import { AxiosRequestConfig, AxiosResponse, AxiosInstance } from 'axios'; import { Reader } from 'properties-reader'; interface NoIdObjectSkeletonInterface { _rev?: string; [k: string]: string | number | boolean | string[] | IdObjectSkeletonInterface | object | undefined; } interface IdObjectSkeletonInterface extends NoIdObjectSkeletonInterface { _id?: string; } interface AmConfigEntityInterface extends IdObjectSkeletonInterface { _type?: EntityType; } type Readable = Type; type Writable = { inherited: boolean; value?: Type; }; type PagedResult = { result: Type[]; resultCount: number; pagedResultsCookie: string; totalPagedResultsPolicy: 'EXACT' | 'NONE'; totalPagedResults: number; remainingPagedResults: number; }; type EntityType = IdObjectSkeletonInterface & { name: string; collection: boolean; }; interface FeatureInterface extends IdObjectSkeletonInterface { installedVersion: string; availableVersions: string[]; } type CallbackType = 'NameCallback' | 'PasswordCallback' | 'TextInputCallback'; type CallbackKeyValuePair = { name: string; value: any; }; type Callback = { type: CallbackType; output: CallbackKeyValuePair[]; input: CallbackKeyValuePair[]; }; type CallbackHandler = (callback: Callback) => Callback; type Jose = { createJwkRsa(): Promise; getJwkRsaPublic(jwkJson: JwkRsa): Promise; createJwks(...keys: JwkInterface[]): JwksInterface; createSignedJwtToken(payload: string | object, jwkJson: JwkRsa): Promise; verifySignedJwtToken(jwt: string, jwkJson: JwkRsaPublic): Promise; }; interface JwkInterface { kty: string; use?: string; key_ops?: string[]; alg: string; kid?: string; x5u?: string; x5c?: string; x5t?: string; 'x5t#S256'?: string; } type JwkRsa = JwkInterface & { d: string; dp: string; dq: string; e: string; n: string; p: string; q: string; qi: string; }; type JwkRsaPublic = JwkInterface & { e: string; n: string; }; interface JwksInterface { keys: JwkInterface[]; } type AccessTokenResponseType = { access_token: string; id_token?: string; scope: string; token_type: string; expires_in: number; }; type TokenInfoResponseType = { sub: string; cts: string; auditTrackingId: string; subname: string; iss: string; tokenName: string; token_type: string; authGrantId: string; access_token: string; aud: string; nbf: number; grant_type: string; scope: string[]; auth_time: number; sessionToken?: string; realm: string; exp: number; iat: number; expires_in: number; jti: string; [k: string]: string | number | string[]; }; type AccessTokenMetaType = AccessTokenResponseType & { expires: number; from_cache?: boolean; }; type OAuth2Oidc = { authorize(amBaseUrl: string, data: string, config: AxiosRequestConfig): Promise>; accessToken(amBaseUrl: string, data: any, config: AxiosRequestConfig): Promise; accessTokenRfc7523AuthZGrant(clientId: string, jwt: string, scope: string[], config?: AxiosRequestConfig): Promise; getTokenInfo(amBaseUrl: string, config: AxiosRequestConfig): Promise; clientCredentialsGrant(amBaseUrl: string, clientId: string, clientSecret: string, scope: string): Promise; }; type Authenticate = { /** * Get tokens and store them in State * @param {boolean} forceLoginAsUser true to force login as user even if a service account is available (default: false) * @param {boolean} autoRefresh true to automatically refresh tokens before they expire (default: true) * @param {string[]} types Array of supported deployment types. The function will throw an error if an unsupported type is detected (default: ['classic', 'cloud', 'forgeops']) * @param {CallbackHandler} callbackHandler function allowing the library to collect responses from the user through callbacks * @returns {Promise} object containing the tokens */ getTokens(forceLoginAsUser?: boolean, autoRefresh?: boolean, types?: string[], callbackHandler?: CallbackHandler): Promise; /** * Get access token for service account * @param {string} saId optional service account id * @param {JwkRsa} saJwk optional service account JWK * @returns {string | null} Access token or null * @deprecated since v2.0.0 use {@link Authenticate.getTokens | getTokens} instead * ```javascript * getTokens(): Promise * ``` * @group Deprecated */ getAccessTokenForServiceAccount(saId?: string, saJwk?: JwkRsa): Promise; }; type UserSessionMetaType = { tokenId: string; successUrl: string; realm: string; expires: number; from_cache?: boolean; }; type Tokens = { bearerToken?: AccessTokenMetaType; userSessionToken?: UserSessionMetaType; subject?: string; host?: string; realm?: string; }; type ProgressIndicatorType = 'determinate' | 'indeterminate'; type ProgressIndicatorStatusType = 'none' | 'success' | 'warn' | 'fail'; type State = { /** * Get a clone of the full state as an object * @returns a clone of the state */ getState(): StateInterface; /** * Set the AM host base URL * @param host Access Management base URL, e.g.: https://cdk.iam.example.com/am. To use a connection profile, just specify a unique substring. */ setHost(host: string): void; /** * Get the AM host base URL * @returns the AM host base URL */ getHost(): string; /** * Set the IDM host base URL * @param host Identity Management base URL, e.g.: https://cdk.iam.example.com/openidm. To use a connection profile, just specify a unique substring. */ setIdmHost(host: string): void; /** * Get the IDM host base URL * @returns the IDM host base URL */ getIdmHost(): string; setUsername(username: string): void; getUsername(): string; setPassword(password: string): void; getPassword(): string; setRealm(realm: string): void; getRealm(): string; setUseRealmPrefixOnManagedObjects(useRealmPrefixOnManagedObjects: boolean): void; getUseRealmPrefixOnManagedObjects(): boolean; setDeploymentType(type: string): void; getDeploymentType(): string; setAdminClientId(type: string): void; getAdminClientId(): string; setAdminClientRedirectUri(type: string): void; getAdminClientRedirectUri(): string; setAllowInsecureConnection(allowInsecureConnection: boolean): void; getAllowInsecureConnection(): boolean; setCookieName(name: string): void; getCookieName(): string; setUserSessionTokenMeta(value: UserSessionMetaType): void; getCookieValue(): string; getUserSessionTokenMeta(): UserSessionMetaType; setFeatures(features: FeatureInterface[]): void; getFeatures(): FeatureInterface[]; setAuthenticationHeaderOverrides(overrides: Record): void; getAuthenticationHeaderOverrides(): Record; setAuthenticationService(service: string): void; getAuthenticationService(): string; setServiceAccountId(uuid: string): void; getServiceAccountId(): string; setServiceAccountJwk(jwk: JwkRsa): void; getServiceAccountJwk(): JwkRsa; setServiceAccountScope(scope: string): void; getServiceAccountScope(): string; setUseBearerTokenForAmApis(useBearerTokenForAmApis: boolean): void; getUseBearerTokenForAmApis(): boolean; setBearerTokenMeta(token: AccessTokenMetaType): void; getBearerToken(): string; getBearerTokenMeta(): AccessTokenMetaType; setLogApiKey(key: string): void; getLogApiKey(): string; setLogApiSecret(secret: string): void; getLogApiSecret(): string; setAmVersion(version: string): void; getAmVersion(): string; setFrodoVersion(version: string): void; getFrodoVersion(): string; setConnectionProfilesPath(path: string): void; getConnectionProfilesPath(): string; setUseTokenCache(useTokenCache: boolean): void; getUseTokenCache(): boolean; setTokenCachePath(path: string): void; getTokenCachePath(): string; setMasterKeyPath(path: string): void; getMasterKeyPath(): string; setOutputFile(file: string): void; getOutputFile(): string; setDirectory(directory: string): void; getDirectory(): string; setAutoRefreshTimer(timer: NodeJS.Timeout): void; getAutoRefreshTimer(): NodeJS.Timeout; setCurlirizeHandler(handler: (message: string) => void): void; getCurlirizeHandler(): (message: string) => void; setCurlirize(curlirize: boolean): void; getCurlirize(): boolean; setCreateProgressHandler(handler: (type: ProgressIndicatorType, total?: number, message?: string) => string): void; getCreateProgressHandler(): (type: ProgressIndicatorType, total?: number, message?: string) => string; setUpdateProgressHandler(handler: (id: string, message: string) => void): void; getUpdateProgressHandler(): (id: string, message: string) => void; setStopProgressHandler(handler: (id: string, message: string, status?: ProgressIndicatorStatusType) => void): void; getStopProgressHandler(): (id: string, message: string, status?: ProgressIndicatorStatusType) => void; setPrintHandler(handler: (message: string | object, type?: string, newline?: boolean) => void): void; getPrintHandler(): (message: string | object, type?: string, newline?: boolean) => void; setErrorHandler(handler: (error: Error, message?: string) => void): void; getErrorHandler(): (error: Error, message?: string) => void; setVerboseHandler(handler: (message: string | object) => void): void; getVerboseHandler(): (message: string | object) => void; setVerbose(verbose: boolean): void; getVerbose(): boolean; setDebugHandler(handler: (message: string | object) => void): void; getDebugHandler(): (message: string | object) => void; setDebug(debug: boolean): void; getDebug(): boolean; /** * Reset the state to default values */ reset(): void; /** * @deprecated since v0.17.0 use `setHost(host: string)` instead */ setTenant(tenant: string): void; /** * @deprecated since v0.17.0 use `getHost` instead */ getTenant(): string; }; interface StateInterface { host?: string; idmHost?: string; username?: string; password?: string; realm?: string; useRealmPrefixOnManagedObjects?: boolean; deploymentType?: string; adminClientId?: string; adminClientRedirectUri?: string; allowInsecureConnection?: boolean; authenticationHeaderOverrides?: Record; authenticationService?: string; cookieName?: string; userSessionToken?: UserSessionMetaType; features?: FeatureInterface[]; serviceAccountId?: string; serviceAccountJwk?: JwkRsa; serviceAccountScope?: string; useBearerTokenForAmApis?: boolean; bearerToken?: AccessTokenMetaType; logApiKey?: string; logApiSecret?: string; amVersion?: string; frodoVersion?: string; connectionProfilesPath?: string; useTokenCache?: boolean; tokenCachePath?: string; masterKeyPath?: string; outputFile?: string; directory?: string; autoRefreshTimer?: NodeJS.Timeout; printHandler?: (message: string | object, type?: string, newline?: boolean) => void; errorHandler?: (error: Error, message: string) => void; verboseHandler?: (message: string | object) => void; verbose?: boolean; debugHandler?: (message: string | object) => void; debug?: boolean; curlirizeHandler?: (message: string) => void; curlirize?: boolean; createProgressHandler?: (type: ProgressIndicatorType, total?: number, message?: string) => string; updateProgressHandler?: (id: string, message: string) => void; stopProgressHandler?: (id: string, message: string, status?: string) => void; } type OAuth2ClientSkeleton = AmConfigEntityInterface & { overrideOAuth2ClientConfig?: { [k: string]: string | number | boolean | string[] | object | undefined; }; advancedOAuth2ClientConfig?: { descriptions: { inherited: boolean; value: string[]; }; grantTypes?: Readable | Writable; isConsentImplied?: Readable | Writable; tokenEndpointAuthMethod?: Readable | Writable; responseTypes?: Readable | Writable; [k: string]: string | number | boolean | string[] | object | undefined; }; signEncOAuth2ClientConfig?: { jwkSet?: Readable | Writable; publicKeyLocation?: Readable | Writable; [k: string]: string | number | boolean | string[] | object | undefined; }; coreOpenIDClientConfig?: { [k: string]: string | number | boolean | string[] | object | undefined; }; coreOAuth2ClientConfig?: { userpassword?: string; clientName?: Readable | Writable; clientType?: Readable | Writable; accessTokenLifetime?: Readable | Writable; scopes?: Readable | Writable; defaultScopes?: { value: string[]; [k: string]: string | number | boolean | string[] | object | undefined; }; [k: string]: string | number | boolean | string[] | object | undefined; }; coreUmaClientConfig?: { [k: string]: string | number | boolean | string[] | object | undefined; }; }; type OAuth2TrustedJwtIssuerSkeleton = IdObjectSkeletonInterface & { allowedSubjects?: Readable | Writable; jwksCacheTimeout?: Readable | Writable; jwkSet?: Readable | Writable; consentedScopesClaim?: Readable | Writable; issuer: Readable | Writable; jwkStoreCacheMissCacheTime?: Readable | Writable; resourceOwnerIdentityClaim?: Readable | Writable; jwksUri?: Readable | Writable; _type: { _id: 'TrustedJwtIssuer'; name: 'OAuth2 Trusted JWT Issuer'; collection: true; }; }; type Admin = { generateRfc7523AuthZGrantArtefacts(clientId: string, iss: string, jwk?: JwkRsa, sub?: string, scope?: string[], options?: { save: boolean; }): Promise<{ jwk: JwkRsa; jwks: JwksInterface; client: OAuth2ClientSkeleton; issuer: OAuth2TrustedJwtIssuerSkeleton; }>; executeRfc7523AuthZGrantFlow(clientId: string, iss: string, jwk: JwkRsa, sub: string, scope?: string[]): Promise; generateRfc7523ClientAuthNArtefacts(clientId: string, aud?: string, jwk?: JwkRsa, options?: { save: boolean; }): Promise<{ jwk: JwkRsa; jwks: JwksInterface; jwt: any; client: OAuth2ClientSkeleton; }>; trainAA(apiKey: string, apiSecret: string, customUsernames?: string[], customUserAgents?: string[], customIPs?: string[], loginsPerUser?: number, service?: string): Promise; /** * @deprecated Deprecated since v2.0.0. This function may be removed in future versions. Similar functionality has been added to the frodo-cli code base. * @group Deprecated */ listOAuth2CustomClients(): Promise; /** * @deprecated Deprecated since v2.0.0. This function may be removed in future versions. Similar functionality has been added to the frodo-cli code base. * @group Deprecated */ listOAuth2AdminClients(): Promise; /** * @deprecated Deprecated since v2.0.0. This function may be removed in future versions. Similar functionality has been added to the frodo-cli code base. * @group Deprecated */ listNonOAuth2AdminStaticUserMappings(showProtected: boolean): Promise; /** * @deprecated Deprecated since v2.0.0. This function may be removed in future versions. Similar functionality has been added to the frodo-cli code base. * @group Deprecated */ addAutoIdStaticUserMapping(): Promise; /** * @deprecated Deprecated since v2.0.0. This function may be removed in future versions. Similar functionality has been added to the frodo-cli code base. * @group Deprecated */ grantOAuth2ClientAdminPrivileges(clientId: string): Promise; /** * @deprecated Deprecated since v2.0.0. This function may be removed in future versions. Similar functionality has been added to the frodo-cli code base. * @group Deprecated */ revokeOAuth2ClientAdminPrivileges(clientId: string): Promise; /** * @deprecated Deprecated since v2.0.0. This function may be removed in future versions. Similar functionality has been added to the frodo-cli code base. * @group Deprecated */ createOAuth2ClientWithAdminPrivileges(clientId: string, clientSecret: string): Promise; /** * @deprecated Deprecated since v2.0.0. This function may be removed in future versions. Similar functionality has been added to the frodo-cli code base. * @group Deprecated */ createLongLivedToken(clientId: string, clientSecret: string, scope: string, secret: string | boolean, lifetime: number): Promise; /** * @deprecated Deprecated since v2.0.0. This function may be removed in future versions. Similar functionality has been added to the frodo-cli code base. * @group Deprecated */ removeStaticUserMapping(subject: string): Promise; /** * @deprecated Deprecated since v2.0.0. This function may be removed in future versions. Similar functionality has been added to the frodo-cli code base. * @group Deprecated */ hideGenericExtensionAttributes(includeCustomized: boolean, dryRun: boolean): Promise; /** * @deprecated Deprecated since v2.0.0. This function may be removed in future versions. Similar functionality has been added to the frodo-cli code base. * @group Deprecated */ showGenericExtensionAttributes(includeCustomized: boolean, dryRun: boolean): Promise; /** * @deprecated Deprecated since v2.0.0. This function may be removed in future versions. Similar functionality has been added to the frodo-cli code base. * @group Deprecated */ repairOrgModel(excludeCustomized: boolean, extendPermissions: boolean, dryRun: boolean): Promise; }; type GatewayAgentType = 'IdentityGatewayAgent'; type JavaAgentType = 'J2EEAgent'; type WebAgentType = 'WebAgent'; type AgentType = GatewayAgentType | JavaAgentType | WebAgentType | EntityType; type AgentSkeleton = AmConfigEntityInterface; interface ExportMetaData { origin: string; originAmVersion: string; exportedBy: string; exportDate: string; exportTool: string; exportToolVersion: string; } type Agent = { /** * Create an empty agent export template * @returns {AgentExportInterface} an empty agent export template */ createAgentExportTemplate(): AgentExportInterface; /** * Read all agents. * @returns {Promise} a promise that resolves to an array of agent objects */ readAgents(): Promise; /** * Read agent * @param {string} agentId agent id/name * @returns {Promise} a promise that resolves to an agent object */ readAgent(agentId: string): Promise; /** * Read agent by type and id * @param {string} agentType agent type (IdentityGatewayAgent, J2EEAgent, WebAgent) * @param {string} agentId agent id/name * @returns {Promise} a promise that resolves to an agent object */ readAgentByTypeAndId(agentType: AgentType, agentId: string): Promise; /** * Read identity gateway agents * @returns {Promise} a promise that resolves to an array of IdentityGatewayAgent objects */ readIdentityGatewayAgents(): Promise; /** * Read identity gateway agent * @param {string} gatewayId gateway id * @returns {Promise} a promise that resolves to an object containing an IdentityGatewayAgent object */ readIdentityGatewayAgent(gatewayId: string): Promise; /** * Create identity gateway agent * @param {string} gatewayId gateway id * @param {AgentSkeleton} gatewayData IdentityGatewayAgent object * @returns {Promise} a promise that resolves to an object containing an IdentityGatewayAgent object */ createIdentityGatewayAgent(gatewayId: string, gatewayData: AgentSkeleton): Promise; /** * Update or create identity gateway agent * @param {string} gatewayId gateway id * @param {AgentSkeleton} gatewayData IdentityGatewayAgent object * @returns {Promise} a promise that resolves to an object containing an IdentityGatewayAgent object */ updateIdentityGatewayAgent(gatewayId: string, gatewayData: AgentSkeleton): Promise; /** * Read java agents * @returns {Promise} a promise that resolves to an array of J2EEAgent objects */ readJavaAgents(): Promise; /** * Read java agent * @param {string} agentId java agent id * @returns {Promise} a promise that resolves to an object containing an J2EEAgent object */ readJavaAgent(agentId: string): Promise; /** * Put java agent * @param {string} agentId java agent id * @param {AgentSkeleton} agentData java agent object * @returns {Promise} a promise that resolves to an object containing an java agent object */ createJavaAgent(agentId: string, agentData: AgentSkeleton): Promise; /** * Put java agent * @param {string} agentId java agent id * @param {AgentSkeleton} agentData java agent object * @returns {Promise} a promise that resolves to an object containing an java agent object */ updateJavaAgent(agentId: string, agentData: AgentSkeleton): Promise; /** * Read web agents * @returns {Promise} a promise that resolves to an array of WebAgent objects */ readWebAgents(): Promise; /** * Read web agent * @param {string} agentId web agent id * @returns {Promise} a promise that resolves to an object containing an WebAgent object */ readWebAgent(agentId: string): Promise; /** * Create web agent * @param {string} agentId web agent id * @param {AgentSkeleton} agentData WebAgent object * @returns {Promise} a promise that resolves to an object containing an WebAgent object */ createWebAgent(agentId: string, agentData: AgentSkeleton): Promise; /** * Update or create web agent * @param {string} agentId web agent id * @param {AgentSkeleton} agentData WebAgent object * @returns {Promise} a promise that resolves to an object containing an WebAgent object */ updateWebAgent(agentId: string, agentData: AgentSkeleton): Promise; /** * Export all agents. The response can be saved to file as is. * @returns {Promise} Promise resolving to an AgentExportInterface object. */ exportAgents(): Promise; /** * Export all identity gateway agents. The response can be saved to file as is. * @returns {Promise} Promise resolving to an AgentExportInterface object. */ exportIdentityGatewayAgents(): Promise; /** * Export all java agents. The response can be saved to file as is. * @returns {Promise} Promise resolving to an AgentExportInterface object. */ exportJavaAgents(): Promise; /** * Export all web agents. The response can be saved to file as is. * @returns {Promise} Promise resolving to an AgentExportInterface object. */ exportWebAgents(): Promise; /** * Export agent. The response can be saved to file as is. * @param agentId agent id/name * @returns {Promise} Promise resolving to an AgentExportInterface object. */ exportAgent(agentId: string): Promise; /** * Export identity gateway agent. The response can be saved to file as is. * @param agentId agent id/name * @returns {Promise} Promise resolving to an AgentExportInterface object. */ exportIdentityGatewayAgent(agentId: string): Promise; /** * Export java agent. The response can be saved to file as is. * @param agentId agent id/name * @returns {Promise} Promise resolving to an AgentExportInterface object. */ exportJavaAgent(agentId: string): Promise; /** * Export web agent. The response can be saved to file as is. * @param agentId agent id/name * @returns {Promise} Promise resolving to an AgentExportInterface object. */ exportWebAgent(agentId: string): Promise; /** * Import agents. The import data is usually read from an agent export file. * @param {AgentExportInterface} importData agent import data. * @returns {Promise} The agents that were imported. */ importAgents(importData: AgentExportInterface): Promise; /** * Import identity gateway agents. The import data is usually read from an agent export file. * @param {AgentExportInterface} importData agent import data. */ importIdentityGatewayAgents(importData: AgentExportInterface): Promise; /** * Import java agents. The import data is usually read from an agent export file. * @param {AgentExportInterface} importData agent import data. */ importJavaAgents(importData: AgentExportInterface): Promise; /** * Import web agents. The import data is usually read from an agent export file. * @param {AgentExportInterface} importData agent import data. */ importWebAgents(importData: AgentExportInterface): Promise; /** * Import agent. The import data is usually read from an agent export file. * @param {string} agentId agent id/name * @param {AgentExportInterface} importData agent import data. * @returns {Promise} Promise resolving to an agent object. */ importAgent(agentId: string, importData: AgentExportInterface): Promise; /** * Import identity gateway agent. The import data is usually read from an agent export file. * @param {string} agentId agent id/name * @param {AgentExportInterface} importData agent import data. * @returns {Promise} Promise resolving to an agent object. */ importIdentityGatewayAgent(agentId: string, importData: AgentExportInterface): Promise; /** * Import java agent. The import data is usually read from an agent export file. * @param {string} agentId agent id/name * @param {AgentExportInterface} importData agent import data. * @returns {Promise} Promise resolving to an agent object. */ importJavaAgent(agentId: string, importData: AgentExportInterface): Promise; /** * Import java agent. The import data is usually read from an agent export file. * @param {string} agentId agent id/name * @param {AgentExportInterface} importData agent import data. * @returns {Promise} Promise resolving to an agent object. */ importWebAgent(agentId: string, importData: AgentExportInterface): Promise; /** * Delete all agents */ deleteAgents(): Promise; /** * Delete agent * @param agentId agent id/name */ deleteAgent(agentId: string): Promise; /** * Delete all identity gateway agents */ deleteIdentityGatewayAgents(): Promise; /** * Delete identity gateway agent * @param agentId agent id/name */ deleteIdentityGatewayAgent(agentId: string): Promise; /** * Delete all java agents */ deleteJavaAgents(): Promise; /** * Delete java agent * @param agentId agent id/name */ deleteJavaAgent(agentId: string): Promise; /** * Delete all web agents */ deleteWebAgents(): Promise; /** * Delete web agent * @param agentId agent id/name */ deleteWebAgent(agentId: string): Promise; /** * Get all agents. * @returns {Promise} a promise that resolves to an array of agent objects * @deprecated since v2.0.0 use {@link Agent.readAgents | readAgents} instead * ```javascript * readAgents(): Promise * ``` * @group Deprecated */ getAgents(): Promise; /** * Get agent * @param {string} agentId agent id/name * @returns {Promise} a promise that resolves to an agent object * @deprecated since v2.0.0 use {@link Agent.readAgent | readAgent} instead * ```javascript * readAgent(agentId: string): Promise * ``` * @group Deprecated */ getAgent(agentId: string): Promise; /** * Get agent by type and id * @param {string} agentType agent type (IdentityGatewayAgent, J2EEAgent, WebAgent) * @param {string} agentId agent id/name * @returns {Promise} a promise that resolves to an agent object * @deprecated since v2.0.0 use {@link Agent.readAgentByTypeAndId | readAgentByTypeAndId} instead * ```javascript * readAgentByTypeAndId(agentType: AgentType, agentId: string): Promise * ``` * @group Deprecated */ getAgentByTypeAndId(agentType: AgentType, agentId: string): Promise; /** * Get identity gateway agents * @returns {Promise} a promise that resolves to an array of IdentityGatewayAgent objects * @deprecated since v2.0.0 use {@link Agent.readIdentityGatewayAgents | readIdentityGatewayAgents} instead * ```javascript * readIdentityGatewayAgents(): Promise * ``` * @group Deprecated */ getIdentityGatewayAgents(): Promise; /** * Get identity gateway agent * @param {string} gatewayId gateway id * @returns {Promise} a promise that resolves to an object containing an IdentityGatewayAgent object * @deprecated since v2.0.0 use {@link Agent.readIdentityGatewayAgent | readIdentityGatewayAgent} instead * ```javascript * readIdentityGatewayAgent(gatewayId: string): Promise * ``` * @group Deprecated */ getIdentityGatewayAgent(gatewayId: string): Promise; /** * Update or create identity gateway agent * @param {string} gatewayId gateway id * @param {AgentSkeleton} gatewayData IdentityGatewayAgent object * @returns {Promise} a promise that resolves to an object containing an IdentityGatewayAgent object * @deprecated since v2.0.0 use {@link Agent.updateIdentityGatewayAgent | updateIdentityGatewayAgent} or {@link Agent.createIdentityGatewayAgent | createIdentityGatewayAgent} instead * ```javascript * updateIdentityGatewayAgent(gatewayId: string, gatewayData: AgentSkeleton): Promise * createIdentityGatewayAgent(gatewayId: string, gatewayData: AgentSkeleton): Promise * ``` * @group Deprecated */ putIdentityGatewayAgent(gatewayId: string, gatewayData: AgentSkeleton): Promise; /** * Get java agents * @returns {romise} a promise that resolves to an array of J2EEAgent objects * @deprecated since v2.0.0 use {@link Agent.readJavaAgents | readJavaAgents} instead * ```javascript * readJavaAgents(): Promise * ``` * @group Deprecated */ getJavaAgents(): Promise; /** * Get java agent * @param {string} agentId java agent id * @returns {Promise} a promise that resolves to an object containing an J2EEAgent object * @deprecated since v2.0.0 use {@link Agent.readJavaAgent | readJavaAgent} instead * ```javascript * readJavaAgent(agentId: string): Promise * ``` * @group Deprecated */ getJavaAgent(agentId: string): Promise; /** * Update or create java agent * @param {string} agentId java agent id * @param {AgentSkeleton} agentData java agent object * @returns {Promise} a promise that resolves to an object containing an java agent object * @deprecated since v2.0.0 use {@link Agent.updateJavaAgent | updateJavaAgent} or {@link Agent.createJavaAgent | createJavaAgent} instead * ```javascript * updateJavaAgent(agentId: string, agentData: AgentSkeleton): Promise * createJavaAgent(agentId: string, agentData: AgentSkeleton): Promise * ``` * @group Deprecated */ putJavaAgent(agentId: string, agentData: AgentSkeleton): Promise; /** * Get web agents * @returns {Promise} a promise that resolves to an array of WebAgent objects * @deprecated since v2.0.0 use {@link Agent.readWebAgents | readWebAgents} instead * ```javascript * readWebAgents(): Promise * ``` * @group Deprecated */ getWebAgents(): Promise; /** * Get web agent * @param {string} agentId web agent id * @returns {Promise} a promise that resolves to an object containing an WebAgent object * @deprecated since v2.0.0 use {@link Agent.readWebAgent | readWebAgent} instead * ```javascript * readWebAgent(agentId: string): Promise * ``` * @group Deprecated */ getWebAgent(agentId: string): Promise; /** * Update or create web agent * @param {string} agentId web agent id * @param {AgentSkeleton} agentData WebAgent object * @returns {Promise} a promise that resolves to an object containing an WebAgent object * @deprecated since v2.0.0 use {@link Agent.updateWebAgent | updateWebAgent} or {@link Agent.createWebAgent | createWebAgent} instead * ```javascript * updateWebAgent(agentId: string, agentData: AgentSkeleton): Promise * createWebAgent(agentId: string, agentData: AgentSkeleton): Promise * ``` * @group Deprecated */ putWebAgent(agentId: string, agentData: AgentSkeleton): Promise; }; interface AgentExportInterface { meta?: ExportMetaData; agent: Record; } type ResourceConfig = { apiVersion?: string; }; type ApiFactory = { /** * Generates an AM Axios API instance * @param {ResourceConfig} resource Takes an object takes a resource object. example: * @param {AxiosRequestConfig} requestOverride Takes an object of AXIOS parameters that can be used to either * add on extra information or override default properties https://github.com/axios/axios#request-config * * @returns {AxiosInstance} Returns a reaady to use Axios instance */ generateAmApi(resource: ResourceConfig, requestOverride?: AxiosRequestConfig): AxiosInstance; /** * Generates an OAuth2 Axios API instance * @param {ResourceConfig} resource Takes a resource object. example: * @param {AxiosRequestConfig} requestOverride Takes an object of AXIOS parameters that can be used to either * add on extra information or override default properties https://github.com/axios/axios#request-config * * @returns {AxiosInstance} Returns a reaady to use Axios instance */ generateOauth2Api(resource: ResourceConfig, requestOverride?: AxiosRequestConfig, authenticate?: boolean): AxiosInstance; /** * Generates an IDM Axios API instance * @param {AxiosRequestConfig} requestOverride Takes an object of AXIOS parameters that can be used to either add * on extra information or override default properties https://github.com/axios/axios#request-config * * @returns {AxiosInstance} Returns a reaady to use Axios instance */ generateIdmApi(requestOverride?: AxiosRequestConfig): AxiosInstance; /** * Generates a LogKeys API Axios instance * @param {AxiosRequestConfig} requestOverride Takes an object of AXIOS parameters that can be used to either add * on extra information or override default properties https://github.com/axios/axios#request-config * * @returns {AxiosInstance} Returns a reaady to use Axios instance */ generateLogKeysApi(requestOverride?: AxiosRequestConfig): AxiosInstance; /** * Generates a Log API Axios instance * @param {AxiosRequestConfig} requestOverride Takes an object of AXIOS parameters that can be used to either add * on extra information or override default properties https://github.com/axios/axios#request-config * * @returns {AxiosInstance} Returns a reaady to use Axios instance */ generateLogApi(requestOverride?: AxiosRequestConfig): AxiosInstance; /** * Generates an Axios instance for the Identity Cloud Environment API * @param {ResourceConfig} resource Resource config object. * @param {AxiosRequestConfig} requestOverride Takes an object of AXIOS parameters that can be used to either add * on extra information or override default properties https://github.com/axios/axios#request-config * * @returns {AxiosInstance} Returns a reaady to use Axios instance */ generateEnvApi(resource: ResourceConfig, requestOverride?: AxiosRequestConfig): AxiosInstance; /** * Generates an Axios instance for the Identity Cloud Governance API * @param {ResourceConfig} resource Resource config object. * @param {AxiosRequestConfig} requestOverride Takes an object of AXIOS parameters that can be used to either add * on extra information or override default properties https://github.com/axios/axios#request-config * * @returns {AxiosInstance} Returns a reaady to use Axios instance */ generateGovernanceApi(resource: ResourceConfig, requestOverride?: AxiosRequestConfig): AxiosInstance; /** * Generates a release (Github or Npm) Axios API instance * @param {string} baseUrl Base URL for the request * @param {AxiosRequestConfig} requestOverride Takes an object of AXIOS parameters that can be used to either add * on extra information or override default properties https://github.com/axios/axios#request-config * * @returns {AxiosInstance} Returns a reaady to use Axios instance */ generateReleaseApi(baseUrl: string, requestOverride?: AxiosRequestConfig): AxiosInstance; }; type CircleOfTrustSkeleton = AmConfigEntityInterface & { status?: string; trustedProviders?: string[]; }; type Saml2ProiderLocation = 'hosted' | 'remote'; type Saml2ProviderStub = IdObjectSkeletonInterface & { entityId: string; location: Saml2ProiderLocation; roles: string[]; }; type Saml2ProviderSkeleton = IdObjectSkeletonInterface & { entityId: string; entityLocation: Saml2ProiderLocation; serviceProvider: unknown; identityProvider: { assertionProcessing?: { attributeMapper?: { attributeMapperScript?: string; }; }; advanced?: { idpAdapter?: { idpAdapterScript?: string; }; }; }; attributeQueryProvider: unknown; xacmlPolicyEnforcementPoint: unknown; }; type ScriptLanguage = 'GROOVY' | 'JAVASCRIPT'; type ScriptContext = 'OAUTH2_ACCESS_TOKEN_MODIFICATION' | 'AUTHENTICATION_CLIENT_SIDE' | 'AUTHENTICATION_TREE_DECISION_NODE' | 'AUTHENTICATION_SERVER_SIDE' | 'SOCIAL_IDP_PROFILE_TRANSFORMATION' | 'OAUTH2_VALIDATE_SCOPE' | 'CONFIG_PROVIDER_NODE' | 'OAUTH2_AUTHORIZE_ENDPOINT_DATA_PROVIDER' | 'OAUTH2_EVALUATE_SCOPE' | 'POLICY_CONDITION' | 'OIDC_CLAIMS' | 'SAML2_IDP_ADAPTER' | 'SAML2_IDP_ATTRIBUTE_MAPPER' | 'OAUTH2_MAY_ACT' | 'LIBRARY'; type ScriptSkeleton = IdObjectSkeletonInterface & { name: string; description: string; default: boolean; script: string | string[]; language: ScriptLanguage; context: ScriptContext; createdBy: string; creationDate: number; lastModifiedBy: string; lastModifiedDate: number; }; type Mapping = { /** * Create an empty mapping export template * @returns {MappingExportInterface} an empty mapping export template */ createMappingExportTemplate(): MappingExportInterface; /** * Read mappings from sync.json (legacy) * @returns {Promise} a promise that resolves to an array of mapping objects */ readSyncMappings(): Promise; /** * Read mappings * @param {string} connectorId limit mappings to connector * @param {string} moType limit mappings to managed object type * @returns {Promise} a promise that resolves to an array of mapping objects */ readMappings(connectorId?: string, moType?: string): Promise; /** * Read mapping * @param {string} mappingId id of the mapping (new: 'mapping/\', legacy: 'sync/\') * @returns {Promise} a promise that resolves an mapping object */ readMapping(mappingId: string): Promise; /** * Create mapping * @param {string} mappingId id of the mapping (new: 'mapping/\', legacy: 'sync/\') * @param {MappingSkeleton} mappingData mapping object * @returns {Promise} a promise that resolves to an mapping object */ createMapping(mappingId: string, mappingData: MappingSkeleton): Promise; /** * Update or create mapping * @param {string} mappingId id of the mapping (new: 'mapping/\', legacy: 'sync/\') * @param {MappingSkeleton} mappingData mapping object * @returns {Promise} a promise that resolves to an mapping object */ updateMapping(mappingId: string, mappingData: MappingSkeleton): Promise; /** * Update or create mappings in sync.json (legacy) * @param {MappingSkeleton} mappingData mapping object * @returns {Promise} a promise that resolves to an mapping object */ updateSyncMappings(mappings: MappingSkeleton[]): Promise; /** * Delete all mappings * @param {string} connectorId limit mappings to connector * @param {string} moType limit mappings to managed object type * @returns {Promise} a promise that resolves to an array of mapping objects */ deleteMappings(connectorId?: string, moType?: string): Promise; /** * Delete mapping * @param {string} mappingId id of the mapping (new: 'mapping/\', legacy: 'sync/\') * @returns {Promise} a promise that resolves an mapping object */ deleteMapping(mappingId: string): Promise; /** * Export mapping * @param {string} mappingId id of the mapping (new: 'mapping/\', legacy: 'sync/\') * @param {MappingExportOptions} options export options * @returns {Promise} a promise that resolves to a MappingExportInterface object */ exportMapping(mappingId: string, options?: MappingExportOptions): Promise; /** * Export all mappings * @param {MappingExportOptions} options export options * @returns {Promise} a promise that resolves to a MappingExportInterface object */ exportMappings(options?: MappingExportOptions): Promise; /** * Import mapping * @param {string} mappingId id of the mapping (new: 'mapping/\', legacy: 'sync/\') * @param {MappingExportInterface} importData import data * @param {MappingImportOptions} options import options * @returns {Promise} a promise resolving to a MappingSkeleton object */ importMapping(mappingId: string, importData: MappingExportInterface, options?: MappingImportOptions): Promise; /** * Import first mapping * @param {MappingExportInterface} importData import data * @param {MappingImportOptions} options import options * @returns {Promise} a promise resolving to a MappingSkeleton object */ importFirstMapping(importData: MappingExportInterface, options?: MappingImportOptions): Promise; /** * Import all mappings * @param {MappingExportInterface} importData import data * @param {MappingImportOptions} options import options * @returns {Promise} a promise resolving to an array of MappingSkeleton objects */ importMappings(importData: MappingExportInterface, options?: MappingImportOptions): Promise; /** * Helper that returns a boolean indicating whether the mapping is a legacy mapping or not given the id * @param {string} mappingId the mapping id * @returns {boolean} true if the mapping is a legacy mapping, false otherwise * @throws {FrodoError} if the id is invalid */ isLegacyMapping(mappingId: string): boolean; }; type MappingPolicy = { action: 'CREATE' | 'DELETE' | 'EXCEPTION' | 'IGNORE' | 'UPDATE'; situation: 'ABSENT' | 'ALL_GONE' | 'AMBIGUOUS' | 'CONFIRMED' | 'FOUND' | 'FOUND_ALREADY_LINKED' | 'LINK_ONLY' | 'MISSING' | 'SOURCE_IGNORED' | 'SOURCE_MISSING' | 'TARGET_IGNORED' | 'UNASSIGNED' | 'UNQUALIFIED'; }; type MappingProperty = { source?: string; target: string; transform?: { globals: any; source: string; type: string; }; }; type MappingSkeleton = IdObjectSkeletonInterface & { name: string; displayName?: string; linkQualifiers?: string[]; consentRequired?: boolean; policies?: MappingPolicy[]; properties?: MappingProperty[]; source?: string; target?: string; syncAfter?: string[]; }; type SyncSkeleton = IdObjectSkeletonInterface & { mappings: MappingSkeleton[]; }; interface MappingExportInterface { meta?: ExportMetaData; mapping: Record; sync: SyncSkeleton; } /** * Mapping export options */ interface MappingExportOptions { /** * Use string arrays to store multi-line text in scripts. */ useStringArrays: boolean; /** * Include any dependencies. */ deps: boolean; /** * limit mappings to connector */ connectorId?: string; /** * limit mappings to managed object type */ moType?: string; } /** * Mapping import options */ interface MappingImportOptions { /** * Include any dependencies. */ deps: boolean; } type Connector = { /** * Connector type key used to build the IDM id: '/' */ CONNECTOR_TYPE: string; /** * Create an empty connector export template * @returns {ConnectorExportInterface} an empty connector export template */ createConnectorExportTemplate(): ConnectorExportInterface; /** * Get all connectors * @returns {Promise} a promise that resolves to an array of connector objects */ readConnectors(): Promise; /** * Get connector * @param {string} connectorId id/name of the connector without the type prefix * @returns {Promise} a promise that resolves an connector object */ readConnector(connectorId: string): Promise; /** * Create connector * @param {string} connectorId id/name of the connector without the type prefix * @param {ConnectorSkeleton} connectorData connector object * @returns {Promise} a promise that resolves to an connector object */ createConnector(connectorId: string, connectorData: ConnectorSkeleton): Promise; /** * Update or create connector * @param {string} connectorId id/name of the connector without the type prefix * @param {ConnectorSkeleton} connectorData connector object * @returns {Promise} a promise that resolves to an connector object */ updateConnector(connectorId: string, connectorData: ConnectorSkeleton): Promise; /** * Delete all connectors * @returns {Promise} a promise that resolves to an array of connector objects */ deleteConnectors(): Promise; /** * Delete connector * @param {string} connectorId id/name of the connector without the type prefix * @returns {Promise} a promise that resolves an connector object */ deleteConnector(connectorId: string): Promise; /** * Export connector * @param {string} connectorId id/name of the connector without the type prefix * @param {ConnectorExportOptions} options export options * @returns {Promise} a promise that resolves to a ConnectorExportInterface object */ exportConnector(connectorId: string, options?: ConnectorExportOptions): Promise; /** * Export all connectors * @returns {Promise} a promise that resolves to a ConnectorExportInterface object */ exportConnectors(): Promise; /** * Import connector * @param {string} connectorId id/name of the connector without the type prefix * @param {ConnectorExportInterface} importData import data * @param {ConnectorImportOptions} options import options * @returns {Promise} a promise resolving to a ConnectorSkeleton object */ importConnector(connectorId: string, importData: ConnectorExportInterface, options?: ConnectorImportOptions): Promise; /** * Import first connector * @param {ConnectorExportInterface} importData import data * @param {ConnectorImportOptions} options import options * @returns {Promise} a promise resolving to a ConnectorSkeleton object */ importFirstConnector(importData: ConnectorExportInterface, options?: ConnectorImportOptions): Promise; /** * Import all connectors * @param {ConnectorExportInterface} importData import data * @param {ConnectorImportOptions} options import options * @returns {Promise} a promise resolving to an array of ConnectorSkeleton objects */ importConnectors(importData: ConnectorExportInterface, options?: ConnectorImportOptions): Promise; }; type ObjectPropertyFlag = 'NOT_CREATABLE' | 'NOT_READABLE' | 'NOT_RETURNED_BY_DEFAULT' | 'NOT_UPDATEABLE'; type ObjectPropertyType = 'array' | 'boolean' | 'string'; type ObjectPropertyNativeType = 'array' | 'boolean' | 'string' | 'JAVA_TYPE_BIGDECIMAL' | 'JAVA_TYPE_BIGINTEGER' | 'JAVA_TYPE_BYTE' | 'JAVA_TYPE_BYTE_ARRAY' | 'JAVA_TYPE_CHAR' | 'JAVA_TYPE_CHARACTER' | 'JAVA_TYPE_DATE' | 'JAVA_TYPE_DOUBLE' | 'JAVA_TYPE_FILE' | 'JAVA_TYPE_FLOAT' | 'JAVA_TYPE_GUARDEDBYTEARRAY' | 'JAVA_TYPE_GUARDEDSTRING' | 'JAVA_TYPE_INT' | 'JAVA_TYPE_INTEGER' | 'JAVA_TYPE_LONG' | 'JAVA_TYPE_OBJECT' | 'JAVA_TYPE_PRIMITIVE_BOOLEAN' | 'JAVA_TYPE_PRIMITIVE_BYTE' | 'JAVA_TYPE_PRIMITIVE_DOUBLE' | 'JAVA_TYPE_PRIMITIVE_FLOAT' | 'JAVA_TYPE_PRIMITIVE_LONG' | 'JAVA_TYPE_STRING'; type ObjectPropertySkeleton = { flags?: ObjectPropertyFlag[]; nativeName: string; nativeType: ObjectPropertyNativeType; type: ObjectPropertyType; runAsUser?: boolean; required?: boolean; items?: { nativeType: ObjectPropertyNativeType; type: ObjectPropertyType; }; }; type ObjectTypeSkeleton = { $schema: string; id: string; nativeType: string; properties: Record; type: 'object'; }; type ConnectorSkeleton = IdObjectSkeletonInterface & { configurationProperties: any; connectorRef: { bundleName: string; bundleVersion: string; connectorHostRef: string; connectorName: string; displayName: string; systemType: 'provisioner.openicf'; }; enabled: boolean; objectTypes: Record; }; /** * Connector export options */ interface ConnectorExportOptions { /** * Use string arrays to store multi-line text in scripts. */ useStringArrays: boolean; /** * Include any dependencies (mappings). */ deps: boolean; } /** * Connector import options */ interface ConnectorImportOptions { /** * Include any dependencies (mappings). */ deps: boolean; } interface ConnectorExportInterface { meta?: ExportMetaData; connector: Record; mapping?: Record; } type Application = { /** * Create an empty application export template * @returns {ApplicationExportInterface} an empty application export template */ createApplicationExportTemplate(): ApplicationExportInterface; /** * Get application managed object type * @returns {String} application managed object type in this realm */ getRealmManagedApplication(): string; /** * Create application * @param {string} applicationId application id/name * @param {ApplicationSkeleton} applicationData application data * @returns {Promise} a promise that resolves to an application object */ createApplication(applicationId: string, applicationData: ApplicationSkeleton): Promise; /** * Read application * @param {string} applicationId application uuid * @returns {Promise} a promise that resolves to an application object */ readApplication(applicationId: string): Promise; /** * Read application by name * @param {string} applicationName application name * @returns {Promise} a promise that resolves to an application object */ readApplicationByName(applicationName: string): Promise; /** * Read all applications. Results are sorted aphabetically. * @returns {Promise} a promise that resolves to an array of application objects */ readApplications(): Promise; /** * Update application * @param {string} applicationId application uuid * @param {ApplicationSkeleton} applicationData application data * @returns {Promise} a promise that resolves to an application object */ updateApplication(applicationId: string, applicationData: ApplicationSkeleton): Promise; /** * Delete application * @param {string} applicationId application uuid * @param {boolean} deep deep delete (remove dependencies) * @returns {Promise} a promise that resolves to an application object */ deleteApplication(applicationId: string, deep?: boolean): Promise; /** * Delete application by name * @param {string} applicationName application name * @param {boolean} deep deep delete (remove dependencies) * @returns {Promise} a promise that resolves to an application object */ deleteApplicationByName(applicationName: string, deep?: boolean): Promise; /** * Delete all applications * @param {boolean} deep deep delete (remove dependencies) * @returns {Promise} a promise that resolves to an array of application objects */ deleteApplications(deep?: boolean): Promise; /** * Query applications * @param filter CREST search filter * @param fields array of fields to return */ queryApplications(filter: string, fields?: string[]): Promise; /** * Export application. The response can be saved to file as is. * @param {string} applicationId application uuid * @param {ApplicationExportOptions} options export options * @returns {Promise; /** * Export application by name. The response can be saved to file as is. * @param {string} applicationName application name * @param {ApplicationExportOptions} options export options * @returns {Promise; /** * Export all applications. The response can be saved to file as is. * @returns {Promise} Promise resolving to an ApplicationExportInterface object. */ exportApplications(options?: ApplicationExportOptions): Promise; /** * Import application. The import data is usually read from an application export file. * @param {string} applicationId application uuid * @param {ApplicationExportInterface} importData application import data. * @returns {Promise} Promise resolving to an application object. */ importApplication(applicationId: string, importData: ApplicationExportInterface, options: ApplicationImportOptions): Promise; /** * Import application by name. The import data is usually read from an application export file. * @param {string} applicationName application name * @param {ApplicationExportInterface} importData application import data. * @returns {Promise} Promise resolving to an application object. */ importApplicationByName(applicationName: string, importData: ApplicationExportInterface, options: ApplicationImportOptions): Promise; /** * Import first application. The import data is usually read from an application export file. * @param {ApplicationExportInterface} importData application import data. */ importFirstApplication(importData: ApplicationExportInterface, options: ApplicationImportOptions): Promise; /** * Import applications. The import data is usually read from an application export file. * @param {ApplicationExportInterface} importData application import data. */ importApplications(importData: ApplicationExportInterface, options: ApplicationImportOptions): Promise; }; type ApplicationSkeleton = IdObjectSkeletonInterface & { authoritative: boolean; connectorId: string; description: string; icon: string; mappingNames: string[]; members: any; name: string; owners: any; roles: any; ssoEntities: { idpLocation: string; idpPrivateId: string; spLocation: string; spPrivate: string; }; templateName: string; templateVersion: string; uiConfig: object; url: string; }; /** * Export format for applications */ interface ApplicationExportInterface { /** * Metadata */ meta?: ExportMetaData; /** * Managed applications */ managedApplication: Record; /** * Scripts */ script?: Record; /** * OAuth2 clients */ application?: Record; /** * Saml providers, circles of trust, and metadata */ saml?: { hosted?: Record; remote?: Record; metadata?: Record; cot?: Record; }; /** * connectors */ connector?: Record; /** * mappings */ mapping?: Record; } /** * Application export options */ type ApplicationExportOptions = { /** * Include any dependencies (scripts, oauth2 clients, saml providers, circles of trust, etc). */ deps: boolean; /** * Use string arrays to store multi-line text in scripts. */ useStringArrays: boolean; }; /** * Application export options */ type ApplicationImportOptions = { /** * Import any dependencies (scripts). */ deps: boolean; }; type AuthenticationSettingsSkeleton = IdObjectSkeletonInterface & { _id: ''; _type: { _id: 'EMPTY'; name: 'Core'; collection: false; }; }; type AuthenticationSettings = { /** * Read authentication settings * @returns {Promise} a promise that resolves an authentication settings object */ readAuthenticationSettings(): Promise; /** * Update authentication settings * @param {AuthenticationSettingsSkeleton} settings authentication settings data * @returns {Promise} a promise that resolves an authentication settings object */ updateAuthenticationSettings(settings: AuthenticationSettingsSkeleton): Promise; /** * Export authentication settings * @returns {Promise} a promise that resolves to an AuthenticationSettingsExportInterface object */ exportAuthenticationSettings(): Promise; /** * Import authentication settings * @param {AuthenticationSettingsExportInterface} importData import data */ importAuthenticationSettings(importData: AuthenticationSettingsExportInterface): Promise; }; interface AuthenticationSettingsExportInterface { meta?: ExportMetaData; authentication: AuthenticationSettingsSkeleton; } type CirclesOfTrust = { /** * Create an empty agent export template * @returns {CirclesOfTrustExportInterface} an empty agent export template */ createCirclesOfTrustExportTemplate(): CirclesOfTrustExportInterface; /** * Read all circles of trust * @param {string[]} entityProviders filter by entity providers */ readCirclesOfTrust(entityProviders?: string[]): Promise; /** * Read circle of trust * @param {string} cotId circle of trust id/name */ readCircleOfTrust(cotId: string): Promise; /** * Create circle of trust * @param {string} cotId circle of trust id/name * @param {CircleOfTrustSkeleton} cotData circle of trust data */ createCircleOfTrust(cotId?: string, cotData?: CircleOfTrustSkeleton): Promise; /** * Update circle of trust * @param {string} cotId circle of trust id/name * @param cotData circle of trust data */ updateCircleOfTrust(cotId: string, cotData: CircleOfTrustSkeleton): Promise; /** * Delete circle of trust * @param {string} cotId circle of trust id/name */ deleteCircleOfTrust(cotId: string): Promise; /** * Delete circles of trust * @param {string[]} entityProviders filter by entity providers */ deleteCirclesOfTrust(entityProviders?: string[]): Promise; /** * Export circle of trust * @param {string} cotId circle of trust id/name */ exportCircleOfTrust(cotId: string): Promise; /** * Export all circles of trust * @param {string[]} entityProviders filter by entity providers */ exportCirclesOfTrust(entityProviders?: string[]): Promise; /** * Import a circle of trust by id/name from file * @param {string} cotId Circle of trust id/name * @param {CirclesOfTrustExportInterface} importData Import data * @returns {Promise} a promise resolving to the circle of trust object that was created or updated. Note: If the circle of trust already exists and does not need updating, null is returned. */ importCircleOfTrust(cotId: string, importData: CirclesOfTrustExportInterface): Promise; /** * Import first circle of trust * @param {CirclesOfTrustExportInterface} importData Import data * @returns {Promise} a promise resolving to the circle of trust object that was created or updated. Note: If the circle of trust already exists and does not need updating, null is returned. */ importFirstCircleOfTrust(importData: CirclesOfTrustExportInterface): Promise; /** * Import all circles of trust * @param {string[]} entityProviders filter by entity providers * @param {CirclesOfTrustExportInterface} importData Import data * @returns {Promise} a promise resolving to an array of circle of trust objects that were created or updated. Note: If a circle of trust already exists and does not need updating, it is omitted from the response array. */ importCirclesOfTrust(importData: CirclesOfTrustExportInterface, entityProviders?: string[]): Promise; /** * Get all circles of trust * @returns {Promise} a promise resolving to an array of circle of trust objects * @deprecated since v2.0.0 use {@link CirclesOfTrust.readCirclesOfTrust | readCirclesOfTrust} instead * ```javascript * readCirclesOfTrust(): Promise * ``` * @group Deprecated */ getCirclesOfTrust(): Promise; /** * Get circle of trust * @param {string} cotId circle of trust id/name * @returns {Promise} a promise resolving to a circle of trust object * @deprecated since v2.0.0 use {@link CirclesOfTrust.readCircleOfTrust | readCircleOfTrust} instead * ```javascript * readCircleOfTrust(cotId: string): Promise * ``` * @group Deprecated */ getCircleOfTrust(cotId: string): Promise; }; interface CirclesOfTrustExportInterface { meta?: ExportMetaData; script: Record; saml: { hosted: Record; remote: Record; metadata: Record; cot: Record; }; } type SocialIdpSkeleton = AmConfigEntityInterface & { enabled: boolean; transform: string; }; type AdminFederationConfigSkeleton = IdObjectSkeletonInterface & { groups: { claim: string; mappings: { 'super-admins': string[]; 'tenant-admins': string[]; }; }; }; type AdminFederation = { /** * Create an empty idp export template * @returns {AdminFederationExportInterface} an empty idp export template */ createAdminFederationExportTemplate(): AdminFederationExportInterface; /** * Read all admin federation providers * @returns {Promise} a promise that resolves to an object containing an array of admin federation providers */ readAdminFederationProviders(): Promise; /** * Read admin federation provider * @param {string} providerId social identity provider id/name * @returns {Promise} a promise that resolves a social admin federation object */ readAdminFederationProvider(providerId: string): Promise; /** * Create admin federation provider * @param {string} providerType social identity provider type * @param {string} providerId social identity provider id/name * @param {SocialIdpSkeleton} providerData social identity provider data * @returns {Promise} a promise that resolves a social admin federation object */ createAdminFederationProvider(providerType: string, providerData: SocialIdpSkeleton, providerId?: string): Promise; /** * Update or create admin federation provider * @param {string} providerType social identity provider type * @param {string} providerId social identity provider id/name * @param {SocialIdpSkeleton} providerData social identity provider data * @returns {Promise} a promise that resolves a social admin federation object */ updateAdminFederationProvider(providerType: string, providerId: string, providerData: SocialIdpSkeleton): Promise; /** * Delete admin federation provider by id * @param {String} providerId admin federation provider id/name * @returns {Promise} a promise that resolves to an admin federation provider object */ deleteAdminFederationProvider(providerId: string): Promise; /** * Export admin federation provider by id * @param {string} providerId provider id/name * @returns {Promise} a promise that resolves to a SocialProviderExportInterface object */ exportAdminFederationProvider(providerId: string): Promise; /** * Export all providers * @returns {Promise} a promise that resolves to a SocialProviderExportInterface object */ exportAdminFederationProviders(): Promise; /** * Import admin federation provider by id/name * @param {string} providerId provider id/name * @param {AdminFederationExportInterface} importData import data */ importAdminFederationProvider(providerId: string, importData: AdminFederationExportInterface): Promise; /** * Import first provider * @param {AdminFederationExportInterface} importData import data */ importFirstAdminFederationProvider(importData: AdminFederationExportInterface): Promise; /** * Import all providers * @param {AdminFederationExportInterface} importData import data */ importAdminFederationProviders(importData: AdminFederationExportInterface): Promise; /** * Get all admin federation providers * @returns {Promise} a promise that resolves to an object containing an array of admin federation providers * @deprecated since v2.0.0 use {@link AdminFederation.readAdminFederationProviders | readAdminFederationProviders} instead * ```javascript * readAdminFederationProviders(): Promise * ``` * @group Deprecated */ getAdminFederationProviders(): Promise; /** * Get admin federation provider * @param {String} providerId social identity provider id/name * @returns {Promise} a promise that resolves a social admin federation object * @deprecated since v2.0.0 use {@link AdminFederation.readAdminFederationProvider | readAdminFederationProvider} instead * ```javascript * readAdminFederationProvider(providerId: string): Promise * ``` * @group Deprecated */ getAdminFederationProvider(providerId: string): Promise; /** * Update or create admin federation provider * @param {string} providerType social identity provider type * @param {string} providerId social identity provider id/name * @param {SocialIdpSkeleton} providerData social identity provider data * @returns {Promise} a promise that resolves a social admin federation object * @deprecated since v2.0.0 use {@link AdminFederation.updateAdminFederationProvider | updateAdminFederationProvider} instead * ```javascript * updateAdminFederationProvider(providerType: string, providerId: string, providerData: SocialIdpSkeleton): Promise * ``` * @group Deprecated */ putProviderByTypeAndId(providerType: string, providerId: string, providerData: SocialIdpSkeleton): Promise; }; interface AdminFederationExportInterface { meta?: ExportMetaData; config: Record; idp: Record; } /** * Certificate object skeleton */ type CertificateResponse = NoIdObjectSkeletonInterface & { active: boolean; certificate: string; expireTime: string; id: string; issuer: string; live: boolean; subject: string; subjectAlternativeNames: string[]; validFromTime: string; }; type EnvCertificate = { /** * Read certificate by id * @param {string} certificateId certificate id * @returns {Promise} a promise that resolves to a certificate object */ readCertificate(certificateId: string): Promise; /** * Read all certificates * @param {boolean} noDecode Do not decode values (default: false) * @returns {Promise} a promise that resolves to an array of certificate objects */ readCertificates(noDecode?: boolean): Promise; /** * Create certificate * @param {boolean} active The active status of the certificate. Set this to true for the certificate to actively be served. * @param {string} certificate The PEM formatted certificate. * @param {string} privateKey The private key for the certificate. For security reasons, only insert requests include this field. * @param {boolean} wait Wait until certificate is live (use interval and retries to modify default behavior) * @param {number} interval Only applies when wait=true: Time (in milliseconds) to wait between retries (default: 5000) * @param {number} retries Only applies when wait=true: How many times to retry (default: 24) * @returns {Promise} a promise that resolves to a certificate object */ createCertificate(active: boolean, certificate: string, privateKey: string, wait?: boolean, interval?: number, retries?: number): Promise; /** * Update certificate * @param {string} certificateId ID of the certificate * @param {boolean} active The active status of the certificate. Set this to true for the certificate to actively be served. * @returns {Promise} a promise that resolves to a certificate object */ updateCertificate(certificateId: string, active: boolean): Promise; /** * Activate certificate * @param {string} certificateId ID of the certificate * @param {boolean} wait Wait until certificate is live (use interval and retries to modify default behavior) * @param {number} interval Only applies when wait=true: Time (in milliseconds) to wait between retries (default: 5000) * @param {number} retries Only applies when wait=true: How many times to retry (default: 24) * @returns {Promise} a promise that resolves to a certificate object */ activateCertificate(certificateId: string, wait?: boolean, interval?: number, retries?: number): Promise; /** * Deactivate certificate * @param {string} certificateId ID of the certificate * @param {boolean} wait Wait until certificate is live (use interval and retries to modify default behavior) * @param {number} interval Only applies when wait=true: Time (in milliseconds) to wait between retries (default: 5000) * @param {number} retries Only applies when wait=true: How many times to retry (default: 24) * @returns {Promise} a promise that resolves to a certificate object */ deactivateCertificate(certificateId: string, wait?: boolean, interval?: number, retries?: number): Promise; /** * Check if certificate is active * @param {string} certificateId ID of the certificate * @returns {Promise} a promise that resolves to true or false */ isCertificateActive(certificateId: string): Promise; /** * Check if certificate is live * @param {string} certificateId ID of the certificate * @returns {Promise} a promise that resolves to true or false */ isCertificateLive(certificateId: string): Promise; /** * Delete certificate * @param {string} certificateId certificate id/name * @param {boolean} force force deletion of active certificate by attempting to deactivate it (use interval and retries to modify default behavior) * @param {number} interval Only applies when force=true: Time (in milliseconds) to wait between retries (default: 5000) * @param {number} retries Only applies when force=true: How many times to retry (default: 24) * @returns {Promise} a promise that resolves to a certificate object */ deleteCertificate(certificateId: string, force?: boolean, interval?: number, retries?: number): Promise; /** * Delete all certificates * @param {boolean} force force deletion of active certificate by attempting to deactivate it (use interval and retries to modify default behavior) * @param {number} interval Only applies when force=true: Time (in milliseconds) to wait between retries (default: 5000) * @param {number} retries Only applies when force=true: How many times to retry (default: 24) * @returns {Promise} a promise that resolves to a certificate object */ deleteCertificates(force?: boolean, interval?: number, retries?: number): Promise; }; type DirectiveEnabled = []; type DirectiveSource = string; type AllFlag = '*'; type AllowDuplicatesFlag = "'allow-duplicates'"; type NoneFlag = "'none'"; type ScriptFlag = "'script'"; type SelfFlag = "'self'"; type DirectiveFlag = AllFlag | NoneFlag | SelfFlag | DirectiveSource; type DirectiveSourceFlag = 'data:' | "'unsafe-inline'" | "'unsafe-eval'" | "'unsafe-hashes'" | DirectiveFlag; type SandboxDirectiveFlag = "'allow-forms'" | "'allow-same-origin'" | "'allow-scripts'" | "'allow-popups'" | "'allow-pointer-lock'" | "'allow-top-navigation'"; type RefererDirectiveFlag = "'no-referrer'" | "'none-when-downgrade'" | "'origin'" | "'origin-when-cross-origin'" | "'unsafe-url'"; /** * Content Security Policy object */ type ContentSecurityPolicy = { active: boolean; directives: { 'base-uri'?: DirectiveFlag[]; 'block-all-mixed-content'?: DirectiveEnabled; 'child-src'?: DirectiveSourceFlag[]; 'connect-src'?: DirectiveSourceFlag[]; 'default-src'?: DirectiveSourceFlag[]; 'font-src'?: DirectiveSourceFlag[]; 'form-action'?: DirectiveFlag[]; 'frame-ancestors'?: DirectiveFlag[]; 'frame-src'?: DirectiveSourceFlag[]; 'img-src'?: DirectiveSourceFlag[]; 'manifest-src'?: DirectiveSourceFlag[]; 'media-src'?: DirectiveSourceFlag[]; 'navigate-to'?: DirectiveFlag[]; 'object-src'?: DirectiveSourceFlag[]; 'plugin-types'?: DirectiveSource[]; 'prefetch-src'?: DirectiveSourceFlag[]; referrer?: RefererDirectiveFlag[]; 'report-to'?: DirectiveSource; 'report-uri'?: DirectiveSource; 'require-trusted-types-for'?: ScriptFlag; sandbox?: SandboxDirectiveFlag[]; 'script-src'?: DirectiveSourceFlag[]; 'script-src-attr'?: DirectiveSourceFlag[]; 'script-src-elem'?: DirectiveSourceFlag[]; 'style-src'?: DirectiveSourceFlag[]; 'style-src-attr'?: DirectiveSourceFlag[]; 'style-src-elem'?: DirectiveSourceFlag; 'trusted-types'?: NoneFlag | AllowDuplicatesFlag; 'upgrade-insecure-requests'?: DirectiveEnabled; 'worker-src'?: DirectiveSourceFlag[]; }; }; type EnvContentSecurityPolicy = { /** * Read enforced content security policy * @returns {Promise} a promise that resolves to a ContentSecurityPolicy object */ readEnforcedContentSecurityPolicy(): Promise; /** * Update enforced content security policy * @param {ContentSecurityPolicy} policy ContentSecurityPolicy object * @returns {Promise} a promise that resolves to a ContentSecurityPolicy object. */ updateEnforcedContentSecurityPolicy(policy: ContentSecurityPolicy): Promise; /** * Read report-only content security policy * @returns {Promise} a promise that resolves to a ContentSecurityPolicy object */ readReportOnlyContentSecurityPolicy(): Promise; /** * Update report-only content security policy * @param {ContentSecurityPolicy} policy ContentSecurityPolicy object * @returns {Promise} a promise that resolves to a ContentSecurityPolicy object. */ updateReportOnlyContentSecurityPolicy(policy: ContentSecurityPolicy): Promise; }; /** * Cookie Domains object */ type CookieDomains = { domains: string[]; }; type EnvCookieDomains = { /** * Read cookie domains * @returns {Promise} a promise that resolves to a CookieDomains object */ readCookieDomains(): Promise; /** * Update cookie domains * @param {CookieDomains} domains CookieDomains object * @returns {Promise} a promise that resolves to a CookieDomains object. */ updateCookieDomains(domains: CookieDomains): Promise; }; /** * CSR object */ type CSR = { /** * The algorithm for the private key. The encryption algorithm will either be * RSA-2048 or ECDSA P-256 depending on the algorithm choice. The default is RSA-2048. */ algorithm: 'rsa' | 'ecdsa'; /** * Category of business, such as "Private Organization", “Government Entity”, * “Business Entity”, or “Non-Commercial Entity”. Relevant for EV certificates. */ businessCategory: string; /** * City */ city: string; /** * Domain name that the SSL certificate is securing */ commonName: string; /** * Two-letter ISO-3166 country code: string[A-Z]{2} */ country: string; /** * Email: string^\S+@\S+$ */ email: string; /** * This field contains only information relevant to the Jurisdiction * of Incorporation or Registration. Relevant for EV certificates. */ jurisdictionCity: string; /** * This field contains only information relevant to the Jurisdiction * of Incorporation or Registration. Relevant for EV certificates. */ jurisdictionCountry: string; /** * This field contains only information relevant to the Jurisdiction * of Incorporation or Registration. Relevant for EV certificates. */ jurisdictionState: string; /** * Full name of company */ organization: string; /** * Company section or department */ organizationalUnit: string; /** * Zip code */ postalCode: string; /** * The Registration (or similar) Number assigned to the Subject by the Incorporating * or Registration Agency in its Jurisdiction of Incorporation or Registration. * Relevant for EV certificates. */ serialNumber: string; /** * State */ state: string; /** * Address */ streetAddress: string; /** * Additional domain or domains that the SSL certificate is securing */ subjectAlternativeNames: string[]; }; /** * CSR response object skeleton */ type CSRResponse = NoIdObjectSkeletonInterface & { /** * The algorithm for the private key. The encryption algorithm will either be RSA-2048 or ECDSA P-256 depending on the algorithm choice. The default is RSA-2048. */ algorithm: string; /** * The ID of the certificate created from this CSR if the CSR has been completed. */ certificateID: string; /** * Creation timestamp: eg '2006-01-02T15:04:05Z07:00' */ createdDate: string; /** * The unique identifier for the CSR */ id: string; /** * PEM formatted CSR. */ request: string; /** * the CSR subject */ subject: string; /** * Additional domain or domains that the SSL certificate is securing */ subjectAlternativeNames: string[]; }; type EnvCSR = { /** * Read CSR by id * @param {string} csrId ID of the CSR * @returns {Promise} a promise that resolves to a CSRResponse object */ readCSR(csrId: string): Promise; /** * Read all CSRs * @returns {Promise} a promise that resolves to an array of CSRResponse objects */ readCSRs(): Promise; /** * Create CSR * @param {CSR} csr CSR object * @returns {Promise} a promise that resolves to a CSRResponse object */ createCSR(csr: CSR): Promise; /** * Create CSR * @param {'rsa' | 'ecdsa'} algorithm The algorithm for the private key. The encryption algorithm will either be RSA-2048 or ECDSA P-256 depending on the algorithm choice. The default is RSA-2048. * @param {string} businessCategory Category of business, such as "Private Organization", “Government Entity”, “Business Entity”, or “Non-Commercial Entity”. Relevant for EV certificates. * @param {string} city City * @param {string} commonName Domain name that the SSL certificate is securing * @param {string} country Two-letter ISO-3166 country code: string[A-Z]{2} * @param {string} email Email: string^\S+@\S+$ * @param {string} jurisdictionCity This field contains only information relevant to the Jurisdiction of Incorporation or Registration. Relevant for EV certificates. * @param {string} jurisdictionCountry This field contains only information relevant to the Jurisdiction of Incorporation or Registration. Relevant for EV certificates. * @param {string} jurisdictionState This field contains only information relevant to the Jurisdiction of Incorporation or Registration. Relevant for EV certificates. * @param {string} organization Full name of company * @param {string} organizationalUnit Company section or department * @param {string} postalCode Zip code * @param {string} serialNumber The Registration (or similar) Number assigned to the Subject by the Incorporating or Registration Agency in its Jurisdiction of Incorporation or Registration. Relevant for EV certificates. * @param {string} state State * @param {string} streetAddress Address * @param {string[]} subjectAlternativeNames Additional domain or domains that the SSL certificate is securing * @returns {Promise} a promise that resolves to a CSRResponse object */ createCSR2(algorithm: 'rsa' | 'ecdsa', businessCategory: string, city: string, commonName: string, country: string, email: string, jurisdictionCity: string, jurisdictionCountry: string, jurisdictionState: string, organization: string, organizationalUnit: string, postalCode: string, serialNumber: string, state: string, streetAddress: string, subjectAlternativeNames: string[]): Promise; /** * Update CSR * @param {string} csrId ID of the CSR * @param {string} certificate The matching signed certificate for the request. This should only be set on update requests to upload the certificate. * @returns {Promise} a promise that resolves to a CSRResponse object */ updateCSR(csrId: string, certificate: string): Promise; /** * Delete CSR * @param {string} csrId ID of the CSR * @returns {Promise} a promise that resolves to a CSRResponse object */ deleteCSR(csrId: string): Promise; /** * Delete all CSRs * @returns {Promise} a promise that resolves to an array of CSRResponse objects */ deleteCSRs(): Promise; }; /** * Custom Domains object */ type CustomDomains = { domains: string[]; }; type EnvCustomDomains = { /** * Verify CNAME * @param {string} name CNAME to verify * @returns {Promise} a promise that resolves to true if successul, false otherwise. */ verifyCNAME(name: string): Promise; /** * Read custom domains * @returns {Promise} a promise that resolves to a CustomDomains object */ readCustomDomains(): Promise; /** * Update custom domains * @param {CustomDomains} domains CustomDomains object * @returns {Promise} a promise that resolves to a CustomDomains object. */ updateCustomDomains(domains: CustomDomains): Promise; }; /** * Federation Enforcement object */ type FederationEnforcement = { groups: 'none' | 'non-global' | 'all'; }; type EnvFederationEnforcement = { /** * Read federation enforcement configuration * @returns {Promise} a promise that resolves to a FederationEnforcement object */ readFederationEnforcement(): Promise; /** * Update federation enforcement configuration * @param {FederationEnforcement} config FederationEnforcement object * @returns {Promise} a promise that resolves to a FederationEnforcement object. */ updateFederationEnforcement(config: FederationEnforcement): Promise; /** * Enforce federation for a group of admins * @param {EnforcementGroup} group Group of admins to enforce federation for * @returns {Promise} a promise that resolves to a FederationEnforcement object. */ enforceFederationFor(group: EnforcementGroup): Promise; }; declare enum EnforcementGroup { Nobody = "none", TenantAdmins = "non-global", AllAdmins = "all" } /** * Lock response */ type LockResponse = { description: string; promotionId: string; result: string; }; /** * Lock status */ type LockStatus = { description: string; lowerEnv: { promotionId: string; proxyState: string; state: string; }; promotionId: string; result: 'unlocked' | 'locking' | 'unlocking' | 'locked' | 'error'; upperEnv: { promotionId: string; proxyState: string; state: string; }; }; /** * Promotion request config */ type PromotionRequestConfig = { dryRun: boolean; ignoreEncryptedSecrets: boolean; promoter: string; promotionDescription: string; unlockEnvironmentsAfterPromotion: boolean; zendeskTicketReference: string; }; /** * Promotion response */ type PromotionResponse = { result: string; }; type PromotionType = 'promotion' | 'rollback'; /** * Promotion status */ type PromotionStatus = { blockingError: boolean; encryptedSecrets: string[]; globalLock: string; message: string; missingESVs: string[]; promotionId: string; status: string; timeStamp: string; type: PromotionType; }; type PromotionConfigChange = { name: string; realm: string; uid: string; }; type PromotionConfig = { configChange: { added: PromotionConfigChange[]; deleted: PromotionConfigChange[]; modified: PromotionConfigChange[]; }; configItem: string; }; type PromotionReport = { createdDate: string; dryRun: boolean; missingESVs: string[]; previouslyIgnoredEncryptedSecrets: string[]; promoter: string; promotionDescription: string; promotionId: string; report: { AMConfig: PromotionConfig[]; IDMConfig: PromotionConfig[]; }; reportId: string; reportName: string; type: PromotionType; }; type PromotionReportStub = { createdDate: '2022-01-19T13:04:00Z'; dryRun: true; promotionId: '7575f185-cd0b-4823-b8b1-f677895291d4'; reportId: 'd19e140-8325-4669-b9f3-1cd82784e24e'; type: 'rollback'; }; /** * Rollback request */ type RollbackConfig = { promoter: string; promotionDescription: string; unlockEnvironmentsAfterPromotion: boolean; zendeskTicketReference: string; }; /** * Rollback response */ type RollbackResponse = { result: string; }; type EnvPromotion = { /** * Lock environment * @returns {Promise} a promise that resolves to a LockResponse object. */ lockEnvironment(): Promise; /** * Unlock environment * @param {string} promotionId Promotion id. * @returns {Promise} a promise that resolves to a LockResponse object */ unlockEnvironment(promotionId: string): Promise; /** * Read lock status * @returns {Promise} a promise that resolves to a LockStatus object */ readLockStatus(): Promise; /** * Promote configuration * @param {PromotionRequestConfig} config Promotion request config * @returns {Promise} a promise that resolves to a PromotionResponse object. */ promoteConfiguration(config: PromotionRequestConfig): Promise; /** * Read promotion status * @returns {Promise} a promise that resolves to a PromotionStatus object */ readPromotionStatus(): Promise; /** * Read last promotion report * @returns {Promise} a promise that resolves to a PromotionReport object */ readLastPromotionReport(): Promise; /** * Read promotion report * @param {string} reportId Promotion id * @returns {Promise} a promise that resolves to a PromotionReport object */ readPromotionReport(reportId: string): Promise; /** * Run a provisional report of changes since the last time the lower environment was promoted to the upper environment. * The report generated is for informational purposes only and may not reflect all the changes in a full promotion. * A dry-run promotion is always recommended prior to a full promotion between environments. * @returns {Promise} a promise that resolves to a PromotionReport object */ runProvisionalPromotionReport(): Promise; /** * Run a provisional rollback report of changes when we rollback the configuration to the previous promotion. * @returns {Promise} a promise that resolves to a PromotionReport object */ runProvisionalRollbackReport(): Promise; /** * Read a list of promotion reports in date order. * @returns {Promise} a promise that resolves to an array of PromotionReportStub objects */ readPromotionReports(): Promise; /** * Rollback a promotion * @param {RollbackConfig} config Rollback config * @returns {Promise} a promise that resolves to a RollbackResponse object. */ rollbackPromotion(config: RollbackConfig): Promise; }; /** * Release object */ type Release = { currentVersion: string; nextUpgrade: string; }; type EnvRelease = { /** * Read release information * @returns {Promise} a promise that resolves to a Release object */ readRelease(): Promise; }; /** * SSO Cookie Configuration object */ type SSOCookieConfig = { name: string; }; type EnvSSOCookieConfig = { /** * Read SSO cookie configuration * @returns {Promise} a promise that resolves to an SSOCookieConfig object. */ readSSOCookieConfig(): Promise; /** * Reset SSO cookie configuration * @returns {Promise} a promise that resolves to an SSOCookieConfig object. */ resetSSOCookieConfig(): Promise; /** * Update SSO cookie configuration * @param {SSOCookieConfig} config SSOCookieConfig object * @returns {Promise} a promise that resolves to an SSOCookieConfig object. */ updateSSOCookieConfig(config: SSOCookieConfig): Promise; }; type EsvCountResponse = { secrets: number; variables: number; }; type EsvCount = { /** * Get count of ESV secrets and variables in the environment. * @returns {Promise} a promise that resolves to an object with counts of secrets and variables */ getEsvCount(): Promise; }; type Feature = { /** * Get all features * @returns {Promise} a promise that resolves to an array of feature objects */ getFeatures(): Promise; /** * Check if feature is available * @param {string} featureId feature id (e.g. 'service-accounts') * @returns {Promise} a promise that resolves to true if the feature is available and to false otherwise */ hasFeature(featureId: string): Promise; }; type LogApiKey = { name: string; api_key_id: string; api_key_secret?: string; created_at: string; }; type LogEventPayloadSkeleton = NoIdObjectSkeletonInterface & { context: string; level: string; logger: string; mdc: { transactionId: string; }; message: string; thread: string; timestamp: string; transactionId: string; }; type LogEventSkeleton = NoIdObjectSkeletonInterface & { payload: string | LogEventPayloadSkeleton; timestamp: string; type: string; source: string; }; type Log = { /** * Get default noise filter * @returns {string[]} array of default event types and loggers to be filtered out */ getDefaultNoiseFilter(): string[]; /** * Resolve log level to an array of effective log levels * @param level string or numeric log level: 'FATAL', 'ERROR', 'WARN', 'INFO', 'DEBUG', 'TRACE', 'ALL', 0, 1, 2, 3, 4 * @returns {string[]} array of effective log levels */ resolveLevel(level: string | number): string[]; /** * Resolve a log event's level * @param {object} log log event * @returns {string} log level */ resolvePayloadLevel(log: LogEventSkeleton): string; /** * Get available log sources * @returns {Promise} promise resolving to an array of available log sources */ getLogSources(): Promise; /** * Get log api key * @param {string} keyId key id * @returns {Promise} promise resolving to a LogApiKey objects */ getLogApiKey(keyId: string): Promise; /** * Validate log api key and secret * @param {string} keyId log api key id * @param {string} secret log api secret * @returns {Promise} a promise resolving to true if the key is valid, false otherwise */ isLogApiKeyValid(keyId: string, secret: string): Promise; /** * Get log api keys * @returns {Promise} promise resolving to an array of LogApiKey objects */ getLogApiKeys(): Promise; /** * Create log api key * @param {string} keyName human-readable key name * @returns {Promise} a promise resolving to an object containing the log api key and secret */ createLogApiKey(keyName: string): Promise; /** * Delete log api key * @param {string} keyId key id * @returns {Promise} a promise resolving to an object containing the log api key */ deleteLogApiKey(keyId: string): Promise; /** * Delete all log api keys * @returns {Promise} a promise resolving to an array of log api key objects */ deleteLogApiKeys(): Promise; /** * Tail logs * @param {string} source log source(s) to tail * @param {string} cookie paged results cookie * @returns {Promise>} promise resolving to paged log event result */ tail(source: string, cookie: string): Promise>; /** * Fetch logs * @param {string} source log source(s) to tail * @param {string} startTs start timestamp * @param {string} endTs end timestamp * @param {string} cookie paged results cookie * @returns {Promise>} promise resolving to paged log event result */ fetch(source: string, startTs: string, endTs: string, cookie: string): Promise>; }; /** * Secret encoding * * @summary * You can use the encoding parameter to set an encoding format when you create an ESV secret. * You can only choose an encoding format using the API. The UI currently creates secrets only * with the generic encoding format. * * @see * {@link https://backstage.forgerock.com/docs/idcloud/latest/tenants/esvs.html#encoding_format | ForgeRock Documentation} */ type SecretEncodingType = 'generic' | 'pem' | 'base64hmac' | 'base64aes'; /** * Secret object skeleton */ type SecretSkeleton = IdObjectSkeletonInterface & { description: string; encoding: SecretEncodingType; lastChangedBy?: string; lastChangeDate?: string; useInPlaceholders: boolean; loaded?: boolean; loadedVersion?: string; activeVersion?: string; activeValue?: any; }; type VersionOfSecretStatus = 'DISABLED' | 'ENABLED' | 'DESTROYED'; /** * Secret version skeleton */ type VersionOfSecretSkeleton = IdObjectSkeletonInterface & { /** * Base64-encoded value. Only used when creating a new version of a secret */ valueBase64?: string; /** * Version string. Returned when reading a version of a secret */ version?: string; /** * Date string. Returned when reading a version of a secret */ createDate?: string; /** * True if loaded, false otherwise. Returned when reading a version of a secret */ loaded?: boolean; /** * Status string. Returned when reading a version of a secret */ status?: VersionOfSecretStatus; }; type Secret = { /** * Read all secrets * @returns {Promise} a promise that resolves to an array of secrets */ readSecrets(): Promise; /** * Read secret * @param {string} secretId secret id/name * @returns {Promise} a promise that resolves to a secret */ readSecret(secretId: string): Promise; /** * Read the value of a secret * @param {string} secretId secret id/name * @param {string} target Host URL of target environment to encrypt secret value for * @param {boolean} decrypt retrieve secret value in the clear (default: false) * @returns {Promise} a promise that resolves to the value of the secret */ readSecretValue(secretId: string, target?: string, decrypt?: boolean): Promise; /** * Read the values of an array of secrets * @param {string} secretIds secret id/name * @param {string} target Host URL of target environment to encrypt secret values for * @param {boolean} decrypt retrieve secret values in the clear (default: false) * @returns {Promise<{ [key: string]: string }>} a promise that resolves to a map of secret ids and values */ readSecretValues(secretIds: string[], target?: string, decrypt?: boolean): Promise<{ [key: string]: string; }>; /** * Export secret. The response can be saved to file as is. * @param {string} secretId secret id/name * @param {boolean} includeActiveValue include active value of secret (default: false) * @param {string} target Host URL of target environment to encrypt secret value for * @returns {Promise} Promise resolving to a SecretsExportInterface object. */ exportSecret(secretId: string, includeActiveValue?: boolean, target?: string): Promise; /** * Export all secrets * @param {boolean} includeActiveValues include active values of secrets (default: false) * @param {string} target Host URL of target environment to encrypt secret values for * @returns {Promise} Promise resolving to an SecretsExportInterface object. */ exportSecrets(includeActiveValues?: boolean, target?: string): Promise; /** * Import secret by id * @param {string} secretId secret id/name * @param {SecretsExportInterface} importData import data * @param {boolean} includeActiveValue include active value of secret (default: false) * @param {string} source Host URL of source environment where the secret was exported from * @returns {Promise} imported secret object */ importSecret(secretId: string, importData: SecretsExportInterface, includeActiveValue?: boolean, source?: string): Promise; /** * Import secrets * @param {SecretsExportInterface} importData import data * @param {boolean} includeActiveValues include active values of secrets (default: false) * @param {string} source Host URL of source environment where the secrets were exported from * @returns {Promise} array of imported secret objects */ importSecrets(importData: SecretsExportInterface, includeActiveValues?: boolean, source?: string): Promise; /** * Create secret * @param {string} secretId secret id/name * @param {string} value secret value * @param {string} description secret description * @param {string} encoding secret encoding (only `generic` is supported) * @param {boolean} useInPlaceholders flag indicating if the secret can be used in placeholders * @returns {Promise} a promise that resolves to a secret */ createSecret(secretId: string, value: string, description: string, encoding?: string, useInPlaceholders?: boolean): Promise; /** * Update secret description * @param {string} secretId secret id/name * @param {string} description secret description * @returns {Promise} a promise that resolves to an empty string */ updateSecretDescription(secretId: string, description: string): Promise; /** * Delete secret * @param {string} secretId secret id/name * @returns {Promise} a promise that resolves to a secret object */ deleteSecret(secretId: string): Promise; /** * Read versions of secret * @param {string} secretId secret id/name * @returns {Promise} a promise that resolves to an array of secret versions */ readVersionsOfSecret(secretId: string): Promise; /** * Create version of secret * @param {string} secretId secret id/name * @param {string} value secret value * @returns {Promise} a promise that resolves to a version object */ createVersionOfSecret(secretId: string, value: string): Promise; /** * Read version of secret * @param {string} secretId secret id/name * @param {string} version secret version * @returns {Promise} a promise that resolves to a version object */ readVersionOfSecret(secretId: string, version: string): Promise; /** * Enable a version of a secret * @param {string} secretId secret id/name * @param {string} version secret version * @returns {Promise} a promise that resolves to a status object */ enableVersionOfSecret(secretId: string, version: string): Promise; /** * Disable a version of a secret * @param {string} secretId secret id/name * @param {string} version secret version * @returns {Promise} a promise that resolves to a status object */ disableVersionOfSecret(secretId: string, version: string): Promise; /** * Delete version of secret * @param {string} secretId secret id/name * @param {string} version secret version * @returns {Promise} a promise that resolves to a version object */ deleteVersionOfSecret(secretId: string, version: string): Promise; /** * Get all secrets * @returns {Promise} a promise that resolves to an array of secrets * @deprecated since v2.0.0 use {@link Secret.readSecrets | readSecrets} instead * ```javascript * readSecrets(): Promise * ``` * @group Deprecated */ getSecrets(): Promise; /** * Get secret * @param secretId secret id/name * @returns {Promise} a promise that resolves to a secret * @deprecated since v2.0.0 use {@link Secret.readSecret | readSecret} instead * ```javascript * readSecret(secretId: string): Promise * ``` * @group Deprecated */ getSecret(secretId: string): Promise; /** * Create secret * @param {string} secretId secret id/name * @param {string} value secret value * @param {string} description secret description * @param {string} encoding secret encoding (only `generic` is supported) * @param {boolean} useInPlaceholders flag indicating if the secret can be used in placeholders * @returns {Promise} a promise that resolves to a secret * @deprecated since v2.0.0 use {@link Secret.createSecret | createSecret} instead * ```javascript * createSecret(secretId: string, value: string, description: string, encoding?: string, useInPlaceholders?: boolean): Promise * ``` * @group Deprecated */ putSecret(secretId: string, value: string, description: string, encoding?: string, useInPlaceholders?: boolean): Promise; /** * Set secret description * @param {string} secretId secret id/name * @param {string} description secret description * @returns {Promise} a promise that resolves to an empty string * @deprecated since v2.0.0 use {@link Secret.updateSecretDescription | updateSecretDescription} instead * ```javascript * updateSecretDescription(secretId: string, description: string): Promise * ``` * @group Deprecated */ setSecretDescription(secretId: string, description: string): Promise; /** * Get secret versions * @param {string} secretId secret id/name * @returns {Promise} a promise that resolves to an array of secret versions * @deprecated since v2.0.0 use {@link Secret.readVersionsOfSecret | readVersionsOfSecret} instead * ```javascript * readVersionsOfSecret(secretId: string): Promise * ``` * @group Deprecated */ getSecretVersions(secretId: string): Promise; /** * Create new secret version * @param {string} secretId secret id/name * @param {string} value secret value * @returns {Promise} a promise that resolves to a version object * @deprecated since v2.0.0 use {@link Secret.createVersionOfSecret | createVersionOfSecret} instead * ```javascript * createVersionOfSecret(secretId: string, value: string): Promise * ``` * @group Deprecated */ createNewVersionOfSecret(secretId: string, value: string): Promise; /** * Get version of secret * @param {string} secretId secret id/name * @param {string} version secret version * @returns {Promise} a promise that resolves to a version object * @deprecated since v2.0.0 use {@link Secret.readVersionOfSecret | readVersionOfSecret} instead * ```javascript * readVersionOfSecret(secretId: string, version: string): Promise * ``` * @group Deprecated */ getVersionOfSecret(secretId: string, version: string): Promise; /** * Update the status of a version of a secret * @param {string} secretId secret id/name * @param {string} version secret version * @param {VersionOfSecretStatus} status status * @returns {Promise} a promise that resolves to a status object * @deprecated since v2.0.0 use {@link Secret.enableVersionOfSecret | enableVersionOfSecret} or {@link Secret.disableVersionOfSecret | disableVersionOfSecret} instead * ```javascript * enableVersionOfSecret(secretId: string, version: string): Promise * disableVersionOfSecret(secretId: string, version: string): Promise * ``` * @group Deprecated */ setStatusOfVersionOfSecret(secretId: string, version: string, status: VersionOfSecretStatus): Promise; }; interface SecretsExportInterface { meta?: ExportMetaData; secret: Record; } type ServiceAccount = { /** * Check if service accounts are available * @returns {Promise} true if service accounts are available, false otherwise */ isServiceAccountsFeatureAvailable(): Promise; /** * Create service account * @param {string} name Human-readable name of service account * @param {string} description Description of service account * @param {'Active' | 'Inactive'} accountStatus Service account status * @param {string[]} scopes Scopes. * @param {JwksInterface} jwks Java Web Key Set * @returns {Promise} A promise resolving to a service account object */ createServiceAccount(name: string, description: string, accountStatus: 'active' | 'inactive', scopes: string[], jwks: JwksInterface): Promise; /** * Get service account * @param {string} serviceAccountId service account id * @returns {Promise} a promise resolving to a service account object */ getServiceAccount(serviceAccountId: string): Promise; }; type ServiceAccountType = IdObjectSkeletonInterface & { name: string; description: string; accountStatus: 'active' | 'inactive'; scopes: string[]; jwks: string; }; type Startup = { /** * Check for updates that need applying * @returns {Promise} true if there are updates that need to be applied, false otherwise */ checkForUpdates(): Promise; /** * Apply updates * @param {boolean} wait wait for the operation to complete or not * @param {number} timeout timeout in milliseconds * @returns {Promise} true if successful, false otherwise */ applyUpdates(wait: boolean, timeout?: number): Promise; }; /** * Updates that need to be applied. */ interface Updates { /** * Array of secrets that need applying */ secrets?: unknown[]; /** * Array of variables that need applying */ variables?: unknown[]; } /** * Variable types * * @summary * You can use the expressionType parameter to set a type when you create an ESV variable. * This lets Identity Cloud correctly transform the value of the ESV * to match the configuration property type when substituting it into configuration. * * The type is set when the ESV is created, and cannot be modified after creation. * If you do not specify a type, it will default to string. * * Before the expressionType parameter was introduced, it was only possible to set types * from within configuration, using expression level syntax; for example, * {"$int": "&{esv.journey.ldap.port|1389}"}. * The expressionType parameter supplements this expression level syntax and allows the * ESV type to be identified without inspecting configuration. * * @see * {@link https://backstage.forgerock.com/docs/idcloud/latest/tenants/esvs.html#variable_types | ForgeRock Documentation} */ type VariableExpressionType = 'array' | 'base64encodedinlined' | 'bool' | 'int' | 'keyvaluelist' | 'list' | 'number' | 'object' | 'string'; /** * Variable object skeleton */ type VariableSkeleton = IdObjectSkeletonInterface & { valueBase64?: string; value?: string; description?: string; loaded?: boolean; lastChangedBy?: string; lastChangeDate?: string; expressionType?: VariableExpressionType; }; type Variable = { /** * Read variable by id/name * @param {string} variableId variable id/name * @param {boolean} noDecode Do not decode value (default: false) * @returns {Promise} a promise that resolves to a variable object */ readVariable(variableId: string, noDecode?: boolean): Promise; /** * Read all variables * @param {boolean} noDecode Do not decode values (default: false) * @returns {Promise} a promise that resolves to an array of variable objects */ readVariables(noDecode?: boolean): Promise; /** * Export variable. The response can be saved to file as is. * @param {string} variableId variable id/name * @param {boolean} noDecode Do not decode value (default: false) * @returns {Promise} Promise resolving to a VariablesExportInterface object. */ exportVariable(variableId: string, noDecode?: boolean): Promise; /** * Export all variables * @param {boolean} noDecode Do not decode values (default: false) * @returns {Promise} Promise resolving to an VariablesExportInterface object. */ exportVariables(noDecode?: boolean): Promise; /** * Import variable by id * @param {string} variableId variable id/name * @param {VariablesExportInterface} importData import data * @returns {Promise} imported variable object */ importVariable(variableId: string, importData: VariablesExportInterface): Promise; /** * Import variables * @param {VariablesExportInterface} importData import data * @returns {Promise} array of imported variable objects */ importVariables(importData: VariablesExportInterface): Promise; /** * Create variable * @param {string} variableId variable id/name * @param {string} value variable value * @param {string} description variable description * @param {VariableExpressionType} expressionType type of the value * @param {boolean} noEncode do not encode if passing a pre-encoded (base64) value * @returns {Promise} a promise that resolves to a variable object */ createVariable(variableId: string, value: string, description: string, expressionType?: VariableExpressionType, noEncode?: boolean): Promise; /** * Update or create variable * @param {string} variableId variable id/name * @param {string} value variable value * @param {string} description variable description * @param {VariableExpressionType} expressionType type of the value * @param {boolean} noEncode do not encode if passing a pre-encoded (base64) value * @returns {Promise} a promise that resolves to a variable object */ updateVariable(variableId: string, value: string, description: string, expressionType?: VariableExpressionType, noEncode?: boolean): Promise; /** * Update variable description * @param {string} variableId variable id/name * @param {string} description variable description * @returns {Promise} a promise that resolves to a status object */ updateVariableDescription(variableId: string, description: string): Promise; /** * Delete variable by id/name * @param {string} variableId variable id/name * @returns {Promise} a promise that resolves to a variable object */ deleteVariable(variableId: string): Promise; /** * Get variable by id/name * @param {string} variableId variable id/name * @returns {Promise} a promise that resolves to a variable object * @deprecated since v2.0.0 use {@link Variable.readVariable | readVariable} instead * ```javascript * readVariable(variableId: string): Promise * ``` * @group Deprecated */ getVariable(variableId: string): Promise; /** * Get all variables * @returns {Promise} a promise that resolves to an array of variable objects * @deprecated since v2.0.0 use {@link Variable.readVariables | readVariables} instead * ```javascript * readVariables(): Promise * ``` * @group Deprecated */ getVariables(): Promise; /** * Create variable * @param {string} variableId variable id/name * @param {string} valueBase64 base64-encoded variable value * @param {string} description variable description * @param {VariableExpressionType} expressionType type of the value * @returns {Promise} a promise that resolves to a variable object * @deprecated since v2.0.0 use {@link Variable.createVariable | createVariable} instead * ```javascript * createVariable(variableId: string, value: string, description: string, expressionType?: VariableExpressionType): Promise * ``` * @group Deprecated */ putVariable(variableId: string, valueBase64: string, description: string, expressionType?: VariableExpressionType): Promise; /** * Set variable description * @param {string} variableId variable id/name * @param {string} description variable description * @returns {Promise} a promise that resolves to an empty string * @deprecated since v2.0.0 use {@link Variable.updateVariableDescription | updateVariableDescription} instead * ```javascript * updateVariableDescription(variableId: string, description: string): Promise * ``` * @group Deprecated */ setVariableDescription(variableId: string, description: string): Promise; }; interface VariablesExportInterface { meta?: ExportMetaData; variable: Record; } type PolicyConditionType = 'Script' | 'AMIdentityMembership' | 'IPv6' | 'IPv4' | 'SimpleTime' | 'LEAuthLevel' | 'LDAPFilter' | 'AuthScheme' | 'Session' | 'AND' | 'AuthenticateToRealm' | 'ResourceEnvIP' | 'Policy' | 'OAuth2Scope' | 'SessionProperty' | 'OR' | 'Transaction' | 'NOT' | 'AuthLevel' | 'AuthenticateToService'; type PolicyCondition = NoIdObjectSkeletonInterface & { type: PolicyConditionType; condition?: PolicyCondition; conditions?: PolicyCondition[]; }; type PolicySkeleton = IdObjectSkeletonInterface & { name: string; applicationName: string; condition?: PolicyCondition; resourceTypeUuid: string; }; type PolicySetSkeleton = NoIdObjectSkeletonInterface & { name: string; resourceTypeUuids: string[]; }; type ResourceTypeSkeleton = NoIdObjectSkeletonInterface & { uuid: string; name: string; }; type AmServiceSkeleton = AmConfigEntityInterface & { [key: string]: any; }; interface ServiceNextDescendent { [key: string]: any; } interface FullService extends AmServiceSkeleton { nextDescendents?: ServiceNextDescendent[]; } type EmailTemplate = { /** * Email template type key used to build the IDM id: 'emailTemplate/' */ EMAIL_TEMPLATE_TYPE: string; /** * Create an empty email template export template * @returns {EmailTemplateExportInterface} an empty email template export template */ createEmailTemplateExportTemplate(): EmailTemplateExportInterface; /** * Get all email templates * @returns {Promise} a promise that resolves to an array of email template objects */ readEmailTemplates(): Promise; /** * Get email template * @param {string} templateId id/name of the email template without the type prefix * @returns {Promise} a promise that resolves an email template object */ readEmailTemplate(templateId: string): Promise; /** * Export all email templates. The response can be saved to file as is. * @returns {Promise} Promise resolving to a EmailTemplateExportInterface object. */ exportEmailTemplates(): Promise; /** * Create email template * @param {string} templateId id/name of the email template without the type prefix * @param {EmailTemplateSkeleton} templateData email template object * @returns {Promise} a promise that resolves to an email template object */ createEmailTemplate(templateId: string, templateData: EmailTemplateSkeleton): Promise; /** * Update or create email template * @param {string} templateId id/name of the email template without the type prefix * @param {EmailTemplateSkeleton} templateData email template object * @returns {Promise} a promise that resolves to an email template object */ updateEmailTemplate(templateId: string, templateData: EmailTemplateSkeleton): Promise; /** * Import all email templates * @param {EmailTemplateExportInterface} importData import data * @returns {Promise} a promise resolving to an array of email template objects */ importEmailTemplates(importData: EmailTemplateExportInterface): Promise; /** * Delete all email templates * @returns {Promise} a promise that resolves to an array of email template objects */ deleteEmailTemplates(): Promise; /** * Delete email template * @param {string} templateId id/name of the email template without the type prefix 'emailTemplate/' * @returns {Promise} a promise that resolves an email template object */ deleteEmailTemplate(templateId: string): Promise; /** * Get all email templates * @returns {Promise} a promise that resolves to an array of email template objects * @deprecated since v2.0.0 use {@link EmailTemplate.readEmailTemplates | readEmailTemplates} instead * ```javascript * readEmailTemplates(): Promise * ``` * @group Deprecated */ getEmailTemplates(): Promise; /** * Get email template * @param {string} templateId id/name of the email template without the type prefix * @returns {Promise} a promise that resolves an email template object * @deprecated since v2.0.0 use {@link EmailTemplate.readEmailTemplate | readEmailTemplate} instead * ```javascript * readEmailTemplate(templateId: string): Promise * ``` * @group Deprecated */ getEmailTemplate(templateId: string): Promise; /** * Put email template * @param {string} templateId id/name of the email template without the type prefix * @param {Object} templateData email template object * @returns {Promise} a promise that resolves to an email template object * @deprecated since v2.0.0 use {@link EmailTemplate.updateEmailTemplate | updateEmailTemplate} or {@link EmailTemplate.createEmailTemplate | createEmailTemplate} instead * ```javascript * updateEmailTemplate(templateId: string, templateData: EmailTemplateSkeleton): Promise * createEmailTemplate(templateId: string, templateData: EmailTemplateSkeleton): Promise * ``` * @group Deprecated */ putEmailTemplate(templateId: string, templateData: EmailTemplateSkeleton): Promise; }; type EmailTemplateSkeleton = IdObjectSkeletonInterface & { defaultLocale?: string; displayName?: string; enabled?: boolean; from: string; subject: Record; message?: Record; html?: Record; }; interface EmailTemplateExportInterface { meta?: ExportMetaData; emailTemplate: Record; } interface NodeRefSkeletonInterface { connections: Record; displayName: string; nodeType: string; x: number; y: number; } interface InnerNodeRefSkeletonInterface { _id: string; displayName: string; nodeType: string; } type NodeSkeleton = AmConfigEntityInterface & { nodes?: InnerNodeRefSkeletonInterface[]; tree?: string; identityResource?: string; script?: string; emailTemplateName?: string; filteredProviders?: string[]; useScript?: boolean; useFilterScript?: boolean; }; interface UiConfigInterface { categories: string; } type TreeSkeleton = IdObjectSkeletonInterface & { entryNodeId: string; nodes: Record; identityResource?: string; uiConfig?: UiConfigInterface; enabled?: boolean; innerTreeOnly?: boolean; }; type ThemeSkeleton = IdObjectSkeletonInterface & { name: string; isDefault: boolean; linkedTrees: string[]; }; type Theme = { /** * Create an empty theme export template * @returns {ThemeExportInterface} an empty theme export template */ createThemeExportTemplate(): ThemeExportInterface; /** * Read all themes * @param {string} realm realm name * @returns {Promise} a promise that resolves to an array of themes */ readThemes(): Promise; /** * Read theme by id * @param {string} themeId theme id * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object */ readTheme(themeId: string, realm?: string): Promise; /** * Read theme by name * @param {string} themeName theme name * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object */ readThemeByName(themeName: string, realm?: string): Promise; /** * Export all themes. The response can be saved to file as is. * @returns {Promise} Promise resolving to a ThemeExportInterface object. */ exportThemes(): Promise; /** * Update theme * @param {ThemeSkeleton} themeData theme object * @param {string} themeId theme id * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object */ createTheme(themeData: ThemeSkeleton, themeId?: string, realm?: string): Promise; /** * Update theme * @param {string} themeId theme id * @param {ThemeSkeleton} themeData theme object * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object */ updateTheme(themeId: string, themeData: ThemeSkeleton, realm?: string): Promise; /** * Update theme by name * @param {String} themeName theme name * @param {ThemeSkeleton} themeData theme object * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object */ updateThemeByName(themeName: string, themeData: ThemeSkeleton, realm?: string): Promise; /** * Update all themes * @param {Map} allThemesData themes object containing all themes for all realms * @param {string} realm realm name * @returns {Promise>} a promise that resolves to a themes object */ updateThemes(themeMap: Record): Promise>; /** * Import themes * @param {ThemeExportInterface} importData import data * @returns {Promise} a promise resolving to an array of theme objects */ importThemes(importData: ThemeExportInterface): Promise; /** * Delete theme by id * @param {string} themeId theme id * @param {string} realm realm name * @returns {Promise} a promise that resolves to a themes object */ deleteTheme(themeId: string, realm?: string): Promise; /** * Delete theme by name * @param {string} themeName theme name * @param {string} realm realm name * @returns {Promise} a promise that resolves to a themes object */ deleteThemeByName(themeName: string, realm?: string): Promise; /** * Delete all themes * @param {string} realm realm name * @returns {Promise} a promise that resolves to an array of themes */ deleteThemes(realm?: string): Promise; /** * Get all themes * @param {string} realm realm name * @returns {Promise} a promise that resolves to an array of themes * @deprecated since v2.0.0 use {@link Theme.readThemes | readThemes} instead * ```javascript * readThemes(): Promise * ``` * @group Deprecated */ getThemes(): Promise; /** * Get theme by id * @param {string} themeId theme id * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object * @deprecated since v2.0.0 use {@link Theme.readTheme | readTheme} instead * ```javascript * readTheme(themeId: string, realm?: string): Promise * ``` * @group Deprecated */ getTheme(themeId: string, realm?: string): Promise; /** * Get theme by name * @param {string} themeName theme name * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object * @deprecated since v2.0.0 use {@link Theme.readThemeByName | readThemeByName} instead * ```javascript * readThemeByName(themeName: string, realm?: string): Promise * ``` * @group Deprecated */ getThemeByName(themeName: string, realm?: string): Promise; /** * Put theme by id * @param {string} themeId theme id * @param {ThemeSkeleton} themeData theme object * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object * @deprecated since v2.0.0 use {@link Theme.updateTheme | updateTheme} or {@link Theme.createTheme | createTheme} instead * ```javascript * updateTheme(themeId: string, themeData: ThemeSkeleton, realm?: string): Promise * createTheme(themeData: ThemeSkeleton, themeId?: string, realm?: string): Promise * ``` * @group Deprecated */ putTheme(themeId: string, themeData: ThemeSkeleton, realm?: string): Promise; /** * Put theme by name * @param {String} themeName theme name * @param {ThemeSkeleton} themeData theme object * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object * @deprecated since v2.0.0 use {@link Theme.updateThemeByName | updateThemeByName} instead * ```javascript * updateThemeByName(themeName: string, themeData: ThemeSkeleton, realm?: string): Promise * ``` * @group Deprecated */ putThemeByName(themeName: string, themeData: ThemeSkeleton, realm?: string): Promise; /** * Put all themes * @param {Map} allThemesData themes object containing all themes for all realms * @param {string} realm realm name * @returns {Promise>} a promise that resolves to a themes object * @deprecated since v2.0.0 use {@link Theme.updateThemes | updateThemes} instead * ```javascript * updateThemes(themeMap: Map): Promise> * ``` * @group Deprecated */ putThemes(themeMap: Record): Promise>; }; interface ThemeExportInterface { meta?: ExportMetaData; theme: Record; } type Journey = { /** * Create an empty single tree export template * @returns {SingleTreeExportInterface} an empty single tree export template */ createSingleTreeExportTemplate(): SingleTreeExportInterface; /** * Create an empty multi tree export template * @returns {MultiTreeExportInterface} an empty multi tree export template */ createMultiTreeExportTemplate(): MultiTreeExportInterface; /** * Create export data for a tree/journey with all its nodes and dependencies. The export data can be written to a file as is. * @param {string} treeId tree id/name * @param {TreeExportOptions} options export options * @returns {Promise} a promise that resolves to an object containing the tree and all its nodes and dependencies */ exportJourney(treeId: string, options?: TreeExportOptions): Promise; /** * Create export data for all trees/journeys with all their nodes and dependencies. The export data can be written to a file as is. * @param {TreeExportOptions} options export options * @returns {Promise} a promise that resolves to an object containing the trees and all their nodes and dependencies */ exportJourneys(options?: TreeExportOptions): Promise; /** * Read all journeys without dependencies. * @returns {Promise} a promise that resolves to an array of journey objects */ readJourneys(): Promise; /** * Read journey without dependencies. * @param {string} journeyId journey id/name * @returns {Promise} a promise that resolves to a journey object */ readJourney(journeyId: string): Promise; /** * Create journey without dependencies. * @param {string} journeyId journey id/name * @returns {Promise} a promise that resolves to a journey object */ createJourney(journeyId: string, journeyData: TreeSkeleton): Promise; /** * Update journey without dependencies. * @param {string} journeyId journey id/name * @returns {Promise} a promise that resolves to a journey object */ updateJourney(journeyId: string, journeyData: TreeSkeleton): Promise; /** * Import journey * @param {SingleTreeExportInterface} treeObject tree object containing tree and all its dependencies * @param {TreeImportOptions} options import options * @returns {Promise} a promise that resolves to a journey object */ importJourney(treeObject: SingleTreeExportInterface, options: TreeImportOptions): Promise; /** * Resolve journey dependencies * @param {string[]} installedJorneys Map of installed journeys * @param {Record} journeyMap Map of journeys to resolve dependencies for * @param {string[]} unresolvedJourneys Map to hold the names of unresolved journeys and their dependencies * @param {string[]} resolvedJourneys Array to hold the names of resolved journeys * @param {int} index Depth of recursion */ resolveDependencies(installedJorneys: any, journeyMap: any, unresolvedJourneys: any, resolvedJourneys: any, index?: number): Promise; /** * Import journeys * @param {MultiTreeExportInterface} importData map of trees object * @param {TreeImportOptions} options import options */ importJourneys(importData: MultiTreeExportInterface, options: TreeImportOptions): Promise; /** * Get the node reference obbject for a node object. Node reference objects * are used in a tree flow definition and within page nodes to reference * nodes. Among other things, node references contain all the non-configuration * meta data that exists for readaility, like the x/y coordinates of the node * and the display name chosen by the tree designer. The dislay name is the * only intuitive link between the graphical representation of the tree and * the node configurations that make up the tree. * @param nodeObj node object to retrieve the node reference object for * @param singleTreeExport tree export with or without dependencies * @returns {NodeRefSkeletonInterface | InnerNodeRefSkeletonInterface} node reference object */ getNodeRef(nodeObj: NodeSkeleton, singleTreeExport: SingleTreeExportInterface): NodeRefSkeletonInterface | InnerNodeRefSkeletonInterface; /** * Default tree export resolver used to resolve a tree id/name to a full export * w/o dependencies of that tree from a platform instance. * @param {string} treeId id/name of the tree to resolve * @returns {TreeExportResolverInterface} tree export */ onlineTreeExportResolver: TreeExportResolverInterface; /** * Tree export resolver used to resolve a tree id/name to a full export * of that tree from individual `treename.journey.json` export files. * @param {string} treeId id/name of the tree to resolve * @returns {TreeExportResolverInterface} tree export */ fileByIdTreeExportResolver: TreeExportResolverInterface; /** * Factory that creates a tree export resolver used to resolve a tree id * to a full export of that tree from a multi-tree export file. * @param {string} file multi-tree export file * @returns {TreeExportResolverInterface} tree export resolver */ createFileParamTreeExportResolver(file: string): TreeExportResolverInterface; /** * Get tree dependencies (all descendent inner trees) * @param {SingleTreeExportInterface} treeExport single tree export * @param {string[]} resolvedTreeIds list of tree ids wich have already been resolved * @param {TreeExportResolverInterface} resolveTreeExport tree export resolver callback function * @returns {Promise} a promise that resolves to a tree dependency map */ getTreeDescendents(treeExport: SingleTreeExportInterface, resolveTreeExport: TreeExportResolverInterface, resolvedTreeIds?: string[]): Promise; /** * Analyze if a journey contains any custom nodes considering the detected or the overridden version. * @param {SingleTreeExportInterface} journey Journey/tree configuration object * @returns {boolean} True if the journey/tree contains any custom nodes, false otherwise. */ isCustomJourney(journey: SingleTreeExportInterface): boolean; /** * Analyze if a journey contains any premium nodes considering the detected or the overridden version. * @param {SingleTreeExportInterface} journey Journey/tree configuration object * @returns {boolean} True if the journey/tree contains any custom nodes, false otherwise. */ isPremiumJourney(journey: SingleTreeExportInterface): boolean; /** * Analyze if a journey contains any cloud-only nodes considering the detected or the overridden version. * @param {SingleTreeExportInterface} journey Journey/tree configuration object * @returns {boolean} True if the journey/tree contains any cloud-only nodes, false otherwise. */ isCloudOnlyJourney(journey: SingleTreeExportInterface): boolean; /** * Get a journey's classifications, which can be one or multiple of: * - standard: can run on any instance of a ForgeRock platform * - cloud: utilize nodes, which are exclusively available in the ForgeRock Identity Cloud * - premium: utilizes nodes, which come at a premium * - custom: utilizes nodes not included in the ForgeRock platform release * @param {SingleTreeExportInterface} journey journey export data * @returns {JourneyClassificationType[]} an array of one or multiple classifications */ getJourneyClassification(journey: SingleTreeExportInterface): JourneyClassificationType[]; /** * Delete a journey * @param {string} journeyId journey id/name * @param {Object} options deep=true also delete all the nodes and inner nodes, verbose=true print verbose info */ deleteJourney(journeyId: string, options: { deep: boolean; verbose: boolean; progress?: boolean; }): Promise; /** * Delete all journeys * @param {Object} options deep=true also delete all the nodes and inner nodes, verbose=true print verbose info */ deleteJourneys(options: { deep: boolean; verbose: boolean; }): Promise; /** * Enable a journey * @param journeyId journey id/name * @returns {Promise} the updated tree/journey object */ enableJourney(journeyId: string): Promise; /** * Disable a journey * @param journeyId journey id/name * @returns {Promise} the updated tree/journey object */ disableJourney(journeyId: string): Promise; /** * Get all the journeys/trees without all their nodes and dependencies. * @returns {Promise} a promise that resolves to an array of journey objects * @deprecated since v2.0.0 use {@link Journey.readJourneys | readJourneys} instead * ```javascript * readJourneys(): Promise * ``` * @group Deprecated */ getJourneys(): Promise; /** * Get a journey/tree without all its nodes and dependencies. * @param {string} journeyId journey id/name * @returns {Promise} a promise that resolves to a journey object * @deprecated since v2.0.0 use {@link Journey.readJourney | readJourney} instead * ```javascript * readJourney(journeyId: string): Promise * ``` * @group Deprecated */ getJourney(journeyId: string): Promise; /** * Import journeys * @param {MultiTreeExportInterface} importData map of trees object * @param {TreeImportOptions} options import options * @deprecated since v2.0.0 use {@link Journey.importJourneys | importJourneys} instead * ```javascript * importJourneys(importData: MultiTreeExportInterface, options: TreeImportOptions): Promise * ``` * @group Deprecated */ importAllJourneys(importData: MultiTreeExportInterface, options: TreeImportOptions): Promise; /** * Find all node configuration objects that are no longer referenced by any tree * @returns {Promise} a promise that resolves to an array of orphaned nodes * @deprecated since v2.0.0 use {@link Node.findOrphanedNodes | findOrphanedNodes} in the {@link Node} module instead * @group Deprecated */ findOrphanedNodes(): Promise; /** * Remove orphaned nodes * @param {NodeSkeleton[]} orphanedNodes Pass in an array of orphaned node configuration objects to remove * @returns {Promise} a promise that resolves to an array nodes that encountered errors deleting * @deprecated since v2.0.0 use {@link Node.removeOrphanedNodes | removeOrphanedNodes} in the {@link Node} module instead * @group Deprecated */ removeOrphanedNodes(orphanedNodes: NodeSkeleton[]): Promise; }; /** * Tree export options */ interface TreeExportOptions { /** * Where applicable, use string arrays to store multi-line text (e.g. scripts). */ useStringArrays: boolean; /** * Include any dependencies (scripts, email templates, SAML entity providers and circles of trust, social identity providers, themes). */ deps: boolean; /** * Include x and y coordinate positions of the journey/tree nodes. */ coords: boolean; } /** * Tree import options */ interface TreeImportOptions { /** * Generate new UUIDs for all nodes during import. */ reUuid: boolean; /** * Include any dependencies (scripts, email templates, SAML entity providers and circles of trust, social identity providers, themes). */ deps: boolean; } interface SingleTreeExportInterface { meta?: ExportMetaData; innerNodes?: Record; innernodes?: Record; nodes: Record; scripts: Record; emailTemplates: Record; socialIdentityProviders: Record; themes: ThemeSkeleton[]; saml2Entities: Record; circlesOfTrust: Record; tree: TreeSkeleton; } interface MultiTreeExportInterface { meta?: ExportMetaData; trees: Record; } type JourneyClassificationType = 'standard' | 'custom' | 'cloud' | 'premium'; interface TreeDependencyMapInterface { [k: string]: TreeDependencyMapInterface[]; } interface TreeExportResolverInterface { (treeId: string, state: State): Promise; } type DeleteJourneyStatus = { status: string; nodes: { status?: string; }; }; type DeleteJourneysStatus = { [k: string]: DeleteJourneyStatus; }; type Config = { /** * Export full configuration * @param {FullExportOptions} options export options * @param {Error[]} collectErrors optional parameter to collect errors instead of having the function throw. Pass an empty array to collect errors and report on them but have the function perform all it can and return the export data even if it encounters errors. * @returns {Promise} a promise resolving to a full export object */ exportFullConfiguration(options: FullExportOptions, collectErrors?: Error[]): Promise; /** * Import full configuration * @param {FullExportInterface} importData import data * @param {FullImportOptions} options import options * @param {Error[]} collectErrors optional parameter to collect errors instead of having the function throw. Pass an empty array to collect errors and report on them but have the function perform all it can and return the export data even if it encounters errors. */ importFullConfiguration(importData: FullExportInterface, options: FullImportOptions, collectErrors?: Error[]): Promise<(object | any[])[]>; }; /** * Full export options */ interface FullExportOptions { /** * Use string arrays to store multi-line text in scripts. */ useStringArrays: boolean; /** * Do not include decoded variable value in export */ noDecode: boolean; /** * Include x and y coordinate positions of the journey/tree nodes. */ coords: boolean; /** * Include default scripts in export if true */ includeDefault: boolean; /** * Include active and loaded secret values */ includeActiveValues: boolean; /** * Host URL of target environment to encrypt secret values for */ target?: string; } /** * Full import options */ interface FullImportOptions { /** * Generate new UUIDs for all journey nodes during import. */ reUuidJourneys: boolean; /** * Generate new UUIDs for all scripts during import. */ reUuidScripts: boolean; /** * Indicates whether to remove previously existing services of the same id before importing */ cleanServices: boolean; /** * Include default scripts in import if true */ includeDefault: boolean; /** * Include active secret values */ includeActiveValues: boolean; /** * Host URL of source environment to decrypt secret values from */ source?: string; } interface FullExportInterface { meta?: ExportMetaData; global: FullGlobalExportInterface; realm: Record; } interface FullGlobalExportInterface { emailTemplate: Record | undefined; idm: Record | undefined; mapping: Record | undefined; secret: Record | undefined; service: Record | undefined; sync: SyncSkeleton | undefined; variable: Record | undefined; } interface FullRealmExportInterface { agent: Record | undefined; application: Record | undefined; authentication: AuthenticationSettingsSkeleton | undefined; idp: Record | undefined; managedApplication: Record | undefined; policy: Record | undefined; policyset: Record | undefined; resourcetype: Record | undefined; saml: { hosted: Record; remote: Record; metadata: Record; cot: Record | undefined; } | undefined; script: Record | undefined; service: Record | undefined; theme: Record | undefined; trees: Record | undefined; } type ConnectionProfile = { /** * Get connection profiles file name * @returns {string} connection profiles file name */ getConnectionProfilesPath(): string; /** * Find connection profiles * @param {ConnectionsFileInterface} connectionProfiles connection profile object * @param {string} host host url or unique substring * @returns {SecureConnectionProfileInterface[]} Array of connection profiles */ findConnectionProfiles(connectionProfiles: ConnectionsFileInterface, host: string): SecureConnectionProfileInterface[]; /** * Initialize connection profiles * * This method is called from app.ts and runs before any of the message handlers are registered. * Therefore none of the Console message functions will produce any output. */ initConnectionProfiles(): Promise; /** * Get connection profile by host * @param {String} host host tenant host url or unique substring * @returns {Object} connection profile or null */ getConnectionProfileByHost(host: string): Promise; /** * Get connection profile * @returns {Object} connection profile or null */ getConnectionProfile(): Promise; /** * Load a connection profile into library state * @param {string} host AM host URL or unique substring * @returns {Promise} A promise resolving to true if successful */ loadConnectionProfileByHost(host: string): Promise; /** * Load a connection profile into library state * @returns {Promise} A promise resolving to true if successful */ loadConnectionProfile(): Promise; /** * Save connection profile * @param {string} host host url for new profiles or unique substring for existing profiles * @returns {Promise} true if the operation succeeded, false otherwise */ saveConnectionProfile(host: string): Promise; /** * Delete connection profile * @param {string} host host tenant host url or unique substring */ deleteConnectionProfile(host: string): void; /** * Create a new service account using auto-generated parameters * @returns {Promise} A promise resolving to a service account object */ addNewServiceAccount(): Promise; }; interface SecureConnectionProfileInterface { tenant: string; idmHost?: string; allowInsecureConnection?: boolean; deploymentType?: string; username?: string | null; encodedPassword?: string | null; logApiKey?: string | null; encodedLogApiSecret?: string | null; authenticationService?: string | null; authenticationHeaderOverrides?: Record; adminClientId?: string | null; adminClientRedirectUri?: string | null; svcacctId?: string | null; encodedSvcacctJwk?: string | null; svcacctName?: string | null; svcacctScope?: string | null; } interface ConnectionProfileInterface { tenant: string; idmHost?: string; allowInsecureConnection?: boolean; deploymentType?: string; username?: string | null; password?: string | null; logApiKey?: string | null; logApiSecret?: string | null; authenticationService?: string | null; authenticationHeaderOverrides?: Record; adminClientId?: string | null; adminClientRedirectUri?: string | null; svcacctId?: string | null; svcacctJwk?: JwkRsa; svcacctName?: string | null; svcacctScope?: string | null; } interface ConnectionsFileInterface { [key: string]: SecureConnectionProfileInterface; } type IdmConfigStub = IdObjectSkeletonInterface & { _id: string; pid: string; factoryPid: string | null; }; interface ConnectorServerStatusInterface { name: string; type: string; ok: boolean; } interface SystemStatusInterface { name: string; enabled: boolean; config: string; connectorRef: { connectorHostRef: string; bundleVersion: string; bundleName: string; connectorName: string; }; displayName: string; objectTypes: string[]; ok: boolean; } interface SystemObjectPatchOperationInterface { operation: 'add' | 'copy' | 'increment' | 'move' | 'remove' | 'replace' | 'transform'; field: string; value?: any; from?: string; } type IdmConfig = { /** * Read available config entity types * @returns {string[]} promise resolving to an array of config entity types */ readConfigEntityTypes(): Promise; /** * Read all config entity stubs. For full entities use {@link IdmConfig.readConfigEntities | readConfigEntities}. * @returns {IdmConfigStub[]} promise resolving to an array of config entity stubs */ readConfigEntityStubs(): Promise; /** * Read all config entities * @returns {IdObjectSkeletonInterface[]} promise reolving to an array of config entities */ readConfigEntities(): Promise; /** * Read all config entities of a type * @param {string} type config entity type * @returns {IdObjectSkeletonInterface[]} promise resolving to an array of config entities of a type */ readConfigEntitiesByType(type: string): Promise; /** * Read config entity * @param {string} entityId config entity id/name * @returns {IdObjectSkeletonInterface} promise resolving to a config entity */ readConfigEntity(entityId: string): Promise; /** * Export a single IDM config entity * @param {string} entityId config entity id * @param {ConfigEntityExportOptions} options export options * @returns {ConfigEntityExportInterface} promise resolving to a ConfigEntityExportInterface object */ exportConfigEntity(entityId: string, options?: ConfigEntityExportOptions): Promise; /** * Export all IDM config entities * @param {ConfigEntityExportOptions} options export options * @returns {ConfigEntityExportInterface} promise resolving to a ConfigEntityExportInterface object */ exportConfigEntities(options?: ConfigEntityExportOptions): Promise; /** * Create config entity * @param {string} entityId config entity id/name * @param {IdObjectSkeletonInterface} entityData config entity data * @param {boolean} wait delay the response until an OSGi service event confirms the change has been consumed by the corresponding service or the request times out. * @returns {IdObjectSkeletonInterface} promise resolving to a config entity */ createConfigEntity(entityId: string, entityData: IdObjectSkeletonInterface, wait?: boolean): Promise; /** * Update or create config entity * @param {string} entityId config entity id/name * @param {IdObjectSkeletonInterface} entityData config entity data * @param {boolean} wait delay the response until an OSGi service event confirms the change has been consumed by the corresponding service or the request times out. * @returns {IdObjectSkeletonInterface} promise resolving to a config entity */ updateConfigEntity(entityId: string, entityData: IdObjectSkeletonInterface, wait?: boolean): Promise; /** * Import idm config entities. * @param {ConfigEntityExportInterface} importData idm config entity import data. * @param {string} entityId Optional entity id that, when provided, will only import the entity of that id from the importData * @param {ConfigEntityImportOptions} options import options * @returns {Promise} a promise resolving to an array of config entity objects */ importConfigEntities(importData: ConfigEntityExportInterface, entityId?: string, options?: ConfigEntityImportOptions): Promise; /** * Delete all config entities * @returns {IdObjectSkeletonInterface[]} promise reolving to an array of config entities */ deleteConfigEntities(): Promise; /** * Delete all config entities of a type * @param {string} type config entity type * @returns {IdObjectSkeletonInterface[]} promise resolving to an array of config entities of a type */ deleteConfigEntitiesByType(type: string): Promise; /** * Delete config entity * @param {string} entityId config entity id/name * @returns {IdObjectSkeletonInterface} promise resolving to a config entity */ deleteConfigEntity(entityId: string): Promise; /** * Get available config entity types * @returns {string[]} promise resolving to an array of config entity types * @deprecated since v2.0.0 use {@link IdmConfig.readConfigEntityTypes | readConfigEntityTypes} instead * ```javascript * readConfigEntityTypes(): Promise * ``` * @group Deprecated */ getConfigEntityTypes(): Promise; /** * Get all config entities * @returns {IdObjectSkeletonInterface[]} promise reolving to an array of config entities * @deprecated since v2.0.0 use {@link IdmConfig.readConfigEntities | readConfigEntities} instead * ```javascript * readConfigEntities(): Promise * ``` * @group Deprecated */ getAllConfigEntities(): Promise; /** * Get all config entities of a type * @param {string} type config entity type * @returns {IdObjectSkeletonInterface[]} promise resolving to an array of config entities of a type * @deprecated since v2.0.0 use {@link IdmConfig.readConfigEntitiesByType | readConfigEntitiesByType} instead * ```javascript * readConfigEntitiesByType(type: string): Promise * ``` * @group Deprecated */ getConfigEntitiesByType(type: string): Promise; /** * Get config entity * @param {string} entityId config entity id/name * @returns {IdObjectSkeletonInterface} promise resolving to a config entity * @deprecated since v2.0.0 use {@link IdmConfig.readConfigEntity | readConfigEntity} instead * ```javascript * readConfigEntity(entityId: string): Promise * ``` * @group Deprecated */ getConfigEntity(entityId: string): Promise; /** * Put config entity * @param {string} entityId config entity id/name * @param {IdObjectSkeletonInterface} entityData config entity data * @returns {IdObjectSkeletonInterface} promise resolving to a config entity * @deprecated since v2.0.0 use {@link IdmConfig.updateConfigEntity | updateConfigEntity} or {@link IdmConfig.createConfigEntity | createConfigEntity} instead * ```javascript * updateConfigEntity(entityId: string, entityData: IdObjectSkeletonInterface): Promise * createConfigEntity(entityId: string, entityData: IdObjectSkeletonInterface): Promise * ``` * @group Deprecated */ putConfigEntity(entityId: string, entityData: IdObjectSkeletonInterface): Promise; /** * Test connector servers * @deprecated since v2.0.0-42 use {@link IdmSystem.testConnectorServers | testConnectorServers} or {@link IdmSystem.testConnectorServers | testConnectorServers} instead * @returns {Promise} a promise that resolves to an array of ConnectorServerStatusInterface objects */ testConnectorServers(): Promise; }; /** * Idm export options */ interface ConfigEntityExportOptions { /** * Gives a list of entities to export. If undefined or empty, it will export all entities. */ entitiesToExport?: string[]; /** * Gives the list of key-value pairs of env replacements. Replaces each occurrence of the value with '${key}', where key is the correspond key to the value. */ envReplaceParams?: string[][]; } /** * Config entity import options */ interface ConfigEntityImportOptions { /** * Gives a list of entities to import. If undefined or empty, it will import all entities. */ entitiesToImport?: string[]; /** * Gives the list of key-value pairs of env replacements. Replaces each occurrence of '${key}' with its value. */ envReplaceParams?: string[][]; /** * validate script hooks */ validate: boolean; } interface ConfigEntityExportInterface { meta?: ExportMetaData; idm: Record; } type IdmCrypto = { /** * Test if a value is encrypted * @param {any} value value to test * @returns {boolean} true if the value is encrypted, false otherwise */ isEncrypted(value: any): boolean; /** * Encrypt a value * @param {any} value value to encrypt * @returns {Promise} a promise resolving to the encrypted value */ encrypt(value: any): Promise; /** * Encrypt a map of values * @param {{ [key: string]: any }} map map of values to encrypt * @returns {Promise<{ [key: string]: any }>} a promise resolving to a map of encrypted values */ encryptMap(map: { [key: string]: any; }): Promise<{ [key: string]: any; }>; /** * Decrypt a value * @returns {Promise} a promise resolving to the decrypted value */ decrypt(script: string): Promise; /** * Decrypt a map of values * @param {{ [key: string]: any }} map map of values to decrypt * @returns {Promise<{ [key: string]: any }>} a promise resolving to a map of decrypted values */ decryptMap(map: { [key: string]: any; }): Promise<{ [key: string]: any; }>; }; type IdmScript = { /** * Compile a JS script * @returns {Promise} a promise resolving to 'true' or an error message */ compileScript(script: string): Promise; /** * Run a JS script * @returns {Promise} a promise resolving to the script result */ evaluateScript(script: string, globals?: { [key: string]: any; }): Promise; }; type IdmSystem = { /** * Test connector servers * @returns {Promise} a promise that resolves to an array of ConnectorServerStatusInterface objects */ testConnectorServers(): Promise; /** * Read available systems/connectors status * @returns {Promise} a promise resolving to an array of system status objects */ readAvailableSystems(): Promise; /** * Read system/connector status * @returns {Promise} a promise resolving to a system status object */ readSystemStatus(systemName: string): Promise; /** * Authenticate a system object using username and password (pass-through authentication) * @param {string} systemName name of system/connector * @param {string} systemObjectType type of system object * @param {string} username system object username * @param {string} password system object password * @returns {Promise} a promise resolving to an IdObjectSkeletonInterface object containing only the _id */ authenticateSystemObject(systemName: string, systemObjectType: string, username: string, password: string): Promise; /** * Run system script * @param {string} systemName name of system/connector * @param {string} scriptName name of script * @returns {Promise} a promise resolving to a status object */ runSystemScript(systemName: string, scriptName: string): Promise; /** * Query all system object ids * @param {string} systemName name of system/connector * @param {string} systemObjectType type of system object * @param {number} pageSize page size (default value: 1000) * @param {string} pageCookie paged results cookie * @returns {Promise>} a promise resolving to an array of IdObjectSkeletonInterface objects */ queryAllSystemObjectIds(systemName: string, systemObjectType: string, pageSize?: number, pageCookie?: string): Promise>; /** * Query system objects using a search filter * @param {string} systemName name of system/connector * @param {string} systemObjectType type of system object * @param {string} filter search filter * @param {string[]} fields array of fields to return * @param {number} pageSize page size (default value: 1000) * @param {string} pageCookie paged results cookie * @returns {Promise>} a promise resolving to an array of IdObjectSkeletonInterface objects */ querySystemObjects(systemName: string, systemObjectType: string, filter: string, fields?: string[], pageSize?: number, pageCookie?: string): Promise>; /** * Read system object * @param {string} systemName name of system/connector * @param {string} systemObjectType type of system object * @param {string} systemObjectId id of system object * @param {string[]} fields array of fields to return (default: `['*']`) * @returns {Promise} a promise resolving to an IdObjectSkeletonInterface object */ readSystemObject(systemName: string, systemObjectType: string, systemObjectId: string, fields?: string[]): Promise; /** * Create system object * @param {string} systemName name of system/connector * @param {string} systemObjectType type of system object * @param {IdObjectSkeletonInterface} systemObjectData system object data * @returns {Promise} a promise resolving to an IdObjectSkeletonInterface object */ createSystemObject(systemName: string, systemObjectType: string, systemObjectData: IdObjectSkeletonInterface): Promise; /** * Update or create system object * @param {string} systemName name of system/connector * @param {string} systemObjectType type of system object * @param {string} systemObjectId id of system object * @param {IdObjectSkeletonInterface} systemObjectData system object data * @param {boolean} failIfExists fail if object exists (default value: false) * @returns {Promise} a promise resolving to an IdObjectSkeletonInterface object */ updateSystemObject(systemName: string, systemObjectType: string, systemObjectId: string, systemObjectData: IdObjectSkeletonInterface, failIfExists?: boolean): Promise; /** * Partially update system object through a collection of patch operations. * @param {string} systemName name of system/connector * @param {string} systemObjectType type of system object * @param {string} systemObjectId id of system object * @param {SystemObjectPatchOperationInterface[]} operations collection of patch operations to perform on the object * @returns {Promise} a promise resolving to an IdObjectSkeletonInterface object */ updateSystemObjectProperties(systemName: string, systemObjectType: string, systemObjectId: string, operations: SystemObjectPatchOperationInterface[]): Promise; /** * Delete system object * @param {string} systemName name of system/connector * @param {string} systemObjectType type of system object * @param {string} systemObjectId id of system object * @returns {Promise} a promise resolving to an IdObjectSkeletonInterface object */ deleteSystemObject(systemName: string, systemObjectType: string, systemObjectId: string): Promise; /** * Read system schema * @param {string} systemName name of system/connector * @returns {Promise>} a promise resolving to a map of Record */ readSystemSchema(systemName: string): Promise>; }; type Idp = { /** * Read all social identity providers * @returns {Promise} a promise that resolves to an array of social identity providers */ readSocialIdentityProviders(): Promise; /** * Read social identity provider * @param {string} providerId identity provider id/name * @returns {Promise} a promise that resolves a social identity provider object */ readSocialIdentityProvider(providerId: string): Promise; /** * Create social identity provider * @param {string} providerType identity provider type * @param {string} providerId identity provider id/name * @param {SocialIdpSkeleton} providerData identity provider data * @returns {Promise} a promise that resolves a social identity provider object */ createSocialIdentityProvider(providerType: string, providerId: string, providerData: SocialIdpSkeleton): Promise; /** * Update or create social identity provider * @param {string} providerType identity provider type * @param {string} providerId identity provider id/name * @param {SocialIdpSkeleton} providerData identity provider data * @returns {Promise} a promise that resolves a social identity provider object */ updateSocialIdentityProvider(providerType: string, providerId: string, providerData: SocialIdpSkeleton): Promise; /** * Delete all social identity providers * @returns {Promise} a promise that resolves to an array of social identity provider objects */ deleteSocialIdentityProviders(): Promise; /** * Delete social identity provider * @param {string} providerId social identity provider id/name * @returns {Promise} a promise that resolves a social identity provider object */ deleteSocialIdentityProvider(providerId: string): Promise; /** * Export social identity provider * @param {string} providerId provider id/name * @returns {Promise} a promise that resolves to a SocialProviderExportInterface object */ exportSocialIdentityProvider(providerId: string): Promise; /** * Export all social identity providers * @param {SocialIdentityProviderExportOptions} options export options * @returns {Promise} a promise that resolves to a SocialProviderExportInterface object */ exportSocialIdentityProviders(options?: SocialIdentityProviderExportOptions): Promise; /** * Import social identity provider * @param {string} providerId provider id/name * @param {SocialProviderExportInterface} importData import data * @param {SocialIdentityProviderImportOptions} options import options * @returns {Promise} a promise resolving to a social identity provider object */ importSocialIdentityProvider(providerId: string, importData: SocialProviderExportInterface, options: SocialIdentityProviderImportOptions): Promise; /** * Import first social identity provider * @param {SocialProviderExportInterface} importData import data * @param {SocialIdentityProviderImportOptions} options import options * @returns {Promise} a promise resolving to a social identity provider object */ importFirstSocialIdentityProvider(importData: SocialProviderExportInterface, options: SocialIdentityProviderImportOptions): Promise; /** * Import all social identity providers * @param {SocialProviderExportInterface} importData import data * @param {SocialIdentityProviderImportOptions} options import options * @returns {Promise} a promise resolving to an array of social identity provider objects */ importSocialIdentityProviders(importData: SocialProviderExportInterface, options: SocialIdentityProviderImportOptions): Promise; /** * Get all social identity providers * @returns {Promise} a promise that resolves to an array of social identity providers * @deprecated since v2.0.0 use {@link Idp.readSocialIdentityProviders | readSocialIdentityProviders} instead * ```javascript * readSocialIdentityProviders(): Promise * ``` * @group Deprecated */ getSocialIdentityProviders(): Promise; /** * Get social identity provider by id * @param {string} providerId identity provider id/name * @returns {Promise} a promise that resolves a social identity provider object * @deprecated since v2.0.0 use {@link Idp.readSocialIdentityProvider | readSocialIdentityProvider} instead * ```javascript * readSocialIdentityProvider(providerId: string): Promise * ``` * @group Deprecated */ getSocialProvider(providerId: string): Promise; /** * Update or create identity provider * @param {string} providerType identity provider type * @param {string} providerId identity provider id/name * @param {SocialIdpSkeleton} providerData identity provider data * @returns {Promise} a promise that resolves a social identity provider object * @deprecated since v2.0.0 use {@link Idp.updateSocialIdentityProvider | updateSocialIdentityProvider} or {@link Idp.createSocialIdentityProvider | createSocialIdentityProvider} instead * ```javascript * updateSocialIdentityProvider(providerType: string, providerId: string, providerData: SocialIdpSkeleton): Promise * createSocialIdentityProvider(providerType: string, providerId: string, providerData: SocialIdpSkeleton): Promise * ``` * @group Deprecated */ putProviderByTypeAndId(providerType: string, providerId: string, providerData: SocialIdpSkeleton): Promise; /** * Delete social identity provider * @param {string} providerId social identity provider id/name * @returns {Promise} a promise that resolves to a social identity provider object * @deprecated since v2.0.0 use {@link Idp.deleteSocialIdentityProvider | deleteSocialIdentityProvider} instead * ```javascript * deleteSocialIdentityProvider(providerId: string): Promise * ``` * @group Deprecated */ deleteSocialProvider(providerId: string): Promise; /** * Export social identity provider * @param {string} providerId provider id/name * @returns {Promise} a promise that resolves to a SocialProviderExportInterface object * @deprecated since v2.0.0 use {@link Idp.exportSocialIdentityProvider | exportSocialIdentityProvider} instead * ```javascript * exportSocialIdentityProvider(providerId: string): Promise * ``` * @group Deprecated */ exportSocialProvider(providerId: string): Promise; /** * Export all social identity providers * @returns {Promise} a promise that resolves to a SocialProviderExportInterface object * @deprecated since v2.0.0 use {@link Idp.exportSocialIdentityProviders | exportSocialIdentityProviders} instead * ```javascript * exportSocialIdentityProviders(): Promise * ``` * @group Deprecated */ exportSocialProviders(): Promise; /** * Import social identity provider * @param {string} providerId provider id/name * @param {SocialProviderExportInterface} importData import data * @deprecated since v2.0.0 use {@link Idp.importSocialIdentityProvider | importSocialIdentityProvider} instead * ```javascript * importSocialIdentityProvider(providerId: string, importData: SocialProviderExportInterface): Promise * ``` * @group Deprecated */ importSocialProvider(providerId: string, importData: SocialProviderExportInterface): Promise; /** * Import first social identity provider * @param {SocialProviderExportInterface} importData import data * @deprecated since v2.0.0 use {@link Idp.importFirstSocialIdentityProvider | importFirstSocialIdentityProvider} instead * ```javascript * importFirstSocialIdentityProvider(importData: SocialProviderExportInterface): Promise * ``` * @group Deprecated */ importFirstSocialProvider(importData: SocialProviderExportInterface): Promise; /** * Import all social identity providers * @param {SocialProviderExportInterface} importData import data * @deprecated since v2.0.0 use {@link Idp.importFirstSocialIdentityProviders | importFirstSocialIdentityProviders} instead * ```javascript * importFirstSocialIdentityProviders(importData: SocialProviderExportInterface): Promise * ``` * @group Deprecated */ importSocialProviders(importData: SocialProviderExportInterface): Promise; }; /** * Social identity provider export options */ interface SocialIdentityProviderExportOptions { /** * Use string arrays to store multi-line text in scripts. */ useStringArrays: boolean; /** * Include any dependencies (scripts). */ deps: boolean; } /** * Social identity provider import options */ interface SocialIdentityProviderImportOptions { /** * Include any dependencies (scripts). */ deps: boolean; } interface SocialProviderExportInterface { meta?: ExportMetaData; script: Record; idp: Record; } interface EnvInfoInterface { immutable: boolean; locked: boolean; region: string; tier: string; warning_message_html: string; message_box_title: string; message_box_html: string; message_variant: string; config_promotion_done: boolean; placeholder_management: 'CUSTOMER' | 'SRE'; placeholder_management_migration_date: string; } type Info = { /** * Get info about the platform instance * @returns {Promise} a promise that resolves to a json blob with information about the instance and tokens */ getInfo(): Promise; }; interface PlatformInfoInterface { host: string; authenticatedSubject: string; amVersion: string; cookieName: string; sessionToken: string; bearerToken?: string; deploymentType: string; } type PlatformInfo = PlatformInfoInterface & Partial; /** * See {@link https://backstage.forgerock.com/docs/idm/7/rest-api-reference/sec-about-crest.html#about-crest-patch}. */ interface ManagedObjectPatchOperationInterface { operation: 'add' | 'copy' | 'increment' | 'move' | 'remove' | 'replace' | 'transform'; field: string; value?: any; from?: string; } type ManagedObject = { /** * Create managed object * @param {string} type managed object type, e.g. teammember or alpha_user * @param {IdObjectSkeletonInterface} moData managed object data * @param {string} id managed object _id */ createManagedObject(type: string, moData: IdObjectSkeletonInterface, id?: string): Promise; /** * Read managed object * @param {string} type managed object type, e.g. alpha_user or user * @param {string} id managed object id * @param {string[]} id array of fields to include * @returns {Promise} a promise that resolves to an IdObjectSkeletonInterface */ readManagedObject(type: string, id: string, fields: string[]): Promise; /** * Read all managed object of the specified type * @param {string} type managed object type, e.g. alpha_user or user * @param {string[]} fields array of fields to return * @returns {Promise} a promise that resolves to an array of IdObjectSkeletonInterfaces */ readManagedObjects(type: string, fields: string[]): Promise; /** * Update managed object * @param {string} type managed object type, e.g. alpha_user or user * @param {string} id managed object id * @param {IdObjectSkeletonInterface} moData managed object data * @returns {Promise} a promise that resolves to an IdObjectSkeletonInterface */ updateManagedObject(type: string, id: string, moData: IdObjectSkeletonInterface): Promise; /** * Partially update managed object through a collection of patch operations. * @param {string} type managed object type, e.g. alpha_user or user * @param {string} id managed object id * @param {ManagedObjectPatchOperationInterface[]} operations collection of patch operations to perform on the object * @param {string} rev managed object revision * @returns {Promise} a promise that resolves to an IdObjectSkeletonInterface */ updateManagedObjectProperties(type: string, id: string, operations: ManagedObjectPatchOperationInterface[], rev?: string): Promise; /** * Partially update multiple managed object through a collection of patch operations. * @param {string} type managed object type, e.g. alpha_user or user * @param {string} filter CREST search filter * @param {ManagedObjectPatchOperationInterface[]} operations collection of patch operations to perform on the object * @param {string} rev managed object revision * @param {number} pageSize page size * @returns {Promise} a promise that resolves to an IdObjectSkeletonInterface */ updateManagedObjectsProperties(type: string, filter: string, operations: ManagedObjectPatchOperationInterface[], rev?: string, pageSize?: number): Promise; /** * Delete managed object * @param {string} type managed object type, e.g. alpha_user or user * @param {string} id managed object id * @returns {Promise} a promise that resolves to an IdObjectSkeletonInterface */ deleteManagedObject(type: string, id: string): Promise; /** * Delete managed objects by filter * @param {string} type managed object type, e.g. alpha_user or user * @param {string} filter filter * @returns {Promise} a promise that resolves the number of deleted objects */ deleteManagedObjects(type: string, filter: string): Promise; /** * Query managed objects * @param {string} type managed object type, e.g. alpha_user or user * @param {string} filter CREST search filter * @param {string[]} fields array of fields to return * @return {Promise} a promise resolving to an array of managed objects */ queryManagedObjects(type: string, filter?: string, fields?: string[], pageSize?: number): Promise; /** * Resolve a managed object's uuid to a human readable username * @param {string} type managed object type, e.g. teammember or alpha_user * @param {string} id managed object _id * @returns {Promise} resolved username or uuid if any error occurs during reslution */ resolveUserName(type: string, id: string): Promise; /** * Resolve a managed object's uuid to a human readable full name * @param {string} type managed object type, e.g. teammember or alpha_user * @param {string} id managed object _id * @returns {Promise} resolved full name or uuid if any error occurs during reslution */ resolveFullName(type: string, id: string): Promise; /** * Resolve a perpetrator's uuid to a human readable string identifying the perpetrator * @param {string} id managed object _id * @returns {Promise} resolved perpetrator descriptive string or uuid if any error occurs during reslution */ resolvePerpetratorUuid(id: string): Promise; }; type Node = { /** * Read all node types * @returns {Promise} a promise that resolves to an array of node type objects */ readNodeTypes(): Promise; /** * Read all nodes * @returns {Promise} a promise that resolves to an object containing an array of node objects */ readNodes(): Promise; /** * Read all nodes by type * @param {string} nodeType node type * @returns {Promise} a promise that resolves to an object containing an array of node objects of the requested type */ readNodesByType(nodeType: string): Promise; /** * Read node by uuid and type * @param {string} nodeId node uuid * @param {string} nodeType node type * @returns {Promise} a promise that resolves to a node object */ readNode(nodeId: string, nodeType: string): Promise; /** * Create node by type * @param {string} nodeType node type * @param {NodeSkeleton} nodeData node object * @returns {Promise} a promise that resolves to an object containing a node object */ createNode(nodeType: string, nodeData: NodeSkeleton): Promise; /** * Update or create node by uuid and type * @param {string} nodeId node uuid * @param {string} nodeType node type * @param {NodeSkeleton} nodeData node object * @returns {Promise} a promise that resolves to an object containing a node object */ updateNode(nodeId: string, nodeType: string, nodeData: NodeSkeleton): Promise; /** * Delete node by uuid and type * @param {string} nodeId node uuid * @param {string} nodeType node type * @returns {Promise} a promise that resolves to an object containing a node object */ deleteNode(nodeId: string, nodeType: string): Promise; /** * Find all node configuration objects that are no longer referenced by any tree * @returns {Promise} a promise that resolves to an array of orphaned nodes */ findOrphanedNodes(): Promise; /** * Remove orphaned nodes * @param {NodeSkeleton[]} orphanedNodes Pass in an array of orphaned node configuration objects to remove * @returns {Promise} a promise that resolves to an array nodes that encountered errors deleting */ removeOrphanedNodes(orphanedNodes: NodeSkeleton[]): Promise; /** * Analyze if a node type is premium. * @param {string} nodeType Node type * @returns {boolean} True if the node type is premium, false otherwise. */ isPremiumNode(nodeType: string): boolean; /** * Analyze if a node type is a cloud-only node. * @param {string} nodeType Node type * @returns {boolean} True if the node type is cloud-only, false otherwise. */ isCloudOnlyNode(nodeType: string): boolean; /** * Analyze if a node type is a cloud-excluded node. Cloud excluded nodes are OOTB nodes in self-hosted AM deployments but have been excluded in cloud. * @param {string} nodeType node type. * @returns {boolean} True if node type is cloud-excluded, false otherwise. */ isCloudExcludedNode(nodeType: string): boolean; /** * Analyze if a node type has been deprecated * @param {string} nodeType node type. * @returns {boolean} True if node type is deprecated, false otherwise. */ isDeprecatedNode(nodeType: string): boolean; /** * Analyze if a node is custom. * @param {string} nodeType Node type * @returns {boolean} True if the node type is custom, false otherwise. */ isCustomNode(nodeType: string): boolean; /** * Get a node's classifications, which can be one or multiple of: * - standard: can run on any instance of a ForgeRock platform * - cloud: utilize nodes, which are exclusively available in the ForgeRock Identity Cloud * - premium: utilizes nodes, which come at a premium * @param {string} nodeType Node type * @returns {NodeClassificationType[]} an array of one or multiple classifications */ getNodeClassification(nodeType: string): NodeClassificationType[]; }; type NodeClassificationType = 'standard' | 'custom' | 'cloud' | 'excluded' | 'premium' | 'deprecated'; type OAuth2Client = { /** * Create an empty OAuth2 client export template * @returns {OAuth2ClientExportInterface} an empty OAuth2 client export template */ createOAuth2ClientExportTemplate(): OAuth2ClientExportInterface; /** * Read all OAuth2 clients * @returns {Promise} a promise that resolves to an array of oauth2client objects */ readOAuth2Clients(): Promise; /** * Read OAuth2 client * @param {string} clientId client id * @returns {Promise} a promise that resolves to an oauth2client object */ readOAuth2Client(clientId: string): Promise; /** * Create OAuth2 client * @param {string} clientId client id * @param {any} clientData oauth2client object * @returns {Promise} a promise that resolves to an oauth2client object */ createOAuth2Client(clientId: string, clientData: OAuth2ClientSkeleton): Promise; /** * Update or create OAuth2 client * @param {string} clientId client id * @param {any} clientData oauth2client object * @returns {Promise} a promise that resolves to an oauth2client object */ updateOAuth2Client(clientId: string, clientData: OAuth2ClientSkeleton): Promise; /** * Delete all OAuth2 clients * @returns {Promise} a promise that resolves to an array of oauth2client objects */ deleteOAuth2Clients(): Promise; /** * Delete OAuth2 client * @param {string} clientId client id * @returns {Promise} a promise that resolves to an oauth2client object */ deleteOAuth2Client(clientId: string): Promise; /** * Export all OAuth2 clients * @param {OAuth2ClientExportOptions} options export options * @returns {OAuth2ClientExportInterface} export data */ exportOAuth2Clients(options?: OAuth2ClientExportOptions): Promise; /** * Export OAuth2 client by ID * @param {string} clientId oauth2 client id * @param {OAuth2ClientExportOptions} options export options * @returns {OAuth2ClientExportInterface} export data */ exportOAuth2Client(clientId: string, options?: OAuth2ClientExportOptions): Promise; /** * Import OAuth2 Client by ID * @param {string} clientId client id * @param {OAuth2ClientExportInterface} importData import data * @param {OAuth2ClientImportOptions} options import options * @returns {Promise} a promise resolving to an oauth2 client */ importOAuth2Client(clientId: string, importData: OAuth2ClientExportInterface, options?: OAuth2ClientImportOptions): Promise; /** * Import first OAuth2 Client * @param {OAuth2ClientExportInterface} importData import data * @param {OAuth2ClientImportOptions} options import options * @returns {Promise} a promise resolving to an oauth2 client */ importFirstOAuth2Client(importData: OAuth2ClientExportInterface, options?: OAuth2ClientImportOptions): Promise; /** * Import OAuth2 Clients * @param {OAuth2ClientExportInterface} importData import data * @param {OAuth2ClientImportOptions} options import options * @returns {Promise} a promise resolving to an array of oauth2 clients */ importOAuth2Clients(importData: OAuth2ClientExportInterface, options?: OAuth2ClientImportOptions): Promise; /** * Get all OAuth2 clients * @returns {Promise} a promise that resolves to an array of oauth2client objects * @deprecated since v2.0.0 use {@link OAuth2Client.readOAuth2Clients | readOAuth2Clients} instead * ```javascript * readOAuth2Clients(): Promise * ``` * @group Deprecated */ getOAuth2Clients(): Promise; /** * Get OAuth2 client * @param {string} clientId client id * @returns {Promise} a promise that resolves to an oauth2client object * @deprecated since v2.0.0 use {@link OAuth2Client.readOAuth2Client | readOAuth2Client} instead * ```javascript * readOAuth2Client(clientId: string): Promise * ``` * @group Deprecated */ getOAuth2Client(clientId: string): Promise; /** * Put OAuth2 client * @param {string} clientId client id * @param {OAuth2ClientSkeleton} clientData oauth2client object * @returns {Promise} a promise that resolves to an oauth2client object * @deprecated since v2.0.0 use {@link OAuth2Client.updateOAuth2Client | updateOAuth2Client} or {@link OAuth2Client.createOAuth2Client | createOAuth2Client} instead * ```javascript * updateOAuth2Client(clientId: string, clientData: OAuth2ClientSkeleton): Promise * createOAuth2Client(clientId: string, clientData: OAuth2ClientSkeleton): Promise * ``` * @group Deprecated */ putOAuth2Client(clientId: string, clientData: OAuth2ClientSkeleton): Promise; }; /** * OAuth2 client export options */ interface OAuth2ClientExportOptions { /** * Use string arrays to store multi-line text in scripts. */ useStringArrays: boolean; /** * Include any dependencies (scripts). */ deps: boolean; } /** * OAuth2 client import options */ interface OAuth2ClientImportOptions { /** * Include any dependencies (scripts). */ deps: boolean; } interface OAuth2ClientExportInterface { meta?: ExportMetaData; script?: Record; application: Record; } type OAuth2ProviderSkeleton = AmConfigEntityInterface & { advancedOIDCConfig: { supportedRequestParameterEncryptionEnc?: string[]; authorisedOpenIdConnectSSOClients?: string[]; supportedUserInfoEncryptionAlgorithms?: string[]; supportedAuthorizationResponseEncryptionEnc?: string[]; supportedTokenIntrospectionResponseEncryptionAlgorithms?: string[]; useForceAuthnForPromptLogin?: boolean; useForceAuthnForMaxAge?: boolean; alwaysAddClaimsToToken?: boolean; supportedTokenIntrospectionResponseSigningAlgorithms?: string[]; supportedTokenEndpointAuthenticationSigningAlgorithms?: string[]; supportedRequestParameterSigningAlgorithms?: string[]; includeAllKtyAlgCombinationsInJwksUri?: boolean; amrMappings?: any; loaMapping?: any; authorisedIdmDelegationClients?: string[]; idTokenInfoClientAuthenticationEnabled?: boolean; storeOpsTokens?: boolean; supportedUserInfoSigningAlgorithms?: string[]; supportedAuthorizationResponseSigningAlgorithms?: string[]; supportedUserInfoEncryptionEnc?: string[]; claimsParameterSupported?: boolean; supportedTokenIntrospectionResponseEncryptionEnc?: string[]; supportedAuthorizationResponseEncryptionAlgorithms?: string[]; supportedRequestParameterEncryptionAlgorithms?: string[]; defaultACR?: string[]; [k: string]: string | number | boolean | string[] | object | undefined; }; advancedOAuth2Config?: { passwordGrantAuthService?: string; tokenCompressionEnabled?: boolean; tokenEncryptionEnabled?: boolean; requirePushedAuthorizationRequests?: boolean; tlsCertificateBoundAccessTokensEnabled?: boolean; defaultScopes?: string[]; moduleMessageEnabledInPasswordGrant?: boolean; allowClientCredentialsInTokenRequestQueryParameters?: boolean; supportedSubjectTypes?: string[]; refreshTokenGracePeriod?: number; tlsClientCertificateHeaderFormat?: string; hashSalt?: string; macaroonTokenFormat?: string; maxAgeOfRequestObjectNbfClaim?: number; tlsCertificateRevocationCheckingEnabled?: boolean; nbfClaimRequiredInRequestObject?: boolean; requestObjectProcessing?: string; maxDifferenceBetweenRequestObjectNbfAndExp?: number; responseTypeClasses?: string[]; expClaimRequiredInRequestObject?: boolean; tokenValidatorClasses?: string[]; tokenSigningAlgorithm?: string; codeVerifierEnforced?: string; displayNameAttribute?: string; tokenExchangeClasses?: string[]; parRequestUriLifetime?: number; allowedAudienceValues?: string[]; persistentClaims?: string[]; supportedScopes?: string[]; authenticationAttributes?: string[]; grantTypes?: string[]; [k: string]: string | number | boolean | string[] | object | undefined; }; clientDynamicRegistrationConfig?: { dynamicClientRegistrationScope: string; allowDynamicRegistration: boolean; requiredSoftwareStatementAttestedAttributes: string[]; dynamicClientRegistrationSoftwareStatementRequired: boolean; generateRegistrationAccessTokens: boolean; [k: string]: string | number | boolean | string[] | object | undefined; }; coreOIDCConfig?: { overrideableOIDCClaims: string[]; oidcDiscoveryEndpointEnabled: boolean; supportedIDTokenEncryptionMethods: string[]; supportedClaims: string[]; supportedIDTokenSigningAlgorithms: string[]; supportedIDTokenEncryptionAlgorithms: string[]; jwtTokenLifetime: number; [k: string]: string | number | boolean | string[] | object | undefined; }; coreOAuth2Config?: { refreshTokenLifetime: number; scopesPolicySet: string; accessTokenMayActScript: '[Empty]' | string; accessTokenLifetime: number; macaroonTokensEnabled: boolean; codeLifetime: number; statelessTokensEnabled: boolean; usePolicyEngineForScope: boolean; issueRefreshToken: boolean; oidcMayActScript: '[Empty]' | string; issueRefreshTokenOnRefreshedToken: boolean; [k: string]: string | number | boolean | string[] | object | undefined; }; consent?: { supportedRcsRequestSigningAlgorithms: string[]; supportedRcsResponseEncryptionAlgorithms: string[]; supportedRcsRequestEncryptionMethods: string[]; enableRemoteConsent: boolean; supportedRcsRequestEncryptionAlgorithms: string[]; clientsCanSkipConsent: boolean; supportedRcsResponseSigningAlgorithms: string[]; supportedRcsResponseEncryptionMethods: string[]; [k: string]: string | number | boolean | string[] | object | undefined; }; deviceCodeConfig?: { deviceUserCodeLength: number; deviceCodeLifetime: number; deviceUserCodeCharacterSet: string; devicePollInterval: number; [k: string]: string | number | boolean | string[] | object | undefined; }; pluginsConfig?: { evaluateScopeClass?: string; validateScopeScript?: '[Empty]' | string; accessTokenEnricherClass?: string; oidcClaimsPluginType?: string; authorizeEndpointDataProviderClass?: string; authorizeEndpointDataProviderPluginType?: 'JAVA' | 'SCRIPTED'; userCodeGeneratorClass?: string; evaluateScopeScript?: '[Empty]' | string; oidcClaimsClass?: string; evaluateScopePluginType?: 'JAVA' | 'SCRIPTED'; authorizeEndpointDataProviderScript?: '[Empty]' | string; accessTokenModifierClass?: string; accessTokenModificationScript?: '[Empty]' | string; validateScopePluginType?: 'JAVA' | 'SCRIPTED'; accessTokenModificationPluginType?: 'JAVA' | 'SCRIPTED'; oidcClaimsScript?: '[Empty]' | string; validateScopeClass?: string; [k: string]: string | number | boolean | string[] | object | undefined; }; cibaConfig?: { cibaMinimumPollingInterval: number; supportedCibaSigningAlgorithms: string[]; cibaAuthReqIdLifetime: number; [k: string]: string | number | boolean | string[] | object | undefined; }; [k: string]: string | number | boolean | string[] | object | undefined; }; type OAuth2Provider = { /** * Read oauth2 provider * @returns {Promise} a promise resolving to an oauth2 provider object */ readOAuth2Provider(): Promise; /** * Create oauth2 provider * @param {OAuth2ProviderSkeleton} providerData oauth2 provider data * @returns {Promise} a promise resolving to an oauth2 provider object */ createOAuth2Provider(providerData?: OAuth2ProviderSkeleton): Promise; /** * Update or create oauth2 provider * @param {OAuth2ProviderSkeleton} providerData oauth2 provider data * @returns {Promise} a promise resolving to an oauth2 provider object */ updateOAuth2Provider(providerData: OAuth2ProviderSkeleton): Promise; /** * Delete oauth2 provider * @returns {Promise} a promise resolving to an oauth2 provider object */ deleteOAuth2Provider(): Promise; /** * Get oauth2 provider * @returns {Promise} a promise resolving to an oauth2 provider object * @deprecated since v2.0.0 use {@link OAuth2Provider.readOAuth2Provider | readOAuth2Provider} instead * ```javascript * importFirstSocialIdentityProvider(importData: SocialProviderExportInterface): Promise * ``` * @group Deprecated */ getOAuth2Provider(): Promise; }; type OAuth2TrustedJwtIssuer = { /** * Create an empty OAuth2 trusted jwt issuer export template * @returns {OAuth2TrustedJwtIssuerExportInterface} an empty OAuth2 trusted jwt issuer export template */ createOAuth2TrustedJwtIssuerExportTemplate(): OAuth2TrustedJwtIssuerExportInterface; /** * Read all OAuth2 trusted jwt issuers * @returns {Promise} a promise that resolves to an array of trusted jwt issuer objects */ readOAuth2TrustedJwtIssuers(): Promise; /** * Read OAuth2 trusted jwt issuer * @param {string} issuerId trusted jwt issuer id * @returns {Promise} a promise that resolves to an trusted jwt issuer object */ readOAuth2TrustedJwtIssuer(issuerId: string): Promise; /** * Create OAuth2 trusted jwt issuer * @param {string} issuerId trusted jwt issuer id * @param {any} issuerData trusted jwt issuer object * @returns {Promise} a promise that resolves to an trusted jwt issuer object */ createOAuth2TrustedJwtIssuer(issuerId: string, issuerData: OAuth2TrustedJwtIssuerSkeleton): Promise; /** * Update or create OAuth2 trusted jwt issuer * @param {string} issuerId trusted jwt issuer id * @param {any} issuerData trusted jwt issuer object * @returns {Promise} a promise that resolves to an trusted jwt issuer object */ updateOAuth2TrustedJwtIssuer(issuerId: string, issuerData: OAuth2TrustedJwtIssuerSkeleton): Promise; /** * Delete all OAuth2 trusted jwt issuers * @returns {Promise} a promise that resolves to an array of trusted jwt issuer objects */ deleteOAuth2TrustedJwtIssuers(): Promise; /** * Delete OAuth2 trusted jwt issuer * @param {string} issuerId trusted jwt issuer id * @returns {Promise} a promise that resolves to an trusted jwt issuer object */ deleteOAuth2TrustedJwtIssuer(issuerId: string): Promise; /** * Export all OAuth2 trusted jwt issuers * @param {OAuth2TrustedJwtIssuerExportOptions} options export options * @returns {OAuth2TrustedJwtIssuerExportInterface} export data */ exportOAuth2TrustedJwtIssuers(options?: OAuth2TrustedJwtIssuerExportOptions): Promise; /** * Export OAuth2 trusted jwt issuer by ID * @param {string} issuerId oauth2 trusted jwt issuer id * @param {OAuth2TrustedJwtIssuerExportOptions} options export options * @returns {OAuth2TrustedJwtIssuerExportInterface} export data */ exportOAuth2TrustedJwtIssuer(issuerId: string, options?: OAuth2TrustedJwtIssuerExportOptions): Promise; /** * Import OAuth2 Client by ID * @param {string} issuerId trusted jwt issuer id * @param {OAuth2TrustedJwtIssuerExportInterface} importData import data * @param {OAuth2TrustedJwtIssuerImportOptions} options import options * @returns {Promise} a promise resolving to an oauth2 trusted jwt issuer */ importOAuth2TrustedJwtIssuer(issuerId: string, importData: OAuth2TrustedJwtIssuerExportInterface, options?: OAuth2TrustedJwtIssuerImportOptions): Promise; /** * Import first OAuth2 Client * @param {OAuth2TrustedJwtIssuerExportInterface} importData import data * @param {OAuth2TrustedJwtIssuerImportOptions} options import options * @returns {Promise} a promise resolving to an oauth2 trusted jwt issuer */ importFirstOAuth2TrustedJwtIssuer(importData: OAuth2TrustedJwtIssuerExportInterface, options?: OAuth2TrustedJwtIssuerImportOptions): Promise; /** * Import OAuth2 Clients * @param {OAuth2TrustedJwtIssuerExportInterface} importData import data * @param {OAuth2TrustedJwtIssuerImportOptions} options import options * @returns {Promise} a promise resolving to an array of oauth2 trusted jwt issuers */ importOAuth2TrustedJwtIssuers(importData: OAuth2TrustedJwtIssuerExportInterface, options?: OAuth2TrustedJwtIssuerImportOptions): Promise; /** * Get all OAuth2 trusted jwt issuers * @returns {Promise} a promise that resolves to an array of trusted jwt issuer objects * @deprecated since v2.0.0 use {@link OAuth2TrustedJwtIssuer.readOAuth2TrustedJwtIssuers | readOAuth2TrustedJwtIssuers} instead * ```javascript * readOAuth2TrustedJwtIssuers(): Promise * ``` * @group Deprecated */ getOAuth2TrustedJwtIssuers(): Promise; /** * Get OAuth2 trusted jwt issuer * @param {string} issuerId trusted jwt issuer id * @returns {Promise} a promise that resolves to an trusted jwt issuer object * @deprecated since v2.0.0 use {@link OAuth2TrustedJwtIssuer.readOAuth2TrustedJwtIssuer | readOAuth2TrustedJwtIssuer} instead * ```javascript * readOAuth2TrustedJwtIssuer(issuerId: string): Promise * ``` * @group Deprecated */ getOAuth2TrustedJwtIssuer(issuerId: string): Promise; /** * Put OAuth2 trusted jwt issuer * @param {string} issuerId trusted jwt issuer id * @param {OAuth2TrustedJwtIssuerSkeleton} issuerData trusted jwt issuer object * @returns {Promise} a promise that resolves to an trusted jwt issuer object * @deprecated since v2.0.0 use {@link OAuth2TrustedJwtIssuer.updateOAuth2TrustedJwtIssuer | updateOAuth2TrustedJwtIssuer} or {@link OAuth2TrustedJwtIssuer.createOAuth2TrustedJwtIssuer | createOAuth2TrustedJwtIssuer} instead * ```javascript * updateOAuth2TrustedJwtIssuer(issuerId: string, issuerData: OAuth2TrustedJwtIssuerSkeleton): Promise * createOAuth2TrustedJwtIssuer(issuerId: string, issuerData: OAuth2TrustedJwtIssuerSkeleton): Promise * ``` * @group Deprecated */ putOAuth2TrustedJwtIssuer(issuerId: string, issuerData: OAuth2TrustedJwtIssuerSkeleton): Promise; }; /** * OAuth2 trusted jwt issuer export options */ interface OAuth2TrustedJwtIssuerExportOptions { /** * Use string arrays to store multi-line text in scripts. */ useStringArrays: boolean; /** * Include any dependencies (scripts). */ deps: boolean; } /** * OAuth2 trusted jwt issuer import options */ interface OAuth2TrustedJwtIssuerImportOptions { /** * Include any dependencies (scripts). */ deps: boolean; } interface OAuth2TrustedJwtIssuerExportInterface { meta?: ExportMetaData; trustedJwtIssuer: Record; } type Organization = { /** * Get organization managed object type * @returns {string} organization managed object type in this realm */ getRealmManagedOrganization(): string; /** * Read all organizations * @returns {Promise} promise resolving to an array of organization objects */ readOrganizations(): Promise; /** * Get organizations * @returns {Promise} promise resolving to an array of organization objects * @deprecated since v2.0.0 use {@link Organization.readOrganizations | readOrganizations} instead * ```javascript * readOrganizations(): Promise * ``` * @group Deprecated */ getOrganizations(): Promise; }; type Policy = { /** * Create policy export template */ createPolicyExportTemplate(): PolicyExportInterface; /** * Read all policies * @returns {Promise} a promise that resolves to an array of policy set objects */ readPolicies(): Promise; /** * Get policies by policy set * @param {string} policySetId policy set id/name * @returns {Promise} a promise resolving to an array of policy objects */ readPoliciesByPolicySet(policySetId: string): Promise; /** * Get policy * @param {string} policyId policy id/name * @returns {Promise} promise resolving to a policy object */ readPolicy(policyId: string): Promise; /** * Update or create policy * @param {string} policyId policy id/name * @param {PolicySkeleton} policyData policy object * @returns {Promise} promise resolving to a policy object */ createPolicy(policyId: string, policyData: PolicySkeleton): Promise; /** * Update or create policy * @param {string} policyId policy id/name * @param {PolicySkeleton} policyData policy object * @returns {Promise} promise resolving to a policy object */ updatePolicy(policyId: string, policyData: PolicySkeleton): Promise; /** * Delete policy * @param {string} policyId policy id/name * @returns {Promise} promise resolving to a policy object */ deletePolicy(policyId: string): Promise; /** * Export policy * @param {string} policyId policy id/name * @returns {Promise} a promise that resolves to a PolicyExportInterface object */ exportPolicy(policyId: string, options?: PolicyExportOptions): Promise; /** * Export policies * @param {PolicyExportOptions} options export options * @returns {Promise} a promise that resolves to an PolicyExportInterface object */ exportPolicies(options?: PolicyExportOptions): Promise; /** * Export policies by policy set * @param {string} policySetName policy set id/name * @param {PolicyExportOptions} options export options * @returns {Promise} a promise that resolves to an PolicyExportInterface object */ exportPoliciesByPolicySet(policySetName: string, options?: PolicyExportOptions): Promise; /** * Import policy by id * @param {string} policyId policy id * @param {PolicyExportInterface} importData import data * @param {PolicyImportOptions} options import options * @returns {Promise} imported policy object */ importPolicy(policyId: string, importData: PolicyExportInterface, options?: PolicyImportOptions): Promise; /** * Import first policy * @param {PolicyExportInterface} importData import data * @param {PolicyImportOptions} options import options * @returns {Promise} imported policy object */ importFirstPolicy(importData: PolicyExportInterface, options?: PolicyImportOptions): Promise; /** * Import policies * @param {PolicyExportInterface} importData import data * @param {PolicyImportOptions} options import options * @returns {Promise} array of imported policy objects */ importPolicies(importData: PolicyExportInterface, options?: PolicyImportOptions): Promise; /** * Get all policies * @returns {Promise} a promise that resolves to an array of policy set objects * @deprecated since v2.0.0 use {@link Agent.readPolicies | readPolicies} instead * ```javascript * readPolicies(): Promise * ``` * @group Deprecated */ getPolicies(): Promise; /** * Get policies by policy set * @param {string} policySetId policy set id/name * @returns {Promise} a promise resolving to an array of policy objects * @deprecated since v2.0.0 use {@link Agent.readPoliciesByPolicySet | readPoliciesByPolicySet} instead * ```javascript * readPoliciesByPolicySet(policySetId: string): Promise * ``` * @group Deprecated */ getPoliciesByPolicySet(policySetId: string): Promise; /** * Get policy * @param {string} policyId policy id/name * @returns {Promise} promise resolving to a policy object * @deprecated since v2.0.0 use {@link Agent.readPolicy | readPolicy} instead * ```javascript * readPolicy(policyId: string): Promise * ``` * @group Deprecated */ getPolicy(policyId: string): Promise; /** * Update or create policy * @param {string} policyId policy id/name * @param {PolicySkeleton} policyData policy object * @returns {Promise} promise resolving to a policy object * @deprecated since v2.0.0 use {@link Agent.updatePolicy | updatePolicy} or {@link Agent.createPolicy | createPolicy} instead * ```javascript * updatePolicy(policyId: string, policyData: PolicySkeleton): Promise * createPolicy(policyId: string, policyData: PolicySkeleton): Promise * ``` * @group Deprecated */ putPolicy(policyId: string, policyData: PolicySkeleton): Promise; }; interface PolicyExportInterface { meta?: ExportMetaData; script: Record; resourcetype: Record; policy: Record; policyset: Record; } /** * Policy export options */ interface PolicyExportOptions { /** * Include any dependencies (scripts). */ deps: boolean; /** * Include any prerequisites (policy sets, resource types). */ prereqs: boolean; /** * Use string arrays to store multi-line text in scripts. */ useStringArrays: boolean; } /** * Policy import options */ interface PolicyImportOptions { /** * Include any dependencies (scripts). */ deps: boolean; /** * Include any prerequisites (policy sets, resource types). */ prereqs: boolean; /** * Import policies into different policy set */ policySetName?: string; } type PolicySet = { /** * Create policy export template * @returns {PolicySetExportInterface} policy export interface */ createPolicySetExportTemplate(): PolicySetExportInterface; /** * Read all policy sets * @returns {Promise} a promise that resolves to an array of policy set objects */ readPolicySets(): Promise; /** * Read policy set * @param {string} policySetName policy set name * @returns {Promise} a promise that resolves to a policy set object */ readPolicySet(policySetName: string): Promise; createPolicySet(policySetData: PolicySetSkeleton, policySetName?: string): Promise; updatePolicySet(policySetData: PolicySetSkeleton, policySetName?: string): Promise; deletePolicySet(policySetName: string): Promise; /** * Export policy set * @param {string} policySetName policy set name * @param {PolicySetExportOptions} options export options * @returns {Promise} a promise that resolves to an PolicySetExportInterface object */ exportPolicySet(policySetName: string, options?: PolicySetExportOptions): Promise; /** * Export policy sets * @param {PolicySetExportOptions} options export options * @returns {Promise} a promise that resolves to an PolicySetExportInterface object */ exportPolicySets(options?: PolicySetExportOptions): Promise; /** * Import policy set * @param {string} policySetName policy set name * @param {PolicySetExportInterface} importData import data * @param {PolicySetImportOptions} options import options */ importPolicySet(policySetName: string, importData: PolicySetExportInterface, options?: PolicySetImportOptions): Promise; /** * Import first policy set * @param {PolicySetExportInterface} importData import data * @param {PolicySetImportOptions} options import options */ importFirstPolicySet(importData: PolicySetExportInterface, options?: PolicySetImportOptions): Promise; /** * Import policy sets * @param {PolicySetExportInterface} importData import data * @param {PolicySetImportOptions} options import options * @returns {any[]} The imported policy sets */ importPolicySets(importData: PolicySetExportInterface, options?: PolicySetImportOptions): Promise; /** * Get all policy sets * @returns {Promise} a promise that resolves to an array of policy set objects * @deprecated since v2.0.0 use {@link Policy.readPolicySets | readPolicySets} instead * ```javascript * readPolicySets(): Promise * ``` * @group Deprecated */ getPolicySets(): Promise; /** * Get policy set * @param {string} policySetName policy set name * @returns {Promise} a promise that resolves to a policy set object * @deprecated since v2.0.0 use {@link Policy.readPolicySet | readPolicySet} instead * ```javascript * readPolicySet(policySetName: string): Promise * ``` * @group Deprecated */ getPolicySet(policySetName: string): Promise; }; interface PolicySetExportInterface { meta?: ExportMetaData; script: Record; resourcetype: Record; policy: Record; policyset: Record; } /** * Application/policy set export options */ interface PolicySetExportOptions { /** * Include any dependencies (policies, scripts, resource types). */ deps: boolean; /** * Include any prerequisites (policy sets, resource types). */ prereqs: boolean; /** * Use string arrays to store multi-line text in scripts. */ useStringArrays: boolean; } /** * Policy set import options */ interface PolicySetImportOptions { /** * Include any dependencies (policies, scripts, resource types). */ deps: boolean; /** * Include any prerequisites (policy sets, resource types). */ prereqs: boolean; } type RealmSkeleton = IdObjectSkeletonInterface & { parentPath: string; active: boolean; name: string; aliases: string[]; }; type Realm = { /** * Read all realms * @returns {Promise} a promise resolving to an array of realm objects */ readRealms(): Promise; /** * Read realm * @param {string} realmId realm id * @returns {Promise} a promise resolving to a realm object */ readRealm(realmId: string): Promise; /** * Read realm by name * @param {string} realmName realm name * @returns {Promise} a promise resolving to a realm object */ readRealmByName(realmName: string): Promise; /** * Create realm * @param {string} realmName realm name * @param {RealmSkeleton} realmData realm data * @returns {Promise} a promise resolving to a realm object */ createRealm(realmName: string, realmData?: RealmSkeleton): Promise; /** * Update realm * @param {string} realmId realm id * @param {RealmSkeleton} realmData realm data * @returns {Promise} a promise resolving to a realm object */ updateRealm(realmId: string, realmData: RealmSkeleton): Promise; /** * Delete realm * @param {string} realmId realm id * @returns {Promise} a promise resolving to a realm object */ deleteRealm(realmId: string): Promise; /** * Delete realm by name * @param {string} realmName realm name * @returns {Promise} a promise resolving to a realm object */ deleteRealmByName(realmName: string): Promise; /** * Add custom DNS domain name (realm DNS alias) * @param {string} realmName realm name * @param {string} domain domain name * @returns {Promise} a promise resolving to a realm object */ addCustomDomain(realmName: string, domain: string): Promise; /** * Remove custom DNS domain name (realm DNS alias) * @param {string} realmName realm name * @param {string} domain domain name * @returns {Promise} a promise resolving to a realm object */ removeCustomDomain(realmName: string, domain: string): Promise; /** * Get all realms * @returns {Promise} a promise resolving to an array of realm objects * @deprecated since v2.0.0 use {@link Realm.readRealms | readRealms} instead * ```javascript * readRealms(): Promise * ``` * @group Deprecated */ getRealms(): Promise; /** * Get realm by name * @param {string} realmName realm name * @returns {Promise} a promise resolving to a realm object * @deprecated since v2.0.0 use {@link Realm.readRealmByName | readRealmByName} instead * ```javascript * readRealmByName(realmName: string): Promise * ``` * @group Deprecated */ getRealmByName(realmName: string): Promise; /** * Update realm * @param {string} realmId realm id * @param {RealmSkeleton} realmData realm data * @returns {Promise} a promise resolving to a realm object * @deprecated since v2.0.0 use {@link Realm.updateRealm | updateRealm} or {@link Realm.createRealm | createRealm} instead * ```javascript * updateRealm(realmId: string, realmData: RealmSkeleton): Promise * createRealm(realmName: string, realmData: RealmSkeleton): Promise * ``` * @group Deprecated */ putRealm(realmId: string, realmData: RealmSkeleton): Promise; }; type ReconType = IdObjectSkeletonInterface & { mapping: string; state: 'SUCCESS' | string; stage: 'COMPLETED_SUCCESS' | string; stageDescription: string; progress: { source: { existing: { processed: number; total: string; }; }; target: { existing: { processed: number; total: string; }; created: number; unchanged: number; updated: number; deleted: number; }; links: { existing: { processed: number; total: string; }; created: number; }; }; situationSummary: { SOURCE_IGNORED: number; TARGET_CHANGED: number; SOURCE_TARGET_CONFLICT: number; FOUND_ALREADY_LINKED: number; UNQUALIFIED: number; ABSENT: number; TARGET_IGNORED: number; MISSING: number; ALL_GONE: number; UNASSIGNED: number; AMBIGUOUS: number; CONFIRMED: number; LINK_ONLY: number; SOURCE_MISSING: number; FOUND: number; }; statusSummary: { SUCCESS: number; FAILURE: number; }; durationSummary: { sourceQuery: { min: number; max: number; mean: number; count: number; sum: number; stdDev: number; }; auditLog: { min: number; max: number; mean: number; count: number; sum: number; stdDev: number; }; defaultPropertyMapping: { min: number; max: number; mean: number; count: number; sum: number; stdDev: number; }; sourceLinkQuery: { min: number; max: number; mean: number; count: number; sum: number; stdDev: number; }; updateTargetObject: { min: number; max: number; mean: number; count: number; sum: number; stdDev: number; }; propertyMappingScript: { min: number; max: number; mean: number; count: number; sum: number; stdDev: number; }; updateLastSync: { min: number; max: number; mean: number; count: number; sum: number; stdDev: number; }; targetObjectQuery: { min: number; max: number; mean: number; count: number; sum: number; stdDev: number; }; sourcePhase: { min: number; max: number; mean: number; count: number; sum: number; stdDev: number; }; }; parameters: { sourceIds: [string]; sourceQuery: { resourceName: string; _queryFilter: string; _fields: string; }; targetQuery: { resourceName: string; queryFilter: string; _fields: string; }; }; started: string; ended: string; duration: number; sourceProcessedByNode: object; }; type ReconStatusType = IdObjectSkeletonInterface & { state: 'ACTIVE' | string; action: 'cancel' | string; status: 'INITIATED' | string; }; type Recon = { /** * Read all reconciliation runs * @returns {Promise} a promise resolving to an array of recon objects */ readRecons(): Promise; /** * Read recon * @param {string} reconId id of the recon * @returns {Promise} a promise resolving to a recon object */ readRecon(reconId: string): Promise; /** * Start a reconciliation * @param {string} mappingName mapping to reconcile * @returns {Promise} a promise resolving to a recon status object */ startRecon(mappingName: string): Promise; /** * Start a reconciliation by Id * @param {string} mappingName mapping to reconcile * @param {string} objectId id of object to reconcile * @returns {Promise} a promise resolving to a recon status object */ startReconById(mappingName: string, objectId: string): Promise; /** * Cancel a reconciliation * @param {string} reconId id of the recon to cancel * @returns {Promise} a promise resolving to a recon status object */ cancelRecon(reconId: string): Promise; }; type ResourceType = { /** * Read resource type * @param resourceTypeUuid resource type uuid * @returns {Promise} a promise that resolves to a resource type object */ readResourceType(resourceTypeUuid: string): Promise; /** * Read all resource types * @returns {Promise} a promise that resolves to an array of resource type objects */ readResourceTypes(): Promise; /** * Read resource type by name * @param {string} resourceTypeName resource type name * @returns {Promise} a promise that resolves to a resource type object */ readResourceTypeByName(resourceTypeName: string): Promise; /** * Create resource type * @param resourceTypeData resource type data * @param resourceTypeUuid resource type uuid * @returns {Promise} a promise that resolves to a resource type object */ createResourceType(resourceTypeData: ResourceTypeSkeleton, resourceTypeUuid?: string): Promise; /** * Update resource type * @param {string} resourceTypeData resource type data * @returns {Promise} a promise that resolves to a resource type object */ updateResourceType(resourceTypeUuid: string, resourceTypeData: ResourceTypeSkeleton): Promise; /** * Delete resource type * @param {string} resourceTypeUuid resource type uuid * @returns {Promise} Promise resolvig to a resource type object */ deleteResourceType(resourceTypeUuid: string): Promise; /** * Delete resource type by name * @param {string} resourceTypeName resource type name * @returns {Promise} Promise resolvig to a resource type object */ deleteResourceTypeByName(resourceTypeName: string): Promise; /** * Export resource type * @param {string} resourceTypeUuid resource type uuid * @returns {Promise} a promise that resolves to an ResourceTypeExportInterface object */ exportResourceType(resourceTypeUuid: string): Promise; /** * Export resource type by name * @param {string} resourceTypeName resource type name * @returns {Promise} a promise that resolves to an ResourceTypeExportInterface object */ exportResourceTypeByName(resourceTypeName: string): Promise; /** * Export resource types * @returns {Promise} a promise that resolves to an ResourceTypeExportInterface object */ exportResourceTypes(): Promise; /** * Import resource type by uuid * @param {string} resourceTypeUuid client uuid * @param {ResourceTypeExportInterface} importData import data */ importResourceType(resourceTypeUuid: string, importData: ResourceTypeExportInterface): Promise; /** * Import resource type by name * @param {string} resourceTypeName client id * @param {ResourceTypeExportInterface} importData import data */ importResourceTypeByName(resourceTypeName: string, importData: ResourceTypeExportInterface): Promise; /** * Import first resource type * @param {ResourceTypeExportInterface} importData import data */ importFirstResourceType(importData: ResourceTypeExportInterface): Promise; /** * Import resource types * @param {ResourceTypeExportInterface} importData import data */ importResourceTypes(importData: ResourceTypeExportInterface): Promise; /** * Get resource type * @param resourceTypeUuid resource type uuid * @returns {Promise} a promise that resolves to a resource type object * @deprecated since v2.0.0 use {@link Agent.readResourceType | readResourceType} instead * ```javascript * readResourceType(resourceTypeUuid: string): Promise * ``` * @group Deprecated */ getResourceType(resourceTypeUuid: string): Promise; /** * Get all resource types * @returns {Promise} a promise that resolves to an array of resource type objects * @deprecated since v2.0.0 use {@link Agent.readResourceTypes | readResourceTypes} instead * ```javascript * readResourceTypes(): Promise * ``` * @group Deprecated */ getResourceTypes(): Promise; /** * Get resource type by name * @param {string} resourceTypeName resource type name * @returns {Promise} a promise that resolves to a resource type object * @deprecated since v2.0.0 use {@link Agent.readResourceTypeByName | readResourceTypeByName} instead * ```javascript * readResourceTypeByName(resourceTypeName: string): Promise * ``` * @group Deprecated */ getResourceTypeByName(resourceTypeName: string): Promise; }; interface ResourceTypeExportInterface { meta?: ExportMetaData; resourcetype: Record; } type Saml2 = { /** * Read all SAML2 entity provider stubs * @returns {Promise} a promise that resolves to an array of saml2 entity stubs */ readSaml2ProviderStubs(): Promise; /** * * @param {string} entityId Provider entity id * @returns {Promise} Promise resolving to a Saml2ExportInterface object. */ readSaml2ProviderStub(entityId: string): Promise; /** * Export a single entity provider. The response can be saved to file as is. * @param {string} entityId Provider entity id * @returns {Promise} Promise resolving to a Saml2ExportInterface object. */ readSaml2Provider(entityId: string): Promise; /** * Create a SAML2 entity provider * @param {Saml2ProiderLocation} location 'hosted' or 'remote' * @param {Saml2ProviderSkeleton} providerData Object representing a SAML entity provider * @param {string} metaData Base64-encoded metadata XML. Only required for remote providers * @returns {Promise} a promise that resolves to a saml2 entity provider object */ createSaml2Provider(location: Saml2ProiderLocation, providerData: Saml2ProviderSkeleton, metaData: string): Promise; /** * Update SAML2 entity provider * @param {Saml2ProiderLocation} location Entity provider location (hosted or remote) * @param {string} entityId SAML2 entity id * @param {Saml2ProviderSkeleton} providerData Object representing a SAML entity provider * @returns {Promise} a promise that resolves to a saml2 entity provider object */ updateSaml2Provider(location: Saml2ProiderLocation, providerData: Saml2ProviderSkeleton, entityId?: string): Promise; /** * Delete an entity provider. The response can be saved to file as is. * @param {string} entityId Provider entity id * @returns {Promise} Promise resolving to a Saml2ExportInterface object. */ deleteSaml2Provider(entityId: string): Promise; /** * Delete all entity providers. * @returns {Promise} Promise resolving to an array of Saml2ProviderSkeleton objects. */ deleteSaml2Providers(): Promise; /** * Get a SAML2 entity provider's metadata URL by entity id * @param {string} entityId SAML2 entity id * @returns {string} the URL to get the metadata from */ getSaml2ProviderMetadataUrl(entityId: string): string; /** * Get a SAML2 entity provider's metadata by entity id * @param {string} entityId SAML2 entity id * @returns {Promise} a promise that resolves to an object containing a SAML2 metadata */ getSaml2ProviderMetadata(entityId: string): Promise; /** * Export a single entity provider. The response can be saved to file as is. * @param {string} entityId Provider entity id * @param {Saml2EntitiesExportOptions} options export options * @returns {Promise} Promise resolving to a Saml2ExportInterface object. */ exportSaml2Provider(entityId: string, options?: Saml2EntitiesExportOptions): Promise; /** * Export all entity providers. The response can be saved to file as is. * @param {Saml2EntitiesExportOptions} options export options * @returns {Promise} Promise resolving to a Saml2ExportInterface object. */ exportSaml2Providers(options?: Saml2EntitiesExportOptions): Promise; /** * Import a SAML entity provider * @param {string} entityId Provider entity id * @param {Saml2ExportInterface} importData Import data * @param {Saml2EntitiesImportOptions} options import options * @returns {Promise} a promise resolving to a provider object */ importSaml2Provider(entityId: string, importData: Saml2ExportInterface, options?: Saml2EntitiesImportOptions): Promise; /** * Import SAML entity providers * @param {Saml2ExportInterface} importData Import data * @param {Saml2EntitiesImportOptions} options import options * @returns {Promise} a promise resolving to an array of provider objects */ importSaml2Providers(importData: Saml2ExportInterface, options?: Saml2EntitiesImportOptions): Promise; /** * Get SAML2 entity provider stubs * @returns {Promise} a promise that resolves to an array of saml2 entity stubs * @deprecated since v2.0.0 use {@link Saml2.readSaml2ProviderStubs | readSaml2ProviderStubs} instead * ```javascript * readSaml2ProviderStubs(): Promise * ``` * @group Deprecated */ getSaml2ProviderStubs(): Promise; /** * Get a SAML2 entity provider's metadata URL by entity id * @param {string} entityId SAML2 entity id * @returns {string} the URL to get the metadata from * @deprecated since v2.0.0 use {@link Saml2.getSaml2ProviderMetadataUrl | getSaml2ProviderMetadataUrl} instead * ```javascript * getSaml2ProviderMetadataUrl(entityId: string): string * ``` * @group Deprecated */ getProviderMetadataUrl(entityId: string): string; /** * Get a SAML2 entity provider's metadata by entity id * @param {string} entityId SAML2 entity id * @returns {Promise} a promise that resolves to an object containing a SAML2 metadata * @deprecated since v2.0.0 use {@link Saml2.getSaml2ProviderMetadata | getSaml2ProviderMetadata} instead * ```javascript * getSaml2ProviderMetadata(entityId: string): Promise * ``` * @group Deprecated */ getProviderMetadata(entityId: string): Promise; /** * * @param {string} entityId Provider entity id * @returns {Promise} Promise resolving to a Saml2ExportInterface object. * @deprecated since v2.0.0 use {@link Saml2.readSaml2ProviderStub | readSaml2ProviderStub} instead * ```javascript * readSaml2ProviderStub(entityId: string): Promise * ``` * @group Deprecated */ getSaml2ProviderStub(entityId: string): Promise; /** * Export a single entity provider. The response can be saved to file as is. * @param {string} entityId Provider entity id * @returns {Promise} Promise resolving to a Saml2ExportInterface object. * @deprecated since v2.0.0 use {@link Saml2.readSaml2Provider | readSaml2Provider} instead * ```javascript * readSaml2Provider(entityId: string): Promise * ``` * @group Deprecated */ getSaml2Provider(entityId: string): Promise; }; interface Saml2EntitiesImportOptions { /** * Include any dependencies (scripts). */ deps: boolean; } interface Saml2EntitiesExportOptions { /** * Include any dependencies (scripts). */ deps: boolean; } interface Saml2ExportInterface { meta?: ExportMetaData; script: Record; saml: { hosted: Record; remote: Record; metadata: Record; }; } type Script = { /** * Create an empty script export template * @returns {ScriptExportInterface} an empty script export template */ createScriptExportTemplate(): ScriptExportInterface; /** * Read all scripts * @returns {Promise} a promise that resolves to an array of script objects */ readScripts(): Promise; /** * Get the names of library scripts required by the input script object * * @param {ScriptSkeleton} scriptObj the script object * @returns an array of required library script names */ getLibraryScriptNames(scriptObj: ScriptSkeleton): string[]; /** * Read script * @param {string} scriptId script id * @returns {Promise} promise that resolves to a script object */ readScript(scriptId: string): Promise; /** * Read script by name * @param {string} scriptName name of the script * @returns {Promise} promise that resolves to a script object */ readScriptByName(scriptName: string): Promise; /** * Create script * @param {string} scriptId script id * @param {string} scriptName name of the script * @param {ScriptSkeleton} scriptData script object * @returns {Promise} a status object */ createScript(scriptId: string, scriptName: string, scriptData: ScriptSkeleton): Promise; /** * Create or update script * @param {string} scriptId script id * @param {ScriptSkeleton} scriptData script object * @returns {Promise} a status object */ updateScript(scriptId: string, scriptData: ScriptSkeleton): Promise; /** * Delete script * @param {string} scriptId script id * @returns {Promise} promise that resolves to a script object */ deleteScript(scriptId: string): Promise; /** * Delete script by name * @param {String} scriptName script name * @returns {Promise} a promise that resolves to a script object */ deleteScriptByName(scriptName: string): Promise; /** * Delete all non-default scripts * @returns {Promise>} a promise that resolves to an array of script objects */ deleteScripts(): Promise; /** * Export all scripts * @param {ScriptExportOptions} options script export options * @returns {Promise} a promise that resolved to a ScriptExportInterface object */ exportScripts(options?: ScriptExportOptions): Promise; /** * Export script by id * @param {string} scriptId script uuid * @param {ScriptExportOptions} options script export options * @returns {Promise} a promise that resolved to a ScriptExportInterface object */ exportScript(scriptId: string, options?: ScriptExportOptions): Promise; /** * Export script by name * @param {string} scriptName script name * @param {ScriptExportOptions} options script export options * @returns {Promise} a promise that resolved to a ScriptExportInterface object */ exportScriptByName(scriptName: string, options?: ScriptExportOptions): Promise; /** * Import scripts * @param {string} scriptId Optional id of script. If supplied, only the script of that id is imported. Takes priority over scriptName if both are provided. * @param {string} scriptName Optional name of script. If supplied, only the script of that name is imported * @param {ScriptExportInterface} importData Script import data * @param {ScriptImportOptions} options Script import options * @param {boolean} validate If true, validates Javascript scripts to ensure no errors exist in them. Default: false * @returns {Promise} the imported scripts */ importScripts(scriptId: string, scriptName: string, importData: ScriptExportInterface, options?: ScriptImportOptions, validate?: boolean): Promise; /** * Get all scripts * @returns {Promise} a promise that resolves to an array of script objects * @deprecated since v2.0.0 use {@link Script.readScripts | readScripts} instead * ```javascript * readScripts(): Promise * ``` * @group Deprecated */ getScripts(): Promise; /** * Get script * @param {string} scriptId script id * @returns {Promise} promise that resolves to a script object * @deprecated since v2.0.0 use {@link Script.readScript | readScript} instead * ```javascript * readScript(scriptName: string): Promise * ``` * @group Deprecated */ getScript(scriptId: string): Promise; /** * Get script by name * @param {string} scriptName name of the script * @returns {Promise} promise that resolves to a script object * @deprecated since v2.0.0 use {@link Script.readScriptByName | readScriptByName} instead * ```javascript * readScriptByName(scriptName: string): Promise * ``` * @group Deprecated */ getScriptByName(scriptName: string): Promise; /** * Create or update script * @param {string} scriptId script uuid * @param {ScriptSkeleton} scriptData script object * @returns {Promise} a status object * @deprecated since v2.0.0 use {@link Script.updateScript | updateScript} or {@link Script.createScript | createScript} instead * ```javascript * updateScript(scriptId: string, scriptData: ScriptSkeleton): Promise * createScript(scriptId: string, scriptName: string, scriptData: ScriptSkeleton): Promise * ``` * @group Deprecated */ putScript(scriptId: string, scriptData: ScriptSkeleton): Promise; }; interface ScriptExportInterface { meta?: ExportMetaData; script: Record; } /** * Script import options */ interface ScriptImportOptions { /** * Include dependency (library) scripts in export */ deps: boolean; /** * Generate new UUIDs for all scripts during import. */ reUuid: boolean; /** * Include default scripts in import if true */ includeDefault: boolean; } /** * Script export options */ interface ScriptExportOptions { /** * Include dependency (library) scripts in export */ deps: boolean; /** * Include default scripts in export if true */ includeDefault: boolean; /** * Use string arrays to store script code */ useStringArrays: boolean; } type Service = { createServiceExportTemplate(): ServiceExportInterface; /** * Get list of services * @param {boolean} globalConfig true if the list of global services is requested, false otherwise. Default: false. */ getListOfServices(globalConfig?: boolean): Promise; /** * Get all services including their descendents. * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false. * @returns Promise resolving to an array of services with their descendants */ getFullServices(globalConfig?: boolean): Promise; /** * Deletes the specified service * @param {string} serviceId The service to delete * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false. */ deleteFullService(serviceId: string, globalConfig?: boolean): Promise; /** * Deletes all services * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false. */ deleteFullServices(globalConfig?: boolean): Promise; /** * Export service. The response can be saved to file as is. * @param serviceId service id/name * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false. * @returns {Promise} Promise resolving to a ServiceExportInterface object. */ exportService(serviceId: string, globalConfig?: boolean): Promise; /** * Export all services * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false. */ exportServices(globalConfig?: boolean): Promise; /** * Imports a single service using a reference to the service and a file to read the data from. Optionally clean (remove) an existing service first * @param {string} serviceId The service id/name to add * @param {ServiceExportInterface} importData The service configuration export data to import * @param {ServiceImportOptions} options Import options * @returns {Promise} A promise resolving to a service object */ importService(serviceId: string, importData: ServiceExportInterface, options: ServiceImportOptions): Promise; /** * Imports multiple services from the same file. Optionally clean (remove) existing services first * @param {ServiceExportInterface} importData The service configuration export data to import * @param {ServiceImportOptions} options Import options * @returns {Promise} A promise resolving to an array of service objects */ importServices(importData: ServiceExportInterface, options: ServiceImportOptions): Promise; }; interface ServiceExportInterface { meta?: ExportMetaData; service: Record; } /** * Service import options */ interface ServiceImportOptions { /** * Indicates whether to remove previously existing services of the same id before importing */ clean: boolean; /** * Indicates whether to import service(s) as global services */ global: boolean; /** * Indicates whether to import service(s) to the current realm */ realm: boolean; } type SessionInfoType = { username: string; universalId: string; realm: string; latestAccessTime: string; maxIdleExpirationTime: string; maxSessionExpirationTime: string; properties: { AMCtxId: string; [k: string]: string; }; }; type Session = { /** * Get session info * @param {string} tokenId session token * @returns {Promise} a promise resolving to a session info object */ getSessionInfo(tokenId: string): Promise; }; type TokenCache = { /** * Get connection profiles file name * @returns {string} connection profiles file name */ getTokenCachePath(): string; /** * Initialize token cache * * This method is called from app.ts and runs before any of the message handlers are registered. * Therefore none of the Console message functions will produce any output. */ initTokenCache(): void; /** * Check if there are suitable tokens in the cache * @param {tokenType} tokenType type of token * @returns {Promise} true if tokens found in cache, false otherwise */ hasToken(tokenType: tokenType): Promise; /** * Check if there are suitable user session tokens in the cache * @returns {Promise} true if tokens found in cache, false otherwise */ hasUserSessionToken(): Promise; /** * Check if there are suitable user bearer tokens in the cache * @returns {Promise} true if tokens found in cache, false otherwise */ hasUserBearerToken(): Promise; /** * Check if there are suitable service account bearer tokens in the cache * @returns {Promise} true if tokens found in cache, false otherwise */ hasSaBearerToken(): Promise; /** * Read token * @param {tokenType} tokenType type of token * @returns {Promise} token or null */ readToken(tokenType: tokenType): Promise; /** * Read user session token * @returns {Promise} token or null */ readUserSessionToken(): Promise; /** * Read user bearer token * @returns {Promise} token or null */ readUserBearerToken(): Promise; /** * Read service account bearer token * @returns {Promise} token or null */ readSaBearerToken(): Promise; /** * Save user session token for current connection * @returns {Promise} true if the operation succeeded, false otherwise */ saveUserSessionToken(token: UserSessionMetaType): Promise; /** * Save user bearer token for current connection * @returns {Promise} true if the operation succeeded, false otherwise */ saveUserBearerToken(token: AccessTokenMetaType): Promise; /** * Save service account bearer token for current connection * @returns {Promise} true if the operation succeeded, false otherwise */ saveSaBearerToken(token: AccessTokenMetaType): Promise; /** * Purge all expired tokens from cache * @returns {TokenCacheInterface} purged cache */ purge(): TokenCacheInterface; /** * Flush cache * @returns {boolean} true if the operation succeeded, false otherwise */ flush(): boolean; }; type tokenType = 'userSession' | 'userBearer' | 'saBearer'; interface TokenCacheInterface { [hostKey: string]: { [realmKey: string]: { [typeKey in keyof typeKey]: { [subjectKey: string]: { [expKey: string]: string; }; }; }; }; } type Version = { getVersion(): string; getAllVersions(endpoints: { base: string; path: string; }[]): Promise[]>; }; type Constants = { DEFAULT_REALM_KEY: string; CLASSIC_DEPLOYMENT_TYPE_KEY: string; CLOUD_DEPLOYMENT_TYPE_KEY: string; FORGEOPS_DEPLOYMENT_TYPE_KEY: string; DEPLOYMENT_TYPES: string[]; DEPLOYMENT_TYPE_REALM_MAP: { classic: string; cloud: string; forgeops: string; }; FRODO_METADATA_ID: string; FRODO_CONNECTION_PROFILES_PATH_KEY: string; FRODO_MASTER_KEY_PATH_KEY: string; FRODO_MASTER_KEY_KEY: string; }; type Base64 = { isBase64Encoded(input: any): boolean; encodeBase64(input: string, padding?: boolean): string; decodeBase64(input: string): string; decodeBase64Url(input: string): string; encodeBase64Url(input: string): string; }; type ExportImport = { getMetadata(): ExportMetaData; titleCase(input: string): string; getRealmString(): string; convertBase64TextToArray(b64text: string): any[]; convertBase64UrlTextToArray(b64UTF8Text: string): any[]; convertTextArrayToBase64(textArray: string[]): string; convertTextArrayToBase64Url(textArray: string[]): any; validateImport(metadata: any): boolean; getTypedFilename(name: string, type: string, suffix?: string): string; getWorkingDirectory(mkdirs?: boolean): string; getFilePath(fileName: string, mkdirs?: boolean): string; saveToFile(type: string, data: object, identifier: string, filename: string, includeMeta?: boolean): void; /** * Save JSON object to file * @param {Object} data data object * @param {String} filename file name * @param {boolean} includeMeta true to include metadata, false otherwise. Default: true * @return {boolean} true if successful, false otherwise */ saveJsonToFile(data: object, filename: string, includeMeta?: boolean): boolean; /** * Save text data to file * @param data text data * @param filename file name * @return true if successful, false otherwise */ saveTextToFile(data: string, filename: string): boolean; /** * Append text data to file * @param {String} data text data * @param {String} filename file name */ appendTextToFile(data: string, filename: string): void; /** * Find files by name * @param {string} fileName file name to search for * @param {boolean} fast return first result and stop search * @param {string} path path to directory where to start the search * @returns {string[]} array of found file paths relative to starting directory */ findFilesByName(fileName: string, fast?: boolean, path?: string): string[]; /** * find all (nested) files in a directory * * @param directory directory to search * @returns list of files */ readFiles(directory: string): Promise<{ path: string; content: string; }[]>; substituteEnvParams(input: string, reader: Reader): string; unSubstituteEnvParams(input: string, reader: Reader): string; parseUrl(href: string): any; /** * Check if a string is a valid URL * @param {string} urlString input string to be evaluated * @returns {boolean} true if a valid URL, false otherwise */ isValidUrl(urlString: string): boolean; }; type FRUtils = { applyNameCollisionPolicy(name: string): string; getRealmPath(realm: string): string; getCurrentRealmPath(): string; getCurrentRealmName(): string; getCurrentRealmManagedUser(): string; getRealmName(realm: string): string; /** * Gets the list of realms to be used for exports in special format. * e.g. if the realm is normally '/first/second', then it will return 'root-first-second'. */ getRealmsForExport(): Promise; /** * Helper that gets the normal realm name from the realm export format. * It reverses the format generated by getRealmsForExport. * e.g. if the realm is 'root-first-second', then it will return '/first/second'. * @param realm realm in export format */ getRealmUsingExportFormat(realm: string): string; /** * Get host URL without path and query params * @param {string} url tenant URL with path and query params * @returns {string} AM host URL without path and query params */ getHostUrl(url: string): string; /** * Get IDM base URL * @returns {string} IDM host URL without path and query params */ getIdmBaseUrl(): string; /** * Get host URL without path and query params * @param {string} url tenant URL with path and query params * @returns {string} AM host URL without path and query params * @deprecated since v2.1.2 use {@link FRUtils.getHostUrl | getHostUrl} instead * ```javascript * getHostUrl(url: string): string * ``` * @group Deprecated */ getHostBaseUrl(url: string): string; }; type Json = { /** * Compare two json objects * @param {object} obj1 object 1 * @param {object} obj2 object 2 * @param {string[]} ignoreKeys array of keys to ignore in comparison * @returns {boolean} true if the two json objects have the same length and all the properties have the same value */ isEqualJson(obj1: object, obj2: object, ignoreKeys?: string[]): boolean; /** * Deep delete keys and their values from an input object. If a key in object contains substring, the key an its value is deleted. * @param {Object} object input object that needs keys removed * @param {String} substring substring to search for in key * @returns the modified object without the matching keys and their values */ deleteDeepByKey(object: any, substring: any): any; /** * Deep clone object * @param {any} obj object to deep clone * @returns {any} new object cloned from obj */ cloneDeep(obj: any): any; /** * Deep merge two objects * @param obj1 first object * @param obj2 second object * @returns merged first and second object */ mergeDeep(obj1: any, obj2: any): any; /** * Get all paths for an object * @param {any} o object * @param {string} prefix prefix (path calculated up to this point). Only needed for recursion or to add a global prefix to all paths. * @param {string} delim delimiter used to separate elements of the path. Default is '.'. * @returns {string[]} an array of paths */ getPaths(o: any, prefix?: string, delim?: string): string[]; findInArray(objs: any[], predicate: any): any; get(obj: any, path: string[], defaultValue?: any): any; put(obj: any, value: any, path: string[]): any; /** * Deterministic stringify * @param {any} obj json object to stringify deterministically * @returns {string} stringified json object */ stringify(obj: any): string; }; type ScriptValidation = { validateScriptHooks(jsonData: object): void; validateScript(scriptData: ScriptSkeleton): void; validateJs(javascriptSource: string): void; areScriptHooksValid(jsonData: object): boolean; isScriptValid(scriptData: ScriptSkeleton): boolean; isValidJs(javascriptSource: string): boolean; }; /** * Frodo Library */ type Frodo = { state: State; admin: Admin; agent: Agent; app: Application; authn: { journey: Journey; node: Node; settings: AuthenticationSettings; }; authz: { policy: Policy; policySet: PolicySet; resourceType: ResourceType; }; cloud: EsvCount & { adminFed: AdminFederation; env: EnvContentSecurityPolicy & EnvCookieDomains & EnvCustomDomains & EnvFederationEnforcement & EnvRelease & EnvSSOCookieConfig & { cert: EnvCertificate; csr: EnvCSR; promotion: EnvPromotion; }; /** * @deprecated since v2.0.4 use {@link frodo.cloud.getEsvCount | frodo.cloud.getEsvCount} instead */ esvCount: EsvCount; feature: Feature; log: Log; secret: Secret; serviceAccount: ServiceAccount; startup: Startup; variable: Variable; }; config: Config; conn: ConnectionProfile; cache: TokenCache; email: { template: EmailTemplate; }; factory: ApiFactory; idm: { config: IdmConfig; connector: Connector; crypto: IdmCrypto; managed: ManagedObject; mapping: Mapping; organization: Organization; recon: Recon; script: IdmScript; system: IdmSystem; }; info: Info; login: Authenticate; oauth2oidc: { client: OAuth2Client; endpoint: OAuth2Oidc; external: Idp; provider: OAuth2Provider; issuer: OAuth2TrustedJwtIssuer; }; realm: Realm; saml2: { circlesOfTrust: CirclesOfTrust; entityProvider: Saml2; }; script: Script; service: Service; session: Session; theme: Theme; utils: FRUtils & ScriptValidation & ExportImport & Base64 & { constants: Constants; jose: Jose; json: Json; version: Version; }; /** * Create a new frodo instance * @param {StateInterface} config Initial state configuration to use with the new instance * @returns {Frodo} frodo instance */ createInstance(config: StateInterface): Frodo; /** * Factory helper to create a frodo instance ready for logging in with an admin user account * @param {string} host host base URL, e.g. 'https://openam-my-tenant.forgeblocks.com/am' * @param {string} username admin account username * @param {string} password admin account password * @param {string} realm (optional) override default realm * @param {string} deploymentType (optional) override deployment type ('cloud', 'forgeops', or 'classic') * @param {boolean} allowInsecureConnection (optional) allow insecure connection * @param {boolean} debug (optional) enable debug output * @param {boolean} curlirize (optional) enable output of all library REST calls as curl commands * @returns {Frodo} frodo instance */ createInstanceWithAdminAccount(host: string, username: string, password: string, realm?: string, deploymentType?: string, allowInsecureConnection?: boolean, debug?: boolean, curlirize?: boolean): Frodo; /** * Factory helper to create a frodo instance ready for logging in with a service account * @param {string} host host base URL, e.g. 'https://openam-my-tenant.forgeblocks.com/am' * @param {string} serviceAccountId service account uuid * @param {string} serviceAccountJwkStr service account JWK as stringified JSON * @param {string} realm (optional) override default realm * @param {string} deploymentType (optional) override deployment type ('cloud', 'forgeops', or 'classic') * @param {boolean} allowInsecureConnection (optional) allow insecure connection * @param {boolean} debug (optional) enable debug output * @param {boolean} curlirize (optional) enable output of all library REST calls as curl commands * @returns {Frodo} frodo instance */ createInstanceWithServiceAccount(host: string, serviceAccountId: string, serviceAccountJwkStr: string, realm?: string, deploymentType?: string, allowInsecureConnection?: boolean, debug?: boolean, curlirize?: boolean): Frodo; }; /** * Default frodo instance * * @remarks * * If your application requires a single connection to a ForgeRock Identity Platform * instance at a time, then this default instance is all you need: * * In order to use the default {@link Frodo | frodo} instance, you must populate its {@link State | state} with the * minimum required information to login to your ForgeRock Identity Platform instance: * * ```javascript * // configure the state before invoking any library functions that require credentials * state.setHost('https://instance0/am'); * state.setUsername('admin'); * state.setPassword('p@ssw0rd!'); * * // now the library can login * frodo.login.getTokens(); * * // and perform operations * frodo.authn.journey.exportJourney('Login'); * ``` * * If your application needs to connect to multiple ForgeRock Identity Platform instances * simultaneously, then you will want to create additional frodo instances using any of * the available factory methods accessible from the default instance: * * {@link frodo.createInstance} * ```javascript * // use factory method to create a new Frodo instance * const instance1 = frodo.createInstance({ * host: 'https://instance1/am', * username: 'admin', * password: 'p@ssw0rd!', * }); * * // now the instance can login * instance1.login.getTokens(); * * // and perform operations * instance1.authn.journey.exportJourney('Login'); * ``` * * {@link frodo.createInstanceWithAdminAccount} * ```javascript * // use factory method to create a new Frodo instance ready to login with an admin user account * const instance2 = frodo.createInstanceWithAdminAccount( * 'https://instance2/am', * 'admin', * 'p@ssw0rd!' * ); * * // now the instance can login * instance2.login.getTokens(); * * // and perform operations * instance2.authn.journey.exportJourney('Login'); * ``` * * {@link frodo.createInstanceWithServiceAccount} * ```javascript * // use factory method to create a new Frodo instance ready to login with a service account * const instance3 = frodo.createInstanceWithServiceAccount( * 'https://instance3/am', * 'serviceAccount', * '{"k":"jwk"}' * ); * * // now the instance can login * instance3.login.getTokens(); * * // and perform operations * instance3.authn.journey.exportJourney('Login'); * ``` */ declare const frodo: Frodo; /** * Default state instance * * @remarks * * {@link Frodo} maintains a {@link State | state} for each instance. The state is where Frodo gets configuration * information from like host to connecto to, username and password to use, whether to * allow insecure connections or not, etc. As the library operates, it updates its state. * * The default frodo instance contains an empty state instance by default. In order to * use the default frodo instance, you must populate its state with the minimum required * information to login to your ForgeRock Identity Platform instance: * * ```javascript * // configure the state before invoking any library functions that require credentials * state.setHost('https://instance0/am'); * state.setUsername('admin'); * state.setPassword('p@ssw0rd!'); * * // now the library can login * frodo.login.getTokens(); * * // and perform operations * frodo.authn.journey.exportJourney('Login'); * ``` */ declare const state: State; declare class FrodoError extends Error { originalErrors: Error[]; isHttpError: boolean; httpCode: string; httpStatus: number; httpMessage: string; httpDetail: string; httpErrorText: string; httpErrorReason: string; httpDescription: string; constructor(message: string, originalErrors?: Error | Error[]); getOriginalErrors(): Error[]; getCombinedMessage(): string; toString(): string; } export { FrodoError, frodo, state };