@salesforce/platform-sdk 11.38.0 → 11.40.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.
@@ -0,0 +1,24 @@
1
+ import { CurrentApp, SDKOptions } from '../core';
2
+ /**
3
+ * Options for querying the current app.
4
+ */
5
+ export interface CurrentAppOptions extends SDKOptions {
6
+ }
7
+ /**
8
+ * Get the current (running) app based on the detected surface.
9
+ *
10
+ * There is exactly one running app, so this queries the ambient one rather than
11
+ * constructing a client. Its identity is backed by `SFDC_ENV`, which the runtime
12
+ * injects only on the {@link Surface.WebApp} surface today (an internally-hosted
13
+ * MicroFrontend is the natural next surface). On every other surface — and when
14
+ * the surface is unusable — the returned {@link CurrentApp} has `identity`
15
+ * `undefined`, mirroring how the Data/Chat SDKs degrade rather than failing the
16
+ * host.
17
+ *
18
+ * @param options - Optional configuration including surface override
19
+ * @returns Promise resolving to the current app
20
+ */
21
+ export declare function getCurrentApp(options?: CurrentAppOptions): Promise<CurrentApp>;
22
+ export { WebAppCurrentApp } from './webapp';
23
+ export type { AppIdentity, CurrentApp } from '../core';
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGtD;;GAEG;AAEH,MAAM,WAAW,iBAAkB,SAAQ,UAAU;CAAG;AAExD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAoB9E;AAED,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { g as n, S as c } from "../surface-Dd2tqrPi.js";
2
+ import { w as s } from "../sdk-promise-D0sy7OW1.js";
3
+ const p = "c";
4
+ class u {
5
+ identity;
6
+ constructor() {
7
+ const e = globalThis.SFDC_ENV, r = e?.appName;
8
+ if (!r)
9
+ return;
10
+ const a = e?.namespace || p;
11
+ this.identity = {
12
+ namespace: a,
13
+ appName: r,
14
+ // Namespace first, "__" separator — the UIBundle record's qualified name.
15
+ qualifiedName: `${a}__${r}`,
16
+ // Authoritative record Id from the server injector; absent in local-dev.
17
+ bundleId: e?.bundleId
18
+ };
19
+ }
20
+ }
21
+ function f(t) {
22
+ return s(
23
+ (async () => {
24
+ try {
25
+ return await n(t?.surface) === c.WebApp ? new u() : {};
26
+ } catch {
27
+ return {};
28
+ }
29
+ })(),
30
+ "getCurrentApp"
31
+ );
32
+ }
33
+ export {
34
+ u as WebAppCurrentApp,
35
+ f as getCurrentApp
36
+ };
@@ -0,0 +1,10 @@
1
+ import { AppIdentity, CurrentApp } from '../core';
2
+ /**
3
+ * Current-app implementation for web apps: reads the identity the runtime
4
+ * injected into `globalThis.SFDC_ENV` and composes the qualified name.
5
+ */
6
+ export declare class WebAppCurrentApp implements CurrentApp {
7
+ readonly identity?: AppIdentity;
8
+ constructor();
9
+ }
10
+ //# sourceMappingURL=webapp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webapp.d.ts","sourceRoot":"","sources":["../../src/app/webapp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAKvD;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,UAAU;IAClD,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;;CAuBhC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ /**
7
+ * Identity of the running UIBundle (web app), derived from the values the
8
+ * runtime injects into `globalThis.SFDC_ENV`.
9
+ *
10
+ * The {@link qualifiedName} — `namespace__appName` — is the platform-addressable
11
+ * name of the UIBundle record (namespace first, `__` separator, namespace kept
12
+ * in its original mixed case). It is composed at runtime from the two stored
13
+ * fields; it is **not** the auto-assigned 18-char record Id. Consumers such as
14
+ * CMS search that key off the UIBundle identity use this value.
15
+ */
16
+ export interface AppIdentity {
17
+ /**
18
+ * Namespace prefix in its original mixed case (e.g., "MyNs"). Falls back to
19
+ * "c" when the org has no registered namespace.
20
+ */
21
+ namespace: string;
22
+ /** Developer (app) name of the UIBundle (e.g., "MyBundle"). */
23
+ appName: string;
24
+ /**
25
+ * Platform-addressable qualified name `namespace__appName`
26
+ * (e.g., "MyNs__MyBundle", or "c__MyBundle" with no registered namespace).
27
+ */
28
+ qualifiedName: string;
29
+ /**
30
+ * Authoritative UIBundle **record Id**, injected by the core server (owned
31
+ * by App Fabric) into `SFDC_ENV`. Explicitly **not** {@link qualifiedName}
32
+ * and **not** {@link appName}. `undefined` when the runtime does not inject
33
+ * it — local development, and every non-WebApp surface.
34
+ */
35
+ bundleId?: string;
36
+ }
37
+ /**
38
+ * The current (running) app: the single, ambient app the code is executing
39
+ * inside. There is exactly one, so it is queried — not constructed.
40
+ *
41
+ * Its {@link identity} is only meaningful on surfaces where the runtime injects
42
+ * `SFDC_ENV` (the {@link Surface.WebApp} surface today). On every other surface
43
+ * {@link identity} is absent, mirroring how the other SDKs degrade when a surface
44
+ * cannot back their capability.
45
+ */
46
+ export interface CurrentApp {
47
+ /** The running app's identity, or `undefined` on surfaces without `SFDC_ENV`. */
48
+ readonly identity?: AppIdentity;
49
+ }
50
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/core/app.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC3B;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;CAChC"}
@@ -6,6 +6,7 @@
6
6
  export { Surface, getVerifiedSurface, initialize, isSfEmbeddingIframe, resetSurface, } from './surface';
