@salesforce/platform-sdk 11.9.0 → 11.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/data.d.ts +29 -0
- package/dist/core/data.d.ts.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/data/index.d.ts +1 -1
- package/dist/data/index.d.ts.map +1 -1
- package/dist/data/index.js +300 -258
- package/dist/data/mosaic/index.d.ts.map +1 -1
- package/dist/data/openai/index.d.ts +5 -0
- package/dist/data/openai/index.d.ts.map +1 -1
- package/dist/data/shared/graphql/cache/command.d.ts +12 -1
- package/dist/data/shared/graphql/cache/command.d.ts.map +1 -1
- package/dist/data/shared/graphql/cached-graphql.d.ts.map +1 -1
- package/dist/data/shared/graphql/graphql-parse.d.ts +1 -1
- package/dist/data/shared/graphql/graphql-parse.d.ts.map +1 -1
- package/dist/data/shared/graphql/headers.d.ts +39 -5
- package/dist/data/shared/graphql/headers.d.ts.map +1 -1
- package/dist/data/shared/graphql/uncached-graphql.d.ts.map +1 -1
- package/dist/data/webapp/index.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/core/data.d.ts
CHANGED
|
@@ -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}.
|
package/dist/core/data.d.ts.map
CHANGED
|
@@ -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;
|
|
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;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC;AAEhD,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,C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IAC1B,SAAS,CAAC,EAAE,CAAC,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oFAAoF;IACpF,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,qBAAqB,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,MAAM,CAAC,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"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -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';
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -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,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AAY,EACZ,OAAO,EACP,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,cAAc,EACd,YAAY,EACZ,WAAW,EACX,eAAe,EACf,WAAW,GACX,MAAM,QAAQ,CAAC;AAGhB,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7F,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC7E,YAAY,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAGnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG1D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/data/index.d.ts
CHANGED
|
@@ -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 {
|
package/dist/data/index.d.ts.map
CHANGED
|
@@ -1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C,GACD,KAAK,GACN,KAAK,CAAC"}
|
package/dist/data/index.js
CHANGED
|
@@ -1,61 +1,94 @@
|
|
|
1
|
-
import { g as
|
|
2
|
-
import { w as
|
|
3
|
-
import { buildServiceDescriptor as
|
|
4
|
-
import { resolvedPromiseLike as u, ok as
|
|
5
|
-
import { print as
|
|
6
|
-
import { RetryPolicy as
|
|
7
|
-
import { buildServiceDescriptor as
|
|
8
|
-
import { buildServiceDescriptor as
|
|
9
|
-
import { buildInMemoryCacheInclusionPolicyService as
|
|
10
|
-
import { buildServiceDescriptor as
|
|
11
|
-
import { HttpCacheControlCommand as
|
|
12
|
-
function
|
|
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 [
|
|
15
|
-
if (typeof
|
|
16
|
-
const s =
|
|
17
|
-
return u([`${
|
|
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
|
|
23
|
-
return (e) => u(
|
|
22
|
+
function te(r) {
|
|
23
|
+
return (e) => u(b("Authorization", `Bearer ${r}`, e));
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
const
|
|
27
|
-
return
|
|
28
|
-
request:
|
|
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
|
|
32
|
-
|
|
31
|
+
const se = {
|
|
32
|
+
"Content-Type": "application/json",
|
|
33
|
+
Accept: "application/json",
|
|
34
|
+
"X-Chatter-Entity-Encoding": "false"
|
|
33
35
|
};
|
|
34
|
-
function
|
|
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
|
|
69
|
+
return C(j(r));
|
|
37
70
|
} catch (e) {
|
|
38
|
-
return
|
|
71
|
+
return E(d(e));
|
|
39
72
|
}
|
|
40
73
|
}
|
|
41
|
-
function
|
|
42
|
-
const
|
|
74
|
+
function q(r, e) {
|
|
75
|
+
const t = r.definitions.filter(
|
|
43
76
|
(n) => n.kind === "OperationDefinition"
|
|
44
77
|
);
|
|
45
|
-
return
|
|
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
|
|
48
|
-
if (
|
|
49
|
-
const e =
|
|
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
|
|
86
|
+
return r instanceof Error ? [{ message: r.message }] : typeof r == "string" ? [{ message: r }] : [{ message: "Unknown error" }];
|
|
54
87
|
}
|
|
55
|
-
async function
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
58
|
-
const
|
|
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
|
|
70
|
-
query:
|
|
71
|
-
variables:
|
|
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:
|
|
76
|
-
errors:
|
|
109
|
+
data: c.data ?? void 0,
|
|
110
|
+
errors: c.errors
|
|
77
111
|
};
|
|
78
|
-
} catch (
|
|
79
|
-
return { data: void 0, errors:
|
|
112
|
+
} catch (c) {
|
|
113
|
+
return { data: void 0, errors: d(c) };
|
|
80
114
|
}
|
|
81
115
|
}
|
|
82
|
-
function
|
|
83
|
-
function e(n, s, a) {
|
|
84
|
-
return
|
|
85
|
-
query:
|
|
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:
|
|
128
|
+
(o) => ({ data: void 0, errors: d(o) })
|
|
94
129
|
);
|
|
95
130
|
}
|
|
96
|
-
async function
|
|
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 =
|
|
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: () =>
|
|
107
|
-
refresh:
|
|
142
|
+
subscribe: () => S,
|
|
143
|
+
refresh: D
|
|
108
144
|
};
|
|
109
|
-
const
|
|
110
|
-
if (
|
|
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 ${
|
|
151
|
+
message: `DataSDK.graphql.query() requires a GraphQL query, received ${f}.`
|
|
116
152
|
}
|
|
117
153
|
],
|
|
118
|
-
subscribe: () =>
|
|
119
|
-
refresh:
|
|
154
|
+
subscribe: () => S,
|
|
155
|
+
refresh: D
|
|
120
156
|
};
|
|
121
|
-
const
|
|
157
|
+
const h = /* @__PURE__ */ new Set(), p = s, m = await e(c, p, a, i);
|
|
122
158
|
return {
|
|
123
|
-
data:
|
|
124
|
-
errors:
|
|
125
|
-
subscribe(
|
|
126
|
-
return
|
|
127
|
-
|
|
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
|
|
132
|
-
for (const
|
|
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:
|
|
138
|
-
mutate: (n) =>
|
|
173
|
+
query: t,
|
|
174
|
+
mutate: (n) => L(r, n)
|
|
139
175
|
};
|
|
140
176
|
}
|
|
141
|
-
const
|
|
142
|
-
function
|
|
143
|
-
return `/services/data/v${
|
|
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
|
-
|
|
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
|
|
151
|
-
this.pathData =
|
|
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:
|
|
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:
|
|
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
|
|
169
|
-
const
|
|
206
|
+
function he() {
|
|
207
|
+
const r = globalThis.MOSAIC_ENV;
|
|
170
208
|
return {
|
|
171
|
-
instanceUrl:
|
|
172
|
-
accessToken:
|
|
173
|
-
apiVersion:
|
|
209
|
+
instanceUrl: r?.instanceUrl,
|
|
210
|
+
accessToken: r?.accessToken,
|
|
211
|
+
apiVersion: r?.apiVersion
|
|
174
212
|
};
|
|
175
213
|
}
|
|
176
|
-
function
|
|
177
|
-
if (!
|
|
178
|
-
let e =
|
|
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
|
|
182
|
-
class
|
|
219
|
+
const de = "graphqlQuery";
|
|
220
|
+
class fe {
|
|
183
221
|
graphql;
|
|
184
222
|
constructor() {
|
|
185
|
-
this.graphql =
|
|
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:
|
|
232
|
+
variables: t,
|
|
190
233
|
operationName: n
|
|
191
234
|
}) {
|
|
192
|
-
return (await window.openai.callTool(
|
|
235
|
+
return (await window.openai.callTool(de, {
|
|
193
236
|
query: e,
|
|
194
|
-
...
|
|
237
|
+
...t != null ? { variables: t } : {},
|
|
195
238
|
...n != null ? { operationName: n } : {}
|
|
196
239
|
})).structuredContent;
|
|
197
240
|
}
|
|
198
241
|
}
|
|
199
|
-
const
|
|
200
|
-
let e =
|
|
201
|
-
return e =
|
|
202
|
-
},
|
|
203
|
-
function
|
|
204
|
-
const { protectedUrls:
|
|
242
|
+
const pe = "X-SFDC-Client-Name", me = "X-SFDC-Client-Version", ye = "@salesforce/platform-sdk", be = "11.10.0", ve = (r) => {
|
|
243
|
+
let e = b(pe, ye, r);
|
|
244
|
+
return e = b(me, be, e), u(e);
|
|
245
|
+
}, Se = "X-CSRF-Token";
|
|
246
|
+
function we(r, e = {}) {
|
|
247
|
+
const { protectedUrls: t = [], alwaysProtectedUrls: n = [] } = e;
|
|
205
248
|
return async (s) => {
|
|
206
|
-
const [a,
|
|
207
|
-
if (
|
|
208
|
-
const
|
|
209
|
-
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
|
|
215
|
-
const e =
|
|
257
|
+
function ge(r) {
|
|
258
|
+
const e = r.toLowerCase();
|
|
216
259
|
return e === "post" || e === "put" || e === "patch" || e === "delete";
|
|
217
260
|
}
|
|
218
|
-
function
|
|
219
|
-
const
|
|
220
|
-
return
|
|
261
|
+
function O(r, e) {
|
|
262
|
+
const t = new URL(e);
|
|
263
|
+
return r.some((n) => t.pathname.includes(n));
|
|
221
264
|
}
|
|
222
|
-
function
|
|
223
|
-
const
|
|
265
|
+
function Ce(r, e = {}) {
|
|
266
|
+
const t = we(r, e);
|
|
224
267
|
async function n(s) {
|
|
225
|
-
const a = await
|
|
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
|
|
231
|
-
class
|
|
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,
|
|
239
|
-
return
|
|
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,
|
|
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,
|
|
296
|
+
async prepareRetry(e, t) {
|
|
254
297
|
await this.csrfTokenManager.refreshToken();
|
|
255
298
|
}
|
|
256
299
|
}
|
|
257
|
-
class
|
|
258
|
-
constructor(e,
|
|
259
|
-
this.endpoint = e, this.cacheName =
|
|
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)),
|
|
287
|
-
e || (e = await fetch(this.endpoint, { method: "get" }),
|
|
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
|
|
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
|
|
300
|
-
return e(
|
|
342
|
+
const t = await caches.open(this.cacheName);
|
|
343
|
+
return e(t);
|
|
301
344
|
} else
|
|
302
345
|
return;
|
|
303
346
|
}
|
|
304
347
|
}
|
|
305
|
-
const
|
|
306
|
-
function
|
|
307
|
-
const { endpoint: e, cacheName:
|
|
308
|
-
let s =
|
|
309
|
-
return s || (s = new
|
|
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:
|
|
312
|
-
request: [
|
|
354
|
+
retry: Ce(s, n),
|
|
355
|
+
request: [ve]
|
|
313
356
|
},
|
|
314
|
-
|
|
357
|
+
B(new De(s)).service
|
|
315
358
|
).service;
|
|
316
359
|
}
|
|
317
|
-
const
|
|
318
|
-
function
|
|
319
|
-
let e =
|
|
360
|
+
const _ = /* @__PURE__ */ new Map();
|
|
361
|
+
function qe(r) {
|
|
362
|
+
let e = _.get(r);
|
|
320
363
|
if (!e) {
|
|
321
|
-
const
|
|
322
|
-
e = { cache:
|
|
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
|
|
327
|
-
const
|
|
369
|
+
function Oe(r, e) {
|
|
370
|
+
const t = qe(r);
|
|
328
371
|
return {
|
|
329
|
-
shared:
|
|
372
|
+
shared: t,
|
|
330
373
|
services: {
|
|
331
|
-
cacheController:
|
|
332
|
-
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
|
|
381
|
+
function Pe(r, e) {
|
|
346
382
|
try {
|
|
347
|
-
return JSON.parse(JSON.stringify(
|
|
348
|
-
} catch (
|
|
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. ${
|
|
386
|
+
`HttpGraphQLResourceCacheControlCommand: variables for operation "${n}" must be JSON-serializable. ${t.message}`
|
|
351
387
|
);
|
|
352
|
-
throw s.cause =
|
|
388
|
+
throw s.cause = t, s;
|
|
353
389
|
}
|
|
354
390
|
}
|
|
355
|
-
function
|
|
356
|
-
if (typeof
|
|
357
|
-
const e =
|
|
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
|
|
363
|
-
constructor(e,
|
|
364
|
-
super(
|
|
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 =
|
|
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
|
-
|
|
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
|
|
410
|
-
return n === void 0 ? u(
|
|
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,
|
|
413
|
-
if (
|
|
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:
|
|
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) ?
|
|
479
|
+
return this.responseHasErrors(e) ? E(new G(e)) : C(e);
|
|
441
480
|
}
|
|
442
481
|
}
|
|
443
|
-
function
|
|
444
|
-
if (
|
|
445
|
-
const e =
|
|
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
|
|
489
|
+
function Te(r) {
|
|
451
490
|
return (e) => {
|
|
452
491
|
if (e.isOk()) {
|
|
453
|
-
const
|
|
454
|
-
|
|
492
|
+
const t = e.value;
|
|
493
|
+
v(t), r({ data: t, errors: void 0 });
|
|
455
494
|
} else {
|
|
456
|
-
const
|
|
457
|
-
|
|
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
|
|
462
|
-
let e,
|
|
500
|
+
async function Re(r) {
|
|
501
|
+
let e, t, n;
|
|
463
502
|
try {
|
|
464
|
-
const s = await
|
|
465
|
-
s.isOk() ? (e = s.value.data,
|
|
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
|
-
|
|
506
|
+
t = d(s);
|
|
468
507
|
}
|
|
469
508
|
return {
|
|
470
509
|
data: e,
|
|
471
|
-
errors:
|
|
510
|
+
errors: t,
|
|
472
511
|
subscribe(s) {
|
|
473
|
-
return n ? n(
|
|
512
|
+
return n ? n(Te(s)) : S;
|
|
474
513
|
},
|
|
475
514
|
async refresh() {
|
|
476
|
-
await
|
|
515
|
+
await r.refresh();
|
|
477
516
|
}
|
|
478
517
|
};
|
|
479
518
|
}
|
|
480
|
-
function g(
|
|
519
|
+
function g(r) {
|
|
481
520
|
return {
|
|
482
521
|
data: void 0,
|
|
483
|
-
errors:
|
|
484
|
-
subscribe: () =>
|
|
485
|
-
refresh:
|
|
522
|
+
errors: r,
|
|
523
|
+
subscribe: () => S,
|
|
524
|
+
refresh: D
|
|
486
525
|
};
|
|
487
526
|
}
|
|
488
|
-
function
|
|
489
|
-
bundle:
|
|
527
|
+
function Me({
|
|
528
|
+
bundle: r,
|
|
490
529
|
url: e,
|
|
491
|
-
executeRaw:
|
|
530
|
+
executeRaw: t
|
|
492
531
|
}) {
|
|
493
|
-
const { services: n } =
|
|
532
|
+
const { services: n } = r;
|
|
494
533
|
async function s({
|
|
495
534
|
query: a,
|
|
496
|
-
variables:
|
|
497
|
-
operationName:
|
|
498
|
-
cacheControl:
|
|
535
|
+
variables: i,
|
|
536
|
+
operationName: o,
|
|
537
|
+
cacheControl: c,
|
|
538
|
+
headers: f
|
|
499
539
|
}) {
|
|
500
|
-
const
|
|
501
|
-
if (
|
|
502
|
-
const p =
|
|
503
|
-
if (
|
|
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 ${
|
|
546
|
+
message: `DataSDK.graphql.query() requires a GraphQL query, received ${m}.`
|
|
507
547
|
}
|
|
508
548
|
]);
|
|
509
|
-
let
|
|
549
|
+
let l;
|
|
510
550
|
try {
|
|
511
|
-
|
|
551
|
+
l = new Ne(
|
|
512
552
|
{
|
|
513
|
-
query:
|
|
514
|
-
variables:
|
|
515
|
-
operationName:
|
|
516
|
-
cacheControl:
|
|
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 (
|
|
522
|
-
return g(
|
|
562
|
+
} catch (w) {
|
|
563
|
+
return g(d(w));
|
|
523
564
|
}
|
|
524
|
-
return
|
|
565
|
+
return Re(l);
|
|
525
566
|
}
|
|
526
567
|
return {
|
|
527
568
|
query: s,
|
|
528
|
-
mutate: (a) =>
|
|
569
|
+
mutate: (a) => L(t, a)
|
|
529
570
|
};
|
|
530
571
|
}
|
|
531
|
-
const
|
|
532
|
-
class
|
|
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
|
|
539
|
-
this.baseUrl =
|
|
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}${
|
|
542
|
-
cacheName:
|
|
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,
|
|
548
|
-
this.graphql =
|
|
588
|
+
const n = (a, i) => this.fetch(a, i), s = Oe(this.baseUrl, n);
|
|
589
|
+
this.graphql = Me({
|
|
549
590
|
bundle: s,
|
|
550
|
-
url:
|
|
591
|
+
url: T,
|
|
551
592
|
executeRaw: this.executeRawGraphQL.bind(this)
|
|
552
593
|
});
|
|
553
594
|
}
|
|
554
|
-
async fetch(e,
|
|
555
|
-
const n = this.applySalesforceBase(e), s = await this.clientFetch(n,
|
|
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:
|
|
567
|
-
operationName: n
|
|
607
|
+
variables: t,
|
|
608
|
+
operationName: n,
|
|
609
|
+
headers: s
|
|
568
610
|
}) {
|
|
569
|
-
return (await this.fetch(
|
|
611
|
+
return (await this.fetch(T, {
|
|
570
612
|
method: "POST",
|
|
571
|
-
body: JSON.stringify({ query: e, variables:
|
|
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
|
|
584
|
-
return `${this.baseUrl}${
|
|
625
|
+
const t = e.startsWith("/") ? e : `/${e}`;
|
|
626
|
+
return `${this.baseUrl}${t}`;
|
|
585
627
|
}
|
|
586
628
|
return e;
|
|
587
629
|
}
|
|
588
630
|
}
|
|
589
|
-
function
|
|
631
|
+
function Fe() {
|
|
590
632
|
return {
|
|
591
633
|
apiPath: globalThis.SFDC_ENV?.apiPath
|
|
592
634
|
};
|
|
593
635
|
}
|
|
594
|
-
function
|
|
595
|
-
if (!
|
|
596
|
-
let e =
|
|
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
|
|
600
|
-
let
|
|
641
|
+
function Ye(r, ...e) {
|
|
642
|
+
let t = r[0] ?? "";
|
|
601
643
|
for (let n = 0; n < e.length; n += 1)
|
|
602
|
-
|
|
603
|
-
return
|
|
644
|
+
t += String(e[n]) + (r[n + 1] ?? "");
|
|
645
|
+
return t;
|
|
604
646
|
}
|
|
605
|
-
function
|
|
606
|
-
return
|
|
647
|
+
function Ze(r) {
|
|
648
|
+
return K(
|
|
607
649
|
(async () => {
|
|
608
650
|
try {
|
|
609
|
-
switch (await
|
|
610
|
-
case
|
|
611
|
-
return new
|
|
612
|
-
case
|
|
613
|
-
case
|
|
614
|
-
return new
|
|
615
|
-
case
|
|
616
|
-
return new
|
|
617
|
-
case
|
|
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
|
-
|
|
631
|
-
|
|
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;
|
|
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;;
|
|
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;
|
|
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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AelB;;;;;;;;;;;;OAYG;IACH,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAStE,YAAY,CACX,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,GAClD,WAAW,CAAC,IAAI,CAAC;IAqBpB,SAAS,KAAK,0BAA0B,IAAI,0BAA0B,CAarE;IAED,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,eAAe,CAAC,KAAK,CAAC;cAIrC,uBAAuB,CACzC,IAAI,EAAE,eAAe,CAAC,KAAK,CAAC,GAC1B,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;CAMxC"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,MA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,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,OAAO,EAAE,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
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* a
|
|
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
|
|
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;
|
|
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,
|
|
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;
|
|
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.
|
|
3
|
+
"version": "11.10.0",
|
|
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.
|
|
118
|
+
"@salesforce/jsonrpc": "^11.10.0",
|
|
119
119
|
"@salesforce/sf-embedding-bridge": "2.2.4-rc.1"
|
|
120
120
|
},
|
|
121
121
|
"peerDependencies": {
|