forked from clerk/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorganizationDomain.ts
More file actions
42 lines (34 loc) · 1.45 KB
/
Copy pathorganizationDomain.ts
File metadata and controls
42 lines (34 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import type { ClerkResource } from './resource';
export interface OrganizationDomainVerification {
status: OrganizationDomainVerificationStatus;
strategy: 'email_code'; // only available value for now
attempts: number;
expiresAt: Date;
}
export type OrganizationDomainVerificationStatus = 'unverified' | 'verified';
export type OrganizationEnrollmentMode = 'manual_invitation' | 'automatic_invitation' | 'automatic_suggestion';
export interface OrganizationDomainResource extends ClerkResource {
id: string;
name: string;
organizationId: string;
enrollmentMode: OrganizationEnrollmentMode;
verification: OrganizationDomainVerification | null;
createdAt: Date;
updatedAt: Date;
affiliationEmailAddress: string | null;
totalPendingInvitations: number;
totalPendingSuggestions: number;
prepareAffiliationVerification: (params: PrepareAffiliationVerificationParams) => Promise<OrganizationDomainResource>;
attemptAffiliationVerification: (params: AttemptAffiliationVerificationParams) => Promise<OrganizationDomainResource>;
delete: () => Promise<void>;
updateEnrollmentMode: (params: UpdateEnrollmentModeParams) => Promise<OrganizationDomainResource>;
}
export type PrepareAffiliationVerificationParams = {
affiliationEmailAddress: string;
};
export type AttemptAffiliationVerificationParams = {
code: string;
};
export type UpdateEnrollmentModeParams = Pick<OrganizationDomainResource, 'enrollmentMode'> & {
deletePending?: boolean;
};