-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(backend,types): Introduces organization domains CRUD API (#4224)
Co-authored-by: Laura Beatris <48022589+LauraBeatris@users.noreply.github.com>
- Loading branch information
1 parent
4749ed4
commit f1f17ea
Showing
6 changed files
with
131 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@clerk/backend": patch | ||
"@clerk/types": patch | ||
--- | ||
|
||
Introduces the CRUD of organization domains under the `organizations` API. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type { OrganizationDomainJSON, OrganizationEnrollmentMode } from '@clerk/types'; | ||
|
||
import { OrganizationDomainVerification } from './Verification'; | ||
|
||
export class OrganizationDomain { | ||
constructor( | ||
readonly id: string, | ||
readonly organizationId: string, | ||
readonly name: string, | ||
readonly enrollmentMode: OrganizationEnrollmentMode, | ||
readonly verification: OrganizationDomainVerification | null, | ||
readonly totalPendingInvitations: number, | ||
readonly totalPendingSuggestions: number, | ||
readonly createdAt: number, | ||
readonly updatedAt: number, | ||
readonly affiliationEmailAddress: string | null, | ||
) {} | ||
|
||
static fromJSON(data: OrganizationDomainJSON) { | ||
return new OrganizationDomain( | ||
data.id, | ||
data.organization_id, | ||
data.name, | ||
data.enrollment_mode, | ||
data.verification && OrganizationDomainVerification.fromJSON(data.verification), | ||
data.total_pending_invitations, | ||
data.total_pending_suggestions, | ||
data.created_at, | ||
data.updated_at, | ||
data.affiliation_email_address, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,5 @@ export type { | |
WebhookEvent, | ||
WebhookEventType, | ||
} from './Webhooks'; | ||
|
||
export * from './OrganizationDomain'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters