@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
|
@@ -4,108 +4,137 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
* time.
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* `
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* `
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
7
|
+
* An extension: a named namespace factory bound to a base SDK instance at
|
|
8
|
+
* attach time.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* This type is SDK-agnostic: `Sdk` is the base type that this extension's
|
|
12
|
+
* `setup` requires.
|
|
13
|
+
*
|
|
14
|
+
* The contract does not depend on any concrete SDK. Enforcement of a
|
|
15
|
+
* specific SDK happens at attach time, through {@link ExtensionsFor}: an
|
|
16
|
+
* extension is attachable to a base `B` only when `B` is assignable to
|
|
17
|
+
* `Sdk`. So authoring `setup(sdk: DataSDK)` type-checks the extension
|
|
18
|
+
* against `DataSDK` when it attaches through `createDataSDK`, even though
|
|
19
|
+
* `Extension` itself never imports `DataSDK`.
|
|
20
|
+
*
|
|
21
|
+
* Reserved — `Deps`, inert in WI-1: the trailing type parameter is the
|
|
22
|
+
* seam for WI-3 extension dependencies. It defaults to `[]` and appears
|
|
23
|
+
* only through `setup`'s parameter, as `Sdk & Accumulate<Deps>`. With the
|
|
24
|
+
* default empty tuple, `Accumulate<[]>` is `unknown`, and `Sdk & unknown`
|
|
25
|
+
* reduces to `Sdk`. So `setup` sees exactly the base SDK. A three-argument
|
|
26
|
+
* `Extension<Sdk, Name, Api>` (see {@link AnyExtension} and
|
|
27
|
+
* {@link ExtensionsFor}) stays unchanged, and no WI-1 extension's type
|
|
28
|
+
* shifts. There is no `deps` field yet, so `attach` has no dependency to
|
|
29
|
+
* honor or silently drop.
|
|
30
|
+
*
|
|
31
|
+
* Threading `Deps` through `setup`, rather than leaving it dangling, is
|
|
32
|
+
* deliberate: an unreferenced reserved type parameter is not free,
|
|
33
|
+
* because it trips `noUnusedLocals`. This makes the slot load-bearing
|
|
34
|
+
* while behaviorally a no-op. WI-3's add-back is then a pure superset:
|
|
35
|
+
* add a `deps?: Deps` field, populate the tuple, and the already-wired
|
|
36
|
+
* `setup` view lights up. The spike notes that the superset holds with
|
|
37
|
+
* or without this slot, so the project keeps it as an explicit intent
|
|
38
|
+
* marker, not a forward-compatibility necessity.
|
|
33
39
|
*/
|
|
34
40
|
export interface Extension<Sdk, Name extends string, Api, Deps extends readonly AnyExtension[] = []> {
|
|
35
|
-
/** The single namespace key this extension mounts under
|
|
41
|
+
/** The single namespace key this extension mounts under, for example `"labels"`. */
|
|
36
42
|
name: Name;
|
|
37
43
|
/**
|
|
38
|
-
*
|
|
39
|
-
* instance-bound base SDK. May be synchronous or async — return the API
|
|
40
|
-
* directly, or a promise of it (e.g. to `await` a dynamic import or a
|
|
41
|
-
* capability handshake). The resolved `Api` is what mounts under `name`.
|
|
44
|
+
* Builds the extension API.
|
|
42
45
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
+
* @remarks
|
|
47
|
+
* Runs at attach time with the fully-resolved, instance-bound base
|
|
48
|
+
* SDK. This function may be synchronous or asynchronous: return the
|
|
49
|
+
* API directly, or return a promise of it, for example to `await` a
|
|
50
|
+
* dynamic import or a capability handshake. The resolved `Api` is what
|
|
51
|
+
* mounts under `name`.
|
|
52
|
+
*
|
|
53
|
+
* `sdk` is `Sdk & Accumulate<Deps>`. With the reserved `Deps = []`,
|
|
54
|
+
* this is just `Sdk` today (see the `Deps` note above). WI-3 populates
|
|
55
|
+
* `Deps`, so an extension's declared dependencies' namespaces appear
|
|
56
|
+
* here.
|
|
46
57
|
*/
|
|
47
58
|
setup: (sdk: Sdk & Accumulate<Deps>) => Api | PromiseLike<Api>;
|
|
48
59
|
}
|
|
49
60
|
/**
|
|
50
|
-
* An extension entry after attachment has resolved its
|
|
51
|
-
*
|
|
52
|
-
*
|
|
61
|
+
* An extension entry after attachment has resolved its shape, whether
|
|
62
|
+
* bare or aliased.
|
|
63
|
+
*
|
|
64
|
+
* @remarks
|
|
65
|
+
* SDK-specific preflights and the attachment loop consume this same
|
|
66
|
+
* resolved representation, so entry discrimination and validation happen
|
|
67
|
+
* only once.
|
|
53
68
|
*/
|
|
54
69
|
export interface ResolvedExtensionEntry<Base> {
|
|
55
70
|
readonly extension: Extension<Base, string, unknown>;
|
|
56
71
|
readonly mountName: string;
|
|
57
72
|
readonly label: string;
|
|
58
73
|
}
|
|
59
|
-
/** True
|
|
74
|
+
/** True only when `T` is a union of two or more members. */
|
|
60
75
|
type IsUnion<T, U = T> = T extends unknown ? ([U] extends [T] ? false : true) : never;
|
|
61
76
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* `
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
77
|
+
* Rejects a `name` that is not a single string literal.
|
|
78
|
+
*
|
|
79
|
+
* @remarks
|
|
80
|
+
* A concrete literal, for example `"labels"`, passes through unchanged.
|
|
81
|
+
* Anything else collapses to `never`, so the authoring helpers error at
|
|
82
|
+
* definition time instead of silently losing key accumulation.
|
|
83
|
+
* Surface-specific authoring definers, such as `defineDataExtension`,
|
|
84
|
+
* apply this guard at definition time.
|
|
85
|
+
*
|
|
86
|
+
* This type rejects two shapes, because both would otherwise mount
|
|
87
|
+
* phantom keys:
|
|
88
|
+
* - a widened `string` (`string extends Name`) — there is no literal key to accumulate
|
|
89
|
+
* - a union literal, for example `"a" | "b"` from `name: cond ? "a" : "b"` —
|
|
90
|
+
* this survives the `string extends Name` check, but {@link Accumulate}
|
|
91
|
+
* distributes over the union and types both `a` and `b` as present,
|
|
92
|
+
* non-optional members. `attach` mounts only one, so the other stays
|
|
93
|
+
* typed as present, yet is `undefined` at runtime.
|
|
94
|
+
*
|
|
95
|
+
* Requiring a single literal is what keeps the accumulated key set sound.
|
|
76
96
|
*/
|
|
77
97
|
export type LiteralName<Name extends string> = string extends Name ? never : IsUnion<Name> extends true ? never : Name;
|
|
78
98
|
/**
|
|
79
|
-
* Any extension, for use in constraints.
|
|
80
|
-
*
|
|
81
|
-
*
|
|
99
|
+
* Any extension, for use in constraints.
|
|
100
|
+
*
|
|
101
|
+
* @remarks
|
|
102
|
+
* `never` in the contravariant `Sdk` slot makes every concrete
|
|
103
|
+
* `Extension<...>` assignable to this type. It is the top type over the
|
|
104
|
+
* SDK parameter.
|
|
82
105
|
*/
|
|
83
106
|
export type AnyExtension = Extension<never, string, unknown>;
|
|
84
107
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
108
|
+
* Rebinds an extension's mount point: attaches `extension` under `as`
|
|
109
|
+
* instead of its own `name`.
|
|
110
|
+
*
|
|
111
|
+
* @remarks
|
|
112
|
+
* This is the consumer's recourse for a collision they did not cause. Two
|
|
113
|
+
* uneditable third-party extensions that both mount `sdk.ext.labels` can
|
|
114
|
+
* each alias to a distinct key. Aliasing rebinds only the mount key,
|
|
115
|
+
* never the extension's identity. This is what keeps identity-based
|
|
116
|
+
* dependency resolution, a later WI, robust to aliasing.
|
|
117
|
+
*
|
|
118
|
+
* `As` is intentionally the raw alias literal, not `LiteralName<As>`.
|
|
119
|
+
* Pinning `LiteralName` here would collapse the constraint form
|
|
120
|
+
* `AliasedExtension<_, string>`, used in {@link ExtensionsFor}, to
|
|
121
|
+
* `as: never` and reject every alias. Instead, {@link ValidMountNames}
|
|
122
|
+
* applies the widened-or-union `as` guard at the call boundary, exactly
|
|
123
|
+
* as {@link UniqueExtensionNames} guards mount uniqueness there. The
|
|
124
|
+
* entry type stays permissive; the boundary validates it.
|
|
125
|
+
*
|
|
126
|
+
* The fields `name?: never` and `setup?: never` reject the mixed shape
|
|
127
|
+
* structurally, mirroring the runtime discriminator. An object that
|
|
128
|
+
* carries a bare extension's defining members and `{ extension, as }`
|
|
129
|
+
* satisfies both arms of {@link ExtensionEntry}. Without these guards,
|
|
130
|
+
* {@link MountName}, which tests the aliased arm first, would key it
|
|
131
|
+
* under `as`, while `attach` — which discriminates on `"setup" in entry`
|
|
132
|
+
* — mounts the bare extension under `name`. The `never` fields
|
|
133
|
+
* fail the aliased arm for such an object, so it matches only
|
|
134
|
+
* {@link Extension}, and both sides agree on `name`. Unlike the
|
|
135
|
+
* `LiteralName` case above, these are fixed, optional-never fields
|
|
136
|
+
* independent of `P` and `As`. So a real `{ extension, as }` entry, which
|
|
137
|
+
* omits them, leaves the `ExtensionsFor` constraint form intact.
|
|
109
138
|
*/
|
|
110
139
|
export interface AliasedExtension<P extends AnyExtension, As extends string> {
|
|
111
140
|
extension: P;
|
|
@@ -113,52 +142,67 @@ export interface AliasedExtension<P extends AnyExtension, As extends string> {
|
|
|
113
142
|
name?: never;
|
|
114
143
|
setup?: never;
|
|
115
144
|
}
|
|
116
|
-
/** Any aliased entry, for use in unions
|
|
145
|
+
/** Any aliased entry, for use in unions and constraints (see {@link AnyExtension}). */
|
|
117
146
|
type AnyAliasedExtension = AliasedExtension<AnyExtension, string>;
|
|
118
147
|
/**
|
|
119
|
-
* The `extensions: []` array constraint that enforces a concrete base SDK.
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
* `
|
|
125
|
-
*
|
|
148
|
+
* The `extensions: []` array constraint that enforces a concrete base SDK.
|
|
149
|
+
*
|
|
150
|
+
* @remarks
|
|
151
|
+
* A bare `Extension<Sdk, Name, Api>`, or an {@link AliasedExtension}
|
|
152
|
+
* wrapping one, is a member only when a `Base` value is assignable to the
|
|
153
|
+
* inner extension's `setup` parameter. In other words, the extension asks
|
|
154
|
+
* for no more than `Base` provides. An extension that ignores the SDK,
|
|
155
|
+
* with `Sdk = unknown`, is universally attachable. `createDataSDK` binds
|
|
156
|
+
* `Base = DataSDK`. That is where `DataSDK`-specific enforcement occurs.
|
|
126
157
|
*/
|
|
127
158
|
export type ExtensionsFor<Base> = readonly (Extension<Base, string, unknown> | AliasedExtension<Extension<Base, string, unknown>, string>)[];
|
|
128
159
|
/**
|
|
129
|
-
* What may appear in the `extensions: []` array: a bare extension, or a
|
|
130
|
-
* wrapped with an `{ as }` alias.
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
160
|
+
* What may appear in the `extensions: []` array: a bare extension, or a
|
|
161
|
+
* bare extension wrapped with an `{ as }` alias.
|
|
162
|
+
*
|
|
163
|
+
* @remarks
|
|
164
|
+
* Everything downstream — {@link Accumulate}, {@link DuplicateMountName},
|
|
165
|
+
* and {@link ExtendedSDK} — is written against `ExtensionEntry` and
|
|
166
|
+
* routes through {@link ExtensionOf} and {@link MountName}. So the
|
|
167
|
+
* bare-versus-aliased distinction resolves in exactly those two helpers,
|
|
168
|
+
* and nowhere else.
|
|
135
169
|
*/
|
|
136
170
|
export type ExtensionEntry = AnyExtension | AnyAliasedExtension;
|
|
137
171
|
/** The underlying extension of an entry, whether it was passed bare or aliased. */
|
|
138
172
|
type ExtensionOf<E extends ExtensionEntry> = E extends AnyAliasedExtension ? E["extension"] : E;
|
|
139
173
|
/**
|
|
140
|
-
* The literal key an entry mounts under: its alias `as` when aliased,
|
|
141
|
-
* extension's own `name`.
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
174
|
+
* The literal key an entry mounts under: its alias `as` when aliased,
|
|
175
|
+
* otherwise the extension's own `name`.
|
|
176
|
+
*
|
|
177
|
+
* @remarks
|
|
178
|
+
* This is the single place where the effective mount key is computed. All
|
|
179
|
+
* mount-name-keyed logic, such as {@link Accumulate} and
|
|
180
|
+
* {@link DuplicateMountName}, routes through it, so aliasing stays
|
|
181
|
+
* transparent to them. For example, `[a, a]`, which both mount `"labels"`,
|
|
182
|
+
* collides. But `[{ extension: a, as: "x" }, { extension: a, as: "y" }]`
|
|
183
|
+
* resolves to distinct keys and does not collide.
|
|
146
184
|
*/
|
|
147
185
|
type MountName<E extends ExtensionEntry> = E extends AnyAliasedExtension ? E["as"] : ExtensionOf<E>["name"];
|
|
148
186
|
/**
|
|
149
|
-
* The resolved API an entry's extension `setup` returns.
|
|
150
|
-
*
|
|
187
|
+
* The resolved API that an entry's extension `setup` returns.
|
|
188
|
+
*
|
|
189
|
+
* @remarks
|
|
190
|
+
* `Awaited` unwraps the asynchronous case, so the mounted namespace is
|
|
191
|
+
* the settled value, never a promise.
|
|
151
192
|
*/
|
|
152
193
|
type ApiOf<E extends ExtensionEntry> = Awaited<ReturnType<ExtensionOf<E>["setup"]>>;
|
|
153
194
|
/**
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
195
|
+
* Walks the extension tuple left to right, intersecting
|
|
196
|
+
* `{ [name]: namespace }` for each entry.
|
|
197
|
+
*
|
|
198
|
+
* @remarks
|
|
199
|
+
* Namespaces are non-optional, because presence is a static attach fact.
|
|
200
|
+
*
|
|
201
|
+
* This type intersects unconditionally: a duplicate mount name collapses
|
|
202
|
+
* to `{ labels: A } & { labels: B }` here, rather than raising an error.
|
|
203
|
+
* Enforcing uniqueness is not this type's job. {@link UniqueExtensionNames}
|
|
204
|
+
* enforces it up front, at the authoring boundary, and `attach`'s runtime
|
|
205
|
+
* guard backstops tuples that are built dynamically past the static check.
|
|
162
206
|
*/
|
|
163
207
|
type Accumulate<Extensions extends readonly ExtensionEntry[]> = Extensions extends readonly [
|
|
164
208
|
infer Head extends ExtensionEntry,
|
|
@@ -167,27 +211,36 @@ type Accumulate<Extensions extends readonly ExtensionEntry[]> = Extensions exten
|
|
|
167
211
|
[K in MountName<Head>]: ApiOf<Head>;
|
|
168
212
|
} & Accumulate<Tail> : unknown;
|
|
169
213
|
/**
|
|
170
|
-
* The first mount name that repeats in the tuple, or `never`
|
|
171
|
-
* distinct.
|
|
172
|
-
*
|
|
173
|
-
*
|
|
214
|
+
* The first mount name that repeats in the tuple, or `never` when all
|
|
215
|
+
* are distinct.
|
|
216
|
+
*
|
|
217
|
+
* @remarks
|
|
218
|
+
* This type walks the tuple left to right, accumulating seen names in
|
|
219
|
+
* `Seen`. The first {@link MountName} already in `Seen` is the
|
|
220
|
+
* duplicate. It keys on {@link MountName}, so aliasing a clash apart is
|
|
221
|
+
* a valid way to resolve it (see {@link AliasedExtension}).
|
|
174
222
|
*/
|
|
175
223
|
type DuplicateMountName<Extensions extends readonly ExtensionEntry[], Seen = never> = Extensions extends readonly [
|
|
176
224
|
infer Head extends ExtensionEntry,
|
|
177
225
|
...infer Tail extends readonly ExtensionEntry[]
|
|
178
226
|
] ? [MountName<Head>] extends [Seen] ? MountName<Head> : DuplicateMountName<Tail, Seen | MountName<Head>> : never;
|
|
179
227
|
/**
|
|
180
|
-
* A constraint intersected into the `extensions` option to reject a
|
|
181
|
-
* mount names are not unique.
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
228
|
+
* A constraint intersected into the `extensions` option to reject a
|
|
229
|
+
* tuple whose mount names are not unique.
|
|
230
|
+
*
|
|
231
|
+
* @remarks
|
|
232
|
+
* This type resolves to `unknown`, a no-op intersection, when every
|
|
233
|
+
* mount name is distinct. Otherwise it resolves to an object whose
|
|
234
|
+
* `extensions` field is a human-readable error string, which makes the
|
|
235
|
+
* supplied array inassignable and surfaces the message in the
|
|
236
|
+
* diagnostic.
|
|
237
|
+
*
|
|
238
|
+
* This moves the collision from a runtime throw, an `attach` fail-loud
|
|
239
|
+
* check, to a compile error at the call site. The two checks are
|
|
240
|
+
* complementary, not redundant. This one catches statically-known
|
|
241
|
+
* tuples early with a clear message, while `attach` still guards tuples
|
|
242
|
+
* assembled dynamically, for example `[...a, ...b]`, whose duplicates a
|
|
243
|
+
* static check cannot see.
|
|
191
244
|
*/
|
|
192
245
|
export type UniqueExtensionNames<Extensions extends readonly ExtensionEntry[]> = [
|
|
193
246
|
DuplicateMountName<Extensions>
|
|
@@ -195,14 +248,17 @@ export type UniqueExtensionNames<Extensions extends readonly ExtensionEntry[]> =
|
|
|
195
248
|
extensions: `Two extensions mount under "${DuplicateMountName<Extensions> & string}"; mount names must be unique.`;
|
|
196
249
|
};
|
|
197
250
|
/**
|
|
198
|
-
* A constraint intersected into the `extensions` option to require
|
|
199
|
-
* effective mount name
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
251
|
+
* A constraint intersected into the `extensions` option to require
|
|
252
|
+
* every effective mount name to be one concrete string literal.
|
|
253
|
+
*
|
|
254
|
+
* @remarks
|
|
255
|
+
* An effective mount name is a bare extension's `name`, or an alias's
|
|
256
|
+
* `as`. A widened or union mount name would make {@link Accumulate}
|
|
257
|
+
* promise keys that the runtime may not mount. Applying the guard at
|
|
258
|
+
* the attachment interface backstops every authoring form, including
|
|
259
|
+
* objects that bypass a surface-specific definer. This type resolves to
|
|
260
|
+
* `unknown`, or to an inassignable `{ extensions }` error, exactly as
|
|
261
|
+
* {@link UniqueExtensionNames} does.
|
|
206
262
|
*/
|
|
207
263
|
export type ValidMountNames<Extensions extends readonly ExtensionEntry[]> = Extensions extends readonly [
|
|
208
264
|
infer Head extends ExtensionEntry,
|
|
@@ -212,31 +268,36 @@ export type ValidMountNames<Extensions extends readonly ExtensionEntry[]> = Exte
|
|
|
212
268
|
} : {
|
|
213
269
|
extensions: `An extension "name" must be a single string literal, not a widened or union type.`;
|
|
214
270
|
} : ValidMountNames<Tail> : unknown;
|
|
215
|
-
/**
|
|
271
|
+
/** Collapses an intersection into a single flat object type for readable hovers. */
|
|
216
272
|
type Flatten<T> = {
|
|
217
273
|
[K in keyof T]: T[K];
|
|
218
274
|
} & {};
|
|
219
275
|
/**
|
|
220
|
-
* The base SDK plus an `ext` namespace carrying every attached
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
276
|
+
* The base SDK plus an `ext` namespace carrying every attached
|
|
277
|
+
* extension's API.
|
|
278
|
+
*
|
|
279
|
+
* @remarks
|
|
280
|
+
* Extensions are compartmentalized under `ext`, for example
|
|
281
|
+
* `sdk.ext.labels`, rather than spliced onto the SDK root. This mirrors
|
|
282
|
+
* where {@link attachExtensions} mounts them. It also lets the SDK add
|
|
283
|
+
* members over time without a name-reservation registry: an extension
|
|
284
|
+
* *key* can never collide with a current or future root member,
|
|
285
|
+
* because it lives one level down. The single exception is `ext`
|
|
286
|
+
* itself. That one root key is now SDK-owned as the extension
|
|
287
|
+
* container, the same way `graphql` and `fetch` are SDK-owned. A base
|
|
288
|
+
* SDK surface must therefore not declare its own `ext` member.
|
|
289
|
+
* Extension-versus-extension uniqueness within `ext` is still enforced,
|
|
290
|
+
* statically by {@link UniqueExtensionNames} and at runtime by `attach`.
|
|
291
|
+
*
|
|
292
|
+
* Only a tuple known to be non-empty introduces `ext`, whose value is
|
|
293
|
+
* the left-to-right {@link Accumulate}d namespace map. Both other cases
|
|
294
|
+
* resolve to exactly `Base`, with no `ext` key: the empty tuple `[]`,
|
|
295
|
+
* and, deliberately, a widened, non-tuple extension array, for example
|
|
296
|
+
* `DataSDKExtension[]`, whose length TypeScript cannot see. The runtime
|
|
297
|
+
* returns the base untouched whenever the array is empty. So keying
|
|
298
|
+
* presence off "provably non-empty," rather than "provably empty,"
|
|
299
|
+
* keeps the type from promising an `ext` that the runtime may not
|
|
300
|
+
* create for a widened array that happens to be empty.
|
|
240
301
|
*/
|
|
241
302
|
export type ExtendedSDK<Base, Extensions extends readonly ExtensionEntry[]> = Extensions extends readonly [ExtensionEntry, ...ExtensionEntry[]] ? Flatten<Base & {
|
|
242
303
|
ext: Flatten<Accumulate<Extensions>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension-types.d.ts","sourceRoot":"","sources":["../../src/core/extension-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH
|
|
1
|
+
{"version":3,"file":"extension-types.d.ts","sourceRoot":"","sources":["../../src/core/extension-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,WAAW,SAAS,CACzB,GAAG,EACH,IAAI,SAAS,MAAM,EACnB,GAAG,EACH,IAAI,SAAS,SAAS,YAAY,EAAE,GAAG,EAAE;IAEzC,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,cAAc,EAAE,IACzC,UAAU,SAAS,SAAS,CAAC,cAAc,EAAE,GAAG,cAAc,EAAE,CAAC,GAClE,OAAO,CAAC,IAAI,GAAG;IAAE,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAA;CAAE,CAAC,GACxD,IAAI,CAAC"}
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACN,OAAO,EACP,kBAAkB,EAClB,UAAU,EACV,mBAAmB,EACnB,YAAY,GACZ,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAGnD,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAG5C,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGrD,YAAY,EACX,WAAW,EACX,UAAU,EACV,WAAW,EACX,OAAO,EACP,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,QAAQ,EACR,SAAS,GACT,MAAM,QAAQ,CAAC;AAGhB,YAAY,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,SAAS,EACT,OAAO,EACP,QAAQ,EACR,OAAO,GACP,MAAM,QAAQ,CAAC;AAGhB,YAAY,EACX,YAAY,EACZ,OAAO,EACP,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,cAAc,EACd,YAAY,EACZ,WAAW,EACX,eAAe,EACf,WAAW,GACX,MAAM,QAAQ,CAAC;AAGhB,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7F,YAAY,EAAE,SAA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Ae,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7F,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC7E,YAAY,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAGnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG1D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAS/C,YAAY,EACX,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,eAAe,GACf,MAAM,mBAAmB,CAAC"}
|
package/dist/core/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as r, a as s, S as i, g as p, i as f, b as o, r as t } from "../surface-
|
|
2
|
-
import { g as c } from "../capabilities-
|
|
1
|
+
import { M as r, a as s, S as i, g as p, i as f, b as o, r as t } from "../surface-DWDgqdpN.js";
|
|
2
|
+
import { g as c } from "../capabilities-B0mU0_G0.js";
|
|
3
3
|
import { w as g } from "../sdk-promise-D0sy7OW1.js";
|
|
4
4
|
export {
|
|
5
5
|
r as McpAppsNotAvailableError,
|
package/dist/core/lightning.d.ts
CHANGED
|
@@ -3,39 +3,31 @@
|
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
|
-
/**
|
|
7
|
-
* Lightning Message Service message payload
|
|
8
|
-
*/
|
|
6
|
+
/** The message payload for the Lightning Message Service. */
|
|
9
7
|
export type LMSMessage = Record<string, unknown>;
|
|
10
|
-
/**
|
|
11
|
-
* Lightning Message Service subscription
|
|
12
|
-
*/
|
|
8
|
+
/** A Lightning Message Service subscription. */
|
|
13
9
|
export interface LMSSubscription {
|
|
14
10
|
unsubscribe: () => void;
|
|
15
11
|
}
|
|
16
|
-
/**
|
|
17
|
-
* Lightning Message Service channel configuration
|
|
18
|
-
*/
|
|
12
|
+
/** The configuration for a Lightning Message Service channel. */
|
|
19
13
|
export interface MessageChannel {
|
|
20
14
|
channelName: string;
|
|
21
15
|
}
|
|
22
|
-
/**
|
|
23
|
-
* Lightning SDK interface for Lightning Web Component runtime integration
|
|
24
|
-
*/
|
|
16
|
+
/** The Lightning SDK for Lightning Web Component runtime integration. */
|
|
25
17
|
export interface LightningSDK {
|
|
26
18
|
/**
|
|
27
|
-
*
|
|
19
|
+
* Publishes a message to a Lightning Message Service channel.
|
|
28
20
|
*
|
|
29
|
-
* @param channel -
|
|
30
|
-
* @param message -
|
|
21
|
+
* @param channel - The channel configuration.
|
|
22
|
+
* @param message - The message payload to publish.
|
|
31
23
|
*/
|
|
32
24
|
publishLmsMessage?: <M extends LMSMessage>(channel: MessageChannel, message: M) => void;
|
|
33
25
|
/**
|
|
34
|
-
*
|
|
26
|
+
* Subscribes to a Lightning Message Service channel.
|
|
35
27
|
*
|
|
36
|
-
* @param channel -
|
|
37
|
-
* @param callback -
|
|
38
|
-
* @returns
|
|
28
|
+
* @param channel - The channel configuration.
|
|
29
|
+
* @param callback - The function that handles a received message.
|
|
30
|
+
* @returns The subscription, with an `unsubscribe` method.
|
|
39
31
|
*/
|
|
40
32
|
subscribeToLmsChannel?: <M extends LMSMessage>(channel: MessageChannel, callback: (message: M) => void) => LMSSubscription;
|
|
41
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lightning.d.ts","sourceRoot":"","sources":["../../src/core/lightning.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH
|
|
1
|
+
{"version":3,"file":"lightning.d.ts","sourceRoot":"","sources":["../../src/core/lightning.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,6DAA6D;AAC7D,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD,gDAAgD;AAChD,MAAM,WAAW,eAAe;IAC/B,WAAW,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,iEAAiE;AACjE,MAAM,WAAW,cAAc;IAC9B,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,yEAAyE;AACzE,MAAM,WAAW,YAAY;IAC5B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,CAAC,CAAC,SAAS,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,KAAK,IAAI,CAAC;IAExF;;;;;;OAMG;IACH,qBAAqB,CAAC,EAAE,CAAC,CAAC,SAAS,UAAU,EAC5C,OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,KAC1B,eAAe,CAAC;CACrB"}
|