@salesforce/platform-sdk 12.8.0 → 12.9.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/dist/analytics/analytics.d.ts +19 -15
- package/dist/analytics/analytics.d.ts.map +1 -1
- package/dist/analytics/error-listener.d.ts +3 -3
- package/dist/analytics/index.d.ts.map +1 -1
- package/dist/analytics/index.js +1 -1
- package/dist/analytics/method-configs.d.ts +8 -4
- package/dist/analytics/method-configs.d.ts.map +1 -1
- package/dist/analytics/pft.d.ts +22 -16
- package/dist/analytics/pft.d.ts.map +1 -1
- package/dist/analytics/proxy.d.ts +10 -8
- package/dist/analytics/proxy.d.ts.map +1 -1
- package/dist/analytics/types.d.ts +57 -43
- package/dist/analytics/types.d.ts.map +1 -1
- package/dist/{analytics-Dpz22kda.js → analytics-wESbWdca.js} +1 -1
- package/dist/app/index.d.ts +18 -13
- package/dist/app/index.d.ts.map +1 -1
- package/dist/app/index.js +5 -3
- package/dist/app/webapp.d.ts +5 -2
- package/dist/app/webapp.d.ts.map +1 -1
- package/dist/{capabilities-CKe8z6kZ.js → capabilities-B0mU0_G0.js} +1 -1
- package/dist/chat/index.js +1 -1
- package/dist/core/app.d.ts +31 -22
- package/dist/core/app.d.ts.map +1 -1
- package/dist/core/capabilities.d.ts +26 -17
- package/dist/core/capabilities.d.ts.map +1 -1
- package/dist/core/chat.d.ts +155 -125
- package/dist/core/chat.d.ts.map +1 -1
- package/dist/core/data.d.ts +146 -107
- package/dist/core/data.d.ts.map +1 -1
- package/dist/core/extension-attach.d.ts +65 -51
- package/dist/core/extension-attach.d.ts.map +1 -1
- package/dist/core/extension-types.d.ts +214 -153
- package/dist/core/extension-types.d.ts.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -2
- package/dist/core/lightning.d.ts +11 -19
- package/dist/core/lightning.d.ts.map +1 -1
- package/dist/core/mcpapps-session.d.ts +63 -52
- package/dist/core/mcpapps-session.d.ts.map +1 -1
- package/dist/core/options.d.ts +6 -4
- package/dist/core/options.d.ts.map +1 -1
- package/dist/core/platforms.d.ts +29 -29
- package/dist/core/sdk-promise.d.ts +7 -4
- package/dist/core/sdk-promise.d.ts.map +1 -1
- package/dist/core/surface.d.ts +89 -67
- package/dist/core/surface.d.ts.map +1 -1
- package/dist/core/view.d.ts +164 -113
- package/dist/core/view.d.ts.map +1 -1
- package/dist/data/extensions/index.d.ts +5 -2
- package/dist/data/extensions/index.d.ts.map +1 -1
- package/dist/data/extensions/labels/index.d.ts +72 -49
- package/dist/data/extensions/labels/index.d.ts.map +1 -1
- package/dist/data/extensions/labels/query.d.ts +38 -29
- package/dist/data/extensions/labels/query.d.ts.map +1 -1
- package/dist/data/gql.d.ts +8 -4
- package/dist/data/gql.d.ts.map +1 -1
- package/dist/data/index.d.ts +67 -48
- package/dist/data/index.d.ts.map +1 -1
- package/dist/data/index.js +265 -242
- package/dist/data/mosaic/fetch.d.ts +24 -15
- package/dist/data/mosaic/fetch.d.ts.map +1 -1
- package/dist/data/mosaic/index.d.ts +13 -9
- package/dist/data/mosaic/index.d.ts.map +1 -1
- package/dist/data/openai/index.d.ts +11 -5
- package/dist/data/openai/index.d.ts.map +1 -1
- package/dist/data/shared/graphql/cache/command.d.ts +60 -46
- package/dist/data/shared/graphql/cache/command.d.ts.map +1 -1
- package/dist/data/shared/graphql/cache/invoker.d.ts.map +1 -1
- package/dist/data/shared/graphql/cache/services.d.ts +21 -11
- package/dist/data/shared/graphql/cache/services.d.ts.map +1 -1
- package/dist/data/shared/graphql/cached-graphql.d.ts +9 -4
- package/dist/data/shared/graphql/cached-graphql.d.ts.map +1 -1
- package/dist/data/shared/graphql/graphql-parse.d.ts +6 -3
- package/dist/data/shared/graphql/graphql-parse.d.ts.map +1 -1
- package/dist/data/shared/graphql/headers.d.ts +34 -27
- package/dist/data/shared/graphql/headers.d.ts.map +1 -1
- package/dist/data/shared/graphql/parse-response.d.ts +31 -23
- package/dist/data/shared/graphql/parse-response.d.ts.map +1 -1
- package/dist/data/shared/graphql/uncached-graphql.d.ts +10 -6
- package/dist/data/shared/graphql/uncached-graphql.d.ts.map +1 -1
- package/dist/data/shared/url-utils.d.ts +1 -1
- package/dist/data/shared/url-utils.d.ts.map +1 -1
- package/dist/data/webapp/accept-language.interceptor.d.ts +26 -9
- package/dist/data/webapp/accept-language.interceptor.d.ts.map +1 -1
- package/dist/data/webapp/client-headers.interceptor.d.ts +4 -3
- package/dist/data/webapp/client-headers.interceptor.d.ts.map +1 -1
- package/dist/data/webapp/csrf/header.interceptor.d.ts +4 -4
- package/dist/data/webapp/csrf/header.interceptor.d.ts.map +1 -1
- package/dist/data/webapp/csrf/retry.policy.d.ts +12 -11
- package/dist/data/webapp/csrf/retry.policy.d.ts.map +1 -1
- package/dist/data/webapp/csrf/token-manager.d.ts +18 -12
- package/dist/data/webapp/csrf/token-manager.d.ts.map +1 -1
- package/dist/data/webapp/fetch.d.ts +12 -8
- package/dist/data/webapp/fetch.d.ts.map +1 -1
- package/dist/data/webapp/index.d.ts +12 -7
- package/dist/data/webapp/index.d.ts.map +1 -1
- package/dist/i18n/locale-format.d.ts +23 -21
- package/dist/i18n/locale-format.d.ts.map +1 -1
- package/dist/i18n/salesforce-backend.d.ts +19 -11
- package/dist/i18n/salesforce-backend.d.ts.map +1 -1
- package/dist/i18n/salesforce-detector.d.ts +22 -14
- package/dist/i18n/salesforce-detector.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/lightning/embedding.d.ts.map +1 -1
- package/dist/lightning/index.d.ts +4 -4
- package/dist/lightning/index.d.ts.map +1 -1
- package/dist/lightning/index.js +2 -2
- package/dist/{surface-Dd2tqrPi.js → surface-DWDgqdpN.js} +18 -13
- package/dist/telemetry/tool-adapter.d.ts.map +1 -1
- package/dist/telemetry/uploader/TelemetryUploader.d.ts.map +1 -1
- package/dist/ui-embedding/index.d.ts.map +1 -1
- package/dist/ui-embedding/session.d.ts +7 -2
- package/dist/ui-embedding/session.d.ts.map +1 -1
- package/dist/ui-embedding/session.js +1 -1
- package/dist/view/index.js +1 -1
- package/package.json +2 -2
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { LabelFallback, LabelResolution } from './query';
|
|
2
2
|
export type { LabelFallback, LabelResolution } from './query';
|
|
3
3
|
/**
|
|
4
|
-
* Where labels are read from and how they resolve.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* Where labels are read from, and how they resolve.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Supply these options once when you configure the extension
|
|
8
|
+
* (`labels({ namespace: "MyApp" })`) to set the defaults, and again per call
|
|
9
|
+
* ({@link LabelsApi.get} or {@link LabelsApi.getAll}) to override them for that
|
|
10
|
+
* call. Each field resolves on its own as `call ?? config ?? built-in default`.
|
|
9
11
|
*/
|
|
10
12
|
export interface LabelsOptions {
|
|
11
13
|
/**
|
|
@@ -17,81 +19,102 @@ export interface LabelsOptions {
|
|
|
17
19
|
*/
|
|
18
20
|
namespace?: string;
|
|
19
21
|
/**
|
|
20
|
-
*
|
|
21
|
-
* to let the server resolve the
|
|
22
|
-
* empty per-call value defers to the configured locale, exactly as
|
|
23
|
-
* it does.
|
|
22
|
+
* The target locale, for example `"fr"` or `"en-US"`. Omit it — or pass an
|
|
23
|
+
* empty string — to let the server resolve the current user's locale (the
|
|
24
|
+
* default). An empty per-call value defers to the configured locale, exactly as
|
|
25
|
+
* omitting it does.
|
|
24
26
|
*/
|
|
25
27
|
locale?: string;
|
|
26
28
|
/**
|
|
27
29
|
* How the server resolves a label with no translation for {@link locale}.
|
|
28
|
-
* Defaults to `"BASE_VALUE"` (the org-default value).
|
|
30
|
+
* Defaults to `"BASE_VALUE"` (the org-default value).
|
|
31
|
+
*
|
|
32
|
+
* @see {@link LabelFallback}
|
|
29
33
|
*/
|
|
30
34
|
fallback?: LabelFallback;
|
|
31
35
|
}
|
|
32
36
|
/**
|
|
33
37
|
* The `labels` namespace mounted in the DataSDK's `ext` container — `sdk.ext.labels`.
|
|
34
|
-
* Its methods read labels with configured or per-call options. A missing label
|
|
35
|
-
* returns `undefined` from {@link get}/{@link resolve}. It has no key in the
|
|
36
|
-
* maps from {@link getAll}/{@link resolveAll}.
|
|
37
38
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* The methods read labels with configured or per-call options. A missing label
|
|
41
|
+
* reads as a miss. {@link get} and {@link resolve} return `undefined`.
|
|
42
|
+
* {@link getAll} and {@link resolveAll} omit the key from their maps.
|
|
43
|
+
*
|
|
44
|
+
* The methods are optional. This mirrors the {@link DataSDK.graphql} namespace the
|
|
45
|
+
* methods depend on. A surface whose DataSDK has no `graphql` cannot fetch labels,
|
|
46
|
+
* so `get`, `getAll`, `resolve`, and `resolveAll` are absent there. Feature-detect
|
|
47
|
+
* them with optional chaining, or check that the method exists first.
|
|
42
48
|
*/
|
|
43
49
|
export interface LabelsApi {
|
|
44
50
|
/**
|
|
45
|
-
*
|
|
46
|
-
* not resolve it. Absent when the surface's DataSDK has no `graphql`.
|
|
51
|
+
* Resolves a single label.
|
|
47
52
|
*
|
|
48
|
-
* @
|
|
49
|
-
*
|
|
53
|
+
* @remarks
|
|
54
|
+
* Returns the label's value, or `undefined` when the server does not resolve
|
|
55
|
+
* it. This method is absent when the surface's DataSDK has no `graphql`.
|
|
56
|
+
*
|
|
57
|
+
* @param name - The label's developer name.
|
|
58
|
+
* @param options - The per-call overrides of the configured {@link LabelsOptions}.
|
|
50
59
|
*/
|
|
51
60
|
get?(name: string, options?: LabelsOptions): Promise<string | undefined>;
|
|
52
61
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* `graphql`.
|
|
62
|
+
* Resolves many labels in one batched load.
|
|
63
|
+
*
|
|
64
|
+
* @remarks
|
|
65
|
+
* This method is absent when the surface's DataSDK has no `graphql`.
|
|
58
66
|
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* per-call cap
|
|
62
|
-
*
|
|
63
|
-
*
|
|
67
|
+
* It is intended for a bounded label set, such as an app's manifest — dozens to
|
|
68
|
+
* a few hundred names. The method deduplicates the names and splits them into
|
|
69
|
+
* batches of 100, the server's per-call cap, and fetches the batches
|
|
70
|
+
* concurrently. A very large input therefore issues a proportional number of
|
|
71
|
+
* simultaneous requests. Batch, cache, or throttle the input yourself if you
|
|
72
|
+
* expect to resolve thousands of names at once.
|
|
64
73
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
74
|
+
* Returns a map keyed only by the names the server resolved. A name that did
|
|
75
|
+
* not resolve is absent from the map, symmetric with {@link get} returning
|
|
76
|
+
* `undefined`, so `Object.keys` reflects exactly what the server supplied.
|
|
77
|
+
*
|
|
78
|
+
* @param names - The label names to resolve. The method deduplicates and
|
|
79
|
+
* batches them internally, so the order and any duplicates in the input do
|
|
80
|
+
* not matter.
|
|
81
|
+
* @param options - The per-call overrides of the configured {@link LabelsOptions}.
|
|
68
82
|
*/
|
|
69
83
|
getAll?(names: readonly string[], options?: LabelsOptions): Promise<Record<string, string>>;
|
|
70
84
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
85
|
+
* Reads one label with its server locale and fallback result.
|
|
86
|
+
*
|
|
87
|
+
* @remarks
|
|
88
|
+
* Returns `undefined` for a missing label. `resolvedLocale` is `null` when the
|
|
89
|
+
* server has no locale for the base label. This method is absent when the
|
|
90
|
+
* DataSDK has no `graphql`.
|
|
74
91
|
*/
|
|
75
92
|
resolve?(name: string, options?: LabelsOptions): Promise<LabelResolution | undefined>;
|
|
76
93
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
94
|
+
* Reads many labels with their server locale and fallback results.
|
|
95
|
+
*
|
|
96
|
+
* @remarks
|
|
97
|
+
* The result map holds only resolved names. The method deduplicates the names
|
|
98
|
+
* and runs batches of 100 in parallel, so a large input can start many requests
|
|
99
|
+
* at once. `resolvedLocale` can be `null`. This method is absent when the
|
|
100
|
+
* DataSDK has no `graphql`.
|
|
81
101
|
*/
|
|
82
102
|
resolveAll?(names: readonly string[], options?: LabelsOptions): Promise<Record<string, LabelResolution>>;
|
|
83
103
|
}
|
|
84
104
|
/**
|
|
85
|
-
*
|
|
86
|
-
* custom labels.
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
105
|
+
* Creates a first-party DataSDK extension that mounts a `labels` namespace for
|
|
106
|
+
* reading custom labels.
|
|
107
|
+
*
|
|
108
|
+
* @remarks
|
|
109
|
+
* Attach it with `createDataSDK({ extensions: [labels()] })`. Then call
|
|
110
|
+
* `sdk.ext.labels.get?.(name)` or `sdk.ext.labels.getAll?.(names)` for values, or
|
|
111
|
+
* `resolve` or `resolveAll` for resolution data. The methods are optional, and are
|
|
112
|
+
* absent when the DataSDK has no `graphql`.
|
|
90
113
|
*
|
|
91
|
-
*
|
|
92
|
-
* `uiapi.platform.labels` GraphQL shape this extension queries
|
|
114
|
+
* This extension requires Salesforce API v64.0 or later. Release 264 introduced
|
|
115
|
+
* the `uiapi.platform.labels` GraphQL shape that this extension queries.
|
|
93
116
|
*
|
|
94
|
-
* @param config -
|
|
117
|
+
* @param config - The default {@link LabelsOptions} for every call. Each field is
|
|
95
118
|
* overridable per call. Omit `namespace` (here and per call) to read from the
|
|
96
119
|
* server's default namespace, `"c"`.
|
|
97
120
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/data/extensions/labels/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAEN,KAAK,aAAa,EAClB,KAAK,eAAe,EAGpB,MAAM,SAAS,CAAC;AAGjB,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE9D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EhD"}
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
import { DataSDK } from '../../../core';
|
|
2
2
|
/**
|
|
3
3
|
* How the server resolves a label with no translation for the requested locale.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* `BASE_VALUE` returns the org-default (base) value directly. `USER_DEFAULT`
|
|
7
|
+
* falls back to the current user's language first, then the base value. `NONE`
|
|
8
|
+
* does not fall back: a label with no translation for the locale comes back as a
|
|
9
|
+
* null slot, and {@link queryBatch} classifies its indexed error as a miss, not a
|
|
10
|
+
* failure. So the name surfaces as absent, not as a fallback value.
|
|
9
11
|
*/
|
|
10
12
|
export type LabelFallback = "BASE_VALUE" | "USER_DEFAULT" | "NONE";
|
|
11
13
|
/**
|
|
12
|
-
*
|
|
13
|
-
* requested locale, instead of the
|
|
14
|
-
* `USER_DEFAULT` behavior). The extension resolves an explicit target locale, so
|
|
15
|
-
* opts into `BASE_VALUE`.
|
|
14
|
+
* Returns the org-default (base) value when a label has no translation for the
|
|
15
|
+
* requested locale, instead of the current user's language (the server's
|
|
16
|
+
* `USER_DEFAULT` behavior). The extension resolves an explicit target locale, so
|
|
17
|
+
* it opts into `BASE_VALUE`.
|
|
16
18
|
*/
|
|
17
19
|
export declare const DEFAULT_LABEL_FALLBACK: LabelFallback;
|
|
18
20
|
/**
|
|
19
|
-
* A resolved label value
|
|
20
|
-
*
|
|
21
|
+
* A resolved label value with its server resolution data.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* The result omits unknown labels and labels with no translation under
|
|
25
|
+
* `fallback: "NONE"`.
|
|
21
26
|
*/
|
|
22
27
|
export interface LabelResolution {
|
|
23
28
|
value: string;
|
|
@@ -31,31 +36,35 @@ export interface LabelResolution {
|
|
|
31
36
|
/** The DataSDK `graphql` namespace with its optionality removed. */
|
|
32
37
|
type GraphQL = NonNullable<DataSDK["graphql"]>;
|
|
33
38
|
/**
|
|
34
|
-
*
|
|
39
|
+
* Resolves `names` in `namespace` to their label values.
|
|
35
40
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* This function deduplicates the names and batches them into `labels()` calls of
|
|
43
|
+
* at most 100 names (the server cap), then fans the batches out in parallel. The
|
|
44
|
+
* batches cover disjoint names, so `Promise.all` is safe. The load stays
|
|
45
|
+
* all-or-nothing: a single failed batch rejects the whole load ({@link queryBatch}
|
|
46
|
+
* throws on any non-miss GraphQL error), rather than returning a partial map that
|
|
47
|
+
* hides the failure.
|
|
41
48
|
*
|
|
42
|
-
*
|
|
43
|
-
* translation when `fallback` is `NONE
|
|
44
|
-
* error already classified as a miss by {@link queryBatch}
|
|
45
|
-
* the map
|
|
49
|
+
* The result is a map keyed by the requested name. A miss is an unknown name, or
|
|
50
|
+
* no translation when `fallback` is `NONE`. A miss comes back as a null slot, with
|
|
51
|
+
* its indexed error already classified as a miss by {@link queryBatch}, and drops
|
|
52
|
+
* from the map. So the result holds only the names the server resolved.
|
|
46
53
|
*
|
|
47
|
-
* @param namespace -
|
|
48
|
-
* its default namespace (`"c"
|
|
49
|
-
* defaulted, so the variable is omitted when this is `undefined
|
|
50
|
-
* @param locale -
|
|
51
|
-
*
|
|
54
|
+
* @param namespace - The label namespace, or `undefined` to let the server apply
|
|
55
|
+
* its default namespace (`"c"`). The GraphQL `namespace` argument is nullable
|
|
56
|
+
* and defaulted, so the variable is omitted when this is `undefined`.
|
|
57
|
+
* @param locale - The target locale, or `undefined` to let the server resolve the
|
|
58
|
+
* current user's locale. The GraphQL `locale` argument is nullable.
|
|
52
59
|
*/
|
|
53
60
|
export declare function resolveLabels(graphql: GraphQL, namespace: string | undefined, names: readonly string[], locale: string | undefined, fallback: LabelFallback): Promise<Record<string, string>>;
|
|
54
61
|
/**
|
|
55
|
-
*
|
|
62
|
+
* Resolves names to values, locales, and fallback results.
|
|
56
63
|
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
64
|
+
* @remarks
|
|
65
|
+
* This function deduplicates the names and runs batches of at most 100 queries in
|
|
66
|
+
* parallel. One failed batch rejects the whole load. A missing name is absent from
|
|
67
|
+
* the result map.
|
|
59
68
|
*/
|
|
60
69
|
export declare function resolveLabelResolutions(graphql: GraphQL, namespace: string | undefined, names: readonly string[], locale: string | undefined, fallback: LabelFallback): Promise<Record<string, LabelResolution>>;
|
|
61
70
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/data/extensions/labels/query.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,eAAe,CAAC;AAE3D
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/data/extensions/labels/query.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,eAAe,CAAC;AAE3D;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,cAAc,GAAG,MAAM,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,aAA4B,CAAC;AA+ClE;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,WAAW,EAAE,OAAO,CAAC;CACrB;AA2GD,oEAAoE;AACpE,KAAK,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;AAgF/C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,aAAa,CAClC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,QAAQ,EAAE,aAAa,GACrB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA4BjC;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAC5C,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,QAAQ,EAAE,aAAa,GACrB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CA2B1C"}
|
package/dist/data/gql.d.ts
CHANGED
|
@@ -4,12 +4,16 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Assembles a GraphQL query or mutation string from a template literal.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* This is a pass-through template tag. It exists so IDE GraphQL integrations can highlight and
|
|
11
|
+
* validate the embedded query syntax. It performs no parsing — it only interpolates values and
|
|
12
|
+
* returns the assembled string.
|
|
10
13
|
*
|
|
11
14
|
* @param strings - The template string segments.
|
|
12
|
-
* @param values -
|
|
15
|
+
* @param values - The values to interpolate. Each is stringified and spliced between the
|
|
16
|
+
* segments.
|
|
13
17
|
* @returns The assembled GraphQL document string.
|
|
14
18
|
*
|
|
15
19
|
* @example
|
package/dist/data/gql.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gql.d.ts","sourceRoot":"","sources":["../../src/data/gql.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH
|
|
1
|
+
{"version":3,"file":"gql.d.ts","sourceRoot":"","sources":["../../src/data/gql.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,GAAG,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAM/E"}
|
package/dist/data/index.d.ts
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { DataSDK, ExtendedSDK, Extension, ExtensionsFor, LiteralName, SDKOptions, UniqueExtensionNames, ValidMountNames } from '../core';
|
|
2
2
|
import { MosaicDataSDKOptions } from './mosaic';
|
|
3
3
|
/**
|
|
4
|
-
* A callback the host invokes for a given HTTP status
|
|
5
|
-
*
|
|
4
|
+
* A callback that the host invokes for a given HTTP status — see
|
|
5
|
+
* {@link WebAppDataSDKOptions.onStatus}.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* The callback may be synchronous or asynchronous.
|
|
6
9
|
*
|
|
7
10
|
* @see docs/data/04-surfaces-and-guards.md
|
|
8
11
|
*/
|
|
9
12
|
export type StatusCallback = () => Promise<unknown> | void;
|
|
10
13
|
/**
|
|
11
|
-
* Options for the WebApp surface — the browser-hosted, cached surface.
|
|
12
|
-
*
|
|
14
|
+
* Options for the WebApp surface — the browser-hosted, cached surface.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* Pass these as `DataSDKOptions.webapp`.
|
|
13
18
|
*
|
|
14
19
|
* @see docs/data/04-surfaces-and-guards.md
|
|
15
20
|
*/
|
|
@@ -20,7 +25,7 @@ export interface WebAppDataSDKOptions {
|
|
|
20
25
|
*/
|
|
21
26
|
basePath?: string;
|
|
22
27
|
/**
|
|
23
|
-
*
|
|
28
|
+
* The callbacks for individual HTTP statuses, for example re-authentication on a 401.
|
|
24
29
|
* @example { 401: () => reauthenticate() }
|
|
25
30
|
*/
|
|
26
31
|
onStatus?: Partial<Record<number, StatusCallback>>;
|
|
@@ -32,52 +37,65 @@ export interface WebAppDataSDKOptions {
|
|
|
32
37
|
}
|
|
33
38
|
export type { MosaicDataSDKOptions };
|
|
34
39
|
/**
|
|
35
|
-
*
|
|
36
|
-
* pre-applied to `DataSDK`.
|
|
40
|
+
* An extension authored for the DataSDK surface: {@link Extension} with the base SDK
|
|
41
|
+
* pre-applied to `DataSDK`.
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* Author these with {@link defineDataExtension}.
|
|
37
45
|
*
|
|
38
46
|
* @see docs/data/06-extensions.md
|
|
39
47
|
*/
|
|
40
48
|
export interface DataSDKExtension<Name extends string = string, Api = unknown> extends Extension<DataSDK, Name, Api> {
|
|
41
49
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
50
|
+
* The lowest Salesforce API version this extension supports, in `major.minor` form — for
|
|
51
|
+
* example, `"64.0"`.
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
* Declare this when the extension depends on a Salesforce data shape or capability that a
|
|
55
|
+
* particular API version introduced.
|
|
45
56
|
*
|
|
46
57
|
* On versioned surfaces, `createDataSDK` compares this value with the resolved
|
|
47
|
-
* {@link DataSDK.apiVersion} before any extension setup runs. Tool-backed and
|
|
48
|
-
*
|
|
49
|
-
* attach behavior.
|
|
58
|
+
* {@link DataSDK.apiVersion} before any extension setup runs. Tool-backed and degraded
|
|
59
|
+
* surfaces expose no comparable version, so they retain their existing attach behavior.
|
|
50
60
|
*/
|
|
51
61
|
minApiVersion?: string;
|
|
52
62
|
}
|
|
53
63
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
64
|
+
* Marks an object as a DataSDK extension, without needing to annotate `setup`'s parameter.
|
|
65
|
+
*
|
|
66
|
+
* @remarks
|
|
67
|
+
* The base SDK is bound to `DataSDK` here, so `setup(sdk)` infers `sdk: DataSDK`. This is the
|
|
56
68
|
* recommended way to author DataSDK extensions.
|
|
57
69
|
*
|
|
58
|
-
* Because `DataSDK` is fixed here, an author can never forget the annotation
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
70
|
+
* Because `DataSDK` is fixed here, an author can never forget the annotation and silently get
|
|
71
|
+
* `Sdk = unknown`. That universally-attachable binding would let a DataSDK-only extension slip
|
|
72
|
+
* past the per-surface `ExtensionsFor` guard.
|
|
73
|
+
*
|
|
74
|
+
* The identity implementation is intentional. Its value is the contextual typing at the
|
|
75
|
+
* extension object definition, plus literal-name and Data-specific metadata validation, while
|
|
76
|
+
* `Name` and `Api` remain inferred.
|
|
64
77
|
*
|
|
65
78
|
* @see docs/data/06-extensions.md
|
|
66
79
|
*/
|
|
67
80
|
export declare function defineDataExtension<const Name extends string, Api>(extension: DataSDKExtension<LiteralName<Name>, Api>): DataSDKExtension<Name, Api>;
|
|
68
81
|
/**
|
|
69
|
-
* A DataSDK
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
82
|
+
* A DataSDK that carries an `ext` namespace with every API an ordered extension tuple
|
|
83
|
+
* contributes — for example, `sdk.ext.labels`.
|
|
84
|
+
*
|
|
85
|
+
* @remarks
|
|
86
|
+
* Entries may be bare extensions, or `{ extension, as }` aliases. Each entry mounts under its
|
|
87
|
+
* effective key inside `ext` — the alias, when present — so aliasing is reflected here for free.
|
|
88
|
+
* An extension-less tuple resolves to a plain {@link DataSDK} with no `ext` key.
|
|
74
89
|
*
|
|
75
90
|
* @see docs/data/06-extensions.md
|
|
76
91
|
*/
|
|
77
92
|
export type DataSDKWithExtensions<Extensions extends ExtensionsFor<DataSDK>> = ExtendedSDK<DataSDK, Extensions>;
|
|
78
93
|
/**
|
|
79
|
-
* Options for creating a DataSDK instance
|
|
80
|
-
*
|
|
94
|
+
* Options for creating a DataSDK instance.
|
|
95
|
+
*
|
|
96
|
+
* @remarks
|
|
97
|
+
* These options cover surface selection, the per-surface option bags (`webapp`, `mosaic`), and
|
|
98
|
+
* any `extensions`.
|
|
81
99
|
*
|
|
82
100
|
* @see docs/data/04-surfaces-and-guards.md
|
|
83
101
|
*/
|
|
@@ -93,38 +111,39 @@ export interface DataSDKOptions extends SDKOptions {
|
|
|
93
111
|
*/
|
|
94
112
|
mosaic?: MosaicDataSDKOptions;
|
|
95
113
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
114
|
+
* The extensions to attach.
|
|
115
|
+
*
|
|
116
|
+
* @remarks
|
|
117
|
+
* Each entry is a bare {@link DataSDKExtension}, which mounts under its own `name`, or a
|
|
118
|
+
* `{ extension, as }` alias, which mounts under `as`. Each one lands inside the SDK's `ext`
|
|
119
|
+
* namespace — `sdk.ext.<name>`. Aliasing is the recourse when two extensions want the same
|
|
120
|
+
* key — for example, two third-party labels extensions that the consumer cannot edit.
|
|
101
121
|
*
|
|
102
122
|
* Pass the array inline to keep `sdk.ext.<name>` typed. A pre-bound
|
|
103
|
-
* `const extensions: DataSDKExtension[] = […]` widens the tuple away, so the
|
|
104
|
-
*
|
|
105
|
-
* to the array to recover it.
|
|
123
|
+
* `const extensions: DataSDKExtension[] = […]` widens the tuple away, so the result narrows
|
|
124
|
+
* to a plain {@link DataSDK} with no typed `ext`. Add `as const` to the array to recover it.
|
|
106
125
|
*/
|
|
107
126
|
extensions?: ExtensionsFor<DataSDK>;
|
|
108
127
|
}
|
|
109
128
|
/**
|
|
110
|
-
*
|
|
129
|
+
* Creates and initializes a DataSDK instance based on the detected surface.
|
|
111
130
|
*
|
|
112
|
-
* @param options -
|
|
113
|
-
*
|
|
114
|
-
* @returns
|
|
131
|
+
* @param options - The configuration, including a surface override, web app options, and
|
|
132
|
+
* extensions to attach.
|
|
133
|
+
* @returns An initialized DataSDK, extended per extension.
|
|
115
134
|
*
|
|
116
135
|
* @remarks
|
|
117
|
-
* Each call creates a new instance
|
|
136
|
+
* Each call creates a new instance. The options apply to every call.
|
|
118
137
|
*
|
|
119
|
-
* When `extensions` is supplied, the result type accumulates each extension's
|
|
120
|
-
*
|
|
121
|
-
*
|
|
138
|
+
* When `extensions` is supplied, the result type accumulates each extension's namespace under
|
|
139
|
+
* its own key inside the SDK's `ext` container — `sdk.ext.<name>` (see
|
|
140
|
+
* {@link DataSDKWithExtensions}). Otherwise, the result is a plain {@link DataSDK}.
|
|
122
141
|
*
|
|
123
|
-
* If the surface is unusable
|
|
124
|
-
* the function resolves to a bare `{}` rather than rejecting, so the host still
|
|
125
|
-
* Feature-detect `sdk.graphql`
|
|
142
|
+
* If the surface is unusable — for example, an MCPApps handshake never succeeded, or detection
|
|
143
|
+
* throws — the function resolves to a bare `{}` rather than rejecting, so the host still
|
|
144
|
+
* renders. Feature-detect `sdk.graphql` or `sdk.fetch` before use.
|
|
126
145
|
*
|
|
127
|
-
* @throws {TypeError}
|
|
146
|
+
* @throws {TypeError} When the returned Promise is used without `await`.
|
|
128
147
|
*
|
|
129
148
|
* @example
|
|
130
149
|
* ```typescript
|
package/dist/data/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACX,OAAO,EACP,WAAW,EACX,SAAS,EACT,aAAa,EACb,WAAW,EACX,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAiB,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAKpE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACX,OAAO,EACP,WAAW,EACX,SAAS,EACT,aAAa,EACb,WAAW,EACX,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAiB,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAKpE;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AAE3D;;;;;;;GAOG;AACH,MAAM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