@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.
Files changed (38) hide show
  1. package/dist/core/extension-attach.d.ts +56 -0
  2. package/dist/core/extension-attach.d.ts.map +1 -0
  3. package/dist/core/{plugin-factory.d.ts → extension-factory.d.ts} +16 -16
  4. package/dist/core/extension-factory.d.ts.map +1 -0
  5. package/dist/core/extension-types.d.ts +231 -0
  6. package/dist/core/extension-types.d.ts.map +1 -0
  7. package/dist/core/index.d.ts +2 -2
  8. package/dist/core/index.d.ts.map +1 -1
  9. package/dist/core/index.js +5 -5
  10. package/dist/data/extensions/index.d.ts +19 -0
  11. package/dist/data/extensions/index.d.ts.map +1 -0
  12. package/dist/data/{plugins → extensions}/index.js +12 -12
  13. package/dist/data/{plugins → extensions}/labels/index.d.ts +18 -18
  14. package/dist/data/extensions/labels/index.d.ts.map +1 -0
  15. package/dist/data/{plugins → extensions}/labels/query.d.ts +1 -1
  16. package/dist/data/extensions/labels/query.d.ts.map +1 -0
  17. package/dist/data/index.d.ts +35 -27
  18. package/dist/data/index.d.ts.map +1 -1
  19. package/dist/data/index.js +158 -153
  20. package/dist/data/shared/graphql/cache/services.d.ts +7 -7
  21. package/dist/data/shared/graphql/cache/services.d.ts.map +1 -1
  22. package/dist/data/webapp/index.d.ts.map +1 -1
  23. package/dist/{plugin-factory-BC3b3BOy.js → extension-factory-CJkfM4km.js} +2 -2
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +21 -21
  27. package/package.json +8 -8
  28. package/dist/core/plugin-attach.d.ts +0 -46
  29. package/dist/core/plugin-attach.d.ts.map +0 -1
  30. package/dist/core/plugin-factory.d.ts.map +0 -1
  31. package/dist/core/plugin-types.d.ts +0 -208
  32. package/dist/core/plugin-types.d.ts.map +0 -1
  33. package/dist/data/plugins/index.d.ts +0 -19
  34. package/dist/data/plugins/index.d.ts.map +0 -1
  35. package/dist/data/plugins/labels/index.d.ts.map +0 -1
  36. package/dist/data/plugins/labels/query.d.ts.map +0 -1
  37. package/dist/data/reserved.d.ts +0 -3
  38. package/dist/data/reserved.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- import { DataSDK, ExtendedSDK, Plugin, PluginsFor, SDKOptions, UniquePluginNames, ValidAliasNames } from '../core';
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 plugin authored for the DataSDK surface: {@link Plugin} with the base SDK
31
- * pre-applied to `DataSDK`. Author these with {@link defineDataPlugin}.
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 DataSDKPlugin<Name extends string = string, Api = unknown> = Plugin<DataSDK, Name, Api>;
33
+ export type DataSDKExtension<Name extends string = string, Api = unknown> = Extension<DataSDK, Name, Api>;
34
34
  /**
35
- * Author a DataSDK plugin without annotating `setup`'s parameter — the base
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 plugins.
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 plugin past the per-surface `PluginsFor` guard.
42
- * Equivalent to the internal `definePlugin` with `Sdk = DataSDK` pre-applied;
43
- * see {@link createPluginFactory} for the underlying mechanism.
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 defineDataPlugin: <const Name extends string, Api>(plugin: Plugin<DataSDK, import('..').LiteralName<Name>, Api, []>) => Plugin<DataSDK, Name, Api, []>;
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 every namespace contributed by an ordered plugin tuple.
48
- * Entries may be bare plugins or `{ plugin, as }` aliases; each mounts under its
49
- * effective key (the alias when present), so aliasing is reflected here for free.
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 DataSDKWithPlugins<Plugins extends PluginsFor<DataSDK>> = ExtendedSDK<DataSDK, Plugins>;
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
- * Plugins to attach. Each entry is a bare {@link DataSDKPlugin} (mounts under
68
- * its own `name`) or a `{ plugin, as }` alias (mounts under `as`). Aliasing
69
- * is the recourse when two plugins want the same key e.g. two third-party
70
- * labels plugins the consumer can't edit.
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
- plugins?: PluginsFor<DataSDK>;
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 plugins to attach
79
- * @returns Promise resolving to an initialized DataSDK, extended per plugin
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 `plugins` is supplied, the result type accumulates each plugin's
85
- * namespace under its own key (see {@link DataSDKWithPlugins}); otherwise it is
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 Plugins extends PluginsFor<DataSDK> = []>(options?: Omit<DataSDKOptions, "plugins"> & {
113
- plugins?: Plugins;
114
- } & UniquePluginNames<Plugins> & ValidAliasNames<Plugins>): Promise<DataSDKWithPlugins<Plugins>>;
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
  /**
@@ -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,MAAM,EACN,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAiB,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAMpE;;;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,aAAa,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,EAAE,GAAG,GAAG,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;AAEpG;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,sIAAiC,CAAC;AAE/D;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,CAAC,OAAO,SAAS,UAAU,CAAC,OAAO,CAAC,IAAI,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAEp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