@salesforce/platform-sdk 11.71.5 → 12.0.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.
@@ -31,6 +31,7 @@ export interface MosaicDataSDKOptions {
31
31
  export declare class MosaicDataSDK implements DataSDK {
32
32
  private readonly clientFetch;
33
33
  private readonly pathData;
34
+ readonly apiVersion: string;
34
35
  readonly graphql: DataSDKGraphQL;
35
36
  constructor(options?: MosaicDataSDKOptions);
36
37
  private executeRawGraphQL;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/mosaic/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,YAAY,CAAC;AAe3F;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;gBAErB,OAAO,CAAC,EAAE,oBAAoB;YAa5B,iBAAiB;CAe/B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/mosaic/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,YAAY,CAAC;AAe3F;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;gBAErB,OAAO,CAAC,EAAE,oBAAoB;YAc5B,iBAAiB;CAe/B"}
@@ -8,6 +8,7 @@ export declare class WebAppDataSDK implements DataSDK {
8
8
  private readonly pathData;
9
9
  private readonly clientFetch;
10
10
  private readonly onStatus;
11
+ readonly apiVersion: string;
11
12
  readonly graphql: DataSDKGraphQL;
12
13
  constructor(options?: WebAppDataSDKOptions);
13
14
  fetch(input: string | URL | Request, init?: RequestInit): Promise<Response>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/webapp/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,YAAY,CAAC;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAWrD;;GAEG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyD;IAClF,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;gBAErB,OAAO,CAAC,EAAE,oBAAoB;IAkCpC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IAUjF;;;;;OAKG;YACW,iBAAiB;IAgB/B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;CAa3B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/webapp/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,YAAY,CAAC;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAWrD;;GAEG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyD;IAClF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;gBAErB,OAAO,CAAC,EAAE,oBAAoB;IAmCpC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IAUjF;;;;;OAKG;YACW,iBAAiB;IAgB/B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;CAa3B"}
package/dist/index.js CHANGED
@@ -1,46 +1,44 @@
1
- import { M as t, a, S as o, g as p, i as s, b as i, r as S } from "./surface-Dd2tqrPi.js";
1
+ import { M as t, a, S as p, g as s, i as o, b as i, r as S } from "./surface-Dd2tqrPi.js";
2
2
  import { g as c } from "./capabilities-CCBqEXMt.js";
3
- import { w as n } from "./sdk-promise-D0sy7OW1.js";
4
- import { c as g } from "./extension-factory-CJkfM4km.js";
5
- import { MCPAppsChatSDK as K, createChatSDK as l, getChatSDK as A, getChatSDKSync as C, resetChatSDK as d } from "./chat/index.js";
6
- import { MCPAppsViewSDK as y, createViewSDK as T, getViewSDK as h, getViewSDKSync as u, resetViewSDK as E } from "./view/index.js";
7
- import { createDataSDK as P, defineDataExtension as V, gql as b } from "./data/index.js";
8
- import { createLightningSDK as F } from "./lightning/index.js";
9
- import { WebAppCurrentApp as U, getCurrentApp as _ } from "./app/index.js";
10
- import { c as z } from "./transport-D9QstWle.js";
11
- import { T as N, r as W } from "./TelemetryUploader-DKkdppe9.js";
12
- import { P as j, c as k, v as B } from "./analytics-Dpz22kda.js";
3
+ import { w as D } from "./sdk-promise-D0sy7OW1.js";
4
+ import { MCPAppsChatSDK as n, createChatSDK as K, getChatSDK as l, getChatSDKSync as x, resetChatSDK as A } from "./chat/index.js";
5
+ import { MCPAppsViewSDK as d, createViewSDK as w, getViewSDK as T, getViewSDKSync as h, resetViewSDK as u } from "./view/index.js";
6
+ import { createDataSDK as M, defineDataExtension as P, gql as V } from "./data/index.js";
7
+ import { createLightningSDK as E } from "./lightning/index.js";
8
+ import { WebAppCurrentApp as I, getCurrentApp as U } from "./app/index.js";
9
+ import { c as q } from "./transport-D9QstWle.js";
10
+ import { T as F, r as L } from "./TelemetryUploader-DKkdppe9.js";
11
+ import { P as W, c as Y, v as j } from "./analytics-Dpz22kda.js";
13
12
  export {
14
- K as MCPAppsChatSDK,
15
- y as MCPAppsViewSDK,
13
+ n as MCPAppsChatSDK,
14
+ d as MCPAppsViewSDK,
16
15
  t as McpAppsNotAvailableError,
17
16
  a as McpAppsSession,
18
- j as PFT_META_KEY,
19
- o as Surface,
20
- N as TelemetryUploader,
21
- U as WebAppCurrentApp,
22
- k as createAnalytics,
23
- l as createChatSDK,
24
- P as createDataSDK,
25
- g as createExtensionFactory,
26
- F as createLightningSDK,
27
- z as createTelemetryTransport,
28
- T as createViewSDK,
29
- V as defineDataExtension,
30
- A as getChatSDK,
31
- C as getChatSDKSync,
32
- _ as getCurrentApp,
17
+ W as PFT_META_KEY,
18
+ p as Surface,
19
+ F as TelemetryUploader,
20
+ I as WebAppCurrentApp,
21
+ Y as createAnalytics,
22
+ K as createChatSDK,
23
+ M as createDataSDK,
24
+ E as createLightningSDK,
25
+ q as createTelemetryTransport,
26
+ w as createViewSDK,
27
+ P as defineDataExtension,
28
+ l as getChatSDK,
29
+ x as getChatSDKSync,
30
+ U as getCurrentApp,
33
31
  c as getSurfaceCapabilities,
34
- p as getVerifiedSurface,
35
- h as getViewSDK,
36
- u as getViewSDKSync,
37
- b as gql,
38
- s as initialize,
32
+ s as getVerifiedSurface,
33
+ T as getViewSDK,
34
+ h as getViewSDKSync,
35
+ V as gql,
36
+ o as initialize,
39
37
  i as isSfEmbeddingIframe,
40
- W as registerTelemetryUploader,
41
- d as resetChatSDK,
38
+ L as registerTelemetryUploader,
39
+ A as resetChatSDK,
42
40
  S as resetSurface,
43
- E as resetViewSDK,
44
- B as validatePftId,
45
- n as wrapSDKPromise
41
+ u as resetViewSDK,
42
+ j as validatePftId,
43
+ D as wrapSDKPromise
46
44
  };
@@ -15,7 +15,18 @@ and `fetch` (the escape hatch; see [01-grounding-and-precedence.md](./01-groundi
15
15
  for which door to pick). Both are **optional**: a surface that doesn't support data operations
16
16
  resolves to a bare `{}` rather than throwing (see `DataSDK` in `dist/core/data.d.ts`). This page is
17
17
  the residue: how to guard that optionality, what `.fetch` is and how it differs from `.graphql`, how
18
- to read `errors`, and the per-surface options.
18
+ to read `errors`, the resolved `apiVersion`, and the per-surface options.
19
+
20
+ ## `apiVersion` — the resolved adapter version
21
+
22
+ `sdk.apiVersion` is the optional, read-only Salesforce API version selected by the resolved surface
23
+ adapter. WebApp and Mosaic expose it and derive their data request paths from that same value;
24
+ `apiVersion: "63.0"`, for example, produces paths under `/services/data/v63.0`. Tool-backed OpenAI
25
+ and degraded surfaces do not expose a comparable org request version, so the property is absent.
26
+
27
+ Use this property when behavior depends on the adapter's effective Salesforce API version. Do not
28
+ recover the version by parsing a GraphQL or REST URL: those paths are downstream products of the
29
+ version selection, not the version interface.
19
30
 
20
31
  ## `sdk.graphql!` vs guard — a surface decision
21
32
 
@@ -120,9 +131,9 @@ if (!result.data && result.errors?.length) {
120
131
  `createDataSDK(options)` takes a `DataSDKOptions` bag; the fields you set depend on the surface. The
121
132
  declarations own the field lists — this is just the routing:
122
133
 
123
- - **WebApp** — `WebAppDataSDKOptions` (`options.webapp`): `basePath`, and `onStatus` per-HTTP-status
124
- callbacks (each a `StatusCallback`) for cases like re-authenticating on a `401`. This is the
125
- cached surface — see [02-caching-and-freshness.md](./02-caching-and-freshness.md).
134
+ - **WebApp** — `WebAppDataSDKOptions` (`options.webapp`): `basePath`, `apiVersion`, and `onStatus`
135
+ per-HTTP-status callbacks (each a `StatusCallback`) for cases like re-authenticating on a `401`.
136
+ This is the cached surface — see [02-caching-and-freshness.md](./02-caching-and-freshness.md).
126
137
  - **Mosaic** — `MosaicDataSDKOptions` (`options.mosaic`): server-side (Node) auth via `instanceUrl` /
127
138
  `accessToken` / `apiVersion`. Uncached.
128
139
  - **OpenAI** — no surface options bag; delegates to an MCP tool. Uncached, and it exposes no header
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/platform-sdk",
3
- "version": "11.71.5",
3
+ "version": "12.0.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -139,7 +139,7 @@
139
139
  "@conduit-client/service-pubsub": "3.19.6",
140
140
  "@conduit-client/service-retry": "3.19.6",
141
141
  "@conduit-client/utils": "3.19.6",
142
- "@salesforce/jsonrpc": "^11.71.5",
142
+ "@salesforce/jsonrpc": "^12.0.0",
143
143
  "@salesforce/sf-embedding-bridge": "2.2.5-rc.2"
144
144
  },
145
145
  "peerDependencies": {
@@ -1,42 +0,0 @@
1
- import { LiteralName, Extension } from './extension-types';
2
- /**
3
- * Bind a extension authoring helper to one SDK surface, so authors never annotate
4
- * `setup`'s parameter. `createExtensionFactory<Sdk>()` captures the base SDK once
5
- * and returns a definer; each call to that definer infers only the extension's
6
- * literal `Name` and its `Api`, with `setup(sdk)` already typed as `Sdk`:
7
- *
8
- * ```ts
9
- * const defineDataExtension = createExtensionFactory<DataSDK>();
10
- * const labels = defineDataExtension({ name: "labels", setup: (sdk) => ({ ... }) });
11
- * ```
12
- *
13
- * `createDataSDK` exposes the DataSDK-bound definer as `defineDataExtension`. This
14
- * factory is also the public escape hatch for a surface with no first-party
15
- * definer yet, or for an author's own SDK.
16
- *
17
- * ## Why a curried factory, and not a single `defineExtension<Sdk, Name, Api>`?
18
- *
19
- * The obvious alternative is one generic function whose caller fixes the SDK:
20
- * `defineExtension<DataSDK>({ name, setup })`. TypeScript does not allow it —
21
- * type-argument lists are all-or-nothing per call, so supplying `Sdk` forces
22
- * you to also supply `Name` and `Api` (`Expected 3 type arguments, but got 1`),
23
- * which throws away the very inference that makes the helper worth using. That
24
- * leaves only one way to keep `Sdk` implicit at the value call: annotate the
25
- * parameter (`setup: (sdk: DataSDK) => ...`) on every extension. And a *forgotten*
26
- * annotation does not error — it silently infers `Sdk = unknown`, a
27
- * universally-attachable binding that slips a surface-specific extension past the
28
- * per-surface {@link ExtensionsFor} guard.
29
- *
30
- * Currying dodges both problems. The outer call takes `Sdk` as its only type
31
- * argument and no value arguments, so nothing forces `Name`/`Api` to be spelled
32
- * out; the inner call infers those from the extension object. `Sdk` is fixed before
33
- * any extension is written, so it can be neither forgotten nor widened — the
34
- * footgun is designed out rather than documented around.
35
- *
36
- * The returned definer is identity at runtime. It carries the {@link LiteralName}
37
- * guard, which rejects a widened `string` name at definition time: without a
38
- * concrete literal there is no key to accumulate onto the extended SDK, so
39
- * failing loud here beats a silently dropped namespace downstream.
40
- */
41
- export declare function createExtensionFactory<Sdk>(): <const Name extends string, Api>(extension: Extension<Sdk, LiteralName<Name>, Api>) => Extension<Sdk, Name, Api>;
42
- //# sourceMappingURL=extension-factory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extension-factory.d.ts","sourceRoot":"","sources":["../../src/core/extension-factory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,MACT,KAAK,CAAC,IAAI,SAAS,MAAM,EAAE,GAAG,EAC7D,WAAW,SAAS,CAAC,GAAG,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,KAC/C,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,CAG5B"}
@@ -1,8 +0,0 @@
1
- function t() {
2
- return function(n) {
3
- return n;
4
- };
5
- }
6
- export {
7
- t as c
8
- };