@salesforce/platform-sdk 11.9.0 → 11.10.1

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.
@@ -15,10 +15,25 @@ export interface GraphQLResponse<T> {
15
15
  data: T;
16
16
  errors?: GraphQLError[];
17
17
  }
18
+ /**
19
+ * Extra HTTP headers to attach to a single GraphQL request, merged over the
20
+ * surface's canonical header set. Caller-supplied entries take precedence, so
21
+ * avoid overriding transport headers such as `Content-Type` unless intentional.
22
+ *
23
+ * Accepts any `HeadersInit` — a plain `Record<string, string>`, an array of
24
+ * `[name, value]` tuples, or a `Headers` instance — so multi-valued headers can
25
+ * be expressed via repeated tuples or a pre-built `Headers` object.
26
+ *
27
+ * Ignored by surfaces that do not issue the request over HTTP directly — the
28
+ * OpenAI surface delegates to an MCP tool that exposes no header channel.
29
+ */
30
+ export type GraphQLRequestHeaders = HeadersInit;
18
31
  export interface GraphQLRequest<V = Record<string, unknown>> {
19
32
  query: string;
20
33
  variables?: V;
21
34
  operationName?: string;
35
+ /** @see {@link GraphQLRequestHeaders} */
36
+ headers?: GraphQLRequestHeaders;
22
37
  }
23
38
  /**
24
39
  * A GraphQL operation source string passed to {@link DataSDKGraphQL.query} or
@@ -107,6 +122,15 @@ export interface QueryOptions<V = Record<string, unknown>> {
107
122
  operationName?: string;
108
123
  /** Override the default cache behavior for this query. @see {@link CacheControl} */
109
124
  cacheControl?: CacheControl;
125
+ /**
126
+ * Extra HTTP headers for this request, merged over the surface's canonical
127
+ * header set. Part of the cache key: two calls that differ only in `headers`
128
+ * resolve to different cache entries. This prevents a response scoped by a
129
+ * header — e.g. `Authorization` — from being served to a later caller that
130
+ * passed a different value. Calls with equivalent headers still share an
131
+ * entry. @see {@link GraphQLRequestHeaders}
132
+ */
133
+ headers?: GraphQLRequestHeaders;
110
134
  }
111
135
  /**
112
136
  * Options bag for {@link DataSDKGraphQL.mutate}.
@@ -115,6 +139,11 @@ export interface MutateOptions<V = Record<string, unknown>> {
115
139
  mutation: GraphQLRawDocument;
116
140
  variables?: V;
117
141
  operationName?: string;
142
+ /**
143
+ * Extra HTTP headers for this request, merged over the surface's canonical
144
+ * header set. @see {@link GraphQLRequestHeaders}
145
+ */
146
+ headers?: GraphQLRequestHeaders;
118
147
  }
119
148
  /**
120
149
  * The `graphql` namespace on a {@link DataSDK}.
@@ -1 +1 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/core/data.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,YAAY;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC/C,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,eAAe,CAAC,CAAC;IACjC,IAAI,EAAE,CAAC,CAAC;IACR,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,CAAC,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC;AAErC;;;;;GAKG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC;IAC/B,IAAI,EAAE,CAAC,GAAG,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;CACxB;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AAEtE;;;;;;;;;;;GAWG;AACH,MAAM,WAAW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AAC,MAAM,EAAE,OAAO,CAAC;IACzD,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,SAAS,CAAC,EAAE,CAAC,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,qBAAqB,CAAC;CAChC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC9B;;;;;;;;;;;;;;;;;OAiBG;IACH,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzF;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;CAC9F;AAED,MAAM,WAAW,OAAO;IACvB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACrB"}
@@ -8,7 +8,7 @@ export type { InitializeOptions } from './surface';
8
8
  export type { SDKOptions } from './options';
9
9
  export type { HostContext, HostStyles, ChatMessage, ChatSDK, ContentBlock, DeviceCapabilities, DisplayMode, ResourceRequest, SafeAreaInsets, SetWidgetStateOptions, ToolCall, ToolState, } from './chat';
10
10
  export type { AlertOptions, MessageLevel, ModalOptions, ToastOptions, Theme, ThemeMode, UiState, UiStyles, ViewSDK, } from './view';
11
- export type { CacheControl, DataSDK, DataSDKGraphQL, GraphQLError, GraphQLRawDocument, GraphQLRequest, GraphQLResponse, MutateOptions, MutationResult, QueryOptions, QueryResult, QuerySubscriber, Unsubscribe, } from './data';
11
+ export type { CacheControl, DataSDK, DataSDKGraphQL, GraphQLError, GraphQLRawDocument, GraphQLRequest, GraphQLRequestHeaders, GraphQLResponse, MutateOptions, MutationResult, QueryOptions, QueryResult, QuerySubscriber, Unsubscribe, } from './data';
12
12
  export type { LightningSDK, LMSMessage, LMSSubscription, MessageChannel } from './lightning';
13
13
  export type { OpenAISDK } from './platforms';
14
14
  export { McpAppsNotAvailableError, McpAppsSession } from './mcpapps-session';
@@ -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,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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C;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"}
@@ -25,7 +25,7 @@ export interface DataSDKOptions extends SDKOptions {
25
25
  */
26
26
  export declare function createDataSDK(options?: DataSDKOptions): Promise<DataSDK>;
27
27
  export { gql } from './gql';
