@salesforce/platform-sdk 12.8.0 → 12.10.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.
Files changed (116) hide show
  1. package/dist/analytics/analytics.d.ts +19 -15
  2. package/dist/analytics/analytics.d.ts.map +1 -1
  3. package/dist/analytics/error-listener.d.ts +3 -3
  4. package/dist/analytics/index.d.ts.map +1 -1
  5. package/dist/analytics/index.js +1 -1
  6. package/dist/analytics/method-configs.d.ts +8 -4
  7. package/dist/analytics/method-configs.d.ts.map +1 -1
  8. package/dist/analytics/pft.d.ts +22 -16
  9. package/dist/analytics/pft.d.ts.map +1 -1
  10. package/dist/analytics/proxy.d.ts +10 -8
  11. package/dist/analytics/proxy.d.ts.map +1 -1
  12. package/dist/analytics/types.d.ts +57 -43
  13. package/dist/analytics/types.d.ts.map +1 -1
  14. package/dist/{analytics-Dpz22kda.js → analytics-wESbWdca.js} +1 -1
  15. package/dist/app/index.d.ts +18 -13
  16. package/dist/app/index.d.ts.map +1 -1
  17. package/dist/app/index.js +5 -3
  18. package/dist/app/webapp.d.ts +5 -2
  19. package/dist/app/webapp.d.ts.map +1 -1
  20. package/dist/{capabilities-CKe8z6kZ.js → capabilities-B0mU0_G0.js} +1 -1
  21. package/dist/chat/index.js +1 -1
  22. package/dist/core/app.d.ts +31 -22
  23. package/dist/core/app.d.ts.map +1 -1
  24. package/dist/core/capabilities.d.ts +26 -17
  25. package/dist/core/capabilities.d.ts.map +1 -1
  26. package/dist/core/chat.d.ts +155 -125
  27. package/dist/core/chat.d.ts.map +1 -1
  28. package/dist/core/data.d.ts +146 -107
  29. package/dist/core/data.d.ts.map +1 -1
  30. package/dist/core/extension-attach.d.ts +65 -51
  31. package/dist/core/extension-attach.d.ts.map +1 -1
  32. package/dist/core/extension-types.d.ts +214 -153
  33. package/dist/core/extension-types.d.ts.map +1 -1
  34. package/dist/core/index.d.ts.map +1 -1
  35. package/dist/core/index.js +2 -2
  36. package/dist/core/lightning.d.ts +11 -19
  37. package/dist/core/lightning.d.ts.map +1 -1
  38. package/dist/core/mcpapps-session.d.ts +63 -52
  39. package/dist/core/mcpapps-session.d.ts.map +1 -1
  40. package/dist/core/options.d.ts +6 -4
  41. package/dist/core/options.d.ts.map +1 -1
  42. package/dist/core/platforms.d.ts +29 -29
  43. package/dist/core/sdk-promise.d.ts +7 -4
  44. package/dist/core/sdk-promise.d.ts.map +1 -1
  45. package/dist/core/surface.d.ts +89 -67
  46. package/dist/core/surface.d.ts.map +1 -1
  47. package/dist/core/view.d.ts +164 -113
  48. package/dist/core/view.d.ts.map +1 -1
  49. package/dist/data/extensions/index.d.ts +5 -2
  50. package/dist/data/extensions/index.d.ts.map +1 -1
  51. package/dist/data/extensions/labels/index.d.ts +72 -49
  52. package/dist/data/extensions/labels/index.d.ts.map +1 -1
  53. package/dist/data/extensions/labels/query.d.ts +38 -29
  54. package/dist/data/extensions/labels/query.d.ts.map +1 -1
  55. package/dist/data/gql.d.ts +8 -4
  56. package/dist/data/gql.d.ts.map +1 -1
  57. package/dist/data/index.d.ts +67 -48
  58. package/dist/data/index.d.ts.map +1 -1
  59. package/dist/data/index.js +265 -242
  60. package/dist/data/mosaic/fetch.d.ts +24 -15
  61. package/dist/data/mosaic/fetch.d.ts.map +1 -1
  62. package/dist/data/mosaic/index.d.ts +13 -9
  63. package/dist/data/mosaic/index.d.ts.map +1 -1
  64. package/dist/data/openai/index.d.ts +11 -5
  65. package/dist/data/openai/index.d.ts.map +1 -1
  66. package/dist/data/shared/graphql/cache/command.d.ts +60 -46
  67. package/dist/data/shared/graphql/cache/command.d.ts.map +1 -1
  68. package/dist/data/shared/graphql/cache/invoker.d.ts.map +1 -1
  69. package/dist/data/shared/graphql/cache/services.d.ts +21 -11
  70. package/dist/data/shared/graphql/cache/services.d.ts.map +1 -1
  71. package/dist/data/shared/graphql/cached-graphql.d.ts +9 -4
  72. package/dist/data/shared/graphql/cached-graphql.d.ts.map +1 -1
  73. package/dist/data/shared/graphql/graphql-parse.d.ts +6 -3
  74. package/dist/data/shared/graphql/graphql-parse.d.ts.map +1 -1
  75. package/dist/data/shared/graphql/headers.d.ts +34 -27
  76. package/dist/data/shared/graphql/headers.d.ts.map +1 -1
  77. package/dist/data/shared/graphql/parse-response.d.ts +31 -23
  78. package/dist/data/shared/graphql/parse-response.d.ts.map +1 -1
  79. package/dist/data/shared/graphql/uncached-graphql.d.ts +10 -6
  80. package/dist/data/shared/graphql/uncached-graphql.d.ts.map +1 -1
  81. package/dist/data/shared/url-utils.d.ts +1 -1
  82. package/dist/data/shared/url-utils.d.ts.map +1 -1
  83. package/dist/data/webapp/accept-language.interceptor.d.ts +26 -9
  84. package/dist/data/webapp/accept-language.interceptor.d.ts.map +1 -1
  85. package/dist/data/webapp/client-headers.interceptor.d.ts +4 -3
  86. package/dist/data/webapp/client-headers.interceptor.d.ts.map +1 -1
  87. package/dist/data/webapp/csrf/header.interceptor.d.ts +4 -4
  88. package/dist/data/webapp/csrf/header.interceptor.d.ts.map +1 -1
  89. package/dist/data/webapp/csrf/retry.policy.d.ts +12 -11
  90. package/dist/data/webapp/csrf/retry.policy.d.ts.map +1 -1
  91. package/dist/data/webapp/csrf/token-manager.d.ts +18 -12
  92. package/dist/data/webapp/csrf/token-manager.d.ts.map +1 -1
  93. package/dist/data/webapp/fetch.d.ts +12 -8
  94. package/dist/data/webapp/fetch.d.ts.map +1 -1
  95. package/dist/data/webapp/index.d.ts +12 -7
  96. package/dist/data/webapp/index.d.ts.map +1 -1
  97. package/dist/i18n/locale-format.d.ts +23 -21
  98. package/dist/i18n/locale-format.d.ts.map +1 -1
  99. package/dist/i18n/salesforce-backend.d.ts +19 -11
  100. package/dist/i18n/salesforce-backend.d.ts.map +1 -1
  101. package/dist/i18n/salesforce-detector.d.ts +22 -14
  102. package/dist/i18n/salesforce-detector.d.ts.map +1 -1
  103. package/dist/index.js +3 -3
  104. package/dist/lightning/embedding.d.ts.map +1 -1
  105. package/dist/lightning/index.d.ts +4 -4
  106. package/dist/lightning/index.d.ts.map +1 -1
  107. package/dist/lightning/index.js +2 -2
  108. package/dist/{surface-Dd2tqrPi.js → surface-DWDgqdpN.js} +18 -13
  109. package/dist/telemetry/tool-adapter.d.ts.map +1 -1
  110. package/dist/telemetry/uploader/TelemetryUploader.d.ts.map +1 -1
  111. package/dist/ui-embedding/index.d.ts.map +1 -1
  112. package/dist/ui-embedding/session.d.ts +7 -2
  113. package/dist/ui-embedding/session.d.ts.map +1 -1
  114. package/dist/ui-embedding/session.js +1 -1
  115. package/dist/view/index.js +1 -1
  116. package/package.json +2 -2
