@descope/node-sdk 1.6.2 → 1.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _descope_core_js_sdk from '@descope/core-js-sdk';
2
- import _descope_core_js_sdk__default, { DeliveryMethod, UserResponse, SdkResponse, ExchangeAccessKeyResponse } from '@descope/core-js-sdk';
2
+ import _descope_core_js_sdk__default, { DeliveryMethod, UserResponse, SdkResponse, AccessKeyLoginOptions, ExchangeAccessKeyResponse } from '@descope/core-js-sdk';
3
3
  export { DeliveryMethod, JWTResponse, OAuthProvider, ResponseData, SdkResponse } from '@descope/core-js-sdk';
4
4
  import { JWTHeaderParameters, KeyLike } from 'jose';
5
5
 
@@ -18,7 +18,9 @@ interface AuthenticationInfo {
18
18
  }
19
19
  declare type DeliveryMethodForTestUser = DeliveryMethod | 'Embedded';
20
20
 
21
- /** Represents a tenant association for a User or Access Key. The tenantId is required to denote
21
+ declare type ExpirationUnit = 'minutes' | 'hours' | 'days' | 'weeks';
22
+ /**
23
+ * Represents a tenant association for a User or Access Key. The tenantId is required to denote
22
24
  * which tenant the user or access key belongs to. The roleNames array is an optional list of
23
25
  * roles for the user or access key in this specific tenant.
24
26
  */
