@sinequa/atomic 2.2.0 → 2.3.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/README.md +28 -1
- package/dist/atomic.cjs +1 -1
- package/dist/atomic.js +2 -2
- package/dist/authentication/constants.d.ts +20 -0
- package/dist/authentication/constants.d.ts.map +1 -1
- package/dist/authentication/events/auth-events.d.ts +71 -0
- package/dist/authentication/events/auth-events.d.ts.map +1 -0
- package/dist/authentication/events/emit-authenticated-event.d.ts +9 -0
- package/dist/authentication/events/emit-authenticated-event.d.ts.map +1 -1
- package/dist/authentication/events/index.d.ts +1 -0
- package/dist/authentication/events/index.d.ts.map +1 -1
- package/dist/authentication/index.d.ts +3 -3
- package/dist/authentication/index.d.ts.map +1 -1
- package/dist/authentication/providers/oauth-authentication.d.ts +10 -1
- package/dist/authentication/providers/oauth-authentication.d.ts.map +1 -1
- package/dist/authentication/providers/redirect-to-identity-provider.d.ts +34 -0
- package/dist/authentication/providers/redirect-to-identity-provider.d.ts.map +1 -0
- package/dist/authentication/providers/saml-authentication.d.ts +10 -1
- package/dist/authentication/providers/saml-authentication.d.ts.map +1 -1
- package/dist/authentication/session/auth-mode-marker.d.ts +7 -0
- package/dist/authentication/session/auth-mode-marker.d.ts.map +1 -1
- package/dist/authentication/session/auth-state.d.ts +6 -1
- package/dist/authentication/session/auth-state.d.ts.map +1 -1
- package/dist/authentication/session/detect-auth-mode.d.ts +2 -1
- package/dist/authentication/session/detect-auth-mode.d.ts.map +1 -1
- package/dist/authentication/session/has-session.d.ts +26 -0
- package/dist/authentication/session/has-session.d.ts.map +1 -0
- package/dist/authentication/session/index.d.ts +2 -0
- package/dist/authentication/session/index.d.ts.map +1 -1
- package/dist/authentication/session/login.d.ts +15 -8
- package/dist/authentication/session/login.d.ts.map +1 -1
- package/dist/authentication/session/logout.d.ts +13 -2
- package/dist/authentication/session/logout.d.ts.map +1 -1
- package/dist/authentication/session/redirect-guard.d.ts +18 -0
- package/dist/authentication/session/redirect-guard.d.ts.map +1 -0
- package/dist/authentication/session/try-auto-authentication.d.ts +14 -6
- package/dist/authentication/session/try-auto-authentication.d.ts.map +1 -1
- package/dist/authentication/session/user-authentication.d.ts +7 -2
- package/dist/authentication/session/user-authentication.d.ts.map +1 -1
- package/dist/authentication/tokens/delete-web-token-cookie.d.ts +10 -5
- package/dist/authentication/tokens/delete-web-token-cookie.d.ts.map +1 -1
- package/dist/authentication/tokens/get-csrf-token.d.ts +4 -1
- package/dist/authentication/tokens/get-csrf-token.d.ts.map +1 -1
- package/dist/authentication/tokens/get-jwt-token.d.ts +35 -5
- package/dist/authentication/tokens/get-jwt-token.d.ts.map +1 -1
- package/dist/authentication/tokens/get-token.d.ts +7 -1
- package/dist/authentication/tokens/get-token.d.ts.map +1 -1
- package/dist/authentication/tokens/index.d.ts +1 -1
- package/dist/authentication/tokens/index.d.ts.map +1 -1
- package/dist/authentication/tokens/set-token.d.ts +7 -1
- package/dist/authentication/tokens/set-token.d.ts.map +1 -1
- package/dist/client/atomic-context.d.ts +61 -0
- package/dist/client/atomic-context.d.ts.map +1 -0
- package/dist/client/create-api.d.ts +109 -0
- package/dist/client/create-api.d.ts.map +1 -0
- package/dist/client/create-atomic-client.d.ts +138 -0
- package/dist/client/create-atomic-client.d.ts.map +1 -0
- package/dist/client/http-adapter.d.ts +30 -0
- package/dist/client/http-adapter.d.ts.map +1 -0
- package/dist/client/index.d.ts +5 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/configurations/auth-mode.d.ts +64 -3
- package/dist/configurations/auth-mode.d.ts.map +1 -1
- package/dist/configurations/auth-options.d.ts +78 -0
- package/dist/configurations/auth-options.d.ts.map +1 -0
- package/dist/configurations/global.config.d.ts +23 -3
- package/dist/configurations/global.config.d.ts.map +1 -1
- package/dist/configurations/index.d.ts +1 -0
- package/dist/configurations/index.d.ts.map +1 -1
- package/dist/helpers/filters.d.ts +24 -0
- package/dist/helpers/filters.d.ts.map +1 -1
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/pagination.d.ts +23 -0
- package/dist/helpers/pagination.d.ts.map +1 -0
- package/dist/helpers/ts-helper.d.ts +6 -0
- package/dist/helpers/ts-helper.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/polyfills/storage.d.ts +12 -3
- package/dist/polyfills/storage.d.ts.map +1 -1
- package/dist/spfx/index.cjs +1 -1
- package/dist/spfx/index.d.ts +1 -0
- package/dist/spfx/index.d.ts.map +1 -1
- package/dist/spfx/index.js +2 -2
- package/dist/src-BzPBKdDO.js +2201 -0
- package/dist/src-DeaVS0Tt.cjs +1 -0
- package/dist/types/search/Result.d.ts +36 -2
- package/dist/types/search/Result.d.ts.map +1 -1
- package/dist/types/search/index.d.ts +1 -1
- package/dist/types/search/index.d.ts.map +1 -1
- package/dist/utils/logger.d.ts +27 -16
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/web-api/helpers/aad-http-client-manager.d.ts +8 -0
- package/dist/web-api/helpers/aad-http-client-manager.d.ts.map +1 -1
- package/dist/web-api/helpers/create-headers.d.ts +9 -0
- package/dist/web-api/helpers/create-headers.d.ts.map +1 -1
- package/dist/web-api/helpers/errors/api-error.d.ts.map +1 -1
- package/dist/web-api/helpers/handle-response.d.ts +17 -1
- package/dist/web-api/helpers/handle-response.d.ts.map +1 -1
- package/dist/web-api/helpers/index.d.ts +1 -1
- package/dist/web-api/helpers/index.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/del.d.ts +13 -11
- package/dist/web-api/helpers/methods/del.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/get.d.ts +6 -12
- package/dist/web-api/helpers/methods/get.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/patch.d.ts +6 -7
- package/dist/web-api/helpers/methods/patch.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/post.d.ts +6 -8
- package/dist/web-api/helpers/methods/post.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/put.d.ts +6 -7
- package/dist/web-api/helpers/methods/put.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/send-request.d.ts +24 -0
- package/dist/web-api/helpers/methods/send-request.d.ts.map +1 -0
- package/dist/web-api/helpers/request-options.d.ts +35 -12
- package/dist/web-api/helpers/request-options.d.ts.map +1 -1
- package/dist/web-api/helpers/utils/build-request-url.d.ts +12 -0
- package/dist/web-api/helpers/utils/build-request-url.d.ts.map +1 -0
- package/dist/web-api/helpers/utils/{date-utils..d.ts → date-utils.d.ts} +1 -1
- package/dist/web-api/helpers/utils/date-utils.d.ts.map +1 -0
- package/dist/web-api/helpers/utils/resolve-no-auto-authentication.d.ts +9 -0
- package/dist/web-api/helpers/utils/resolve-no-auto-authentication.d.ts.map +1 -1
- package/dist/web-api/helpers/utils/with-retry.d.ts +10 -5
- package/dist/web-api/helpers/utils/with-retry.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-aggregation.d.ts +2 -1
- package/dist/web-api/v1/fetch-aggregation.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-app.d.ts +12 -5
- package/dist/web-api/v1/fetch-app.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-audit.d.ts +2 -1
- package/dist/web-api/v1/fetch-audit.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-dataset.d.ts +4 -3
- package/dist/web-api/v1/fetch-dataset.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-labels.d.ts +9 -8
- package/dist/web-api/v1/fetch-labels.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-preview.d.ts +2 -1
- package/dist/web-api/v1/fetch-preview.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-principal.d.ts +8 -4
- package/dist/web-api/v1/fetch-principal.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-query-export.d.ts +2 -1
- package/dist/web-api/v1/fetch-query-export.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-query-intent.d.ts +2 -1
- package/dist/web-api/v1/fetch-query-intent.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-query.d.ts +3 -2
- package/dist/web-api/v1/fetch-query.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-security-principal.d.ts +2 -1
- package/dist/web-api/v1/fetch-security-principal.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-similar-documents.d.ts +2 -1
- package/dist/web-api/v1/fetch-similar-documents.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-sponsored-links.d.ts +2 -1
- package/dist/web-api/v1/fetch-sponsored-links.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-suggest.d.ts +4 -3
- package/dist/web-api/v1/fetch-suggest.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-text-chunk.d.ts +2 -1
- package/dist/web-api/v1/fetch-text-chunk.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-user-settings.d.ts +5 -4
- package/dist/web-api/v1/fetch-user-settings.d.ts.map +1 -1
- package/dist/web-api/v2/fetch-change-password.d.ts +2 -1
- package/dist/web-api/v2/fetch-change-password.d.ts.map +1 -1
- package/dist/web-api/v2/fetch-document-upload-container.d.ts +8 -7
- package/dist/web-api/v2/fetch-document-upload-container.d.ts.map +1 -1
- package/dist/web-api/v2/fetch-forgot-password.d.ts +2 -1
- package/dist/web-api/v2/fetch-forgot-password.d.ts.map +1 -1
- package/dist/web-api/v2/fetch-user-profile.d.ts +5 -4
- package/dist/web-api/v2/fetch-user-profile.d.ts.map +1 -1
- package/dist/web-api/v2/fetch-version.d.ts +2 -1
- package/dist/web-api/v2/fetch-version.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/src-BCIlSfZp.js +0 -1923
- package/dist/src-Dg2926V9.cjs +0 -1
- package/dist/web-api/helpers/utils/date-utils..d.ts.map +0 -1
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* It replaces the previous overlapping booleans (`useCredentials` / `useSSO` / `useSAML`),
|
|
6
6
|
* which are now deprecated read-only getters derived from this value.
|
|
7
7
|
*
|
|
8
|
-
* - `credentials` — username/password form (`
|
|
8
|
+
* - `credentials` — username/password form (`requestWebTokenSession` with credentials)
|
|
9
9
|
* - `sso` — browser/proxy injected authentication (a CSRF token is available)
|
|
10
10
|
* - `oauth` — automatic redirection to an OAuth provider
|
|
11
11
|
* - `saml` — automatic redirection to a SAML provider
|
|
12
|
-
* - `bearer` —
|
|
12
|
+
* - `bearer` — authentication using a configured bearer token (a Sinequa access token)
|
|
13
13
|
* - `unknown` — not yet resolved: try SSO silently, then fall back to credentials
|
|
14
14
|
*/
|
|
15
15
|
export type AuthMode = {
|
|
@@ -25,6 +25,7 @@ export type AuthMode = {
|
|
|
25
25
|
} | {
|
|
26
26
|
kind: "bearer";
|
|
27
27
|
token: string;
|
|
28
|
+
sessionCookie?: boolean;
|
|
28
29
|
} | {
|
|
29
30
|
kind: "unknown";
|
|
30
31
|
};
|
|
@@ -38,15 +39,75 @@ export declare const AuthMode: {
|
|
|
38
39
|
readonly sso: () => AuthMode;
|
|
39
40
|
readonly oauth: (provider: string) => AuthMode;
|
|
40
41
|
readonly saml: (provider: string) => AuthMode;
|
|
41
|
-
|
|
42
|
+
/**
|
|
43
|
+
* @param token - The Sinequa access token, sent as `Authorization: Bearer <token>`.
|
|
44
|
+
* @param options.sessionCookie - Whether to also open a **server session** by exchanging the token
|
|
45
|
+
* through `security.webtoken` (`tokenInCookie`). Defaults to `true`, and a server that refuses
|
|
46
|
+
* the exchange falls back to the header alone — see {@link AuthMode} and the `bearer` section of
|
|
47
|
+
* `docs/authentication/auth-mode.md`. Pass `false` for a headless, server-to-server consumer:
|
|
48
|
+
* there is no browser to load anything on its own, so the roundtrip buys nothing.
|
|
49
|
+
*/
|
|
50
|
+
readonly bearer: (token: string, options?: {
|
|
51
|
+
sessionCookie?: boolean;
|
|
52
|
+
}) => AuthMode;
|
|
42
53
|
readonly unknown: () => AuthMode;
|
|
43
54
|
};
|
|
55
|
+
/**
|
|
56
|
+
* The bearer token to send, resolved from the mode first and the legacy `bearerToken` key second.
|
|
57
|
+
*
|
|
58
|
+
* `AuthMode.bearer(token)` carries the token, so an application setting the mode explicitly has
|
|
59
|
+
* already said everything. Reading only `config.bearerToken` — as every call site used to — ignored
|
|
60
|
+
* that token entirely: the mode was right, and the request went out unauthenticated.
|
|
61
|
+
*/
|
|
62
|
+
export declare function resolveBearerToken(config: {
|
|
63
|
+
authMode?: AuthMode;
|
|
64
|
+
bearerToken?: string;
|
|
65
|
+
}): string | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* The OAuth provider to sign in with, resolved from the mode first and `autoOAuthProvider` second.
|
|
68
|
+
*
|
|
69
|
+
* Same reasoning as {@link resolveBearerToken}: `AuthMode.oauth(provider)` carries the provider, so an
|
|
70
|
+
* application setting the mode explicitly has already said everything. Reading only
|
|
71
|
+
* `config.autoOAuthProvider` — as the call site used to — ignored it entirely and threw, which is
|
|
72
|
+
* exactly what a client configured through `AtomicClientConfig` hits: that type has no
|
|
73
|
+
* `autoOAuthProvider` field, so the mode was the only place left to say it.
|
|
74
|
+
*/
|
|
75
|
+
export declare function resolveOAuthProvider(config: {
|
|
76
|
+
authMode?: AuthMode;
|
|
77
|
+
autoOAuthProvider?: string;
|
|
78
|
+
}): string | undefined;
|
|
79
|
+
/** The SAML provider to sign in with. @see resolveOAuthProvider */
|
|
80
|
+
export declare function resolveSAMLProvider(config: {
|
|
81
|
+
authMode?: AuthMode;
|
|
82
|
+
autoSAMLProvider?: string;
|
|
83
|
+
}): string | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Whether the mode authenticates **without a credentials form**: the browser or a reverse proxy
|
|
86
|
+
* (`sso`), an auto-configured identity provider (`oauth`/`saml`), or a configured token (`bearer`).
|
|
87
|
+
*
|
|
88
|
+
* A sign-in screen shows a loader and drives `login()` for these, and a username/password form for
|
|
89
|
+
* the others. That distinction lives here, next to {@link AuthMode}, because it is a property of the
|
|
90
|
+
* mode rather than of any one screen — and because a list of modes maintained elsewhere gets a
|
|
91
|
+
* member forgotten. `bearer` was, and the result was a password prompt for an authentication that
|
|
92
|
+
* has no password.
|
|
93
|
+
*
|
|
94
|
+
* `unknown` is deliberately **not** formless: it is resolved to `sso` or `credentials` before any
|
|
95
|
+
* screen renders, so treating it as formless would only risk a dead-end loader.
|
|
96
|
+
*/
|
|
97
|
+
export declare function isExternalAuthMode(mode?: AuthMode): boolean;
|
|
44
98
|
/**
|
|
45
99
|
* Translates the deprecated boolean flags into an {@link AuthMode}.
|
|
46
100
|
*
|
|
47
101
|
* Used by `setGlobalConfig` for inbound backward-compatibility when callers still write
|
|
48
102
|
* `useCredentials` / `useSSO` / `useSAML`. The ambiguous legacy state
|
|
49
103
|
* `useCredentials && useSSO` maps to `unknown` ("try SSO, then credentials").
|
|
104
|
+
*
|
|
105
|
+
* Note that no combination of legacy booleans can produce `oauth` or `bearer`: those modes were
|
|
106
|
+
* introduced with {@link AuthMode} and never had a boolean flag. Set `authMode` explicitly for them.
|
|
107
|
+
*
|
|
108
|
+
* @deprecated Compatibility shim called by `setGlobalConfig`; it is not meant to be used directly.
|
|
109
|
+
* Set `authMode` with the `AuthMode.*` constructors instead. It will stop being exported in the
|
|
110
|
+
* next major, together with the legacy boolean flags.
|
|
50
111
|
*/
|
|
51
112
|
export declare function legacyBooleansToAuthMode(flags: {
|
|
52
113
|
useCredentials?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-mode.d.ts","sourceRoot":"","sources":["../../src/configurations/auth-mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,QAAQ,GAChB;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,GACvB;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,GACf;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,Q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E;AACnE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAC1C,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,MAAM,GAAG,SAAS,CAIrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAU3D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,EACxE,OAAO,EAAE;IACP,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GACA,QAAQ,CAYV"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { UnauthorizedError } from "../web-api/helpers/errors/unauthorized-error";
|
|
2
|
+
/**
|
|
3
|
+
* Minimal key/value storage contract. Inject one (per scope) via
|
|
4
|
+
* {@link AuthOptions.storage} to replace the Web Storage used for tokens and auth markers —
|
|
5
|
+
* useful for tests, SSR, or hosts without `sessionStorage`/`localStorage`.
|
|
6
|
+
*/
|
|
7
|
+
export interface TokenStorage {
|
|
8
|
+
get(key: string): string | null;
|
|
9
|
+
set(key: string, value: string): void;
|
|
10
|
+
remove(key: string): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Logger contract used by the authentication layer. Inject one via {@link AuthOptions.logger}
|
|
14
|
+
* to capture auth diagnostics (including swallowed best-effort failures, logged at `debug`).
|
|
15
|
+
*/
|
|
16
|
+
export interface AtomicLogger {
|
|
17
|
+
debug(message: string, data?: unknown): void;
|
|
18
|
+
info(message: string, data?: unknown): void;
|
|
19
|
+
warn(message: string, data?: unknown): void;
|
|
20
|
+
error(message: string, data?: unknown): void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Optional knobs of the authentication layer, set via
|
|
24
|
+
* `setGlobalConfig({ auth: { ... } })`. Every field has a default preserving the historical
|
|
25
|
+
* behavior.
|
|
26
|
+
*/
|
|
27
|
+
export interface AuthOptions {
|
|
28
|
+
/** Timeout applied to every authentication network request. Default: `10_000` ms. */
|
|
29
|
+
timeoutMs?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Protected endpoint probed by `tryAutoAuthentication` to detect server-side auto-authentication
|
|
32
|
+
* (OIDC). Default: `"api/v1/principal"`.
|
|
33
|
+
*/
|
|
34
|
+
probeEndpoint?: string;
|
|
35
|
+
/** Storage overrides for tokens and auth markers. Default: Web Storage (with a Node fallback). */
|
|
36
|
+
storage?: {
|
|
37
|
+
session?: TokenStorage;
|
|
38
|
+
local?: TokenStorage;
|
|
39
|
+
};
|
|
40
|
+
/** Logger override. Default: the library logger (`configureLogger`-driven console output). */
|
|
41
|
+
logger?: AtomicLogger;
|
|
42
|
+
/** `fetch` override (instrumentation, proxying, tests). Default: the global `fetch`. */
|
|
43
|
+
fetch?: typeof globalThis.fetch;
|
|
44
|
+
/** `credentials` mode of the HTTP requests. Default: `"include"`. */
|
|
45
|
+
credentials?: RequestCredentials;
|
|
46
|
+
/**
|
|
47
|
+
* Attempts to re-establish the session after a request came back with a 401, and reports whether
|
|
48
|
+
* it succeeded. When it does, that request is replayed **once** with the refreshed token.
|
|
49
|
+
*
|
|
50
|
+
* Recovery is application-specific — showing a login form, reloading for an SSO handshake,
|
|
51
|
+
* redirecting to an identity provider — which is why the library delegates it instead of
|
|
52
|
+
* guessing. Without this hook a 401 simply surfaces as an `UnauthorizedError`, as before.
|
|
53
|
+
*
|
|
54
|
+
* Concurrent 401s share a single call: the library never runs two recoveries at once.
|
|
55
|
+
*
|
|
56
|
+
* @returns `true` when the session is usable again and the request is worth replaying.
|
|
57
|
+
*/
|
|
58
|
+
recoverFromUnauthorized?: (context: {
|
|
59
|
+
endpoint: string;
|
|
60
|
+
error: UnauthorizedError;
|
|
61
|
+
}) => Promise<boolean>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The library logger, used whenever no `auth.logger` is injected.
|
|
65
|
+
*
|
|
66
|
+
* Getters, not captured values: the logger exports are live bindings that `configureLogger()`
|
|
67
|
+
* repoints (see `utils/logger`), so copying them into an object literal here would freeze the level
|
|
68
|
+
* this module happened to be evaluated with. Returning the current binding also keeps the console
|
|
69
|
+
* source link on the caller, since the bound `console.*` is what ends up being invoked.
|
|
70
|
+
*/
|
|
71
|
+
export declare const defaultLogger: AtomicLogger;
|
|
72
|
+
/**
|
|
73
|
+
* The logger of the default client: the injected one, or the library logger.
|
|
74
|
+
*
|
|
75
|
+
* @deprecated Reads the global configuration. Context-aware code uses `contextLogger(ctx)`.
|
|
76
|
+
*/
|
|
77
|
+
export declare function resolveAuthLogger(): AtomicLogger;
|
|
78
|
+
//# sourceMappingURL=auth-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-options.d.ts","sourceRoot":"","sources":["../../src/configurations/auth-options.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAGtF;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAChC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9C;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kGAAkG;IAClG,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,YAAY,CAAC;QAAC,KAAK,CAAC,EAAE,YAAY,CAAA;KAAE,CAAC;IAC3D,8FAA8F;IAC9F,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,wFAAwF;IACxF,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IAChC,qEAAqE;IACrE,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC;;;;;;;;;;;OAWG;IACH,uBAAuB,CAAC,EAAE,CAAC,OAAO,EAAE;QAClC,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,iBAAiB,CAAC;KAC1B,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,YAa3B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,YAAY,CAEhD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { LogLevel } from "../utils";
|
|
2
2
|
import { type AuthMode as AuthModeType } from "./auth-mode";
|
|
3
|
+
import type { AuthOptions } from "./auth-options";
|
|
3
4
|
/**
|
|
4
5
|
* Represents the configuration for the application.
|
|
5
6
|
*
|
|
@@ -9,7 +10,7 @@ import { type AuthMode as AuthModeType } from "./auth-mode";
|
|
|
9
10
|
* autoSAMLProvider: Name of the SAML provider.
|
|
10
11
|
* authMode: source of truth for the authentication method (see {@link AuthMode}).
|
|
11
12
|
*/
|
|
12
|
-
export type AppGlobalConfig<T extends Record<string,
|
|
13
|
+
export type AppGlobalConfig<T extends Record<string, unknown> = {}> = {
|
|
13
14
|
app: string;
|
|
14
15
|
backendUrl: string;
|
|
15
16
|
autoOAuthProvider: string;
|
|
@@ -23,6 +24,13 @@ export type AppGlobalConfig<T extends Record<string, any> = {}> = {
|
|
|
23
24
|
userOverrideActive: boolean;
|
|
24
25
|
/** Source of truth for the authentication method. @see AuthMode */
|
|
25
26
|
authMode: AuthModeType;
|
|
27
|
+
/** Optional knobs of the authentication layer (timeout, storage, logger, fetch…). @see AuthOptions */
|
|
28
|
+
auth: AuthOptions;
|
|
29
|
+
/**
|
|
30
|
+
* UI language sent as `ui-language` in the body of every request that has one. Left out entirely
|
|
31
|
+
* when not configured, so the server keeps applying its own default.
|
|
32
|
+
*/
|
|
33
|
+
uiLanguage: string;
|
|
26
34
|
/** @deprecated Derived read-only getter computed from {@link authMode}. */
|
|
27
35
|
useCredentials: boolean;
|
|
28
36
|
/** @deprecated Derived read-only getter computed from {@link authMode}. */
|
|
@@ -34,8 +42,14 @@ export type AppGlobalConfig<T extends Record<string, any> = {}> = {
|
|
|
34
42
|
} & T;
|
|
35
43
|
/**
|
|
36
44
|
* Configuration object for global settings.
|
|
45
|
+
*
|
|
46
|
+
* Known keys keep their declared type; application-specific extras remain accepted but read back
|
|
47
|
+
* as `unknown` (they used to be `any`, which silently disabled type checking on the whole object —
|
|
48
|
+
* that is how a `isRedirectUrl` key nobody ever read survived here). Applications that store their
|
|
49
|
+
* own keys can describe them once with the {@link AppGlobalConfig} generic and read through it:
|
|
50
|
+
* `(globalConfig as Partial<AppGlobalConfig<{ myFlag: boolean }>>).myFlag`.
|
|
37
51
|
*/
|
|
38
|
-
declare const globalConfig: Partial<AppGlobalConfig & Record<string,
|
|
52
|
+
declare const globalConfig: Partial<AppGlobalConfig> & Record<string, unknown>;
|
|
39
53
|
/**
|
|
40
54
|
* Sets the global configuration for the application.
|
|
41
55
|
*
|
|
@@ -45,6 +59,12 @@ declare const globalConfig: Partial<AppGlobalConfig & Record<string, any>>;
|
|
|
45
59
|
*
|
|
46
60
|
* @param config - The partial configuration object to be merged with the existing global configuration.
|
|
47
61
|
*/
|
|
48
|
-
export declare function setGlobalConfig(config: Partial<AppGlobalConfig & Record<string,
|
|
62
|
+
export declare function setGlobalConfig(config: Partial<AppGlobalConfig> & Record<string, unknown>): void;
|
|
63
|
+
/**
|
|
64
|
+
* Merges a partial configuration into a target configuration object, applying the `authMode`
|
|
65
|
+
* precedence rules. `setGlobalConfig` runs it on the global object; a client created with
|
|
66
|
+
* `createAtomicClient` runs it on its own, which is what keeps the two isolated.
|
|
67
|
+
*/
|
|
68
|
+
export declare function applyConfig(target: Partial<AppGlobalConfig> & Record<string, unknown>, config: Partial<AppGlobalConfig> & Record<string, unknown>): void;
|
|
49
69
|
export { globalConfig };
|
|
50
70
|
//# sourceMappingURL=global.config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global.config.d.ts","sourceRoot":"","sources":["../../src/configurations/global.config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAEL,KAAK,QAAQ,IAAI,YAAY,EAE9B,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"global.config.d.ts","sourceRoot":"","sources":["../../src/configurations/global.config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAEL,KAAK,QAAQ,IAAI,YAAY,EAE9B,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,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
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/configurations/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/configurations/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,YAAY,EACV,YAAY,EACZ,WAAW,EACX,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,cAAc,iBAAiB,CAAC"}
|
|
@@ -65,6 +65,30 @@ export declare const filter: {
|
|
|
65
65
|
in: (field: string, values: string[]) => InFilter;
|
|
66
66
|
/** `field BETWEEN start AND end` (inclusive). Works for numbers and ISO dates. */
|
|
67
67
|
between: (field: string, start: string | number, end: string | number) => BetweenFilter;
|
|
68
|
+
/**
|
|
69
|
+
* The filter for a **distribution** aggregation item — a date or size bucket, typically.
|
|
70
|
+
*
|
|
71
|
+
* Such an item's `value` is not a value at all: it is a whole expression the server built, of the
|
|
72
|
+
* form ``field`display`:<comparisons>``. Clicking "Since yesterday" or "1 to 10 MB" therefore cannot
|
|
73
|
+
* be turned into a filter by taking the value as-is — doing so sends an expression where the field's
|
|
74
|
+
* type is expected, and the backend answers `500 — "Field type error"`. That mistake is easy to make
|
|
75
|
+
* and hard to read, which is why this lives here.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* // Aggregation "Dates" (isDistribution), item value:
|
|
79
|
+
* // modified`Since yesterday[fr]Depuis hier`:>= 2026-08-02
|
|
80
|
+
* filter.distribution("modified", item.value) // → { field: "modified", operator: "gte", value: "2026-08-02" }
|
|
81
|
+
*
|
|
82
|
+
* // Aggregation "Size" (isDistribution), item value:
|
|
83
|
+
* // size`1 to 10 MB`:(>= 1048576 AND < 10485760)
|
|
84
|
+
* filter.distribution("size", item.value) // → and(gte 1048576, lt 10485760)
|
|
85
|
+
*
|
|
86
|
+
* @param field - The aggregation's `column`.
|
|
87
|
+
* @param expression - The item's `value`.
|
|
88
|
+
* @returns The comparison, or `undefined` when the expression carries none — in which case the item
|
|
89
|
+
* is not a distribution bucket and `filter.eq`/`filter.contains` applies instead.
|
|
90
|
+
*/
|
|
91
|
+
distribution: (field: string, expression: unknown) => Filter | undefined;
|
|
68
92
|
/**
|
|
69
93
|
* Combine filters with logical AND. Falsy operands are ignored; with a single
|
|
70
94
|
* effective operand the operand is returned as-is, with none `undefined`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../src/helpers/filters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EACV,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,UAAU,EACV,YAAY,EACb,MAAM,kBAAkB,CAAC;AAE1B,8CAA8C;AAC9C,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEpD;;;;;;;;;GASG;AACH,KAAK,WAAW,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,CAAC;AAOrD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,MAAM;IAGjB,uBAAuB;gBACX,MAAM,SAAS,WAAW,KAAG,YAAY;IAKrD,wBAAwB;iBACX,MAAM,SAAS,WAAW,KAAG,YAAY;IAKtD,uBAAuB;gBACX,MAAM,SAAS,WAAW,KAAG,YAAY;IAKrD,wBAAwB;iBACX,MAAM,SAAS,WAAW,KAAG,YAAY;IAKtD,uBAAuB;gBACX,MAAM,SAAS,WAAW,KAAG,YAAY;IAKrD,wBAAwB;iBACX,MAAM,SAAS,WAAW,KAAG,YAAY;IAKtD,mFAAmF;kBACrE,MAAM,SAAS,MAAM,KAAG,YAAY;IAKlD,6BAA6B;sBACX,MAAM,SAAS,MAAM,KAAG,YAAY;IAKtD,gCAAgC;mBACjB,MAAM,SAAS,MAAM,KAAG,YAAY;IAKnD,kCAAkC;o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S,MAAM,UAAU,MAAM,EAAE,KAAG,QAAQ;IAK/C,kFAAkF;qBAEzE,MAAM,SACN,MAAM,GAAG,MAAM,OACjB,MAAM,GAAG,MAAM,KACnB,aAAa;IAOhB;;;;;;;;;;;;;;;;;;;;;;OAsBG;0BACmB,MAAM,cAAc,OAAO,KAAG,MAAM,GAAG,SAAS;IA6BtE;;;OAGG;sBACe,WAAW,EAAE,KAAG,MAAM,GAAG,SAAS;IAEpD,oFAAoF;qBACnE,WAAW,EAAE,KAAG,MAAM,GAAG,SAAS;IACnD;;;OAGG;sBACe,WAAW,EAAE,KAAG,UAAU,GAAG,SAAS;CAIzD,CAAC;AAcF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,GAAG,SAAS,GAC/B,MAAM,GAAG,SAAS,CAqDpB"}
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Result } from "../types";
|
|
2
|
+
/** The pages either side of the one a result carries. `undefined` on a side means there is none. */
|
|
3
|
+
export type ResultPages = {
|
|
4
|
+
nextPage: number | undefined;
|
|
5
|
+
previousPage: number | undefined;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The pages surrounding the one a result carries.
|
|
9
|
+
*
|
|
10
|
+
* The fields are read as optional on purpose, because a response may carry no pagination at all — one
|
|
11
|
+
* answering `action: "aggregate"` has neither `page` nor `rowCount`. Computing the bounds regardless
|
|
12
|
+
* gave `Math.ceil(undefined / undefined)`, that is `NaN`, and every comparison against `NaN` is
|
|
13
|
+
* `false`: a response with **no** pages then read exactly like a response on its **last** page. Both
|
|
14
|
+
* sides are reported as `undefined` instead, which says the one thing that is true.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* resultPages({ page: 2, pageSize: 10, rowCount: 55 }) // → { nextPage: 3, previousPage: 1 }
|
|
19
|
+
* resultPages({ aggregations: [] }) // → { nextPage: undefined, previousPage: undefined }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function resultPages(result: Partial<Pick<Result, "page" | "pageSize" | "rowCount">>): ResultPages;
|
|
23
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/helpers/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,oGAAoG;AACpG,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC,CAAC,GAC9D,WAAW,CAWb"}
|
|
@@ -5,4 +5,10 @@
|
|
|
5
5
|
* @returns The keys of type `string` from the given type `T`.
|
|
6
6
|
*/
|
|
7
7
|
export type KeyOf<T> = Extract<keyof T, string>;
|
|
8
|
+
/**
|
|
9
|
+
* Exhaustiveness guard: marks a code path the type system proves unreachable (e.g. the `default`
|
|
10
|
+
* of a `switch` over a discriminated union). Adding a new variant to the union then becomes a
|
|
11
|
+
* compile error at every call site instead of a silently ignored case.
|
|
12
|
+
*/
|
|
13
|
+
export declare function assertNever(value: never): never;
|
|
8
14
|
//# sourceMappingURL=ts-helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ts-helper.d.ts","sourceRoot":"","sources":["../../src/helpers/ts-helper.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"ts-helper.d.ts","sourceRoot":"","sources":["../../src/helpers/ts-helper.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AAEhD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAE/C"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AAEjC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
import type { TokenStorage } from "../configurations/auth-options";
|
|
2
|
+
type StorageScope = "session" | "local";
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the storage backing a scope: the one injected through `auth.storage`, otherwise Web
|
|
5
|
+
* Storage, otherwise the in-memory fallback. Resolved at call time so an injection made after
|
|
6
|
+
* start-up is honored.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveStorage(scope: StorageScope, injected?: TokenStorage): TokenStorage;
|
|
1
9
|
export declare function getLocalStorageItem(key: string): string | null;
|
|
2
10
|
export declare function setLocalStorageItem(key: string, value: string): void;
|
|
3
11
|
export declare function removeLocalStorageItem(key: string): void;
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
12
|
+
export declare function getSessionStorageItem(key: string): string | null;
|
|
13
|
+
export declare function setSessionStorageItem(key: string, value: string): void;
|
|
14
|
+
export declare function removeSessionStorageItem(key: string): void;
|
|
15
|
+
export {};
|
|
7
16
|
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/polyfills/storage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/polyfills/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAGnE,KAAK,YAAY,GAAG,SAAS,GAAG,OAAO,CAAC;AAyBxC;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,YAAY,EACnB,QAAQ,CAAC,EAAE,YAAY,GACtB,YAAY,CAkBd;AAOD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE9D;AACD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAEpE;AACD,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAExD;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEhE;AACD,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAEtE;AACD,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE1D"}
|
package/dist/spfx/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../src-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../src-DeaVS0Tt.cjs");exports.API=e.st,exports.ApiError=e.In,exports.Audit=e.bt,exports.AuditEventType=e.Kt,exports.AuthMode=e.qn,exports.DidYouMeanKind=e.Ht,exports.EngineType=e.Gt,exports.EngineTypeModifier=e.Wt,exports.LogLevel=e.$n,exports.MINIMUM_COMPATIBLE_SERVER_API_VERSION=e.Ut,exports.RFMDisplay=e.Vt,exports.ServerError=e.Nn,exports.TimeoutError=e.En,exports.UnauthorizedError=e.Fn,exports.aadHttpClientManager=e.Hn,exports.addAuditAdditionalInfo=e.xt,exports.addConcepts=e.g,exports.addSessionId=e.St,exports.addUrl=e.Ct,exports.aggItemRegex=e.C,exports.aggregationItemStrictCompare=e.w,exports.appInitializerFn=e.Qt,exports.applyConfig=e.Wn,exports.assertNever=e._n,exports.bisect=e.S,exports.buildPathsAndLevels=e.it,exports.clearSessionTokens=e.un,exports.configureLogger=e.er,exports.createAtomicClient=e.k,exports.createContainer=e.L,exports.createHeaders=e.Ln,exports.createHeadersWithContext=e.Rn,exports.createSpfxHttpAdapter=e.Vn,exports.createTimeoutController=e.Tn,exports.createUserProfile=e.M,Object.defineProperty(exports,"debug",{enumerable:!0,get:function(){return e.tr}}),exports.del=e.on,exports.delWithContext=e.sn,exports.deleteContainerDocuments=e.R,exports.deleteContainers=e.z,exports.deleteUserProfileProperty=e.N,exports.deleteUserSettings=e.G,exports.deleteWebTokenCookie=e.fn,exports.detectAuthMode=e.Sn,exports.emitAuthenticatedEvent=e.Bn,Object.defineProperty(exports,"error",{enumerable:!0,get:function(){return e.nr}}),exports.escapeExpr=e.wt,exports.expiresSoon=e.Yt,exports.extraColumns=e.zt,exports.fetchAggregation=e.yt,exports.fetchApp=e.$t,exports.fetchAppPreLogin=e.en,exports.fetchBulkQuery=e.at,exports.fetchChangePassword=e.W,exports.fetchDataset=e.gt,exports.fetchDatasetList=e._t,exports.fetchDatasets=e.vt,exports.fetchLabels=e.mt,exports.fetchPreview=e.ft,exports.fetchPreviewUrl=e.pt,exports.fetchPrincipal=e.ct,exports.fetchPrincipalList=e.lt,exports.fetchPrincipalUserid=e.ut,exports.fetchPrincipalUserids=e.dt,exports.fetchQuery=e.ot,exports.fetchQueryExport=e.rt,exports.fetchQueryIntent=e.nt,exports.fetchSendPasswordResetEmail=e.I,exports.fetchSimilarDocuments=e.et,exports.fetchSponsoredLinks=e.$,exports.fetchSuggest=e.X,exports.fetchSuggestField=e.Z,exports.fetchSuggestQuery=e.Q,exports.fetchTextChunks=e.Y,exports.fetchUserProfile=e.P,exports.fetchUserSettings=e.K,exports.fetchVersion=e.j,exports.filter=e.Lt,exports.get=e.bn,exports.getConcepts=e._,exports.getContainer=e.B,exports.getCsrfToken=e.yn,exports.getDefaultClient=e.A,exports.getFiltersFromURI=e.r,exports.getFiltersFromUrl=e.i,exports.getHelpIndexUrl=e.t,exports.getIdFromUrl=e.a,exports.getJWToken=e.hn,exports.getMetadata=e.Ft,exports.getMetadataWithValues=e.It,exports.getOffsetFromDates=e.m,exports.getQueryPageFromUrl=e.o,exports.getQueryParamsFromUrl=e.s,exports.getQueryTabFromUrl=e.c,exports.getQueryTextFromUrl=e.l,exports.getRelativeDate=e.h,exports.getTime=e.Tt,exports.getToken=e.zn,exports.getUrlParamsFromQueryParams=e.u,exports.getWithContext=e.xn,exports.globalConfig=e.Gn,exports.guid=e.Et,exports.handleResponse=e.jn,exports.handleResponseWithContext=e.Mn,exports.hasSession=e.vn,Object.defineProperty(exports,"info",{enumerable:!0,get:function(){return e.rr}}),exports.initializeAadHttpClient=e.Un,exports.initializeAppConfig=e.tn,exports.isArrayBuffer=e.Dt,exports.isAuthenticated=e.cn,exports.isBlob=e.Ot,exports.isDate=e.kt,exports.isExpired=e.Xt,exports.isExternalAuthMode=e.Jn,exports.isJsonable=e.At,exports.isNotInputEvent=e.p,exports.isObject=e.jt,exports.isRedirectPending=e.ln,exports.isString=e.Mt,exports.labels=e.ht,exports.legacyBooleansToAuthMode=e.Yn,exports.legacyFilterToFilter=e.Rt,exports.listContainerDocuments=e.V,exports.listContainers=e.H,exports.login=e.pn,exports.logout=e.dn,exports.makeColumn=e.Bt,exports.notify=e.f,exports.onAuthEvent=e.ar,exports.openParentNodes=e.T,exports.parseText=e.v,exports.parseValueAndOperatorFromItem=e.E,exports.patch=e.in,exports.patchUserProfile=e.F,exports.patchUserSettings=e.q,exports.patchWithContext=e.an,exports.post=e.Dn,exports.postWithContext=e.On,exports.put=e.nn,exports.putWithContext=e.rn,exports.queryParamsFromUrl=e.d,exports.removeConcept=e.y,exports.removeConcepts=e.b,exports.requestWebTokenSession=e.gn,exports.resolveBearerToken=e.Xn,exports.resolveNoAutoAuthentication=e.kn,exports.resolveNoAutoAuthenticationWithContext=e.An,exports.resolveOAuthProvider=e.Zn,exports.resolveSAMLProvider=e.Qn,exports.resolveToColumnName=e.qt,exports.resultPages=e.Pt,exports.rewriteText=e.x,exports.saveUserSettings=e.J,exports.searchPrincipals=e.tt,exports.setGlobalConfig=e.Kn,exports.setToken=e.Pn,exports.sha512=e.Nt,exports.suggestionsToTreeAggregationNodes=e.D,exports.sysLang=e.n,exports.toDate=e.Zt,exports.translateAggregationToDateOptions=e.O,exports.tryAutoAuthentication=e.mn,exports.tryOAuthAuthentication=e.wn,exports.trySAMLAuthentication=e.Cn,exports.updateContainer=e.U,Object.defineProperty(exports,"warn",{enumerable:!0,get:function(){return e.ir}}),exports.withRetry=e.Jt;
|
package/dist/spfx/index.d.ts
CHANGED
package/dist/spfx/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/spfx/index.ts"],"names":[],"mappings":"AAAA,cAAc,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/spfx/index.ts"],"names":[],"mappings":"AAAA,cAAc,IAAI,CAAC;AAGnB,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,cAAc,4CAA4C,CAAC"}
|
package/dist/spfx/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as e, $
|
|
2
|
-
export {
|
|
1
|
+
import { $ as e, $n as t, $t as n, A as r, An as i, At as a, B as o, Bn as s, Bt as c, C as l, Cn as u, Ct as d, D as f, Dn as p, Dt as m, E as h, En as g, Et as _, F as v, Fn as y, Ft as b, G as x, Gn as S, Gt as C, H as w, Hn as T, Ht as E, I as D, In as O, It as k, J as A, Jn as j, Jt as M, K as N, Kn as P, Kt as F, L as I, Ln as L, Lt as R, M as z, Mn as B, Mt as V, N as H, Nn as U, Nt as W, O as G, On as K, Ot as q, P as J, Pn as Y, Pt as X, Q as Z, Qn as Q, Qt as $, R as ee, Rn as te, Rt as ne, S as re, Sn as ie, St as ae, T as oe, Tn as se, Tt as ce, U as le, Un as ue, Ut as de, V as fe, Vn as pe, Vt as me, W as he, Wn as ge, Wt as _e, X as ve, Xn as ye, Xt as be, Y as xe, Yn as Se, Yt as Ce, Z as we, Zn as Te, Zt as Ee, _ as De, _n as Oe, _t as ke, a as Ae, an as je, ar as Me, at as Ne, b as Pe, bn as Fe, bt as Ie, c as Le, cn as Re, ct as ze, d as Be, dn as Ve, dt as He, en as Ue, er as We, et as Ge, f as Ke, fn as qe, ft as Je, g as Ye, gn as Xe, gt as Ze, h as Qe, hn as $e, ht as et, i as tt, in as nt, ir as rt, it, j as at, jn as ot, jt as st, k as ct, kn as lt, kt as ut, l as dt, ln as ft, lt as pt, m as mt, mn as ht, mt as gt, n as _t, nn as vt, nr as yt, nt as bt, o as xt, on as St, ot as Ct, p as wt, pn as Tt, pt as Et, q as Dt, qn as Ot, qt as kt, r as At, rn as jt, rr as Mt, rt as Nt, s as Pt, sn as Ft, st as It, t as Lt, tn as Rt, tr as zt, tt as Bt, u as Vt, un as Ht, ut as Ut, v as Wt, vn as Gt, vt as Kt, w as qt, wn as Jt, wt as Yt, x as Xt, xn as Zt, xt as Qt, y as $t, yn as en, yt as tn, z as nn, zn as rn, zt as an } from "../src-BzPBKdDO.js";
|
|
2
|
+
export { It as API, O as ApiError, Ie as Audit, F as AuditEventType, Ot as AuthMode, E as DidYouMeanKind, C as EngineType, _e as EngineTypeModifier, t as LogLevel, de as MINIMUM_COMPATIBLE_SERVER_API_VERSION, me as RFMDisplay, U as ServerError, g as TimeoutError, y as UnauthorizedError, T as aadHttpClientManager, Qt as addAuditAdditionalInfo, Ye as addConcepts, ae as addSessionId, d as addUrl, l as aggItemRegex, qt as aggregationItemStrictCompare, $ as appInitializerFn, ge as applyConfig, Oe as assertNever, re as bisect, it as buildPathsAndLevels, Ht as clearSessionTokens, We as configureLogger, ct as createAtomicClient, I as createContainer, L as createHeaders, te as createHeadersWithContext, pe as createSpfxHttpAdapter, se as createTimeoutController, z as createUserProfile, zt as debug, St as del, Ft as delWithContext, ee as deleteContainerDocuments, nn as deleteContainers, H as deleteUserProfileProperty, x as deleteUserSettings, qe as deleteWebTokenCookie, ie as detectAuthMode, s as emitAuthenticatedEvent, yt as error, Yt as escapeExpr, Ce as expiresSoon, an as extraColumns, tn as fetchAggregation, n as fetchApp, Ue as fetchAppPreLogin, Ne as fetchBulkQuery, he as fetchChangePassword, Ze as fetchDataset, ke as fetchDatasetList, Kt as fetchDatasets, gt as fetchLabels, Je as fetchPreview, Et as fetchPreviewUrl, ze as fetchPrincipal, pt as fetchPrincipalList, Ut as fetchPrincipalUserid, He as fetchPrincipalUserids, Ct as fetchQuery, Nt as fetchQueryExport, bt as fetchQueryIntent, D as fetchSendPasswordResetEmail, Ge as fetchSimilarDocuments, e as fetchSponsoredLinks, ve as fetchSuggest, we as fetchSuggestField, Z as fetchSuggestQuery, xe as fetchTextChunks, J as fetchUserProfile, N as fetchUserSettings, at as fetchVersion, R as filter, Fe as get, De as getConcepts, o as getContainer, en as getCsrfToken, r as getDefaultClient, At as getFiltersFromURI, tt as getFiltersFromUrl, Lt as getHelpIndexUrl, Ae as getIdFromUrl, $e as getJWToken, b as getMetadata, k as getMetadataWithValues, mt as getOffsetFromDates, xt as getQueryPageFromUrl, Pt as getQueryParamsFromUrl, Le as getQueryTabFromUrl, dt as getQueryTextFromUrl, Qe as getRelativeDate, ce as getTime, rn as getToken, Vt as getUrlParamsFromQueryParams, Zt as getWithContext, S as globalConfig, _ as guid, ot as handleResponse, B as handleResponseWithContext, Gt as hasSession, Mt as info, ue as initializeAadHttpClient, Rt as initializeAppConfig, m as isArrayBuffer, Re as isAuthenticated, q as isBlob, ut as isDate, be as isExpired, j as isExternalAuthMode, a as isJsonable, wt as isNotInputEvent, st as isObject, ft as isRedirectPending, V as isString, et as labels, Se as legacyBooleansToAuthMode, ne as legacyFilterToFilter, fe as listContainerDocuments, w as listContainers, Tt as login, Ve as logout, c as makeColumn, Ke as notify, Me as onAuthEvent, oe as openParentNodes, Wt as parseText, h as parseValueAndOperatorFromItem, nt as patch, v as patchUserProfile, Dt as patchUserSettings, je as patchWithContext, p as post, K as postWithContext, vt as put, jt as putWithContext, Be as queryParamsFromUrl, $t as removeConcept, Pe as removeConcepts, Xe as requestWebTokenSession, ye as resolveBearerToken, lt as resolveNoAutoAuthentication, i as resolveNoAutoAuthenticationWithContext, Te as resolveOAuthProvider, Q as resolveSAMLProvider, kt as resolveToColumnName, X as resultPages, Xt as rewriteText, A as saveUserSettings, Bt as searchPrincipals, P as setGlobalConfig, Y as setToken, W as sha512, f as suggestionsToTreeAggregationNodes, _t as sysLang, Ee as toDate, G as translateAggregationToDateOptions, ht as tryAutoAuthentication, Jt as tryOAuthAuthentication, u as trySAMLAuthentication, le as updateContainer, rt as warn, M as withRetry };
|