@salesforce/platform-sdk 12.13.0 → 12.14.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.
@@ -1,51 +1,51 @@
1
- import { g as Y, S as m, a as I } from "../surface-Cg3eyRpj.js";
2
- import { w as Z } from "../sdk-promise-D0sy7OW1.js";
3
- import { print as N, parse as ee } from "@conduit-client/onestore-graphql-parser/v1";
4
- import { ok as q, err as x, resolvedPromiseLike as p, stableJSONStringify as te, DataNotFoundError as re, UserVisibleError as ne, deepFreeze as v, isUserVisibleError as se } from "@conduit-client/utils";
5
- import { buildServiceDescriptor as j, setHeader as b } from "@conduit-client/service-fetch-network/v1";
6
- import { RetryPolicy as ae, buildServiceDescriptor as oe } from "@conduit-client/service-retry/v1";
7
- import { buildServiceDescriptor as ie } from "@conduit-client/service-cache/v1";
8
- import { buildServiceDescriptor as ce } from "@conduit-client/service-cache-control/v1";
9
- import { buildInMemoryCacheInclusionPolicyService as ue } from "@conduit-client/service-cache-inclusion-policy/v1";
10
- import { buildServiceDescriptor as he } from "@conduit-client/service-pubsub/v1";
11
- import { HttpCacheControlCommand as le } from "@conduit-client/command-http-cache-control/v1";
12
- const S = /^(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
13
- function de(t, e) {
14
- const [, r, n] = S.exec(t), [, a, s] = S.exec(e);
15
- return Number(r) - Number(a) || Number(n) - Number(s);
1
+ import { g as X, S as m, a as _ } from "../surface-Cg3eyRpj.js";
2
+ import { w as Y } from "../sdk-promise-D0sy7OW1.js";
3
+ import { print as k, parse as Z } from "@conduit-client/onestore-graphql-parser/v1";
4
+ import { ok as O, err as q, resolvedPromiseLike as d, stableJSONStringify as ee, DataNotFoundError as te, UserVisibleError as re, deepFreeze as v, isUserVisibleError as ne } from "@conduit-client/utils";
5
+ import { buildServiceDescriptor as H, setHeader as w } from "@conduit-client/service-fetch-network/v1";
6
+ import { RetryPolicy as se, buildServiceDescriptor as ae } from "@conduit-client/service-retry/v1";
7
+ import { buildServiceDescriptor as oe } from "@conduit-client/service-cache/v1";
8
+ import { buildServiceDescriptor as ie } from "@conduit-client/service-cache-control/v1";
9
+ import { buildInMemoryCacheInclusionPolicyService as ce } from "@conduit-client/service-cache-inclusion-policy/v1";
10
+ import { buildServiceDescriptor as ue } from "@conduit-client/service-pubsub/v1";
11
+ import { HttpCacheControlCommand as he } from "@conduit-client/command-http-cache-control/v1";
12
+ const E = /^(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
13
+ function le(t, e) {
14
+ const [, r, n] = E.exec(t), [, s, a] = E.exec(e);
15
+ return Number(r) - Number(s) || Number(n) - Number(a);
16
16
  }
17
17
  function pe(t, e) {
18
18
  for (const r of t) {
19
- const n = r.extension, { label: a } = r, s = n.minApiVersion;
20
- if (s !== void 0) {
21
- if (typeof s != "string" || !S.test(s))
19
+ const n = r.extension, { label: s } = r, a = n.minApiVersion;
20
+ if (a !== void 0) {
21
+ if (typeof a != "string" || !E.test(a))
22
22
  throw new TypeError(
23
- `Extension ${a} declares invalid minApiVersion ${JSON.stringify(s)}; expected a Salesforce API version such as "64.0".`
23
+ `Extension ${s} declares invalid minApiVersion ${JSON.stringify(a)}; expected a Salesforce API version such as "64.0".`
24
24
  );
25
25
  if (e.apiVersion !== void 0) {
26
- if (!S.test(e.apiVersion))
26
+ if (!E.test(e.apiVersion))
27
27
  throw new Error(
28
- `Extension ${a} requires Salesforce API version ${s} or later, but the Data SDK exposes invalid apiVersion ${JSON.stringify(e.apiVersion)}.`
28
+ `Extension ${s} requires Salesforce API version ${a} or later, but the Data SDK exposes invalid apiVersion ${JSON.stringify(e.apiVersion)}.`
29
29
  );
30
- if (de(e.apiVersion, s) < 0)
30
+ if (le(e.apiVersion, a) < 0)
31
31
  throw new Error(
32
- `Extension ${a} requires Salesforce API version ${s} or later, but the Data SDK uses version ${e.apiVersion}.`
32
+ `Extension ${s} requires Salesforce API version ${a} or later, but the Data SDK uses version ${e.apiVersion}.`
33
33
  );
34
34
  }
35
35
  }
36
36
  }
37
37
  }
38
- const E = () => {
39
- }, $ = async () => {
38
+ const S = () => {
39
+ }, x = async () => {
40
40
  };
41
- function P(t) {
41
+ function N(t) {
42
42
  try {
43
- return q(ee(t));
43
+ return O(Z(t));
44
44
  } catch (e) {
45
- return x(y(e));
45
+ return q(y(e));
46
46
  }
47
47
  }
48
- function _(t, e) {
48
+ function P(t, e) {
49
49
  const r = t.definitions.filter(
50
50
  (n) => n.kind === "OperationDefinition"
51
51
  );
@@ -59,10 +59,10 @@ function y(t) {
59
59
  }
60
60
  return t instanceof Error ? [{ message: t.message }] : typeof t == "string" ? [{ message: t }] : [{ message: "Unknown error" }];
61
61
  }
62
- async function F(t, { mutation: e, variables: r, operationName: n, headers: a }) {
63
- const s = P(e);
64
- if (s.isErr()) return { data: void 0, errors: s.error };
65
- const o = s.value, i = _(o, n);
62
+ async function U(t, { mutation: e, variables: r, operationName: n, headers: s }) {
63
+ const a = N(e);
64
+ if (a.isErr()) return { data: void 0, errors: a.error };
65
+ const o = a.value, i = P(o, n);
66
66
  if (i !== "mutation")
67
67
  return {
68
68
  data: void 0,
@@ -75,10 +75,10 @@ async function F(t, { mutation: e, variables: r, operationName: n, headers: a })
75
75
  try {
76
76
  const c = await t(
77
77
  {
78
- query: N(o),
78
+ query: k(o),
79
79
  variables: r,
80
80
  operationName: n,
81
- headers: a
81
+ headers: s
82
82
  },
83
83
  "mutation"
84
84
  );
@@ -91,12 +91,12 @@ async function F(t, { mutation: e, variables: r, operationName: n, headers: a })
91
91
  }
92
92
  }
93
93
  function T(t) {
94
- function e(n, a, s, o) {
94
+ function e(n, s, a, o) {
95
95
  return t(
96
96
  {
97
- query: N(n),
98
- variables: a,
99
- operationName: s,
97
+ query: k(n),
98
+ variables: s,
99
+ operationName: a,
100
100
  headers: o
101
101
  },
102
102
  "query"
@@ -110,19 +110,19 @@ function T(t) {
110
110
  }
111
111
  async function r({
112
112
  query: n,
113
- variables: a,
114
- operationName: s,
113
+ variables: s,
114
+ operationName: a,
115
115
  headers: o
116
116
  }) {
117
- const i = P(n);
117
+ const i = N(n);
118
118
  if (i.isErr())
119
119
  return {
120
120
  data: void 0,
121
121
  errors: i.error,
122
- subscribe: () => E,
123
- refresh: $
122
+ subscribe: () => S,
123
+ refresh: x
124
124
  };
125
- const c = i.value, h = _(c, s);
125
+ const c = i.value, h = P(c, a);
126
126
  if (h !== "query")
127
127
  return {
128
128
  data: void 0,
@@ -131,34 +131,34 @@ function T(t) {
131
131
  message: `DataSDK.graphql.query() requires a GraphQL query, received ${h}.`
132
132
  }
133
133
  ],
134
- subscribe: () => E,
135
- refresh: $
134
+ subscribe: () => S,
135
+ refresh: x
136
136
  };
137
- const u = /* @__PURE__ */ new Set(), l = a, d = await e(c, l, s, o);
137
+ const u = /* @__PURE__ */ new Set(), l = s, p = await e(c, l, a, o);
138
138
  return {
139
- data: d.data,
140
- errors: d.errors,
139
+ data: p.data,
140
+ errors: p.errors,
141
141
  subscribe(f) {
142
142
  return u.add(f), () => {
143
143
  u.delete(f);
144
144
  };
145
145
  },
146
146
  async refresh() {
147
- const f = await e(c, l, s, o);
148
- for (const w of u) w(f);
147
+ const f = await e(c, l, a, o);
148
+ for (const g of u) g(f);
149
149
  }
150
150
  };
151
151
  }
152
152
  return {
153
153
  query: r,
154
- mutate: (n) => F(t, n)
154
+ mutate: (n) => U(t, n)
155
155
  };
156
156
  }
157
- const D = typeof __SF_API_VERSION__ < "u" ? __SF_API_VERSION__ : "65.0";
158
- function L(t = D) {
157
+ const C = typeof __SF_API_VERSION__ < "u" ? __SF_API_VERSION__ : "65.0";
158
+ function $(t = C) {
159
159
  return `/services/data/v${t}`;
160
160
  }
161
- function fe(t) {
161
+ function de(t) {
162
162
  if (Array.isArray(t)) {
163
163
  for (const e of t)
164
164
  if (!(e?.type !== "text" || !e.text))
@@ -170,11 +170,11 @@ function fe(t) {
170
170
  }
171
171
  }
172
172
  }
173
- function ye(t) {
173
+ function fe(t) {
174
174
  const e = t;
175
175
  return e?.code === -32601 || e?.code === -32602 && typeof e.message == "string" && /^Unknown tool\b/i.test(e.message);
176
176
  }
177
- function k(t) {
177
+ function R(t) {
178
178
  if (typeof t != "object" || Array.isArray(t)) return !1;
179
179
  if (!Object.hasOwn(t, "errors")) return Object.hasOwn(t, "data");
180
180
  const { errors: e } = t;
@@ -182,211 +182,175 @@ function k(t) {
182
182
  (r) => r !== null && typeof r == "object" && !Array.isArray(r) && typeof r.message == "string"
183
183
  );
184
184
  }
185
- class R {
185
+ class L {
186
186
  graphql;
187
187
  apiVersion;
188
188
  #e;
189
189
  constructor(e, r) {
190
- if (this.#e = e, this.apiVersion = r?.apiVersion ?? D, typeof this.apiVersion != "string" || !/^(0|[1-9]\d*)\.(0|[1-9]\d*)(?![\s\S])/.test(this.apiVersion))
190
+ if (this.#e = e, this.apiVersion = r?.apiVersion ?? C, typeof this.apiVersion != "string" || !/^(0|[1-9]\d*)\.(0|[1-9]\d*)(?![\s\S])/.test(this.apiVersion))
191
191
  throw new TypeError("Invalid Data SDK API version.");
192
192
  this.graphql = T(this.#t.bind(this));
193
193
  }
194
- async #t({ query: e, variables: r, operationName: n }, a) {
195
- const s = {
194
+ async #t({ query: e, variables: r, operationName: n }, s) {
195
+ const a = {
196
196
  query: e,
197
197
  ...r != null ? { variables: r } : {},
198
198
  ...n != null ? { operationName: n } : {}
199
- }, o = a === "query" ? { method: "GET", queryParams: { queryInput: JSON.stringify(s) } } : { method: "POST", body: s }, i = await this.#e.request("tools/call", {
200
- name: a === "query" ? "dispatch_readonly" : "dispatch",
199
+ }, o = s === "query" ? { method: "GET", queryParams: { queryInput: JSON.stringify(a) } } : { method: "POST", body: a }, i = await this.#e.request("tools/call", {
200
+ name: s === "query" ? "dispatch_readonly" : "dispatch",
201
201
  arguments: {
202
- url: `${L(this.apiVersion)}/graphql`,
202
+ url: `${$(this.apiVersion)}/graphql`,
203
203
  ...o
204
204
  }
205
- }).catch((d) => {
205
+ }).catch((p) => {
206
206
  throw new Error(
207
- ye(d) ? "Data SDK GraphQL dispatch tool is unavailable." : "Data SDK GraphQL request failed.",
208
- { cause: d }
207
+ fe(p) ? "Data SDK GraphQL dispatch tool is unavailable." : "Data SDK GraphQL request failed.",
208
+ { cause: p }
209
209
  );
210
- }), c = i?.structuredContent ?? fe(i?.content), h = c?.status_code, u = c?.body, l = i?.isError || c?.error_code !== void 0;
210
+ }), c = i?.structuredContent ?? de(i?.content), h = c?.status_code, u = c?.body, l = i?.isError || c?.error_code !== void 0;
211
211
  if (typeof h != "number" || !Number.isInteger(h))
212
212
  throw new Error(
213
213
  l ? "Data SDK GraphQL request failed." : "Data SDK GraphQL response is malformed."
214
214
  );
215
215
  if (l || h < 200 || h >= 300)
216
- throw u != null && k(u) && u.errors?.length ? (
216
+ throw u != null && R(u) && u.errors?.length ? (
217
217
  // This method is wrapped by `buildUncachedGraphQL`, which handles thrown {data} errors
218
218
  { data: { errors: u.errors } }
219
219
  ) : new Error("Data SDK GraphQL request failed.");
220
- if (u == null || !k(u))
220
+ if (u == null || !R(u))
221
221
  throw new Error("Data SDK GraphQL response is malformed.");
222
222
  return u;
223
223
  }
224
224
  }
225
- const me = "X-Salesforce-First-Party";
226
- function be(t, e) {
227
- if (!t) return !1;
228
- const r = e.toLowerCase();
229
- return t instanceof Headers ? t.has(e) : Array.isArray(t) ? t.some(([n]) => n.toLowerCase() === r) : Object.keys(t).some((n) => n.toLowerCase() === r);
230
- }
231
- function K(t, e, r) {
232
- return !e || !r ? !1 : be(t?.headers, me);
233
- }
234
- function A(t, e, r) {
235
- return e ? r ? b("Cookie", `sid=${e}`, t) : b("Authorization", `Bearer ${e}`, t) : t;
236
- }
237
- function ge({
238
- baseUrl: t,
239
- accessToken: e,
240
- lightningDomain: r,
241
- isInternal: n = !1
242
- }) {
243
- return (a) => {
244
- const [s, o] = a;
245
- if (typeof s == "string" && !s.startsWith("http") && t) {
246
- const i = s.startsWith("/") ? s : `/${s}`;
247
- return K(o, n, r) ? p(
248
- A([`${r}${i}`, o], e, !0)
249
- ) : p(A([`${t}${i}`, o], e, !1));
225
+ function ye(t) {
226
+ return (e) => {
227
+ const [r, n] = e;
228
+ if (typeof r == "string" && !r.startsWith("http")) {
229
+ const s = r.startsWith("/") ? r : `/${r}`;
230
+ return d([`${t}${s}`, n]);
250
231
  }
251
- return p(A(a, e, !1));
232
+ return d(e);
252
233
  };
253
234
  }
254
- function we(t) {
255
- const e = t.baseUrl || t.accessToken ? [ge(t)] : [];
256
- return j({ request: e }).service;
235
+ function me(t) {
236
+ return (e) => d(w("Authorization", `Bearer ${t}`, e));
257
237
  }
258
- const ve = {
238
+ function be(t, e) {
239
+ const r = [];
240
+ return t && r.push(ye(t)), e && r.push(me(e)), H({
241
+ request: r
242
+ }).service;
243
+ }
244
+ const we = {
259
245
  "Content-Type": "application/json",
260
246
  Accept: "application/json",
261
247
  "X-Chatter-Entity-Encoding": "false"
262
248
  };
263
- function Se(t) {
249
+ function ge(t) {
264
250
  if (t instanceof Headers) {
265
251
  const e = [];
266
252
  return t.forEach((r, n) => e.push([n, r])), e;
267
253
  }
268
254
  return Array.isArray(t) ? t.map(([e, r]) => [e, r]) : Object.entries(t);
269
255
  }
270
- function z(t, e) {
256
+ function K(t, e) {
271
257
  if (e === void 0) return { ...t };
272
258
  const r = { ...t }, n = /* @__PURE__ */ new Map();
273
- for (const s of Object.keys(r)) n.set(s.toLowerCase(), s);
274
- const a = /* @__PURE__ */ new Set();
275
- for (const [s, o] of Se(e)) {
276
- const i = s.toLowerCase(), c = n.get(i);
277
- 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));
259
+ for (const a of Object.keys(r)) n.set(a.toLowerCase(), a);
260
+ const s = /* @__PURE__ */ new Set();
261
+ for (const [a, o] of ge(e)) {
262
+ const i = a.toLowerCase(), c = n.get(i);
263
+ c === void 0 ? (r[a] = o, n.set(i, a), s.add(i)) : s.has(i) ? r[c] = `${r[c]}, ${o}` : (r[c] = o, s.add(i));
278
264
  }
279
265
  return r;
280
266
  }
281
- function J(t) {
282
- return z(ve, t);
267
+ function z(t) {
268
+ return K(we, t);
283
269
  }
284
- function Ee(t) {
270
+ function ve(t) {
285
271
  if (t === void 0) return;
286
272
  const e = {};
287
273
  return new Headers(t).forEach((r, n) => {
288
274
  e[n] = r;
289
275
  }), Object.keys(e).length > 0 ? e : void 0;
290
276
  }
291
- const De = 512;
292
- function Ce(t) {
277
+ const Ee = 512;
278
+ function Se(t) {
293
279
  return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
294
280
  }
295
- class M extends Error {
281
+ class V extends Error {
296
282
  status;
297
283
  url;
298
284
  constructor(e) {
299
- const r = e.body.length === 0 ? "empty response body" : "unparseable response body", n = e.body.length === 0 ? "" : ` (starts with: ${JSON.stringify(Ce(e.body.slice(0, De)))})`;
285
+ const r = e.body.length === 0 ? "empty response body" : "unparseable response body", n = e.body.length === 0 ? "" : ` (starts with: ${JSON.stringify(Se(e.body.slice(0, Ee)))})`;
300
286
  super(
301
287
  `${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.`
302
288
  ), this.name = "GraphQLTransportError", this.status = e.status, this.url = e.url, this.cause = e.cause;
303
289
  }
304
290
  }
305
- async function W(t, e, r) {
291
+ async function J(t, e, r) {
306
292
  const n = await t.text();
307
- let a;
293
+ let s;
308
294
  try {
309
- a = JSON.parse(n);
310
- } catch (s) {
311
- throw new M({ surface: e, url: r, status: t.status, body: n, cause: s });
295
+ s = JSON.parse(n);
296
+ } catch (a) {
297
+ throw new V({ surface: e, url: r, status: t.status, body: n, cause: a });
312
298
  }
313
- if (a === null || typeof a != "object")
314
- throw new M({
299
+ if (!Ce(s))
300
+ throw new V({
315
301
  surface: e,
316
302
  url: r,
317
303
  status: t.status,
318
304
  body: n,
319
- cause: new Error("Parsed GraphQL response body was not a JSON object")
305
+ cause: new Error("Parsed response body was not a GraphQL response")
320
306
  });
321
- return a;
307
+ return s;
308
+ }
309
+ function Ce(t) {
310
+ return t === null || typeof t != "object" || Array.isArray(t) ? !1 : "data" in t || Array.isArray(t.errors);
322
311
  }
323
- const Ae = {
312
+ const De = {
324
313
  "Content-Type": "application/json",
325
314
  Accept: "application/json"
326
315
  };
327
- class Oe {
316
+ class Ae {
328
317
  clientFetch;
329
318
  pathData;
330
- baseUrl;
331
- lightningDomain;
332
- isInternal;
333
319
  apiVersion;
334
320
  graphql;
335
321
  constructor(e) {
336
- const r = qe(), n = V(e?.instanceUrl ?? r.instanceUrl), a = e?.accessToken ?? r.accessToken, s = V(
337
- e?.lightningDomain ?? r.lightningDomain
338
- ), o = e?.isInternal ?? r.isInternal ?? !1;
339
- this.apiVersion = e?.apiVersion ?? r.apiVersion ?? D, this.pathData = L(this.apiVersion), this.baseUrl = n || void 0, this.lightningDomain = s || void 0, this.isInternal = o, this.clientFetch = we({
340
- baseUrl: n || void 0,
341
- accessToken: a,
342
- lightningDomain: this.lightningDomain,
343
- isInternal: o
344
- }), this.graphql = T(this.executeRawGraphQL.bind(this));
345
- }
346
- async executeRawGraphQL({ query: e, variables: r, operationName: n, headers: a }, s) {
347
- const o = `${this.pathData}/graphql`, i = z(Ae, a), c = K({ headers: i }, this.isInternal, this.lightningDomain) && !!this.baseUrl;
348
- if (c && s === "mutation")
349
- return {
350
- data: void 0,
351
- errors: [
352
- {
353
- message: "GraphQL mutations are not supported on the lightning domain for the Mosaic surface."
354
- }
355
- ]
356
- };
357
- const { resource: h, init: u } = c ? {
358
- resource: `${o}?queryInput=${encodeURIComponent(
359
- JSON.stringify({ query: e, variables: r, operationName: n })
360
- )}`,
361
- init: { method: "GET", headers: i }
362
- } : {
363
- resource: o,
364
- init: {
365
- method: "POST",
366
- body: JSON.stringify({ query: e, variables: r, operationName: n }),
367
- headers: i
368
- }
369
- }, l = await this.clientFetch(h, u), d = c ? `${o}?queryInput=<redacted>` : h;
370
- return W(l, "Mosaic", d);
322
+ const r = Oe(), n = qe(e?.instanceUrl ?? r.instanceUrl), s = e?.accessToken ?? r.accessToken;
323
+ this.apiVersion = e?.apiVersion ?? r.apiVersion ?? C, this.pathData = $(this.apiVersion), this.clientFetch = be(n || void 0, s), this.graphql = T(this.executeRawGraphQL.bind(this));
324
+ }
325
+ async executeRawGraphQL({
326
+ query: e,
327
+ variables: r,
328
+ operationName: n,
329
+ headers: s
330
+ }) {
331
+ const a = `${this.pathData}/graphql`, o = await this.clientFetch(a, {
332
+ method: "POST",
333
+ body: JSON.stringify({ query: e, variables: r, operationName: n }),
334
+ headers: K(De, s)
335
+ });
336
+ return J(o, "Mosaic", a);
371
337
  }
372
338
  }
373
- function qe() {
339
+ function Oe() {
374
340
  const t = globalThis.MOSAIC_ENV;
375
341
  return {
376
342
  instanceUrl: t?.instanceUrl,
377
343
  accessToken: t?.accessToken,
378
- apiVersion: t?.apiVersion,
379
- lightningDomain: t?.lightningDomain,
380
- isInternal: t?.isInternal
344
+ apiVersion: t?.apiVersion
381
345
  };
382
346
  }
383
- function V(t) {
347
+ function qe(t) {
384
348
  if (!t || t === "/") return "";
385
349
  let e = t;
386
350
  return !e.startsWith("/") && !e.startsWith("http") && (e = `/${e}`), e.endsWith("/") && (e = e.slice(0, -1)), e;
387
351
  }
388
352
  const xe = "graphqlQuery";
389
- class $e {
353
+ class ke {
390
354
  graphql;
391
355
  constructor() {
392
356
  this.graphql = T(this.executeRawGraphQL.bind(this));
@@ -411,50 +375,50 @@ class $e {
411
375
  })).structuredContent;
412
376
  }
413
377
  }
414
- const g = "Accept-Language";
415
- function B(t) {
378
+ const b = "Accept-Language";
379
+ function W(t) {
416
380
  return t ? void 0 : globalThis.SFDC_ENV?.language;
417
381
  }
418
382
  function Ne(t) {
419
- const e = new Headers(t), r = B(e.has(g));
420
- return r ? (e.set(g, r), e) : t;
383
+ const e = new Headers(t), r = W(e.has(b));
384
+ return r ? (e.set(b, r), e) : t;
421
385
  }
422
386
  const Pe = (t) => {
423
- const [e, r] = t, n = e instanceof Request && !r?.headers ? e.headers.has(g) : new Headers(r?.headers).has(g), a = B(n);
424
- return a ? p(b(g, a, t)) : p(t);
425
- }, _e = "X-SFDC-Client-Name", Te = "X-SFDC-Client-Version", Le = "@salesforce/platform-sdk", Ie = "12.13.0", ke = (t) => {
426
- let e = b(_e, Le, t);
427
- return e = b(Te, Ie, e), p(e);
428
- }, Re = "X-CSRF-Token";
387
+ const [e, r] = t, n = e instanceof Request && !r?.headers ? e.headers.has(b) : new Headers(r?.headers).has(b), s = W(n);
388
+ return s ? d(w(b, s, t)) : d(t);
389
+ }, Te = "X-SFDC-Client-Name", $e = "X-SFDC-Client-Version", _e = "@salesforce/platform-sdk", Re = "12.14.0", Le = (t) => {
390
+ let e = w(Te, _e, t);
391
+ return e = w($e, Re, e), d(e);
392
+ }, Ve = "X-CSRF-Token";
429
393
  function Me(t, e = {}) {
430
394
  const { protectedUrls: r = [], alwaysProtectedUrls: n = [] } = e;
431
- return async (a) => {
432
- 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";
433
- if (G(n, i) || Ve(c) && G(r, i)) {
395
+ return async (s) => {
396
+ const [a, o] = s, i = a instanceof Request ? a.url : a instanceof URL ? a.href : a, c = o?.method ?? (a instanceof Request ? a.method : void 0) ?? "GET";
397
+ if (M(n, i) || Ie(c) && M(r, i)) {
434
398
  const u = await t.getToken();
435
- a = b(Re, u, a);
399
+ s = w(Ve, u, s);
436
400
  }
437
- return p(a);
401
+ return d(s);
438
402
  };
439
403
  }
440
- function Ve(t) {
404
+ function Ie(t) {
441
405
  const e = t.toLowerCase();
442
406
  return e === "post" || e === "put" || e === "patch" || e === "delete";
443
407
  }
444
- function G(t, e) {
408
+ function M(t, e) {
445
409
  const r = new URL(e, globalThis.location?.href ?? "http://localhost");
446
410
  return t.some((n) => r.pathname.includes(n));
447
411
  }
448
412
  function Ge(t, e = {}) {
449
413
  const r = Me(t, e);
450
- async function n(a) {
451
- const s = await r(a);
452
- return fetch(s[0], s[1]);
414
+ async function n(s) {
415
+ const a = await r(s);
416
+ return fetch(a[0], a[1]);
453
417
  }
454
- return (a, s) => s ? s.applyRetry(async () => n(a)) : n(a);
418
+ return (s, a) => a ? a.applyRetry(async () => n(s)) : n(s);
455
419
  }
456
420
  const Qe = [400, 401, 403];
457
- class Ue extends ae {
421
+ class je extends se {
458
422
  constructor(e) {
459
423
  super(e), this.csrfTokenManager = e;
460
424
  }
@@ -482,9 +446,9 @@ class Ue extends ae {
482
446
  await this.csrfTokenManager.refreshToken();
483
447
  }
484
448
  }
485
- class He {
449
+ class Fe {
486
450
  constructor(e, r) {
487
- this.endpoint = e, this.cacheName = r, this.tokenPromise = this.obtainToken();
451
+ this.endpoint = e, this.cacheName = r, this.tokenPromise = this.startObtainToken();
488
452
  }
489
453
  endpoint;
490
454
  cacheName;
@@ -494,10 +458,11 @@ class He {
494
458
  * Returns the current CSRF token.
495
459
  *
496
460
  * @remarks
497
- * The first call loads the token lazily, either from the cache or with a fetch request.
461
+ * The token loads from the cache or with a fetch request. When the last attempt failed, this
462
+ * call starts a new attempt, so a transient failure does not block later requests.
498
463
  */
499
464
  async getToken() {
500
- return this.tokenPromise;
465
+ return this.tokenPromise ??= this.startObtainToken(), this.tokenPromise;
501
466
  }
502
467
  /**
503
468
  * Clears the cached CSRF token and fetches a fresh one.
@@ -507,20 +472,48 @@ class He {
507
472
  * every caller shares the same in-flight promise.
508
473
  */
509
474
  refreshToken() {
510
- return this.refreshPromise || (this.refreshPromise = this.withCache((e) => e.delete(this.endpoint)).then(() => (this.tokenPromise = this.obtainToken(), this.tokenPromise)).finally(() => {
475
+ return this.refreshPromise || (this.refreshPromise = this.withCache((e) => e.delete(this.endpoint)).then(() => (this.tokenPromise = this.startObtainToken(), this.tokenPromise)).finally(() => {
511
476
  this.refreshPromise = void 0;
512
477
  })), this.refreshPromise;
513
478
  }
479
+ /**
480
+ * Starts a token attempt that is forgotten when it fails.
481
+ *
482
+ * @remarks
483
+ * The manager lives for the page lifetime. If it kept a rejected promise, every later protected
484
+ * request would fail without a network call until the page reloads.
485
+ */
486
+ startObtainToken() {
487
+ const e = this.obtainToken();
488
+ return e.catch(() => {
489
+ this.tokenPromise === e && (this.tokenPromise = void 0);
490
+ }), e;
491
+ }
514
492
  /**
515
493
  * Returns a CSRF token from the cache, or fetches a new one when the cache has none.
516
494
  *
495
+ * @remarks
496
+ * Only a response that contains a token goes into the cache. The cache persists across page
497
+ * loads, so a cached error response would otherwise fail every attempt.
498
+ *
517
499
  * @returns The CSRF token.
518
500
  */
519
501
  async obtainToken() {
520
- let e = await this.withCache((a) => a.match(this.endpoint)), r = !1;
521
- e || (e = await fetch(this.endpoint, { method: "get" }), r = !0);
522
- const n = (await e.clone().json()).csrfToken;
523
- return r && await this.withCache((a) => a.put(this.endpoint, e)), n;
502
+ const e = await this.withCache((s) => s.match(this.endpoint));
503
+ if (e) {
504
+ const s = await I(e).catch(() => {
505
+ });
506
+ if (s)
507
+ return s;
508
+ await this.withCache((a) => a.delete(this.endpoint));
509
+ }
510
+ const r = await fetch(this.endpoint, { method: "get" });
511
+ if (!r.ok)
512
+ throw new Error(`CSRF token request failed with status ${r.status}`);
513
+ const n = await I(r);
514
+ if (!n)
515
+ throw new Error("CSRF token response did not contain a token");
516
+ return await this.withCache((s) => s.put(this.endpoint, r)), n;
524
517
  }
525
518
  /**
526
519
  * Runs a callback against the Cache API, and returns `undefined` when the API is unavailable.
@@ -536,29 +529,36 @@ class He {
536
529
  return;
537
530
  }
538
531
  }
539
- const Q = /* @__PURE__ */ new Map();
540
- function je(t) {
532
+ async function I(t) {
533
+ const e = await t.clone().json();
534
+ if (typeof e != "object" || e === null || !("csrfToken" in e))
535
+ return;
536
+ const { csrfToken: r } = e;
537
+ return typeof r == "string" && r !== "" ? r : void 0;
538
+ }
539
+ const G = /* @__PURE__ */ new Map();
540
+ function He(t) {
541
541
  const { endpoint: e, cacheName: r, ...n } = t.csrf;
542
- let a = Q.get(e);
543
- return a || (a = new He(e, r), Q.set(e, a)), j(
542
+ let s = G.get(e);
543
+ return s || (s = new Fe(e, r), G.set(e, s)), H(
544
544
  {
545
- retry: Ge(a, n),
546
- request: [ke, Pe]
545
+ retry: Ge(s, n),
546
+ request: [Le, Pe]
547
547
  },
548
- oe(new Ue(a)).service
548
+ ae(new je(s)).service
549
549
  ).service;
550
550
  }
551
- const U = /* @__PURE__ */ new Map();
552
- function Fe(t) {
553
- let e = U.get(t);
551
+ const Q = /* @__PURE__ */ new Map();
552
+ function Ue(t) {
553
+ let e = Q.get(t);
554
554
  if (!e) {
555
- const r = ie().service, n = ue(r).service, a = ce(r, n).service, s = he().service;
556
- e = { cache: r, cacheController: a, pubSub: s }, U.set(t, e);
555
+ const r = oe().service, n = ce(r).service, s = ie(r, n).service, a = ue().service;
556
+ e = { cache: r, cacheController: s, pubSub: a }, Q.set(t, e);
557
557
  }
558
558
  return e;
559
559
  }
560
560
  function Ke(t, e) {
561
- const r = Fe(t);
561
+ const r = Ue(t);
562
562
  return {
563
563
  shared: r,
564
564
  services: {
@@ -568,30 +568,30 @@ function Ke(t, e) {
568
568
  }
569
569
  };
570
570
  }
571
- const H = 300;
571
+ const j = 300;
572
572
  function ze(t, e) {
573
573
  try {
574
574
  return JSON.parse(JSON.stringify(t));
575
575
  } catch (r) {
576
- const n = e || "(anonymous)", a = new TypeError(
576
+ const n = e || "(anonymous)", s = new TypeError(
577
577
  `HttpGraphQLResourceCacheControlCommand: variables for operation "${n}" must be JSON-serializable. ${r.message}`
578
578
  );
579
- throw a.cause = r, a;
579
+ throw s.cause = r, s;
580
580
  }
581
581
  }
582
582
  function Je(t) {
583
583
  if (typeof t == "object" && t.type === "max-age") {
584
584
  const e = t.maxAge;
585
- return Number.isFinite(e) && e >= 0 ? e : H;
585
+ return Number.isFinite(e) && e >= 0 ? e : j;
586
586
  }
587
- return H;
587
+ return j;
588
588
  }
589
- class We extends le {
589
+ class We extends he {
590
590
  constructor(e, r, n) {
591
591
  super(r), this.url = n, this.query = e.query, this.normalizedOperationName = e.operationName ?? "", this.normalizedVariables = ze(
592
592
  e.variables ?? {},
593
593
  this.normalizedOperationName
594
- ), this.cacheControl = e.cacheControl, this.resolvedMaxAge = Je(e.cacheControl), this.headers = e.headers, this.headersKey = Ee(e.headers);
594
+ ), this.cacheControl = e.cacheControl, this.resolvedMaxAge = Je(e.cacheControl), this.headers = e.headers, this.headersKey = ve(e.headers);
595
595
  }
596
596
  url;
597
597
  query;
@@ -606,7 +606,7 @@ class We extends le {
606
606
  this.url,
607
607
  {
608
608
  method: "POST",
609
- headers: J(this.headers),
609
+ headers: z(this.headers),
610
610
  body: JSON.stringify({
611
611
  query: this.query,
612
612
  variables: this.normalizedVariables,
@@ -621,7 +621,7 @@ class We extends le {
621
621
  variables: this.normalizedVariables,
622
622
  operationName: this.normalizedOperationName
623
623
  };
624
- return this.headersKey !== void 0 && (e.headers = this.headersKey), te(e);
624
+ return this.headersKey !== void 0 && (e.headers = this.headersKey), ee(e);
625
625
  }
626
626
  /**
627
627
  * Reads the cached result for this command, or returns an error.
@@ -639,9 +639,9 @@ class We extends le {
639
639
  */
640
640
  readFromCache(e) {
641
641
  const r = this.buildKey(), n = e.get(r)?.value;
642
- return n === void 0 ? p(
643
- x(new re("No cached entry found for this query."))
644
- ) : p(q(n));
642
+ return n === void 0 ? d(
643
+ q(new te("No cached entry found for this query."))
644
+ ) : d(O(n));
645
645
  }
646
646
  writeToCache(e, r) {
647
647
  if (r.isOk() && r.value.data != null && Object.keys(r.value.data).length > 0) {
@@ -657,7 +657,7 @@ class We extends le {
657
657
  }
658
658
  });
659
659
  }
660
- return p(void 0);
660
+ return d(void 0);
661
661
  }
662
662
  get cacheControlStrategyConfig() {
663
663
  const e = Math.floor(Date.now() / 1e3);
@@ -671,7 +671,7 @@ class We extends le {
671
671
  return e.errors && e.errors.length > 0;
672
672
  }
673
673
  processFetchReturnValue(e) {
674
- return this.responseHasErrors(e) ? x(new ne(e)) : q(e);
674
+ return this.responseHasErrors(e) ? q(new re(e)) : O(e);
675
675
  }
676
676
  }
677
677
  const Be = "CACHE_MISS";
@@ -683,8 +683,8 @@ function Xe() {
683
683
  }
684
684
  ];
685
685
  }
686
- function X(t) {
687
- if (se(t) && t.data && typeof t.data == "object") {
686
+ function B(t) {
687
+ if (ne(t) && t.data && typeof t.data == "object") {
688
688
  const e = t.data;
689
689
  if (e.data != null)
690
690
  return e.data;
@@ -696,36 +696,36 @@ function Ye(t) {
696
696
  const r = e.value;
697
697
  v(r), t({ data: r, errors: void 0 });
698
698
  } else {
699
- const r = X(e.error);
699
+ const r = B(e.error);
700
700
  r && v(r), t({ data: r, errors: y(e.error) });
701
701
  }
702
702
  };
703
703
  }
704
704
  async function Ze(t, e = !1) {
705
- let r, n, a;
705
+ let r, n, s;
706
706
  try {
707
- const s = await t.execute();
708
- s.isOk() ? (r = s.value.data, v(r), a = (o) => s.value.subscribe(o)) : (r = X(s.error.failure), r && v(r), n = e && r === void 0 ? Xe() : y(s.error.failure), a = (o) => s.error.subscribe(o));
709
- } catch (s) {
710
- n = y(s);
707
+ const a = await t.execute();
708
+ a.isOk() ? (r = a.value.data, v(r), s = (o) => a.value.subscribe(o)) : (r = B(a.error.failure), r && v(r), n = e && r === void 0 ? Xe() : y(a.error.failure), s = (o) => a.error.subscribe(o));
709
+ } catch (a) {
710
+ n = y(a);
711
711
  }
712
712
  return {
713
713
  data: r,
714
714
  errors: n,
715
- subscribe(s) {
716
- return a ? a(Ye(s)) : E;
715
+ subscribe(a) {
716
+ return s ? s(Ye(a)) : S;
717
717
  },
718
718
  async refresh() {
719
719
  await t.refresh();
720
720
  }
721
721
  };
722
722
  }
723
- function O(t) {
723
+ function A(t) {
724
724
  return {
725
725
  data: void 0,
726
726
  errors: t,
727
- subscribe: () => E,
728
- refresh: $
727
+ subscribe: () => S,
728
+ refresh: x
729
729
  };
730
730
  }
731
731
  function et({
@@ -734,49 +734,49 @@ function et({
734
734
  executeRaw: r,
735
735
  resolveEffectiveHeaders: n
736
736
  }) {
737
- const { services: a } = t;
738
- async function s({
737
+ const { services: s } = t;
738
+ async function a({
739
739
  query: o,
740
740
  variables: i,
741
741
  operationName: c,
742
742
  cacheControl: h,
743
743
  headers: u
744
744
  }) {
745
- const l = P(o);
746
- if (l.isErr()) return O(l.error);
747
- const d = l.value, f = _(d, c);
745
+ const l = N(o);
746
+ if (l.isErr()) return A(l.error);
747
+ const p = l.value, f = P(p, c);
748
748
  if (f !== "query")
749
- return O([
749
+ return A([
750
750
  {
751
751
  message: `DataSDK.graphql.query() requires a GraphQL query, received ${f}.`
752
752
  }
753
753
  ]);
754
- let w;
754
+ let g;
755
755
  try {
756
- const C = n ? n(u) : u;
757
- w = new We(
756
+ const D = n ? n(u) : u;
757
+ g = new We(
758
758
  {
759
- query: N(d),
759
+ query: k(p),
760
760
  variables: i,
761
761
  operationName: c,
762
762
  cacheControl: h,
763
- headers: C
763
+ headers: D
764
764
  },
765
- a,
765
+ s,
766
766
  e
767
767
  );
768
- } catch (C) {
769
- return O(y(C));
768
+ } catch (D) {
769
+ return A(y(D));
770
770
  }
771
- return Ze(w, h === "only-if-cached");
771
+ return Ze(g, h === "only-if-cached");
772
772
  }
773
773
  return {
774
- query: s,
775
- mutate: (o) => F(r, o)
774
+ query: a,
775
+ mutate: (o) => U(r, o)
776
776
  };
777
777
  }
778
778
  const tt = 1, rt = `@salesforce/platform-sdk-data_v${tt}`;
779
- class nt {
779
+ class F {
780
780
  baseUrl;
781
781
  pathData;
782
782
  clientFetch;
@@ -784,10 +784,10 @@ class nt {
784
784
  apiVersion;
785
785
  graphql;
786
786
  constructor(e) {
787
- const r = st();
788
- this.baseUrl = at(e?.basePath ?? r.apiPath), this.apiVersion = e?.apiVersion ?? D, this.pathData = L(this.apiVersion);
789
- const n = `${this.pathData}/ui-api`, a = `${this.pathData}/graphql`;
790
- this.onStatus = e?.onStatus ?? {}, this.clientFetch = je({
787
+ const r = nt();
788
+ this.baseUrl = st(e?.basePath ?? r.apiPath), this.apiVersion = e?.apiVersion ?? C, this.pathData = $(this.apiVersion);
789
+ const n = `${this.pathData}/ui-api`, s = `${this.pathData}/graphql`;
790
+ this.onStatus = e?.onStatus ?? {}, this.clientFetch = He({
791
791
  csrf: {
792
792
  endpoint: `${this.baseUrl}${n}/session/csrf`,
793
793
  cacheName: rt,
@@ -795,17 +795,17 @@ class nt {
795
795
  alwaysProtectedUrls: ["services/apexrest"]
796
796
  }
797
797
  });
798
- const s = (i, c) => this.fetch(i, c), o = Ke(`${this.baseUrl}${this.pathData}`, s);
798
+ const a = (i, c) => this.fetch(i, c), o = Ke(`${this.baseUrl}${this.pathData}`, a);
799
799
  this.graphql = et({
800
800
  bundle: o,
801
- url: a,
801
+ url: s,
802
802
  executeRaw: this.executeRawGraphQL.bind(this),
803
803
  resolveEffectiveHeaders: Ne
804
804
  });
805
805
  }
806
806
  async fetch(e, r) {
807
- const n = this.applySalesforceBase(e), a = await this.clientFetch(n, r);
808
- return await this.onStatus[a.status]?.(), a;
807
+ const n = this.applySalesforceBase(e), s = await this.clientFetch(n, r);
808
+ return await this.onStatus[s.status]?.(), s;
809
809
  }
810
810
  /**
811
811
  * Sends a raw GraphQL POST request.
@@ -819,14 +819,14 @@ class nt {
819
819
  query: e,
820
820
  variables: r,
821
821
  operationName: n,
822
- headers: a
822
+ headers: s
823
823
  }) {
824
- const s = `${this.pathData}/graphql`, o = await this.fetch(s, {
824
+ const a = `${this.pathData}/graphql`, o = await this.fetch(a, {
825
825
  method: "POST",
826
826
  body: JSON.stringify({ query: e, variables: r, operationName: n }),
827
- headers: J(a)
827
+ headers: z(s)
828
828
  });
829
- return W(o, "WebApp", s);
829
+ return J(o, "WebApp", a);
830
830
  }
831
831
  /**
832
832
  * Converts a relative URL to an absolute Salesforce URL.
@@ -845,44 +845,44 @@ class nt {
845
845
  return e;
846
846
  }
847
847
  }
848
- function st() {
848
+ function nt() {
849
849
  return {
850
850
  apiPath: globalThis.SFDC_ENV?.apiPath
851
851
  };
852
852
  }
853
- function at(t) {
853
+ function st(t) {
854
854
  if (!t || t === "/") return "";
855
855
  let e = t;
856
856
  return e.startsWith("/") || (e = `/${e}`), e.endsWith("/") && (e = e.slice(0, -1)), e;
857
857
  }
858
- function ot(t) {
859
- 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;
860
- if (typeof a?.setup != "function")
858
+ function at(t) {
859
+ const e = t, r = typeof e == "object" && e !== null ? e : void 0, n = r !== void 0 && "setup" in r, s = n ? r : r?.extension, a = n ? s?.name : r?.as;
860
+ if (typeof s?.setup != "function")
861
861
  throw new Error("Extension entry cannot attach: it is missing a setup function.");
862
- if (typeof s != "string" || s.length === 0)
862
+ if (typeof a != "string" || a.length === 0)
863
863
  throw new Error(
864
864
  n ? 'Extension entry cannot attach: "name" must be a non-empty string.' : 'Extension entry cannot attach: alias "as" must be a non-empty string.'
865
865
  );
866
866
  return {
867
- extension: a,
868
- mountName: s,
869
- label: s === a.name ? `"${a.name}"` : `"${a.name}" (aliased as "${s}")`
867
+ extension: s,
868
+ mountName: a,
869
+ label: a === s.name ? `"${s.name}"` : `"${s.name}" (aliased as "${a}")`
870
870
  };
871
871
  }
872
- async function it(t, e, r) {
872
+ async function ot(t, e, r) {
873
873
  if (e.length === 0)
874
874
  return t;
875
875
  if ("ext" in t)
876
876
  throw new Error(
877
877
  'Cannot attach extensions: the base SDK already declares an "ext" member, which the extension container reserves.'
878
878
  );
879
- const n = e.map(ot);
879
+ const n = e.map(at);
880
880
  r?.preflight?.(n, t);
881
- const a = Object.create(t), s = /* @__PURE__ */ Object.create(null), o = (h) => {
881
+ const s = Object.create(t), a = /* @__PURE__ */ Object.create(null), o = (h) => {
882
882
  throw new Error(`Cannot write "ext.${String(h)}" — ext is immutable once attached.`);
883
883
  }, i = (h) => {
884
884
  throw new Error(`Cannot ${h} "ext" — ext is immutable once attached.`);
885
- }, c = new Proxy(s, {
885
+ }, c = new Proxy(a, {
886
886
  set(h, u) {
887
887
  return o(u);
888
888
  },
@@ -904,55 +904,58 @@ async function it(t, e, r) {
904
904
  return i("change the prototype of");
905
905
  }
906
906
  });
907
- Object.defineProperty(a, "ext", {
907
+ Object.defineProperty(s, "ext", {
908
908
  value: c,
909
909
  enumerable: !0,
910
910
  writable: !1,
911
911
  configurable: !1
912
912
  });
913
913
  for (const { extension: h, mountName: u, label: l } of n) {
914
- if (Object.hasOwn(s, u))
914
+ if (Object.hasOwn(a, u))
915
915
  throw new Error(
916
916
  `Extension ${l} cannot attach: "${u}" is already defined by another extension.`
917
917
  );
918
- let d;
918
+ let p;
919
919
  try {
920
- d = await h.setup(a);
920
+ p = await h.setup(s);
921
921
  } catch (f) {
922
922
  throw new Error(`Extension ${l} failed during setup.`, { cause: f });
923
923
  }
924
- Object.defineProperty(s, u, {
925
- value: d,
924
+ Object.defineProperty(a, u, {
925
+ value: p,
926
926
  enumerable: !0,
927
927
  writable: !1,
928
928
  configurable: !1
929
929
  });
930
930
  }
931
- return Object.freeze(s), a;
931
+ return Object.freeze(a), s;
932
932
  }
933
- function vt(t, ...e) {
933
+ function gt(t, ...e) {
934
934
  let r = t[0] ?? "";
935
935
  for (let n = 0; n < e.length; n += 1)
936
936
  r += String(e[n]) + (t[n + 1] ?? "");
937
937
  return r;
938
938
  }
939
- function St(t) {
939
+ function vt(t) {
940
940
  return t;
941
941
  }
942
- async function ct(t) {
942
+ async function it(t) {
943
943
  try {
944
- switch (await Y(t?.surface)) {
944
+ switch (await X(t?.surface)) {
945
945
  case m.OpenAI:
946
- return new $e();
946
+ return new ke();
947
947
  case m.WebApp:
948
- case m.MicroFrontend:
949
- return new nt(t?.webapp);
948
+ return new F(t?.webapp);
949
+ case m.MicroFrontend: {
950
+ const r = globalThis.SFDC_ENV;
951
+ return typeof r == "object" && r !== null ? new F(t?.webapp) : {};
952
+ }
950
953
  case m.Mosaic:
951
- return new Oe(t?.mosaic);
954
+ return new Ae(t?.mosaic);
952
955
  case m.Claude:
953
- return new R(await I.getInstance(), t?.claude);
956
+ return new L(await _.getInstance(), t?.claude);
954
957
  case m.MCPApps:
955
- return new R(await I.getInstance(), t?.mcpApps);
958
+ return new L(await _.getInstance(), t?.mcpApps);
956
959
  default:
957
960
  return {};
958
961
  }
@@ -961,10 +964,10 @@ async function ct(t) {
961
964
  }
962
965
  }
963
966
  function Et(t) {
964
- return Z(
967
+ return Y(
965
968
  (async () => {
966
- const e = await ct(t);
967
- return it(e, t?.extensions ?? [], {
969
+ const e = await it(t);
970
+ return ot(e, t?.extensions ?? [], {
968
971
  preflight: pe
969
972
  });
970
973
  })(),
@@ -973,6 +976,6 @@ function Et(t) {
973
976
  }
974
977
  export {
975
978
  Et as createDataSDK,
976
- St as defineDataExtension,
977
- vt as gql
979
+ vt as defineDataExtension,
980
+ gt as gql
978
981
  };