@@ -30,6 +32,71 @@ declare type AssociatedTenant = {
30
32
  declare type CreateTenantResponse = {
31
33
  id: string;
32
34
  };
35
+ /**
36
+ * Options to create or update an OIDC application.
37
+ *
38
+ * **Note:** When updating, `id` will be required to perform the operation
39
+ */
40
+ declare type OidcApplicationOptions = {
41
+ name: string;
42
+ loginPageUrl: string;
43
+ id?: string;
44
+ description?: string;
45
+ logo?: string;
46
+ enabled?: boolean;
47
+ };
48
+ /**
49
+ * Options to create or update a SAML application.
50
+ *
51
+ * **Note:** When updating, `id` will be required to perform the operation
52
+ */
53
+ declare type SamlApplicationOptions = {
54
+ name: string;
55
+ loginPageUrl: string;
56
+ id?: string;
57
+ description?: string;
58
+ logo?: string;
59
+ enabled?: boolean;
60
+ useMetadataInfo?: boolean;
61
+ metadataUrl?: string;
62
+ entityId?: string;
63
+ acsUrl?: string;
64
+ certificate?: string;
65
+ attributeMapping?: SamlIdpAttributeMappingInfo[];
66
+ groupsMapping?: SamlIdpGroupsMappingInfo[];
67
+ acsAllowedCallbacks?: string[];
68
+ subjectNameIdType?: string;
69
+ subjectNameIdFormat?: string;
70
+ };
71
+ /**
72
+ * Represents a SAML IDP attribute mapping object. Use this class for mapping Descope attribute
73
+ * to the relevant SAML Assertion attributes matching your expected SP attributes names.
74
+ */
75
+ declare type SamlIdpAttributeMappingInfo = {
76
+ name: string;
77
+ type: string;
78
+ value: string;
79
+ };
80
+ /** Represents a SAML IDP Role Group mapping object. */
81
+ declare type SAMLIDPRoleGroupMappingInfo = {
82
+ id: string;
83
+ name: string;
84
+ };
85
+ /**
86
+ * Represents a SAML IDP groups mapping object. Use this class for mapping Descope roles
87
+ * to the relevant SAML Assertion groups attributes that matching your expected SP groups attributes names.
88
+ */
89
+ declare type SamlIdpGroupsMappingInfo = {
90
+ name: string;
91
+ type: string;
92
+ filterType: string;
93
+ value: string;
94
+ roles: SAMLIDPRoleGroupMappingInfo[];
95
+ };
96
+ /** The ID of a newly created SSO application */
97
+ declare type CreateSSOApplicationResponse = {
98
+ id: string;
99
+ };
33
100
  /** An access key that can be used to access descope */
34
101
  declare type AccessKey = {
35
102
  id: string;
@@ -42,6 +109,7 @@ declare type AccessKey = {
42
109
  expiresTime: number;
43
110
  createdBy: string;
44
111
  clientId: string;
112
+ boundUserId?: string;
45
113
  };
46
114
  /** Access Key extended details including created key cleartext */
47
115
  declare type CreatedAccessKeyResponse = {
@@ -72,6 +140,78 @@ declare type Tenant = {
72
140
  id: string;
73
141
  name: string;
74
142
  selfProvisioningDomains: string[];
143
+ customAttributes?: Record<string, string | number | boolean>;
144
+ domains?: string[];
145
+ authType?: 'none' | 'saml' | 'oidc';
146
+ };
147
+ /** Represents settings of a tenant in a project. It has an id, a name and an array of
148
+ * self provisioning domains used to associate users with that tenant.
149
+ */
150
+ declare type TenantSettings = {
151
+ selfProvisioningDomains: string[];
152
+ domains?: string[];
153
+ authType?: 'none' | 'saml' | 'oidc';
154
+ sessionSettingsEnabled?: boolean;
155
+ refreshTokenExpiration?: number;
156
+ refreshTokenExpirationUnit?: ExpirationUnit;
157
+ sessionTokenExpiration?: number;
158
+ sessionTokenExpirationUnit?: ExpirationUnit;
159
+ stepupTokenExpiration?: number;
160
+ stepupTokenExpirationUnit?: ExpirationUnit;
161
+ enableInactivity?: boolean;
162
+ InactivityTime?: number;
163
+ InactivityTimeUnit?: ExpirationUnit;
164
+ JITDisabled?: boolean;
165
+ };
166
+ /** Represents password settings of a tenant in a project. It has the password policy details. */
167
+ declare type PasswordSettings = {
168
+ enabled: boolean;
169
+ minLength: number;
170
+ lowercase: boolean;
171
+ uppercase: boolean;
172
+ number: boolean;
173
+ nonAlphaNumeric: boolean;
174
+ expiration: boolean;
175
+ expirationWeeks: number;
176
+ reuse: boolean;
177
+ reuseAmount: number;
178
+ lock: boolean;
179
+ lockAttempts: number;
180
+ };
181
+ /** Represents OIDC settings of an SSO application in a project. */
182
+ declare type SSOApplicationOIDCSettings = {
183
+ loginPageUrl: string;
184
+ issuer: string;
185
+ discoveryUrl: string;
186
+ };
187
+ /** Represents SAML settings of an SSO application in a project. */
188
+ declare type SSOApplicationSAMLSettings = {
189
+ loginPageUrl: string;
190
+ idpCert: string;
191
+ useMetadataInfo: boolean;
192
+ metadataUrl: string;
193
+ entityId: string;
194
+ acsUrl: string;
195
+ certificate: string;
196
+ attributeMapping: SamlIdpAttributeMappingInfo[];
197
+ groupsMapping: SamlIdpGroupsMappingInfo[];
198
+ idpMetadataUrl: string;
199
+ idpEntityId: string;
200
+ idpSsoUrl: string;
201
+ acsAllowedCallbacks: string[];
202
+ subjectNameIdType: string;
203
+ subjectNameIdFormat: string;
204
+ };
205
+ /** Represents an SSO application in a project. */
206
+ declare type SSOApplication = {
207
+ id: string;
208
+ name: string;
209
+ description: string;
210
+ enabled: boolean;
211
+ logo: string;
212
+ appType: string;
213
+ samlSettings: SSOApplicationSAMLSettings;
214
+ oidcSettings: SSOApplicationOIDCSettings;
75
215
  };
76
216
  /** Represents a permission in a project. It has a name and optionally a description.
77
217
  * It also has a flag indicating whether it is system default or not.
@@ -89,6 +229,7 @@ declare type Role = {
89
229
  description?: string;
90
230
  permissionNames: string[];
91
231
  createdTime: number;
232
+ tenantId?: string;
92
233
  };
93
234
  /** Represents a group in a project. It has an id and display name and a list of group members. */
94
235
  declare type Group = {
@@ -168,6 +309,34 @@ declare type User = {
168
309
  verifiedPhone?: boolean;
169
310
  test?: boolean;
170
311
  additionalLoginIds?: string[];
312
+ password?: string;
313
+ hashedPassword?: UserPasswordHashed;
314
+ };
315
+ declare type UserPasswordHashed = {
316
+ bcrypt?: UserPasswordBcrypt;
317
+ pbkdf2?: UserPasswordPbkdf2;
318
+ firebase?: UserPasswordFirebase;
319
+ django?: UserPasswordDjango;
320
+ };
321
+ declare type UserPasswordBcrypt = {
322
+ hash: string;
323
+ };
324
+ declare type UserPasswordPbkdf2 = {
325
+ hash: string;
326
+ salt: string;
327
+ iterations: number;
328
+ type: 'sha1' | 'sha256' | 'sha512';
329
+ };
330
+ declare type UserPasswordFirebase = {
331
+ hash: string;
332
+ salt: string;
333
+ saltSeparator: string;
334
+ signerKey: string;
335
+ memory: number;
336
+ rounds: number;
337
+ };
338
+ declare type UserPasswordDjango = {
339
+ hash: string;
171
340
  };
172
341
  declare type UserMapping = {
173
342
  name: string;
@@ -199,6 +368,66 @@ declare type SSOSettingsResponse = {
199
368
  domains: string[];
200
369
  domain: string;
201
370
  };
371
+ declare type SSOSAMLSettingsResponse = {
372
+ idpEntityId: string;
373
+ idpSSOUrl: string;
374
+ idpCertificate: string;
375
+ idpMetadataUrl: string;
376
+ spEntityId: string;
377
+ spACSUrl: string;
378
+ spCertificate: string;
379
+ attributeMapping: AttributeMapping;
380
+ groupsMapping: RoleMappings;
381
+ redirectUrl: string;
382
+ };
383
+ declare type SSOSettings = {
384
+ tenant: Tenant;
385
+ saml?: SSOSAMLSettingsResponse;
386
+ oidc?: SSOOIDCSettings;
387
+ };
388
+ declare type OIDCAttributeMapping = {
389
+ loginId?: string;
390
+ name?: string;
391
+ givenName?: string;
392
+ middleName?: string;
393
+ familyName?: string;
394
+ email?: string;
395
+ verifiedEmail?: string;
396
+ username?: string;
397
+ phoneNumber?: string;
398
+ verifiedPhone?: string;
399
+ picture?: string;
400
+ };
401
+ declare type Prompt = 'none' | 'login' | 'consent' | 'select_account';
402
+ declare type SSOOIDCSettings = {
403
+ name: string;
404
+ clientId: string;
405
+ clientSecret?: string;
406
+ redirectUrl?: string;
407
+ authUrl?: string;
408
+ tokenUrl?: string;
409
+ userDataUrl?: string;
410
+ scope?: string[];
411
+ JWKsUrl?: string;
412
+ attributeMapping?: OIDCAttributeMapping;
413
+ manageProviderTokens?: boolean;
414
+ callbackDomain?: string;
415
+ prompt?: Prompt[];
416
+ grantType?: 'authorization_code' | 'implicit';
417
+ issuer?: string;
418
+ };
419
+ declare type SSOSAMLSettings = {
420
+ idpUrl: string;
421
+ idpCert: string;
422
+ entityId: string;
423
+ roleMappings?: RoleMappings;
424
+ attributeMapping?: AttributeMapping;
425
+ };
426
+ declare type SSOSAMLByMetadataSettings = {
427
+ idpMetadataUrl: string;
428
+ roleMappings?: RoleMappings;
429
+ attributeMapping?: AttributeMapping;
430
+ };
202
431
  declare type ProviderTokenResponse = {
203
432
  provider: string;
204
433
  providerUserId: string;
@@ -324,24 +553,37 @@ declare type AuthzRelationQuery = {
324
553
  target: string;
325
554
  hasRelation?: boolean;
326
555
  };
327
- declare type NewProjectResponse = {
556
+ /**
557
+ * AuthzModified has the list of resources and targets that were modified since given time returned from GetModified
558
+ */
559
+ declare type AuthzModified = {
560
+ resources: string[];
561
+ targets: string[];
562
+ schemaChanged: boolean;
563
+ };
564
+ declare type CloneProjectResponse = {
328
565
  projectId: string;
329
566
  projectName: string;
330
- projectSettingsWeb: Record<string, any>;
331
- authMethodsMagicLink: Record<string, any>;
332
- authMethodsOTP: Record<string, any>;
333
- authMethodsSAML: Record<string, any>;
334
- authMethodsOAuth: Record<string, any>;
335
- authMethodsWebAuthn: Record<string, any>;
336
- authMethodsTOTP: Record<string, any>;
337
- messagingProvidersWeb: Record<string, any>;
338
- authMethodsEnchantedLink: Record<string, any>;
339
- authMethodsPassword: Record<string, any>;
340
- authMethodsOIDCIDP: Record<string, any>;
341
- authMethodsEmbeddedLink: Record<string, any>;
342
567
  tag?: string;
343
568
  };
344
569
 
570
+ interface UserOptions {
571
+ email?: string;
572
+ phone?: string;
573
+ displayName?: string;
574
+ roles?: string[];
575
+ userTenants?: AssociatedTenant[];
576
+ customAttributes?: Record<string, AttributesTypes>;
577
+ picture?: string;
578
+ verifiedEmail?: boolean;
579
+ verifiedPhone?: boolean;
580
+ givenName?: string;
581
+ middleName?: string;
582
+ familyName?: string;
583
+ additionalLoginIds?: string[];
584
+ ssoAppIds?: string[];
585
+ }
586
+
345
587
  /** Common Error Codes */
346
588
  declare const descopeErrors: {
347
589
  badRequest: string;
@@ -363,18 +605,53 @@ declare const nodeSdk: {
363
605
  ({ managementKey, publicKey, ...config }: NodeSdkArgs): {
364
606
  management: {
365
607
  user: {
366
- create: (loginId: string, email?: string, phone?: string, displayName?: string, roles?: string[], userTenants?: AssociatedTenant[], customAttributes?: Record<string, AttributesTypes>, picture?: string, verifiedEmail?: boolean, verifiedPhone?: boolean, givenName?: string, middleName?: string, familyName?: string, additionalLoginIds?: string[]) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
367
- createTestUser: (loginId: string, email?: string, phone?: string, displayName?: string, roles?: string[], userTenants?: AssociatedTenant[], customAttributes?: Record<string, AttributesTypes>, picture?: string, verifiedEmail?: boolean, verifiedPhone?: boolean, givenName?: string, middleName?: string, familyName?: string, additionalLoginIds?: string[]) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
368
- invite: (loginId: string, email?: string, phone?: string, displayName?: string, roles?: string[], userTenants?: AssociatedTenant[], customAttributes?: Record<string, AttributesTypes>, picture?: string, verifiedEmail?: boolean, verifiedPhone?: boolean, inviteUrl?: string, sendMail?: boolean, sendSMS?: boolean, givenName?: string, middleName?: string, familyName?: string, additionalLoginIds?: string[]) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
608
+ create: {
609
+ (loginId: string, options?: UserOptions): Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
610
+ (loginId: string, email?: string, phone?: string, displayName?: string, roles?: string[], userTenants?: AssociatedTenant[], customAttributes?: Record<string, AttributesTypes>, picture?: string, verifiedEmail?: boolean, verifiedPhone?: boolean, givenName?: string, middleName?: string, familyName?: string, additionalLoginIds?: string[]): Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
611
+ };
612
+ createTestUser: {
613
+ (loginId: string, options?: UserOptions): Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
614
+ (loginId: string, email?: string, phone?: string, displayName?: string, roles?: string[], userTenants?: AssociatedTenant[], customAttributes?: Record<string, AttributesTypes>, picture?: string, verifiedEmail?: boolean, verifiedPhone?: boolean, givenName?: string, middleName?: string, familyName?: string, additionalLoginIds?: string[]): Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
615
+ };
616
+ invite: {
617
+ (loginId: string, options?: UserOptions & {
618
+ inviteUrl?: string;
619
+ sendMail?: boolean;
620
+ sendSMS?: boolean;
621
+ }): Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
622
+ (loginId: string, email?: string, phone?: string, displayName?: string, roles?: string[], userTenants?: AssociatedTenant[], customAttributes?: Record<string, AttributesTypes>, picture?: string, verifiedEmail?: boolean, verifiedPhone?: boolean, inviteUrl?: string, sendMail?: boolean, sendSMS?: boolean, givenName?: string, middleName?: string, familyName?: string, additionalLoginIds?: string[]): Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
623
+ };
369
624
  inviteBatch: (users: User[], inviteUrl?: string, sendMail?: boolean, sendSMS?: boolean) => Promise<SdkResponse<InviteBatchResponse>>;
370
- update: (loginId: string, email?: string, phone?: string, displayName?: string, roles?: string[], userTenants?: AssociatedTenant[], customAttributes?: Record<string, AttributesTypes>, picture?: string, verifiedEmail?: boolean, verifiedPhone?: boolean, givenName?: string, middleName?: string, familyName?: string, additionalLoginIds?: string[]) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
625
+ update: {
626
+ (loginId: string, options?: UserOptions): Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
627
+ (loginId: string, email?: string, phone?: string, displayName?: string, roles?: string[], userTenants?: AssociatedTenant[], customAttributes?: Record<string, AttributesTypes>, picture?: string, verifiedEmail?: boolean, verifiedPhone?: boolean, givenName?: string, middleName?: string, familyName?: string, additionalLoginIds?: string[]): Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
628
+ };
371
629
  delete: (loginId: string) => Promise<SdkResponse<never>>;
630
+ deleteByUserId: (userId: string) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
372
631
  deleteAllTestUsers: () => Promise<SdkResponse<never>>;
373
632
  load: (loginId: string) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
374
633
  loadByUserId: (userId: string) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
375
634
  logoutUser: (loginId: string) => Promise<SdkResponse<never>>;
376
635
  logoutUserByUserId: (userId: string) => Promise<SdkResponse<never>>;
377
636
  searchAll: (tenantIds?: string[], roles?: string[], limit?: number, page?: number, testUsersOnly?: boolean, withTestUser?: boolean, customAttributes?: Record<string, AttributesTypes>, statuses?: UserStatus[], emails?: string[], phones?: string[]) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse[]>>;
637
+ search: (searchReq: {
638
+ page?: number;
639
+ limit?: number;
640
+ sort?: {
641
+ field: string;
642
+ desc?: boolean;
643
+ }[];
644
+ text?: string;
645
+ emails?: string[];
646
+ phones?: string[];
647
+ statuses?: UserStatus[];
648
+ roles?: string[];
649
+ tenantIds?: string[];
650
+ customAttributes?: Record<string, AttributesTypes>;
651
+ withTestUser?: boolean;
652
+ testUsersOnly?: boolean;
653
+ ssoAppIds?: string[];
654
+ }) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse[]>>;
378
655
  getProviderToken: (loginId: string, provider: string) => Promise<SdkResponse<ProviderTokenResponse>>;
379
656
  activate: (loginId: string) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
380
657
  deactivate: (loginId: string) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
@@ -392,19 +669,28 @@ declare const nodeSdk: {
392
669
  setTenantRoles: (loginId: string, tenantId: string, roles: string[]) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
393
670
  addTenantRoles: (loginId: string, tenantId: string, roles: string[]) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
394
671
  removeTenantRoles: (loginId: string, tenantId: string, roles: string[]) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
672
+ addSSOapps: (loginId: string, ssoAppIds: string[]) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
673
+ setSSOapps: (loginId: string, ssoAppIds: string[]) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
674
+ removeSSOapps: (loginId: string, ssoAppIds: string[]) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
395
675
  generateOTPForTestUser: (deliveryMethod: DeliveryMethodForTestUser, loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<SdkResponse<GenerateOTPForTestResponse>>;
396
676
  generateMagicLinkForTestUser: (deliveryMethod: DeliveryMethodForTestUser, loginId: string, uri: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<SdkResponse<GenerateMagicLinkForTestResponse>>;
397
677
  generateEnchantedLinkForTestUser: (loginId: string, uri: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<SdkResponse<GenerateEnchantedLinkForTestResponse>>;
398
678
  generateEmbeddedLink: (loginId: string, customClaims?: Record<string, any>) => Promise<SdkResponse<GenerateEmbeddedLinkResponse>>;
679
+ setTemporaryPassword: (loginId: string, password: string) => Promise<SdkResponse<never>>;
680
+ setActivePassword: (loginId: string, password: string) => Promise<SdkResponse<never>>;
399
681
  setPassword: (loginId: string, password: string) => Promise<SdkResponse<never>>;
400
682
  expirePassword: (loginId: string) => Promise<SdkResponse<never>>;
683
+ removeAllPasskeys: (loginId: string) => Promise<SdkResponse<never>>;
684
+ history: (userIds: string[]) => Promise<SdkResponse<_descope_core_js_sdk.UserHistoryResponse[]>>;
401
685
  };
402
686
  project: {
403
687
  updateName: (name: string) => Promise<SdkResponse<never>>;
404
- clone: (name: string, tag?: "production") => Promise<SdkResponse<NewProjectResponse>>;
688
+ clone: (name: string, tag?: "production") => Promise<SdkResponse<CloneProjectResponse>>;
689
+ export: () => Promise<SdkResponse<Record<string, any>>>;
690
+ import: (files: Record<string, any>) => Promise<SdkResponse<never>>;
405
691
  };
406
692
  accessKey: {
407
- create: (name: string, expireTime: number, roles?: string[], keyTenants?: AssociatedTenant[]) => Promise<SdkResponse<CreatedAccessKeyResponse>>;
693
+ create: (name: string, expireTime: number, roles?: string[], keyTenants?: AssociatedTenant[], userId?: string) => Promise<SdkResponse<CreatedAccessKeyResponse>>;
408
694
  load: (id: string) => Promise<SdkResponse<AccessKey>>;
409
695
  searchAll: (tenantIds?: string[]) => Promise<SdkResponse<AccessKey[]>>;
410
696
  update: (id: string, name: string) => Promise<SdkResponse<AccessKey>>;
@@ -420,6 +706,21 @@ declare const nodeSdk: {
420
706
  load: (id: string) => Promise<SdkResponse<Tenant>>;
421
707
  loadAll: () => Promise<SdkResponse<Tenant[]>>;
422
708
  searchAll: (ids?: string[], names?: string[], selfProvisioningDomains?: string[], customAttributes?: Record<string, AttributesTypes>) => Promise<SdkResponse<Tenant[]>>;
709
+ getSettings: (tenantId: string) => Promise<SdkResponse<TenantSettings>>;
710
+ configureSettings: (tenantId: string, settings: TenantSettings) => Promise<SdkResponse<never>>;
711
+ };
712
+ ssoApplication: {
713
+ createOidcApplication: (options: OidcApplicationOptions) => Promise<SdkResponse<CreateSSOApplicationResponse>>;
714
+ createSamlApplication: (options: SamlApplicationOptions) => Promise<SdkResponse<CreateSSOApplicationResponse>>;
715
+ updateOidcApplication: (options: OidcApplicationOptions & {
716
+ id: string;
717
+ }) => Promise<SdkResponse<never>>;
718
+ updateSamlApplication: (options: SamlApplicationOptions & {
719
+ id: string;
720
+ }) => Promise<SdkResponse<never>>;
721
+ delete: (id: string) => Promise<SdkResponse<never>>;
722
+ load: (id: string) => Promise<SdkResponse<SSOApplication>>;
723
+ loadAll: () => Promise<SdkResponse<SSOApplication[]>>;
423
724
  };
424
725
  sso: {
425
726
  getSettings: (tenantId: string) => Promise<SdkResponse<SSOSettingsResponse>>;
@@ -427,9 +728,14 @@ declare const nodeSdk: {
427
728
  configureSettings: (tenantId: string, idpURL: string, idpCert: string, entityId: string, redirectURL: string, domains: string[]) => Promise<SdkResponse<never>>;
428
729
  configureMetadata: (tenantId: string, idpMetadataURL: string, redirectURL: string, domains: string[]) => Promise<SdkResponse<never>>;
429
730
  configureMapping: (tenantId: string, roleMappings?: RoleMappings, attributeMapping?: AttributeMapping) => Promise<SdkResponse<never>>;
731
+ configureOIDCSettings: (tenantId: string, settings: SSOOIDCSettings, domains?: string[]) => Promise<SdkResponse<never>>;
732
+ configureSAMLSettings: (tenantId: string, settings: SSOSAMLSettings, redirectUrl?: string, domains?: string[]) => Promise<SdkResponse<never>>;
733
+ configureSAMLByMetadata: (tenantId: string, settings: SSOSAMLByMetadataSettings, redirectUrl?: string, domains?: string[]) => Promise<SdkResponse<never>>;
734
+ loadSettings: (tenantId: string) => Promise<SdkResponse<SSOSettings>>;
430
735
  };
431
736
  jwt: {
432
737
  update: (jwt: string, customClaims?: Record<string, any>) => Promise<SdkResponse<UpdateJWTResponse>>;
738
+ impersonate: (impersonatorId: string, loginId: string, validateConsent: boolean) => Promise<SdkResponse<UpdateJWTResponse>>;
433
739
  };
434
740
  permission: {
435
741
  create: (name: string, description?: string) => Promise<SdkResponse<never>>;
@@ -437,10 +743,14 @@ declare const nodeSdk: {
437
743
  delete: (name: string) => Promise<SdkResponse<never>>;
438
744
  loadAll: () => Promise<SdkResponse<Permission[]>>;
439
745
  };
746
+ password: {
747
+ getSettings: (tenantId: string) => Promise<SdkResponse<PasswordSettings>>;
748
+ configureSettings: (tenantId: string, settings: PasswordSettings) => Promise<SdkResponse<never>>;
749
+ };
440
750
  role: {
441
- create: (name: string, description?: string, permissionNames?: string[]) => Promise<SdkResponse<never>>;
442
- update: (name: string, newName: string, description?: string, permissionNames?: string[]) => Promise<SdkResponse<never>>;
443
- delete: (name: string) => Promise<SdkResponse<never>>;
751
+ create: (name: string, description?: string, permissionNames?: string[], tenantId?: string) => Promise<SdkResponse<never>>;
752
+ update: (name: string, newName: string, description?: string, permissionNames?: string[], tenantId?: string) => Promise<SdkResponse<never>>;
753
+ delete: (name: string, tenantId?: string) => Promise<SdkResponse<never>>;
444
754
  loadAll: () => Promise<SdkResponse<Role[]>>;
445
755
  };
446
756
  group: {
@@ -450,6 +760,7 @@ declare const nodeSdk: {
450
760
  };
451
761
  flow: {
452
762
  list: () => Promise<SdkResponse<FlowsResponse>>;
763
+ delete: (flowIds: string[]) => Promise<SdkResponse<never>>;
453
764
  export: (flowId: string) => Promise<SdkResponse<FlowResponse>>;
454
765
  import: (flowId: string, flow: Flow, screens?: Screen[]) => Promise<SdkResponse<FlowResponse>>;
455
766
  };
@@ -476,6 +787,7 @@ declare const nodeSdk: {
476
787
  resourceRelations: (resource: string) => Promise<SdkResponse<AuthzRelation[]>>;
477
788
  targetsRelations: (targets: string[]) => Promise<SdkResponse<AuthzRelation[]>>;
478
789
  whatCanTargetAccess: (target: string) => Promise<SdkResponse<AuthzRelation[]>>;
790
+ getModified: (since: Date) => Promise<SdkResponse<AuthzModified>>;
479
791
  };
480
792
  };
481
793
  getKey: (header: JWTHeaderParameters) => Promise<KeyLike | Uint8Array>;
@@ -483,7 +795,7 @@ declare const nodeSdk: {
483
795
  validateSession: (sessionToken: string) => Promise<AuthenticationInfo>;
484
796
  refreshSession: (refreshToken: string) => Promise<AuthenticationInfo>;
485
797
  validateAndRefreshSession: (sessionToken?: string, refreshToken?: string) => Promise<AuthenticationInfo>;
486
- exchangeAccessKey: (accessKey: string) => Promise<AuthenticationInfo>;
798
+ exchangeAccessKey: (accessKey: string, loginOptions?: AccessKeyLoginOptions) => Promise<AuthenticationInfo>;
487
799
  validatePermissions: (authInfo: AuthenticationInfo, permissions: string[]) => boolean;
488
800
  getMatchedPermissions: (authInfo: AuthenticationInfo, permissions: string[]) => string[];
489
801
  validateTenantPermissions: (authInfo: AuthenticationInfo, tenant: string, permissions: string[]) => boolean;
@@ -493,7 +805,7 @@ declare const nodeSdk: {
493
805
  validateTenantRoles: (authInfo: AuthenticationInfo, tenant: string, roles: string[]) => boolean;
494
806
  getMatchedTenantRoles: (authInfo: AuthenticationInfo, tenant: string, roles: string[]) => string[];
495
807
  accessKey: {
496
- exchange: (accessKey: string) => Promise<SdkResponse<ExchangeAccessKeyResponse>>;
808
+ exchange: (accessKey: string, loginOptions?: AccessKeyLoginOptions) => Promise<SdkResponse<ExchangeAccessKeyResponse>>;
497
809
  };
498
810
  otp: {
499
811
  verify: {
@@ -511,13 +823,13 @@ declare const nodeSdk: {
511
823
  }>>;
512
824
  };
513
825
  signIn: {
514
- sms: (loginId: string) => Promise<SdkResponse<{
826
+ sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<SdkResponse<{
515
827
  maskedPhone: string;
516
828
  }>>;
517
- whatsapp: (loginId: string) => Promise<SdkResponse<{
829
+ whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<SdkResponse<{
518
830
  maskedPhone: string;
519
831
  }>>;
520
- email: (loginId: string) => Promise<SdkResponse<{
832
+ email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<SdkResponse<{
521
833
  maskedEmail: string;
522
834
  }>>;
523
835
  };
@@ -529,6 +841,11 @@ declare const nodeSdk: {
529
841
  middleName?: string;
530
842
  familyName?: string;
531
843
  phone?: string;
844
+ }, signUpOptions?: {
845
+ customClaims?: Record<string, any>;
846
+ templateOptions?: {
847
+ [x: string]: string;
848
+ };
532
849
  }) => Promise<SdkResponse<{
533
850
  maskedPhone: string;
534
851
  }>>;
@@ -539,6 +856,11 @@ declare const nodeSdk: {
539
856
  middleName?: string;
540
857
  familyName?: string;
541
858
  phone?: string;
859
+ }, signUpOptions?: {
860
+ customClaims?: Record<string, any>;
861
+ templateOptions?: {
862
+ [x: string]: string;
863
+ };
542
864
  }) => Promise<SdkResponse<{
543
865
  maskedPhone: string;
544
866
  }>>;
@@ -549,18 +871,23 @@ declare const nodeSdk: {
549
871
  middleName?: string;
550
872
  familyName?: string;
551
873
  phone?: string;
874
+ }, signUpOptions?: {
875
+ customClaims?: Record<string, any>;
876
+ templateOptions?: {
877
+ [x: string]: string;
878
+ };
552
879
  }) => Promise<SdkResponse<{
553
880
  maskedEmail: string;
554
881
  }>>;
555
882
  };
556
883
  signUpOrIn: {
557
- sms: (loginId: string) => Promise<SdkResponse<{
884
+ sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<SdkResponse<{
558
885
  maskedPhone: string;
559
886
  }>>;
560
- whatsapp: (loginId: string) => Promise<SdkResponse<{
887
+ whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<SdkResponse<{
561
888
  maskedPhone: string;
562
889
  }>>;
563
- email: (loginId: string) => Promise<SdkResponse<{
890
+ email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<SdkResponse<{
564
891
  maskedEmail: string;
565
892
  }>>;
566
893
  };
@@ -568,6 +895,9 @@ declare const nodeSdk: {
568
895
  email: <T extends boolean>(loginId: string, email: string, token?: string, updateOptions?: {
569
896
  addToLoginIDs?: T;
570
897
  onMergeUseExisting?: T extends true ? boolean : never;
898
+ templateOptions?: {
899
+ [x: string]: string;
900
+ };
571
901
  }) => Promise<SdkResponse<{
572
902
  maskedEmail: string;
573
903
  }>>;
@@ -575,12 +905,18 @@ declare const nodeSdk: {
575
905
  sms: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
576
906
  addToLoginIDs?: T_1;
577
907
  onMergeUseExisting?: T_1 extends true ? boolean : never;
908
+ templateOptions?: {
909
+ [x: string]: string;
910
+ };
578
911
  }) => Promise<SdkResponse<{
579
912
  maskedPhone: string;
580
913
  }>>;
581
914
  whatsapp: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
582
915
  addToLoginIDs?: T_1;
583
916
  onMergeUseExisting?: T_1 extends true ? boolean : never;
917
+ templateOptions?: {
918
+ [x: string]: string;
919
+ };
584
920
  }) => Promise<SdkResponse<{
585
921
  maskedPhone: string;
586
922
  }>>;
@@ -593,56 +929,86 @@ declare const nodeSdk: {
593
929
  cookies?: string[];
594
930
  }>>;
595
931
  signIn: {
596
- sms: (loginId: string, uri: string) => Promise<SdkResponse<{
932
+ sms: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<SdkResponse<{
597
933
  maskedPhone: string;
598
934
  }>>;
599
- whatsapp: (loginId: string, uri: string) => Promise<SdkResponse<{
935
+ whatsapp: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<SdkResponse<{
600
936
  maskedPhone: string;
601
937
  }>>;
602
- email: (loginId: string, uri: string) => Promise<SdkResponse<{
938
+ email: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<SdkResponse<{
603
939
  maskedEmail: string;
604
940
  }>>;
605
941
  };
606
942
  signUp: {
607
- sms: (loginId: string, uri: string, user?: {
943
+ sms: (loginId: string, URI: string, user?: {
608
944
  email?: string;
609
945
  name?: string;
610
946
  givenName?: string;
611
947
  middleName?: string;
612
948
  familyName?: string;
613
949
  phone?: string;
950
+ }, signUpOptions?: {
951
+ customClaims?: Record<string, any>;
952
+ templateOptions?: {
953
+ [x: string]: string;
954
+ };
614
955
  }) => Promise<SdkResponse<{
615
956
  maskedPhone: string;
616
957
  }>>;
617
- whatsapp: (loginId: string, uri: string, user?: {
958
+ whatsapp: (loginId: string, URI: string, user?: {
618
959
  email?: string;
619
960
  name?: string;
620
961
  givenName?: string;
621
962
  middleName?: string;
622
963
  familyName?: string;
623
964
  phone?: string;
965
+ }, signUpOptions?: {
966
+ customClaims?: Record<string, any>;
967
+ templateOptions?: {
968
+ [x: string]: string;
969
+ };
624
970
  }) => Promise<SdkResponse<{
625
971
  maskedPhone: string;
626
972
  }>>;
627
- email: (loginId: string, uri: string, user?: {
973
+ email: (loginId: string, URI: string, user?: {
628
974
  email?: string;
629
975
  name?: string;
630
976
  givenName?: string;
631
977
  middleName?: string;
632
978
  familyName?: string;
633
979
  phone?: string;
980
+ }, signUpOptions?: {
981
+ customClaims?: Record<string, any>;
982
+ templateOptions?: {
983
+ [x: string]: string;
984
+ };
634
985
  }) => Promise<SdkResponse<{
635
986
  maskedEmail: string;
636
987
  }>>;
637
988
  };
638
989
  signUpOrIn: {
639
- sms: (loginId: string, uri: string) => Promise<SdkResponse<{
990
+ sms: (loginId: string, URI?: string, signUpOptions?: {
991
+ customClaims?: Record<string, any>;
992
+ templateOptions?: {
993
+ [x: string]: string;
994
+ };
995
+ }) => Promise<SdkResponse<{
640
996
  maskedPhone: string;
641
997
  }>>;
642
- whatsapp: (loginId: string, uri: string) => Promise<SdkResponse<{
998
+ whatsapp: (loginId: string, URI?: string, signUpOptions?: {
999
+ customClaims?: Record<string, any>;
1000
+ templateOptions?: {
1001
+ [x: string]: string;
1002
+ };
1003
+ }) => Promise<SdkResponse<{
643
1004
  maskedPhone: string;
644
1005
  }>>;
645
- email: (loginId: string, uri: string) => Promise<SdkResponse<{
1006
+ email: (loginId: string, URI?: string, signUpOptions?: {
1007
+ customClaims?: Record<string, any>;
1008
+ templateOptions?: {
1009
+ [x: string]: string;
1010
+ };
1011
+ }) => Promise<SdkResponse<{
646
1012
  maskedEmail: string;
647
1013
  }>>;
648
1014
  };
@@ -650,6 +1016,9 @@ declare const nodeSdk: {
650
1016
  email: <T_2 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
651
1017
  addToLoginIDs?: T_2;
652
1018
  onMergeUseExisting?: T_2 extends true ? boolean : never;
1019
+ templateOptions?: {
1020
+ [x: string]: string;
1021
+ };
653
1022
  }) => Promise<SdkResponse<{
654
1023
  maskedEmail: string;
655
1024
  }>>;
@@ -657,12 +1026,18 @@ declare const nodeSdk: {
657
1026
  sms: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
658
1027
  addToLoginIDs?: T_3;
659
1028
  onMergeUseExisting?: T_3 extends true ? boolean : never;
1029
+ templateOptions?: {
1030
+ [x: string]: string;
1031
+ };
660
1032
  }) => Promise<SdkResponse<{
661
1033
  maskedPhone: string;
662
1034
  }>>;
663
1035
  whatsapp: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
664
1036
  addToLoginIDs?: T_3;
665
1037
  onMergeUseExisting?: T_3 extends true ? boolean : never;
1038
+ templateOptions?: {
1039
+ [x: string]: string;
1040
+ };
666
1041
  }) => Promise<SdkResponse<{
667
1042
  maskedPhone: string;
668
1043
  }>>;
@@ -671,18 +1046,28 @@ declare const nodeSdk: {
671
1046
  };
672
1047
  enchantedLink: {
673
1048
  verify: (token: string) => Promise<SdkResponse<never>>;
674
- signIn: (loginId: string, uri: string) => Promise<SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse & {
1049
+ signIn: (loginId: string, URI?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse & {
675
1050
  refreshJwt?: string;
676
1051
  cookies?: string[];
677
1052
  }>>;
678
- signUpOrIn: (loginId: string, uri: string) => Promise<SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
679
- signUp: (loginId: string, uri: string, user?: {
1053
+ signUpOrIn: (loginId: string, URI?: string, signUpOptions?: {
1054
+ customClaims?: Record<string, any>;
1055
+ templateOptions?: {
1056
+ [x: string]: string;
1057
+ };
1058
+ }) => Promise<SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
1059
+ signUp: (loginId: string, URI?: string, user?: {
680
1060
  email?: string;
681
1061
  name?: string;
682
1062
  givenName?: string;
683
1063
  middleName?: string;
684
1064
  familyName?: string;
685
1065
  phone?: string;
1066
+ }, signUpOptions?: {
1067
+ customClaims?: Record<string, any>;
1068
+ templateOptions?: {
1069
+ [x: string]: string;
1070
+ };
686
1071
  }) => Promise<SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse & {
687
1072
  refreshJwt?: string;
688
1073
  cookies?: string[];
@@ -695,6 +1080,9 @@ declare const nodeSdk: {
695
1080
  email: <T_4 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
696
1081
  addToLoginIDs?: T_4;
697
1082
  onMergeUseExisting?: T_4 extends true ? boolean : never;
1083
+ templateOptions?: {
1084
+ [x: string]: string;
1085
+ };
698
1086
  }) => Promise<SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
699
1087
  };
700
1088
  };
@@ -714,6 +1102,8 @@ declare const nodeSdk: {
714
1102
  refreshJwt?: string;
715
1103
  cookies?: string[];
716
1104
  }>>;
1105
+ startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<SdkResponse<_descope_core_js_sdk.ResponseData>>;
1106
+ finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<SdkResponse<_descope_core_js_sdk.ResponseData>>;
717
1107
  };
718
1108
  saml: {
719
1109
  start: (tenantIdOrEmail: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<SdkResponse<_descope_core_js_sdk.URLResponse>>;
@@ -786,7 +1176,9 @@ declare const nodeSdk: {
786
1176
  phone?: string;
787
1177
  }) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse>>;
788
1178
  signIn: (loginId: string, password: string) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse>>;
789
- sendReset: (loginId: string, redirectUrl?: string) => Promise<SdkResponse<{
1179
+ sendReset: (loginId: string, redirectUrl?: string, templateOptions?: {
1180
+ [x: string]: string;
1181
+ }) => Promise<SdkResponse<{
790
1182
  resetMethod: string;
791
1183
  pendingRef?: string;
792
1184
  linkId?: string;
@@ -811,7 +1203,7 @@ declare const nodeSdk: {
811
1203
  webAuthnSupport?: boolean;
812
1204
  };
813
1205
  lastAuth?: {
814
- authMethod?: "otp" | "oauth" | "saml" | "totp" | "webauthn" | "magiclink" | "enchantedlink";
1206
+ authMethod?: "saml" | "otp" | "oauth" | "totp" | "webauthn" | "magiclink" | "enchantedlink";
815
1207
  oauthProvider?: string;
816
1208
  name?: string;
817
1209
  loginId?: string;
@@ -825,6 +1217,7 @@ declare const nodeSdk: {
825
1217
  samlIdpStateId?: string;
826
1218
  samlIdpUsername?: string;
827
1219
  ssoAppId?: string;
1220
+ oidcLoginHint?: string;
828
1221
  abTestingKey?: number;
829
1222
  startOptionsVersion?: number;
830
1223
  client?: Record<string, any>;
@@ -843,6 +1236,7 @@ declare const nodeSdk: {
843
1236
  logout: (token?: string) => Promise<SdkResponse<never>>;
844
1237
  logoutAll: (token?: string) => Promise<SdkResponse<never>>;
845
1238
  me: (token?: string) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
1239
+ history: (token?: string) => Promise<SdkResponse<_descope_core_js_sdk.UserHistoryResponse>>;
846
1240
  isJwtExpired: (token: string) => boolean;
847
1241
  getTenants: (token: string) => string[];
848
1242
  getJwtPermissions: (token: string, tenant?: string) => string[];