@salesforce/platform-sdk 11.2.0 → 11.4.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/data/index.js +1 -1
- package/dist/i18n/index.d.ts +10 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/salesforce-backend.d.ts +17 -0
- package/dist/i18n/salesforce-backend.d.ts.map +1 -0
- package/dist/i18n/salesforce-detector.d.ts +22 -0
- package/dist/i18n/salesforce-detector.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +135 -39
- package/package.json +2 -2
package/dist/data/index.js
CHANGED
|
@@ -196,7 +196,7 @@ class ie {
|
|
|
196
196
|
})).structuredContent;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
const ce = "X-SFDC-Client-Name", ue = "X-SFDC-Client-Version", he = "@salesforce/platform-sdk", le = "11.
|
|
199
|
+
const ce = "X-SFDC-Client-Name", ue = "X-SFDC-Client-Version", he = "@salesforce/platform-sdk", le = "11.4.0", de = (t) => {
|
|
200
200
|
let e = y(ce, he, t);
|
|
201
201
|
return e = y(ue, le, e), u(e);
|
|
202
202
|
}, pe = "X-CSRF-Token";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
export { fetchI18nContext, createSalesforceDetector } from './salesforce-detector';
|
|
7
|
+
export type { I18nContext } from './salesforce-detector';
|
|
8
|
+
export { SalesforceBackend } from './salesforce-backend';
|
|
9
|
+
export type { SalesforceBackendOptions } from './salesforce-backend';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACnF,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,YAAY,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DataSDK } from '../core';
|
|
2
|
+
export interface SalesforceBackendOptions {
|
|
3
|
+
dataSDK: DataSDK;
|
|
4
|
+
labelManifest?: string[];
|
|
5
|
+
}
|
|
6
|
+
type ReadCallback = (err: unknown, data: Record<string, string> | false) => void;
|
|
7
|
+
export declare class SalesforceBackend {
|
|
8
|
+
type: "backend";
|
|
9
|
+
static type: "backend";
|
|
10
|
+
private options;
|
|
11
|
+
private grouped;
|
|
12
|
+
init(_services: unknown, options: SalesforceBackendOptions): void;
|
|
13
|
+
read(language: string, namespace: string, callback: ReadCallback): void;
|
|
14
|
+
private loadLabels;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=salesforce-backend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"salesforce-backend.d.ts","sourceRoot":"","sources":["../../src/i18n/salesforce-backend.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,WAAW,wBAAwB;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAeD,KAAK,YAAY,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,KAAK,KAAK,IAAI,CAAC;AA6BjF,qBAAa,iBAAiB;IAC7B,IAAI,EAAG,SAAS,CAAU;IAC1B,MAAM,CAAC,IAAI,EAAG,SAAS,CAAU;IAEjC,OAAO,CAAC,OAAO,CAA6C;IAC5D,OAAO,CAAC,OAAO,CAAgC;IAE/C,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,wBAAwB,GAAG,IAAI;IAKjE,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,GAAG,IAAI;YAMzD,UAAU;CA8BxB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DataSDK } from '../core';
|
|
2
|
+
/**
|
|
3
|
+
* The subset of i18next's native LanguageDetectorModule contract that this
|
|
4
|
+
* detector implements. Declared locally so platform-sdk does not take a
|
|
5
|
+
* dependency on i18next; the returned object is structurally compatible with
|
|
6
|
+
* i18next's `.use()` plugin slot.
|
|
7
|
+
*/
|
|
8
|
+
interface LanguageDetectorModule {
|
|
9
|
+
type: "languageDetector";
|
|
10
|
+
detect(): string | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface I18nContext {
|
|
13
|
+
lang: string;
|
|
14
|
+
locale: string;
|
|
15
|
+
dir: string;
|
|
16
|
+
currency: string;
|
|
17
|
+
timeZone: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function fetchI18nContext(dataSDK: DataSDK): Promise<I18nContext>;
|
|
20
|
+
export declare function createSalesforceDetector(_dataSDK: DataSDK): LanguageDetectorModule;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=salesforce-detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"salesforce-detector.d.ts","sourceRoot":"","sources":["../../src/i18n/salesforce-detector.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC;;;;;GAKG;AACH,UAAU,sBAAsB;IAC/B,IAAI,EAAE,kBAAkB,CAAC;IACzB,MAAM,IAAI,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CACjB;AAYD,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAkC7E;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,OAAO,GAAG,sBAAsB,CAQlF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,4 +10,5 @@ export { createDataSDK, type DataSDKOptions, type WebAppDataSDKOptions, type Mos
|
|
|
10
10
|
export { createLightningSDK, type LightningSDKOptions } from './lightning';
|
|
11
11
|
export { createTelemetryTransport, registerTelemetryUploader, TelemetryUploader, type TelemetryTransport, type TelemetryTransportOptions, type EnvelopeEntry, type EnvelopeMetadata, type TelemetryUploaderOptions, type OnEnvelopeCallback, type FlushReason, type TelemetryUploadContext, type TelemetryUploaderErrorContext, type InstrumentedAppLike, type DisposeOptions, } from './telemetry';
|
|
12
12
|
export { AXL_PFT_ID, createAnalytics, INTERNAL_SESSION_META_KEY, PFT_META_KEY, validatePftId, type Analytics, type AnalyticsOptions, } from './analytics';
|
|
13
|
+
export { fetchI18nContext, createSalesforceDetector, SalesforceBackend, type I18nContext, type SalesforceBackendOptions, } from './i18n';
|
|
13
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,QAAQ,CAAC;AAGvB,OAAO,EACN,aAAa,EACb,KAAK,cAAc,EACnB,cAAc,EACd,UAAU,EACV,cAAc,EACd,YAAY,GACZ,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACN,aAAa,EACb,K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AC;AAGhB,OAAO,EAAE,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAG3E,OAAO,EACN,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACnB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACN,UAAU,EACV,eAAe,EACf,yBAAyB,EACzB,YAAY,EACZ,aAAa,EACb,KAAK,SAAS,EACd,KAAK,gBAAgB,GACrB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACN,gBAAgB,EAChB,wBAAwB,EACxB,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,wBAAwB,GAC7B,MAAM,QAAQ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,42 +1,138 @@
|
|
|
1
|
-
import { M as
|
|
2
|
-
import { g as
|
|
3
|
-
import { w as
|
|
4
|
-
import { MCPAppsChatSDK as
|
|
5
|
-
import { MCPAppsViewSDK as
|
|
6
|
-
import { createDataSDK as
|
|
7
|
-
import { createLightningSDK as
|
|
8
|
-
import { c as
|
|
9
|
-
import { T as
|
|
10
|
-
import { A as
|
|
1
|
+
import { M as g, a as m, S as h, g as D, i as y, b as K, r as b } from "./surface-Dd2tqrPi.js";
|
|
2
|
+
import { g as x } from "./capabilities-5BWkCbcP.js";
|
|
3
|
+
import { w as q } from "./sdk-promise-D0sy7OW1.js";
|
|
4
|
+
import { MCPAppsChatSDK as A, createChatSDK as I, getChatSDK as v, getChatSDKSync as C, resetChatSDK as T } from "./chat/index.js";
|
|
5
|
+
import { MCPAppsViewSDK as N, createViewSDK as M, getViewSDK as $, getViewSDKSync as P, resetViewSDK as V } from "./view/index.js";
|
|
6
|
+
import { createDataSDK as O, gql as B } from "./data/index.js";
|
|
7
|
+
import { createLightningSDK as Q } from "./lightning/index.js";
|
|
8
|
+
import { c as Y } from "./transport-CdXFRgRc.js";
|
|
9
|
+
import { T as J, r as R } from "./TelemetryUploader-DKkdppe9.js";
|
|
10
|
+
import { A as X, I as Z, P as j, c as H, v as W } from "./analytics-CY_NdbkB.js";
|
|
11
|
+
let s = null;
|
|
12
|
+
async function p(o) {
|
|
13
|
+
if (s) return s;
|
|
14
|
+
if (!o.graphql)
|
|
15
|
+
throw new Error("Data SDK GraphQL surface unavailable");
|
|
16
|
+
const a = await o.graphql.query({
|
|
17
|
+
operationName: "I18nDetect",
|
|
18
|
+
query: `
|
|
19
|
+
query I18nDetect {
|
|
20
|
+
uiapi {
|
|
21
|
+
platform {
|
|
22
|
+
i18n {
|
|
23
|
+
lang
|
|
24
|
+
locale
|
|
25
|
+
dir
|
|
26
|
+
currency
|
|
27
|
+
timeZone
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
`
|
|
33
|
+
});
|
|
34
|
+
if (!a.data)
|
|
35
|
+
throw new Error(
|
|
36
|
+
`I18nDetect query failed: ${JSON.stringify(a.errors ?? "no data, no errors")}`
|
|
37
|
+
);
|
|
38
|
+
const e = a.data.uiapi.platform.i18n;
|
|
39
|
+
return s = e, e;
|
|
40
|
+
}
|
|
41
|
+
function f(o) {
|
|
42
|
+
return {
|
|
43
|
+
type: "languageDetector",
|
|
44
|
+
detect() {
|
|
45
|
+
return s?.lang;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const l = `
|
|
50
|
+
query Labels($ns: String!, $names: [String!]!, $locale: String) {
|
|
51
|
+
uiapi {
|
|
52
|
+
platform {
|
|
53
|
+
labels(namespace: $ns, names: $names, locale: $locale) {
|
|
54
|
+
name
|
|
55
|
+
value
|
|
56
|
+
resolvedLocale
|
|
57
|
+
wasFallback
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
function c(o) {
|
|
64
|
+
const a = {};
|
|
65
|
+
for (const e of o) {
|
|
66
|
+
const r = e.indexOf(":");
|
|
67
|
+
if (r === -1) continue;
|
|
68
|
+
const t = e.slice(0, r), n = e.slice(r + 1);
|
|
69
|
+
(a[t] ??= []).push(n);
|
|
70
|
+
}
|
|
71
|
+
return a;
|
|
72
|
+
}
|
|
73
|
+
class u {
|
|
74
|
+
type = "backend";
|
|
75
|
+
static type = "backend";
|
|
76
|
+
options = { dataSDK: {} };
|
|
77
|
+
grouped = {};
|
|
78
|
+
init(a, e) {
|
|
79
|
+
this.options = e, this.grouped = c(e.labelManifest ?? []);
|
|
80
|
+
}
|
|
81
|
+
read(a, e, r) {
|
|
82
|
+
this.loadLabels(a, e).then((t) => r(null, t)).catch((t) => r(t, !1));
|
|
83
|
+
}
|
|
84
|
+
async loadLabels(a, e) {
|
|
85
|
+
const r = this.grouped[e];
|
|
86
|
+
if (!r?.length) return {};
|
|
87
|
+
if (!this.options.dataSDK.graphql)
|
|
88
|
+
throw new Error("Data SDK GraphQL surface unavailable");
|
|
89
|
+
const t = await this.options.dataSDK.graphql.query({
|
|
90
|
+
operationName: "Labels",
|
|
91
|
+
query: l,
|
|
92
|
+
variables: { ns: e, names: r, locale: a }
|
|
93
|
+
});
|
|
94
|
+
if (!t.data)
|
|
95
|
+
throw new Error(
|
|
96
|
+
`Labels query failed: ${JSON.stringify(t.errors ?? "no data, no errors")}`
|
|
97
|
+
);
|
|
98
|
+
const n = {};
|
|
99
|
+
for (const i of t.data.uiapi.platform.labels)
|
|
100
|
+
i.value != null && (n[i.name] = i.value);
|
|
101
|
+
return n;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
11
104
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
105
|
+
X as AXL_PFT_ID,
|
|
106
|
+
Z as INTERNAL_SESSION_META_KEY,
|
|
107
|
+
A as MCPAppsChatSDK,
|
|
108
|
+
N as MCPAppsViewSDK,
|
|
109
|
+
g as McpAppsNotAvailableError,
|
|
110
|
+
m as McpAppsSession,
|
|
111
|
+
j as PFT_META_KEY,
|
|
112
|
+
u as SalesforceBackend,
|
|
113
|
+
h as Surface,
|
|
114
|
+
J as TelemetryUploader,
|
|
115
|
+
H as createAnalytics,
|
|
116
|
+
I as createChatSDK,
|
|
117
|
+
O as createDataSDK,
|
|
118
|
+
Q as createLightningSDK,
|
|
119
|
+
f as createSalesforceDetector,
|
|
120
|
+
Y as createTelemetryTransport,
|
|
121
|
+
M as createViewSDK,
|
|
122
|
+
p as fetchI18nContext,
|
|
123
|
+
v as getChatSDK,
|
|
124
|
+
C as getChatSDKSync,
|
|
125
|
+
x as getSurfaceCapabilities,
|
|
126
|
+
D as getVerifiedSurface,
|
|
127
|
+
$ as getViewSDK,
|
|
128
|
+
P as getViewSDKSync,
|
|
129
|
+
B as gql,
|
|
130
|
+
y as initialize,
|
|
131
|
+
K as isSfEmbeddingIframe,
|
|
132
|
+
R as registerTelemetryUploader,
|
|
37
133
|
T as resetChatSDK,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
134
|
+
b as resetSurface,
|
|
135
|
+
V as resetViewSDK,
|
|
136
|
+
W as validatePftId,
|
|
137
|
+
q as wrapSDKPromise
|
|
42
138
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/platform-sdk",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.4.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"@conduit-client/service-pubsub": "3.19.6",
|
|
108
108
|
"@conduit-client/service-retry": "3.19.6",
|
|
109
109
|
"@conduit-client/utils": "3.19.6",
|
|
110
|
-
"@salesforce/jsonrpc": "^11.
|
|
110
|
+
"@salesforce/jsonrpc": "^11.4.0",
|
|
111
111
|
"@salesforce/sf-embedding-bridge": "2.2.4-rc.1"
|
|
112
112
|
},
|
|
113
113
|
"peerDependencies": {
|