@descope/web-js-sdk 1.19.1 → 1.20.0

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
@@ -646,6 +646,7 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
646
646
  selectTenant: (tenantId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
647
647
  logout: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
648
648
  logoutAll: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
649
+ logoutPrevious: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
649
650
  me: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserResponse>>;
650
651
  myTenants: (tenants: true | string[], token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
651
652
  tenants: {
@@ -1252,6 +1253,614 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
1252
1253
  selectTenant: (tenantId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1253
1254
  logout: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1254
1255
  logoutAll: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1256
+ logoutPrevious: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1257
+ me: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserResponse>>;
1258
+ myTenants: (tenants: true | string[], token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1259
+ tenants: {
1260
+ id: string;
1261
+ name: string;
1262
+ customAttributes?: Record<string, any>;
1263
+ }[];
1264
+ }>>;
1265
+ history: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserHistoryResponse>>;
1266
+ isJwtExpired: (token: string) => boolean;
1267
+ getTenants: (token: string) => string[];
1268
+ getJwtPermissions: (token: string, tenant?: string) => string[];
1269
+ getJwtRoles: (token: string, tenant?: string) => string[];
1270
+ httpClient: {
1271
+ get: (path: string, config?: {
1272
+ headers?: HeadersInit;
1273
+ queryParams?: {
1274
+ [key: string]: string;
1275
+ };
1276
+ token?: string;
1277
+ }) => Promise<Response>;
1278
+ post: (path: string, body?: any, config?: {
1279
+ headers?: HeadersInit;
1280
+ queryParams?: {
1281
+ [key: string]: string;
1282
+ };
1283
+ token?: string;
1284
+ }) => Promise<Response>;
1285
+ patch: (path: string, body?: any, config?: {
1286
+ headers?: HeadersInit;
1287
+ queryParams?: {
1288
+ [key: string]: string;
1289
+ };
1290
+ token?: string;
1291
+ }) => Promise<Response>;
1292
+ put: (path: string, body?: any, config?: {
1293
+ headers?: HeadersInit;
1294
+ queryParams?: {
1295
+ [key: string]: string;
1296
+ };
1297
+ token?: string;
1298
+ }) => Promise<Response>;
1299
+ delete: (path: string, config?: {
1300
+ headers?: HeadersInit;
1301
+ queryParams?: {
1302
+ [key: string]: string;
1303
+ };
1304
+ token?: string;
1305
+ }) => Promise<Response>;
1306
+ hooks?: {
1307
+ beforeRequest?: (config: _descope_core_js_sdk.RequestConfig) => _descope_core_js_sdk.RequestConfig;
1308
+ afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
1309
+ transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
1310
+ };
1311
+ buildUrl: (path: string, queryParams?: {
1312
+ [key: string]: string;
1313
+ }) => string;
1314
+ };
1315
+ } | {
1316
+ refresh: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1317
+ flow: {
1318
+ start: (flowId: string, options?: Pick<{
1319
+ redirectUrl?: string;
1320
+ location?: string;
1321
+ tenant?: string;
1322
+ deviceInfo?: {
1323
+ webAuthnSupport?: boolean;
1324
+ };
1325
+ lastAuth?: {
1326
+ authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
1327
+ oauthProvider?: string;
1328
+ name?: string;
1329
+ loginId?: string;
1330
+ };
1331
+ redirectAuth?: {
1332
+ callbackUrl: string;
1333
+ codeChallenge: string;
1334
+ };
1335
+ oidcIdpStateId?: string;
1336
+ preview?: boolean;
1337
+ samlIdpStateId?: string;
1338
+ samlIdpUsername?: string;
1339
+ ssoAppId?: string;
1340
+ oidcLoginHint?: string;
1341
+ abTestingKey?: number;
1342
+ startOptionsVersion?: number;
1343
+ client?: Record<string, any>;
1344
+ locale?: string;
1345
+ oidcPrompt?: string;
1346
+ oidcErrorRedirectUri?: string;
1347
+ nativeOptions?: {
1348
+ platform: "ios" | "android";
1349
+ oauthProvider?: string;
1350
+ oauthRedirect?: string;
1351
+ };
1352
+ }, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "nativeOptions"> & {
1353
+ lastAuth?: Omit<{
1354
+ authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
1355
+ oauthProvider?: string;
1356
+ name?: string;
1357
+ loginId?: string;
1358
+ }, "loginId" | "name">;
1359
+ }, conditionInteractionId?: string, interactionId?: string, componentsVersion?: string, flowVersions?: Record<string, number>, input?: {
1360
+ [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)[])[])[])[])[])[])[])[])[])[])[];
1361
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.FlowResponse>>;
1362
+ next: (executionId: string, stepId: string, interactionId: string, version?: number, componentsVersion?: string, input?: {
1363
+ [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)[])[])[])[])[])[])[])[])[])[])[];
1364
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.FlowResponse>>;
1365
+ };
1366
+ webauthn: {
1367
+ signUp: ((identifier: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
1368
+ start: (loginId: string, origin: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
1369
+ transactionId: string;
1370
+ options: string;
1371
+ create: boolean;
1372
+ }>>;
1373
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1374
+ };
1375
+ signIn: ((identifier: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
1376
+ start: (loginId: string, origin: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
1377
+ transactionId: string;
1378
+ options: string;
1379
+ create: boolean;
1380
+ }>>;
1381
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1382
+ };
1383
+ signUpOrIn: ((identifier: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
1384
+ start: (loginId: string, origin: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
1385
+ transactionId: string;
1386
+ options: string;
1387
+ create: boolean;
1388
+ }>>;
1389
+ };
1390
+ update: ((identifier: string, token: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>) & {
1391
+ start: (loginId: string, origin: string, token: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
1392
+ transactionId: string;
1393
+ options: string;
1394
+ create: boolean;
1395
+ }>>;
1396
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
1397
+ };
1398
+ helpers: {
1399
+ create: (options: string) => Promise<string>;
1400
+ get: (options: string) => Promise<string>;
1401
+ isSupported: typeof isSupported;
1402
+ conditional: (options: string, abort: AbortController) => Promise<string>;
1403
+ };
1404
+ };
1405
+ fedcm: {
1406
+ oneTap(provider?: string, oneTapConfig?: OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: () => void): Promise<unknown>;
1407
+ launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1408
+ isSupported(): boolean;
1409
+ };
1410
+ accessKey: {
1411
+ exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
1412
+ };
1413
+ otp: {
1414
+ verify: {
1415
+ sms: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1416
+ voice: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1417
+ whatsapp: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1418
+ email: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1419
+ };
1420
+ signIn: {
1421
+ sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1422
+ maskedPhone: string;
1423
+ }>>;
1424
+ voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1425
+ maskedPhone: string;
1426
+ }>>;
1427
+ whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1428
+ maskedPhone: string;
1429
+ }>>;
1430
+ email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1431
+ maskedEmail: string;
1432
+ }>>;
1433
+ };
1434
+ signUp: {
1435
+ sms: (loginId: string, user?: {
1436
+ email?: string;
1437
+ name?: string;
1438
+ givenName?: string;
1439
+ middleName?: string;
1440
+ familyName?: string;
1441
+ phone?: string;
1442
+ }, signUpOptions?: {
1443
+ customClaims?: Record<string, any>;
1444
+ templateId?: string;
1445
+ templateOptions?: {
1446
+ [x: string]: string;
1447
+ };
1448
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1449
+ maskedPhone: string;
1450
+ }>>;
1451
+ voice: (loginId: string, user?: {
1452
+ email?: string;
1453
+ name?: string;
1454
+ givenName?: string;
1455
+ middleName?: string;
1456
+ familyName?: string;
1457
+ phone?: string;
1458
+ }, signUpOptions?: {
1459
+ customClaims?: Record<string, any>;
1460
+ templateId?: string;
1461
+ templateOptions?: {
1462
+ [x: string]: string;
1463
+ };
1464
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1465
+ maskedPhone: string;
1466
+ }>>;
1467
+ whatsapp: (loginId: string, user?: {
1468
+ email?: string;
1469
+ name?: string;
1470
+ givenName?: string;
1471
+ middleName?: string;
1472
+ familyName?: string;
1473
+ phone?: string;
1474
+ }, signUpOptions?: {
1475
+ customClaims?: Record<string, any>;
1476
+ templateId?: string;
1477
+ templateOptions?: {
1478
+ [x: string]: string;
1479
+ };
1480
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1481
+ maskedPhone: string;
1482
+ }>>;
1483
+ email: (loginId: string, user?: {
1484
+ email?: string;
1485
+ name?: string;
1486
+ givenName?: string;
1487
+ middleName?: string;
1488
+ familyName?: string;
1489
+ phone?: string;
1490
+ }, signUpOptions?: {
1491
+ customClaims?: Record<string, any>;
1492
+ templateId?: string;
1493
+ templateOptions?: {
1494
+ [x: string]: string;
1495
+ };
1496
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1497
+ maskedEmail: string;
1498
+ }>>;
1499
+ };
1500
+ signUpOrIn: {
1501
+ sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1502
+ maskedPhone: string;
1503
+ }>>;
1504
+ voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1505
+ maskedPhone: string;
1506
+ }>>;
1507
+ whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1508
+ maskedPhone: string;
1509
+ }>>;
1510
+ email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1511
+ maskedEmail: string;
1512
+ }>>;
1513
+ };
1514
+ update: {
1515
+ email: <T extends boolean>(loginId: string, email: string, token?: string, updateOptions?: {
1516
+ addToLoginIDs?: T;
1517
+ onMergeUseExisting?: T extends true ? boolean : never;
1518
+ templateOptions?: {
1519
+ [x: string]: string;
1520
+ };
1521
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1522
+ maskedEmail: string;
1523
+ }>>;
1524
+ phone: {
1525
+ sms: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
1526
+ addToLoginIDs?: T_1;
1527
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
1528
+ templateOptions?: {
1529
+ [x: string]: string;
1530
+ };
1531
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1532
+ maskedPhone: string;
1533
+ }>>;
1534
+ voice: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
1535
+ addToLoginIDs?: T_1;
1536
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
1537
+ templateOptions?: {
1538
+ [x: string]: string;
1539
+ };
1540
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1541
+ maskedPhone: string;
1542
+ }>>;
1543
+ whatsapp: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
1544
+ addToLoginIDs?: T_1;
1545
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
1546
+ templateOptions?: {
1547
+ [x: string]: string;
1548
+ };
1549
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1550
+ maskedPhone: string;
1551
+ }>>;
1552
+ };
1553
+ };
1554
+ };
1555
+ magicLink: {
1556
+ verify: (token: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1557
+ signIn: {
1558
+ sms: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1559
+ maskedPhone: string;
1560
+ }>>;
1561
+ voice: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1562
+ maskedPhone: string;
1563
+ }>>;
1564
+ whatsapp: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1565
+ maskedPhone: string;
1566
+ }>>;
1567
+ email: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1568
+ maskedEmail: string;
1569
+ }>>;
1570
+ };
1571
+ signUp: {
1572
+ sms: (loginId: string, URI: string, user?: {
1573
+ email?: string;
1574
+ name?: string;
1575
+ givenName?: string;
1576
+ middleName?: string;
1577
+ familyName?: string;
1578
+ phone?: string;
1579
+ }, signUpOptions?: {
1580
+ customClaims?: Record<string, any>;
1581
+ templateId?: string;
1582
+ templateOptions?: {
1583
+ [x: string]: string;
1584
+ };
1585
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1586
+ maskedPhone: string;
1587
+ }>>;
1588
+ voice: (loginId: string, URI: string, user?: {
1589
+ email?: string;
1590
+ name?: string;
1591
+ givenName?: string;
1592
+ middleName?: string;
1593
+ familyName?: string;
1594
+ phone?: string;
1595
+ }, signUpOptions?: {
1596
+ customClaims?: Record<string, any>;
1597
+ templateId?: string;
1598
+ templateOptions?: {
1599
+ [x: string]: string;
1600
+ };
1601
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1602
+ maskedPhone: string;
1603
+ }>>;
1604
+ whatsapp: (loginId: string, URI: string, user?: {
1605
+ email?: string;
1606
+ name?: string;
1607
+ givenName?: string;
1608
+ middleName?: string;
1609
+ familyName?: string;
1610
+ phone?: string;
1611
+ }, signUpOptions?: {
1612
+ customClaims?: Record<string, any>;
1613
+ templateId?: string;
1614
+ templateOptions?: {
1615
+ [x: string]: string;
1616
+ };
1617
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1618
+ maskedPhone: string;
1619
+ }>>;
1620
+ email: (loginId: string, URI: string, user?: {
1621
+ email?: string;
1622
+ name?: string;
1623
+ givenName?: string;
1624
+ middleName?: string;
1625
+ familyName?: string;
1626
+ phone?: string;
1627
+ }, signUpOptions?: {
1628
+ customClaims?: Record<string, any>;
1629
+ templateId?: string;
1630
+ templateOptions?: {
1631
+ [x: string]: string;
1632
+ };
1633
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1634
+ maskedEmail: string;
1635
+ }>>;
1636
+ };
1637
+ signUpOrIn: {
1638
+ sms: (loginId: string, URI?: string, signUpOptions?: {
1639
+ customClaims?: Record<string, any>;
1640
+ templateId?: string;
1641
+ templateOptions?: {
1642
+ [x: string]: string;
1643
+ };
1644
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1645
+ maskedPhone: string;
1646
+ }>>;
1647
+ voice: (loginId: string, URI?: string, signUpOptions?: {
1648
+ customClaims?: Record<string, any>;
1649
+ templateId?: string;
1650
+ templateOptions?: {
1651
+ [x: string]: string;
1652
+ };
1653
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1654
+ maskedPhone: string;
1655
+ }>>;
1656
+ whatsapp: (loginId: string, URI?: string, signUpOptions?: {
1657
+ customClaims?: Record<string, any>;
1658
+ templateId?: string;
1659
+ templateOptions?: {
1660
+ [x: string]: string;
1661
+ };
1662
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1663
+ maskedPhone: string;
1664
+ }>>;
1665
+ email: (loginId: string, URI?: string, signUpOptions?: {
1666
+ customClaims?: Record<string, any>;
1667
+ templateId?: string;
1668
+ templateOptions?: {
1669
+ [x: string]: string;
1670
+ };
1671
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1672
+ maskedEmail: string;
1673
+ }>>;
1674
+ };
1675
+ update: {
1676
+ email: <T_2 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
1677
+ addToLoginIDs?: T_2;
1678
+ onMergeUseExisting?: T_2 extends true ? boolean : never;
1679
+ templateOptions?: {
1680
+ [x: string]: string;
1681
+ };
1682
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1683
+ maskedEmail: string;
1684
+ }>>;
1685
+ phone: {
1686
+ sms: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
1687
+ addToLoginIDs?: T_3;
1688
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
1689
+ templateOptions?: {
1690
+ [x: string]: string;
1691
+ };
1692
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1693
+ maskedPhone: string;
1694
+ }>>;
1695
+ voice: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
1696
+ addToLoginIDs?: T_3;
1697
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
1698
+ templateOptions?: {
1699
+ [x: string]: string;
1700
+ };
1701
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1702
+ maskedPhone: string;
1703
+ }>>;
1704
+ whatsapp: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
1705
+ addToLoginIDs?: T_3;
1706
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
1707
+ templateOptions?: {
1708
+ [x: string]: string;
1709
+ };
1710
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1711
+ maskedPhone: string;
1712
+ }>>;
1713
+ };
1714
+ };
1715
+ };
1716
+ enchantedLink: {
1717
+ verify: (token: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1718
+ signIn: (loginId: string, URI?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
1719
+ signUpOrIn: (loginId: string, URI?: string, signUpOptions?: {
1720
+ customClaims?: Record<string, any>;
1721
+ templateId?: string;
1722
+ templateOptions?: {
1723
+ [x: string]: string;
1724
+ };
1725
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
1726
+ signUp: (loginId: string, URI?: string, user?: {
1727
+ email?: string;
1728
+ name?: string;
1729
+ givenName?: string;
1730
+ middleName?: string;
1731
+ familyName?: string;
1732
+ phone?: string;
1733
+ }, signUpOptions?: {
1734
+ customClaims?: Record<string, any>;
1735
+ templateId?: string;
1736
+ templateOptions?: {
1737
+ [x: string]: string;
1738
+ };
1739
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
1740
+ waitForSession: (pendingRef: string, config?: {
1741
+ pollingIntervalMs: number;
1742
+ timeoutMs: number;
1743
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1744
+ update: {
1745
+ email: <T_4 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
1746
+ addToLoginIDs?: T_4;
1747
+ onMergeUseExisting?: T_4 extends true ? boolean : never;
1748
+ templateOptions?: {
1749
+ [x: string]: string;
1750
+ };
1751
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
1752
+ };
1753
+ };
1754
+ oauth: {
1755
+ start: ((provider: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>) & {
1756
+ google: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1757
+ facebook: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1758
+ github: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1759
+ microsoft: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1760
+ gitlab: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1761
+ apple: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1762
+ discord: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1763
+ linkedin: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1764
+ slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1765
+ };
1766
+ exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1767
+ startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
1768
+ finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
1769
+ };
1770
+ saml: {
1771
+ start: (tenantIdOrEmail: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1772
+ exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1773
+ };
1774
+ totp: {
1775
+ signUp: (loginId: string, user?: {
1776
+ email?: string;
1777
+ name?: string;
1778
+ givenName?: string;
1779
+ middleName?: string;
1780
+ familyName?: string;
1781
+ phone?: string;
1782
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
1783
+ verify: (loginId: string, code: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1784
+ update: (loginId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
1785
+ };
1786
+ notp: {
1787
+ signUpOrIn: (loginId?: string, signUpOptions?: {
1788
+ customClaims?: Record<string, any>;
1789
+ templateId?: string;
1790
+ templateOptions?: {
1791
+ [x: string]: string;
1792
+ };
1793
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1794
+ pendingRef: string;
1795
+ redirectUrl: string;
1796
+ image: string;
1797
+ }>>;
1798
+ signUp: (loginId?: string, user?: {
1799
+ email?: string;
1800
+ name?: string;
1801
+ givenName?: string;
1802
+ middleName?: string;
1803
+ familyName?: string;
1804
+ phone?: string;
1805
+ }, signUpOptions?: {
1806
+ customClaims?: Record<string, any>;
1807
+ templateId?: string;
1808
+ templateOptions?: {
1809
+ [x: string]: string;
1810
+ };
1811
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1812
+ pendingRef: string;
1813
+ redirectUrl: string;
1814
+ image: string;
1815
+ }>>;
1816
+ signIn: (loginId?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1817
+ pendingRef: string;
1818
+ redirectUrl: string;
1819
+ image: string;
1820
+ }>>;
1821
+ waitForSession: (pendingRef: string, config?: {
1822
+ pollingIntervalMs: number;
1823
+ timeoutMs: number;
1824
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1825
+ };
1826
+ password: {
1827
+ signUp: (loginId: string, password: string, user?: {
1828
+ email?: string;
1829
+ name?: string;
1830
+ givenName?: string;
1831
+ middleName?: string;
1832
+ familyName?: string;
1833
+ phone?: string;
1834
+ }, signUpOptions?: {
1835
+ customClaims?: Record<string, any>;
1836
+ templateId?: string;
1837
+ templateOptions?: {
1838
+ [x: string]: string;
1839
+ };
1840
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1841
+ signIn: (loginId: string, password: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1842
+ sendReset: (loginId: string, redirectUrl?: string, templateOptions?: {
1843
+ [x: string]: string;
1844
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1845
+ resetMethod: string;
1846
+ pendingRef?: string;
1847
+ linkId?: string;
1848
+ maskedEmail: string;
1849
+ }>>;
1850
+ update: (loginId: string, newPassword: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1851
+ replace: (loginId: string, oldPassword: string, newPassword: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1852
+ policy: () => Promise<_descope_core_js_sdk.SdkResponse<{
1853
+ minLength: number;
1854
+ lowercase: boolean;
1855
+ uppercase: boolean;
1856
+ number: boolean;
1857
+ nonAlphanumeric: boolean;
1858
+ }>>;
1859
+ };
1860
+ selectTenant: (tenantId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1861
+ logout: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1862
+ logoutAll: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1863
+ logoutPrevious: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1255
1864
  me: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserResponse>>;
1256
1865
  myTenants: (tenants: true | string[], token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1257
1866
  tenants: {
@@ -1867,6 +2476,614 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
1867
2476
  selectTenant: (tenantId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1868
2477
  logout: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1869
2478
  logoutAll: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
2479
+ logoutPrevious: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
2480
+ me: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserResponse>>;
2481
+ myTenants: (tenants: true | string[], token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2482
+ tenants: {
2483
+ id: string;
2484
+ name: string;
2485
+ customAttributes?: Record<string, any>;
2486
+ }[];
2487
+ }>>;
2488
+ history: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserHistoryResponse>>;
2489
+ isJwtExpired: (token: string) => boolean;
2490
+ getTenants: (token: string) => string[];
2491
+ getJwtPermissions: (token: string, tenant?: string) => string[];
2492
+ getJwtRoles: (token: string, tenant?: string) => string[];
2493
+ httpClient: {
2494
+ get: (path: string, config?: {
2495
+ headers?: HeadersInit;
2496
+ queryParams?: {
2497
+ [key: string]: string;
2498
+ };
2499
+ token?: string;
2500
+ }) => Promise<Response>;
2501
+ post: (path: string, body?: any, config?: {
2502
+ headers?: HeadersInit;
2503
+ queryParams?: {
2504
+ [key: string]: string;
2505
+ };
2506
+ token?: string;
2507
+ }) => Promise<Response>;
2508
+ patch: (path: string, body?: any, config?: {
2509
+ headers?: HeadersInit;
2510
+ queryParams?: {
2511
+ [key: string]: string;
2512
+ };
2513
+ token?: string;
2514
+ }) => Promise<Response>;
2515
+ put: (path: string, body?: any, config?: {
2516
+ headers?: HeadersInit;
2517
+ queryParams?: {
2518
+ [key: string]: string;
2519
+ };
2520
+ token?: string;
2521
+ }) => Promise<Response>;
2522
+ delete: (path: string, config?: {
2523
+ headers?: HeadersInit;
2524
+ queryParams?: {
2525
+ [key: string]: string;
2526
+ };
2527
+ token?: string;
2528
+ }) => Promise<Response>;
2529
+ hooks?: {
2530
+ beforeRequest?: (config: _descope_core_js_sdk.RequestConfig) => _descope_core_js_sdk.RequestConfig;
2531
+ afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
2532
+ transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
2533
+ };
2534
+ buildUrl: (path: string, queryParams?: {
2535
+ [key: string]: string;
2536
+ }) => string;
2537
+ };
2538
+ } | {
2539
+ refresh: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2540
+ flow: {
2541
+ start: (flowId: string, options?: Pick<{
2542
+ redirectUrl?: string;
2543
+ location?: string;
2544
+ tenant?: string;
2545
+ deviceInfo?: {
2546
+ webAuthnSupport?: boolean;
2547
+ };
2548
+ lastAuth?: {
2549
+ authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
2550
+ oauthProvider?: string;
2551
+ name?: string;
2552
+ loginId?: string;
2553
+ };
2554
+ redirectAuth?: {
2555
+ callbackUrl: string;
2556
+ codeChallenge: string;
2557
+ };
2558
+ oidcIdpStateId?: string;
2559
+ preview?: boolean;
2560
+ samlIdpStateId?: string;
2561
+ samlIdpUsername?: string;
2562
+ ssoAppId?: string;
2563
+ oidcLoginHint?: string;
2564
+ abTestingKey?: number;
2565
+ startOptionsVersion?: number;
2566
+ client?: Record<string, any>;
2567
+ locale?: string;
2568
+ oidcPrompt?: string;
2569
+ oidcErrorRedirectUri?: string;
2570
+ nativeOptions?: {
2571
+ platform: "ios" | "android";
2572
+ oauthProvider?: string;
2573
+ oauthRedirect?: string;
2574
+ };
2575
+ }, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "nativeOptions"> & {
2576
+ lastAuth?: Omit<{
2577
+ authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
2578
+ oauthProvider?: string;
2579
+ name?: string;
2580
+ loginId?: string;
2581
+ }, "loginId" | "name">;
2582
+ }, conditionInteractionId?: string, interactionId?: string, componentsVersion?: string, flowVersions?: Record<string, number>, input?: {
2583
+ [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)[])[])[])[])[])[])[])[])[])[])[];
2584
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.FlowResponse>>;
2585
+ next: (executionId: string, stepId: string, interactionId: string, version?: number, componentsVersion?: string, input?: {
2586
+ [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)[])[])[])[])[])[])[])[])[])[])[];
2587
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.FlowResponse>>;
2588
+ };
2589
+ webauthn: {
2590
+ signUp: ((identifier: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
2591
+ start: (loginId: string, origin: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
2592
+ transactionId: string;
2593
+ options: string;
2594
+ create: boolean;
2595
+ }>>;
2596
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2597
+ };
2598
+ signIn: ((identifier: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
2599
+ start: (loginId: string, origin: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
2600
+ transactionId: string;
2601
+ options: string;
2602
+ create: boolean;
2603
+ }>>;
2604
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2605
+ };
2606
+ signUpOrIn: ((identifier: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
2607
+ start: (loginId: string, origin: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
2608
+ transactionId: string;
2609
+ options: string;
2610
+ create: boolean;
2611
+ }>>;
2612
+ };
2613
+ update: ((identifier: string, token: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>) & {
2614
+ start: (loginId: string, origin: string, token: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
2615
+ transactionId: string;
2616
+ options: string;
2617
+ create: boolean;
2618
+ }>>;
2619
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
2620
+ };
2621
+ helpers: {
2622
+ create: (options: string) => Promise<string>;
2623
+ get: (options: string) => Promise<string>;
2624
+ isSupported: typeof isSupported;
2625
+ conditional: (options: string, abort: AbortController) => Promise<string>;
2626
+ };
2627
+ };
2628
+ fedcm: {
2629
+ oneTap(provider?: string, oneTapConfig?: OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: () => void): Promise<unknown>;
2630
+ launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2631
+ isSupported(): boolean;
2632
+ };
2633
+ accessKey: {
2634
+ exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
2635
+ };
2636
+ otp: {
2637
+ verify: {
2638
+ sms: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2639
+ voice: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2640
+ whatsapp: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2641
+ email: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2642
+ };
2643
+ signIn: {
2644
+ sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2645
+ maskedPhone: string;
2646
+ }>>;
2647
+ voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2648
+ maskedPhone: string;
2649
+ }>>;
2650
+ whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2651
+ maskedPhone: string;
2652
+ }>>;
2653
+ email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2654
+ maskedEmail: string;
2655
+ }>>;
2656
+ };
2657
+ signUp: {
2658
+ sms: (loginId: string, user?: {
2659
+ email?: string;
2660
+ name?: string;
2661
+ givenName?: string;
2662
+ middleName?: string;
2663
+ familyName?: string;
2664
+ phone?: string;
2665
+ }, signUpOptions?: {
2666
+ customClaims?: Record<string, any>;
2667
+ templateId?: string;
2668
+ templateOptions?: {
2669
+ [x: string]: string;
2670
+ };
2671
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2672
+ maskedPhone: string;
2673
+ }>>;
2674
+ voice: (loginId: string, user?: {
2675
+ email?: string;
2676
+ name?: string;
2677
+ givenName?: string;
2678
+ middleName?: string;
2679
+ familyName?: string;
2680
+ phone?: string;
2681
+ }, signUpOptions?: {
2682
+ customClaims?: Record<string, any>;
2683
+ templateId?: string;
2684
+ templateOptions?: {
2685
+ [x: string]: string;
2686
+ };
2687
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2688
+ maskedPhone: string;
2689
+ }>>;
2690
+ whatsapp: (loginId: string, user?: {
2691
+ email?: string;
2692
+ name?: string;
2693
+ givenName?: string;
2694
+ middleName?: string;
2695
+ familyName?: string;
2696
+ phone?: string;
2697
+ }, signUpOptions?: {
2698
+ customClaims?: Record<string, any>;
2699
+ templateId?: string;
2700
+ templateOptions?: {
2701
+ [x: string]: string;
2702
+ };
2703
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2704
+ maskedPhone: string;
2705
+ }>>;
2706
+ email: (loginId: string, user?: {
2707
+ email?: string;
2708
+ name?: string;
2709
+ givenName?: string;
2710
+ middleName?: string;
2711
+ familyName?: string;
2712
+ phone?: string;
2713
+ }, signUpOptions?: {
2714
+ customClaims?: Record<string, any>;
2715
+ templateId?: string;
2716
+ templateOptions?: {
2717
+ [x: string]: string;
2718
+ };
2719
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2720
+ maskedEmail: string;
2721
+ }>>;
2722
+ };
2723
+ signUpOrIn: {
2724
+ sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2725
+ maskedPhone: string;
2726
+ }>>;
2727
+ voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2728
+ maskedPhone: string;
2729
+ }>>;
2730
+ whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2731
+ maskedPhone: string;
2732
+ }>>;
2733
+ email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2734
+ maskedEmail: string;
2735
+ }>>;
2736
+ };
2737
+ update: {
2738
+ email: <T extends boolean>(loginId: string, email: string, token?: string, updateOptions?: {
2739
+ addToLoginIDs?: T;
2740
+ onMergeUseExisting?: T extends true ? boolean : never;
2741
+ templateOptions?: {
2742
+ [x: string]: string;
2743
+ };
2744
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2745
+ maskedEmail: string;
2746
+ }>>;
2747
+ phone: {
2748
+ sms: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
2749
+ addToLoginIDs?: T_1;
2750
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
2751
+ templateOptions?: {
2752
+ [x: string]: string;
2753
+ };
2754
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2755
+ maskedPhone: string;
2756
+ }>>;
2757
+ voice: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
2758
+ addToLoginIDs?: T_1;
2759
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
2760
+ templateOptions?: {
2761
+ [x: string]: string;
2762
+ };
2763
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2764
+ maskedPhone: string;
2765
+ }>>;
2766
+ whatsapp: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
2767
+ addToLoginIDs?: T_1;
2768
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
2769
+ templateOptions?: {
2770
+ [x: string]: string;
2771
+ };
2772
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2773
+ maskedPhone: string;
2774
+ }>>;
2775
+ };
2776
+ };
2777
+ };
2778
+ magicLink: {
2779
+ verify: (token: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2780
+ signIn: {
2781
+ sms: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2782
+ maskedPhone: string;
2783
+ }>>;
2784
+ voice: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2785
+ maskedPhone: string;
2786
+ }>>;
2787
+ whatsapp: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2788
+ maskedPhone: string;
2789
+ }>>;
2790
+ email: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2791
+ maskedEmail: string;
2792
+ }>>;
2793
+ };
2794
+ signUp: {
2795
+ sms: (loginId: string, URI: string, user?: {
2796
+ email?: string;
2797
+ name?: string;
2798
+ givenName?: string;
2799
+ middleName?: string;
2800
+ familyName?: string;
2801
+ phone?: string;
2802
+ }, signUpOptions?: {
2803
+ customClaims?: Record<string, any>;
2804
+ templateId?: string;
2805
+ templateOptions?: {
2806
+ [x: string]: string;
2807
+ };
2808
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2809
+ maskedPhone: string;
2810
+ }>>;
2811
+ voice: (loginId: string, URI: string, user?: {
2812
+ email?: string;
2813
+ name?: string;
2814
+ givenName?: string;
2815
+ middleName?: string;
2816
+ familyName?: string;
2817
+ phone?: string;
2818
+ }, signUpOptions?: {
2819
+ customClaims?: Record<string, any>;
2820
+ templateId?: string;
2821
+ templateOptions?: {
2822
+ [x: string]: string;
2823
+ };
2824
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2825
+ maskedPhone: string;
2826
+ }>>;
2827
+ whatsapp: (loginId: string, URI: string, user?: {
2828
+ email?: string;
2829
+ name?: string;
2830
+ givenName?: string;
2831
+ middleName?: string;
2832
+ familyName?: string;
2833
+ phone?: string;
2834
+ }, signUpOptions?: {
2835
+ customClaims?: Record<string, any>;
2836
+ templateId?: string;
2837
+ templateOptions?: {
2838
+ [x: string]: string;
2839
+ };
2840
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2841
+ maskedPhone: string;
2842
+ }>>;
2843
+ email: (loginId: string, URI: string, user?: {
2844
+ email?: string;
2845
+ name?: string;
2846
+ givenName?: string;
2847
+ middleName?: string;
2848
+ familyName?: string;
2849
+ phone?: string;
2850
+ }, signUpOptions?: {
2851
+ customClaims?: Record<string, any>;
2852
+ templateId?: string;
2853
+ templateOptions?: {
2854
+ [x: string]: string;
2855
+ };
2856
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2857
+ maskedEmail: string;
2858
+ }>>;
2859
+ };
2860
+ signUpOrIn: {
2861
+ sms: (loginId: string, URI?: string, signUpOptions?: {
2862
+ customClaims?: Record<string, any>;
2863
+ templateId?: string;
2864
+ templateOptions?: {
2865
+ [x: string]: string;
2866
+ };
2867
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2868
+ maskedPhone: string;
2869
+ }>>;
2870
+ voice: (loginId: string, URI?: string, signUpOptions?: {
2871
+ customClaims?: Record<string, any>;
2872
+ templateId?: string;
2873
+ templateOptions?: {
2874
+ [x: string]: string;
2875
+ };
2876
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2877
+ maskedPhone: string;
2878
+ }>>;
2879
+ whatsapp: (loginId: string, URI?: string, signUpOptions?: {
2880
+ customClaims?: Record<string, any>;
2881
+ templateId?: string;
2882
+ templateOptions?: {
2883
+ [x: string]: string;
2884
+ };
2885
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2886
+ maskedPhone: string;
2887
+ }>>;
2888
+ email: (loginId: string, URI?: string, signUpOptions?: {
2889
+ customClaims?: Record<string, any>;
2890
+ templateId?: string;
2891
+ templateOptions?: {
2892
+ [x: string]: string;
2893
+ };
2894
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2895
+ maskedEmail: string;
2896
+ }>>;
2897
+ };
2898
+ update: {
2899
+ email: <T_2 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
2900
+ addToLoginIDs?: T_2;
2901
+ onMergeUseExisting?: T_2 extends true ? boolean : never;
2902
+ templateOptions?: {
2903
+ [x: string]: string;
2904
+ };
2905
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2906
+ maskedEmail: string;
2907
+ }>>;
2908
+ phone: {
2909
+ sms: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
2910
+ addToLoginIDs?: T_3;
2911
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
2912
+ templateOptions?: {
2913
+ [x: string]: string;
2914
+ };
2915
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2916
+ maskedPhone: string;
2917
+ }>>;
2918
+ voice: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
2919
+ addToLoginIDs?: T_3;
2920
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
2921
+ templateOptions?: {
2922
+ [x: string]: string;
2923
+ };
2924
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2925
+ maskedPhone: string;
2926
+ }>>;
2927
+ whatsapp: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
2928
+ addToLoginIDs?: T_3;
2929
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
2930
+ templateOptions?: {
2931
+ [x: string]: string;
2932
+ };
2933
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2934
+ maskedPhone: string;
2935
+ }>>;
2936
+ };
2937
+ };
2938
+ };
2939
+ enchantedLink: {
2940
+ verify: (token: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
2941
+ signIn: (loginId: string, URI?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
2942
+ signUpOrIn: (loginId: string, URI?: string, signUpOptions?: {
2943
+ customClaims?: Record<string, any>;
2944
+ templateId?: string;
2945
+ templateOptions?: {
2946
+ [x: string]: string;
2947
+ };
2948
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
2949
+ signUp: (loginId: string, URI?: string, user?: {
2950
+ email?: string;
2951
+ name?: string;
2952
+ givenName?: string;
2953
+ middleName?: string;
2954
+ familyName?: string;
2955
+ phone?: string;
2956
+ }, signUpOptions?: {
2957
+ customClaims?: Record<string, any>;
2958
+ templateId?: string;
2959
+ templateOptions?: {
2960
+ [x: string]: string;
2961
+ };
2962
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
2963
+ waitForSession: (pendingRef: string, config?: {
2964
+ pollingIntervalMs: number;
2965
+ timeoutMs: number;
2966
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2967
+ update: {
2968
+ email: <T_4 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
2969
+ addToLoginIDs?: T_4;
2970
+ onMergeUseExisting?: T_4 extends true ? boolean : never;
2971
+ templateOptions?: {
2972
+ [x: string]: string;
2973
+ };
2974
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
2975
+ };
2976
+ };
2977
+ oauth: {
2978
+ start: ((provider: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>) & {
2979
+ google: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2980
+ facebook: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2981
+ github: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2982
+ microsoft: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2983
+ gitlab: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2984
+ apple: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2985
+ discord: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2986
+ linkedin: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2987
+ slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2988
+ };
2989
+ exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2990
+ startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
2991
+ finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
2992
+ };
2993
+ saml: {
2994
+ start: (tenantIdOrEmail: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2995
+ exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2996
+ };
2997
+ totp: {
2998
+ signUp: (loginId: string, user?: {
2999
+ email?: string;
3000
+ name?: string;
3001
+ givenName?: string;
3002
+ middleName?: string;
3003
+ familyName?: string;
3004
+ phone?: string;
3005
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
3006
+ verify: (loginId: string, code: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3007
+ update: (loginId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
3008
+ };
3009
+ notp: {
3010
+ signUpOrIn: (loginId?: string, signUpOptions?: {
3011
+ customClaims?: Record<string, any>;
3012
+ templateId?: string;
3013
+ templateOptions?: {
3014
+ [x: string]: string;
3015
+ };
3016
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3017
+ pendingRef: string;
3018
+ redirectUrl: string;
3019
+ image: string;
3020
+ }>>;
3021
+ signUp: (loginId?: string, user?: {
3022
+ email?: string;
3023
+ name?: string;
3024
+ givenName?: string;
3025
+ middleName?: string;
3026
+ familyName?: string;
3027
+ phone?: string;
3028
+ }, signUpOptions?: {
3029
+ customClaims?: Record<string, any>;
3030
+ templateId?: string;
3031
+ templateOptions?: {
3032
+ [x: string]: string;
3033
+ };
3034
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3035
+ pendingRef: string;
3036
+ redirectUrl: string;
3037
+ image: string;
3038
+ }>>;
3039
+ signIn: (loginId?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
3040
+ pendingRef: string;
3041
+ redirectUrl: string;
3042
+ image: string;
3043
+ }>>;
3044
+ waitForSession: (pendingRef: string, config?: {
3045
+ pollingIntervalMs: number;
3046
+ timeoutMs: number;
3047
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3048
+ };
3049
+ password: {
3050
+ signUp: (loginId: string, password: string, user?: {
3051
+ email?: string;
3052
+ name?: string;
3053
+ givenName?: string;
3054
+ middleName?: string;
3055
+ familyName?: string;
3056
+ phone?: string;
3057
+ }, signUpOptions?: {
3058
+ customClaims?: Record<string, any>;
3059
+ templateId?: string;
3060
+ templateOptions?: {
3061
+ [x: string]: string;
3062
+ };
3063
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3064
+ signIn: (loginId: string, password: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3065
+ sendReset: (loginId: string, redirectUrl?: string, templateOptions?: {
3066
+ [x: string]: string;
3067
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3068
+ resetMethod: string;
3069
+ pendingRef?: string;
3070
+ linkId?: string;
3071
+ maskedEmail: string;
3072
+ }>>;
3073
+ update: (loginId: string, newPassword: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
3074
+ replace: (loginId: string, oldPassword: string, newPassword: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3075
+ policy: () => Promise<_descope_core_js_sdk.SdkResponse<{
3076
+ minLength: number;
3077
+ lowercase: boolean;
3078
+ uppercase: boolean;
3079
+ number: boolean;
3080
+ nonAlphanumeric: boolean;
3081
+ }>>;
3082
+ };
3083
+ selectTenant: (tenantId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3084
+ logout: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
3085
+ logoutAll: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
3086
+ logoutPrevious: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1870
3087
  me: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserResponse>>;
1871
3088
  myTenants: (tenants: true | string[], token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1872
3089
  tenants: {
@@ -2473,6 +3690,7 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
2473
3690
  selectTenant: (tenantId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2474
3691
  logout: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
2475
3692
  logoutAll: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
3693
+ logoutPrevious: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
2476
3694
  me: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserResponse>>;
2477
3695
  myTenants: (tenants: true | string[], token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2478
3696
  tenants: {