@sinequa/atomic 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +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 +12 -7
- 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 +5 -2
- 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 +29 -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 +51 -1
- 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-1RUu1uXc.cjs +1 -0
- package/dist/src-DFuZeDvd.js +2198 -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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ApiError } from "../../web-api/helpers/errors/api-error";
|
|
1
2
|
import { Aggregation, TreeAggregation } from "../aggregations";
|
|
2
3
|
import { Answer } from "./Answer";
|
|
3
4
|
import { Article } from "./Article";
|
|
@@ -8,7 +9,13 @@ import { QueryIntent } from "./QueryIntent";
|
|
|
8
9
|
import { Tab } from "./Tab";
|
|
9
10
|
import { TopPassage } from "./TopPassage";
|
|
10
11
|
/**
|
|
11
|
-
* Describes the results of a call to the query web service
|
|
12
|
+
* Describes the results of a **search** call to the query web service.
|
|
13
|
+
*
|
|
14
|
+
* Only a search response has this shape. A query sent with `action: "aggregate"` — the one that pages
|
|
15
|
+
* through a single aggregation's items — comes back with `aggregations` and little else: no `records`,
|
|
16
|
+
* no `rowCount`, no `page`/`pageSize`, no `tab`. Type those responses as {@link AggregateResult}
|
|
17
|
+
* instead; casting one to `Result` makes twelve absent fields look present, and arithmetic on them
|
|
18
|
+
* silently yields `NaN` rather than failing.
|
|
12
19
|
*/
|
|
13
20
|
export type Result = {
|
|
14
21
|
id: string;
|
|
@@ -26,7 +33,8 @@ export type Result = {
|
|
|
26
33
|
didYouMean?: DidYouMean;
|
|
27
34
|
aggregations: (Aggregation | TreeAggregation)[];
|
|
28
35
|
attributes: Attributes;
|
|
29
|
-
|
|
36
|
+
/** Absent unless the query carried a query-intent configuration — the server omits the key entirely. */
|
|
37
|
+
queryIntents?: QueryIntent[];
|
|
30
38
|
queryAnalysis?: QueryAnalysis;
|
|
31
39
|
records: Article[];
|
|
32
40
|
rfmQueryHash?: string;
|
|
@@ -39,5 +47,31 @@ export type Result = {
|
|
|
39
47
|
topPassages?: {
|
|
40
48
|
passages?: TopPassage[];
|
|
41
49
|
} | null;
|
|
50
|
+
/**
|
|
51
|
+
* Set by the client, never by the server: the request failed, and none of the fields above were
|
|
52
|
+
* received.
|
|
53
|
+
*
|
|
54
|
+
* It exists so a failure can be told apart from a corpus that legitimately matched nothing. Both
|
|
55
|
+
* arrive as a result with no records, and a caller that only looks at `records` or `rowCount` reports
|
|
56
|
+
* "no results" for a backend that is in fact broken — a 500 on a malformed filter, typically. Check
|
|
57
|
+
* this field **before** concluding anything from an empty result.
|
|
58
|
+
*
|
|
59
|
+
* Prefixed with `$` like the other client-side additions (`$hasMore`, `$selected`).
|
|
60
|
+
*/
|
|
61
|
+
$error?: ApiError;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Describes the response to a query sent with `action: "aggregate"` — paging through one
|
|
65
|
+
* aggregation's items, as a "load more" does.
|
|
66
|
+
*
|
|
67
|
+
* A deliberately narrow type: the server answers with these four keys and nothing else of use. It is
|
|
68
|
+
* **not** a {@link Result}, and typing it as one is how `rowCount`, `records` and `page` came to be read
|
|
69
|
+
* from a response that never carries them.
|
|
70
|
+
*/
|
|
71
|
+
export type AggregateResult = {
|
|
72
|
+
id: string;
|
|
73
|
+
queryName: string;
|
|
74
|
+
aggregations: (Aggregation | TreeAggregation)[];
|
|
75
|
+
attributes: Attributes;
|
|
42
76
|
};
|
|
43
77
|
//# sourceMappingURL=Result.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Result.d.ts","sourceRoot":"","sources":["../../../src/types/search/Result.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Result.d.ts","sourceRoot":"","sources":["../../../src/types/search/Result.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;;;;;GAQG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,YAAY,EAAE,CAAC,WAAW,GAAG,eAAe,CAAC,EAAE,CAAC;IAChD,UAAU,EAAE,UAAU,CAAC;IACvB,wGAAwG;IACxG,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE;QACR,OAAO,EAAE,MAAM,EAAE,CAAC;KACnB,GAAG,IAAI,CAAC;IACT,WAAW,CAAC,EAAE;QACZ,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;KACzB,GAAG,IAAI,CAAC;IACT;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,CAAC,WAAW,GAAG,eAAe,CAAC,EAAE,CAAC;IAChD,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC"}
|
|
@@ -24,7 +24,7 @@ export type { QueryIntentMatch } from "./QueryIntentMatch";
|
|
|
24
24
|
export type { QueryIntentResponse } from "./QueryIntentResponse";
|
|
25
25
|
export type { QueryIntentWord } from "./QueryIntentWord";
|
|
26
26
|
export type { RelevantExtract } from "./RelevantExtract";
|
|
27
|
-
export type { Result } from "./Result";
|
|
27
|
+
export type { AggregateResult, Result } from "./Result";
|
|
28
28
|
export type { RFMActionDisplay } from "./RFMActionDisplay";
|
|
29
29
|
export type { RFMData } from "./RFMData";
|
|
30
30
|
export { RFMDisplay } from "./RFMDisplay";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/search/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM,CAAC,CAAC;IACvB,OAAO,EAAE,CAAC,EAAE,CAAC;CACd;AAED,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAC7E,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/search/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM,CAAC,CAAC;IACvB,OAAO,EAAE,CAAC,EAAE,CAAC;CACd;AAED,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAC7E,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACxD,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/utils/logger.d.ts
CHANGED
|
@@ -15,26 +15,37 @@ interface LoggerConfig {
|
|
|
15
15
|
level: LogLevel;
|
|
16
16
|
enableConsoleOutput: boolean;
|
|
17
17
|
}
|
|
18
|
+
/** Signature of the exported log functions. */
|
|
19
|
+
type LogFn = (message: string, data?: unknown) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Log a debug message.
|
|
22
|
+
*
|
|
23
|
+
* Reassigned by {@link configureLogger} rather than implemented as a wrapper, and that is the whole
|
|
24
|
+
* point: the browser attributes a console entry to the frame that **called** `console.*`, so routing
|
|
25
|
+
* every level through one internal `logMessage()` helper made DevTools blame this file — every line
|
|
26
|
+
* of the application linked to `logger.ts` instead of its caller. Exporting the *bound* console
|
|
27
|
+
* method makes the caller the invoking frame, so the source link is the code that logged.
|
|
28
|
+
*
|
|
29
|
+
* Two consequences to know about:
|
|
30
|
+
* - These are live ESM bindings. `import { debug }` follows a later `configureLogger()`, but
|
|
31
|
+
* capturing the value first (`const { debug } = await import(…)`) freezes the level it was
|
|
32
|
+
* configured with.
|
|
33
|
+
* - The `console` method is captured when the binding is built, so anything that replaces
|
|
34
|
+
* `console.*` afterwards — a test spy, an error-reporting SDK, a log shipper — is bypassed.
|
|
35
|
+
* Install such a wrapper before importing this module, or call `configureLogger({})` after
|
|
36
|
+
* installing it to rebuild the bindings against it.
|
|
37
|
+
*/
|
|
38
|
+
export declare let debug: LogFn;
|
|
39
|
+
/** Log an info message. @see debug for why this is a binding rather than a function. */
|
|
40
|
+
export declare let info: LogFn;
|
|
41
|
+
/** Log a warning message. @see debug for why this is a binding rather than a function. */
|
|
42
|
+
export declare let warn: LogFn;
|
|
43
|
+
/** Log an error message. @see debug for why this is a binding rather than a function. */
|
|
44
|
+
export declare let error: LogFn;
|
|
18
45
|
/**
|
|
19
46
|
* Configure the logger system
|
|
20
47
|
* @param config - Logger configuration options
|
|
21
48
|
*/
|
|
22
49
|
export declare function configureLogger(config: Partial<LoggerConfig>): void;
|
|
23
|
-
/**
|
|
24
|
-
* Log a debug message
|
|
25
|
-
*/
|
|
26
|
-
export declare function debug(message: string, data?: unknown): void;
|
|
27
|
-
/**
|
|
28
|
-
* Log an info message
|
|
29
|
-
*/
|
|
30
|
-
export declare function info(message: string, data?: unknown): void;
|
|
31
|
-
/**
|
|
32
|
-
* Log a warning message
|
|
33
|
-
*/
|
|
34
|
-
export declare function warn(message: string, data?: unknown): void;
|
|
35
|
-
/**
|
|
36
|
-
* Log an error message
|
|
37
|
-
*/
|
|
38
|
-
export declare function error(message: string, error?: unknown): void;
|
|
39
50
|
export {};
|
|
40
51
|
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,oBAAY,QAAQ;IAClB,KAAK,IAAI;IACT,IAAI,IAAI;IACR,IAAI,IAAI;IACR,KAAK,IAAI;IACT,IAAI,IAAI;CACT;AAED,UAAU,YAAY;IACpB,KAAK,EAAE,QAAQ,CAAC;IAChB,mBAAmB,EAAE,OAAO,CAAC;CAE9B;AAQD
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,oBAAY,QAAQ;IAClB,KAAK,IAAI;IACT,IAAI,IAAI;IACR,IAAI,IAAI;IACR,KAAK,IAAI;IACT,IAAI,IAAI;CACT;AAED,UAAU,YAAY;IACpB,KAAK,EAAE,QAAQ,CAAC;IAChB,mBAAmB,EAAE,OAAO,CAAC;CAE9B;AAQD,+CAA+C;AAC/C,KAAK,KAAK,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;AAIvD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,IAAI,KAAK,EAAE,KAAY,CAAC;AAE/B,wFAAwF;AACxF,eAAO,IAAI,IAAI,EAAE,KAAY,CAAC;AAE9B,0FAA0F;AAC1F,eAAO,IAAI,IAAI,EAAE,KAAY,CAAC;AAE9B,yFAAyF;AACzF,eAAO,IAAI,KAAK,EAAE,KAAY,CAAC;AA0B/B;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAGnE"}
|
|
@@ -41,6 +41,14 @@ declare class AadHttpClientManager {
|
|
|
41
41
|
initialize(client: AadHttpClientLike | null): void;
|
|
42
42
|
/** @throws if no client has been initialized. */
|
|
43
43
|
getClient(): AadHttpClientLike;
|
|
44
|
+
/**
|
|
45
|
+
* The v1 request configuration every `AadHttpClient` call needs. The SPFx SDK exposes it as a
|
|
46
|
+
* static member of the client's class, which is not describable on the instance type — so the
|
|
47
|
+
* single cast needed lives here rather than being repeated at each call site.
|
|
48
|
+
*
|
|
49
|
+
* @throws if no client has been initialized.
|
|
50
|
+
*/
|
|
51
|
+
getConfiguration(): unknown;
|
|
44
52
|
isInitialized(): boolean;
|
|
45
53
|
}
|
|
46
54
|
export declare const aadHttpClientManager: AadHttpClientManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aad-http-client-manager.d.ts","sourceRoot":"","sources":["../../../src/web-api/helpers/aad-http-client-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE;QAAE,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IACpC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACxB,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACzB,IAAI,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;IACzC,KAAK,CAAC,IAAI,mBAAmB,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,GAAG,CACD,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,OAAO,EACtB,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAChC,IAAI,CACF,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,OAAO,EACtB,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAChC,KAAK,CACH,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,OAAO,EACtB,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACjC;AAED;;;;;GAKG;AACH,cAAM,oBAAoB;IACxB,OAAO,CAAC,MAAM,CAAkC;IAEhD,0DAA0D;IAC1D,UAAU,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,IAAI;IAIlD,iDAAiD;IACjD,SAAS,IAAI,iBAAiB;IAS9B,aAAa,IAAI,OAAO;CAGzB;AAGD,eAAO,MAAM,oBAAoB,sBAA6B,CAAC;AAE/D;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAC/B,IAAI,CAEN"}
|
|
1
|
+
{"version":3,"file":"aad-http-client-manager.d.ts","sourceRoot":"","sources":["../../../src/web-api/helpers/aad-http-client-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE;QAAE,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IACpC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACxB,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACzB,IAAI,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;IACzC,KAAK,CAAC,IAAI,mBAAmB,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,GAAG,CACD,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,OAAO,EACtB,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAChC,IAAI,CACF,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,OAAO,EACtB,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAChC,KAAK,CACH,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,OAAO,EACtB,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACjC;AAED;;;;;GAKG;AACH,cAAM,oBAAoB;IACxB,OAAO,CAAC,MAAM,CAAkC;IAEhD,0DAA0D;IAC1D,UAAU,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,IAAI;IAIlD,iDAAiD;IACjD,SAAS,IAAI,iBAAiB;IAS9B;;;;;;OAMG;IACH,gBAAgB,IAAI,OAAO;IAO3B,aAAa,IAAI,OAAO;CAGzB;AAGD,eAAO,MAAM,oBAAoB,sBAA6B,CAAC;AAE/D;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAC/B,IAAI,CAEN"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
import { type AtomicContext } from "../../client/atomic-context";
|
|
2
|
+
/**
|
|
3
|
+
* Builds the headers of a request for a context: CSRF token, bearer token and impersonation.
|
|
4
|
+
*/
|
|
5
|
+
export declare function createHeadersWithContext(ctx: AtomicContext, headers?: Headers): Headers;
|
|
1
6
|
/**
|
|
2
7
|
* Creates headers for a web API request.
|
|
3
8
|
* @returns {Headers} The headers object.
|
|
9
|
+
*
|
|
10
|
+
* @deprecated Implementation detail of the HTTP helpers, which already call it on every request.
|
|
11
|
+
* Pass your own `headers` in the request options instead. It will stop being exported in the next
|
|
12
|
+
* major.
|
|
4
13
|
*/
|
|
5
14
|
export declare function createHeaders(headers?: Headers): Headers;
|
|
6
15
|
//# sourceMappingURL=create-headers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-headers.d.ts","sourceRoot":"","sources":["../../../src/web-api/helpers/create-headers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-headers.d.ts","sourceRoot":"","sources":["../../../src/web-api/helpers/create-headers.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,6BAA6B,CAAC;AAGrC;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,aAAa,EAClB,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAyBT;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAExD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-error.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/errors/api-error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,QAAS,SAAQ,KAAK;IACjC,MAAM,EAAE,MAAM,CAAC;gBAEH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"api-error.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/errors/api-error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,QAAS,SAAQ,KAAK;IACjC,MAAM,EAAE,MAAM,CAAC;gBAEH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAO5C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type AtomicContext } from "../../client/atomic-context";
|
|
1
2
|
import type { AadHttpResponseLike } from "./aad-http-client-manager";
|
|
2
3
|
type ResponseLike = Response | AadHttpResponseLike;
|
|
3
4
|
/**
|
|
@@ -6,7 +7,22 @@ type ResponseLike = Response | AadHttpResponseLike;
|
|
|
6
7
|
* @param response - The response from the web API (standard Response or SPFx HttpClientResponse).
|
|
7
8
|
* @param responseType - The type of response expected ('arraybuffer', 'blob', 'json', or 'text')
|
|
8
9
|
* @returns A promise that resolves to the response data of type T.
|
|
10
|
+
*
|
|
11
|
+
* @deprecated Implementation detail of the HTTP helpers, which already apply it to every response.
|
|
12
|
+
* Use `get`/`post`/`put`/`patch`/`del`, or subscribe to `onAuthEvent("unauthorized", …)` to react to
|
|
13
|
+
* a 401. It will stop being exported in the next major.
|
|
14
|
+
*/
|
|
15
|
+
export declare function handleResponse<T>(response: ResponseLike, responseType?: "arraybuffer" | "blob" | "json" | "text" | "response"): Promise<T>;
|
|
16
|
+
/**
|
|
17
|
+
* Handles the response of a request made on a context: sliding token refresh, body parsing, and
|
|
18
|
+
* typed errors (with the `unauthorized` event raised on the context's own subscribers).
|
|
19
|
+
*/
|
|
20
|
+
export declare function handleResponseWithContext<T>(ctx: AtomicContext, response: ResponseLike, responseType?: "arraybuffer" | "blob" | "json" | "text" | "response",
|
|
21
|
+
/**
|
|
22
|
+
* URL the request was sent to. Passed explicitly because `response.url` is empty on a synthetic
|
|
23
|
+
* Response (an injected `fetch`, an SPFx transport), which would leave the error events without
|
|
24
|
+
* an endpoint.
|
|
9
25
|
*/
|
|
10
|
-
|
|
26
|
+
endpoint?: string): Promise<T>;
|
|
11
27
|
export {};
|
|
12
28
|
//# sourceMappingURL=handle-response.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle-response.d.ts","sourceRoot":"","sources":["../../../src/web-api/helpers/handle-response.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAMrE,KAAK,YAAY,GAAG,QAAQ,GAAG,mBAAmB,CAAC;AAEnD
|
|
1
|
+
{"version":3,"file":"handle-response.d.ts","sourceRoot":"","sources":["../../../src/web-api/helpers/handle-response.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,aAAa,EAGnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAMrE,KAAK,YAAY,GAAG,QAAQ,GAAG,mBAAmB,CAAC;AAEnD;;;;;;;;;;GAUG;AACH,wBAAsB,cAAc,CAAC,CAAC,EACpC,QAAQ,EAAE,YAAY,EACtB,YAAY,GAAE,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,UAAmB,GAC3E,OAAO,CAAC,CAAC,CAAC,CAEZ;AAED;;;GAGG;AACH,wBAAsB,yBAAyB,CAAC,CAAC,EAC/C,GAAG,EAAE,aAAa,EAClB,QAAQ,EAAE,YAAY,EACtB,YAAY,GAAE,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,UAAmB;AAC5E;;;;GAIG;AACH,QAAQ,SAAqB,GAC5B,OAAO,CAAC,CAAC,CAAC,CAkEZ"}
|
|
@@ -11,7 +11,7 @@ export * from "./methods/post";
|
|
|
11
11
|
export * from "./methods/put";
|
|
12
12
|
export * from "./request-options";
|
|
13
13
|
export * from "./utils/create-timeout-controller";
|
|
14
|
-
export * from "./utils/date-utils
|
|
14
|
+
export * from "./utils/date-utils";
|
|
15
15
|
export * from "./utils/resolve-no-auto-authentication";
|
|
16
16
|
export * from "./utils/with-retry";
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/web-api/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mCAAmC,CAAC;AAClD,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/web-api/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oBAAoB,CAAC;AACnC,cAAc,wCAAwC,CAAC;AACvD,cAAc,oBAAoB,CAAC"}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
+
import { type AtomicContext } from "../../../client/atomic-context";
|
|
1
2
|
import type { API_ENDPOINTS } from "../../../types";
|
|
3
|
+
import type { RequestOptions } from "../request-options";
|
|
4
|
+
/** Options of a DELETE request: the shared ones, plus an optional JSON payload. */
|
|
5
|
+
export type DeleteOptions = RequestOptions & {
|
|
6
|
+
body?: Record<string, unknown>;
|
|
7
|
+
};
|
|
8
|
+
/** Makes a DELETE request on the given context. */
|
|
9
|
+
export declare function delWithContext<T>(ctx: AtomicContext, endpoint: API_ENDPOINTS, params?: URLSearchParams, options?: DeleteOptions): Promise<T>;
|
|
2
10
|
/**
|
|
3
11
|
* Makes a DELETE request to the specified API endpoint.
|
|
4
12
|
*
|
|
5
13
|
* @param endpoint - The API endpoint to send the request to.
|
|
6
14
|
* @param params - The URL parameters to include in the request.
|
|
7
|
-
* @param options - Additional options for the request
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* alongside the DELETE method). `app`/`locale`/`noUserOverride`/`noAutoAuthentication` are
|
|
12
|
-
* merged in automatically, same as `post`/`put`.
|
|
15
|
+
* @param options - Additional options for the request (see {@link RequestOptions}), plus an
|
|
16
|
+
* optional JSON `body` (e.g. bulk-delete endpoints that need a payload alongside the DELETE
|
|
17
|
+
* method). `app`/`locale`/`noUserOverride`/`noAutoAuthentication` are merged into that body
|
|
18
|
+
* automatically, same as `post`/`put`.
|
|
13
19
|
* @returns A promise that resolves to the response data of type T.
|
|
14
20
|
*/
|
|
15
|
-
export declare function del<T>(endpoint: API_ENDPOINTS, params?: URLSearchParams, options?:
|
|
16
|
-
headers?: Headers;
|
|
17
|
-
responseType?: "arraybuffer" | "blob" | "json" | "text";
|
|
18
|
-
body?: Record<string, unknown>;
|
|
19
|
-
}): Promise<T>;
|
|
21
|
+
export declare function del<T>(endpoint: API_ENDPOINTS, params?: URLSearchParams, options?: DeleteOptions): Promise<T>;
|
|
20
22
|
//# sourceMappingURL=del.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"del.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/del.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"del.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/del.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAGnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIzD,mFAAmF;AACnF,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC;AAEhF,mDAAmD;AACnD,wBAAsB,cAAc,CAAC,CAAC,EACpC,GAAG,EAAE,aAAa,EAClB,QAAQ,EAAE,aAAa,EACvB,MAAM,CAAC,EAAE,eAAe,EACxB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,CAAC,CAAC,CAyBZ;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,GAAG,CAAC,CAAC,EACzB,QAAQ,EAAE,aAAa,EACvB,MAAM,CAAC,EAAE,eAAe,EACxB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,CAAC,CAAC,CAEZ"}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
+
import { type AtomicContext } from "../../../client/atomic-context";
|
|
1
2
|
import type { API_ENDPOINTS } from "../../../types";
|
|
3
|
+
import type { RequestOptions } from "../request-options";
|
|
4
|
+
/** Makes a GET request on the given context. */
|
|
5
|
+
export declare function getWithContext<T>(ctx: AtomicContext, endpoint: API_ENDPOINTS, params?: URLSearchParams, options?: RequestOptions): Promise<T>;
|
|
2
6
|
/**
|
|
3
7
|
* Makes a GET request to the specified API endpoint with the given parameters.
|
|
4
8
|
*
|
|
5
9
|
* @param endpoint - The API endpoint to send the GET request to.
|
|
6
10
|
* @param params - The URL parameters to include in the request.
|
|
7
|
-
* @param options - Additional options for the request.
|
|
8
|
-
* @param options.headers - Custom headers to include in the request.
|
|
9
|
-
* @param options.responseType - The expected type of response data.
|
|
10
|
-
* @param options.redirect - How to handle a redirect response (defaults to the browser's `follow`).
|
|
11
|
-
* Pass `"manual"` to avoid following a cross-origin redirect (e.g. an auth challenge to an IdP),
|
|
12
|
-
* which would otherwise surface as a CORS network error.
|
|
11
|
+
* @param options - Additional options for the request (see {@link RequestOptions}).
|
|
13
12
|
* @returns A Promise that resolves to the response data of type T.
|
|
14
13
|
*/
|
|
15
|
-
export declare function get<T>(endpoint: API_ENDPOINTS, params?: URLSearchParams, options?:
|
|
16
|
-
headers?: Headers;
|
|
17
|
-
responseType?: "arraybuffer" | "blob" | "json" | "text";
|
|
18
|
-
signal?: AbortSignal;
|
|
19
|
-
redirect?: RequestRedirect;
|
|
20
|
-
}): Promise<T>;
|
|
14
|
+
export declare function get<T>(endpoint: API_ENDPOINTS, params?: URLSearchParams, options?: RequestOptions): Promise<T>;
|
|
21
15
|
//# sourceMappingURL=get.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/get.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/get.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAGnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIzD,gDAAgD;AAChD,wBAAsB,cAAc,CAAC,CAAC,EACpC,GAAG,EAAE,aAAa,EAClB,QAAQ,EAAE,aAAa,EACvB,MAAM,CAAC,EAAE,eAAe,EACxB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,CAAC,CAAC,CAuBZ;AAED;;;;;;;GAOG;AACH,wBAAsB,GAAG,CAAC,CAAC,EACzB,QAAQ,EAAE,aAAa,EACvB,MAAM,CAAC,EAAE,eAAe,EACxB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,CAAC,CAAC,CAEZ"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
+
import { type AtomicContext } from "../../../client/atomic-context";
|
|
1
2
|
import type { API_ENDPOINTS } from "../../../types";
|
|
3
|
+
import type { RequestOptions } from "../request-options";
|
|
4
|
+
/** Makes a PATCH request on the given context. */
|
|
5
|
+
export declare function patchWithContext<T>(ctx: AtomicContext, endpoint: API_ENDPOINTS, body: Record<string, unknown>, options?: RequestOptions): Promise<T>;
|
|
2
6
|
/**
|
|
3
7
|
* Makes a PATCH request to the specified API endpoint.
|
|
4
8
|
*
|
|
5
9
|
* @param endpoint - The API endpoint to send the request to.
|
|
6
10
|
* @param body - The request body as a record of key-value pairs.
|
|
7
|
-
* @param options - Additional options for the request.
|
|
8
|
-
* @param options.headers - Custom headers to include in the request.
|
|
9
|
-
* @param options.responseType - The expected type of response data.
|
|
11
|
+
* @param options - Additional options for the request (see {@link RequestOptions}).
|
|
10
12
|
* @returns A promise that resolves to the response data of type T.
|
|
11
13
|
*/
|
|
12
|
-
export declare function patch<T>(endpoint: API_ENDPOINTS, body: Record<string, unknown>, options?:
|
|
13
|
-
headers?: Headers;
|
|
14
|
-
responseType?: "arraybuffer" | "blob" | "json" | "text";
|
|
15
|
-
}): Promise<T>;
|
|
14
|
+
export declare function patch<T>(endpoint: API_ENDPOINTS, body: Record<string, unknown>, options?: RequestOptions): Promise<T>;
|
|
16
15
|
//# sourceMappingURL=patch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patch.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/patch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"patch.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/patch.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAGnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIzD,kDAAkD;AAClD,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,GAAG,EAAE,aAAa,EAClB,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,CAAC,CAAC,CAkBZ;AAED;;;;;;;GAOG;AACH,wBAAsB,KAAK,CAAC,CAAC,EAC3B,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,CAAC,CAAC,CAEZ"}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
+
import { type AtomicContext } from "../../../client/atomic-context";
|
|
1
2
|
import type { API_ENDPOINTS } from "../../../types";
|
|
3
|
+
import type { RequestOptions } from "../request-options";
|
|
4
|
+
/** Makes a POST request on the given context. */
|
|
5
|
+
export declare function postWithContext<T>(ctx: AtomicContext, endpoint: API_ENDPOINTS, body: Record<string, unknown>, options?: RequestOptions): Promise<T>;
|
|
2
6
|
/**
|
|
3
7
|
* Makes a POST request to the specified API endpoint.
|
|
4
8
|
* `app` and `locale` are added automatically to the request body.
|
|
5
9
|
*
|
|
6
10
|
* @param endpoint - The API endpoint to send the request to.
|
|
7
11
|
* @param body - The request body as a record of key-value pairs.
|
|
8
|
-
* @param options - Additional options for the request.
|
|
9
|
-
* @param options.headers - Custom headers to include in the request.
|
|
10
|
-
* @param options.responseType - The expected type of response data.
|
|
12
|
+
* @param options - Additional options for the request (see {@link RequestOptions}).
|
|
11
13
|
* @returns A promise that resolves to the response data of type T.
|
|
12
14
|
*/
|
|
13
|
-
export declare function post<T>(endpoint: API_ENDPOINTS, body: Record<string, unknown>, options?:
|
|
14
|
-
headers?: Headers;
|
|
15
|
-
responseType?: "arraybuffer" | "blob" | "json" | "text";
|
|
16
|
-
signal?: AbortSignal;
|
|
17
|
-
}): Promise<T>;
|
|
15
|
+
export declare function post<T>(endpoint: API_ENDPOINTS, body: Record<string, unknown>, options?: RequestOptions): Promise<T>;
|
|
18
16
|
//# sourceMappingURL=post.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/post.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/post.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAGnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIzD,iDAAiD;AACjD,wBAAsB,eAAe,CAAC,CAAC,EACrC,GAAG,EAAE,aAAa,EAClB,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,CAAC,CAAC,CAoBZ;AAED;;;;;;;;GAQG;AACH,wBAAsB,IAAI,CAAC,CAAC,EAC1B,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,CAAC,CAAC,CAEZ"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
+
import { type AtomicContext } from "../../../client/atomic-context";
|
|
1
2
|
import type { API_ENDPOINTS } from "../../../types";
|
|
3
|
+
import type { RequestOptions } from "../request-options";
|
|
4
|
+
/** Makes a PUT request on the given context. */
|
|
5
|
+
export declare function putWithContext<T>(ctx: AtomicContext, endpoint: API_ENDPOINTS, body: Record<string, unknown>, options?: RequestOptions): Promise<T>;
|
|
2
6
|
/**
|
|
3
7
|
* Makes a PUT request to the specified API endpoint.
|
|
4
8
|
*
|
|
5
9
|
* @param endpoint - The API endpoint to send the request to.
|
|
6
10
|
* @param body - The request body as a record of key-value pairs.
|
|
7
|
-
* @param options - Additional options for the request.
|
|
8
|
-
* @param options.headers - Custom headers to include in the request.
|
|
9
|
-
* @param options.responseType - The expected type of response data.
|
|
11
|
+
* @param options - Additional options for the request (see {@link RequestOptions}).
|
|
10
12
|
* @returns A promise that resolves to the response data of type T.
|
|
11
13
|
*/
|
|
12
|
-
export declare function put<T>(endpoint: API_ENDPOINTS, body: Record<string, unknown>, options?:
|
|
13
|
-
headers?: Headers;
|
|
14
|
-
responseType?: "arraybuffer" | "blob" | "json" | "text";
|
|
15
|
-
}): Promise<T>;
|
|
14
|
+
export declare function put<T>(endpoint: API_ENDPOINTS, body: Record<string, unknown>, options?: RequestOptions): Promise<T>;
|
|
16
15
|
//# sourceMappingURL=put.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"put.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/put.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"put.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/put.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAGnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIzD,gDAAgD;AAChD,wBAAsB,cAAc,CAAC,CAAC,EACpC,GAAG,EAAE,aAAa,EAClB,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,CAAC,CAAC,CAoBZ;AAED;;;;;;;GAOG;AACH,wBAAsB,GAAG,CAAC,CAAC,EACzB,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,CAAC,CAAC,CAEZ"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type AtomicContext } from "../../../client/atomic-context";
|
|
2
|
+
import type { RequestOptions } from "../request-options";
|
|
3
|
+
/**
|
|
4
|
+
* Issues the request on the context's transport — its `HttpAdapter` when one is configured (SPFx),
|
|
5
|
+
* the resolved `fetch` otherwise — and hands the response to `handleResponse`.
|
|
6
|
+
*
|
|
7
|
+
* On a 401, the configured {@link AuthOptions.recoverFromUnauthorized} hook gets one chance to
|
|
8
|
+
* re-establish the session; if it succeeds the request is replayed **once**, with the refreshed
|
|
9
|
+
* CSRF token. Without a hook — or with {@link RequestOptions.noRecovery} — the `UnauthorizedError`
|
|
10
|
+
* propagates unchanged.
|
|
11
|
+
*
|
|
12
|
+
* Centralising this removes the transport branch that used to be copy-pasted in the five verbs.
|
|
13
|
+
*/
|
|
14
|
+
export declare function sendRequest<T>(ctx: AtomicContext, url: string, init: {
|
|
15
|
+
method: string;
|
|
16
|
+
headers: Headers;
|
|
17
|
+
body?: string;
|
|
18
|
+
}, options?: RequestOptions): Promise<T>;
|
|
19
|
+
/**
|
|
20
|
+
* Builds the JSON body shared by `post`, `put`, `patch` and `del`: the caller's payload plus the
|
|
21
|
+
* `app`/`locale` context and the two server flags.
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildJsonBody(ctx: AtomicContext, body: Record<string, unknown>, options?: RequestOptions): string;
|
|
24
|
+
//# sourceMappingURL=send-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-request.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/send-request.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAInB,MAAM,gCAAgC,CAAC;AAGxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAiEzD;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,CAAC,CAAC,EACjC,GAAG,EAAE,aAAa,EAClB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EACzD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,CAAC,CAAC,CA0BZ;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,MAAM,CAoBR"}
|
|
@@ -1,18 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Options accepted by every HTTP helper (`get`, `post`, `put`, `patch`, `del`).
|
|
3
|
+
*
|
|
4
|
+
* All fields are optional, and the set is the same across methods — a request built for one verb
|
|
5
|
+
* can be moved to another without rewriting its options.
|
|
3
6
|
*/
|
|
4
7
|
export interface RequestOptions {
|
|
5
|
-
/**
|
|
8
|
+
/** Extra headers to merge into the request. */
|
|
6
9
|
headers?: Headers;
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Expected shape of the response body. Defaults to `"json"`.
|
|
12
|
+
*
|
|
13
|
+
* `"response"` hands back the raw response instead of a parsed body, for the callers that need
|
|
14
|
+
* its headers or status — a download reading `content-disposition`, for instance.
|
|
15
|
+
*/
|
|
16
|
+
responseType?: "arraybuffer" | "blob" | "json" | "text" | "response";
|
|
17
|
+
/** Signal used to abort the request (see `createTimeoutController`). */
|
|
18
|
+
signal?: AbortSignal;
|
|
19
|
+
/**
|
|
20
|
+
* How to handle a redirect response. Defaults to the browser's `follow`; pass `"manual"` to avoid
|
|
21
|
+
* following a cross-origin redirect (e.g. an auth challenge to an IdP), which would otherwise
|
|
22
|
+
* surface as a CORS network error.
|
|
23
|
+
*/
|
|
24
|
+
redirect?: RequestRedirect;
|
|
25
|
+
/**
|
|
26
|
+
* Overrides the `noAutoAuthentication` flag sent to the server, which otherwise follows the
|
|
27
|
+
* resolved auth mode (see `resolveNoAutoAuthentication`): `false` in `sso`, so the server can
|
|
28
|
+
* replay its challenge, `true` everywhere else.
|
|
29
|
+
*/
|
|
30
|
+
noAutoAuthentication?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Keeps a `401` on this request from triggering {@link AuthOptions.recoverFromUnauthorized}.
|
|
33
|
+
*
|
|
34
|
+
* Set it on every request that is **part of** establishing a session — a sign-in, a session
|
|
35
|
+
* probe, a logout. Their `401` is an answer, not a session loss, and asking for the session to be
|
|
36
|
+
* re-established from inside the very procedure that establishes it makes that procedure wait on
|
|
37
|
+
* itself: the recovery hook never returns, and nothing ever rejects.
|
|
38
|
+
*/
|
|
39
|
+
noRecovery?: boolean;
|
|
17
40
|
}
|
|
18
41
|
//# sourceMappingURL=request-options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-options.d.ts","sourceRoot":"","sources":["../../../src/web-api/helpers/request-options.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"request-options.d.ts","sourceRoot":"","sources":["../../../src/web-api/helpers/request-options.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;IACrE,wEAAwE;IACxE,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AtomicContext } from "../../../client/atomic-context";
|
|
2
|
+
import type { API_ENDPOINTS } from "../../../types";
|
|
3
|
+
/**
|
|
4
|
+
* Builds the absolute request URL for an endpoint.
|
|
5
|
+
*
|
|
6
|
+
* Endpoints starting with `plugin` get the `api/v1/` prefix (assistant component v3.9.5) — that
|
|
7
|
+
* rule used to be duplicated in `get`/`post` and simply missing from `put`/`patch`/`del`. When no
|
|
8
|
+
* `backendUrl` is configured the endpoint stays relative, so the request targets the current origin
|
|
9
|
+
* instead of `undefined/api/...`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildRequestUrl(ctx: AtomicContext, endpoint: API_ENDPOINTS, params?: URLSearchParams): string;
|
|
12
|
+
//# sourceMappingURL=build-request-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-request-url.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/utils/build-request-url.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,aAAa,EAClB,QAAQ,EAAE,aAAa,EACvB,MAAM,CAAC,EAAE,eAAe,GACvB,MAAM,CAQR"}
|
|
@@ -11,4 +11,4 @@ export declare function toDate(iso?: string): Date | undefined;
|
|
|
11
11
|
export declare function isExpired(iso?: string): boolean;
|
|
12
12
|
/** Returns true if the given ISO date is within the next N days. */
|
|
13
13
|
export declare function expiresSoon(iso?: string, days?: number): boolean;
|
|
14
|
-
//# sourceMappingURL=date-utils
|
|
14
|
+
//# sourceMappingURL=date-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-utils.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/utils/date-utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,kDAAkD;AAClD,wBAAgB,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAKrD;AAED,kEAAkE;AAClE,wBAAgB,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAG/C;AAED,oEAAoE;AACpE,wBAAgB,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,SAAI,GAAG,OAAO,CAS3D"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type AtomicContext } from "../../../client/atomic-context";
|
|
1
2
|
/**
|
|
2
3
|
* Resolves the `noAutoAuthentication` flag sent on data requests.
|
|
3
4
|
*
|
|
@@ -12,5 +13,13 @@
|
|
|
12
13
|
*
|
|
13
14
|
* @returns `false` in `sso` mode (let the server auto-authenticate), `true` otherwise.
|
|
14
15
|
*/
|
|
16
|
+
export declare function resolveNoAutoAuthenticationWithContext(ctx: AtomicContext): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* @returns `false` in `sso` mode (let the server auto-authenticate), `true` otherwise.
|
|
19
|
+
*
|
|
20
|
+
* @deprecated Implementation detail of the HTTP helpers, which already apply it to every request.
|
|
21
|
+
* To override the flag on a single call, pass `noAutoAuthentication` in the request options instead.
|
|
22
|
+
* It will stop being exported in the next major.
|
|
23
|
+
*/
|
|
15
24
|
export declare function resolveNoAutoAuthentication(): boolean;
|
|
16
25
|
//# sourceMappingURL=resolve-no-auto-authentication.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-no-auto-authentication.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/utils/resolve-no-auto-authentication.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve-no-auto-authentication.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/utils/resolve-no-auto-authentication.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,gCAAgC,CAAC;AAExC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sCAAsC,CACpD,GAAG,EAAE,aAAa,GACjB,OAAO,CAET;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,IAAI,OAAO,CAErD"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* @param
|
|
6
|
-
* @
|
|
2
|
+
* Retries a request until it succeeds or the attempts run out. 4xx responses (except 429) and
|
|
3
|
+
* aborted requests are never retried.
|
|
4
|
+
*
|
|
5
|
+
* @param fetchFn - Function performing the request.
|
|
6
|
+
* @param maxRetries - Maximum number of retries.
|
|
7
|
+
* @param retryDelay - Delay between attempts, in ms.
|
|
8
|
+
* @returns The result of the request.
|
|
9
|
+
*
|
|
10
|
+
* @deprecated Never wired into the HTTP helpers, and unused since it was introduced. It will be
|
|
11
|
+
* removed in the next major; copy it into your application if you rely on it.
|
|
7
12
|
*/
|
|
8
13
|
export declare function withRetry<T>(fetchFn: () => Promise<T>, maxRetries?: number, retryDelay?: number): Promise<T>;
|
|
9
14
|
//# sourceMappingURL=with-retry.d.ts.map
|