@descope/node-sdk 2.10.0 → 2.12.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/README.md +31 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.d.ts +335 -4
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -315,6 +315,9 @@ declare type SSOApplication = {
|
|
|
315
315
|
oidcSettings: SSOApplicationOIDCSettings;
|
|
316
316
|
wsfedSettings?: SSOApplicationWSFedSettings;
|
|
317
317
|
};
|
|
318
|
+
declare type SSOApplicationSecretResponse = {
|
|
319
|
+
cleartext: string;
|
|
320
|
+
};
|
|
318
321
|
/** Represents a permission in a project. It has a name and optionally a description.
|
|
319
322
|
* It also has a flag indicating whether it is system default or not.
|
|
320
323
|
*/
|
|
@@ -659,6 +662,44 @@ declare type AuditRecord = {
|
|
|
659
662
|
tenants: string[];
|
|
660
663
|
data: Record<string, any>;
|
|
661
664
|
};
|
|
665
|
+
/** Response for the searchAll audit method, including the total number of matching records. */
|
|
666
|
+
declare type AuditSearchAllResponse = {
|
|
667
|
+
audits: AuditRecord[];
|
|
668
|
+
total: number;
|
|
669
|
+
};
|
|
670
|
+
/** Basic authentication for an HTTP connector. */
|
|
671
|
+
declare type ConnectorHTTPBasicAuthentication = {
|
|
672
|
+
username?: string;
|
|
673
|
+
password?: string;
|
|
674
|
+
};
|
|
675
|
+
/** API key authentication for an HTTP connector. */
|
|
676
|
+
declare type ConnectorHTTPAPIKeyAuthentication = {
|
|
677
|
+
key?: string;
|
|
678
|
+
token?: string;
|
|
679
|
+
};
|
|
680
|
+
/** Authentication configuration for an HTTP connector. */
|
|
681
|
+
declare type ConnectorHTTPAuthentication = {
|
|
682
|
+
bearerToken?: string;
|
|
683
|
+
basic?: ConnectorHTTPBasicAuthentication;
|
|
684
|
+
apiKey?: ConnectorHTTPAPIKeyAuthentication;
|
|
685
|
+
};
|
|
686
|
+
/** Filters that determine which audit events are streamed by an audit webhook. */
|
|
687
|
+
declare type AuditFilters = {
|
|
688
|
+
key?: string;
|
|
689
|
+
operator?: string;
|
|
690
|
+
values?: string[];
|
|
691
|
+
};
|
|
692
|
+
/** Configuration for an audit webhook connector. */
|
|
693
|
+
declare type AuditWebhook = {
|
|
694
|
+
name: string;
|
|
695
|
+
description?: string;
|
|
696
|
+
url?: string;
|
|
697
|
+
authentication?: ConnectorHTTPAuthentication;
|
|
698
|
+
hmacSecret?: string;
|
|
699
|
+
headers?: Record<string, string>;
|
|
700
|
+
insecure?: boolean;
|
|
701
|
+
filters?: AuditFilters[];
|
|
702
|
+
};
|
|
662
703
|
declare type UserStatus = 'enabled' | 'disabled' | 'invited' | 'expired';
|
|
663
704
|
declare type AuthzNodeExpressionType = 'self' | 'targetSet' | 'relationLeft' | 'relationRight';
|
|
664
705
|
/**
|
|
@@ -837,6 +878,31 @@ interface FGAResourceDetails {
|
|
|
837
878
|
resourceType: string;
|
|
838
879
|
displayName: string;
|
|
839
880
|
}
|
|
881
|
+
declare type FGASchemaDryRunResponse = {
|
|
882
|
+
deletesPreview?: {
|
|
883
|
+
hasDeletes: boolean;
|
|
884
|
+
relations?: string[];
|
|
885
|
+
types?: string[];
|
|
886
|
+
};
|
|
887
|
+
};
|
|
888
|
+
declare type FGAMappableResource = {
|
|
889
|
+
resource: string;
|
|
890
|
+
};
|
|
891
|
+
declare type FGAMappableResources = {
|
|
892
|
+
type: string;
|
|
893
|
+
resources: FGAMappableResource[];
|
|
894
|
+
};
|
|
895
|
+
declare type FGAMappableSchema = {
|
|
896
|
+
schema?: AuthzSchema | null;
|
|
897
|
+
mappableResources?: FGAMappableResources[];
|
|
898
|
+
};
|
|
899
|
+
declare type FGAMappableResourcesQuery = {
|
|
900
|
+
type: string;
|
|
901
|
+
queries: string[];
|
|
902
|
+
};
|
|
903
|
+
declare type FGAMappableResourcesOptions = {
|
|
904
|
+
resourcesLimit?: number;
|
|
905
|
+
};
|
|
840
906
|
/**
|
|
841
907
|
* Configuration for FGA cache proxy support.
|
|
842
908
|
* When fgaCacheUrl is provided along with managementKey, certain FGA operations
|
|
@@ -932,6 +998,11 @@ declare type InboundApplicationConsentDeleteOptions = {
|
|
|
932
998
|
appId?: string;
|
|
933
999
|
userIds?: string[];
|
|
934
1000
|
};
|
|
1001
|
+
declare type InboundApplicationTenantConsentDeleteOptions = {
|
|
1002
|
+
consentIds?: string[];
|
|
1003
|
+
appId?: string;
|
|
1004
|
+
tenantId?: string;
|
|
1005
|
+
};
|
|
935
1006
|
declare type PromptType = 'none' | 'login' | 'consent' | 'select_account';
|
|
936
1007
|
declare type AccessType = 'offline' | 'online';
|
|
937
1008
|
declare type OutboundApplication = {
|
|
@@ -1161,6 +1232,173 @@ declare type MgmtKeyCreateResponse = {
|
|
|
1161
1232
|
declare type License = {
|
|
1162
1233
|
rateLimitTier: string;
|
|
1163
1234
|
};
|
|
1235
|
+
/** Represents an engine in a project. `secret` is populated only on create and
|
|
1236
|
+
* rotateSecret; it is always empty on load/loadAll. */
|
|
1237
|
+
declare type Engine = {
|
|
1238
|
+
id: string;
|
|
1239
|
+
name: string;
|
|
1240
|
+
secret?: string;
|
|
1241
|
+
createdTime?: number;
|
|
1242
|
+
};
|
|
1243
|
+
/** Response of an engine secret rotation. */
|
|
1244
|
+
declare type EngineSecretResponse = {
|
|
1245
|
+
secret: string;
|
|
1246
|
+
};
|
|
1247
|
+
/** A single option for a custom attribute of type "select". */
|
|
1248
|
+
declare type CustomAttributeOption = {
|
|
1249
|
+
value?: string;
|
|
1250
|
+
label?: string;
|
|
1251
|
+
};
|
|
1252
|
+
/** Represents a custom attribute definition in the project schema. */
|
|
1253
|
+
declare type CustomAttribute = {
|
|
1254
|
+
name?: string;
|
|
1255
|
+
type?: number;
|
|
1256
|
+
options?: CustomAttributeOption[];
|
|
1257
|
+
displayName?: string;
|
|
1258
|
+
defaultValue?: any;
|
|
1259
|
+
viewPermissions?: string[];
|
|
1260
|
+
editPermissions?: string[];
|
|
1261
|
+
};
|
|
1262
|
+
/** A registered passkey (WebAuthn credential) for a user. */
|
|
1263
|
+
declare type UserPasskey = {
|
|
1264
|
+
id?: string;
|
|
1265
|
+
rpId?: string;
|
|
1266
|
+
kind?: string;
|
|
1267
|
+
displayName?: string;
|
|
1268
|
+
createdTime?: number;
|
|
1269
|
+
};
|
|
1270
|
+
/** A trusted device associated with a user. */
|
|
1271
|
+
declare type UserTrustedDevice = {
|
|
1272
|
+
id?: string;
|
|
1273
|
+
name?: string;
|
|
1274
|
+
deviceType?: string;
|
|
1275
|
+
lastLoginTime?: number;
|
|
1276
|
+
expirationTime?: number;
|
|
1277
|
+
lastLocation?: string;
|
|
1278
|
+
};
|
|
1279
|
+
/** A single failure entry returned from a user import. */
|
|
1280
|
+
declare type UserImportFailure = {
|
|
1281
|
+
user: string;
|
|
1282
|
+
reason: string;
|
|
1283
|
+
};
|
|
1284
|
+
/** Response of a user import operation. */
|
|
1285
|
+
declare type UserImportResponse = {
|
|
1286
|
+
users?: UserResponse[];
|
|
1287
|
+
failures?: UserImportFailure[];
|
|
1288
|
+
};
|
|
1289
|
+
/** Request to update an existing permission by its ID as part of a batch update. */
|
|
1290
|
+
declare type PermissionUpdateRequest = {
|
|
1291
|
+
id: string;
|
|
1292
|
+
newName: string;
|
|
1293
|
+
description?: string;
|
|
1294
|
+
};
|
|
1295
|
+
/** Request to update an existing role by its ID as part of a batch update. */
|
|
1296
|
+
declare type RoleUpdateRequest = {
|
|
1297
|
+
id: string;
|
|
1298
|
+
newName: string;
|
|
1299
|
+
description?: string;
|
|
1300
|
+
permissionNames?: string[];
|
|
1301
|
+
tenantId?: string;
|
|
1302
|
+
default?: boolean;
|
|
1303
|
+
};
|
|
1304
|
+
/** The type of a project list (currently "ip" or "text"). */
|
|
1305
|
+
declare type ListType = string;
|
|
1306
|
+
/** Represents a project list of IPs or texts. */
|
|
1307
|
+
declare type List = {
|
|
1308
|
+
id?: string;
|
|
1309
|
+
name?: string;
|
|
1310
|
+
description?: string;
|
|
1311
|
+
type?: ListType;
|
|
1312
|
+
data?: any;
|
|
1313
|
+
};
|
|
1314
|
+
/** Request payload for creating or updating a list. */
|
|
1315
|
+
declare type ListRequest = {
|
|
1316
|
+
name: string;
|
|
1317
|
+
description?: string;
|
|
1318
|
+
type: ListType;
|
|
1319
|
+
data?: any;
|
|
1320
|
+
};
|
|
1321
|
+
/** Represents a JWT template configuration. */
|
|
1322
|
+
declare type JWTTemplate = {
|
|
1323
|
+
id?: string;
|
|
1324
|
+
name?: string;
|
|
1325
|
+
description?: string;
|
|
1326
|
+
template?: Record<string, any>;
|
|
1327
|
+
source?: string;
|
|
1328
|
+
tags?: string[];
|
|
1329
|
+
authSchema?: string;
|
|
1330
|
+
type?: string;
|
|
1331
|
+
conformanceIssuer?: boolean;
|
|
1332
|
+
autoDCT?: boolean;
|
|
1333
|
+
enforceIssuer?: boolean;
|
|
1334
|
+
emptyClaimPolicy?: string;
|
|
1335
|
+
overrideSubject?: boolean;
|
|
1336
|
+
issuerType?: string;
|
|
1337
|
+
omitCustomClaimsFromDSR?: boolean;
|
|
1338
|
+
addJti?: boolean;
|
|
1339
|
+
excludePermissions?: boolean;
|
|
1340
|
+
};
|
|
1341
|
+
/** A single validation issue found while validating a JWT template. */
|
|
1342
|
+
declare type JWTTemplateValidationIssue = {
|
|
1343
|
+
message?: string;
|
|
1344
|
+
severity?: string;
|
|
1345
|
+
path?: string;
|
|
1346
|
+
};
|
|
1347
|
+
/** Result of validating a JWT template. */
|
|
1348
|
+
declare type JWTTemplateValidationResult = {
|
|
1349
|
+
valid: boolean;
|
|
1350
|
+
issues?: JWTTemplateValidationIssue[];
|
|
1351
|
+
};
|
|
1352
|
+
/** A JWT template entry available in the shared template library. */
|
|
1353
|
+
declare type JWTTemplateLibraryEntry = JWTTemplate & {
|
|
1354
|
+
experimental?: boolean;
|
|
1355
|
+
logoLight?: string;
|
|
1356
|
+
logoDark?: string;
|
|
1357
|
+
};
|
|
1358
|
+
/** Request payload for applying a JWT template from the library. */
|
|
1359
|
+
declare type ApplyJWTTemplateFromLibraryRequest = {
|
|
1360
|
+
libraryEntryId: string;
|
|
1361
|
+
nameOverride?: string;
|
|
1362
|
+
descriptionOverride?: string;
|
|
1363
|
+
tagsOverride?: string[];
|
|
1364
|
+
templateOverride?: Record<string, any>;
|
|
1365
|
+
};
|
|
1366
|
+
/** A single scope-to-claims mapping entry. */
|
|
1367
|
+
declare type ScopeClaimMappingEntry = {
|
|
1368
|
+
scope?: string;
|
|
1369
|
+
claims?: Record<string, string>;
|
|
1370
|
+
description?: string;
|
|
1371
|
+
};
|
|
1372
|
+
/** Options for searching analytics records. Time fields are epoch milliseconds. */
|
|
1373
|
+
declare type AnalyticsSearchOptions = {
|
|
1374
|
+
actions?: string[];
|
|
1375
|
+
excludedActions?: string[];
|
|
1376
|
+
from?: number;
|
|
1377
|
+
to?: number;
|
|
1378
|
+
devices?: string[];
|
|
1379
|
+
methods?: string[];
|
|
1380
|
+
geos?: string[];
|
|
1381
|
+
tenants?: string[];
|
|
1382
|
+
groupByAction?: boolean;
|
|
1383
|
+
groupByDevice?: boolean;
|
|
1384
|
+
groupByMethod?: boolean;
|
|
1385
|
+
groupByGeo?: boolean;
|
|
1386
|
+
groupByTenant?: boolean;
|
|
1387
|
+
groupByReferrer?: boolean;
|
|
1388
|
+
groupByCreated?: string;
|
|
1389
|
+
};
|
|
1390
|
+
/** A single analytics record returned from an analytics search. */
|
|
1391
|
+
declare type AnalyticRecord = {
|
|
1392
|
+
projectId?: string;
|
|
1393
|
+
action?: string;
|
|
1394
|
+
created?: string;
|
|
1395
|
+
device?: string;
|
|
1396
|
+
method?: string;
|
|
1397
|
+
geo?: string;
|
|
1398
|
+
tenant?: string;
|
|
1399
|
+
referrer?: string;
|
|
1400
|
+
cnt?: string;
|
|
1401
|
+
};
|
|
1164
1402
|
|
|
1165
1403
|
interface PatchUserOptions {
|
|
1166
1404
|
email?: string;
|
|
@@ -1350,10 +1588,22 @@ declare const nodeSdk: {
|
|
|
1350
1588
|
removeAllPasskeys: (loginId: string) => Promise<SdkResponse<never>>;
|
|
1351
1589
|
removeTOTPSeed: (loginId: string) => Promise<SdkResponse<never>>;
|
|
1352
1590
|
history: (userIds: string[]) => Promise<SdkResponse<_descope_core_js_sdk.UserHistoryResponse[]>>;
|
|
1591
|
+
import: (source: string, users?: string | Uint8Array, hashes?: string | Uint8Array, dryrun?: boolean) => Promise<SdkResponse<UserImportResponse>>;
|
|
1592
|
+
updateRecoveryEmail: (loginIdOrUserId: string, email: string, isVerified?: boolean) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
|
|
1593
|
+
updateRecoveryPhone: (loginIdOrUserId: string, phone: string, isVerified?: boolean) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
|
|
1594
|
+
updateUserNames: (loginIdOrUserId: string, givenName?: string, middleName?: string, familyName?: string) => Promise<SdkResponse<_descope_core_js_sdk.UserResponse>>;
|
|
1595
|
+
getCustomAttributes: () => Promise<SdkResponse<CustomAttribute[]>>;
|
|
1596
|
+
createCustomAttributes: (attributes: CustomAttribute[]) => Promise<SdkResponse<CustomAttribute[]>>;
|
|
1597
|
+
deleteCustomAttributes: (names: string[]) => Promise<SdkResponse<CustomAttribute[]>>;
|
|
1598
|
+
removePasskey: (loginId: string, credentialId: string) => Promise<SdkResponse<never>>;
|
|
1599
|
+
listPasskeys: (loginId: string) => Promise<SdkResponse<UserPasskey[]>>;
|
|
1600
|
+
listTrustedDevices: (loginIdsOrUserIds: string[]) => Promise<SdkResponse<UserTrustedDevice[]>>;
|
|
1601
|
+
removeTrustedDevices: (loginIdOrUserId: string, deviceIds: string[]) => Promise<SdkResponse<never>>;
|
|
1353
1602
|
};
|
|
1354
1603
|
project: {
|
|
1355
1604
|
updateName: (name: string) => Promise<SdkResponse<never>>;
|
|
1356
1605
|
updateTags: (tags: string[]) => Promise<SdkResponse<never>>;
|
|
1606
|
+
delete: () => Promise<SdkResponse<never>>;
|
|
1357
1607
|
clone: (name: string, environment?: "production", tags?: string[]) => Promise<SdkResponse<CloneProjectResponse>>;
|
|
1358
1608
|
listProjects: () => Promise<SdkResponse<Project[]>>;
|
|
1359
1609
|
exportSnapshot: () => Promise<SdkResponse<ExportSnapshotResponse>>;
|
|
@@ -1368,8 +1618,12 @@ declare const nodeSdk: {
|
|
|
1368
1618
|
searchAll: (tenantIds?: string[], boundUserId?: string, creatingUser?: string, customAttributes?: Record<string, any>) => Promise<SdkResponse<AccessKey[]>>;
|
|
1369
1619
|
update: (id: string, name: string, description?: string, roles?: string[], tenants?: AssociatedTenant[], customClaims?: Record<string, any>, permittedIps?: string[], customAttributes?: Record<string, any>) => Promise<SdkResponse<AccessKey>>;
|
|
1370
1620
|
deactivate: (id: string) => Promise<SdkResponse<never>>;
|
|
1621
|
+
deactivateBatch: (ids: string[]) => Promise<SdkResponse<never>>;
|
|
1371
1622
|
activate: (id: string) => Promise<SdkResponse<never>>;
|
|
1623
|
+
activateBatch: (ids: string[]) => Promise<SdkResponse<never>>;
|
|
1372
1624
|
delete: (id: string) => Promise<SdkResponse<never>>;
|
|
1625
|
+
deleteBatch: (ids: string[]) => Promise<SdkResponse<never>>;
|
|
1626
|
+
rotate: (id: string) => Promise<SdkResponse<CreatedAccessKeyResponse>>;
|
|
1373
1627
|
};
|
|
1374
1628
|
tenant: {
|
|
1375
1629
|
create: (name: string, selfProvisioningDomains?: string[], customAttributes?: Record<string, AttributesTypes>, enforceSSO?: boolean, disabled?: boolean, parent?: string, roleInheritance?: "" | "none" | "userOnly") => Promise<SdkResponse<CreateTenantResponse>>;
|
|
@@ -1383,6 +1637,7 @@ declare const nodeSdk: {
|
|
|
1383
1637
|
getSettings: (tenantId: string) => Promise<SdkResponse<TenantSettings>>;
|
|
1384
1638
|
configureSettings: (tenantId: string, settings: TenantSettings) => Promise<SdkResponse<never>>;
|
|
1385
1639
|
generateSSOConfigurationLink: (tenantId: string, expireDuration: number, ssoId?: string, email?: string, templateId?: string, actorId?: string) => Promise<SdkResponse<GenerateSSOConfigurationLinkResponse>>;
|
|
1640
|
+
revokeSSOConfigurationLink: (tenantId: string, ssoId?: string) => Promise<SdkResponse<never>>;
|
|
1386
1641
|
};
|
|
1387
1642
|
ssoApplication: {
|
|
1388
1643
|
createOidcApplication: (options: OidcApplicationOptions) => Promise<SdkResponse<CreateSSOApplicationResponse>>;
|
|
@@ -1400,6 +1655,8 @@ declare const nodeSdk: {
|
|
|
1400
1655
|
delete: (id: string) => Promise<SdkResponse<never>>;
|
|
1401
1656
|
load: (id: string) => Promise<SdkResponse<SSOApplication>>;
|
|
1402
1657
|
loadAll: () => Promise<SdkResponse<SSOApplication[]>>;
|
|
1658
|
+
getApplicationSecret: (id: string) => Promise<SdkResponse<SSOApplicationSecretResponse>>;
|
|
1659
|
+
rotateApplicationSecret: (id: string) => Promise<SdkResponse<SSOApplicationSecretResponse>>;
|
|
1403
1660
|
};
|
|
1404
1661
|
inboundApplication: {
|
|
1405
1662
|
createApplication: (options: InboundApplicationOptions) => Promise<SdkResponse<CreateInboundApplicationResponse>>;
|
|
@@ -1410,12 +1667,14 @@ declare const nodeSdk: {
|
|
|
1410
1667
|
id: string;
|
|
1411
1668
|
}) => Promise<SdkResponse<never>>;
|
|
1412
1669
|
deleteApplication: (id: string) => Promise<SdkResponse<never>>;
|
|
1670
|
+
deleteApplicationBatch: (ids: string[]) => Promise<SdkResponse<never>>;
|
|
1413
1671
|
loadApplication: (id: string) => Promise<SdkResponse<InboundApplication>>;
|
|
1414
1672
|
loadAllApplications: () => Promise<SdkResponse<InboundApplication[]>>;
|
|
1415
1673
|
getApplicationSecret: (id: string) => Promise<SdkResponse<InboundApplicationSecretResponse>>;
|
|
1416
1674
|
rotateApplicationSecret: (id: string) => Promise<SdkResponse<never>>;
|
|
1417
1675
|
searchConsents: (options?: InboundApplicationConsentSearchOptions) => Promise<SdkResponse<InboundApplicationConsent[]>>;
|
|
1418
1676
|
deleteConsents: (options: InboundApplicationConsentDeleteOptions) => Promise<SdkResponse<never>>;
|
|
1677
|
+
deleteTenantConsents: (options: InboundApplicationTenantConsentDeleteOptions) => Promise<SdkResponse<never>>;
|
|
1419
1678
|
};
|
|
1420
1679
|
outboundApplication: {
|
|
1421
1680
|
createApplication: (app: Omit<OutboundApplication, "id"> & Partial<Pick<OutboundApplication, "id">> & {
|
|
@@ -1452,12 +1711,15 @@ declare const nodeSdk: {
|
|
|
1452
1711
|
configureOIDCSettings: (tenantId: string, settings: SSOOIDCSettings, domains?: string[], ssoId?: string) => Promise<SdkResponse<never>>;
|
|
1453
1712
|
configureSAMLSettings: (tenantId: string, settings: SSOSAMLSettings, redirectUrl?: string, domains?: string[], ssoId?: string) => Promise<SdkResponse<never>>;
|
|
1454
1713
|
configureSAMLByMetadata: (tenantId: string, settings: SSOSAMLByMetadataSettings, redirectUrl?: string, domains?: string[], ssoId?: string) => Promise<SdkResponse<never>>;
|
|
1714
|
+
configureSSORedirectURL: (tenantId: string, samlRedirectUrl?: string, oauthRedirectUrl?: string, ssoId?: string) => Promise<SdkResponse<never>>;
|
|
1715
|
+
recalculateSSOMappings: (tenantId: string, ssoId?: string) => Promise<SdkResponse<never>>;
|
|
1455
1716
|
loadSettings: (tenantId: string, ssoId?: string) => Promise<SdkResponse<SSOSettings>>;
|
|
1456
1717
|
loadAllSettings: (tenantId: string) => Promise<SdkResponse<SSOSettings[]>>;
|
|
1457
1718
|
};
|
|
1458
1719
|
jwt: {
|
|
1459
1720
|
update: (jwt: string, customClaims?: Record<string, any>, refreshDuration?: number) => Promise<SdkResponse<UpdateJWTResponse>>;
|
|
1460
1721
|
impersonate: (impersonatorId: string, loginId: string, validateConsent: boolean, customClaims?: Record<string, any>, selectedTenant?: string, refreshDuration?: number) => Promise<SdkResponse<UpdateJWTResponse>>;
|
|
1722
|
+
impersonateStepup: (impersonatorId: string, loginId: string, validateConsent: boolean, customClaims?: Record<string, any>, selectedTenant?: string, refreshDuration?: number) => Promise<SdkResponse<UpdateJWTResponse>>;
|
|
1461
1723
|
stopImpersonation: (jwt: string, customClaims?: Record<string, any>, selectedTenant?: string, refreshDuration?: number) => Promise<SdkResponse<UpdateJWTResponse>>;
|
|
1462
1724
|
signIn: (loginId: string, loginOptions?: MgmtLoginOptions) => Promise<SdkResponse<JWTResponse>>;
|
|
1463
1725
|
signUp: (loginId: string, user?: MgmtUserOptions, signUpOptions?: MgmtSignUpOptions) => Promise<SdkResponse<JWTResponse>>;
|
|
@@ -1479,8 +1741,13 @@ declare const nodeSdk: {
|
|
|
1479
1741
|
};
|
|
1480
1742
|
permission: {
|
|
1481
1743
|
create: (name: string, description?: string) => Promise<SdkResponse<never>>;
|
|
1744
|
+
createBatch: (permissions: Permission[]) => Promise<SdkResponse<never>>;
|
|
1482
1745
|
update: (name: string, newName: string, description?: string) => Promise<SdkResponse<never>>;
|
|
1746
|
+
updateWithId: (id: string, newName: string, description?: string) => Promise<SdkResponse<never>>;
|
|
1747
|
+
updateBatch: (permissions: PermissionUpdateRequest[]) => Promise<SdkResponse<never>>;
|
|
1483
1748
|
delete: (name: string) => Promise<SdkResponse<never>>;
|
|
1749
|
+
deleteWithId: (id: string) => Promise<SdkResponse<never>>;
|
|
1750
|
+
deleteBatch: (names?: string[], ids?: string[]) => Promise<SdkResponse<never>>;
|
|
1484
1751
|
loadAll: () => Promise<SdkResponse<Permission[]>>;
|
|
1485
1752
|
};
|
|
1486
1753
|
password: {
|
|
@@ -1489,8 +1756,14 @@ declare const nodeSdk: {
|
|
|
1489
1756
|
};
|
|
1490
1757
|
role: {
|
|
1491
1758
|
create: (name: string, description?: string, permissionNames?: string[], tenantId?: string, defaultRole?: boolean) => Promise<SdkResponse<never>>;
|
|
1759
|
+
createBatch: (roles: Role[]) => Promise<SdkResponse<Role[]>>;
|
|
1760
|
+
/** Configuration arguments which include the Descope core SDK args and an optional management key */
|
|
1492
1761
|
update: (name: string, newName: string, description?: string, permissionNames?: string[], tenantId?: string, defaultRole?: boolean) => Promise<SdkResponse<never>>;
|
|
1762
|
+
updateWithId: (id: string, newName: string, description?: string, permissionNames?: string[], tenantId?: string, defaultRole?: boolean) => Promise<SdkResponse<never>>;
|
|
1763
|
+
updateBatch: (roles: RoleUpdateRequest[]) => Promise<SdkResponse<Role[]>>;
|
|
1493
1764
|
delete: (name: string, tenantId?: string) => Promise<SdkResponse<never>>;
|
|
1765
|
+
deleteWithId: (id: string, tenantId?: string) => Promise<SdkResponse<never>>;
|
|
1766
|
+
deleteBatch: (roleNames?: string[], tenantId?: string, roleIds?: string[]) => Promise<SdkResponse<never>>;
|
|
1494
1767
|
loadAll: () => Promise<SdkResponse<Role[]>>;
|
|
1495
1768
|
search: (options: RoleSearchOptions) => Promise<SdkResponse<Role[]>>;
|
|
1496
1769
|
};
|
|
@@ -1512,7 +1785,9 @@ declare const nodeSdk: {
|
|
|
1512
1785
|
};
|
|
1513
1786
|
audit: {
|
|
1514
1787
|
search: (searchOptions: AuditSearchOptions) => Promise<SdkResponse<AuditRecord[]>>;
|
|
1788
|
+
searchAll: (searchOptions: AuditSearchOptions) => Promise<SdkResponse<AuditSearchAllResponse>>;
|
|
1515
1789
|
createEvent: (createOptions: AuditCreateOptions) => Promise<SdkResponse<never>>;
|
|
1790
|
+
createAuditWebhook: (options: AuditWebhook) => Promise<SdkResponse<never>>;
|
|
1516
1791
|
};
|
|
1517
1792
|
authz: {
|
|
1518
1793
|
saveSchema: (schema: AuthzSchema, upgrade: boolean) => Promise<SdkResponse<never>>;
|
|
@@ -1530,19 +1805,26 @@ declare const nodeSdk: {
|
|
|
1530
1805
|
hasRelations: (relationQueries: AuthzRelationQuery[]) => Promise<SdkResponse<AuthzRelationQuery[]>>;
|
|
1531
1806
|
whoCanAccess: (resource: string, relationDefinition: string, namespace: string) => Promise<SdkResponse<string[]>>;
|
|
1532
1807
|
resourceRelations: (resource: string, ignoreTargetSetRelations?: boolean) => Promise<SdkResponse<AuthzRelation[]>>;
|
|
1808
|
+
resourceRelationsWithTargetSetsFilter: (resource: string, includeTargetSetRelations?: boolean) => Promise<SdkResponse<AuthzRelation[]>>;
|
|
1533
1809
|
targetsRelations: (targets: string[], includeTargetSetRelations?: boolean) => Promise<SdkResponse<AuthzRelation[]>>;
|
|
1810
|
+
targetsRelationsWithTargetSetsFilter: (targets: string[], includeTargetSetRelations?: boolean) => Promise<SdkResponse<AuthzRelation[]>>;
|
|
1534
1811
|
whatCanTargetAccess: (target: string) => Promise<SdkResponse<AuthzRelation[]>>;
|
|
1535
1812
|
whatCanTargetAccessWithRelation: (target: string, relationDefinition: string, namespace: string) => Promise<SdkResponse<AuthzResource[]>>;
|
|
1536
1813
|
getModified: (since: Date) => Promise<SdkResponse<AuthzModified>>;
|
|
1537
1814
|
};
|
|
1538
1815
|
fga: {
|
|
1539
1816
|
saveSchema: (schema: FGASchema) => Promise<SdkResponse<never>>;
|
|
1817
|
+
loadSchema: () => Promise<SdkResponse<FGASchema>>;
|
|
1818
|
+
dryRunSchema: (schema: FGASchema) => Promise<SdkResponse<FGASchemaDryRunResponse>>;
|
|
1540
1819
|
deleteSchema: () => Promise<SdkResponse<never>>;
|
|
1541
1820
|
createRelations: (relations: FGARelation[]) => Promise<SdkResponse<never>>;
|
|
1542
1821
|
deleteRelations: (relations: FGARelation[]) => Promise<SdkResponse<never>>;
|
|
1543
1822
|
check: (relations: FGARelation[]) => Promise<SdkResponse<CheckResponseRelation[]>>;
|
|
1823
|
+
checkWithContext: (relations: FGARelation[], context?: Record<string, any>) => Promise<SdkResponse<CheckResponseRelation[]>>;
|
|
1544
1824
|
loadResourcesDetails: (resourceIdentifiers: FGAResourceIdentifier[]) => Promise<SdkResponse<FGAResourceDetails[]>>;
|
|
1545
1825
|
saveResourcesDetails: (resourcesDetails: FGAResourceDetails[]) => Promise<SdkResponse<never>>;
|
|
1826
|
+
loadMappableSchema: (tenantId: string, options?: FGAMappableResourcesOptions) => Promise<SdkResponse<FGAMappableSchema>>;
|
|
1827
|
+
searchMappableResources: (tenantId: string, resourcesQueries: FGAMappableResourcesQuery[], options?: FGAMappableResourcesOptions) => Promise<SdkResponse<FGAMappableResources[]>>;
|
|
1546
1828
|
deleteAllRelations: () => Promise<SdkResponse<never>>;
|
|
1547
1829
|
};
|
|
1548
1830
|
descoper: {
|
|
@@ -1565,6 +1847,49 @@ declare const nodeSdk: {
|
|
|
1565
1847
|
load: (id: string) => Promise<SdkResponse<MgmtKey>>;
|
|
1566
1848
|
search: () => Promise<SdkResponse<MgmtKey[]>>;
|
|
1567
1849
|
};
|
|
1850
|
+
engine: {
|
|
1851
|
+
create: (name: string) => Promise<SdkResponse<Engine>>;
|
|
1852
|
+
update: (id: string, name: string) => Promise<SdkResponse<Engine>>;
|
|
1853
|
+
delete: (id: string) => Promise<SdkResponse<never>>;
|
|
1854
|
+
load: (id: string) => Promise<SdkResponse<Engine>>;
|
|
1855
|
+
loadAll: () => Promise<SdkResponse<Engine[]>>;
|
|
1856
|
+
rotateSecret: (id: string) => Promise<SdkResponse<EngineSecretResponse>>;
|
|
1857
|
+
};
|
|
1858
|
+
list: {
|
|
1859
|
+
create: (request: ListRequest) => Promise<SdkResponse<List>>;
|
|
1860
|
+
update: (id: string, request: ListRequest) => Promise<SdkResponse<List>>;
|
|
1861
|
+
delete: (id: string) => Promise<SdkResponse<never>>;
|
|
1862
|
+
load: (id: string) => Promise<SdkResponse<List>>;
|
|
1863
|
+
loadByName: (name: string) => Promise<SdkResponse<List>>;
|
|
1864
|
+
loadAll: () => Promise<SdkResponse<List[]>>;
|
|
1865
|
+
import: (lists: List[]) => Promise<SdkResponse<never>>;
|
|
1866
|
+
addIPs: (id: string, ips: string[]) => Promise<SdkResponse<never>>;
|
|
1867
|
+
removeIPs: (id: string, ips: string[]) => Promise<SdkResponse<never>>;
|
|
1868
|
+
checkIP: (id: string, ip: string) => Promise<SdkResponse<any>>;
|
|
1869
|
+
addTexts: (id: string, texts: string[]) => Promise<SdkResponse<never>>;
|
|
1870
|
+
removeTexts: (id: string, texts: string[]) => Promise<SdkResponse<never>>;
|
|
1871
|
+
checkText: (id: string, text: string) => Promise<SdkResponse<any>>;
|
|
1872
|
+
clear: (id: string) => Promise<SdkResponse<never>>;
|
|
1873
|
+
};
|
|
1874
|
+
jwtTemplate: {
|
|
1875
|
+
create: (template: JWTTemplate) => Promise<SdkResponse<JWTTemplate>>;
|
|
1876
|
+
update: (template: JWTTemplate) => Promise<SdkResponse<JWTTemplate>>;
|
|
1877
|
+
delete: (id: string) => Promise<SdkResponse<never>>;
|
|
1878
|
+
list: () => Promise<SdkResponse<JWTTemplate[]>>;
|
|
1879
|
+
load: (id: string) => Promise<SdkResponse<JWTTemplate>>;
|
|
1880
|
+
validate: (id: string, template?: JWTTemplate) => Promise<SdkResponse<JWTTemplateValidationResult>>;
|
|
1881
|
+
listLibrary: () => Promise<SdkResponse<JWTTemplateLibraryEntry[]>>;
|
|
1882
|
+
loadLibraryEntry: (id: string) => Promise<SdkResponse<JWTTemplateLibraryEntry>>;
|
|
1883
|
+
applyFromLibrary: (request: ApplyJWTTemplateFromLibraryRequest) => Promise<SdkResponse<JWTTemplate>>;
|
|
1884
|
+
};
|
|
1885
|
+
scopeClaimMapping: {
|
|
1886
|
+
get: () => Promise<SdkResponse<ScopeClaimMappingEntry[]>>;
|
|
1887
|
+
set: (mappings: ScopeClaimMappingEntry[]) => Promise<SdkResponse<never>>;
|
|
1888
|
+
delete: () => Promise<SdkResponse<never>>;
|
|
1889
|
+
};
|
|
1890
|
+
analytics: {
|
|
1891
|
+
search: (options: AnalyticsSearchOptions) => Promise<SdkResponse<AnalyticRecord[]>>;
|
|
1892
|
+
};
|
|
1568
1893
|
};
|
|
1569
1894
|
getKey: (header: JWTHeaderParameters) => Promise<KeyLike | Uint8Array>;
|
|
1570
1895
|
validateJwt: (jwt: string, options?: VerifyOptions) => Promise<AuthenticationInfo>;
|
|
@@ -2114,6 +2439,10 @@ declare const nodeSdk: {
|
|
|
2114
2439
|
externalIdentifier?: string;
|
|
2115
2440
|
}, token?: string) => Promise<SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
2116
2441
|
};
|
|
2442
|
+
sso: {
|
|
2443
|
+
start: (tenantIdOrEmail: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, ssoId?: string, forceAuthn?: boolean, loginHint?: string, enforceInitiatedEmail?: boolean) => Promise<SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
2444
|
+
exchange: (code: string) => Promise<SdkResponse<JWTResponse>>;
|
|
2445
|
+
};
|
|
2117
2446
|
saml: {
|
|
2118
2447
|
start: (tenantIdOrEmail: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, ssoId?: string, forceAuthn?: boolean, loginHint?: string, enforceInitiatedEmail?: boolean) => Promise<SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
2119
2448
|
exchange: (code: string) => Promise<SdkResponse<JWTResponse & {
|
|
@@ -2218,12 +2547,14 @@ declare const nodeSdk: {
|
|
|
2218
2547
|
}>>;
|
|
2219
2548
|
};
|
|
2220
2549
|
update: {
|
|
2221
|
-
start: (loginId: string, origin: string, token?: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<SdkResponse<{
|
|
2550
|
+
start: (loginId: string, origin: string, token?: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions, mfa?: boolean) => Promise<SdkResponse<{
|
|
2222
2551
|
transactionId: string;
|
|
2223
2552
|
options: string;
|
|
2224
2553
|
create: boolean;
|
|
2225
2554
|
}>>;
|
|
2226
|
-
finish: (transactionId: string, response: string) => Promise<SdkResponse<
|
|
2555
|
+
finish: (transactionId: string, response: string) => Promise<SdkResponse<{
|
|
2556
|
+
jwt?: JWTResponse;
|
|
2557
|
+
}>>;
|
|
2227
2558
|
};
|
|
2228
2559
|
};
|
|
2229
2560
|
password: {
|
|
@@ -2283,7 +2614,7 @@ declare const nodeSdk: {
|
|
|
2283
2614
|
webAuthnSupport?: boolean;
|
|
2284
2615
|
};
|
|
2285
2616
|
lastAuth?: {
|
|
2286
|
-
authMethod?: "saml" | "otp" | "oauth" | "totp" | "webauthn" | "magiclink" | "enchantedlink";
|
|
2617
|
+
authMethod?: "saml" | "otp" | "oauth" | "sso" | "totp" | "webauthn" | "magiclink" | "enchantedlink";
|
|
2287
2618
|
oauthProvider?: string;
|
|
2288
2619
|
name?: string;
|
|
2289
2620
|
loginId?: string;
|
|
@@ -2377,4 +2708,4 @@ declare const nodeSdk: {
|
|
|
2377
2708
|
};
|
|
2378
2709
|
};
|
|
2379
2710
|
|
|
2380
|
-
export { AccessKey, AccessType, AssociatedTenant, AttributeMapping, AttributesTypes, AuditCreateOptions, AuditRecord, AuditSearchOptions, AuditType, AuthenticationInfo, AuthzModified, AuthzNamespace, AuthzNode, AuthzNodeExpression, AuthzNodeExpressionType, AuthzNodeType, AuthzRelation, AuthzRelationDefinition, AuthzRelationQuery, AuthzResource, AuthzSchema, AuthzUserQuery, BatchUploadOutboundAppTokensResponse, CheckResponseRelation, ClientAssertionResponse, CloneProjectResponse, CreateInboundApplicationResponse, CreateOrInviteBatchResponse, CreateOutboundAppByTemplateOptions, CreateSSOApplicationResponse, CreateTenantResponse, CreatedAccessKeyResponse, Descoper, DescoperAttributes, DescoperCreate, DescoperProjectRole, DescoperRBAC, DescoperRole, DescoperTagRole, ExpirationUnit, ExportSnapshotResponse, FGAConfig, FGARelation, FGAResourceDetails, FGAResourceIdentifier, FGASchema, FetchLatestOutboundAppTenantTokenRequest, FetchLatestOutboundAppUserTokenRequest, FetchOutboundAppTenantTokenRequest, FetchOutboundAppTokenOptions, FetchOutboundAppUserTokenRequest, Flow, FlowMetadata, FlowResponse, FlowsResponse, GenerateEmbeddedLinkResponse, GenerateEnchantedLinkForTestResponse, GenerateMagicLinkForTestResponse, GenerateOTPForTestResponse, GenerateSSOConfigurationLinkResponse, Group, GroupMember, GroupsMapping, IDPResponse, ImportSnapshotRequest, InboundApplication, InboundApplicationConsent, InboundApplicationConsentDeleteOptions, InboundApplicationConsentSearchOptions, InboundApplicationOptions, InboundApplicationScope, InboundApplicationSecretResponse, License, ManagementFlowOptions, MgmtKey, MgmtKeyCreateResponse, MgmtKeyProjectRole, MgmtKeyReBac, MgmtKeyStatus, MgmtKeyTagRole, MgmtLoginOptions, MgmtSignUpOptions, MgmtUserOptions, OIDCAttributeMapping, OIDCRoleMapping, OidcApplicationOptions, OutboundAppTemplateOverrides, OutboundAppTenantTokenToUpload, OutboundAppToken, OutboundAppTokenResponse, OutboundAppTokenUploadFailure, OutboundAppUserTokenToUpload, OutboundApplication, PasswordSettings, PatchUserBatchResponse, PatchUserOptions, Permission, Project, ProjectEnvironment, Prompt, PromptType, ProviderTokenOptions, ProviderTokenResponse, RefreshAuthenticationInfo, Role, RoleItem, RoleMapping, RoleMappings, RoleSearchOptions, RunManagementFlowResponse, SAMLIDPRoleGroupMappingInfo, SSOApplication, SSOApplicationOIDCSettings, SSOApplicationSAMLSettings, SSOApplicationWSFedSettings, SSOOIDCSettings, SSOSAMLByMetadataSettings, SSOSAMLSettings, SSOSAMLSettingsResponse, SSOSettings, SSOSettingsResponse, SSOSetupSuiteSettings, SSOSetupSuiteSettingsDisabledFeatures, SamlApplicationOptions, SamlIdpAttributeMappingInfo, SamlIdpGroupsMappingInfo, Screen, SnapshotSecret, SnapshotSecrets, TemplateOptions, Tenant, TenantSettings, Theme, ThemeResponse, URLParam, UpdateJWTResponse, UploadOutboundAppTenantTokenRequest, UploadOutboundAppUserTokenRequest, User, UserFailedResponse, UserMapping, UserOptions, UserPasswordBcrypt, UserPasswordDjango, UserPasswordFirebase, UserPasswordHashed, UserPasswordMd5, UserPasswordPbkdf2, UserPasswordPhpass, UserSearchResponse, UserStatus, ValidateSnapshotRequest, ValidateSnapshotResponse, VerifyOptions, WsFedApplicationOptions, nodeSdk as default };
|
|
2711
|
+
export { AccessKey, AccessType, AnalyticRecord, AnalyticsSearchOptions, ApplyJWTTemplateFromLibraryRequest, AssociatedTenant, AttributeMapping, AttributesTypes, AuditCreateOptions, AuditFilters, AuditRecord, AuditSearchAllResponse, AuditSearchOptions, AuditType, AuditWebhook, AuthenticationInfo, AuthzModified, AuthzNamespace, AuthzNode, AuthzNodeExpression, AuthzNodeExpressionType, AuthzNodeType, AuthzRelation, AuthzRelationDefinition, AuthzRelationQuery, AuthzResource, AuthzSchema, AuthzUserQuery, BatchUploadOutboundAppTokensResponse, CheckResponseRelation, ClientAssertionResponse, CloneProjectResponse, ConnectorHTTPAPIKeyAuthentication, ConnectorHTTPAuthentication, ConnectorHTTPBasicAuthentication, CreateInboundApplicationResponse, CreateOrInviteBatchResponse, CreateOutboundAppByTemplateOptions, CreateSSOApplicationResponse, CreateTenantResponse, CreatedAccessKeyResponse, CustomAttribute, CustomAttributeOption, Descoper, DescoperAttributes, DescoperCreate, DescoperProjectRole, DescoperRBAC, DescoperRole, DescoperTagRole, Engine, EngineSecretResponse, ExpirationUnit, ExportSnapshotResponse, FGAConfig, FGAMappableResource, FGAMappableResources, FGAMappableResourcesOptions, FGAMappableResourcesQuery, FGAMappableSchema, FGARelation, FGAResourceDetails, FGAResourceIdentifier, FGASchema, FGASchemaDryRunResponse, FetchLatestOutboundAppTenantTokenRequest, FetchLatestOutboundAppUserTokenRequest, FetchOutboundAppTenantTokenRequest, FetchOutboundAppTokenOptions, FetchOutboundAppUserTokenRequest, Flow, FlowMetadata, FlowResponse, FlowsResponse, GenerateEmbeddedLinkResponse, GenerateEnchantedLinkForTestResponse, GenerateMagicLinkForTestResponse, GenerateOTPForTestResponse, GenerateSSOConfigurationLinkResponse, Group, GroupMember, GroupsMapping, IDPResponse, ImportSnapshotRequest, InboundApplication, InboundApplicationConsent, InboundApplicationConsentDeleteOptions, InboundApplicationConsentSearchOptions, InboundApplicationOptions, InboundApplicationScope, InboundApplicationSecretResponse, InboundApplicationTenantConsentDeleteOptions, JWTTemplate, JWTTemplateLibraryEntry, JWTTemplateValidationIssue, JWTTemplateValidationResult, License, List, ListRequest, ListType, ManagementFlowOptions, MgmtKey, MgmtKeyCreateResponse, MgmtKeyProjectRole, MgmtKeyReBac, MgmtKeyStatus, MgmtKeyTagRole, MgmtLoginOptions, MgmtSignUpOptions, MgmtUserOptions, OIDCAttributeMapping, OIDCRoleMapping, OidcApplicationOptions, OutboundAppTemplateOverrides, OutboundAppTenantTokenToUpload, OutboundAppToken, OutboundAppTokenResponse, OutboundAppTokenUploadFailure, OutboundAppUserTokenToUpload, OutboundApplication, PasswordSettings, PatchUserBatchResponse, PatchUserOptions, Permission, PermissionUpdateRequest, Project, ProjectEnvironment, Prompt, PromptType, ProviderTokenOptions, ProviderTokenResponse, RefreshAuthenticationInfo, Role, RoleItem, RoleMapping, RoleMappings, RoleSearchOptions, RoleUpdateRequest, RunManagementFlowResponse, SAMLIDPRoleGroupMappingInfo, SSOApplication, SSOApplicationOIDCSettings, SSOApplicationSAMLSettings, SSOApplicationSecretResponse, SSOApplicationWSFedSettings, SSOOIDCSettings, SSOSAMLByMetadataSettings, SSOSAMLSettings, SSOSAMLSettingsResponse, SSOSettings, SSOSettingsResponse, SSOSetupSuiteSettings, SSOSetupSuiteSettingsDisabledFeatures, SamlApplicationOptions, SamlIdpAttributeMappingInfo, SamlIdpGroupsMappingInfo, ScopeClaimMappingEntry, Screen, SnapshotSecret, SnapshotSecrets, TemplateOptions, Tenant, TenantSettings, Theme, ThemeResponse, URLParam, UpdateJWTResponse, UploadOutboundAppTenantTokenRequest, UploadOutboundAppUserTokenRequest, User, UserFailedResponse, UserImportFailure, UserImportResponse, UserMapping, UserOptions, UserPasskey, UserPasswordBcrypt, UserPasswordDjango, UserPasswordFirebase, UserPasswordHashed, UserPasswordMd5, UserPasswordPbkdf2, UserPasswordPhpass, UserSearchResponse, UserStatus, UserTrustedDevice, ValidateSnapshotRequest, ValidateSnapshotResponse, VerifyOptions, WsFedApplicationOptions, nodeSdk as default };
|