@salesforce/platform-sdk 11.64.0 → 11.66.2
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/core/extension-attach.d.ts +56 -0
- package/dist/core/extension-attach.d.ts.map +1 -0
- package/dist/core/{plugin-factory.d.ts → extension-factory.d.ts} +16 -16
- package/dist/core/extension-factory.d.ts.map +1 -0
- package/dist/core/extension-types.d.ts +231 -0
- package/dist/core/extension-types.d.ts.map +1 -0
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +5 -5
- package/dist/data/extensions/index.d.ts +19 -0
- package/dist/data/extensions/index.d.ts.map +1 -0
- package/dist/data/{plugins → extensions}/index.js +12 -12
- package/dist/data/{plugins → extensions}/labels/index.d.ts +18 -18
- package/dist/data/extensions/labels/index.d.ts.map +1 -0
- package/dist/data/{plugins → extensions}/labels/query.d.ts +1 -1
- package/dist/data/extensions/labels/query.d.ts.map +1 -0
- package/dist/data/index.d.ts +35 -27
- package/dist/data/index.d.ts.map +1 -1
- package/dist/data/index.js +158 -153
- package/dist/data/shared/graphql/cache/services.d.ts +7 -7
- package/dist/data/shared/graphql/cache/services.d.ts.map +1 -1
- package/dist/data/webapp/index.d.ts.map +1 -1
- package/dist/{plugin-factory-BC3b3BOy.js → extension-factory-CJkfM4km.js} +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -21
- package/package.json +8 -8
- package/dist/core/plugin-attach.d.ts +0 -46
- package/dist/core/plugin-attach.d.ts.map +0 -1
- package/dist/core/plugin-factory.d.ts.map +0 -1
- package/dist/core/plugin-types.d.ts +0 -208
- package/dist/core/plugin-types.d.ts.map +0 -1
- package/dist/data/plugins/index.d.ts +0 -19
- package/dist/data/plugins/index.d.ts.map +0 -1
- package/dist/data/plugins/labels/index.d.ts.map +0 -1
- package/dist/data/plugins/labels/query.d.ts.map +0 -1
- package/dist/data/reserved.d.ts +0 -3
- package/dist/data/reserved.d.ts.map +0 -1
package/dist/data/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataSDK, ExtendedSDK,
|
|
1
|
+
import { DataSDK, ExtendedSDK, Extension, ExtensionsFor, SDKOptions, UniqueExtensionNames, ValidAliasNames } from '../core';
|
|
2
2
|
import { MosaicDataSDKOptions } from './mosaic';
|
|
3
3
|
/**
|
|
4
4
|
* A callback the host invokes for a given HTTP status (see {@link WebAppDataSDKOptions.onStatus}).
|
|
@@ -27,28 +27,30 @@ export interface WebAppDataSDKOptions {
|
|
|
27
27
|
}
|
|
28
28
|
export type { MosaicDataSDKOptions };
|
|
29
29
|
/**
|
|
30
|
-
* A
|
|
31
|
-
* pre-applied to `DataSDK`. Author these with {@link
|
|
30
|
+
* A extension authored for the DataSDK surface: {@link Extension} with the base SDK
|
|
31
|
+
* pre-applied to `DataSDK`. Author these with {@link defineDataExtension}.
|
|
32
32
|
*/
|
|
33
|
-
export type
|
|
33
|
+
export type DataSDKExtension<Name extends string = string, Api = unknown> = Extension<DataSDK, Name, Api>;
|
|
34
34
|
/**
|
|
35
|
-
* Author a DataSDK
|
|
35
|
+
* Author a DataSDK extension without annotating `setup`'s parameter — the base
|
|
36
36
|
* SDK is bound to `DataSDK`, so `setup(sdk)` infers `sdk: DataSDK`. This is the
|
|
37
|
-
* recommended way to author DataSDK
|
|
37
|
+
* recommended way to author DataSDK extensions.
|
|
38
38
|
*
|
|
39
39
|
* Because `DataSDK` is fixed here, an author can never forget the annotation
|
|
40
40
|
* and silently get `Sdk = unknown` — the universally-attachable binding that
|
|
41
|
-
* would slip a DataSDK-only
|
|
42
|
-
* Equivalent to the internal `
|
|
43
|
-
* see {@link
|
|
41
|
+
* would slip a DataSDK-only extension past the per-surface `ExtensionsFor` guard.
|
|
42
|
+
* Equivalent to the internal `defineExtension` with `Sdk = DataSDK` pre-applied;
|
|
43
|
+
* see {@link createExtensionFactory} for the underlying mechanism.
|
|
44
44
|
*/
|
|
45
|
-
export declare const
|
|
45
|
+
export declare const defineDataExtension: <const Name extends string, Api>(extension: Extension<DataSDK, import('..').LiteralName<Name>, Api, []>) => Extension<DataSDK, Name, Api, []>;
|
|
46
46
|
/**
|
|
47
|
-
* A DataSDK carrying
|
|
48
|
-
*
|
|
49
|
-
*
|
|
47
|
+
* A DataSDK carrying an `ext` namespace with every API contributed by an
|
|
48
|
+
* ordered extension tuple (e.g. `sdk.ext.labels`). Entries may be bare extensions or
|
|
49
|
+
* `{ extension, as }` aliases; each mounts under its effective key (the alias when
|
|
50
|
+
* present) inside `ext`, so aliasing is reflected here for free. A extension-less
|
|
51
|
+
* tuple resolves to a plain {@link DataSDK} with no `ext` key.
|
|
50
52
|
*/
|
|
51
|
-
export type
|
|
53
|
+
export type DataSDKWithExtensions<Extensions extends ExtensionsFor<DataSDK>> = ExtendedSDK<DataSDK, Extensions>;
|
|
52
54
|
/**
|
|
53
55
|
* Options for creating a DataSDK instance.
|
|
54
56
|
*/
|
|
@@ -64,26 +66,32 @@ export interface DataSDKOptions extends SDKOptions {
|
|
|
64
66
|
*/
|
|
65
67
|
mosaic?: MosaicDataSDKOptions;
|
|
66
68
|
/**
|
|
67
|
-
*
|
|
68
|
-
* its own `name`) or a `{
|
|
69
|
-
*
|
|
70
|
-
*
|
|
69
|
+
* Extensions to attach. Each entry is a bare {@link DataSDKExtension} (mounts under
|
|
70
|
+
* its own `name`) or a `{ extension, as }` alias (mounts under `as`), and each
|
|
71
|
+
* lands inside the SDK's `ext` namespace — `sdk.ext.<name>`. Aliasing is the
|
|
72
|
+
* recourse when two extensions want the same key — e.g. two third-party labels
|
|
73
|
+
* extensions the consumer can't edit.
|
|
74
|
+
*
|
|
75
|
+
* Pass the array inline to keep `sdk.ext.<name>` typed. A pre-bound
|
|
76
|
+
* `const extensions: DataSDKExtension[] = […]` widens the tuple away, so the
|
|
77
|
+
* result narrows to a plain {@link DataSDK} with no typed `ext`; add `as const`
|
|
78
|
+
* to the array to recover it.
|
|
71
79
|
*/
|
|
72
|
-
|
|
80
|
+
extensions?: ExtensionsFor<DataSDK>;
|
|
73
81
|
}
|
|
74
82
|
/**
|
|
75
83
|
* Create and initialize a DataSDK instance based on the detected surface.
|
|
76
84
|
*
|
|
77
85
|
* @param options - Optional configuration including surface override, web app
|
|
78
|
-
* options, and
|
|
79
|
-
* @returns Promise resolving to an initialized DataSDK, extended per
|
|
86
|
+
* options, and extensions to attach
|
|
87
|
+
* @returns Promise resolving to an initialized DataSDK, extended per extension
|
|
80
88
|
*
|
|
81
89
|
* @remarks
|
|
82
90
|
* Each call creates a new instance; options are applied to every call.
|
|
83
91
|
*
|
|
84
|
-
* When `
|
|
85
|
-
* namespace under its own key
|
|
86
|
-
* a plain {@link DataSDK}.
|
|
92
|
+
* When `extensions` is supplied, the result type accumulates each extension's
|
|
93
|
+
* namespace under its own key inside the SDK's `ext` container — `sdk.ext.<name>`
|
|
94
|
+
* (see {@link DataSDKWithExtensions}); otherwise it is a plain {@link DataSDK}.
|
|
87
95
|
*
|
|
88
96
|
* If the surface is unusable (e.g. MCPApps handshake never succeeded, or detection throws),
|
|
89
97
|
* the function resolves to a bare `{}` rather than rejecting, so the host still renders.
|
|
@@ -109,9 +117,9 @@ export interface DataSDKOptions extends SDKOptions {
|
|
|
109
117
|
* }
|
|
110
118
|
* ```
|
|
111
119
|
*/
|
|
112
|
-
export declare function createDataSDK<const
|
|
113
|
-
|
|
114
|
-
} &
|
|
120
|
+
export declare function createDataSDK<const Extensions extends ExtensionsFor<DataSDK> = []>(options?: Omit<DataSDKOptions, "extensions"> & {
|
|
121
|
+
extensions?: Extensions;
|
|
122
|
+
} & UniqueExtensionNames<Extensions> & ValidAliasNames<Extensions>): Promise<DataSDKWithExtensions<Extensions>>;
|
|
115
123
|
export { gql } from './gql';
|
|
116
124
|
export type { CacheControl, DataSDK, DataSDKGraphQL, GraphQLError, GraphQLRawDocument, GraphQLRequest, GraphQLRequestHeaders, GraphQLResponse, MutateOptions, MutationResult, QueryOptions, QueryResult, QuerySubscriber, SDKOptions, Unsubscribe, } from '../core';
|
|
117
125
|
/**
|
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,
|
|
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,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAiB,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAKpE;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;IACnD;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,YAAY,EAAE,oBAAoB,EAAE,CAAC;AAErC;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,EAAE,GAAG,GAAG,OAAO,IAAI,SAAS,CACpF,OAAO,EACP,IAAI,EACJ,GAAG,CACH,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,+IAAoC,CAAC;AAErE;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,CAAC,UAAU,SAAS,aAAa,CAAC,OAAO,CAAC,IAAI,WAAW,CACzF,OAAO,EACP,UAAU,CACV,CAAC;AA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