@thunderid/javascript 1.3.2 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DefaultCrypto.d.ts.map +1 -1
- package/dist/IsomorphicCrypto.d.ts +8 -0
- package/dist/IsomorphicCrypto.d.ts.map +1 -1
- package/dist/StorageManager.d.ts.map +1 -1
- package/dist/ThunderIDJavaScriptClient.d.ts +19 -1
- package/dist/ThunderIDJavaScriptClient.d.ts.map +1 -1
- package/dist/api/flows/getFlows.d.ts +30 -0
- package/dist/api/flows/getFlows.d.ts.map +1 -0
- package/dist/api/user-types/getUserTypes.d.ts +23 -0
- package/dist/api/user-types/getUserTypes.d.ts.map +1 -0
- package/dist/cjs/index.cjs +2683 -1828
- package/dist/constants/AuthFlowSelectConstants.d.ts +9 -0
- package/dist/constants/AuthFlowSelectConstants.d.ts.map +1 -0
- package/dist/constants/OIDCRequestConstants.d.ts +5 -0
- package/dist/constants/OIDCRequestConstants.d.ts.map +1 -1
- package/dist/constants/SelectConstants.d.ts +12 -0
- package/dist/constants/SelectConstants.d.ts.map +1 -0
- package/dist/constants/UserSelectConstants.d.ts +8 -0
- package/dist/constants/UserSelectConstants.d.ts.map +1 -0
- package/dist/constants/UserTypeSelectConstants.d.ts +9 -0
- package/dist/constants/UserTypeSelectConstants.d.ts.map +1 -0
- package/dist/edge/index.js +2654 -1831
- package/dist/i18n/models/i18n.d.ts +11 -0
- package/dist/i18n/models/i18n.d.ts.map +1 -1
- package/dist/i18n/translations/en-US.d.ts.map +1 -1
- package/dist/i18n/translations/fr-FR.d.ts.map +1 -1
- package/dist/i18n/translations/hi-IN.d.ts.map +1 -1
- package/dist/i18n/translations/ja-JP.d.ts.map +1 -1
- package/dist/i18n/translations/pt-BR.d.ts.map +1 -1
- package/dist/i18n/translations/pt-PT.d.ts.map +1 -1
- package/dist/i18n/translations/si-LK.d.ts.map +1 -1
- package/dist/i18n/translations/ta-IN.d.ts.map +1 -1
- package/dist/i18n/translations/te-IN.d.ts.map +1 -1
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2654 -1831
- package/dist/models/auth-flow-select.d.ts +3 -0
- package/dist/models/auth-flow-select.d.ts.map +1 -0
- package/dist/models/client.d.ts +2 -2
- package/dist/models/client.d.ts.map +1 -1
- package/dist/models/config.d.ts +11 -1
- package/dist/models/config.d.ts.map +1 -1
- package/dist/models/embedded-flow.d.ts +11 -1
- package/dist/models/embedded-flow.d.ts.map +1 -1
- package/dist/models/managed-flow.d.ts +25 -0
- package/dist/models/managed-flow.d.ts.map +1 -0
- package/dist/models/managed-user-type.d.ts +25 -0
- package/dist/models/managed-user-type.d.ts.map +1 -0
- package/dist/models/select-page.d.ts +38 -0
- package/dist/models/select-page.d.ts.map +1 -0
- package/dist/models/select.d.ts +62 -0
- package/dist/models/select.d.ts.map +1 -0
- package/dist/models/user-select.d.ts +6 -0
- package/dist/models/user-select.d.ts.map +1 -0
- package/dist/models/user-type-select.d.ts +3 -0
- package/dist/models/user-type-select.d.ts.map +1 -0
- package/dist/utils/AuthenticationHelper.d.ts.map +1 -1
- package/dist/utils/base64Encode.d.ts +1 -1
- package/dist/utils/base64Encode.d.ts.map +1 -1
- package/dist/utils/capPageSize.d.ts +9 -0
- package/dist/utils/capPageSize.d.ts.map +1 -0
- package/dist/utils/computeNextPageOffset.d.ts +9 -0
- package/dist/utils/computeNextPageOffset.d.ts.map +1 -0
- package/dist/utils/createResourceOptionsLoader.d.ts +36 -0
- package/dist/utils/createResourceOptionsLoader.d.ts.map +1 -0
- package/dist/utils/dedupeSelectOptions.d.ts +10 -0
- package/dist/utils/dedupeSelectOptions.d.ts.map +1 -0
- package/dist/utils/getAuthorizeRequestUrlParams.d.ts +2 -1
- package/dist/utils/getAuthorizeRequestUrlParams.d.ts.map +1 -1
- package/dist/utils/getOAuthErrorMessage.d.ts +17 -0
- package/dist/utils/getOAuthErrorMessage.d.ts.map +1 -0
- package/dist/utils/getSelectMessages.d.ts +12 -0
- package/dist/utils/getSelectMessages.d.ts.map +1 -0
- package/dist/utils/isAdvancingPageOffset.d.ts +9 -0
- package/dist/utils/isAdvancingPageOffset.d.ts.map +1 -0
- package/dist/utils/isRetryableError.d.ts +7 -0
- package/dist/utils/isRetryableError.d.ts.map +1 -0
- package/dist/utils/loadPageWithRetryAndLog.d.ts +19 -0
- package/dist/utils/loadPageWithRetryAndLog.d.ts.map +1 -0
- package/dist/utils/loadUntilOptionsGrow.d.ts +15 -0
- package/dist/utils/loadUntilOptionsGrow.d.ts.map +1 -0
- package/dist/utils/logResourceFailure.d.ts +25 -0
- package/dist/utils/logResourceFailure.d.ts.map +1 -0
- package/dist/utils/mapSelectPageError.d.ts +36 -0
- package/dist/utils/mapSelectPageError.d.ts.map +1 -0
- package/dist/utils/mergeOptionsBatch.d.ts +25 -0
- package/dist/utils/mergeOptionsBatch.d.ts.map +1 -0
- package/dist/utils/normalizeSelectOptions.d.ts +9 -0
- package/dist/utils/normalizeSelectOptions.d.ts.map +1 -0
- package/dist/utils/parseSelectPageQuery.d.ts +18 -0
- package/dist/utils/parseSelectPageQuery.d.ts.map +1 -0
- package/dist/utils/resolvePageSize.d.ts +9 -0
- package/dist/utils/resolvePageSize.d.ts.map +1 -0
- package/dist/utils/resolveResourceEndpoint.d.ts +1 -1
- package/dist/utils/resolveResourceEndpoint.d.ts.map +1 -1
- package/dist/utils/toAuthFlowSelectPage.d.ts +11 -0
- package/dist/utils/toAuthFlowSelectPage.d.ts.map +1 -0
- package/dist/utils/toError.d.ts +8 -0
- package/dist/utils/toError.d.ts.map +1 -0
- package/dist/utils/toListSelectPage.d.ts +14 -0
- package/dist/utils/toListSelectPage.d.ts.map +1 -0
- package/dist/utils/toSelectOption.d.ts +13 -0
- package/dist/utils/toSelectOption.d.ts.map +1 -0
- package/dist/utils/toSelectOptions.d.ts +4 -0
- package/dist/utils/toSelectOptions.d.ts.map +1 -0
- package/dist/utils/toUserSelectOption.d.ts +10 -0
- package/dist/utils/toUserSelectOption.d.ts.map +1 -0
- package/dist/utils/toUserSelectPage.d.ts +13 -0
- package/dist/utils/toUserSelectPage.d.ts.map +1 -0
- package/dist/utils/toUserTypeSelectPage.d.ts +12 -0
- package/dist/utils/toUserTypeSelectPage.d.ts.map +1 -0
- package/dist/utils/withRetry.d.ts +15 -0
- package/dist/utils/withRetry.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface ResourceFailureDetails {
|
|
2
|
+
attempts: number;
|
|
3
|
+
limit?: number;
|
|
4
|
+
offset?: number;
|
|
5
|
+
/** `performance.now()` when the call started. */
|
|
6
|
+
startedAt: number;
|
|
7
|
+
}
|
|
8
|
+
export type ResourceFailureLogger = (resource: string, error: unknown, details: ResourceFailureDetails) => void;
|
|
9
|
+
/**
|
|
10
|
+
* Logs one error line for a failed resource load: which call, the offset and limit, the status or SDK error code,
|
|
11
|
+
* the number of attempts and how long it ran. It names those fields only. The text of the failure is left out on
|
|
12
|
+
* purpose, because it is whatever the server or a proxy replied and can carry data the SDK does not control. The
|
|
13
|
+
* caller still gets the full error through `onError`.
|
|
14
|
+
*
|
|
15
|
+
* @internal Shared by the SDK packages. It is not part of the public API and can change in any release.
|
|
16
|
+
*/
|
|
17
|
+
export declare const logResourceFailure: ResourceFailureLogger;
|
|
18
|
+
/**
|
|
19
|
+
* A failure logger for one long-lived list: the first failure of each error code is logged as an error and repeats
|
|
20
|
+
* at debug level, so repeated attempts against a failing list do not flood the log.
|
|
21
|
+
*
|
|
22
|
+
* @internal Shared by the SDK packages. It is not part of the public API and can change in any release.
|
|
23
|
+
*/
|
|
24
|
+
export declare const createResourceFailureLogger: () => ResourceFailureLogger;
|
|
25
|
+
//# sourceMappingURL=logResourceFailure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logResourceFailure.d.ts","sourceRoot":"","sources":["../../src/utils/logResourceFailure.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,sBAAsB,KAAK,IAAI,CAAC;AAWhH;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,EAAE,qBAEhC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,QAAO,qBAe9C,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a server sends to the browser when a select page could not be loaded.
|
|
3
|
+
*/
|
|
4
|
+
export interface SelectPageErrorResult {
|
|
5
|
+
/**
|
|
6
|
+
* Text for a developer. It is built from fixed words, the resource name and the status, and never contains the
|
|
7
|
+
* text of the failure itself.
|
|
8
|
+
*/
|
|
9
|
+
message: string;
|
|
10
|
+
/**
|
|
11
|
+
* The HTTP status of the failed call, when the loader threw a {@link ThunderIDAPIError}. `0` means no response
|
|
12
|
+
* arrived. It lets the browser side tell a 403 from a 503.
|
|
13
|
+
*/
|
|
14
|
+
statusCode?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Describes a failed select page load in a form that is safe to send to the browser.
|
|
18
|
+
*
|
|
19
|
+
* The text of a failure is whatever the management API, or a proxy in front of it, replied, so it can carry data the
|
|
20
|
+
* SDK does not control. It is logged on the server where the call is made, and it is not copied into this result. Only
|
|
21
|
+
* the status of an API error is carried over.
|
|
22
|
+
*
|
|
23
|
+
* @param error - The value thrown by the page loader.
|
|
24
|
+
* @param resource - What was being loaded, in plain words such as `users`. It names the resource in the message.
|
|
25
|
+
* @returns The message and, for an API error, the status.
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* mapSelectPageError(new ThunderIDAPIError('...', 'getUsers-ForbiddenError-001', 'node', 403), 'users');
|
|
29
|
+
* // {message: 'Failed to load users (HTTP 403).', statusCode: 403}
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @internal Shared by the SDK packages. It is not part of the public API and can change in any release.
|
|
33
|
+
*/
|
|
34
|
+
declare const mapSelectPageError: (error: unknown, resource?: string) => SelectPageErrorResult;
|
|
35
|
+
export default mapSelectPageError;
|
|
36
|
+
//# sourceMappingURL=mapSelectPageError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapSelectPageError.d.ts","sourceRoot":"","sources":["../../src/utils/mapSelectPageError.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,kBAAkB,GAAI,OAAO,OAAO,EAAE,iBAAoB,KAAG,qBAOlE,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SelectOption, SelectOptionsBatch } from '../models/select';
|
|
2
|
+
export interface OptionsMergeState<TCursor = unknown> {
|
|
3
|
+
cursor: TCursor | undefined;
|
|
4
|
+
options: readonly SelectOption[];
|
|
5
|
+
}
|
|
6
|
+
export type OptionsBatchIssue = 'cursor-stuck' | 'not-a-list';
|
|
7
|
+
export interface OptionsMergeResult<TCursor = unknown> {
|
|
8
|
+
cursor: TCursor | undefined;
|
|
9
|
+
/** No more batches should be requested. */
|
|
10
|
+
finished: boolean;
|
|
11
|
+
/** Something about the batch the caller may want to log. The merge itself carried on. */
|
|
12
|
+
issue?: OptionsBatchIssue;
|
|
13
|
+
options: SelectOption[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Adds one loaded batch to the options loaded so far and decides whether the data has ended. Options that are
|
|
17
|
+
* already present are replaced in place by their newer copy. A batch with a cursor ends when the cursor is
|
|
18
|
+
* missing, or when it adds nothing and the cursor did not move (a loader that ignores its cursor). A plain list
|
|
19
|
+
* ends when it adds nothing new. `null`, `undefined` and anything that is not a list count as an empty batch.
|
|
20
|
+
*
|
|
21
|
+
* @internal Shared by the SDK packages. It is not part of the public API and can change in any release.
|
|
22
|
+
*/
|
|
23
|
+
declare const mergeOptionsBatch: <TCursor = unknown>({ cursor, options }: OptionsMergeState<TCursor>, batch: SelectOptionsBatch<TCursor> | null | undefined) => OptionsMergeResult<TCursor>;
|
|
24
|
+
export default mergeOptionsBatch;
|
|
25
|
+
//# sourceMappingURL=mergeOptionsBatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeOptionsBatch.d.ts","sourceRoot":"","sources":["../../src/utils/mergeOptionsBatch.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,YAAY,EAAE,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAEvE,MAAM,WAAW,iBAAiB,CAAC,OAAO,GAAG,OAAO;IAClD,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;CAClC;AAED,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG,YAAY,CAAC;AAE9D,MAAM,WAAW,kBAAkB,CAAC,OAAO,GAAG,OAAO;IACnD,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,2CAA2C;IAC3C,QAAQ,EAAE,OAAO,CAAC;IAClB,yFAAyF;IACzF,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,QAAA,MAAM,iBAAiB,GAAI,OAAO,GAAG,OAAO,EAC1C,qBAAmB,iBAAiB,CAAC,OAAO,CAAC,EAC7C,OAAO,kBAAkB,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,KACpD,kBAAkB,CAAC,OAAO,CA+B5B,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SelectOption, SelectOptionInput } from '../models/select';
|
|
2
|
+
/**
|
|
3
|
+
* Turns the options a caller wrote into the list a select renders. Strings and numbers stand for
|
|
4
|
+
* themselves, objects set `label` and `value`, and empty or missing entries are skipped. Objects of any
|
|
5
|
+
* other shape are not guessed at: map them with {@link toSelectOptions} first.
|
|
6
|
+
*/
|
|
7
|
+
declare const normalizeSelectOptions: (inputs?: readonly (SelectOptionInput | null | undefined)[] | null) => SelectOption[];
|
|
8
|
+
export default normalizeSelectOptions;
|
|
9
|
+
//# sourceMappingURL=normalizeSelectOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeSelectOptions.d.ts","sourceRoot":"","sources":["../../src/utils/normalizeSelectOptions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,YAAY,EAAE,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AA0BtE;;;;GAIG;AACH,QAAA,MAAM,sBAAsB,GAAI,SAAS,SAAS,CAAC,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,GAAG,IAAI,KAAG,YAAY,EAG3B,CAAC;AAEtF,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SelectPageQueryResult } from '../models/select-page';
|
|
2
|
+
/**
|
|
3
|
+
* Checks the values a browser sends to a server route or server action that loads one page of a management
|
|
4
|
+
* resource. The browser is not trusted: `limit` and `offset` must be whole numbers, and `filter`, only read when
|
|
5
|
+
* `allowFilter` is set, must be a string of reasonable length. Anything else names the first parameter that is
|
|
6
|
+
* not acceptable.
|
|
7
|
+
*
|
|
8
|
+
* @internal Shared by the SDK packages. It is not part of the public API and can change in any release.
|
|
9
|
+
*/
|
|
10
|
+
declare const parseSelectPageQuery: (raw: {
|
|
11
|
+
filter?: unknown;
|
|
12
|
+
limit?: unknown;
|
|
13
|
+
offset?: unknown;
|
|
14
|
+
}, { allowFilter }?: {
|
|
15
|
+
allowFilter?: boolean;
|
|
16
|
+
}) => SelectPageQueryResult;
|
|
17
|
+
export default parseSelectPageQuery;
|
|
18
|
+
//# sourceMappingURL=parseSelectPageQuery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseSelectPageQuery.d.ts","sourceRoot":"","sources":["../../src/utils/parseSelectPageQuery.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,uBAAuB,CAAC;AASjE;;;;;;;GAOG;AACH,QAAA,MAAM,oBAAoB,GACxB,KAAK;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAC,EAC1D,kBAAuB;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAM,KAClD,qBAwBF,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The page size a picker asks for: the default when none is given, otherwise the given size as a whole number of
|
|
3
|
+
* at least 1 and at most what the management API serves.
|
|
4
|
+
*
|
|
5
|
+
* @internal Shared by the SDK packages. It is not part of the public API and can change in any release.
|
|
6
|
+
*/
|
|
7
|
+
declare const resolvePageSize: (pageSize?: number) => number;
|
|
8
|
+
export default resolvePageSize;
|
|
9
|
+
//# sourceMappingURL=resolvePageSize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolvePageSize.d.ts","sourceRoot":"","sources":["../../src/utils/resolvePageSize.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,QAAA,MAAM,eAAe,GAAI,WAAU,MAA0C,KAAG,MACJ,CAAC;AAE7E,eAAe,eAAe,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { BaseConfig } from '../models/config';
|
|
|
8
8
|
* issuers), these overrides let the SDK send flow and user-management requests to the resource
|
|
9
9
|
* server while OAuth requests continue to target the authorization server.
|
|
10
10
|
*/
|
|
11
|
-
export type ResourceEndpointKey = 'agents' | 'applications' | 'flowExecute' | 'flowMeta' | 'users' | 'usersMe' | 'usersMeCredentials' | 'usersMeMeta';
|
|
11
|
+
export type ResourceEndpointKey = 'agents' | 'applications' | 'flowExecute' | 'flowMeta' | 'flows' | 'users' | 'usersMe' | 'usersMeCredentials' | 'usersMeMeta' | 'userTypes';
|
|
12
12
|
/**
|
|
13
13
|
* The `config.endpoints` keys that address resource-server endpoints rather than OIDC/OAuth
|
|
14
14
|
* endpoints. Used to keep these overrides out of the resolved OIDC provider metadata.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveResourceEndpoint.d.ts","sourceRoot":"","sources":["../../src/utils/resolveResourceEndpoint.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAE5C;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,GACR,cAAc,GACd,aAAa,GACb,UAAU,GACV,OAAO,GACP,SAAS,GACT,oBAAoB,GACpB,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"resolveResourceEndpoint.d.ts","sourceRoot":"","sources":["../../src/utils/resolveResourceEndpoint.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAE5C;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,GACR,cAAc,GACd,aAAa,GACb,UAAU,GACV,OAAO,GACP,OAAO,GACP,SAAS,GACT,oBAAoB,GACpB,aAAa,GACb,WAAW,CAAC;AAEhB;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,mBAAmB,EAWhE,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,QAAA,MAAM,uBAAuB,GAC3B,KAAK,mBAAmB,EACxB,QAAQ,sBAAsB,GAAG,SAAS,EAC1C,cAAc,MAAM,KACnB,MAAM,GAAG,SAAiE,CAAC;AAE9E,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ManagedFlowListResponse } from '../models/managed-flow';
|
|
2
|
+
import type { SelectPage } from '../models/select-page';
|
|
3
|
+
import type { SelectOption } from '../models/select';
|
|
4
|
+
/**
|
|
5
|
+
* Converts a `getFlows` response into a loader page: each flow is shown by its name and submits its ID.
|
|
6
|
+
*/
|
|
7
|
+
declare const toAuthFlowSelectPage: (response: ManagedFlowListResponse, requestOffset: number) => SelectPage & {
|
|
8
|
+
options: SelectOption[];
|
|
9
|
+
};
|
|
10
|
+
export default toAuthFlowSelectPage;
|
|
11
|
+
//# sourceMappingURL=toAuthFlowSelectPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toAuthFlowSelectPage.d.ts","sourceRoot":"","sources":["../../src/utils/toAuthFlowSelectPage.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAEnD;;GAEG;AACH,QAAA,MAAM,oBAAoB,GACxB,UAAU,uBAAuB,EACjC,eAAe,MAAM,KACpB,UAAU,GAAG;IAAC,OAAO,EAAE,YAAY,EAAE,CAAA;CAGpC,CAAC;AAEL,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the error itself when it is an `Error`, otherwise an `Error` carrying the thrown value as text.
|
|
3
|
+
*
|
|
4
|
+
* @internal Shared by the SDK packages. It is not part of the public API and can change in any release.
|
|
5
|
+
*/
|
|
6
|
+
declare const toError: (error: unknown) => Error;
|
|
7
|
+
export default toError;
|
|
8
|
+
//# sourceMappingURL=toError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toError.d.ts","sourceRoot":"","sources":["../../src/utils/toError.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,QAAA,MAAM,OAAO,GAAI,OAAO,OAAO,KAAG,KAAoE,CAAC;AAEvG,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SelectPage } from '../models/select-page';
|
|
2
|
+
import type { SelectOption, SelectOptionDefaults, SelectOptionMapping } from '../models/select';
|
|
3
|
+
/**
|
|
4
|
+
* Builds a loader page from one page of a management list response. The next offset comes from the
|
|
5
|
+
* backend's own `count`, so items dropped by the mapping never shift the paging.
|
|
6
|
+
*/
|
|
7
|
+
declare const toListSelectPage: <T>(items: T[], { count, totalResults }: {
|
|
8
|
+
count: number;
|
|
9
|
+
totalResults: number;
|
|
10
|
+
}, requestOffset: number, mapping?: SelectOptionMapping<T>, defaults?: SelectOptionDefaults) => SelectPage & {
|
|
11
|
+
options: SelectOption[];
|
|
12
|
+
};
|
|
13
|
+
export default toListSelectPage;
|
|
14
|
+
//# sourceMappingURL=toListSelectPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toListSelectPage.d.ts","sourceRoot":"","sources":["../../src/utils/toListSelectPage.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAC,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAE9F;;;GAGG;AACH,QAAA,MAAM,gBAAgB,GAAI,CAAC,EACzB,OAAO,CAAC,EAAE,EACV,yBAAuB;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAC,EAC5D,eAAe,MAAM,EACrB,UAAU,mBAAmB,CAAC,CAAC,CAAC,EAChC,WAAW,oBAAoB,KAC9B,UAAU,GAAG;IAAC,OAAO,EAAE,YAAY,EAAE,CAAA;CAItC,CAAC;AAEH,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SelectOption, SelectOptionDefaults, SelectOptionMapping } from '../models/select';
|
|
2
|
+
/**
|
|
3
|
+
* Converts one raw item into an option.
|
|
4
|
+
*
|
|
5
|
+
* Plain text is its own label and value. An object uses the configured `mapping`; with none, an
|
|
6
|
+
* object with an `id` submits it and labels it from `defaults.labelAttributes`, an `{label, value}`
|
|
7
|
+
* object is used as is, and anything else uses its first text field for both.
|
|
8
|
+
*
|
|
9
|
+
* Returns `null` when there is nothing to submit.
|
|
10
|
+
*/
|
|
11
|
+
declare const toSelectOption: <T = unknown>(item: T | string | number, mapping?: SelectOptionMapping<T>, defaults?: SelectOptionDefaults) => SelectOption | null;
|
|
12
|
+
export default toSelectOption;
|
|
13
|
+
//# sourceMappingURL=toSelectOption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toSelectOption.d.ts","sourceRoot":"","sources":["../../src/utils/toSelectOption.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAmF9F;;;;;;;;GAQG;AACH,QAAA,MAAM,cAAc,GAAI,CAAC,GAAG,OAAO,EACjC,MAAM,CAAC,GAAG,MAAM,GAAG,MAAM,EACzB,UAAU,mBAAmB,CAAC,CAAC,CAAC,EAChC,WAAW,oBAAoB,KAC9B,YAAY,GAAG,IAejB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SelectOption, SelectOptionDefaults, SelectOptionMapping } from '../models/select';
|
|
2
|
+
declare const toSelectOptions: <T = unknown>(items: (T | string | number)[], mapping?: SelectOptionMapping<T>, defaults?: SelectOptionDefaults) => SelectOption[];
|
|
3
|
+
export default toSelectOptions;
|
|
4
|
+
//# sourceMappingURL=toSelectOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toSelectOptions.d.ts","sourceRoot":"","sources":["../../src/utils/toSelectOptions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAE9F,QAAA,MAAM,eAAe,GAAI,CAAC,GAAG,OAAO,EAClC,OAAO,CAAC,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,EAC9B,UAAU,mBAAmB,CAAC,CAAC,CAAC,EAChC,WAAW,oBAAoB,KAC9B,YAAY,EAGsE,CAAC;AAEtF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ManagedUser } from '../models/managed-user';
|
|
2
|
+
import type { SelectOption } from '../models/select';
|
|
3
|
+
import type { UserSelectOptionMapping } from '../models/user-select';
|
|
4
|
+
/**
|
|
5
|
+
* Converts one directory user into an option: submits the user's ID and labels it from `display`,
|
|
6
|
+
* then `username`, then `email`, unless `mapping` says otherwise.
|
|
7
|
+
*/
|
|
8
|
+
declare const toUserSelectOption: (user: ManagedUser | string | number, mapping?: UserSelectOptionMapping) => SelectOption | null;
|
|
9
|
+
export default toUserSelectOption;
|
|
10
|
+
//# sourceMappingURL=toUserSelectOption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toUserSelectOption.d.ts","sourceRoot":"","sources":["../../src/utils/toUserSelectOption.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,uBAAuB,CAAC;AAEnE;;;GAGG;AACH,QAAA,MAAM,kBAAkB,GACtB,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,EACnC,UAAU,uBAAuB,KAChC,YAAY,GAAG,IAA8F,CAAC;AAEjH,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ManagedUserListResponse } from '../models/managed-user';
|
|
2
|
+
import type { SelectPage } from '../models/select-page';
|
|
3
|
+
import type { SelectOption } from '../models/select';
|
|
4
|
+
import type { UserSelectOptionMapping } from '../models/user-select';
|
|
5
|
+
/**
|
|
6
|
+
* Converts a `getUsers` response into a loader page. The next offset comes from the backend's own
|
|
7
|
+
* `count`, so users dropped by the mapping never shift the paging.
|
|
8
|
+
*/
|
|
9
|
+
declare const toUserSelectPage: (response: ManagedUserListResponse, requestOffset: number, mapping?: UserSelectOptionMapping) => SelectPage & {
|
|
10
|
+
options: SelectOption[];
|
|
11
|
+
};
|
|
12
|
+
export default toUserSelectPage;
|
|
13
|
+
//# sourceMappingURL=toUserSelectPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toUserSelectPage.d.ts","sourceRoot":"","sources":["../../src/utils/toUserSelectPage.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,uBAAuB,CAAC;AAEnE;;;GAGG;AACH,QAAA,MAAM,gBAAgB,GACpB,UAAU,uBAAuB,EACjC,eAAe,MAAM,EACrB,UAAU,uBAAuB,KAChC,UAAU,GAAG;IAAC,OAAO,EAAE,YAAY,EAAE,CAAA;CAGpC,CAAC;AAEL,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ManagedUserTypeListResponse } from '../models/managed-user-type';
|
|
2
|
+
import type { SelectPage } from '../models/select-page';
|
|
3
|
+
import type { SelectOption } from '../models/select';
|
|
4
|
+
/**
|
|
5
|
+
* Converts a `getUserTypes` response into a loader page: each user type is shown and submitted by
|
|
6
|
+
* its handle.
|
|
7
|
+
*/
|
|
8
|
+
declare const toUserTypeSelectPage: (response: ManagedUserTypeListResponse, requestOffset: number) => SelectPage & {
|
|
9
|
+
options: SelectOption[];
|
|
10
|
+
};
|
|
11
|
+
export default toUserTypeSelectPage;
|
|
12
|
+
//# sourceMappingURL=toUserTypeSelectPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toUserTypeSelectPage.d.ts","sourceRoot":"","sources":["../../src/utils/toUserTypeSelectPage.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,2BAA2B,EAAC,MAAM,6BAA6B,CAAC;AAC7E,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAEnD;;;GAGG;AACH,QAAA,MAAM,oBAAoB,GACxB,UAAU,2BAA2B,EACrC,eAAe,MAAM,KACpB,UAAU,GAAG;IAAC,OAAO,EAAE,YAAY,EAAE,CAAA;CACoD,CAAC;AAE7F,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface RetryOptions {
|
|
2
|
+
/** Pause before the single retry. Defaults to 500 ms. */
|
|
3
|
+
delayMs?: number;
|
|
4
|
+
/** Decides whether a failure is retried. Defaults to {@link isRetryableError}. */
|
|
5
|
+
shouldRetry?: (error: unknown) => boolean;
|
|
6
|
+
/** Aborting cancels the pause and skips the retry. */
|
|
7
|
+
signal?: AbortSignal;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Runs a read operation and, when it fails with a retryable error, runs it once more after a short
|
|
11
|
+
* pause. Only use it for operations that are safe to repeat.
|
|
12
|
+
*/
|
|
13
|
+
declare const withRetry: <T>(operation: () => Promise<T>, { delayMs, shouldRetry, signal }?: RetryOptions) => Promise<T>;
|
|
14
|
+
export default withRetry;
|
|
15
|
+
//# sourceMappingURL=withRetry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withRetry.d.ts","sourceRoot":"","sources":["../../src/utils/withRetry.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,YAAY;IAC3B,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kFAAkF;IAClF,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IAC1C,sDAAsD;IACtD,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAgBD;;;GAGG;AACH,QAAA,MAAM,SAAS,GAAU,CAAC,EACxB,WAAW,MAAM,OAAO,CAAC,CAAC,CAAC,EAC3B,mCAA4E,YAAiB,KAC5F,OAAO,CAAC,CAAC,CAgBX,CAAC;AAEF,eAAe,SAAS,CAAC"}
|