@@ -1,33 +1,33 @@
1
- import { g as z, S as b } from "../surface-Dd2tqrPi.js";
2
- import { w as J } from "../sdk-promise-D0sy7OW1.js";
3
- import { buildServiceDescriptor as L, setHeader as y } from "@conduit-client/service-fetch-network/v1";
4
- import { resolvedPromiseLike as l, ok as O, err as x, stableJSONStringify as W, DataNotFoundError as B, UserVisibleError as X, deepFreeze as g, isUserVisibleError as Y } from "@conduit-client/utils";
5
- import { print as N, parse as Z } from "@conduit-client/onestore-graphql-parser/v1";
6
- import { RetryPolicy as ee, buildServiceDescriptor as te } from "@conduit-client/service-retry/v1";
7
- import { buildServiceDescriptor as re } from "@conduit-client/service-cache/v1";
8
- import { buildServiceDescriptor as ne } from "@conduit-client/service-cache-control/v1";
9
- import { buildInMemoryCacheInclusionPolicyService as se } from "@conduit-client/service-cache-inclusion-policy/v1";
10
- import { buildServiceDescriptor as ae } from "@conduit-client/service-pubsub/v1";
11
- import { HttpCacheControlCommand as oe } from "@conduit-client/command-http-cache-control/v1";
12
- const w = /^(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
13
- function ie(t, e) {
14
- const [, r, n] = w.exec(t), [, a, s] = w.exec(e);
1
+ import { g as W, S as b } from "../surface-DWDgqdpN.js";
2
+ import { w as B } from "../sdk-promise-D0sy7OW1.js";
3
+ import { buildServiceDescriptor as V, setHeader as y } from "@conduit-client/service-fetch-network/v1";
4
+ import { resolvedPromiseLike as p, ok as x, err as A, stableJSONStringify as X, DataNotFoundError as Y, UserVisibleError as Z, deepFreeze as v, isUserVisibleError as ee } from "@conduit-client/utils";
5
+ import { print as N, parse as te } from "@conduit-client/onestore-graphql-parser/v1";
6
+ import { RetryPolicy as re, buildServiceDescriptor as ne } from "@conduit-client/service-retry/v1";
7
+ import { buildServiceDescriptor as se } from "@conduit-client/service-cache/v1";
8
+ import { buildServiceDescriptor as ae } from "@conduit-client/service-cache-control/v1";
9
+ import { buildInMemoryCacheInclusionPolicyService as oe } from "@conduit-client/service-cache-inclusion-policy/v1";
10
+ import { buildServiceDescriptor as ie } from "@conduit-client/service-pubsub/v1";
11
+ import { HttpCacheControlCommand as ce } from "@conduit-client/command-http-cache-control/v1";
12
+ const E = /^(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
13
+ function ue(t, e) {
14
+ const [, r, n] = E.exec(t), [, a, s] = E.exec(e);
15
15
  return Number(r) - Number(a) || Number(n) - Number(s);
16
16
  }
17
- function ce(t, e) {
17
+ function he(t, e) {
18
18
  for (const r of t) {
19
19
  const n = r.extension, { label: a } = r, s = n.minApiVersion;
20
20
  if (s !== void 0) {
21
- if (typeof s != "string" || !w.test(s))
21
+ if (typeof s != "string" || !E.test(s))
22
22
  throw new TypeError(
23
23
  `Extension ${a} declares invalid minApiVersion ${JSON.stringify(s)}; expected a Salesforce API version such as "64.0".`
24
24
  );
25
25
  if (e.apiVersion !== void 0) {
26
- if (!w.test(e.apiVersion))
26
+ if (!E.test(e.apiVersion))
27
27
  throw new Error(
28
28
  `Extension ${a} requires Salesforce API version ${s} or later, but the Data SDK exposes invalid apiVersion ${JSON.stringify(e.apiVersion)}.`
29
29
  );
30
- if (ie(e.apiVersion, s) < 0)
30
+ if (ue(e.apiVersion, s) < 0)
31
31
  throw new Error(
32
32
  `Extension ${a} requires Salesforce API version ${s} or later, but the Data SDK uses version ${e.apiVersion}.`
33
33
  );
@@ -35,19 +35,19 @@ function ce(t, e) {
35
35
  }
36
36
  }
37
37
  }
38
- const ue = "X-Salesforce-First-Party";
39
- function he(t, e) {
38
+ const le = "X-Salesforce-First-Party";
39
+ function de(t, e) {
40
40
  if (!t) return !1;
41
41
  const r = e.toLowerCase();
42
42
  return t instanceof Headers ? t.has(e) : Array.isArray(t) ? t.some(([n]) => n.toLowerCase() === r) : Object.keys(t).some((n) => n.toLowerCase() === r);
43
43
  }
44
- function V(t, e, r) {
45
- return !e || !r ? !1 : he(t?.headers, ue);
44
+ function H(t, e, r) {
45
+ return !e || !r ? !1 : de(t?.headers, le);
46
46
  }
47
- function S(t, e, r) {
47
+ function D(t, e, r) {
48
48
  return e ? r ? y("Cookie", `sid=${e}`, t) : y("Authorization", `Bearer ${e}`, t) : t;
49
49
  }
50
- function le({
50
+ function pe({
51
51
  baseUrl: t,
52
52
  accessToken: e,
53
53
  lightningDomain: r,
@@ -57,74 +57,74 @@ function le({
57
57
  const [s, o] = a;
58
58
  if (typeof s == "string" && !s.startsWith("http") && t) {
59
59
  const i = s.startsWith("/") ? s : `/${s}`;
60
- return V(o, n, r) ? l(
61
- S([`${r}${i}`, o], e, !0)
62
- ) : l(S([`${t}${i}`, o], e, !1));
60
+ return H(o, n, r) ? p(
61
+ D([`${r}${i}`, o], e, !0)
62
+ ) : p(D([`${t}${i}`, o], e, !1));
63
63
  }
64
- return l(S(a, e, !1));
64
+ return p(D(a, e, !1));
65
65
  };
66
66
  }
67
- function de(t) {
68
- const e = t.baseUrl || t.accessToken ? [le(t)] : [];
69
- return L({ request: e }).service;
67
+ function fe(t) {
68
+ const e = t.baseUrl || t.accessToken ? [pe(t)] : [];
69
+ return V({ request: e }).service;
70
70
  }
71
- const pe = {
71
+ const me = {
72
72
  "Content-Type": "application/json",
73
73
  Accept: "application/json",
74
74
  "X-Chatter-Entity-Encoding": "false"
75
75
  };
76
- function fe(t) {
76
+ function ye(t) {
77
77
  if (t instanceof Headers) {
78
78
  const e = [];
79
79
  return t.forEach((r, n) => e.push([n, r])), e;
80
80
  }
81
81
  return Array.isArray(t) ? t.map(([e, r]) => [e, r]) : Object.entries(t);
82
82
  }
83
- function H(t, e) {
83
+ function U(t, e) {
84
84
  if (e === void 0) return { ...t };
85
85
  const r = { ...t }, n = /* @__PURE__ */ new Map();
86
86
  for (const s of Object.keys(r)) n.set(s.toLowerCase(), s);
87
87
  const a = /* @__PURE__ */ new Set();
88
- for (const [s, o] of fe(e)) {
88
+ for (const [s, o] of ye(e)) {
89
89
  const i = s.toLowerCase(), c = n.get(i);
90
90
  c === void 0 ? (r[s] = o, n.set(i, s), a.add(i)) : a.has(i) ? r[c] = `${r[c]}, ${o}` : (r[c] = o, a.add(i));
91
91
  }
92
92
  return r;
93
93
  }
94
- function U(t) {
95
- return H(pe, t);
94
+ function G(t) {
95
+ return U(me, t);
96
96
  }
97
- function me(t) {
97
+ function be(t) {
98
98
  if (t === void 0) return;
99
99
  const e = {};
100
100
  return new Headers(t).forEach((r, n) => {
101
101
  e[n] = r;
102
102
  }), Object.keys(e).length > 0 ? e : void 0;
103
103
  }
104
- const ye = 512;
105
- function be(t) {
104
+ const ge = 512;
105
+ function we(t) {
106
106
  return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
107
107
  }
108
- class _ extends Error {
108
+ class T extends Error {
109
109
  status;
110
110
  url;
111
111
  constructor(e) {
112
- const r = e.body.length === 0 ? "empty response body" : "unparseable response body", n = e.body.length === 0 ? "" : ` (starts with: ${JSON.stringify(be(e.body.slice(0, ye)))})`;
112
+ const r = e.body.length === 0 ? "empty response body" : "unparseable response body", n = e.body.length === 0 ? "" : ` (starts with: ${JSON.stringify(we(e.body.slice(0, ge)))})`;
113
113
  super(
114
114
  `${e.surface} GraphQL request to ${e.url} returned HTTP ${e.status} with an ${r}${n}. Expected a JSON GraphQL response; the transport (proxy/gateway/auth) likely did not return one.`
115
115
  ), this.name = "GraphQLTransportError", this.status = e.status, this.url = e.url, this.cause = e.cause;
116
116
  }
117
117
  }
118
- async function G(t, e, r) {
118
+ async function F(t, e, r) {
119
119
  const n = await t.text();
120
120
  let a;
121
121
  try {
122
122
  a = JSON.parse(n);
123
123
  } catch (s) {
124
- throw new _({ surface: e, url: r, status: t.status, body: n, cause: s });
124
+ throw new T({ surface: e, url: r, status: t.status, body: n, cause: s });
125
125
  }
126
126
  if (a === null || typeof a != "object")
127
- throw new _({
127
+ throw new T({
128
128
  surface: e,
129
129
  url: r,
130
130
  status: t.status,
@@ -133,17 +133,17 @@ async function G(t, e, r) {
133
133
  });
134
134
  return a;
135
135
  }
136
- const v = () => {
136
+ const S = () => {
137
137
  }, $ = async () => {
138
138
  };
139
- function A(t) {
139
+ function P(t) {
140
140
  try {
141
- return O(Z(t));
141
+ return x(te(t));
142
142
  } catch (e) {
143
- return x(m(e));
143
+ return A(m(e));
144
144
  }
145
145
  }
146
- function P(t, e) {
146
+ function q(t, e) {
147
147
  const r = t.definitions.filter(
148
148
  (n) => n.kind === "OperationDefinition"
149
149
  );
@@ -157,10 +157,10 @@ function m(t) {
157
157
  }
158
158
  return t instanceof Error ? [{ message: t.message }] : typeof t == "string" ? [{ message: t }] : [{ message: "Unknown error" }];
159
159
  }
160
- async function F(t, { mutation: e, variables: r, operationName: n, headers: a }) {
161
- const s = A(e);
160
+ async function Q(t, { mutation: e, variables: r, operationName: n, headers: a }) {
161
+ const s = P(e);
162
162
  if (s.isErr()) return { data: void 0, errors: s.error };
163
- const o = s.value, i = P(o, n);
163
+ const o = s.value, i = q(o, n);
164
164
  if (i !== "mutation")
165
165
  return {
166
166
  data: void 0,
@@ -188,7 +188,7 @@ async function F(t, { mutation: e, variables: r, operationName: n, headers: a })
188
188
  return { data: void 0, errors: m(c) };
189
189
  }
190
190
  }
191
- function Q(t) {
191
+ function j(t) {
192
192
  function e(n, a, s, o) {
193
193
  return t(
194
194
  {
@@ -212,15 +212,15 @@ function Q(t) {
212
212
  operationName: s,
213
213
  headers: o
214
214
  }) {
215
- const i = A(n);
215
+ const i = P(n);
216
216
  if (i.isErr())
217
217
  return {
218
218
  data: void 0,
219
219
  errors: i.error,
220
- subscribe: () => v,
220
+ subscribe: () => S,
221
221
  refresh: $
222
222
  };
223
- const c = i.value, h = P(c, s);
223
+ const c = i.value, h = q(c, s);
224
224
  if (h !== "query")
225
225
  return {
226
226
  data: void 0,
@@ -229,38 +229,38 @@ function Q(t) {
229
229
  message: `DataSDK.graphql.query() requires a GraphQL query, received ${h}.`
230
230
  }
231
231
  ],
232
- subscribe: () => v,
232
+ subscribe: () => S,
233
233
  refresh: $
234
234
  };
235
- const u = /* @__PURE__ */ new Set(), d = a, p = await e(c, d, s, o);
235
+ const u = /* @__PURE__ */ new Set(), l = a, d = await e(c, l, s, o);
236
236
  return {
237
- data: p.data,
238
- errors: p.errors,
237
+ data: d.data,
238
+ errors: d.errors,
239
239
  subscribe(f) {
240
240
  return u.add(f), () => {
241
241
  u.delete(f);
242
242
  };
243
243
  },
244
244
  async refresh() {
245
- const f = await e(c, d, s, o);
246
- for (const E of u) E(f);
245
+ const f = await e(c, l, s, o);
246
+ for (const w of u) w(f);
247
247
  }
248
248
  };
249
249
  }
250
250
  return {
251
251
  query: r,
252
- mutate: (n) => F(t, n)
252
+ mutate: (n) => Q(t, n)
253
253
  };
254
254
  }
255
- const q = typeof __SF_API_VERSION__ < "u" ? __SF_API_VERSION__ : "65.0";
256
- function j(t = q) {
255
+ const _ = typeof __SF_API_VERSION__ < "u" ? __SF_API_VERSION__ : "65.0";
256
+ function K(t = _) {
257
257
  return `/services/data/v${t}`;
258
258
  }
259
- const ge = {
259
+ const ve = {
260
260
  "Content-Type": "application/json",
261
261
  Accept: "application/json"
262
262
  };
263
- class we {
263
+ class Ee {
264
264
  clientFetch;
265
265
  pathData;
266
266
  baseUrl;
@@ -269,18 +269,18 @@ class we {
269
269
  apiVersion;
270
270
  graphql;
271
271
  constructor(e) {
272
- const r = ve(), n = T(e?.instanceUrl ?? r.instanceUrl), a = e?.accessToken ?? r.accessToken, s = T(
272
+ const r = Se(), n = k(e?.instanceUrl ?? r.instanceUrl), a = e?.accessToken ?? r.accessToken, s = k(
273
273
  e?.lightningDomain ?? r.lightningDomain
274
274
  ), o = e?.isInternal ?? r.isInternal ?? !1;
275
- this.apiVersion = e?.apiVersion ?? r.apiVersion ?? q, this.pathData = j(this.apiVersion), this.baseUrl = n || void 0, this.lightningDomain = s || void 0, this.isInternal = o, this.clientFetch = de({
275
+ this.apiVersion = e?.apiVersion ?? r.apiVersion ?? _, this.pathData = K(this.apiVersion), this.baseUrl = n || void 0, this.lightningDomain = s || void 0, this.isInternal = o, this.clientFetch = fe({
276
276
  baseUrl: n || void 0,
277
277
  accessToken: a,
278
278
  lightningDomain: this.lightningDomain,
279
279
  isInternal: o
280
- }), this.graphql = Q(this.executeRawGraphQL.bind(this));
280
+ }), this.graphql = j(this.executeRawGraphQL.bind(this));
281
281
  }
282
282
  async executeRawGraphQL({ query: e, variables: r, operationName: n, headers: a }, s) {
283
- const o = `${this.pathData}/graphql`, i = H(ge, a), c = V({ headers: i }, this.isInternal, this.lightningDomain) && !!this.baseUrl;
283
+ const o = `${this.pathData}/graphql`, i = U(ve, a), c = H({ headers: i }, this.isInternal, this.lightningDomain) && !!this.baseUrl;
284
284
  if (c && s === "mutation")
285
285
  return {
286
286
  data: void 0,
@@ -302,11 +302,11 @@ class we {
302
302
  body: JSON.stringify({ query: e, variables: r, operationName: n }),
303
303
  headers: i
304
304
  }
305
- }, d = await this.clientFetch(h, u), p = c ? `${o}?queryInput=<redacted>` : h;
306
- return G(d, "Mosaic", p);
305
+ }, l = await this.clientFetch(h, u), d = c ? `${o}?queryInput=<redacted>` : h;
306
+ return F(l, "Mosaic", d);
307
307
  }
308
308
  }
309
- function ve() {
309
+ function Se() {
310
310
  const t = globalThis.MOSAIC_ENV;
311
311
  return {
312
312
  instanceUrl: t?.instanceUrl,
@@ -316,100 +316,109 @@ function ve() {
316
316
  isInternal: t?.isInternal
317
317
  };
318
318
  }
319
- function T(t) {
319
+ function k(t) {
320
320
  if (!t || t === "/") return "";
321
321
  let e = t;
322
322
  return !e.startsWith("/") && !e.startsWith("http") && (e = `/${e}`), e.endsWith("/") && (e = e.slice(0, -1)), e;
323
323
  }
324
- const Ee = "graphqlQuery";
325
- class Se {
324
+ const Ce = "graphqlQuery";
325
+ class De {
326
326
  graphql;
327
327
  constructor() {
328
- this.graphql = Q(this.executeRawGraphQL.bind(this));
328
+ this.graphql = j(this.executeRawGraphQL.bind(this));
329
329
  }
330
330
  /**
331
- * The `headers` request option is intentionally not forwarded: this surface
332
- * delegates to the `graphqlQuery` MCP tool over the ChatGPT bridge, which
333
- * issues the HTTP request host-side and exposes no header channel.
331
+ * This method does not forward the `headers` request option, by design.
332
+ *
333
+ * @remarks
334
+ * This surface delegates to the `graphqlQuery` MCP tool through the
335
+ * ChatGPT bridge. The bridge issues the HTTP request on the host side and
336
+ * exposes no header channel.
334
337
  */
335
338
  async executeRawGraphQL({
336
339
  query: e,
337
340
  variables: r,
338
341
  operationName: n
339
342
  }) {
340
- return (await window.openai.callTool(Ee, {
343
+ return (await window.openai.callTool(Ce, {
341
344
  query: e,
342
345
  ...r != null ? { variables: r } : {},
343
346
  ...n != null ? { operationName: n } : {}
344
347
  })).structuredContent;
345
348
  }
346
349
  }
347
- const C = "Accept-Language", Ce = (t) => {
348
- const e = globalThis.SFDC_ENV?.language;
349
- if (!e)
350
- return l(t);
351
- const [r, n] = t;
352
- return (r instanceof Request && !n?.headers ? r.headers.has(C) : new Headers(n?.headers).has(C)) ? l(t) : l(y(C, e, t));
353
- }, De = "X-SFDC-Client-Name", Oe = "X-SFDC-Client-Version", xe = "@salesforce/platform-sdk", $e = "12.8.0", Ne = (t) => {
354
- let e = y(De, xe, t);
355
- return e = y(Oe, $e, e), l(e);
356
- }, Ae = "X-CSRF-Token";
357
- function Pe(t, e = {}) {
350
+ const g = "Accept-Language";
351
+ function z(t) {
352
+ return t ? void 0 : globalThis.SFDC_ENV?.language;
353
+ }
354
+ function Oe(t) {
355
+ const e = new Headers(t), r = z(e.has(g));
356
+ return r ? (e.set(g, r), e) : t;
357
+ }
358
+ const xe = (t) => {
359
+ const [e, r] = t, n = e instanceof Request && !r?.headers ? e.headers.has(g) : new Headers(r?.headers).has(g), a = z(n);
360
+ return a ? p(y(g, a, t)) : p(t);
361
+ }, Ae = "X-SFDC-Client-Name", $e = "X-SFDC-Client-Version", Ne = "@salesforce/platform-sdk", Pe = "12.10.0", qe = (t) => {
362
+ let e = y(Ae, Ne, t);
363
+ return e = y($e, Pe, e), p(e);
364
+ }, _e = "X-CSRF-Token";
365
+ function Te(t, e = {}) {
358
366
  const { protectedUrls: r = [], alwaysProtectedUrls: n = [] } = e;
359
367
  return async (a) => {
360
368
  const [s, o] = a, i = s instanceof Request ? s.url : s instanceof URL ? s.href : s, c = o?.method ?? (s instanceof Request ? s.method : void 0) ?? "GET";
361
- if (k(n, i) || qe(c) && k(r, i)) {
369
+ if (R(n, i) || ke(c) && R(r, i)) {
362
370
  const u = await t.getToken();
363
- a = y(Ae, u, a);
371
+ a = y(_e, u, a);
364
372
  }
365
- return l(a);
373
+ return p(a);
366
374
  };
367
375
  }
368
- function qe(t) {
376
+ function ke(t) {
369
377
  const e = t.toLowerCase();
370
378
  return e === "post" || e === "put" || e === "patch" || e === "delete";
371
379
  }
372
- function k(t, e) {
380
+ function R(t, e) {
373
381
  const r = new URL(e, globalThis.location?.href ?? "http://localhost");
374
382
  return t.some((n) => r.pathname.includes(n));
375
383
  }
376
- function _e(t, e = {}) {
377
- const r = Pe(t, e);
384
+ function Re(t, e = {}) {
385
+ const r = Te(t, e);
378
386
  async function n(a) {
379
387
  const s = await r(a);
380
388
  return fetch(s[0], s[1]);
381
389
  }
382
390
  return (a, s) => s ? s.applyRetry(async () => n(a)) : n(a);
383
391
  }
384
- const Te = [400, 401, 403];
385
- class ke extends ee {
392
+ const Ie = [400, 401, 403];
393
+ class Le extends re {
386
394
  constructor(e) {
387
395
  super(e), this.csrfTokenManager = e;
388
396
  }
389
397
  csrfTokenManager;
390
398
  /**
391
- * Determines if a failed request should be retried due to CSRF token issues.
399
+ * Returns true when a CSRF token issue caused the request to fail.
392
400
  */
393
401
  async shouldRetry(e, r) {
394
- return r.attempt >= 1 ? !1 : Te.includes(e.status);
402
+ return r.attempt >= 1 ? !1 : Ie.includes(e.status);
395
403
  }
396
404
  /**
397
- * CSRF token refresh should happen immediately with no delay.
405
+ * Returns zero, so the CSRF token refresh happens immediately with no added delay.
398
406
  */
399
407
  async calculateDelay(e, r) {
400
408
  return 0;
401
409
  }
402
410
  /**
403
- * Called by retry service before each retry attempt.
411
+ * Refreshes the CSRF token before the retry service retries the request.
404
412
  *
405
- * @param _result - The failed response that triggered the retry (unused, already validated)
406
- * @param _context - Current retry context (unused but part of interface)
413
+ * @param _result - The failed response that triggered the retry. Unused; `shouldRetry`
414
+ * already validated it.
415
+ * @param _context - The current retry context. Unused, but required by the interface.
407
416
  */
408
417
  async prepareRetry(e, r) {
409
418
  await this.csrfTokenManager.refreshToken();
410
419
  }
411
420
  }
412
- class Re {
421
+ class Me {
413
422
  constructor(e, r) {
414
423
  this.endpoint = e, this.cacheName = r, this.tokenPromise = this.obtainToken();
415
424
  }
@@ -418,16 +427,20 @@ class Re {
418
427
  tokenPromise;
419
428
  refreshPromise;
420
429
  /**
421
- * Returns the current token value as a Promise.
422
- * Lazy-loads the token on first call (from cache or by fetching).
430
+ * Returns the current CSRF token.
431
+ *
432
+ * @remarks
433
+ * The first call loads the token lazily, either from the cache or with a fetch request.
423
434
  */
424
435
  async getToken() {
425
436
  return this.tokenPromise;
426
437
  }
427
438
  /**
428
- * Obtains and returns a new token value as a promise.
429
- * This will clear the cached token and fetch a fresh one.
430
- * If a refresh is already in progress, all callers share the same in-flight promise.
439
+ * Clears the cached CSRF token and fetches a fresh one.
440
+ *
441
+ * @remarks
442
+ * The returned promise resolves to the new token. When a refresh is already in progress,
443
+ * every caller shares the same in-flight promise.
431
444
  */
432
445
  refreshToken() {
433
446
  return this.refreshPromise || (this.refreshPromise = this.withCache((e) => e.delete(this.endpoint)).then(() => (this.tokenPromise = this.obtainToken(), this.tokenPromise)).finally(() => {
@@ -435,9 +448,9 @@ class Re {
435
448
  })), this.refreshPromise;
436
449
  }
437
450
  /**
438
- * Obtains a CSRF token, using cache when available or fetching a new one.
451
+ * Returns a CSRF token from the cache, or fetches a new one when the cache has none.
439
452
  *
440
- * @returns Promise that resolves to the CSRF token string
453
+ * @returns The CSRF token.
441
454
  */
442
455
  async obtainToken() {
443
456
  let e = await this.withCache((a) => a.match(this.endpoint)), r = !1;
@@ -446,10 +459,10 @@ class Re {
446
459
  return r && await this.withCache((a) => a.put(this.endpoint, e)), n;
447
460
  }
448
461
  /**
449
- * Provides a safe way to interact with the Cache API with fallback for unsupported environments.
462
+ * Runs a callback against the Cache API, and returns `undefined` when the API is unavailable.
450
463
  *
451
- * @param callback - Function that receives the cache instance and returns a promise
452
- * @returns The result of the callback, or undefined if caches API is not available
464
+ * @param callback - The function that receives the cache instance and returns a promise.
465
+ * @returns The result of the callback, or `undefined` when the Cache API is not available.
453
466
  */
454
467
  async withCache(e) {
455
468
  if (this.cacheName && caches) {
@@ -459,29 +472,29 @@ class Re {
459
472
  return;
460
473
  }
461
474
  }
462
- const R = /* @__PURE__ */ new Map();
463
- function Ie(t) {
475
+ const I = /* @__PURE__ */ new Map();
476
+ function Ve(t) {
464
477
  const { endpoint: e, cacheName: r, ...n } = t.csrf;
465
- let a = R.get(e);
466
- return a || (a = new Re(e, r), R.set(e, a)), L(
478
+ let a = I.get(e);
479
+ return a || (a = new Me(e, r), I.set(e, a)), V(
467
480
  {
468
- retry: _e(a, n),
469
- request: [Ne, Ce]
481
+ retry: Re(a, n),
482
+ request: [qe, xe]
470
483
  },
471
- te(new ke(a)).service
484
+ ne(new Le(a)).service
472
485
  ).service;
473
486
  }
474
- const I = /* @__PURE__ */ new Map();
475
- function Me(t) {
476
- let e = I.get(t);
487
+ const L = /* @__PURE__ */ new Map();
488
+ function He(t) {
489
+ let e = L.get(t);
477
490
  if (!e) {
478
- const r = re().service, n = se(r).service, a = ne(r, n).service, s = ae().service;
479
- e = { cache: r, cacheController: a, pubSub: s }, I.set(t, e);
491
+ const r = se().service, n = oe(r).service, a = ae(r, n).service, s = ie().service;
492
+ e = { cache: r, cacheController: a, pubSub: s }, L.set(t, e);
480
493
  }
481
494
  return e;
482
495
  }
483
- function Le(t, e) {
484
- const r = Me(t);
496
+ function Ue(t, e) {
497
+ const r = He(t);
485
498
  return {
486
499
  shared: r,
487
500
  services: {
@@ -492,7 +505,7 @@ function Le(t, e) {
492
505
  };
493
506
  }
494
507
  const M = 300;
495
- function Ve(t, e) {
508
+ function Ge(t, e) {
496
509
  try {
497
510
  return JSON.parse(JSON.stringify(t));
498
511
  } catch (r) {
@@ -502,19 +515,19 @@ function Ve(t, e) {
502
515
  throw a.cause = r, a;
503
516
  }
504
517
  }
505
- function He(t) {
518
+ function Fe(t) {
506
519
  if (typeof t == "object" && t.type === "max-age") {
507
520
  const e = t.maxAge;
508
521
  return Number.isFinite(e) && e >= 0 ? e : M;
509
522
  }
510
523
  return M;
511
524
  }
512
- class Ue extends oe {
525
+ class Qe extends ce {
513
526
  constructor(e, r, n) {
514
- super(r), this.url = n, this.query = e.query, this.normalizedOperationName = e.operationName ?? "", this.normalizedVariables = Ve(
527
+ super(r), this.url = n, this.query = e.query, this.normalizedOperationName = e.operationName ?? "", this.normalizedVariables = Ge(
515
528
  e.variables ?? {},
516
529
  this.normalizedOperationName
517
- ), this.cacheControl = e.cacheControl, this.resolvedMaxAge = He(e.cacheControl), this.headers = e.headers, this.headersKey = me(e.headers);
530
+ ), this.cacheControl = e.cacheControl, this.resolvedMaxAge = Fe(e.cacheControl), this.headers = e.headers, this.headersKey = be(e.headers);
518
531
  }
519
532
  url;
520
533
  query;
@@ -529,7 +542,7 @@ class Ue extends oe {
529
542
  this.url,
530
543
  {
531
544
  method: "POST",
532
- headers: U(this.headers),
545
+ headers: G(this.headers),
533
546
  body: JSON.stringify({
534
547
  query: this.query,
535
548
  variables: this.normalizedVariables,
@@ -544,26 +557,27 @@ class Ue extends oe {
544
557
  variables: this.normalizedVariables,
545
558
  operationName: this.normalizedOperationName
546
559
  };
547
- return this.headersKey !== void 0 && (e.headers = this.headersKey), W(e);
560
+ return this.headersKey !== void 0 && (e.headers = this.headersKey), X(e);
548
561
  }
549
562
  /**
550
- * Reads from the cache and returns the cache result or error
563
+ * Reads the cached result for this command, or returns an error.
551
564
  *
552
- * In case of a missing or partial result, this should return either a DataNotFoundError or
553
- * DataIncompleteError, respectively, in the Error response
565
+ * @remarks
566
+ * When the result is missing or partial, this method returns a
567
+ * `DataNotFoundError` or a `DataIncompleteError` in the error response.
554
568
  *
555
- * Note that any subclass should JUST try to read the data from the cache here; it should
556
- * NOT try to take metadata (eg cache control semantics) into account while reading the
557
- * data. The CacheController is responsible for enforcing those semantics.
569
+ * A subclass must only read data from the cache here. It must not apply
570
+ * metadata, for example cache-control semantics, while it reads the data.
571
+ * The `CacheController` enforces that metadata separately.
558
572
  *
559
- * @param cache source of cached data
560
- * @returns result or error from the cache
573
+ * @param cache - The source of the cached data.
574
+ * @returns The result or error from the cache.
561
575
  */
562
576
  readFromCache(e) {
563
577
  const r = this.buildKey(), n = e.get(r)?.value;
564
- return n === void 0 ? l(
565
- x(new B("No cached entry found for this query."))
566
- ) : l(O(n));
578
+ return n === void 0 ? p(
579
+ A(new Y("No cached entry found for this query."))
580
+ ) : p(x(n));
567
581
  }
568
582
  writeToCache(e, r) {
569
583
  if (r.isOk() && r.value.data != null && Object.keys(r.value.data).length > 0) {
@@ -579,7 +593,7 @@ class Ue extends oe {
579
593
  }
580
594
  });
581
595
  }
582
- return l(void 0);
596
+ return p(void 0);
583
597
  }
584
598
  get cacheControlStrategyConfig() {
585
599
  const e = Math.floor(Date.now() / 1e3);
@@ -593,41 +607,41 @@ class Ue extends oe {
593
607
  return e.errors && e.errors.length > 0;
594
608
  }
595
609
  processFetchReturnValue(e) {
596
- return this.responseHasErrors(e) ? x(new X(e)) : O(e);
610
+ return this.responseHasErrors(e) ? A(new Z(e)) : x(e);
597
611
  }
598
612
  }
599
- const Ge = "CACHE_MISS";
600
- function Fe() {
613
+ const je = "CACHE_MISS";
614
+ function Ke() {
601
615
  return [
602
616
  {
603
617
  message: "No cached entry found for this query (cacheControl: 'only-if-cached').",
604
- extensions: { code: Ge }
618
+ extensions: { code: je }
605
619
  }
606
620
  ];
607
621
  }
608
- function K(t) {
609
- if (Y(t) && t.data && typeof t.data == "object") {
622
+ function J(t) {
623
+ if (ee(t) && t.data && typeof t.data == "object") {
610
624
  const e = t.data;
611
625
  if (e.data != null)
612
626
  return e.data;
613
627
  }
614
628
  }
615
- function Qe(t) {
629
+ function ze(t) {
616
630
  return (e) => {
617
631
  if (e.isOk()) {
618
632
  const r = e.value;
619
- g(r), t({ data: r, errors: void 0 });
633
+ v(r), t({ data: r, errors: void 0 });
620
634
  } else {
621
- const r = K(e.error);
622
- r && g(r), t({ data: r, errors: m(e.error) });
635
+ const r = J(e.error);
636
+ r && v(r), t({ data: r, errors: m(e.error) });
623
637
  }
624
638
  };
625
639
  }
626
- async function je(t, e = !1) {
640
+ async function Je(t, e = !1) {
627
641
  let r, n, a;
628
642
  try {
629
643
  const s = await t.execute();
630
- s.isOk() ? (r = s.value.data, g(r), a = (o) => s.value.subscribe(o)) : (r = K(s.error.failure), r && g(r), n = e && r === void 0 ? Fe() : m(s.error.failure), a = (o) => s.error.subscribe(o));
644
+ s.isOk() ? (r = s.value.data, v(r), a = (o) => s.value.subscribe(o)) : (r = J(s.error.failure), r && v(r), n = e && r === void 0 ? Ke() : m(s.error.failure), a = (o) => s.error.subscribe(o));
631
645
  } catch (s) {
632
646
  n = m(s);
633
647
  }
@@ -635,68 +649,70 @@ async function je(t, e = !1) {
635
649
  data: r,
636
650
  errors: n,
637
651
  subscribe(s) {
638
- return a ? a(Qe(s)) : v;
652
+ return a ? a(ze(s)) : S;
639
653
  },
640
654
  async refresh() {
641
655
  await t.refresh();
642
656
  }
643
657
  };
644
658
  }
645
- function D(t) {
659
+ function O(t) {
646
660
  return {
647
661
  data: void 0,
648
662
  errors: t,
649
- subscribe: () => v,
663
+ subscribe: () => S,
650
664
  refresh: $
651
665
  };
652
666
  }
653
- function Ke({
667
+ function We({
654
668
  bundle: t,
655
669
  url: e,
656
- executeRaw: r
670
+ executeRaw: r,
671
+ resolveEffectiveHeaders: n
657
672
  }) {
658
- const { services: n } = t;
659
- async function a({
660
- query: s,
661
- variables: o,
662
- operationName: i,
663
- cacheControl: c,
664
- headers: h
673
+ const { services: a } = t;
674
+ async function s({
675
+ query: o,
676
+ variables: i,
677
+ operationName: c,
678
+ cacheControl: h,
679
+ headers: u
665
680
  }) {
666
- const u = A(s);
667
- if (u.isErr()) return D(u.error);
668
- const d = u.value, p = P(d, i);
669
- if (p !== "query")
670
- return D([
681
+ const l = P(o);
682
+ if (l.isErr()) return O(l.error);
683
+ const d = l.value, f = q(d, c);
684
+ if (f !== "query")
685
+ return O([
671
686
  {
672
- message: `DataSDK.graphql.query() requires a GraphQL query, received ${p}.`
687
+ message: `DataSDK.graphql.query() requires a GraphQL query, received ${f}.`
673
688
  }
674
689
  ]);
675
- let f;
690
+ let w;
676
691
  try {
677
- f = new Ue(
692
+ const C = n ? n(u) : u;
693
+ w = new Qe(
678
694
  {
679
695
  query: N(d),
680
- variables: o,
681
- operationName: i,
682
- cacheControl: c,
683
- headers: h
696
+ variables: i,
697
+ operationName: c,
698
+ cacheControl: h,
699
+ headers: C
684
700
  },
685
- n,
701
+ a,
686
702
  e
687
703
  );
688
- } catch (E) {
689
- return D(m(E));
704
+ } catch (C) {
705
+ return O(m(C));
690
706
  }
691
- return je(f, c === "only-if-cached");
707
+ return Je(w, h === "only-if-cached");
692
708
  }
693
709
  return {
694
- query: a,
695
- mutate: (s) => F(r, s)
710
+ query: s,
711
+ mutate: (o) => Q(r, o)
696
712
  };
697
713
  }
698
- const ze = 1, Je = `@salesforce/platform-sdk-data_v${ze}`;
699
- class We {
714
+ const Be = 1, Xe = `@salesforce/platform-sdk-data_v${Be}`;
715
+ class Ye {
700
716
  baseUrl;
701
717
  pathData;
702
718
  clientFetch;
@@ -704,22 +720,23 @@ class We {
704
720
  apiVersion;
705
721
  graphql;
706
722
  constructor(e) {
707
- const r = Be();
708
- this.baseUrl = Xe(e?.basePath ?? r.apiPath), this.apiVersion = e?.apiVersion ?? q, this.pathData = j(this.apiVersion);
723
+ const r = Ze();
724
+ this.baseUrl = et(e?.basePath ?? r.apiPath), this.apiVersion = e?.apiVersion ?? _, this.pathData = K(this.apiVersion);
709
725
  const n = `${this.pathData}/ui-api`, a = `${this.pathData}/graphql`;
710
- this.onStatus = e?.onStatus ?? {}, this.clientFetch = Ie({
726
+ this.onStatus = e?.onStatus ?? {}, this.clientFetch = Ve({
711
727
  csrf: {
712
728
  endpoint: `${this.baseUrl}${n}/session/csrf`,
713
- cacheName: Je,
729
+ cacheName: Xe,
714
730
  protectedUrls: ["services/data/v", "services/apexrest"],
715
731
  alwaysProtectedUrls: ["services/apexrest"]
716
732
  }
717
733
  });
718
- const s = (i, c) => this.fetch(i, c), o = Le(`${this.baseUrl}${this.pathData}`, s);
719
- this.graphql = Ke({
734
+ const s = (i, c) => this.fetch(i, c), o = Ue(`${this.baseUrl}${this.pathData}`, s);
735
+ this.graphql = We({
720
736
  bundle: o,
721
737
  url: a,
722
- executeRaw: this.executeRawGraphQL.bind(this)
738
+ executeRaw: this.executeRawGraphQL.bind(this),
739
+ resolveEffectiveHeaders: Oe
723
740
  });
724
741
  }
725
742
  async fetch(e, r) {
@@ -727,10 +744,12 @@ class We {
727
744
  return await this.onStatus[a.status]?.(), a;
728
745
  }
729
746
  /**
730
- * Raw GraphQL POST. On the WebApp surface this is the mutate-only path:
731
- * `graphql.mutate` calls it directly. The `graphql.query` (cache) path does
732
- * NOT route through here — the OneStore cache command in `@conduit-client`
733
- * issues its own fetch and parses the response itself.
747
+ * Sends a raw GraphQL POST request.
748
+ *
749
+ * @remarks
750
+ * On the WebApp surface, this is the mutate-only path: `graphql.mutate` calls this method
751
+ * directly. The `graphql.query` (cache) path does not route through this method. The OneStore
752
+ * cache command in `@conduit-client` issues its own fetch and parses the response itself.
734
753
  */
735
754
  async executeRawGraphQL({
736
755
  query: e,
@@ -741,13 +760,16 @@ class We {
741
760
  const s = `${this.pathData}/graphql`, o = await this.fetch(s, {
742
761
  method: "POST",
743
762
  body: JSON.stringify({ query: e, variables: r, operationName: n }),
744
- headers: U(a)
763
+ headers: G(a)
745
764
  });
746
- return G(o, "WebApp", s);
765
+ return F(o, "WebApp", s);
747
766
  }
748
767
  /**
749
- * If the url is relative, convert to it to an absolute Salesforce URL. This is due to the way Code
750
- * Builder deployments structure the url for Salesforce
768
+ * Converts a relative URL to an absolute Salesforce URL.
769
+ *
770
+ * @remarks
771
+ * Code Builder deployments need this conversion, because they structure Salesforce URLs
772
+ * differently.
751
773
  */
752
774
  applySalesforceBase(e) {
753
775
  if (typeof e == "string") {
@@ -759,17 +781,17 @@ class We {
759
781
  return e;
760
782
  }
761
783
  }
762
- function Be() {
784
+ function Ze() {
763
785
  return {
764
786
  apiPath: globalThis.SFDC_ENV?.apiPath
765
787
  };
766
788
  }
767
- function Xe(t) {
789
+ function et(t) {
768
790
  if (!t || t === "/") return "";
769
791
  let e = t;
770
792
  return e.startsWith("/") || (e = `/${e}`), e.endsWith("/") && (e = e.slice(0, -1)), e;
771
793
  }
772
- function Ye(t) {
794
+ function tt(t) {
773
795
  const e = t, r = typeof e == "object" && e !== null ? e : void 0, n = r !== void 0 && "setup" in r, a = n ? r : r?.extension, s = n ? a?.name : r?.as;
774
796
  if (typeof a?.setup != "function")
775
797
  throw new Error("Extension entry cannot attach: it is missing a setup function.");
@@ -783,14 +805,14 @@ function Ye(t) {
783
805
  label: s === a.name ? `"${a.name}"` : `"${a.name}" (aliased as "${s}")`
784
806
  };
785
807
  }
786
- async function Ze(t, e, r) {
808
+ async function rt(t, e, r) {
787
809
  if (e.length === 0)
788
810
  return t;
789
811
  if ("ext" in t)
790
812
  throw new Error(
791
813
  'Cannot attach extensions: the base SDK already declares an "ext" member, which the extension container reserves.'
792
814
  );
793
- const n = e.map(Ye);
815
+ const n = e.map(tt);
794
816
  r?.preflight?.(n, t);
795
817
  const a = Object.create(t), s = /* @__PURE__ */ Object.create(null), o = (h) => {
796
818
  throw new Error(`Cannot write "ext.${String(h)}" — ext is immutable once attached.`);
@@ -806,10 +828,11 @@ async function Ze(t, e, r) {
806
828
  deleteProperty(h, u) {
807
829
  return o(u);
808
830
  },
809
- // Without these two, `preventExtensions`/`setPrototypeOf` fall through to the
810
- // real `store` (no per-property trap catches them) — the first would silently
811
- // block later extensions from mounting, the second could inject a readable
812
- // property via the prototype chain that no extension ever returned.
831
+ // Without these two traps, `preventExtensions` and `setPrototypeOf`
832
+ // fall through to the real `store`, because no per-property trap
833
+ // catches them. The first would silently block later extensions from
834
+ // mounting. The second could inject a readable property, through the
835
+ // prototype chain, that no extension ever returned.
813
836
  preventExtensions() {
814
837
  return i("prevent extensions on");
815
838
  },
@@ -823,19 +846,19 @@ async function Ze(t, e, r) {
823
846
  writable: !1,
824
847
  configurable: !1
825
848
  });
826
- for (const { extension: h, mountName: u, label: d } of n) {
849
+ for (const { extension: h, mountName: u, label: l } of n) {
827
850
  if (Object.hasOwn(s, u))
828
851
  throw new Error(
829
- `Extension ${d} cannot attach: "${u}" is already defined by another extension.`
852
+ `Extension ${l} cannot attach: "${u}" is already defined by another extension.`
830
853
  );
831
- let p;
854
+ let d;
832
855
  try {
833
- p = await h.setup(a);
856
+ d = await h.setup(a);
834
857
  } catch (f) {
835
- throw new Error(`Extension ${d} failed during setup.`, { cause: f });
858
+ throw new Error(`Extension ${l} failed during setup.`, { cause: f });
836
859
  }
837
860
  Object.defineProperty(s, u, {
838
- value: p,
861
+ value: d,
839
862
  enumerable: !0,
840
863
  writable: !1,
841
864
  configurable: !1
@@ -843,25 +866,25 @@ async function Ze(t, e, r) {
843
866
  }
844
867
  return Object.freeze(s), a;
845
868
  }
846
- function dt(t, ...e) {
869
+ function mt(t, ...e) {
847
870
  let r = t[0] ?? "";
848
871
  for (let n = 0; n < e.length; n += 1)
849
872
  r += String(e[n]) + (t[n + 1] ?? "");
850
873
  return r;
851
874
  }
852
- function pt(t) {
875
+ function yt(t) {
853
876
  return t;
854
877
  }
855
- async function et(t) {
878
+ async function nt(t) {
856
879
  try {
857
- switch (await z(t?.surface)) {
880
+ switch (await W(t?.surface)) {
858
881
  case b.OpenAI:
859
- return new Se();
882
+ return new De();
860
883
  case b.WebApp:
861
884
  case b.MicroFrontend:
862
- return new We(t?.webapp);
885
+ return new Ye(t?.webapp);
863
886
  case b.Mosaic:
864
- return new we(t?.mosaic);
887
+ return new Ee(t?.mosaic);
865
888
  case b.MCPApps:
866
889
  return {};
867
890
  default:
@@ -871,19 +894,19 @@ async function et(t) {
871
894
  return {};
872
895
  }
873
896
  }
874
- function ft(t) {
875
- return J(
897
+ function bt(t) {
898
+ return B(
876
899
  (async () => {
877
- const e = await et(t);
878
- return Ze(e, t?.extensions ?? [], {
879
- preflight: ce
900
+ const e = await nt(t);
901
+ return rt(e, t?.extensions ?? [], {
902
+ preflight: he
880
903
  });
881
904
  })(),
882
905
  "createDataSDK"
883
906
  );
884
907
  }
885
908
  export {
886
- ft as createDataSDK,
887
- pt as defineDataExtension,
888
- dt as gql
909
+ bt as createDataSDK,
910
+ yt as defineDataExtension,
911
+ mt as gql
889
912
  };