@salesforce/platform-sdk 11.1.3 → 11.3.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/analytics/index.js +1 -1
- package/dist/{analytics-ygoSv0Cj.js → analytics-CY_NdbkB.js} +1 -1
- package/dist/{capabilities-CBmOyHnc.js → capabilities-5BWkCbcP.js} +1 -1
- package/dist/chat/index.js +1 -1
- package/dist/core/index.js +2 -2
- package/dist/core/view.d.ts +9 -3
- package/dist/core/view.d.ts.map +1 -1
- package/dist/data/index.js +2 -2
- package/dist/index.js +3 -3
- package/dist/lightning/index.js +1 -1
- package/dist/sf-embedding/index.d.ts +1 -1
- package/dist/sf-embedding/index.d.ts.map +1 -1
- package/dist/sf-embedding/index.js +2 -2
- package/dist/{surface-CEErnCgI.js → surface-Dd2tqrPi.js} +1 -1
- package/dist/view/embedding.d.ts +8 -0
- package/dist/view/embedding.d.ts.map +1 -1
- package/dist/view/index.js +81 -57
- package/package.json +3 -3
package/dist/analytics/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { registerInstrumentedApp as P } from "o11y/client";
|
|
2
|
-
import { g as h, S as T } from "./surface-
|
|
2
|
+
import { g as h, S as T } from "./surface-Dd2tqrPi.js";
|
|
3
3
|
import { w as x } from "./sdk-promise-D0sy7OW1.js";
|
|
4
4
|
import { getChatSDK as v } from "./chat/index.js";
|
|
5
5
|
import { r as _ } from "./TelemetryUploader-DKkdppe9.js";
|
package/dist/chat/index.js
CHANGED
package/dist/core/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as r, a as s, S as i, g as p, i as f, b as o, r as t } from "../surface-
|
|
2
|
-
import { g as c } from "../capabilities-
|
|
1
|
+
import { M as r, a as s, S as i, g as p, i as f, b as o, r as t } from "../surface-Dd2tqrPi.js";
|
|
2
|
+
import { g as c } from "../capabilities-5BWkCbcP.js";
|
|
3
3
|
import { w as g } from "../sdk-promise-D0sy7OW1.js";
|
|
4
4
|
export {
|
|
5
5
|
r as McpAppsNotAvailableError,
|
package/dist/core/view.d.ts
CHANGED
|
@@ -190,23 +190,28 @@ export interface ViewSDK {
|
|
|
190
190
|
* display a visual indicator (e.g., asterisk in title) and prompt the user before
|
|
191
191
|
* navigating away or closing the application.
|
|
192
192
|
*
|
|
193
|
+
* @param label - Optional dirty-source id; lets hosts disambiguate multiple concurrent dirty regions.
|
|
193
194
|
* @returns Promise that resolves when the dirty state is marked
|
|
194
195
|
*
|
|
195
196
|
* @example
|
|
196
197
|
* ```typescript
|
|
197
198
|
* // User made changes to a form
|
|
198
|
-
* formInput.addEventListener('
|
|
199
|
+
* formInput.addEventListener('input1', async () => {
|
|
199
200
|
* await viewSDK.markDirtyState?.();
|
|
200
201
|
* });
|
|
202
|
+
* formInput.addEventListener('input2', async () => {
|
|
203
|
+
* await viewSDK.markDirtyState?.('PrimaryForm');
|
|
204
|
+
* });
|
|
201
205
|
* ```
|
|
202
206
|
*/
|
|
203
|
-
markDirtyState?(): Promise<void>;
|
|
207
|
+
markDirtyState?(label?: string): Promise<void>;
|
|
204
208
|
/**
|
|
205
209
|
* Clear the application's "dirty" state (no unsaved changes)
|
|
206
210
|
*
|
|
207
211
|
* This notifies the host that all changes have been saved. Should be called
|
|
208
212
|
* after successfully persisting data to remove unsaved change indicators.
|
|
209
213
|
*
|
|
214
|
+
* @param label - Optional identifier matching the prior `markDirtyState`.
|
|
210
215
|
* @returns Promise that resolves when the dirty state is cleared
|
|
211
216
|
*
|
|
212
217
|
* @example
|
|
@@ -215,10 +220,11 @@ export interface ViewSDK {
|
|
|
215
220
|
* async function saveForm(data) {
|
|
216
221
|
* await api.save(data);
|
|
217
222
|
* await viewSDK.clearDirtyState?.();
|
|
223
|
+
* await viewSDK.clearDirtyState?.('PrimaryForm');
|
|
218
224
|
* }
|
|
219
225
|
* ```
|
|
220
226
|
*/
|
|
221
|
-
clearDirtyState?(): Promise<void>;
|
|
227
|
+
clearDirtyState?(label?: string): Promise<void>;
|
|
222
228
|
/**
|
|
223
229
|
* Dispatch a custom event to the host environment
|
|
224
230
|
*
|
package/dist/core/view.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/core/view.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,KAAK;IACrB,IAAI,EAAE,SAAS,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC5B;;;;;;;;OAQG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,OAAO;IACvB;;;;;;;;;;;;;;;;OAgBG;IACH,YAAY,CAAC,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD;;;;;;;;;;;;;;;;;OAiBG;IACH,YAAY,CAAC,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD;;;;;;;;;;;;;;;;;;;;OAoBG;IAC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import { g as L, S as m } from "../surface-Dd2tqrPi.js";
|
|
2
2
|
import { w as V } from "../sdk-promise-D0sy7OW1.js";
|
|
3
3
|
import { buildServiceDescriptor as _, setHeader as y } from "@conduit-client/service-fetch-network/v1";
|
|
4
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";
|
|
@@ -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.3.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";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as a, a as t, S as s, g as o, i, b as p, r as S } from "./surface-
|
|
2
|
-
import { g as c } from "./capabilities-
|
|
1
|
+
import { M as a, a as t, S as s, g as o, i, b as p, r as S } from "./surface-Dd2tqrPi.js";
|
|
2
|
+
import { g as c } from "./capabilities-5BWkCbcP.js";
|
|
3
3
|
import { w as D } from "./sdk-promise-D0sy7OW1.js";
|
|
4
4
|
import { MCPAppsChatSDK as g, createChatSDK as l, getChatSDK as A, getChatSDKSync as x, resetChatSDK as T } from "./chat/index.js";
|
|
5
5
|
import { MCPAppsViewSDK as C, createViewSDK as E, getViewSDK as d, getViewSDKSync as w, resetViewSDK as M } from "./view/index.js";
|
|
@@ -7,7 +7,7 @@ import { createDataSDK as _, gql as h } from "./data/index.js";
|
|
|
7
7
|
import { createLightningSDK as I } from "./lightning/index.js";
|
|
8
8
|
import { c as b } from "./transport-CdXFRgRc.js";
|
|
9
9
|
import { T as N, r as v } from "./TelemetryUploader-DKkdppe9.js";
|
|
10
|
-
import { A as F, I as U, P as Y, c as q, v as z } from "./analytics-
|
|
10
|
+
import { A as F, I as U, P as Y, c as q, v as z } from "./analytics-CY_NdbkB.js";
|
|
11
11
|
export {
|
|
12
12
|
F as AXL_PFT_ID,
|
|
13
13
|
U as INTERNAL_SESSION_META_KEY,
|
package/dist/lightning/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SessionHandle } from '@
|
|
1
|
+
import { SessionHandle } from '@salesforce/sf-embedding-bridge';
|
|
2
2
|
/** Thrown when a host-mediated SDK is requested but no session is available. */
|
|
3
3
|
export declare class SfEmbeddingNotAvailableError extends Error {
|
|
4
4
|
constructor(factoryName: string, cause?: Error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sf-embedding/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sf-embedding/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,iCAAiC,CAAC;AA+BvF,gFAAgF;AAChF,qBAAa,4BAA6B,SAAQ,KAAK;gBAC1C,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAc9C;AAED,iGAAiG;AACjG,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAoBhF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bootstrapSession as t } from "@
|
|
2
|
-
import { b as i } from "../surface-
|
|
1
|
+
import { bootstrapSession as t } from "@salesforce/sf-embedding-bridge";
|
|
2
|
+
import { b as i } from "../surface-Dd2tqrPi.js";
|
|
3
3
|
let r;
|
|
4
4
|
if (i()) {
|
|
5
5
|
const s = t();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readHostMetaData as p } from "@
|
|
1
|
+
import { readHostMetaData as p } from "@salesforce/sf-embedding-bridge";
|
|
2
2
|
import { JsonRpcClient as d, WindowPostMessageTransport as f } from "@salesforce/jsonrpc";
|
|
3
3
|
class h extends Error {
|
|
4
4
|
constructor() {
|
package/dist/view/embedding.d.ts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { ViewSDK } from '../core';
|
|
2
|
+
/** Pixel-only dimension string: bare number or `Npx`. The empty string is allowed so a caller can omit one axis. */
|
|
3
|
+
export type PixelSize = `${number}` | `${number}px` | "";
|
|
4
|
+
/** ViewSDK for the sf-embedding surface; wraps bridge wire-layer primitives. */
|
|
2
5
|
export declare class EmbeddingViewSDK implements ViewSDK {
|
|
3
6
|
private readonly session;
|
|
4
7
|
static create(): Promise<EmbeddingViewSDK>;
|
|
5
8
|
private constructor();
|
|
9
|
+
markDirtyState(label?: string): Promise<void>;
|
|
10
|
+
clearDirtyState(label?: string): Promise<void>;
|
|
11
|
+
/** Resize the embedded surface. Pass `""` for either axis to leave it unchanged; both empty is a no-op. */
|
|
12
|
+
resize(width: PixelSize, height: PixelSize): Promise<void>;
|
|
13
|
+
private setDirty;
|
|
6
14
|
}
|
|
7
15
|
//# sourceMappingURL=embedding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embedding.d.ts","sourceRoot":"","sources":["../../src/view/embedding.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAMvC,qBAAa,gBAAiB,YAAW,OAAO;
|
|
1
|
+
{"version":3,"file":"embedding.d.ts","sourceRoot":"","sources":["../../src/view/embedding.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAMvC,oHAAoH;AACpH,MAAM,MAAM,SAAS,GAAG,GAAG,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC;AAEzD,gFAAgF;AAChF,qBAAa,gBAAiB,YAAW,OAAO;IAM3B,OAAO,CAAC,QAAQ,CAAC,OAAO;WAL/B,MAAM,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAKhD,OAAO;IAED,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C,eAAe,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpD,2GAA2G;IACrG,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAYhE,OAAO,CAAC,QAAQ;CAOhB"}
|
package/dist/view/index.js
CHANGED
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
import { g as
|
|
2
|
-
import { w } from "../sdk-promise-D0sy7OW1.js";
|
|
1
|
+
import { g as w, S as a, a as h } from "../surface-Dd2tqrPi.js";
|
|
2
|
+
import { w as m } from "../sdk-promise-D0sy7OW1.js";
|
|
3
3
|
import { requireSharedSession as f } from "../sf-embedding/index.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
constructor(e) {
|
|
7
|
-
this.session = e;
|
|
8
|
-
}
|
|
9
|
-
static async create() {
|
|
10
|
-
const e = await f("EmbeddingViewSDK");
|
|
11
|
-
return new u(e);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
function h(t) {
|
|
15
|
-
switch (t) {
|
|
4
|
+
function p(n) {
|
|
5
|
+
switch (n) {
|
|
16
6
|
case "info":
|
|
17
7
|
return "ℹ️";
|
|
18
8
|
case "success":
|
|
@@ -25,26 +15,60 @@ function h(t) {
|
|
|
25
15
|
return "ℹ️";
|
|
26
16
|
}
|
|
27
17
|
}
|
|
28
|
-
function
|
|
29
|
-
return `${
|
|
18
|
+
function u(n, e) {
|
|
19
|
+
return `${p(e)} ${n}`;
|
|
30
20
|
}
|
|
31
|
-
function
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
21
|
+
function o(n, e) {
|
|
22
|
+
const t = n.trim();
|
|
23
|
+
if (t === "")
|
|
34
24
|
return { success: !0, value: void 0 };
|
|
35
|
-
const s =
|
|
25
|
+
const s = t.match(/^(\d+(?:\.\d+)?)(px)?$/);
|
|
36
26
|
if (!s || !s[1])
|
|
37
27
|
return {
|
|
38
28
|
success: !1,
|
|
39
|
-
error: `Invalid ${e}: "${
|
|
29
|
+
error: `Invalid ${e}: "${n}". Only pixel values are supported (e.g., "800px" or "800").`
|
|
40
30
|
};
|
|
41
|
-
const
|
|
42
|
-
return
|
|
31
|
+
const r = parseFloat(s[1]);
|
|
32
|
+
return r < 0 || !isFinite(r) ? {
|
|
43
33
|
success: !1,
|
|
44
|
-
error: `Invalid ${e}: "${
|
|
45
|
-
} : { success: !0, value:
|
|
34
|
+
error: `Invalid ${e}: "${n}". Value must be a positive number.`
|
|
35
|
+
} : { success: !0, value: r };
|
|
36
|
+
}
|
|
37
|
+
const g = "trackdirtystate";
|
|
38
|
+
class l {
|
|
39
|
+
constructor(e) {
|
|
40
|
+
this.session = e;
|
|
41
|
+
}
|
|
42
|
+
static async create() {
|
|
43
|
+
const e = await f("EmbeddingViewSDK");
|
|
44
|
+
return new l(e);
|
|
45
|
+
}
|
|
46
|
+
async markDirtyState(e) {
|
|
47
|
+
this.setDirty(!0, e);
|
|
48
|
+
}
|
|
49
|
+
async clearDirtyState(e) {
|
|
50
|
+
this.setDirty(!1, e);
|
|
51
|
+
}
|
|
52
|
+
/** Resize the embedded surface. Pass `""` for either axis to leave it unchanged; both empty is a no-op. */
|
|
53
|
+
async resize(e, t) {
|
|
54
|
+
const s = o(e, "width");
|
|
55
|
+
if (!s.success) throw new Error(s.error);
|
|
56
|
+
const r = o(t, "height");
|
|
57
|
+
if (!r.success) throw new Error(r.error);
|
|
58
|
+
s.value === void 0 && r.value === void 0 || this.session.bridge.sendResize({
|
|
59
|
+
...s.value !== void 0 ? { width: s.value } : {},
|
|
60
|
+
...r.value !== void 0 ? { height: r.value } : {}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
setDirty(e, t) {
|
|
64
|
+
this.session.bridge.sendEventDispatch(g, {
|
|
65
|
+
isDirty: e,
|
|
66
|
+
instanceId: this.session.hostMetaData.instanceId,
|
|
67
|
+
label: t ?? ""
|
|
68
|
+
});
|
|
69
|
+
}
|
|
46
70
|
}
|
|
47
|
-
class
|
|
71
|
+
class v {
|
|
48
72
|
constructor(e) {
|
|
49
73
|
this.session = e;
|
|
50
74
|
}
|
|
@@ -53,8 +77,8 @@ class g {
|
|
|
53
77
|
* @param message - The message text
|
|
54
78
|
* @param level - The message severity level (defaults to "info")
|
|
55
79
|
*/
|
|
56
|
-
async sendMessage(e,
|
|
57
|
-
const s =
|
|
80
|
+
async sendMessage(e, t = "info") {
|
|
81
|
+
const s = u(e, t);
|
|
58
82
|
await this.session.request("ui/message", {
|
|
59
83
|
role: "user",
|
|
60
84
|
content: [
|
|
@@ -78,24 +102,24 @@ class g {
|
|
|
78
102
|
const e = this.session.getHostContext().theme;
|
|
79
103
|
return e ? { mode: e } : null;
|
|
80
104
|
}
|
|
81
|
-
async resize(e,
|
|
82
|
-
const s =
|
|
105
|
+
async resize(e, t) {
|
|
106
|
+
const s = o(e, "width");
|
|
83
107
|
if (!s.success)
|
|
84
108
|
return Promise.reject(new Error(s.error));
|
|
85
|
-
const
|
|
86
|
-
if (!
|
|
87
|
-
return Promise.reject(new Error(
|
|
88
|
-
const
|
|
89
|
-
return s.value !== void 0 && (
|
|
109
|
+
const r = o(t, "height");
|
|
110
|
+
if (!r.success)
|
|
111
|
+
return Promise.reject(new Error(r.error));
|
|
112
|
+
const c = {};
|
|
113
|
+
return s.value !== void 0 && (c.width = s.value), r.value !== void 0 && (c.height = r.value), this.session.sendNotification("ui/notifications/size-changed", c), Promise.resolve();
|
|
90
114
|
}
|
|
91
115
|
}
|
|
92
|
-
class
|
|
116
|
+
class y {
|
|
93
117
|
async displayAlert(e) {
|
|
94
|
-
const
|
|
118
|
+
const t = e.level || "info", s = u(e.message, t);
|
|
95
119
|
await window.openai.sendFollowUpMessage({ prompt: s });
|
|
96
120
|
}
|
|
97
121
|
async displayToast(e) {
|
|
98
|
-
const
|
|
122
|
+
const t = e.level || "info", s = u(e.message, t);
|
|
99
123
|
await window.openai.sendFollowUpMessage({ prompt: s });
|
|
100
124
|
}
|
|
101
125
|
async displayModal(e) {
|
|
@@ -109,31 +133,31 @@ class v {
|
|
|
109
133
|
return e ? { mode: e } : null;
|
|
110
134
|
}
|
|
111
135
|
}
|
|
112
|
-
let i = null,
|
|
113
|
-
function
|
|
114
|
-
return i || (i =
|
|
136
|
+
let i = null, d = null;
|
|
137
|
+
function A(n) {
|
|
138
|
+
return i || (i = S(n).then((e) => (d = e, e))), i;
|
|
115
139
|
}
|
|
116
|
-
function
|
|
117
|
-
return
|
|
140
|
+
function E() {
|
|
141
|
+
return d;
|
|
118
142
|
}
|
|
119
|
-
function
|
|
120
|
-
i = null,
|
|
143
|
+
function I() {
|
|
144
|
+
i = null, d = null;
|
|
121
145
|
}
|
|
122
|
-
function
|
|
123
|
-
return
|
|
146
|
+
function S(n) {
|
|
147
|
+
return m(
|
|
124
148
|
(async () => {
|
|
125
149
|
try {
|
|
126
|
-
switch (await
|
|
150
|
+
switch (await w(n?.surface)) {
|
|
127
151
|
case a.OpenAI:
|
|
128
|
-
return new
|
|
152
|
+
return new y();
|
|
129
153
|
case a.WebApp:
|
|
130
154
|
case a.Mosaic:
|
|
131
155
|
return {};
|
|
132
156
|
case a.MicroFrontend:
|
|
133
|
-
return await
|
|
157
|
+
return await l.create();
|
|
134
158
|
case a.MCPApps: {
|
|
135
|
-
const
|
|
136
|
-
return new
|
|
159
|
+
const t = await h.getInstance();
|
|
160
|
+
return new v(t);
|
|
137
161
|
}
|
|
138
162
|
default:
|
|
139
163
|
return {};
|
|
@@ -146,9 +170,9 @@ function y(t) {
|
|
|
146
170
|
);
|
|
147
171
|
}
|
|
148
172
|
export {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
173
|
+
v as MCPAppsViewSDK,
|
|
174
|
+
S as createViewSDK,
|
|
175
|
+
A as getViewSDK,
|
|
176
|
+
E as getViewSDKSync,
|
|
177
|
+
I as resetViewSDK
|
|
154
178
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/platform-sdk",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.3.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -107,8 +107,8 @@
|
|
|
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.
|
|
111
|
-
"@
|
|
110
|
+
"@salesforce/jsonrpc": "^11.3.0",
|
|
111
|
+
"@salesforce/sf-embedding-bridge": "2.2.4-rc.1"
|
|
112
112
|
},
|
|
113
113
|
"peerDependencies": {
|
|
114
114
|
"o11y": ">=260.0.0",
|