7
7
  export type { InitializeOptions } from './surface';
8
8
  export type { SDKOptions } from './options';
9
+ export type { AppIdentity, CurrentApp } from './app';
9
10
  export type { HostContext, HostStyles, ChatMessage, ChatSDK, ContentBlock, DeviceCapabilities, DisplayMode, ResourceRequest, SafeAreaInsets, SetWidgetStateOptions, ToolCall, ToolState, } from './chat';
10
11
  export type { AlertOptions, MessageLevel, ModalOptions, ToastOptions, Theme, ThemeMode, UiState, UiStyles, ViewSDK, } from './view';
11
12
  export type { CacheControl, DataSDK, DataSDKGraphQL, GraphQLError, GraphQLRawDocument, GraphQLRequest, GraphQLRequestHeaders, GraphQLResponse, MutateOptions, MutationResult, QueryOptions, QueryResult, QuerySubscriber, Unsubscribe, } from './data';
@@ -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,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,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"}
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,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"}
@@ -1,15 +1,15 @@
1
1
  import { g as x, S as y } from "../surface-Dd2tqrPi.js";
2
2
  import { w as K } from "../sdk-promise-D0sy7OW1.js";
3
- import { buildServiceDescriptor as R, setHeader as b } from "@conduit-client/service-fetch-network/v1";
4
- import { resolvedPromiseLike as u, ok as C, err as E, stableJSONStringify as V, DataNotFoundError as Q, UserVisibleError as G, deepFreeze as v, isUserVisibleError as z } from "@conduit-client/utils";
5
- import { print as A, parse as j } from "@conduit-client/onestore-graphql-parser/v1";
6
- import { RetryPolicy as W, buildServiceDescriptor as B } from "@conduit-client/service-retry/v1";
7
- import { buildServiceDescriptor as J } from "@conduit-client/service-cache/v1";
8
- import { buildServiceDescriptor as X } from "@conduit-client/service-cache-control/v1";
9
- import { buildInMemoryCacheInclusionPolicyService as Y } from "@conduit-client/service-cache-inclusion-policy/v1";
10
- import { buildServiceDescriptor as Z } from "@conduit-client/service-pubsub/v1";
11
- import { HttpCacheControlCommand as ee } from "@conduit-client/command-http-cache-control/v1";
12
- function re(r) {
3
+ import { buildServiceDescriptor as M, setHeader as b } from "@conduit-client/service-fetch-network/v1";
4
+ import { resolvedPromiseLike as u, ok as E, err as D, stableJSONStringify as G, DataNotFoundError as Q, UserVisibleError as z, deepFreeze as v, isUserVisibleError as j } from "@conduit-client/utils";
5
+ import { print as k, parse as W } from "@conduit-client/onestore-graphql-parser/v1";
6
+ import { RetryPolicy as B, buildServiceDescriptor as J } from "@conduit-client/service-retry/v1";
7
+ import { buildServiceDescriptor as X } from "@conduit-client/service-cache/v1";
8
+ import { buildServiceDescriptor as Y } from "@conduit-client/service-cache-control/v1";
9
+ import { buildInMemoryCacheInclusionPolicyService as Z } from "@conduit-client/service-cache-inclusion-policy/v1";
10
+ import { buildServiceDescriptor as ee } from "@conduit-client/service-pubsub/v1";
11
+ import { HttpCacheControlCommand as re } from "@conduit-client/command-http-cache-control/v1";
12
+ function te(r) {
13
13
  return (e) => {
14
14
  const [t, n] = e;
15
15
  if (typeof t == "string" && !t.startsWith("http")) {
@@ -19,42 +19,42 @@ function re(r) {
19
19
  return u(e);
20
20
  };
21
21
  }
22
- function te(r) {
22
+ function ne(r) {
23
23
  return (e) => u(b("Authorization", `Bearer ${r}`, e));
24
24
  }
25
- function ne(r, e) {
25
+ function se(r, e) {
26
26
  const t = [];
27
- return r && t.push(re(r)), e && t.push(te(e)), R({
27
+ return r && t.push(te(r)), e && t.push(ne(e)), M({
28
28
  request: t
29
29
  }).service;
30
30
  }
31
- const se = {
31
+ const ae = {
32
32
  "Content-Type": "application/json",
33
33
  Accept: "application/json",
34
34
  "X-Chatter-Entity-Encoding": "false"
35
35
  };
36
- function ae(r) {
36
+ function oe(r) {
37
37
  if (r instanceof Headers) {
38
38
  const e = [];
39
39
  return r.forEach((t, n) => e.push([n, t])), e;
40
40
  }
41
41
  return Array.isArray(r) ? r.map(([e, t]) => [e, t]) : Object.entries(r);
42
42
  }
43
- function M(r, e) {
43
+ function L(r, e) {
44
44
  if (e === void 0) return { ...r };
45
45
  const t = { ...r }, n = /* @__PURE__ */ new Map();
46
46
  for (const a of Object.keys(t)) n.set(a.toLowerCase(), a);
47
47
  const s = /* @__PURE__ */ new Set();
48
- for (const [a, i] of ae(e)) {
48
+ for (const [a, i] of oe(e)) {
49
49
  const o = a.toLowerCase(), c = n.get(o);
50
50
  c === void 0 ? (t[a] = i, n.set(o, a), s.add(o)) : s.has(o) ? t[c] = `${t[c]}, ${i}` : (t[c] = i, s.add(o));
51
51
  }
52
52
  return t;
53
53
  }
54
- function I(r) {
55
- return M(se, r);
54
+ function H(r) {
55
+ return L(ae, r);
56
56
  }
57
- function oe(r) {
57
+ function ie(r) {
58
58
  if (r === void 0) return;
59
59
  const e = {};
60
60
  return new Headers(r).forEach((t, n) => {
@@ -62,16 +62,16 @@ function oe(r) {
62
62
  }), Object.keys(e).length > 0 ? e : void 0;
63
63
  }
64
64
  const S = () => {
65
- }, D = async () => {
65
+ }, A = async () => {
66
66
  };
67
- function k(r) {
67
+ function q(r) {
68
68
  try {
69
- return C(j(r));
69
+ return E(W(r));
70
70
  } catch (e) {
71
- return E(d(e));
71
+ return D(d(e));
72
72
  }
73
73
  }
74
- function q(r, e) {
74
+ function _(r, e) {
75
75
  const t = r.definitions.filter(
76
76
  (n) => n.kind === "OperationDefinition"
77
77
  );
@@ -85,10 +85,10 @@ function d(r) {
85
85
  }
86
86
  return r instanceof Error ? [{ message: r.message }] : typeof r == "string" ? [{ message: r }] : [{ message: "Unknown error" }];
87
87
  }
88
- async function L(r, { mutation: e, variables: t, operationName: n, headers: s }) {
89
- const a = k(e);
88
+ async function I(r, { mutation: e, variables: t, operationName: n, headers: s }) {
89
+ const a = q(e);
90
90
  if (a.isErr()) return { data: void 0, errors: a.error };
91
- const i = a.value, o = q(i, n);
91
+ const i = a.value, o = _(i, n);
92
92
  if (o !== "mutation")
93
93
  return {
94
94
  data: void 0,
@@ -100,7 +100,7 @@ async function L(r, { mutation: e, variables: t, operationName: n, headers: s })
100
100
  };
101
101
  try {
102
102
  const c = await r({
103
- query: A(i),
103
+ query: k(i),
104
104
  variables: t,
105
105
  operationName: n,
106
106
  headers: s
@@ -116,7 +116,7 @@ async function L(r, { mutation: e, variables: t, operationName: n, headers: s })
116
116
  function $(r) {
117
117
  function e(n, s, a, i) {
118
118
  return r({
119
- query: A(n),
119
+ query: k(n),
120
120
  variables: s,
121
121
  operationName: a,
122
122
  headers: i
@@ -134,15 +134,15 @@ function $(r) {
134
134
  operationName: a,
135
135
  headers: i
136
136
  }) {
137
- const o = k(n);
137
+ const o = q(n);
138
138
  if (o.isErr())
139
139
  return {
140
140
  data: void 0,
141
141
  errors: o.error,
142
142
  subscribe: () => S,
143
- refresh: D
143
+ refresh: A
144
144
  };
145
- const c = o.value, f = q(c, a);
145
+ const c = o.value, f = _(c, a);
146
146
  if (f !== "query")
147
147
  return {
148
148
  data: void 0,
@@ -152,7 +152,7 @@ function $(r) {
152
152
  }
153
153
  ],
154
154
  subscribe: () => S,
155
- refresh: D
155
+ refresh: A
156
156
  };
157
157
  const h = /* @__PURE__ */ new Set(), p = s, m = await e(c, p, a, i);
158
158
  return {
@@ -165,30 +165,30 @@ function $(r) {
165
165
  },
166
166
  async refresh() {
167
167
  const l = await e(c, p, a, i);
168
- for (const w of h) w(l);
168
+ for (const g of h) g(l);
169
169
  }
170
170
  };
171
171
  }
172
172
  return {
173
173
  query: t,
174
- mutate: (n) => L(r, n)
174
+ mutate: (n) => I(r, n)
175
175
  };
176
176
  }
177
- const ie = typeof __SF_API_VERSION__ < "u" ? __SF_API_VERSION__ : "65.0";
178
- function H(r = ie) {
177
+ const ce = typeof __SF_API_VERSION__ < "u" ? __SF_API_VERSION__ : "65.0";
178
+ function F(r = ce) {
179
179
  return `/services/data/v${r}`;
180
180
  }
181
- const ce = {
181
+ const ue = {
182
182
  "Content-Type": "application/json",
183
183
  Accept: "application/json"
184
184
  };
185
- class ue {
185
+ class he {
186
186
  clientFetch;
187
187
  pathData;
188
188
  graphql;
189
189
  constructor(e) {
190
- const t = he(), n = le(e?.instanceUrl ?? t.instanceUrl), s = e?.accessToken ?? t.accessToken;
191
- this.pathData = H(e?.apiVersion ?? t.apiVersion), this.clientFetch = ne(n || void 0, s), this.graphql = $(this.executeRawGraphQL.bind(this));
190
+ const t = le(), n = de(e?.instanceUrl ?? t.instanceUrl), s = e?.accessToken ?? t.accessToken;
191
+ this.pathData = F(e?.apiVersion ?? t.apiVersion), this.clientFetch = se(n || void 0, s), this.graphql = $(this.executeRawGraphQL.bind(this));
192
192
  }
193
193
  async executeRawGraphQL({
194
194
  query: e,
@@ -199,11 +199,11 @@ class ue {
199
199
  return (await this.clientFetch(`${this.pathData}/graphql`, {
200
200
  method: "POST",
201
201
  body: JSON.stringify({ query: e, variables: t, operationName: n }),
202
- headers: M(ce, s)
202
+ headers: L(ue, s)
203
203
  })).json();
204
204
  }
205
205
  }
206
- function he() {
206
+ function le() {
207
207
  const r = globalThis.MOSAIC_ENV;
208
208
  return {
209
209
  instanceUrl: r?.instanceUrl,
@@ -211,13 +211,13 @@ function he() {
211
211
  apiVersion: r?.apiVersion
212
212
  };
213
213
  }
214
- function le(r) {
214
+ function de(r) {
215
215
  if (!r || r === "/") return "";
216
216
  let e = r;
217
217
  return !e.startsWith("/") && !e.startsWith("http") && (e = `/${e}`), e.endsWith("/") && (e = e.slice(0, -1)), e;
218
218
  }
219
- const de = "graphqlQuery";
220
- class fe {
219
+ const fe = "graphqlQuery";
220
+ class pe {
221
221
  graphql;
222
222
  constructor() {
223
223
  this.graphql = $(this.executeRawGraphQL.bind(this));
@@ -232,29 +232,35 @@ class fe {
232
232
  variables: t,
233
233
  operationName: n
234
234
  }) {
235
- return (await window.openai.callTool(de, {
235
+ return (await window.openai.callTool(fe, {
236
236
  query: e,
237
237
  ...t != null ? { variables: t } : {},
238
238
  ...n != null ? { operationName: n } : {}
239
239
  })).structuredContent;
240
240
  }
241
241
  }
242
- const pe = "X-SFDC-Client-Name", me = "X-SFDC-Client-Version", ye = "@salesforce/platform-sdk", be = "11.38.0", ve = (r) => {
243
- let e = b(pe, ye, r);
244
- return e = b(me, be, e), u(e);
245
- }, Se = "X-CSRF-Token";
246
- function we(r, e = {}) {
242
+ const w = "Accept-Language", me = (r) => {
243
+ const e = globalThis.SFDC_ENV?.language;
244
+ if (!e)
245
+ return u(r);
246
+ const [t, n] = r;
247
+ return (t instanceof Request && !n?.headers ? t.headers.has(w) : new Headers(n?.headers).has(w)) ? u(r) : u(b(w, e, r));
248
+ }, ye = "X-SFDC-Client-Name", be = "X-SFDC-Client-Version", ve = "@salesforce/platform-sdk", Se = "11.40.0", ge = (r) => {
249
+ let e = b(ye, ve, r);
250
+ return e = b(be, Se, e), u(e);
251
+ }, we = "X-CSRF-Token";
252
+ function Ce(r, e = {}) {
247
253
  const { protectedUrls: t = [], alwaysProtectedUrls: n = [] } = e;
248
254
  return async (s) => {
249
255
  const [a, i] = s, o = new Request(a, i);
250
- if (O(n, o.url) || ge(o.method) && O(t, o.url)) {
256
+ if (O(n, o.url) || Ee(o.method) && O(t, o.url)) {
251
257
  const f = await r.getToken();
252
- s = b(Se, f, s);
258
+ s = b(we, f, s);
253
259
  }
254
260
  return u(s);
255
261
  };
256
262
  }
257
- function ge(r) {
263
+ function Ee(r) {
258
264
  const e = r.toLowerCase();
259
265
  return e === "post" || e === "put" || e === "patch" || e === "delete";
260
266
  }
@@ -262,16 +268,16 @@ function O(r, e) {
262
268
  const t = new URL(e);
263
269
  return r.some((n) => t.pathname.includes(n));
264
270
  }
265
- function Ce(r, e = {}) {
266
- const t = we(r, e);
271
+ function De(r, e = {}) {
272
+ const t = Ce(r, e);
267
273
  async function n(s) {
268
274
  const a = await t(s);
269
275
  return fetch(a[0], a[1]);
270
276
  }
271
277
  return (s, a) => a ? a.applyRetry(async () => n(s)) : n(s);
272
278
  }
273
- const Ee = [400, 401, 403];
274
- class De extends W {
279
+ const Ae = [400, 401, 403];
280
+ class ke extends B {
275
281
  constructor(e) {
276
282
  super(e), this.csrfTokenManager = e;
277
283
  }
@@ -279,7 +285,7 @@ class De extends W {
279
285
  * Determines if a failed request should be retried due to CSRF token issues.
280
286
  */
281
287
  async shouldRetry(e, t) {
282
- return t.attempt >= 1 ? !1 : Ee.includes(e.status);
288
+ return t.attempt >= 1 ? !1 : Ae.includes(e.status);
283
289
  }
284
290
  /**
285
291
  * CSRF token refresh should happen immediately with no delay.
@@ -297,7 +303,7 @@ class De extends W {
297
303
  await this.csrfTokenManager.refreshToken();
298
304
  }
299
305
  }
300
- class Ae {
306
+ class qe {
301
307
  constructor(e, t) {
302
308
  this.endpoint = e, this.cacheName = t, this.tokenPromise = this.obtainToken();
303
309
  }
@@ -346,28 +352,28 @@ class Ae {
346
352
  }
347
353
  }
348
354
  const P = /* @__PURE__ */ new Map();
349
- function ke(r) {
355
+ function _e(r) {
350
356
  const { endpoint: e, cacheName: t, ...n } = r.csrf;
351
357
  let s = P.get(e);
352
- return s || (s = new Ae(e, t), P.set(e, s)), R(
358
+ return s || (s = new qe(e, t), P.set(e, s)), M(
353
359
  {
354
- retry: Ce(s, n),
355
- request: [ve]
360
+ retry: De(s, n),
361
+ request: [ge, me]
356
362
  },
357
- B(new De(s)).service
363
+ J(new ke(s)).service
358
364
  ).service;
359
365
  }
360
- const _ = /* @__PURE__ */ new Map();
361
- function qe(r) {
362
- let e = _.get(r);
366
+ const N = /* @__PURE__ */ new Map();
367
+ function Oe(r) {
368
+ let e = N.get(r);
363
369
  if (!e) {
364
- const t = J().service, n = Y(t).service, s = X(t, n).service, a = Z().service;
365
- e = { cache: t, cacheController: s, pubSub: a }, _.set(r, e);
370
+ const t = X().service, n = Z(t).service, s = Y(t, n).service, a = ee().service;
371
+ e = { cache: t, cacheController: s, pubSub: a }, N.set(r, e);
366
372
  }
367
373
  return e;
368
374
  }
369
- function Oe(r, e) {
370
- const t = qe(r);
375
+ function Pe(r, e) {
376
+ const t = Oe(r);
371
377
  return {
372
378
  shared: t,
373
379
  services: {
@@ -377,8 +383,8 @@ function Oe(r, e) {
377
383
  }
378
384
  };
379
385
  }
380
- const N = 300;
381
- function Pe(r, e) {
386
+ const T = 300;
387
+ function Ne(r, e) {
382
388
  try {
383
389
  return JSON.parse(JSON.stringify(r));
384
390
  } catch (t) {
@@ -388,19 +394,19 @@ function Pe(r, e) {
388
394
  throw s.cause = t, s;
389
395
  }
390
396
  }
391
- function _e(r) {
397
+ function Te(r) {
392
398
  if (typeof r == "object" && r.type === "max-age") {
393
399
  const e = r.maxAge;
394
- return Number.isFinite(e) && e >= 0 ? e : N;
400
+ return Number.isFinite(e) && e >= 0 ? e : T;
395
401
  }
396
- return N;
402
+ return T;
397
403
  }
398
- class Ne extends ee {
404
+ class Re extends re {
399
405
  constructor(e, t, n) {
400
- super(t), this.url = n, this.query = e.query, this.normalizedOperationName = e.operationName ?? "", this.normalizedVariables = Pe(
406
+ super(t), this.url = n, this.query = e.query, this.normalizedOperationName = e.operationName ?? "", this.normalizedVariables = Ne(
401
407
  e.variables ?? {},
402
408
  this.normalizedOperationName
403
- ), this.cacheControl = e.cacheControl, this.resolvedMaxAge = _e(e.cacheControl), this.headers = e.headers, this.headersKey = oe(e.headers);
409
+ ), this.cacheControl = e.cacheControl, this.resolvedMaxAge = Te(e.cacheControl), this.headers = e.headers, this.headersKey = ie(e.headers);
404
410
  }
405
411
  query;
406
412
  normalizedVariables;
@@ -414,7 +420,7 @@ class Ne extends ee {
414
420
  this.url,
415
421
  {
416
422
  method: "POST",
417
- headers: I(this.headers),
423
+ headers: H(this.headers),
418
424
  body: JSON.stringify({
419
425
  query: this.query,
420
426
  variables: this.normalizedVariables,
@@ -429,7 +435,7 @@ class Ne extends ee {
429
435
  variables: this.normalizedVariables,
430
436
  operationName: this.normalizedOperationName
431
437
  };
432
- return this.headersKey !== void 0 && (e.headers = this.headersKey), V(e);
438
+ return this.headersKey !== void 0 && (e.headers = this.headersKey), G(e);
433
439
  }
434
440
  /**
435
441
  * Reads from the cache and returns the cache result or error
@@ -446,7 +452,7 @@ class Ne extends ee {
446
452
  */
447
453
  readFromCache(e) {
448
454
  const t = this.buildKey(), n = e.get(t)?.value;
449
- return n === void 0 ? u(E(new Q())) : u(C(n));
455
+ return n === void 0 ? u(D(new Q())) : u(E(n));
450
456
  }
451
457
  writeToCache(e, t) {
452
458
  if (t.isOk() && t.value.data != null && Object.keys(t.value.data).length > 0) {
@@ -476,32 +482,32 @@ class Ne extends ee {
476
482
  return e.errors && e.errors.length > 0;
477
483
  }
478
484
  processFetchReturnValue(e) {
479
- return this.responseHasErrors(e) ? E(new G(e)) : C(e);
485
+ return this.responseHasErrors(e) ? D(new z(e)) : E(e);
480
486
  }
481
487
  }
482
- function F(r) {
483
- if (z(r) && r.data && typeof r.data == "object") {
488
+ function U(r) {
489
+ if (j(r) && r.data && typeof r.data == "object") {
484
490
  const e = r.data;
485
491
  if (e.data != null)
486
492
  return e.data;
487
493
  }
488
494
  }
489
- function Te(r) {
495
+ function Me(r) {
490
496
  return (e) => {
491
497
  if (e.isOk()) {
492
498
  const t = e.value;
493
499
  v(t), r({ data: t, errors: void 0 });
494
500
  } else {
495
- const t = F(e.error);
501
+ const t = U(e.error);
496
502
  t && v(t), r({ data: t, errors: d(e.error) });
497
503
  }
498
504
  };
499
505
  }
500
- async function Re(r) {
506
+ async function Le(r) {
501
507
  let e, t, n;
502
508
  try {
503
509
  const s = await r.execute();
504
- s.isOk() ? (e = s.value.data, v(e), n = (a) => s.value.subscribe(a)) : (e = F(s.error.failure), e && v(e), t = d(s.error.failure), n = (a) => s.error.subscribe(a));
510
+ s.isOk() ? (e = s.value.data, v(e), n = (a) => s.value.subscribe(a)) : (e = U(s.error.failure), e && v(e), t = d(s.error.failure), n = (a) => s.error.subscribe(a));
505
511
  } catch (s) {
506
512
  t = d(s);
507
513
  }
@@ -509,22 +515,22 @@ async function Re(r) {
509
515
  data: e,
510
516
  errors: t,
511
517
  subscribe(s) {
512
- return n ? n(Te(s)) : S;
518
+ return n ? n(Me(s)) : S;
513
519
  },
514
520
  async refresh() {
515
521
  await r.refresh();
516
522
  }
517
523
  };
518
524
  }
519
- function g(r) {
525
+ function C(r) {
520
526
  return {
521
527
  data: void 0,
522
528
  errors: r,
523
529
  subscribe: () => S,
524
- refresh: D
530
+ refresh: A
525
531
  };
526
532
  }
527
- function Me({
533
+ function He({
528
534
  bundle: r,
529
535
  url: e,
530
536
  executeRaw: t
@@ -537,20 +543,20 @@ function Me({
537
543
  cacheControl: c,
538
544
  headers: f
539
545
  }) {
540
- const h = k(a);
541
- if (h.isErr()) return g(h.error);
542
- const p = h.value, m = q(p, o);
546
+ const h = q(a);
547
+ if (h.isErr()) return C(h.error);
548
+ const p = h.value, m = _(p, o);
543
549
  if (m !== "query")
544
- return g([
550
+ return C([
545
551
  {
546
552
  message: `DataSDK.graphql.query() requires a GraphQL query, received ${m}.`
547
553
  }
548
554
  ]);
549
555
  let l;
550
556
  try {
551
- l = new Ne(
557
+ l = new Re(
552
558
  {
553
- query: A(p),
559
+ query: k(p),
554
560
  variables: i,
555
561
  operationName: o,
556
562
  cacheControl: c,
@@ -559,36 +565,36 @@ function Me({
559
565
  n,
560
566
  e
561
567
  );
562
- } catch (w) {
563
- return g(d(w));
568
+ } catch (g) {
569
+ return C(d(g));
564
570
  }
565
- return Re(l);
571
+ return Le(l);
566
572
  }
567
573
  return {
568
574
  query: s,
569
- mutate: (a) => L(t, a)
575
+ mutate: (a) => I(t, a)
570
576
  };
571
577
  }
572
- const Ie = 1, Le = `@salesforce/platform-sdk-data_v${Ie}`, U = H(), $e = `${U}/ui-api`, T = `${U}/graphql`;
573
- class He {
578
+ const Ie = 1, $e = `@salesforce/platform-sdk-data_v${Ie}`, V = F(), Fe = `${V}/ui-api`, R = `${V}/graphql`;
579
+ class Ue {
574
580
  baseUrl;
575
581
  clientFetch;
576
582
  onStatus;
577
583
  graphql;
578
584
  constructor(e) {
579
- const t = Fe();
580
- this.baseUrl = Ue(e?.basePath ?? t.apiPath), this.onStatus = e?.onStatus ?? {}, this.clientFetch = ke({
585
+ const t = Ve();
586
+ this.baseUrl = xe(e?.basePath ?? t.apiPath), this.onStatus = e?.onStatus ?? {}, this.clientFetch = _e({
581
587
  csrf: {
582
- endpoint: `${this.baseUrl}${$e}/session/csrf`,
583
- cacheName: Le,
588
+ endpoint: `${this.baseUrl}${Fe}/session/csrf`,
589
+ cacheName: $e,
584
590
  protectedUrls: ["services/data/v", "services/apexrest"],
585
591
  alwaysProtectedUrls: ["services/apexrest"]
586
592
  }
587
593
  });
588
- const n = (a, i) => this.fetch(a, i), s = Oe(this.baseUrl, n);
589
- this.graphql = Me({
594
+ const n = (a, i) => this.fetch(a, i), s = Pe(this.baseUrl, n);
595
+ this.graphql = He({
590
596
  bundle: s,
591
- url: T,
597
+ url: R,
592
598
  executeRaw: this.executeRawGraphQL.bind(this)
593
599
  });
594
600
  }
@@ -608,10 +614,10 @@ class He {
608
614
  operationName: n,
609
615
  headers: s
610
616
  }) {
611
- return (await this.fetch(T, {
617
+ return (await this.fetch(R, {
612
618
  method: "POST",
613
619
  body: JSON.stringify({ query: e, variables: t, operationName: n }),
614
- headers: I(s)
620
+ headers: H(s)
615
621
  })).json();
616
622
  }
617
623
  /**
@@ -628,34 +634,34 @@ class He {
628
634
  return e;
629
635
  }
630
636
  }
631
- function Fe() {
637
+ function Ve() {
632
638
  return {
633
639
  apiPath: globalThis.SFDC_ENV?.apiPath
634
640
  };
635
641
  }
636
- function Ue(r) {
642
+ function xe(r) {
637
643
  if (!r || r === "/") return "";
638
644
  let e = r;
639
645
  return e.startsWith("/") || (e = `/${e}`), e.endsWith("/") && (e = e.slice(0, -1)), e;
640
646
  }
641
- function Ye(r, ...e) {
647
+ function er(r, ...e) {
642
648
  let t = r[0] ?? "";
643
649
  for (let n = 0; n < e.length; n += 1)
644
650
  t += String(e[n]) + (r[n + 1] ?? "");
645
651
  return t;
646
652
  }
647
- function Ze(r) {
653
+ function rr(r) {
648
654
  return K(
649
655
  (async () => {
650
656
  try {
651
657
  switch (await x(r?.surface)) {
652
658
  case y.OpenAI:
653
- return new fe();
659
+ return new pe();
654
660
  case y.WebApp:
655
661
  case y.MicroFrontend:
656
- return new He(r?.webapp);
662
+ return new Ue(r?.webapp);
657
663
  case y.Mosaic:
658
- return new ue(r?.mosaic);
664
+ return new he(r?.mosaic);
659
665
  case y.MCPApps:
660
666
  return {};
661
667
  default:
@@ -669,6 +675,6 @@ function Ze(r) {
669
675
  );
670
676
  }
671
677
  export {
672
- Ze as createDataSDK,
673
- Ye as gql
678
+ rr as createDataSDK,
679
+ er as gql
674
680
  };
@@ -0,0 +1,19 @@
1
+ import { RequestInterceptor } from '@conduit-client/service-fetch-network/v1';
2
+ export declare const ACCEPT_LANGUAGE_HEADER = "Accept-Language";
3
+ /**
4
+ * A request interceptor that propagates the site's active language to every
5
+ * outgoing SDK request as an `Accept-Language` header.
6
+ *
7
+ * The language is read from the SFDC runtime environment
8
+ * ({@link globalThis.SFDC_ENV}`.language`), the same channel that carries the
9
+ * API path — never from the URL. Behavior:
10
+ *
11
+ * - No env language present -> no-op (falls back to platform/org default).
12
+ * - Caller already set `Accept-Language` (on `init` or on a `Request` input)
13
+ * -> preserved, never overwritten.
14
+ *
15
+ * Since both REST (`fetch`) and GraphQL requests flow through the same fetch
16
+ * service, wiring this once into the request chain covers both paths.
17
+ */
18
+ export declare const acceptLanguageInterceptor: RequestInterceptor;
19
+ //# sourceMappingURL=accept-language.interceptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accept-language.interceptor.d.ts","sourceRoot":"","sources":["../../../src/data/webapp/accept-language.interceptor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGN,KAAK,kBAAkB,EACvB,MAAM,0CAA0C,CAAC;AAGlD,eAAO,MAAM,sBAAsB,oBAAoB,CAAC;AAExD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,yBAAyB,EAAE,kBAwBvC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/data/webapp/fetch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEN,KAAK,YAAY,EACjB,MAAM,0CAA0C,CAAC;AAGlD,OAAO,EAEN,KAAK,sBAAsB,EAC3B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,UAAU,UAAW,SAAQ,sBAAsB;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,UAAU,CAAC;CACjB;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,+BAAsC,CAAC;AAExE;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,YAAY,CAgBpE"}
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/data/webapp/fetch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEN,KAAK,YAAY,EACjB,MAAM,0CAA0C,CAAC;AAIlD,OAAO,EAEN,KAAK,sBAAsB,EAC3B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,UAAU,UAAW,SAAQ,sBAAsB;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,UAAU,CAAC;CACjB;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,+BAAsC,CAAC;AAExE;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,YAAY,CAgBpE"}
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export { createChatSDK, type ChatSDKOptions, MCPAppsChatSDK, getChatSDK, getChat
8
8
  export { createViewSDK, type ViewSDKOptions, MCPAppsViewSDK, getViewSDK, getViewSDKSync, resetViewSDK, } from './view';
9
9
  export { createDataSDK, type DataSDKOptions, type WebAppDataSDKOptions, type MosaicDataSDKOptions, type StatusCallback, type NodeOfConnection, gql, } from './data';
10
10
  export { createLightningSDK, type LightningSDKOptions } from './lightning';
11
+ export { getCurrentApp, type CurrentAppOptions, type AppIdentity, type CurrentApp, WebAppCurrentApp, } from './app';
11
12
  export { createTelemetryTransport, registerTelemetryUploader, TelemetryUploader, type TelemetryTransport, type TelemetryTransportOptions, type EnvelopeEntry, type EnvelopeMetadata, type TelemetryUploaderOptions, type OnEnvelopeCallback, type FlushReason, type TelemetryUploadContext, type TelemetryUploaderErrorContext, type InstrumentedAppLike, type DisposeOptions, } from './telemetry';
12
13
  export { AXL_PFT_ID, createAnalytics, PFT_META_KEY, validatePftId, type Analytics, type AnalyticsOptions, } from './analytics';
13
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,QAAQ,CAAC;AAGvB,OAAO,EACN,aAAa,EACb,KAAK,cAAc,EACnB,cAAc,EACd,UAAU,EACV,cAAc,EACd,YAAY,GACZ,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACN,aAAa,EACb,KAAK,cAAc,EACnB,cAAc,EACd,UAAU,EACV,cAAc,EACd,YAAY,GACZ,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACN,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,GAAG,GACH,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAAE,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAG3E,OAAO,EACN,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACnB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACN,UAAU,EACV,eAAe,EACf,YAAY,EACZ,aAAa,EACb,KAAK,SAAS,EACd,KAAK,gBAAgB,GACrB,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,QAAQ,CAAC;AAGvB,OAAO,EACN,aAAa,EACb,KAAK,cAAc,EACnB,cAAc,EACd,UAAU,EACV,cAAc,EACd,YAAY,GACZ,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACN,aAAa,EACb,KAAK,cAAc,EACnB,cAAc,EACd,UAAU,EACV,cAAc,EACd,YAAY,GACZ,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACN,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,GAAG,GACH,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAAE,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAG3E,OAAO,EACN,aAAa,EACb,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,gBAAgB,GAChB,MAAM,OAAO,CAAC;AAGf,OAAO,EACN,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACnB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACN,UAAU,EACV,eAAe,EACf,YAAY,EACZ,aAAa,EACb,KAAK,SAAS,EACd,KAAK,gBAAgB,GACrB,MAAM,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -1,41 +1,44 @@
1
- import { M as a, a as t, S as s, g as o, i, b as p, r as S } from "./surface-Dd2tqrPi.js";
1
+ import { M as a, a as t, 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-5BWkCbcP.js";
3
3
  import { w as D } from "./sdk-promise-D0sy7OW1.js";
4
- import { MCPAppsChatSDK as g, createChatSDK as l, getChatSDK as x, getChatSDKSync as n, resetChatSDK as A } from "./chat/index.js";
4
+ import { MCPAppsChatSDK as K, createChatSDK as l, getChatSDK as A, getChatSDKSync as n, resetChatSDK as x } from "./chat/index.js";
5
5
  import { MCPAppsViewSDK as T, createViewSDK as d, getViewSDK as w, getViewSDKSync as P, resetViewSDK as h } from "./view/index.js";
6
- import { createDataSDK as M, gql as V } from "./data/index.js";
7
- import { createLightningSDK as u } from "./lightning/index.js";
8
- import { c as _ } from "./transport-D9QstWle.js";
9
- import { T as I, r as F } from "./TelemetryUploader-DKkdppe9.js";
10
- import { A as U, P as q, c as z, v as N } from "./analytics-xqWfpWnv.js";
6
+ import { createDataSDK as y, gql as M } from "./data/index.js";
7
+ import { createLightningSDK as b } from "./lightning/index.js";
8
+ import { WebAppCurrentApp as _, getCurrentApp as v } from "./app/index.js";
9
+ import { c as F } from "./transport-D9QstWle.js";
10
+ import { T as U, r as q } from "./TelemetryUploader-DKkdppe9.js";
11
+ import { A as N, P as W, c as X, v as Y } from "./analytics-xqWfpWnv.js";
11
12
  export {
12
- U as AXL_PFT_ID,
13
- g as MCPAppsChatSDK,
13
+ N as AXL_PFT_ID,
14
+ K as MCPAppsChatSDK,
14
15
  T as MCPAppsViewSDK,
15
16
  a as McpAppsNotAvailableError,
16
17
  t as McpAppsSession,
17
- q as PFT_META_KEY,
18
- s as Surface,
19
- I as TelemetryUploader,
20
- z as createAnalytics,
18
+ W as PFT_META_KEY,
19
+ p as Surface,
20
+ U as TelemetryUploader,
21
+ _ as WebAppCurrentApp,
22
+ X as createAnalytics,
21
23
  l as createChatSDK,
22
- M as createDataSDK,
23
- u as createLightningSDK,
24
- _ as createTelemetryTransport,
24
+ y as createDataSDK,
25
+ b as createLightningSDK,
26
+ F as createTelemetryTransport,
25
27
  d as createViewSDK,
26
- x as getChatSDK,
28
+ A as getChatSDK,
27
29
  n as getChatSDKSync,
30
+ v as getCurrentApp,
28
31
  c as getSurfaceCapabilities,
29
- o as getVerifiedSurface,
32
+ s as getVerifiedSurface,
30
33
  w as getViewSDK,
31
34
  P as getViewSDKSync,
32
- V as gql,
33
- i as initialize,
34
- p as isSfEmbeddingIframe,
35
- F as registerTelemetryUploader,
36
- A as resetChatSDK,
35
+ M as gql,
36
+ o as initialize,
37
+ i as isSfEmbeddingIframe,
38
+ q as registerTelemetryUploader,
39
+ x as resetChatSDK,
37
40
  S as resetSurface,
38
41
  h as resetViewSDK,
39
- N as validatePftId,
42
+ Y as validatePftId,
40
43
  D as wrapSDKPromise
41
44
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/platform-sdk",
3
- "version": "11.38.0",
3
+ "version": "11.40.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -27,6 +27,9 @@
27
27
  "lightning": [
28
28
  "./dist/lightning/index.d.ts"
29
29
  ],
30
+ "app": [
31
+ "./dist/app/index.d.ts"
32
+ ],
30
33
  "telemetry": [
31
34
  "./dist/telemetry/index.d.ts"
32
35
  ],
@@ -72,6 +75,11 @@
72
75
  "import": "./dist/lightning/index.js",
73
76
  "default": "./dist/lightning/index.js"
74
77
  },
78
+ "./app": {
79
+ "types": "./dist/app/index.d.ts",
80
+ "import": "./dist/app/index.js",
81
+ "default": "./dist/app/index.js"
82
+ },
75
83
  "./telemetry": {
76
84
  "types": "./dist/telemetry/index.d.ts",
77
85
  "import": "./dist/telemetry/index.js",
@@ -115,7 +123,7 @@
115
123
  "@conduit-client/service-pubsub": "3.19.6",
116
124
  "@conduit-client/service-retry": "3.19.6",
117
125
  "@conduit-client/utils": "3.19.6",
118
- "@salesforce/jsonrpc": "^11.38.0",
126
+ "@salesforce/jsonrpc": "^11.40.0",
119
127
  "@salesforce/sf-embedding-bridge": "2.2.5-rc.2"
120
128
  },
121
129
  "peerDependencies": {