@descope/node-sdk 1.7.7 → 1.7.9

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, LoginOptions, SdkResponse, AccessKeyLoginOptions, ExchangeAccessKeyResponse } from '@descope/core-js-sdk';
2
+ import _descope_core_js_sdk__default, { DeliveryMethod, UserResponse, LoginOptions, SdkResponse, JWTResponse, 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
 
@@ -16,6 +16,9 @@ interface AuthenticationInfo {
16
16
  token: Token;
17
17
  cookies?: string[];
18
18
  }
19
+ interface RefreshAuthenticationInfo extends AuthenticationInfo {
20
+ refreshJwt?: string;
21
+ }
19
22
  declare type DeliveryMethodForTestUser = DeliveryMethod | 'Embedded';
20
23
 
21
24
  declare type ExpirationUnit = 'minutes' | 'hours' | 'days' | 'weeks';
@@ -158,7 +161,7 @@ declare type Tenant = {
158
161
  name: string;
159
162
  selfProvisioningDomains: string[];
160
163
  createdTime: number;
161
- customAttributes?: Record<string, string | number | boolean>;
164
+ customAttributes?: Record<string, string | number | boolean | string[]>;
162
165
  domains?: string[];
163
166
  authType?: 'none' | 'saml' | 'oidc';
164
167
  enforceSSO?: boolean;
@@ -329,7 +332,7 @@ declare type GenerateEnchantedLinkForTestResponse = {
329
332
  declare type GenerateEmbeddedLinkResponse = {
330
333
  token: string;
331
334
  };
332
- declare type AttributesTypes = string | boolean | number;
335
+ declare type AttributesTypes = string | boolean | number | string[];
333
336
  declare type TemplateOptions = Record<string, string>;
334
337
  declare type User = {
335
338
  loginId: string;
@@ -499,7 +502,7 @@ declare type UserFailedResponse = {
499
502
  failure: string;
500
503
  user: UserResponse;
501
504
  };
502
- declare type InviteBatchResponse = {
505
+ declare type CreateOrInviteBatchResponse = {
503
506
  createdUsers: UserResponse[];
504
507
  failedUsers: UserFailedResponse[];
505
508
  additionalErrors: Record<string, string>;
@@ -807,6 +810,51 @@ declare type InboundApplicationConsentDeleteOptions = {
807
810
  appId?: string;
808
811
  userIds?: string[];
809
812
  };
813
+ declare type PromptType = 'none' | 'login' | 'consent' | 'select_account';
814
+ declare type AccessType = 'offline' | 'online';
815
+ declare type OutboundApplication = {
816
+ id: string;
817
+ name: string;
818
+ description?: string;
819
+ clientId?: string;
820
+ logo?: string;
821
+ discoveryUrl?: string;
822
+ authorizationUrl?: string;
823
+ authorizationUrlParams?: URLParam[];
824
+ tokenUrl?: string;
825
+ tokenUrlParams?: URLParam[];
826
+ revocationUrl?: string;
827
+ defaultScopes?: string[];
828
+ defaultRedirectUrl?: string;
829
+ callbackDomain?: string;
830
+ pkce?: boolean;
831
+ accessType?: AccessType;
832
+ prompt?: Array<PromptType>;
833
+ };
834
+ declare type URLParam = {
835
+ key: string;
836
+ value: string;
837
+ };
838
+ declare type FetchOutboundAppTokenOptions = {
839
+ withRefreshToken?: boolean;
840
+ forceRefresh?: boolean;
841
+ };
842
+ declare type OutboundAppToken = {
843
+ id: string;
844
+ appId: string;
845
+ userId: string;
846
+ tenantId?: string;
847
+ accessToken: string;
848
+ accessTokenExpiry?: number;
849
+ refreshToken?: string;
850
+ hasRefreshToken?: boolean;
851
+ scopes?: string[];
852
+ grantedBy?: string;
853
+ };
854
+ declare type ManagementFlowOptions = {
855
+ input?: Record<string, any>;
856
+ preview?: boolean;
857
+ };
810
858
 
811
859
  interface PatchUserOptions {
812
860
  email?: string;
@@ -832,7 +880,7 @@ declare type NodeSdkArgs = Parameters<typeof _descope_core_js_sdk__default>[0] &
832
880
  };
833
881
  declare const nodeSdk: {
834
882
  ({ managementKey, publicKey, ...config }: NodeSdkArgs): {
835
- refresh: (token?: string) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse & {
883
+ refresh: (token?: string) => Promise<SdkResponse<JWTResponse & {
836
884
  refreshJwt?: string;
837
885
  cookies?: string[];
838
886
  }>>;
@@ -856,7 +904,8 @@ declare const nodeSdk: {
856
904
  }): Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
857
905
  (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[], templateId?: string): Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
858
906
  };
859
- inviteBatch: (users: User[], inviteUrl?: string, sendMail?: boolean, sendSMS?: boolean, templateOptions?: TemplateOptions, templateId?: string) => Promise<SdkResponse<InviteBatchResponse>>;
907
+ inviteBatch: (users: User[], inviteUrl?: string, sendMail?: boolean, sendSMS?: boolean, templateOptions?: TemplateOptions, templateId?: string) => Promise<SdkResponse<CreateOrInviteBatchResponse>>;
908
+ createBatch: (users: User[]) => Promise<SdkResponse<CreateOrInviteBatchResponse>>;
860
909
  update: {
861
910
  (loginId: string, options?: UserOptions): Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
862
911
  (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>>;
@@ -893,6 +942,8 @@ declare const nodeSdk: {
893
942
  toCreatedTime?: number;
894
943
  fromModifiedTime?: number;
895
944
  toModifiedTime?: number;
945
+ tenantRoleIds?: Record<string, string[]>;
946
+ tenantRoleNames?: Record<string, string[]>;
896
947
  }) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse[]>>;
897
948
  search: (searchReq: {
898
949
  page?: number;
@@ -917,6 +968,8 @@ declare const nodeSdk: {
917
968
  toCreatedTime?: number;
918
969
  fromModifiedTime?: number;
919
970
  toModifiedTime?: number;
971
+ tenantRoleIds?: Record<string, string[]>;
972
+ tenantRoleNames?: Record<string, string[]>;
920
973
  }) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse[]>>;
921
974
  getProviderToken: (loginId: string, provider: string, providerTokenOptions?: ProviderTokenOptions) => Promise<SdkResponse<ProviderTokenResponse>>;
922
975
  activate: (loginId: string) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
@@ -1019,6 +1072,21 @@ declare const nodeSdk: {
1019
1072
  searchConsents: (options?: InboundApplicationConsentSearchOptions) => Promise<SdkResponse<InboundApplicationConsent[]>>;
1020
1073
  deleteConsents: (options: InboundApplicationConsentDeleteOptions) => Promise<SdkResponse<never>>;
1021
1074
  };
1075
+ outboundApplication: {
1076
+ createApplication: (app: Omit<OutboundApplication, "id"> & Partial<Pick<OutboundApplication, "id">> & {
1077
+ clientSecret?: string;
1078
+ }) => Promise<SdkResponse<OutboundApplication>>;
1079
+ updateApplication: (app: OutboundApplication & {
1080
+ clientSecret?: string;
1081
+ }) => Promise<SdkResponse<OutboundApplication>>;
1082
+ deleteApplication: (id: string) => Promise<SdkResponse<never>>;
1083
+ loadApplication: (id: string) => Promise<SdkResponse<OutboundApplication>>;
1084
+ loadAllApplications: () => Promise<SdkResponse<OutboundApplication[]>>;
1085
+ fetchTokenByScopes: (appId: string, userId: string, scopes: string[], options?: FetchOutboundAppTokenOptions, tenantId?: string) => Promise<SdkResponse<OutboundAppToken>>;
1086
+ fetchToken: (appId: string, userId: string, tenantId?: string, options?: FetchOutboundAppTokenOptions) => Promise<SdkResponse<OutboundAppToken>>;
1087
+ fetchTenantTokenByScopes: (appId: string, tenantId: string, scopes: string[], options?: FetchOutboundAppTokenOptions) => Promise<SdkResponse<OutboundAppToken>>;
1088
+ fetchTenantToken: (appId: string, tenantId: string, options?: FetchOutboundAppTokenOptions) => Promise<SdkResponse<OutboundAppToken>>;
1089
+ };
1022
1090
  sso: {
1023
1091
  getSettings: (tenantId: string) => Promise<SdkResponse<SSOSettingsResponse>>;
1024
1092
  newSettings: (tenantId: string, ssoId: string, displayName: string) => Promise<SdkResponse<SSOSettings>>;
@@ -1036,9 +1104,9 @@ declare const nodeSdk: {
1036
1104
  update: (jwt: string, customClaims?: Record<string, any>, refreshDuration?: number) => Promise<SdkResponse<UpdateJWTResponse>>;
1037
1105
  impersonate: (impersonatorId: string, loginId: string, validateConsent: boolean, customClaims?: Record<string, any>, selectedTenant?: string, refreshDuration?: number) => Promise<SdkResponse<UpdateJWTResponse>>;
1038
1106
  stopImpersonation: (jwt: string, customClaims?: Record<string, any>, selectedTenant?: string, refreshDuration?: number) => Promise<SdkResponse<UpdateJWTResponse>>;
1039
- signIn: (loginId: string, loginOptions?: MgmtLoginOptions) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1040
- signUp: (loginId: string, user?: MgmtUserOptions, signUpOptions?: MgmtSignUpOptions) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1041
- signUpOrIn: (loginId: string, user?: MgmtUserOptions, signUpOptions?: MgmtSignUpOptions) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1107
+ signIn: (loginId: string, loginOptions?: MgmtLoginOptions) => Promise<SdkResponse<JWTResponse>>;
1108
+ signUp: (loginId: string, user?: MgmtUserOptions, signUpOptions?: MgmtSignUpOptions) => Promise<SdkResponse<JWTResponse>>;
1109
+ signUpOrIn: (loginId: string, user?: MgmtUserOptions, signUpOptions?: MgmtSignUpOptions) => Promise<SdkResponse<JWTResponse>>;
1042
1110
  anonymous: (customClaims?: Record<string, any>, selectedTenant?: string, refreshDuration?: number) => Promise<SdkResponse<{
1043
1111
  refreshJwt?: string;
1044
1112
  cookieDomain?: string;
@@ -1071,11 +1139,14 @@ declare const nodeSdk: {
1071
1139
  loadAllGroupsForMember: (tenantId: string, userIds: string[], loginIds: string[]) => Promise<SdkResponse<Group[]>>;
1072
1140
  loadAllGroupMembers: (tenantId: string, groupId: string) => Promise<SdkResponse<Group[]>>;
1073
1141
  };
1142
+ /** Fetch the public keys (JWKs) from Descope for the configured project */
1074
1143
  flow: {
1075
1144
  list: () => Promise<SdkResponse<FlowsResponse>>;
1076
1145
  delete: (flowIds: string[]) => Promise<SdkResponse<never>>;
1077
1146
  export: (flowId: string) => Promise<SdkResponse<FlowResponse>>;
1147
+ /** Configuration arguments which include the Descope core SDK args and an optional management key */
1078
1148
  import: (flowId: string, flow: Flow, screens?: Screen[]) => Promise<SdkResponse<FlowResponse>>;
1149
+ run: (flowId: string, options?: ManagementFlowOptions) => Promise<SdkResponse<Record<string, any>>>;
1079
1150
  };
1080
1151
  theme: {
1081
1152
  export: () => Promise<SdkResponse<ThemeResponse>>;
@@ -1098,7 +1169,12 @@ declare const nodeSdk: {
1098
1169
  deleteRelationsForResources: (resources: string[]) => Promise<SdkResponse<never>>;
1099
1170
  deleteResourceRelationsForResources: (resources: string[]) => Promise<SdkResponse<never>>;
1100
1171
  deleteRelationsForIds: (ids: string[]) => Promise<SdkResponse<never>>;
1101
- hasRelations: (relationQueries: AuthzRelationQuery[]) => Promise<SdkResponse<AuthzRelationQuery[]>>;
1172
+ hasRelations: (relationQueries: AuthzRelationQuery[]) => Promise<SdkResponse<AuthzRelationQuery[]>>; /**
1173
+ * Validate session and refresh it if it expired
1174
+ * @param sessionToken session JWT
1175
+ * @param refreshToken refresh JWT
1176
+ * @returns RefreshAuthenticationInfo promise or throws Error if there is an issue with JWTs
1177
+ */
1102
1178
  whoCanAccess: (resource: string, relationDefinition: string, namespace: string) => Promise<SdkResponse<string[]>>;
1103
1179
  resourceRelations: (resource: string, ignoreTargetSetRelations?: boolean) => Promise<SdkResponse<AuthzRelation[]>>;
1104
1180
  targetsRelations: (targets: string[], includeTargetSetRelations?: boolean) => Promise<SdkResponse<AuthzRelation[]>>;
@@ -1120,8 +1196,8 @@ declare const nodeSdk: {
1120
1196
  getKey: (header: JWTHeaderParameters) => Promise<KeyLike | Uint8Array>;
1121
1197
  validateJwt: (jwt: string) => Promise<AuthenticationInfo>;
1122
1198
  validateSession: (sessionToken: string) => Promise<AuthenticationInfo>;
1123
- refreshSession: (refreshToken: string) => Promise<AuthenticationInfo>;
1124
- validateAndRefreshSession: (sessionToken?: string, refreshToken?: string) => Promise<AuthenticationInfo>;
1199
+ refreshSession: (refreshToken: string) => Promise<RefreshAuthenticationInfo>;
1200
+ validateAndRefreshSession: (sessionToken?: string, refreshToken?: string) => Promise<RefreshAuthenticationInfo>;
1125
1201
  exchangeAccessKey: (accessKey: string, loginOptions?: AccessKeyLoginOptions) => Promise<AuthenticationInfo>;
1126
1202
  validatePermissions: (authInfo: AuthenticationInfo, permissions: string[]) => boolean;
1127
1203
  getMatchedPermissions: (authInfo: AuthenticationInfo, permissions: string[]) => string[];
@@ -1136,19 +1212,19 @@ declare const nodeSdk: {
1136
1212
  };
1137
1213
  otp: {
1138
1214
  verify: {
1139
- sms: (loginId: string, code: string) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse & {
1215
+ sms: (loginId: string, code: string) => Promise<SdkResponse<JWTResponse & {
1140
1216
  refreshJwt?: string;
1141
1217
  cookies?: string[];
1142
1218
  }>>;
1143
- voice: (loginId: string, code: string) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse & {
1219
+ voice: (loginId: string, code: string) => Promise<SdkResponse<JWTResponse & {
1144
1220
  refreshJwt?: string;
1145
1221
  cookies?: string[];
1146
1222
  }>>;
1147
- whatsapp: (loginId: string, code: string) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse & {
1223
+ whatsapp: (loginId: string, code: string) => Promise<SdkResponse<JWTResponse & {
1148
1224
  refreshJwt?: string;
1149
1225
  cookies?: string[];
1150
1226
  }>>;
1151
- email: (loginId: string, code: string) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse & {
1227
+ email: (loginId: string, code: string) => Promise<SdkResponse<JWTResponse & {
1152
1228
  refreshJwt?: string;
1153
1229
  cookies?: string[];
1154
1230
  }>>;
@@ -1249,13 +1325,7 @@ declare const nodeSdk: {
1249
1325
  };
1250
1326
  update: {
1251
1327
  email: <T extends boolean>(loginId: string, email: string, token?: string, updateOptions?: {
1252
- addToLoginIDs?: T; /**
1253
- * Retrieves the permissions from JWT tenant claims that match the specified permissions list
1254
- * @param authInfo JWT parsed info containing the permissions
1255
- * @param tenant tenant to match the permissions for
1256
- * @param permissions List of permissions to match against the JWT claims
1257
- * @returns An array of permissions that are both in the JWT claims and the specified list. Returns an empty array if no matches are found
1258
- * */
1328
+ addToLoginIDs?: T;
1259
1329
  onMergeUseExisting?: T extends true ? boolean : never;
1260
1330
  templateOptions?: {
1261
1331
  [x: string]: string;
@@ -1267,13 +1337,7 @@ declare const nodeSdk: {
1267
1337
  }>>;
1268
1338
  phone: {
1269
1339
  sms: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
1270
- addToLoginIDs?: T_1; /**
1271
- * Retrieves the permissions from JWT tenant claims that match the specified permissions list
1272
- * @param authInfo JWT parsed info containing the permissions
1273
- * @param tenant tenant to match the permissions for
1274
- * @param permissions List of permissions to match against the JWT claims
1275
- * @returns An array of permissions that are both in the JWT claims and the specified list. Returns an empty array if no matches are found
1276
- * */
1340
+ addToLoginIDs?: T_1;
1277
1341
  onMergeUseExisting?: T_1 extends true ? boolean : never;
1278
1342
  templateOptions?: {
1279
1343
  [x: string]: string;
@@ -1284,13 +1348,7 @@ declare const nodeSdk: {
1284
1348
  maskedPhone: string;
1285
1349
  }>>;
1286
1350
  voice: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
1287
- addToLoginIDs?: T_1; /**
1288
- * Retrieves the permissions from JWT tenant claims that match the specified permissions list
1289
- * @param authInfo JWT parsed info containing the permissions
1290
- * @param tenant tenant to match the permissions for
1291
- * @param permissions List of permissions to match against the JWT claims
1292
- * @returns An array of permissions that are both in the JWT claims and the specified list. Returns an empty array if no matches are found
1293
- * */
1351
+ addToLoginIDs?: T_1;
1294
1352
  onMergeUseExisting?: T_1 extends true ? boolean : never;
1295
1353
  templateOptions?: {
1296
1354
  [x: string]: string;
@@ -1301,13 +1359,7 @@ declare const nodeSdk: {
1301
1359
  maskedPhone: string;
1302
1360
  }>>;
1303
1361
  whatsapp: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
1304
- addToLoginIDs?: T_1; /**
1305
- * Retrieves the permissions from JWT tenant claims that match the specified permissions list
1306
- * @param authInfo JWT parsed info containing the permissions
1307
- * @param tenant tenant to match the permissions for
1308
- * @param permissions List of permissions to match against the JWT claims
1309
- * @returns An array of permissions that are both in the JWT claims and the specified list. Returns an empty array if no matches are found
1310
- * */
1362
+ addToLoginIDs?: T_1;
1311
1363
  onMergeUseExisting?: T_1 extends true ? boolean : never;
1312
1364
  templateOptions?: {
1313
1365
  [x: string]: string;
@@ -1321,7 +1373,7 @@ declare const nodeSdk: {
1321
1373
  };
1322
1374
  };
1323
1375
  magicLink: {
1324
- verify: (token: string) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse & {
1376
+ verify: (token: string) => Promise<SdkResponse<JWTResponse & {
1325
1377
  refreshJwt?: string;
1326
1378
  cookies?: string[];
1327
1379
  }>>;
@@ -1445,13 +1497,7 @@ declare const nodeSdk: {
1445
1497
  };
1446
1498
  update: {
1447
1499
  email: <T_2 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
1448
- addToLoginIDs?: T_2; /**
1449
- * Retrieves the permissions from JWT tenant claims that match the specified permissions list
1450
- * @param authInfo JWT parsed info containing the permissions
1451
- * @param tenant tenant to match the permissions for
1452
- * @param permissions List of permissions to match against the JWT claims
1453
- * @returns An array of permissions that are both in the JWT claims and the specified list. Returns an empty array if no matches are found
1454
- * */
1500
+ addToLoginIDs?: T_2;
1455
1501
  onMergeUseExisting?: T_2 extends true ? boolean : never;
1456
1502
  templateOptions?: {
1457
1503
  [x: string]: string;
@@ -1463,13 +1509,7 @@ declare const nodeSdk: {
1463
1509
  }>>;
1464
1510
  phone: {
1465
1511
  sms: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
1466
- addToLoginIDs?: T_3; /**
1467
- * Retrieves the permissions from JWT tenant claims that match the specified permissions list
1468
- * @param authInfo JWT parsed info containing the permissions
1469
- * @param tenant tenant to match the permissions for
1470
- * @param permissions List of permissions to match against the JWT claims
1471
- * @returns An array of permissions that are both in the JWT claims and the specified list. Returns an empty array if no matches are found
1472
- * */
1512
+ addToLoginIDs?: T_3;
1473
1513
  onMergeUseExisting?: T_3 extends true ? boolean : never;
1474
1514
  templateOptions?: {
1475
1515
  [x: string]: string;
@@ -1480,13 +1520,7 @@ declare const nodeSdk: {
1480
1520
  maskedPhone: string;
1481
1521
  }>>;
1482
1522
  voice: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
1483
- addToLoginIDs?: T_3; /**
1484
- * Retrieves the permissions from JWT tenant claims that match the specified permissions list
1485
- * @param authInfo JWT parsed info containing the permissions
1486
- * @param tenant tenant to match the permissions for
1487
- * @param permissions List of permissions to match against the JWT claims
1488
- * @returns An array of permissions that are both in the JWT claims and the specified list. Returns an empty array if no matches are found
1489
- * */
1523
+ addToLoginIDs?: T_3;
1490
1524
  onMergeUseExisting?: T_3 extends true ? boolean : never;
1491
1525
  templateOptions?: {
1492
1526
  [x: string]: string;
@@ -1497,13 +1531,7 @@ declare const nodeSdk: {
1497
1531
  maskedPhone: string;
1498
1532
  }>>;
1499
1533
  whatsapp: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
1500
- addToLoginIDs?: T_3; /**
1501
- * Retrieves the permissions from JWT tenant claims that match the specified permissions list
1502
- * @param authInfo JWT parsed info containing the permissions
1503
- * @param tenant tenant to match the permissions for
1504
- * @param permissions List of permissions to match against the JWT claims
1505
- * @returns An array of permissions that are both in the JWT claims and the specified list. Returns an empty array if no matches are found
1506
- * */
1534
+ addToLoginIDs?: T_3;
1507
1535
  onMergeUseExisting?: T_3 extends true ? boolean : never;
1508
1536
  templateOptions?: {
1509
1537
  [x: string]: string;
@@ -1549,16 +1577,10 @@ declare const nodeSdk: {
1549
1577
  waitForSession: (pendingRef: string, config?: {
1550
1578
  pollingIntervalMs: number;
1551
1579
  timeoutMs: number;
1552
- }) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1580
+ }) => Promise<SdkResponse<JWTResponse>>;
1553
1581
  update: {
1554
1582
  email: <T_4 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
1555
- addToLoginIDs?: T_4; /**
1556
- * Retrieves the permissions from JWT tenant claims that match the specified permissions list
1557
- * @param authInfo JWT parsed info containing the permissions
1558
- * @param tenant tenant to match the permissions for
1559
- * @param permissions List of permissions to match against the JWT claims
1560
- * @returns An array of permissions that are both in the JWT claims and the specified list. Returns an empty array if no matches are found
1561
- * */
1583
+ addToLoginIDs?: T_4;
1562
1584
  onMergeUseExisting?: T_4 extends true ? boolean : never;
1563
1585
  templateOptions?: {
1564
1586
  [x: string]: string;
@@ -1580,7 +1602,7 @@ declare const nodeSdk: {
1580
1602
  linkedin: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<SdkResponse<_descope_core_js_sdk.URLResponse>>;
1581
1603
  slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<SdkResponse<_descope_core_js_sdk.URLResponse>>;
1582
1604
  };
1583
- exchange: (code: string) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse & {
1605
+ exchange: (code: string) => Promise<SdkResponse<JWTResponse & {
1584
1606
  refreshJwt?: string;
1585
1607
  cookies?: string[];
1586
1608
  }>>;
@@ -1592,7 +1614,7 @@ declare const nodeSdk: {
1592
1614
  verifyOneTapIDToken: (provider: string, idToken: string, nonce: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<SdkResponse<{
1593
1615
  code: string;
1594
1616
  }>>;
1595
- exchangeOneTapIDToken: (provider: string, idToken: string, nonce: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1617
+ exchangeOneTapIDToken: (provider: string, idToken: string, nonce: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<SdkResponse<JWTResponse>>;
1596
1618
  };
1597
1619
  outbound: {
1598
1620
  connect: (appId: string, options?: {
@@ -1602,7 +1624,7 @@ declare const nodeSdk: {
1602
1624
  };
1603
1625
  saml: {
1604
1626
  start: (tenantIdOrEmail: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, ssoId?: string) => Promise<SdkResponse<_descope_core_js_sdk.URLResponse>>;
1605
- exchange: (code: string) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse & {
1627
+ exchange: (code: string) => Promise<SdkResponse<JWTResponse & {
1606
1628
  refreshJwt?: string;
1607
1629
  cookies?: string[];
1608
1630
  }>>;
@@ -1616,7 +1638,7 @@ declare const nodeSdk: {
1616
1638
  familyName?: string;
1617
1639
  phone?: string;
1618
1640
  }) => Promise<SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
1619
- verify: (loginId: string, code: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse & {
1641
+ verify: (loginId: string, code: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<SdkResponse<JWTResponse & {
1620
1642
  refreshJwt?: string;
1621
1643
  cookies?: string[];
1622
1644
  }>>;
@@ -1660,7 +1682,7 @@ declare const nodeSdk: {
1660
1682
  waitForSession: (pendingRef: string, config?: {
1661
1683
  pollingIntervalMs: number;
1662
1684
  timeoutMs: number;
1663
- }) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1685
+ }) => Promise<SdkResponse<JWTResponse>>;
1664
1686
  };
1665
1687
  webauthn: {
1666
1688
  signUp: {
@@ -1669,7 +1691,7 @@ declare const nodeSdk: {
1669
1691
  options: string;
1670
1692
  create: boolean;
1671
1693
  }>>;
1672
- finish: (transactionId: string, response: string) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse & {
1694
+ finish: (transactionId: string, response: string) => Promise<SdkResponse<JWTResponse & {
1673
1695
  refreshJwt?: string;
1674
1696
  cookies?: string[];
1675
1697
  }>>;
@@ -1680,7 +1702,7 @@ declare const nodeSdk: {
1680
1702
  options: string;
1681
1703
  create: boolean;
1682
1704
  }>>;
1683
- finish: (transactionId: string, response: string) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse & {
1705
+ finish: (transactionId: string, response: string) => Promise<SdkResponse<JWTResponse & {
1684
1706
  refreshJwt?: string;
1685
1707
  cookies?: string[];
1686
1708
  }>>;
@@ -1715,8 +1737,8 @@ declare const nodeSdk: {
1715
1737
  templateOptions?: {
1716
1738
  [x: string]: string;
1717
1739
  };
1718
- }) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1719
- signIn: (loginId: string, password: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1740
+ }) => Promise<SdkResponse<JWTResponse>>;
1741
+ signIn: (loginId: string, password: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<SdkResponse<JWTResponse>>;
1720
1742
  sendReset: (loginId: string, redirectUrl?: string, templateOptions?: {
1721
1743
  [x: string]: string;
1722
1744
  }) => Promise<SdkResponse<{
@@ -1726,7 +1748,7 @@ declare const nodeSdk: {
1726
1748
  maskedEmail: string;
1727
1749
  }>>;
1728
1750
  update: (loginId: string, newPassword: string, token?: string) => Promise<SdkResponse<never>>;
1729
- replace: (loginId: string, oldPassword: string, newPassword: string) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1751
+ replace: (loginId: string, oldPassword: string, newPassword: string) => Promise<SdkResponse<JWTResponse>>;
1730
1752
  policy: () => Promise<SdkResponse<{
1731
1753
  minLength: number;
1732
1754
  lowercase: boolean;
@@ -1762,12 +1784,7 @@ declare const nodeSdk: {
1762
1784
  oidcLoginHint?: string;
1763
1785
  abTestingKey?: number;
1764
1786
  startOptionsVersion?: number;
1765
- client?: Record<string, any>; /**
1766
- * Retrieves the permissions from JWT top level claims that match the specified permissions list
1767
- * @param authInfo JWT parsed info containing the permissions
1768
- * @param permissions List of permissions to match against the JWT claims
1769
- * @returns An array of permissions that are both in the JWT claims and the specified list. Returns an empty array if no matches are found
1770
- */
1787
+ client?: Record<string, any>;
1771
1788
  locale?: string;
1772
1789
  oidcPrompt?: string;
1773
1790
  oidcErrorRedirectUri?: string;
@@ -1787,7 +1804,7 @@ declare const nodeSdk: {
1787
1804
  [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any)[])[])[])[])[])[])[])[])[])[])[];
1788
1805
  }) => Promise<SdkResponse<_descope_core_js_sdk.FlowResponse>>;
1789
1806
  };
1790
- selectTenant: (tenantId: string, token?: string) => Promise<SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1807
+ selectTenant: (tenantId: string, token?: string) => Promise<SdkResponse<JWTResponse>>;
1791
1808
  logout: (token?: string) => Promise<SdkResponse<never>>;
1792
1809
  logoutAll: (token?: string) => Promise<SdkResponse<never>>;
1793
1810
  me: (token?: string) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;