28
- export type { CacheControl, DataSDK, DataSDKGraphQL, GraphQLError, GraphQLRawDocument, GraphQLRequest, GraphQLResponse, MutateOptions, MutationResult, QueryOptions, QueryResult, QuerySubscriber, SDKOptions, Unsubscribe, } from '../core';
28
+ export type { CacheControl, DataSDK, DataSDKGraphQL, GraphQLError, GraphQLRawDocument, GraphQLRequest, GraphQLRequestHeaders, GraphQLResponse, MutateOptions, MutationResult, QueryOptions, QueryResult, QuerySubscriber, SDKOptions, Unsubscribe, } from '../core';
29
29
  export type NodeOfConnection<T> = T extends {
30
30
  edges?: (infer E)[] | null;
31
31
  } | null ? E extends {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAiB,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAIpE,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;CACnD;AAED,YAAY,EAAE,oBAAoB,EAAE,CAAC;AAErC;;GA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AACH,MAAM,WAAW,cAAe,SAAQ,UAAU;IACjD,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CA2BxE;AAED,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,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,UAAU,EACV,WAAW,GACX,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS;IAC3C,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC;CAC3B,GAAG,IAAI,GACL,CAAC,SAAS;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,IAAI,GAClC,CAAC,GACD,KAAK,GACN,KAAK,CAAC"}
@@ -1,61 +1,94 @@
1
- import { g as L, S as m } from "../surface-Dd2tqrPi.js";
2
- import { w as V } from "../sdk-promise-D0sy7OW1.js";
3
- import { buildServiceDescriptor as _, setHeader as y } from "@conduit-client/service-fetch-network/v1";
4
- import { resolvedPromiseLike as u, ok as w, err as C, stableJSONStringify as x, DataNotFoundError as Q, UserVisibleError as H, deepFreeze as b, isUserVisibleError as G } from "@conduit-client/utils";
5
- import { print as D, parse as K } from "@conduit-client/onestore-graphql-parser/v1";
6
- import { RetryPolicy as z, buildServiceDescriptor as W } from "@conduit-client/service-retry/v1";
7
- import { buildServiceDescriptor as j } from "@conduit-client/service-cache/v1";
8
- import { buildServiceDescriptor as B } from "@conduit-client/service-cache-control/v1";
9
- import { buildInMemoryCacheInclusionPolicyService as J } from "@conduit-client/service-cache-inclusion-policy/v1";
10
- import { buildServiceDescriptor as X } from "@conduit-client/service-pubsub/v1";
11
- import { HttpCacheControlCommand as Y } from "@conduit-client/command-http-cache-control/v1";
12
- function Z(t) {
1
+ import { g as x, S as y } from "../surface-Dd2tqrPi.js";
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) {
13
13
  return (e) => {
14
- const [r, n] = e;
15
- if (typeof r == "string" && !r.startsWith("http")) {
16
- const s = r.startsWith("/") ? r : `/${r}`;
17
- return u([`${t}${s}`, n]);
14
+ const [t, n] = e;
15
+ if (typeof t == "string" && !t.startsWith("http")) {
16
+ const s = t.startsWith("/") ? t : `/${t}`;
17
+ return u([`${r}${s}`, n]);
18
18
  }
19
19
  return u(e);
20
20
  };
21
21
  }
22
- function ee(t) {
23
- return (e) => u(y("Authorization", `Bearer ${t}`, e));
22
+ function te(r) {
23
+ return (e) => u(b("Authorization", `Bearer ${r}`, e));
24
24
  }
25
- function re(t, e) {
26
- const r = [];
27
- return t && r.push(Z(t)), e && r.push(ee(e)), _({
28
- request: r
25
+ function ne(r, e) {
26
+ const t = [];
27
+ return r && t.push(re(r)), e && t.push(te(e)), R({
28
+ request: t
29
29
  }).service;
30
30
  }
31
- const v = () => {
32
- }, E = async () => {
31
+ const se = {
32
+ "Content-Type": "application/json",
33
+ Accept: "application/json",
34
+ "X-Chatter-Entity-Encoding": "false"
33
35
  };
34
- function q(t) {
36
+ function ae(r) {
37
+ if (r instanceof Headers) {
38
+ const e = [];
39
+ return r.forEach((t, n) => e.push([n, t])), e;
40
+ }
41
+ return Array.isArray(r) ? r.map(([e, t]) => [e, t]) : Object.entries(r);
42
+ }
43
+ function M(r, e) {
44
+ if (e === void 0) return { ...r };
45
+ const t = { ...r }, n = /* @__PURE__ */ new Map();
46
+ for (const a of Object.keys(t)) n.set(a.toLowerCase(), a);
47
+ const s = /* @__PURE__ */ new Set();
48
+ for (const [a, i] of ae(e)) {
49
+ const o = a.toLowerCase(), c = n.get(o);
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
+ }
52
+ return t;
53
+ }
54
+ function I(r) {
55
+ return M(se, r);
56
+ }
57
+ function oe(r) {
58
+ if (r === void 0) return;
59
+ const e = {};
60
+ return new Headers(r).forEach((t, n) => {
61
+ e[n] = t;
62
+ }), Object.keys(e).length > 0 ? e : void 0;
63
+ }
64
+ const S = () => {
65
+ }, D = async () => {
66
+ };
67
+ function k(r) {
35
68
  try {
36
- return w(K(t));
69
+ return C(j(r));
37
70
  } catch (e) {
38
- return C(l(e));
71
+ return E(d(e));
39
72
  }
40
73
  }
41
- function k(t, e) {
42
- const r = t.definitions.filter(
74
+ function q(r, e) {
75
+ const t = r.definitions.filter(
43
76
  (n) => n.kind === "OperationDefinition"
44
77
  );
45
- return r.length === 0 ? "unknown" : r.length === 1 ? e === void 0 || r[0].name?.value === e ? r[0].operation : "unknown" : e === void 0 ? "unknown" : r.find((n) => n.name?.value === e)?.operation ?? "unknown";
78
+ return t.length === 0 ? "unknown" : t.length === 1 ? e === void 0 || t[0].name?.value === e ? t[0].operation : "unknown" : e === void 0 ? "unknown" : t.find((n) => n.name?.value === e)?.operation ?? "unknown";
46
79
  }
47
- function l(t) {
48
- if (t && typeof t == "object" && "data" in t) {
49
- const e = t.data;
80
+ function d(r) {
81
+ if (r && typeof r == "object" && "data" in r) {
82
+ const e = r.data;
50
83
  if (e && typeof e == "object" && "errors" in e && Array.isArray(e.errors))
51
84
  return e.errors;
52
85
  }
53
- return t instanceof Error ? [{ message: t.message }] : typeof t == "string" ? [{ message: t }] : [{ message: "Unknown error" }];
86
+ return r instanceof Error ? [{ message: r.message }] : typeof r == "string" ? [{ message: r }] : [{ message: "Unknown error" }];
54
87
  }
55
- async function R(t, { mutation: e, variables: r, operationName: n }) {
56
- const s = q(e);
57
- if (s.isErr()) return { data: void 0, errors: s.error };
58
- const a = s.value, o = k(a, n);
88
+ async function L(r, { mutation: e, variables: t, operationName: n, headers: s }) {
89
+ const a = k(e);
90
+ if (a.isErr()) return { data: void 0, errors: a.error };
91
+ const i = a.value, o = q(i, n);
59
92
  if (o !== "mutation")
60
93
  return {
61
94
  data: void 0,
@@ -66,182 +99,192 @@ async function R(t, { mutation: e, variables: r, operationName: n }) {
66
99
  ]
67
100
  };
68
101
  try {
69
- const i = await t({
70
- query: D(a),
71
- variables: r,
72
- operationName: n
102
+ const c = await r({
103
+ query: A(i),
104
+ variables: t,
105
+ operationName: n,
106
+ headers: s
73
107
  });
74
108
  return {
75
- data: i.data ?? void 0,
76
- errors: i.errors
109
+ data: c.data ?? void 0,
110
+ errors: c.errors
77
111
  };
78
- } catch (i) {
79
- return { data: void 0, errors: l(i) };
112
+ } catch (c) {
113
+ return { data: void 0, errors: d(c) };
80
114
  }
81
115
  }
82
- function M(t) {
83
- function e(n, s, a) {
84
- return t({
85
- query: D(n),
116
+ function $(r) {
117
+ function e(n, s, a, i) {
118
+ return r({
119
+ query: A(n),
86
120
  variables: s,
87
- operationName: a
121
+ operationName: a,
122
+ headers: i
88
123
  }).then(
89
124
  (o) => ({
90
125
  data: o.data ?? void 0,
91
126
  errors: o.errors
92
127
  }),
93
- (o) => ({ data: void 0, errors: l(o) })
128
+ (o) => ({ data: void 0, errors: d(o) })
94
129
  );
95
130
  }
96
- async function r({
131
+ async function t({
97
132
  query: n,
98
133
  variables: s,
99
- operationName: a
134
+ operationName: a,
135
+ headers: i
100
136
  }) {
101
- const o = q(n);
137
+ const o = k(n);
102
138
  if (o.isErr())
103
139
  return {
104
140
  data: void 0,
105
141
  errors: o.error,
106
- subscribe: () => v,
107
- refresh: E
142
+ subscribe: () => S,
143
+ refresh: D
108
144
  };
109
- const i = o.value, d = k(i, a);
110
- if (d !== "query")
145
+ const c = o.value, f = q(c, a);
146
+ if (f !== "query")
111
147
  return {
112
148
  data: void 0,
113
149
  errors: [
114
150
  {
115
- message: `DataSDK.graphql.query() requires a GraphQL query, received ${d}.`
151
+ message: `DataSDK.graphql.query() requires a GraphQL query, received ${f}.`
116
152
  }
117
153
  ],
118
- subscribe: () => v,
119
- refresh: E
154
+ subscribe: () => S,
155
+ refresh: D
120
156
  };
121
- const c = /* @__PURE__ */ new Set(), p = s, f = await e(i, p, a);
157
+ const h = /* @__PURE__ */ new Set(), p = s, m = await e(c, p, a, i);
122
158
  return {
123
- data: f.data,
124
- errors: f.errors,
125
- subscribe(h) {
126
- return c.add(h), () => {
127
- c.delete(h);
159
+ data: m.data,
160
+ errors: m.errors,
161
+ subscribe(l) {
162
+ return h.add(l), () => {
163
+ h.delete(l);
128
164
  };
129
165
  },
130
166
  async refresh() {
131
- const h = await e(i, p, a);
132
- for (const S of c) S(h);
167
+ const l = await e(c, p, a, i);
168
+ for (const w of h) w(l);
133
169
  }
134
170
  };
135
171
  }
136
172
  return {
137
- query: r,
138
- mutate: (n) => R(t, n)
173
+ query: t,
174
+ mutate: (n) => L(r, n)
139
175
  };
140
176
  }
141
- const te = typeof __SF_API_VERSION__ < "u" ? __SF_API_VERSION__ : "65.0";
142
- function $(t = te) {
143
- return `/services/data/v${t}`;
177
+ const ie = typeof __SF_API_VERSION__ < "u" ? __SF_API_VERSION__ : "65.0";
178
+ function H(r = ie) {
179
+ return `/services/data/v${r}`;
144
180
  }
145
- class ne {
181
+ const ce = {
182
+ "Content-Type": "application/json",
183
+ Accept: "application/json"
184
+ };
185
+ class ue {
146
186
  clientFetch;
147
187
  pathData;
148
188
  graphql;
149
189
  constructor(e) {
150
- const r = se(), n = ae(e?.instanceUrl ?? r.instanceUrl), s = e?.accessToken ?? r.accessToken;
151
- this.pathData = $(e?.apiVersion ?? r.apiVersion), this.clientFetch = re(n || void 0, s), this.graphql = M(this.executeRawGraphQL.bind(this));
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));
152
192
  }
153
193
  async executeRawGraphQL({
154
194
  query: e,
155
- variables: r,
156
- operationName: n
195
+ variables: t,
196
+ operationName: n,
197
+ headers: s
157
198
  }) {
158
199
  return (await this.clientFetch(`${this.pathData}/graphql`, {
159
200
  method: "POST",
160
- body: JSON.stringify({ query: e, variables: r, operationName: n }),
161
- headers: {
162
- "Content-Type": "application/json",
163
- Accept: "application/json"
164
- }
201
+ body: JSON.stringify({ query: e, variables: t, operationName: n }),
202
+ headers: M(ce, s)
165
203
  })).json();
166
204
  }
167
205
  }
168
- function se() {
169
- const t = globalThis.MOSAIC_ENV;
206
+ function he() {
207
+ const r = globalThis.MOSAIC_ENV;
170
208
  return {
171
- instanceUrl: t?.instanceUrl,
172
- accessToken: t?.accessToken,
173
- apiVersion: t?.apiVersion
209
+ instanceUrl: r?.instanceUrl,
210
+ accessToken: r?.accessToken,
211
+ apiVersion: r?.apiVersion
174
212
  };
175
213
  }
176
- function ae(t) {
177
- if (!t || t === "/") return "";
178
- let e = t;
214
+ function le(r) {
215
+ if (!r || r === "/") return "";
216
+ let e = r;
179
217
  return !e.startsWith("/") && !e.startsWith("http") && (e = `/${e}`), e.endsWith("/") && (e = e.slice(0, -1)), e;
180
218
  }
181
- const oe = "graphqlQuery";
182
- class ie {
219
+ const de = "graphqlQuery";
220
+ class fe {
183
221
  graphql;
184
222
  constructor() {
185
- this.graphql = M(this.executeRawGraphQL.bind(this));
223
+ this.graphql = $(this.executeRawGraphQL.bind(this));
186
224
  }
225
+ /**
226
+ * The `headers` request option is intentionally not forwarded: this surface
227
+ * delegates to the `graphqlQuery` MCP tool over the ChatGPT bridge, which
228
+ * issues the HTTP request host-side and exposes no header channel.
229
+ */
187
230
  async executeRawGraphQL({
188
231
  query: e,
189
- variables: r,
232
+ variables: t,
190
233
  operationName: n
191
234
  }) {
192
- return (await window.openai.callTool(oe, {
235
+ return (await window.openai.callTool(de, {
193
236
  query: e,
194
- ...r != null ? { variables: r } : {},
237
+ ...t != null ? { variables: t } : {},
195
238
  ...n != null ? { operationName: n } : {}
196
239
  })).structuredContent;
197
240
  }
198
241
  }
199
- const ce = "X-SFDC-Client-Name", ue = "X-SFDC-Client-Version", he = "@salesforce/platform-sdk", le = "11.9.0", de = (t) => {
200
- let e = y(ce, he, t);
201
- return e = y(ue, le, e), u(e);
202
- }, pe = "X-CSRF-Token";
203
- function fe(t, e = {}) {
204
- const { protectedUrls: r = [], alwaysProtectedUrls: n = [] } = e;
242
+ const pe = "X-SFDC-Client-Name", me = "X-SFDC-Client-Version", ye = "@salesforce/platform-sdk", be = "11.10.1", 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 = {}) {
247
+ const { protectedUrls: t = [], alwaysProtectedUrls: n = [] } = e;
205
248
  return async (s) => {
206
- const [a, o] = s, i = new Request(a, o);
207
- if (P(n, i.url) || me(i.method) && P(r, i.url)) {
208
- const c = await t.getToken();
209
- s = y(pe, c, s);
249
+ const [a, i] = s, o = new Request(a, i);
250
+ if (O(n, o.url) || ge(o.method) && O(t, o.url)) {
251
+ const f = await r.getToken();
252
+ s = b(Se, f, s);
210
253
  }
211
254
  return u(s);
212
255
  };
213
256
  }
214
- function me(t) {
215
- const e = t.toLowerCase();
257
+ function ge(r) {
258
+ const e = r.toLowerCase();
216
259
  return e === "post" || e === "put" || e === "patch" || e === "delete";
217
260
  }
218
- function P(t, e) {
219
- const r = new URL(e);
220
- return t.some((n) => r.pathname.includes(n));
261
+ function O(r, e) {
262
+ const t = new URL(e);
263
+ return r.some((n) => t.pathname.includes(n));
221
264
  }
222
- function ye(t, e = {}) {
223
- const r = fe(t, e);
265
+ function Ce(r, e = {}) {
266
+ const t = we(r, e);
224
267
  async function n(s) {
225
- const a = await r(s);
268
+ const a = await t(s);
226
269
  return fetch(a[0], a[1]);
227
270
  }
228
271
  return (s, a) => a ? a.applyRetry(async () => n(s)) : n(s);
229
272
  }
230
- const be = [400, 401, 403];
231
- class ve extends z {
273
+ const Ee = [400, 401, 403];
274
+ class De extends W {
232
275
  constructor(e) {
233
276
  super(e), this.csrfTokenManager = e;
234
277
  }
235
278
  /**
236
279
  * Determines if a failed request should be retried due to CSRF token issues.
237
280
  */
238
- async shouldRetry(e, r) {
239
- return r.attempt >= 1 ? !1 : be.includes(e.status);
281
+ async shouldRetry(e, t) {
282
+ return t.attempt >= 1 ? !1 : Ee.includes(e.status);
240
283
  }
241
284
  /**
242
285
  * CSRF token refresh should happen immediately with no delay.
243
286
  */
244
- async calculateDelay(e, r) {
287
+ async calculateDelay(e, t) {
245
288
  return 0;
246
289
  }
247
290
  /**
@@ -250,13 +293,13 @@ class ve extends z {
250
293
  * @param _result - The failed response that triggered the retry (unused, already validated)
251
294
  * @param _context - Current retry context (unused but part of interface)
252
295
  */
253
- async prepareRetry(e, r) {
296
+ async prepareRetry(e, t) {
254
297
  await this.csrfTokenManager.refreshToken();
255
298
  }
256
299
  }
257
- class Se {
258
- constructor(e, r) {
259
- this.endpoint = e, this.cacheName = r, this.tokenPromise = this.obtainToken();
300
+ class Ae {
301
+ constructor(e, t) {
302
+ this.endpoint = e, this.cacheName = t, this.tokenPromise = this.obtainToken();
260
303
  }
261
304
  tokenPromise;
262
305
  refreshPromise;
@@ -283,10 +326,10 @@ class Se {
283
326
  * @returns Promise that resolves to the CSRF token string
284
327
  */
285
328
  async obtainToken() {
286
- let e = await this.withCache((s) => s.match(this.endpoint)), r = !1;
287
- e || (e = await fetch(this.endpoint, { method: "get" }), r = !0);
329
+ let e = await this.withCache((s) => s.match(this.endpoint)), t = !1;
330
+ e || (e = await fetch(this.endpoint, { method: "get" }), t = !0);
288
331
  const n = (await e.clone().json()).csrfToken;
289
- return r && await this.withCache((s) => s.put(this.endpoint, e)), n;
332
+ return t && await this.withCache((s) => s.put(this.endpoint, e)), n;
290
333
  }
291
334
  /**
292
335
  * Provides a safe way to interact with the Cache API with fallback for unsupported environments.
@@ -296,87 +339,82 @@ class Se {
296
339
  */
297
340
  async withCache(e) {
298
341
  if (this.cacheName && caches) {
299
- const r = await caches.open(this.cacheName);
300
- return e(r);
342
+ const t = await caches.open(this.cacheName);
343
+ return e(t);
301
344
  } else
302
345
  return;
303
346
  }
304
347
  }
305
- const T = /* @__PURE__ */ new Map();
306
- function ge(t) {
307
- const { endpoint: e, cacheName: r, ...n } = t.csrf;
308
- let s = T.get(e);
309
- return s || (s = new Se(e, r), T.set(e, s)), _(
348
+ const P = /* @__PURE__ */ new Map();
349
+ function ke(r) {
350
+ const { endpoint: e, cacheName: t, ...n } = r.csrf;
351
+ let s = P.get(e);
352
+ return s || (s = new Ae(e, t), P.set(e, s)), R(
310
353
  {
311
- retry: ye(s, n),
312
- request: [de]
354
+ retry: Ce(s, n),
355
+ request: [ve]
313
356
  },
314
- W(new ve(s)).service
357
+ B(new De(s)).service
315
358
  ).service;
316
359
  }
317
- const A = /* @__PURE__ */ new Map();
318
- function we(t) {
319
- let e = A.get(t);
360
+ const _ = /* @__PURE__ */ new Map();
361
+ function qe(r) {
362
+ let e = _.get(r);
320
363
  if (!e) {
321
- const r = j().service, n = J(r).service, s = B(r, n).service, a = X().service;
322
- e = { cache: r, cacheController: s, pubSub: a }, A.set(t, 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);
323
366
  }
324
367
  return e;
325
368
  }
326
- function Ce(t, e) {
327
- const r = we(t);
369
+ function Oe(r, e) {
370
+ const t = qe(r);
328
371
  return {
329
- shared: r,
372
+ shared: t,
330
373
  services: {
331
- cacheController: r.cacheController,
332
- pubSub: r.pubSub,
374
+ cacheController: t.cacheController,
375
+ pubSub: t.pubSub,
333
376
  fetch: e
334
377
  }
335
378
  };
336
379
  }
337
- function I() {
338
- return {
339
- "Content-Type": "application/json",
340
- Accept: "application/json",
341
- "X-Chatter-Entity-Encoding": "false"
342
- };
343
- }
344
380
  const N = 300;
345
- function Ee(t, e) {
381
+ function Pe(r, e) {
346
382
  try {
347
- return JSON.parse(JSON.stringify(t));
348
- } catch (r) {
383
+ return JSON.parse(JSON.stringify(r));
384
+ } catch (t) {
349
385
  const n = e || "(anonymous)", s = new TypeError(
350
- `HttpGraphQLResourceCacheControlCommand: variables for operation "${n}" must be JSON-serializable. ${r.message}`
386
+ `HttpGraphQLResourceCacheControlCommand: variables for operation "${n}" must be JSON-serializable. ${t.message}`
351
387
  );
352
- throw s.cause = r, s;
388
+ throw s.cause = t, s;
353
389
  }
354
390
  }
355
- function De(t) {
356
- if (typeof t == "object" && t.type === "max-age") {
357
- const e = t.maxAge;
391
+ function _e(r) {
392
+ if (typeof r == "object" && r.type === "max-age") {
393
+ const e = r.maxAge;
358
394
  return Number.isFinite(e) && e >= 0 ? e : N;
359
395
  }
360
396
  return N;
361
397
  }
362
- class qe extends Y {
363
- constructor(e, r, n) {
364
- super(r), this.url = n, this.query = e.query, this.normalizedOperationName = e.operationName ?? "", this.normalizedVariables = Ee(
398
+ class Ne extends ee {
399
+ constructor(e, t, n) {
400
+ super(t), this.url = n, this.query = e.query, this.normalizedOperationName = e.operationName ?? "", this.normalizedVariables = Pe(
365
401
  e.variables ?? {},
366
402
  this.normalizedOperationName
367
- ), this.cacheControl = e.cacheControl, this.resolvedMaxAge = De(e.cacheControl);
403
+ ), this.cacheControl = e.cacheControl, this.resolvedMaxAge = _e(e.cacheControl), this.headers = e.headers, this.headersKey = oe(e.headers);
368
404
  }
369
405
  query;
370
406
  normalizedVariables;
371
407
  normalizedOperationName;
372
408
  cacheControl;
373
409
  resolvedMaxAge;
410
+ headers;
411
+ headersKey;
374
412
  get fetchParams() {
375
413
  return [
376
414
  this.url,
377
415
  {
378
416
  method: "POST",
379
- headers: I(),
417
+ headers: I(this.headers),
380
418
  body: JSON.stringify({
381
419
  query: this.query,
382
420
  variables: this.normalizedVariables,
@@ -386,11 +424,12 @@ class qe extends Y {
386
424
  ];
387
425
  }
388
426
  buildKey() {
389
- return x({
427
+ const e = {
390
428
  query: this.query,
391
429
  variables: this.normalizedVariables,
392
430
  operationName: this.normalizedOperationName
393
- });
431
+ };
432
+ return this.headersKey !== void 0 && (e.headers = this.headersKey), V(e);
394
433
  }
395
434
  /**
396
435
  * Reads from the cache and returns the cache result or error
@@ -406,14 +445,14 @@ class qe extends Y {
406
445
  * @returns result or error from the cache
407
446
  */
408
447
  readFromCache(e) {
409
- const r = this.buildKey(), n = e.get(r)?.value;
410
- return n === void 0 ? u(C(new Q())) : u(w(n));
448
+ const t = this.buildKey(), n = e.get(t)?.value;
449
+ return n === void 0 ? u(E(new Q())) : u(C(n));
411
450
  }
412
- writeToCache(e, r) {
413
- if (r.isOk() && r.value.data != null && Object.keys(r.value.data).length > 0) {
451
+ writeToCache(e, t) {
452
+ if (t.isOk() && t.value.data != null && Object.keys(t.value.data).length > 0) {
414
453
  const n = Math.floor(Date.now() / 1e3);
415
454
  e.set(this.buildKey(), {
416
- value: r.value.data,
455
+ value: t.value.data,
417
456
  metadata: {
418
457
  cacheControl: {
419
458
  type: "max-age",
@@ -437,122 +476,124 @@ class qe extends Y {
437
476
  return e.errors && e.errors.length > 0;
438
477
  }
439
478
  processFetchReturnValue(e) {
440
- return this.responseHasErrors(e) ? C(new H(e)) : w(e);
479
+ return this.responseHasErrors(e) ? E(new G(e)) : C(e);
441
480
  }
442
481
  }
443
- function U(t) {
444
- if (G(t) && t.data && typeof t.data == "object") {
445
- const e = t.data;
482
+ function F(r) {
483
+ if (z(r) && r.data && typeof r.data == "object") {
484
+ const e = r.data;
446
485
  if (e.data != null)
447
486
  return e.data;
448
487
  }
449
488
  }
450
- function ke(t) {
489
+ function Te(r) {
451
490
  return (e) => {
452
491
  if (e.isOk()) {
453
- const r = e.value;
454
- b(r), t({ data: r, errors: void 0 });
492
+ const t = e.value;
493
+ v(t), r({ data: t, errors: void 0 });
455
494
  } else {
456
- const r = U(e.error);
457
- r && b(r), t({ data: r, errors: l(e.error) });
495
+ const t = F(e.error);
496
+ t && v(t), r({ data: t, errors: d(e.error) });
458
497
  }
459
498
  };
460
499
  }
461
- async function Pe(t) {
462
- let e, r, n;
500
+ async function Re(r) {
501
+ let e, t, n;
463
502
  try {
464
- const s = await t.execute();
465
- s.isOk() ? (e = s.value.data, b(e), n = (a) => s.value.subscribe(a)) : (e = U(s.error.failure), e && b(e), r = l(s.error.failure), n = (a) => s.error.subscribe(a));
503
+ 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));
466
505
  } catch (s) {
467
- r = l(s);
506
+ t = d(s);
468
507
  }
469
508
  return {
470
509
  data: e,
471
- errors: r,
510
+ errors: t,
472
511
  subscribe(s) {
473
- return n ? n(ke(s)) : v;
512
+ return n ? n(Te(s)) : S;
474
513
  },
475
514
  async refresh() {
476
- await t.refresh();
515
+ await r.refresh();
477
516
  }
478
517
  };
479
518
  }
480
- function g(t) {
519
+ function g(r) {
481
520
  return {
482
521
  data: void 0,
483
- errors: t,
484
- subscribe: () => v,
485
- refresh: E
522
+ errors: r,
523
+ subscribe: () => S,
524
+ refresh: D
486
525
  };
487
526
  }
488
- function Te({
489
- bundle: t,
527
+ function Me({
528
+ bundle: r,
490
529
  url: e,
491
- executeRaw: r
530
+ executeRaw: t
492
531
  }) {
493
- const { services: n } = t;
532
+ const { services: n } = r;
494
533
  async function s({
495
534
  query: a,
496
- variables: o,
497
- operationName: i,
498
- cacheControl: d
535
+ variables: i,
536
+ operationName: o,
537
+ cacheControl: c,
538
+ headers: f
499
539
  }) {
500
- const c = q(a);
501
- if (c.isErr()) return g(c.error);
502
- const p = c.value, f = k(p, i);
503
- if (f !== "query")
540
+ const h = k(a);
541
+ if (h.isErr()) return g(h.error);
542
+ const p = h.value, m = q(p, o);
543
+ if (m !== "query")
504
544
  return g([
505
545
  {
506
- message: `DataSDK.graphql.query() requires a GraphQL query, received ${f}.`
546
+ message: `DataSDK.graphql.query() requires a GraphQL query, received ${m}.`
507
547
  }
508
548
  ]);
509
- let h;
549
+ let l;
510
550
  try {
511
- h = new qe(
551
+ l = new Ne(
512
552
  {
513
- query: D(p),
514
- variables: o,
515
- operationName: i,
516
- cacheControl: d
553
+ query: A(p),
554
+ variables: i,
555
+ operationName: o,
556
+ cacheControl: c,
557
+ headers: f
517
558
  },
518
559
  n,
519
560
  e
520
561
  );
521
- } catch (S) {
522
- return g(l(S));
562
+ } catch (w) {
563
+ return g(d(w));
523
564
  }
524
- return Pe(h);
565
+ return Re(l);
525
566
  }
526
567
  return {
527
568
  query: s,
528
- mutate: (a) => R(r, a)
569
+ mutate: (a) => L(t, a)
529
570
  };
530
571
  }
531
- const Ae = 1, Ne = `@salesforce/platform-sdk-data_v${Ae}`, F = $(), Oe = `${F}/ui-api`, O = `${F}/graphql`;
532
- class _e {
572
+ const Ie = 1, Le = `@salesforce/platform-sdk-data_v${Ie}`, U = H(), $e = `${U}/ui-api`, T = `${U}/graphql`;
573
+ class He {
533
574
  baseUrl;
534
575
  clientFetch;
535
576
  onStatus;
536
577
  graphql;
537
578
  constructor(e) {
538
- const r = Re();
539
- this.baseUrl = Me(e?.basePath ?? r.apiPath), this.onStatus = e?.onStatus ?? {}, this.clientFetch = ge({
579
+ const t = Fe();
580
+ this.baseUrl = Ue(e?.basePath ?? t.apiPath), this.onStatus = e?.onStatus ?? {}, this.clientFetch = ke({
540
581
  csrf: {
541
- endpoint: `${this.baseUrl}${Oe}/session/csrf`,
542
- cacheName: Ne,
582
+ endpoint: `${this.baseUrl}${$e}/session/csrf`,
583
+ cacheName: Le,
543
584
  protectedUrls: ["services/data/v", "services/apexrest"],
544
585
  alwaysProtectedUrls: ["services/apexrest"]
545
586
  }
546
587
  });
547
- const n = (a, o) => this.fetch(a, o), s = Ce(this.baseUrl, n);
548
- this.graphql = Te({
588
+ const n = (a, i) => this.fetch(a, i), s = Oe(this.baseUrl, n);
589
+ this.graphql = Me({
549
590
  bundle: s,
550
- url: O,
591
+ url: T,
551
592
  executeRaw: this.executeRawGraphQL.bind(this)
552
593
  });
553
594
  }
554
- async fetch(e, r) {
555
- const n = this.applySalesforceBase(e), s = await this.clientFetch(n, r);
595
+ async fetch(e, t) {
596
+ const n = this.applySalesforceBase(e), s = await this.clientFetch(n, t);
556
597
  return await this.onStatus[s.status]?.(), s;
557
598
  }
558
599
  /**
@@ -563,13 +604,14 @@ class _e {
563
604
  */
564
605
  async executeRawGraphQL({
565
606
  query: e,
566
- variables: r,
567
- operationName: n
607
+ variables: t,
608
+ operationName: n,
609
+ headers: s
568
610
  }) {
569
- return (await this.fetch(O, {
611
+ return (await this.fetch(T, {
570
612
  method: "POST",
571
- body: JSON.stringify({ query: e, variables: r, operationName: n }),
572
- headers: I()
613
+ body: JSON.stringify({ query: e, variables: t, operationName: n }),
614
+ headers: I(s)
573
615
  })).json();
574
616
  }
575
617
  /**
@@ -580,41 +622,41 @@ class _e {
580
622
  if (typeof e == "string") {
581
623
  if (e.startsWith("http"))
582
624
  return e;
583
- const r = e.startsWith("/") ? e : `/${e}`;
584
- return `${this.baseUrl}${r}`;
625
+ const t = e.startsWith("/") ? e : `/${e}`;
626
+ return `${this.baseUrl}${t}`;
585
627
  }
586
628
  return e;
587
629
  }
588
630
  }
589
- function Re() {
631
+ function Fe() {
590
632
  return {
591
633
  apiPath: globalThis.SFDC_ENV?.apiPath
592
634
  };
593
635
  }
594
- function Me(t) {
595
- if (!t || t === "/") return "";
596
- let e = t;
636
+ function Ue(r) {
637
+ if (!r || r === "/") return "";
638
+ let e = r;
597
639
  return e.startsWith("/") || (e = `/${e}`), e.endsWith("/") && (e = e.slice(0, -1)), e;
598
640
  }
599
- function ze(t, ...e) {
600
- let r = t[0] ?? "";
641
+ function Ye(r, ...e) {
642
+ let t = r[0] ?? "";
601
643
  for (let n = 0; n < e.length; n += 1)
602
- r += String(e[n]) + (t[n + 1] ?? "");
603
- return r;
644
+ t += String(e[n]) + (r[n + 1] ?? "");
645
+ return t;
604
646
  }
605
- function We(t) {
606
- return V(
647
+ function Ze(r) {
648
+ return K(
607
649
  (async () => {
608
650
  try {
609
- switch (await L(t?.surface)) {
610
- case m.OpenAI:
611
- return new ie();
612
- case m.WebApp:
613
- case m.MicroFrontend:
614
- return new _e(t?.webapp);
615
- case m.Mosaic:
616
- return new ne(t?.mosaic);
617
- case m.MCPApps:
651
+ switch (await x(r?.surface)) {
652
+ case y.OpenAI:
653
+ return new fe();
654
+ case y.WebApp:
655
+ case y.MicroFrontend:
656
+ return new He(r?.webapp);
657
+ case y.Mosaic:
658
+ return new ue(r?.mosaic);
659
+ case y.MCPApps:
618
660
  return {};
619
661
  default:
620
662
  return {};
@@ -627,6 +669,6 @@ function We(t) {
627
669
  );
628
670
  }
629
671
  export {
630
- We as createDataSDK,
631
- ze as gql
672
+ Ze as createDataSDK,
673
+ Ye as gql
632
674
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/mosaic/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,YAAY,CAAC;AAI3F;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;gBAErB,OAAO,CAAC,EAAE,oBAAoB;YAa5B,iBAAiB;CAgB/B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/mosaic/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,YAAY,CAAC;AAc3F;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;gBAErB,OAAO,CAAC,EAAE,oBAAoB;YAa5B,iBAAiB;CAc/B"}
@@ -6,6 +6,11 @@ import { DataSDK, DataSDKGraphQL } from '../../core';
6
6
  export declare class OpenAIDataSDK implements DataSDK {
7
7
  readonly graphql: DataSDKGraphQL;
8
8
  constructor();
9
+ /**
10
+ * The `headers` request option is intentionally not forwarded: this surface
11
+ * delegates to the `graphqlQuery` MCP tool over the ChatGPT bridge, which
12
+ * issues the HTTP request host-side and exposes no header channel.
13
+ */
9
14
  private executeRawGraphQL;
10
15
  }
11
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/openai/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,YAAY,CAAC;AAK3F;;;GAGG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;;YAMnB,iBAAiB;CAa/B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/openai/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,YAAY,CAAC;AAK3F;;;GAGG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;;IAMjC;;;;OAIG;YACW,iBAAiB;CAa/B"}
@@ -5,12 +5,21 @@ import { CacheControlStrategyConfig, NamedCacheControllerService } from '@condui
5
5
  import { FetchService, NamedFetchService } from '@conduit-client/service-fetch-network/v1';
6
6
  import { NamedPubSubService } from '@conduit-client/service-pubsub/v1';
7
7
  import { Result, SyncOrAsync } from '@conduit-client/utils';
8
- import { CacheControl } from '../../../../core/data';
8
+ import { CacheControl, GraphQLRequestHeaders } from '../../../../core/data';
9
9
  export interface GraphQLResourceRequestParams {
10
10
  query: string;
11
11
  variables?: Record<string, unknown>;
12
12
  operationName?: string;
13
13
  cacheControl?: CacheControl;
14
+ /**
15
+ * Extra HTTP headers merged over the canonical GraphQL header set on the
16
+ * outgoing request. Included in {@link
17
+ * HttpGraphQLResourceCacheControlCommand.buildKey} (normalized) because they
18
+ * can scope the response — e.g. two identical queries carrying different
19
+ * `Authorization` must not share a cache entry, or a later caller could read
20
+ * an earlier caller's data without the server re-authorizing.
21
+ */
22
+ headers?: GraphQLRequestHeaders;
14
23
  }
15
24
  type Services = NamedCacheControllerService & Partial<NamedPubSubService> & NamedFetchService;
16
25
  /**
@@ -64,6 +73,8 @@ export declare class HttpGraphQLResourceCacheControlCommand<TData extends Record
64
73
  private readonly normalizedOperationName;
65
74
  private readonly cacheControl;
66
75
  private readonly resolvedMaxAge;
76
+ private readonly headers;
77
+ private readonly headersKey;
67
78
  constructor(config: GraphQLResourceRequestParams, services: Services, url: string);
68
79
  protected get fetchParams(): Parameters<FetchService>;
69
80
  buildKey(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../../src/data/shared/graphql/cache/command.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,KAAK,EACX,0BAA0B,EAC1B,2BAA2B,EAC3B,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAON,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAuB1D,MAAM,WAAW,4BAA4B;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,YAAY,CAAC;CAC5B;AAED,KAAK,QAAQ,GAAG,2BAA2B,GAAG,OAAO,CAAC,kBAAkB,CAAC,GAAG,iBAAiB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,KAAK,EAAE,cAAc,EAA2C,MAAM,eAAe,CAAC;AAE7F,UAAU,yBAAyB;IAClC,MAAM,EAAE,WAAW,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,kBAAkB,CAAC;CAC/B;AAWD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EAClC,MAAM,EACN,GAAG,EACH,UAAU,GACV,EAAE,yBAAyB,GAAG,cAAc,CA4C5C"}
1
+ {"version":3,"file":"cached-graphql.d.ts","sourceRoot":"","sources":["../../../../src/data/shared/graphql/cached-graphql.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAON,KAAK,kBAAkB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,cAAc,EAA2C,MAAM,eAAe,CAAC;AAE7F,UAAU,yBAAyB;IAClC,MAAM,EAAE,WAAW,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,kBAAkB,CAAC;CAC/B;AAWD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EAClC,MAAM,EACN,GAAG,EACH,UAAU,GACV,EAAE,yBAAyB,GAAG,cAAc,CA8C5C"}
@@ -12,5 +12,5 @@ export declare function parseToDocument(op: GraphQLRawDocument): Result<Document
12
12
  export declare function getOperationKind(document: DocumentNode, operationName?: string): "query" | "mutation" | "subscription" | "unknown";
13
13
  export declare function toErrors(reason: unknown): GraphQLError[];
14
14
  export type RawGraphQLExecutor = <T, V = Record<string, unknown>>(request: GraphQLRequest<V>) => Promise<GraphQLResponse<T>>;
15
- export declare function executeMutate<T, V = Record<string, unknown>>(executeRaw: RawGraphQLExecutor, { mutation: op, variables, operationName: explicitName }: MutateOptions<V>): Promise<MutationResult<T>>;
15
+ export declare function executeMutate<T, V = Record<string, unknown>>(executeRaw: RawGraphQLExecutor, { mutation: op, variables, operationName: explicitName, headers }: MutateOptions<V>): Promise<MutationResult<T>>;
16
16
  //# sourceMappingURL=graphql-parse.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphql-parse.d.ts","sourceRoot":"","sources":["../../../../src/data/shared/graphql/graphql-parse.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAGN,KAAK,YAAY,EAEjB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EACX,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,aAAa,EACb,cAAc,EACd,WAAW,EACX,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,UAAU,EAAE,WAExB,CAAC;AAEF,eAAO,MAAM,YAAY,QAAa,OAAO,CAAC,IAAI,CAEjD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,MAAM,CAAC,YAAY,EAAE,YAAY,EAAE,CAAC,CAM5F;AAED,wBAAgB,gBAAgB,CAC/B,QAAQ,EAAE,YAAY,EACtB,aAAa,CAAC,EAAE,MAAM,GACpB,OAAO,GAAG,UAAU,GAAG,cAAc,GAAG,SAAS,CAanD;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,YAAY,EAAE,CAexD;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/D,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,KACtB,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;AAEjC,wBAAsB,aAAa,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjE,UAAU,EAAE,kBAAkB,EAC9B,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,aAAa,CAAC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,EAAE,aAAa,CAAC,CAAC,CAAC,GACjF,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CA8B5B"}
@@ -4,10 +4,44 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
  /**
7
- * Builds the canonical request header set for Salesforce GraphQL calls.
8
- * Used by both the WebApp DataSDK transport path and the cache control
9
- * command, so the wire format stays identical regardless of which path
10
- * a consumer's request takes.
7
+ * Merge caller-supplied `overrides` over a `base` header set caller wins on
8
+ * collision and return a plain header record suitable for `RequestInit`.
9
+ *
10
+ * `overrides` accepts any `HeadersInit` form: a plain record, an array of
11
+ * `[name, value]` tuples, or a `Headers` instance. Multi-valued headers are
12
+ * expressible via repeated tuple names (folded here into one comma-separated
13
+ * value) or a pre-built `Headers`.
14
+ *
15
+ * With no overrides the `base` record is returned by value, unchanged. Header
16
+ * names are matched case-insensitively (they are case-insensitive per RFC 7230
17
+ * §3.2), so a caller-supplied `content-type` overrides the canonical
18
+ * `Content-Type` in place rather than emitting a duplicate. The winning name's
19
+ * original casing is preserved — the base key on collision, otherwise the
20
+ * caller's.
11
21
  */
12
- export declare function buildGraphQLRequestHeaders(): Record<string, string>;
22
+ export declare function mergeRequestHeaders(base: Record<string, string>, overrides?: HeadersInit): Record<string, string>;
23
+ /**
24
+ * Builds the canonical Salesforce GraphQL request headers for the core/webapp
25
+ * surface, with optional per-request `overrides` merged on top. Used by both
26
+ * the WebApp DataSDK transport path and the cache control command so the wire
27
+ * format stays identical regardless of which path a consumer's request takes.
28
+ */
29
+ export declare function buildGraphQLRequestHeaders(overrides?: HeadersInit): Record<string, string>;
30
+ /**
31
+ * Reduce a per-request `HeadersInit` into a stable, canonical record for use as
32
+ * part of a cache key. Any `HeadersInit` form collapses to the same result:
33
+ * names are lowercased and repeated names folded (via `Headers`), so callers
34
+ * passing equivalent headers in different shapes, casing, or order key
35
+ * identically. Returns `undefined` when there are no headers, so the no-header
36
+ * path keeps a cache key byte-identical to one built with no headers at all.
37
+ *
38
+ * Headers participate in cache identity because they can scope the response —
39
+ * most importantly `Authorization`. Two otherwise-identical queries carrying
40
+ * different auth must resolve to different cache entries; sharing one would let
41
+ * a later caller read an earlier caller's response without the server ever
42
+ * re-authorizing (a silent cross-auth data leak). See {@link
43
+ * mergeRequestHeaders} for the outgoing-request merge, which is separate from
44
+ * this keying concern.
45
+ */
46
+ export declare function normalizeHeadersForKey(headers?: HeadersInit): Record<string, string> | undefined;
13
47
  //# sourceMappingURL=headers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../../../src/data/shared/graphql/headers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMnE"}
1
+ {"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../../../src/data/shared/graphql/headers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA6BH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAClC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,SAAS,CAAC,EAAE,WAAW,GACrB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA+BxB;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE1F;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAOhG"}
@@ -1 +1 @@
1
- {"version":3,"file":"uncached-graphql.d.ts","sourceRoot":"","sources":["../../../../src/data/shared/graphql/uncached-graphql.ts"],"names":[],"mappings":"AAMA,OAAO,EAON,KAAK,kBAAkB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACX,cAAc,EAKd,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,kBAAkB,GAAG,cAAc,CAyEnF"}
1
+ {"version":3,"file":"uncached-graphql.d.ts","sourceRoot":"","sources":["../../../../src/data/shared/graphql/uncached-graphql.ts"],"names":[],"mappings":"AAMA,OAAO,EAON,KAAK,kBAAkB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACX,cAAc,EAMd,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,kBAAkB,GAAG,cAAc,CA4EnF"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/webapp/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,YAAY,CAAC;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAcrD;;GAEG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyD;IAClF,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;gBAErB,OAAO,CAAC,EAAE,oBAAoB;IA2BpC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IAUjF;;;;;OAKG;YACW,iBAAiB;IAc/B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;CAa3B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/webapp/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,YAAY,CAAC;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAcrD;;GAEG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyD;IAClF,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;gBAErB,OAAO,CAAC,EAAE,oBAAoB;IA2BpC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IAUjF;;;;;OAKG;YACW,iBAAiB;IAe/B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;CAa3B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/platform-sdk",
3
- "version": "11.9.0",
3
+ "version": "11.10.1",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -115,7 +115,7 @@
115
115
  "@conduit-client/service-pubsub": "3.19.6",
116
116
  "@conduit-client/service-retry": "3.19.6",
117
117
  "@conduit-client/utils": "3.19.6",
118
- "@salesforce/jsonrpc": "^11.9.0",
118
+ "@salesforce/jsonrpc": "^11.10.1",
119
119
  "@salesforce/sf-embedding-bridge": "2.2.4-rc.1"
120
120
  },
121
121
  "peerDependencies": {