@salesforce/platform-sdk 8.0.0 → 9.0.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/analytics.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +231 -249
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.d.ts.map +1 -1
- package/dist/telemetry/tool-adapter.d.ts +24 -0
- package/dist/telemetry/tool-adapter.d.ts.map +1 -0
- package/dist/telemetry/transport.d.ts.map +1 -1
- package/dist/telemetry/types.d.ts +1 -5
- package/dist/telemetry/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/telemetry/action-piggyback.d.ts +0 -7
- package/dist/telemetry/action-piggyback.d.ts.map +0 -1
- package/dist/telemetry/widget-state-flush.d.ts +0 -14
- package/dist/telemetry/widget-state-flush.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/analytics/analytics.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAmB,MAAM,SAAS,CAAC;AAE5E;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/analytics/analytics.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAmB,MAAM,SAAS,CAAC;AAE5E;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC,CAmFnF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,6 @@ export { createChatSDK, type ChatSDKOptions, MCPAppsChatSDK, getChatSDK, getChat
|
|
|
8
8
|
export { createViewSDK, type ViewSDKOptions, MCPAppsViewSDK, getViewSDK, getViewSDKSync, resetViewSDK, } from './view';
|
|
9
9
|
export { createDataSDK, type DataSDKOptions, type WebAppDataSDKOptions, type MosaicDataSDKOptions, type StatusCallback, type NodeOfConnection, gql, } from './data';
|
|
10
10
|
export { createLightningSDK, type LightningSDKOptions } from './lightning';
|
|
11
|
-
export { createTelemetryTransport, registerTelemetryUploader, TelemetryUploader, type TelemetryTransport, type TelemetryTransportOptions, type
|
|
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 { createAnalytics, type Analytics, type AnalyticsOptions } from './analytics';
|
|
13
13
|
//# 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,KAAK,cAAc,EACnB,cAAc,EACd,UAAU,EACV,cAAc,EACd,YAAY,GACZ,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACN,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,GAAG,GACH,MAAM,QAAQ,CAAC;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,
|
|
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,KAAK,cAAc,EACnB,cAAc,EACd,UAAU,EACV,cAAc,EACd,YAAY,GACZ,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACN,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,GAAG,GACH,MAAM,QAAQ,CAAC;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,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { buildServiceDescriptor as K, setHeader as _ } from "@conduit-client/service-fetch-network/v1";
|
|
2
|
-
import { resolvedPromiseLike as w, ok as
|
|
3
|
-
import { print as R, parse as
|
|
4
|
-
import { RetryPolicy as
|
|
5
|
-
import { buildServiceDescriptor as
|
|
6
|
-
import { buildServiceDescriptor as
|
|
7
|
-
import { buildInMemoryCacheInclusionPolicyService as
|
|
8
|
-
import { buildServiceDescriptor as
|
|
9
|
-
import { HttpCacheControlCommand as
|
|
10
|
-
import { encodeCoreEnvelopeContentsRaw as
|
|
11
|
-
import { SimpleCollector as
|
|
12
|
-
import { registerInstrumentedApp as
|
|
13
|
-
import { analyticsContextSchema as
|
|
2
|
+
import { resolvedPromiseLike as w, ok as k, err as D, stableJSONStringify as Y, DataNotFoundError as Z, UserVisibleError as ee, deepFreeze as z } from "@conduit-client/utils";
|
|
3
|
+
import { print as R, parse as te } from "@conduit-client/onestore-graphql-parser/v1";
|
|
4
|
+
import { RetryPolicy as se, buildServiceDescriptor as re } from "@conduit-client/service-retry/v1";
|
|
5
|
+
import { buildServiceDescriptor as ne } from "@conduit-client/service-cache/v1";
|
|
6
|
+
import { buildServiceDescriptor as ie } from "@conduit-client/service-cache-control/v1";
|
|
7
|
+
import { buildInMemoryCacheInclusionPolicyService as oe } from "@conduit-client/service-cache-inclusion-policy/v1";
|
|
8
|
+
import { buildServiceDescriptor as ae } from "@conduit-client/service-pubsub/v1";
|
|
9
|
+
import { HttpCacheControlCommand as ce } from "@conduit-client/command-http-cache-control/v1";
|
|
10
|
+
import { encodeCoreEnvelopeContentsRaw as le } from "o11y/collectors";
|
|
11
|
+
import { SimpleCollector as ue } from "o11y/simple_collector";
|
|
12
|
+
import { registerInstrumentedApp as de } from "o11y/client";
|
|
13
|
+
import { analyticsContextSchema as he, sessionSchema as fe, pageViewSchema as pe, errorContextSchema as me, interactionSchema as ge, customEventSchema as ye } from "o11y_schema/sf_mcpanalytics";
|
|
14
14
|
var c = /* @__PURE__ */ ((s) => (s.WebApp = "WebApp", s.MicroFrontend = "Micro-Frontend", s.OpenAI = "OpenAI", s.SalesforceACC = "Salesforce-ACC", s.MCPApps = "MCP-Apps", s.Mosaic = "Mosaic", s))(c || {});
|
|
15
|
-
const
|
|
16
|
-
function
|
|
15
|
+
const we = be();
|
|
16
|
+
function be() {
|
|
17
17
|
if (typeof window > "u")
|
|
18
18
|
return "Mosaic";
|
|
19
19
|
if (window.openai)
|
|
@@ -28,27 +28,27 @@ function ve() {
|
|
|
28
28
|
return s.$A || s.Aura ? "Salesforce-ACC" : "WebApp";
|
|
29
29
|
}
|
|
30
30
|
function C(s) {
|
|
31
|
-
return s ??
|
|
31
|
+
return s ?? we;
|
|
32
32
|
}
|
|
33
33
|
function A(s) {
|
|
34
34
|
return typeof s == "object" && s !== null && "jsonrpc" in s && s.jsonrpc === "2.0";
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function ve(s) {
|
|
37
37
|
return A(s) && "id" in s && typeof s.id == "number" && "result" in s;
|
|
38
38
|
}
|
|
39
39
|
function B(s) {
|
|
40
40
|
return A(s) && "id" in s && typeof s.id == "number" && "error" in s;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
return
|
|
42
|
+
function Ce(s) {
|
|
43
|
+
return ve(s) || B(s);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function Se(s) {
|
|
46
46
|
return A(s) && "method" in s && typeof s.method == "string" && !("id" in s);
|
|
47
47
|
}
|
|
48
48
|
function Zt(s) {
|
|
49
49
|
return A(s) && "id" in s && typeof s.id == "number" && "method" in s && typeof s.method == "string";
|
|
50
50
|
}
|
|
51
|
-
class
|
|
51
|
+
class Te {
|
|
52
52
|
targetOrigin;
|
|
53
53
|
/**
|
|
54
54
|
* @param targetOrigin - origin passed as the second argument to
|
|
@@ -69,7 +69,7 @@ class _e {
|
|
|
69
69
|
return window.addEventListener("message", t), () => window.removeEventListener("message", t);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
class
|
|
72
|
+
class _e {
|
|
73
73
|
nextRequestId = 1;
|
|
74
74
|
pending = /* @__PURE__ */ new Map();
|
|
75
75
|
notificationHandlers = /* @__PURE__ */ new Map();
|
|
@@ -81,7 +81,7 @@ class Ee {
|
|
|
81
81
|
* `WindowPostMessageTransport`, which preserves the original
|
|
82
82
|
* `window.parent.postMessage` behaviour.
|
|
83
83
|
*/
|
|
84
|
-
constructor(e = new
|
|
84
|
+
constructor(e = new Te()) {
|
|
85
85
|
this.transport = e, this.transport.onMessage(this.onMessage);
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
@@ -110,14 +110,14 @@ class Ee {
|
|
|
110
110
|
* multiple protocols without cross-talk.
|
|
111
111
|
*/
|
|
112
112
|
onMessage = (e) => {
|
|
113
|
-
if (
|
|
113
|
+
if (Ce(e)) {
|
|
114
114
|
const t = this.pending.get(e.id);
|
|
115
115
|
if (!t)
|
|
116
116
|
return;
|
|
117
117
|
this.pending.delete(e.id), B(e) ? t.reject(new Error(e.error.message || "Request failed")) : t.resolve(e.result);
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
|
-
if (
|
|
120
|
+
if (Se(e)) {
|
|
121
121
|
const t = this.notificationHandlers.get(e.method);
|
|
122
122
|
t && t.forEach((r) => r(e.params));
|
|
123
123
|
}
|
|
@@ -181,7 +181,7 @@ class Ee {
|
|
|
181
181
|
this.transport.post(r);
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function Ee() {
|
|
185
185
|
}
|
|
186
186
|
class es {
|
|
187
187
|
#e;
|
|
@@ -225,7 +225,7 @@ class es {
|
|
|
225
225
|
*/
|
|
226
226
|
onMessage(e) {
|
|
227
227
|
if (this.#r)
|
|
228
|
-
return
|
|
228
|
+
return Ee;
|
|
229
229
|
this.#s.add(e), this.#n || this.#o();
|
|
230
230
|
let t = !1;
|
|
231
231
|
return () => {
|
|
@@ -279,8 +279,8 @@ class es {
|
|
|
279
279
|
}
|
|
280
280
|
};
|
|
281
281
|
}
|
|
282
|
-
const
|
|
283
|
-
class y extends
|
|
282
|
+
const Ae = 500, Me = "2026-01-26";
|
|
283
|
+
class y extends _e {
|
|
284
284
|
static initPromise = null;
|
|
285
285
|
hostCtx = {};
|
|
286
286
|
_handshakeSucceeded = !1;
|
|
@@ -311,7 +311,7 @@ class y extends Ee {
|
|
|
311
311
|
* still render (graceful degradation for non-SEP-1865 hosts).
|
|
312
312
|
*/
|
|
313
313
|
async handshake(e) {
|
|
314
|
-
const t = e?.handshakeTimeoutMs ??
|
|
314
|
+
const t = e?.handshakeTimeoutMs ?? Ae, r = e?.appInfo ?? { name: "mcp-app", version: "1.0.0" };
|
|
315
315
|
try {
|
|
316
316
|
const n = /* @__PURE__ */ Symbol("timeout"), i = await Promise.race([
|
|
317
317
|
this.request("ui/initialize", {
|
|
@@ -371,7 +371,7 @@ const Ie = {
|
|
|
371
371
|
// TODO
|
|
372
372
|
getTheme: !0,
|
|
373
373
|
resize: !0
|
|
374
|
-
},
|
|
374
|
+
}, ke = {
|
|
375
375
|
callTool: !0,
|
|
376
376
|
sendMessageToHost: !0,
|
|
377
377
|
readResource: !1,
|
|
@@ -390,7 +390,7 @@ const Ie = {
|
|
|
390
390
|
displayModal: !0,
|
|
391
391
|
getTheme: !0,
|
|
392
392
|
resize: !1
|
|
393
|
-
},
|
|
393
|
+
}, De = {
|
|
394
394
|
callTool: !1,
|
|
395
395
|
sendMessageToHost: !0,
|
|
396
396
|
readResource: !1,
|
|
@@ -409,7 +409,7 @@ const Ie = {
|
|
|
409
409
|
displayModal: !1,
|
|
410
410
|
getTheme: !0,
|
|
411
411
|
resize: !1
|
|
412
|
-
},
|
|
412
|
+
}, Pe = {
|
|
413
413
|
callTool: !1,
|
|
414
414
|
sendMessageToHost: !1,
|
|
415
415
|
readResource: !1,
|
|
@@ -434,21 +434,21 @@ function ts(s) {
|
|
|
434
434
|
case c.MCPApps:
|
|
435
435
|
return { ...Ie };
|
|
436
436
|
case c.OpenAI:
|
|
437
|
-
return { ...
|
|
437
|
+
return { ...ke };
|
|
438
438
|
case c.SalesforceACC:
|
|
439
|
-
return { ...
|
|
439
|
+
return { ...De };
|
|
440
440
|
case c.Mosaic:
|
|
441
441
|
case c.WebApp:
|
|
442
442
|
case c.MicroFrontend:
|
|
443
443
|
default:
|
|
444
|
-
return { ...
|
|
444
|
+
return { ...Pe };
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
|
-
const
|
|
448
|
-
function
|
|
447
|
+
const Le = /* @__PURE__ */ new Set(["then", "catch", "finally"]);
|
|
448
|
+
function M(s, e) {
|
|
449
449
|
return new Proxy(s, {
|
|
450
450
|
get(t, r, n) {
|
|
451
|
-
if (typeof r == "symbol" ||
|
|
451
|
+
if (typeof r == "symbol" || Le.has(r)) {
|
|
452
452
|
const i = Reflect.get(t, r, n);
|
|
453
453
|
return typeof i == "function" ? i.bind(t) : i;
|
|
454
454
|
}
|
|
@@ -459,7 +459,7 @@ Use \`const sdk = await ${e}();\` before accessing SDK methods.`
|
|
|
459
459
|
}
|
|
460
460
|
});
|
|
461
461
|
}
|
|
462
|
-
class
|
|
462
|
+
class Re {
|
|
463
463
|
constructor(e) {
|
|
464
464
|
this.session = e;
|
|
465
465
|
const t = e.getHostContext();
|
|
@@ -634,7 +634,7 @@ class Oe {
|
|
|
634
634
|
};
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
|
-
class
|
|
637
|
+
class xe {
|
|
638
638
|
async sendMessageToHost(e) {
|
|
639
639
|
throw console.warn("SalesforceACCChatSDK.sendMessageToHost: stub implementation", e), new Error("SalesforceACCChatSDK.sendMessageToHost not yet implemented");
|
|
640
640
|
}
|
|
@@ -642,18 +642,18 @@ class He {
|
|
|
642
642
|
return console.warn("SalesforceACCChatSDK.followUpActions: stub implementation"), [];
|
|
643
643
|
}
|
|
644
644
|
}
|
|
645
|
-
let S = null,
|
|
646
|
-
function
|
|
647
|
-
return S || (S =
|
|
645
|
+
let S = null, O = null;
|
|
646
|
+
function He(s) {
|
|
647
|
+
return S || (S = qe(s).then((e) => (O = e, e))), S;
|
|
648
648
|
}
|
|
649
649
|
function ss() {
|
|
650
|
-
return
|
|
650
|
+
return O;
|
|
651
651
|
}
|
|
652
652
|
function rs() {
|
|
653
|
-
S = null,
|
|
653
|
+
S = null, O = null;
|
|
654
654
|
}
|
|
655
|
-
function
|
|
656
|
-
return
|
|
655
|
+
function qe(s) {
|
|
656
|
+
return M(
|
|
657
657
|
(async () => {
|
|
658
658
|
switch (C(s?.surface)) {
|
|
659
659
|
case c.OpenAI:
|
|
@@ -662,11 +662,11 @@ function Ne(s) {
|
|
|
662
662
|
case c.Mosaic:
|
|
663
663
|
return {};
|
|
664
664
|
case c.SalesforceACC:
|
|
665
|
-
return new
|
|
665
|
+
return new xe();
|
|
666
666
|
case c.MicroFrontend:
|
|
667
667
|
case c.MCPApps: {
|
|
668
668
|
const t = await y.getInstance(s?.mcpApps);
|
|
669
|
-
return t.handshakeSucceeded ? new
|
|
669
|
+
return t.handshakeSucceeded ? new Re(t) : {};
|
|
670
670
|
}
|
|
671
671
|
default:
|
|
672
672
|
return {};
|
|
@@ -675,7 +675,7 @@ function Ne(s) {
|
|
|
675
675
|
"createChatSDK"
|
|
676
676
|
);
|
|
677
677
|
}
|
|
678
|
-
function
|
|
678
|
+
function Ne(s) {
|
|
679
679
|
switch (s) {
|
|
680
680
|
case "info":
|
|
681
681
|
return "ℹ️";
|
|
@@ -690,7 +690,7 @@ function Fe(s) {
|
|
|
690
690
|
}
|
|
691
691
|
}
|
|
692
692
|
function P(s, e) {
|
|
693
|
-
return `${
|
|
693
|
+
return `${Ne(e)} ${s}`;
|
|
694
694
|
}
|
|
695
695
|
function F(s, e) {
|
|
696
696
|
const t = s.trim();
|
|
@@ -708,7 +708,7 @@ function F(s, e) {
|
|
|
708
708
|
error: `Invalid ${e}: "${s}". Value must be a positive number.`
|
|
709
709
|
} : { success: !0, value: n };
|
|
710
710
|
}
|
|
711
|
-
class
|
|
711
|
+
class Fe {
|
|
712
712
|
constructor(e) {
|
|
713
713
|
this.session = e;
|
|
714
714
|
}
|
|
@@ -753,7 +753,7 @@ class Ue {
|
|
|
753
753
|
return r.value !== void 0 && (i.width = r.value), n.value !== void 0 && (i.height = n.value), this.session.sendNotification("ui/notifications/size-changed", i), Promise.resolve();
|
|
754
754
|
}
|
|
755
755
|
}
|
|
756
|
-
class
|
|
756
|
+
class Ue {
|
|
757
757
|
async displayAlert(e) {
|
|
758
758
|
const t = e.level || "info", r = P(e.message, t);
|
|
759
759
|
await window.openai.sendFollowUpMessage({ prompt: r });
|
|
@@ -773,22 +773,22 @@ class Ve {
|
|
|
773
773
|
return e ? { mode: e } : null;
|
|
774
774
|
}
|
|
775
775
|
}
|
|
776
|
-
let T = null,
|
|
776
|
+
let T = null, x = null;
|
|
777
777
|
function ns(s) {
|
|
778
|
-
return T || (T =
|
|
778
|
+
return T || (T = Ve(s).then((e) => (x = e, e))), T;
|
|
779
779
|
}
|
|
780
780
|
function is() {
|
|
781
|
-
return
|
|
781
|
+
return x;
|
|
782
782
|
}
|
|
783
783
|
function os() {
|
|
784
|
-
T = null,
|
|
784
|
+
T = null, x = null;
|
|
785
785
|
}
|
|
786
|
-
function
|
|
787
|
-
return
|
|
786
|
+
function Ve(s) {
|
|
787
|
+
return M(
|
|
788
788
|
(async () => {
|
|
789
789
|
switch (C(s?.surface)) {
|
|
790
790
|
case c.OpenAI:
|
|
791
|
-
return new
|
|
791
|
+
return new Ue();
|
|
792
792
|
case c.WebApp:
|
|
793
793
|
case c.Mosaic:
|
|
794
794
|
return {};
|
|
@@ -797,7 +797,7 @@ function We(s) {
|
|
|
797
797
|
case c.MicroFrontend:
|
|
798
798
|
case c.MCPApps: {
|
|
799
799
|
const t = await y.getInstance(s?.mcpApps);
|
|
800
|
-
return t.handshakeSucceeded ? new
|
|
800
|
+
return t.handshakeSucceeded ? new Fe(t) : {};
|
|
801
801
|
}
|
|
802
802
|
default:
|
|
803
803
|
return {};
|
|
@@ -816,12 +816,12 @@ function $e(s) {
|
|
|
816
816
|
return w(e);
|
|
817
817
|
};
|
|
818
818
|
}
|
|
819
|
-
function
|
|
819
|
+
function We(s) {
|
|
820
820
|
return (e) => w(_("Authorization", `Bearer ${s}`, e));
|
|
821
821
|
}
|
|
822
|
-
function
|
|
822
|
+
function Ke(s, e) {
|
|
823
823
|
const t = [];
|
|
824
|
-
return s && t.push($e(s)), e && t.push(
|
|
824
|
+
return s && t.push($e(s)), e && t.push(We(e)), K({
|
|
825
825
|
request: t
|
|
826
826
|
}).service;
|
|
827
827
|
}
|
|
@@ -830,7 +830,7 @@ const E = () => {
|
|
|
830
830
|
};
|
|
831
831
|
function H(s) {
|
|
832
832
|
try {
|
|
833
|
-
return
|
|
833
|
+
return k(te(s));
|
|
834
834
|
} catch (e) {
|
|
835
835
|
return D(b(e));
|
|
836
836
|
}
|
|
@@ -915,18 +915,18 @@ function Q(s) {
|
|
|
915
915
|
subscribe: () => E,
|
|
916
916
|
refresh: L
|
|
917
917
|
};
|
|
918
|
-
const
|
|
918
|
+
const h = /* @__PURE__ */ new Set(), p = n, f = await e(a, p, i);
|
|
919
919
|
return {
|
|
920
|
-
data:
|
|
921
|
-
errors:
|
|
922
|
-
subscribe(
|
|
923
|
-
return
|
|
924
|
-
|
|
920
|
+
data: f.data,
|
|
921
|
+
errors: f.errors,
|
|
922
|
+
subscribe(l) {
|
|
923
|
+
return h.add(l), () => {
|
|
924
|
+
h.delete(l);
|
|
925
925
|
};
|
|
926
926
|
},
|
|
927
927
|
async refresh() {
|
|
928
|
-
const
|
|
929
|
-
for (const
|
|
928
|
+
const l = await e(a, p, i);
|
|
929
|
+
for (const d of h) d(l);
|
|
930
930
|
}
|
|
931
931
|
};
|
|
932
932
|
}
|
|
@@ -935,17 +935,17 @@ function Q(s) {
|
|
|
935
935
|
mutate: (r) => j(s, r)
|
|
936
936
|
};
|
|
937
937
|
}
|
|
938
|
-
const
|
|
939
|
-
function G(s =
|
|
938
|
+
const ze = typeof __SF_API_VERSION__ < "u" ? __SF_API_VERSION__ : "65.0";
|
|
939
|
+
function G(s = ze) {
|
|
940
940
|
return `/services/data/v${s}`;
|
|
941
941
|
}
|
|
942
|
-
class
|
|
942
|
+
class Be {
|
|
943
943
|
clientFetch;
|
|
944
944
|
pathData;
|
|
945
945
|
graphql;
|
|
946
946
|
constructor(e) {
|
|
947
|
-
const t =
|
|
948
|
-
this.pathData = G(e?.apiVersion ?? t.apiVersion), this.clientFetch =
|
|
947
|
+
const t = je(), r = Qe(e?.instanceUrl ?? t.instanceUrl), n = e?.accessToken ?? t.accessToken;
|
|
948
|
+
this.pathData = G(e?.apiVersion ?? t.apiVersion), this.clientFetch = Ke(r || void 0, n), this.graphql = Q(this.executeRawGraphQL.bind(this));
|
|
949
949
|
}
|
|
950
950
|
async executeRawGraphQL({
|
|
951
951
|
query: e,
|
|
@@ -962,7 +962,7 @@ class je {
|
|
|
962
962
|
})).json();
|
|
963
963
|
}
|
|
964
964
|
}
|
|
965
|
-
function
|
|
965
|
+
function je() {
|
|
966
966
|
const s = globalThis.MOSAIC_ENV;
|
|
967
967
|
return {
|
|
968
968
|
instanceUrl: s?.instanceUrl,
|
|
@@ -970,13 +970,13 @@ function Qe() {
|
|
|
970
970
|
apiVersion: s?.apiVersion
|
|
971
971
|
};
|
|
972
972
|
}
|
|
973
|
-
function
|
|
973
|
+
function Qe(s) {
|
|
974
974
|
if (!s || s === "/") return "";
|
|
975
975
|
let e = s;
|
|
976
976
|
return !e.startsWith("/") && !e.startsWith("http") && (e = `/${e}`), e.endsWith("/") && (e = e.slice(0, -1)), e;
|
|
977
977
|
}
|
|
978
|
-
const
|
|
979
|
-
class
|
|
978
|
+
const Ge = "graphqlQuery";
|
|
979
|
+
class Je {
|
|
980
980
|
graphql;
|
|
981
981
|
constructor() {
|
|
982
982
|
this.graphql = Q(this.executeRawGraphQL.bind(this));
|
|
@@ -986,29 +986,29 @@ class Xe {
|
|
|
986
986
|
variables: t,
|
|
987
987
|
operationName: r
|
|
988
988
|
}) {
|
|
989
|
-
return (await window.openai.callTool(
|
|
989
|
+
return (await window.openai.callTool(Ge, {
|
|
990
990
|
query: e,
|
|
991
991
|
...t != null ? { variables: t } : {},
|
|
992
992
|
...r != null ? { operationName: r } : {}
|
|
993
993
|
})).structuredContent;
|
|
994
994
|
}
|
|
995
995
|
}
|
|
996
|
-
const
|
|
997
|
-
let e = _(
|
|
998
|
-
return e = _(
|
|
999
|
-
},
|
|
1000
|
-
function
|
|
996
|
+
const Xe = "X-SFDC-Client-Name", Ye = "X-SFDC-Client-Version", Ze = "@salesforce/platform-sdk", et = "9.0.0", tt = (s) => {
|
|
997
|
+
let e = _(Xe, Ze, s);
|
|
998
|
+
return e = _(Ye, et, e), w(e);
|
|
999
|
+
}, st = "X-CSRF-Token";
|
|
1000
|
+
function rt(s, e = {}) {
|
|
1001
1001
|
const { protectedUrls: t = [], alwaysProtectedUrls: r = [] } = e;
|
|
1002
1002
|
return async (n) => {
|
|
1003
1003
|
const [i, o] = n, a = new Request(i, o);
|
|
1004
|
-
if (U(r, a.url) ||
|
|
1005
|
-
const
|
|
1006
|
-
n = _(
|
|
1004
|
+
if (U(r, a.url) || nt(a.method) && U(t, a.url)) {
|
|
1005
|
+
const h = await s.getToken();
|
|
1006
|
+
n = _(st, h, n);
|
|
1007
1007
|
}
|
|
1008
1008
|
return w(n);
|
|
1009
1009
|
};
|
|
1010
1010
|
}
|
|
1011
|
-
function
|
|
1011
|
+
function nt(s) {
|
|
1012
1012
|
const e = s.toLowerCase();
|
|
1013
1013
|
return e === "post" || e === "put" || e === "patch" || e === "delete";
|
|
1014
1014
|
}
|
|
@@ -1016,16 +1016,16 @@ function U(s, e) {
|
|
|
1016
1016
|
const t = new URL(e);
|
|
1017
1017
|
return s.some((r) => t.pathname.includes(r));
|
|
1018
1018
|
}
|
|
1019
|
-
function
|
|
1020
|
-
const t =
|
|
1019
|
+
function it(s, e = {}) {
|
|
1020
|
+
const t = rt(s, e);
|
|
1021
1021
|
async function r(n) {
|
|
1022
1022
|
const i = await t(n);
|
|
1023
1023
|
return fetch(i[0], i[1]);
|
|
1024
1024
|
}
|
|
1025
1025
|
return (n, i) => i ? i.applyRetry(async () => r(n)) : r(n);
|
|
1026
1026
|
}
|
|
1027
|
-
const
|
|
1028
|
-
class
|
|
1027
|
+
const ot = [400, 401, 403];
|
|
1028
|
+
class at extends se {
|
|
1029
1029
|
constructor(e) {
|
|
1030
1030
|
super(e), this.csrfTokenManager = e;
|
|
1031
1031
|
}
|
|
@@ -1033,7 +1033,7 @@ class ct extends re {
|
|
|
1033
1033
|
* Determines if a failed request should be retried due to CSRF token issues.
|
|
1034
1034
|
*/
|
|
1035
1035
|
async shouldRetry(e, t) {
|
|
1036
|
-
return t.attempt >= 1 ? !1 :
|
|
1036
|
+
return t.attempt >= 1 ? !1 : ot.includes(e.status);
|
|
1037
1037
|
}
|
|
1038
1038
|
/**
|
|
1039
1039
|
* CSRF token refresh should happen immediately with no delay.
|
|
@@ -1051,7 +1051,7 @@ class ct extends re {
|
|
|
1051
1051
|
await this.csrfTokenManager.refreshToken();
|
|
1052
1052
|
}
|
|
1053
1053
|
}
|
|
1054
|
-
class
|
|
1054
|
+
class ct {
|
|
1055
1055
|
constructor(e, t) {
|
|
1056
1056
|
this.endpoint = e, this.cacheName = t, this.tokenPromise = this.obtainToken();
|
|
1057
1057
|
}
|
|
@@ -1100,19 +1100,19 @@ class lt {
|
|
|
1100
1100
|
}
|
|
1101
1101
|
}
|
|
1102
1102
|
const V = /* @__PURE__ */ new Map();
|
|
1103
|
-
function
|
|
1103
|
+
function lt(s) {
|
|
1104
1104
|
const { endpoint: e, cacheName: t, ...r } = s.csrf;
|
|
1105
1105
|
let n = V.get(e);
|
|
1106
|
-
return n || (n = new
|
|
1106
|
+
return n || (n = new ct(e, t), V.set(e, n)), K(
|
|
1107
1107
|
{
|
|
1108
|
-
retry:
|
|
1109
|
-
request: [
|
|
1108
|
+
retry: it(n, r),
|
|
1109
|
+
request: [tt]
|
|
1110
1110
|
},
|
|
1111
|
-
|
|
1111
|
+
re(new at(n)).service
|
|
1112
1112
|
).service;
|
|
1113
1113
|
}
|
|
1114
|
-
function
|
|
1115
|
-
const e =
|
|
1114
|
+
function ut(s) {
|
|
1115
|
+
const e = ne().service, t = oe(e).service, r = ie(e, t).service, n = ae().service;
|
|
1116
1116
|
return {
|
|
1117
1117
|
cache: e,
|
|
1118
1118
|
services: { cacheController: r, pubSub: n, fetch: s }
|
|
@@ -1125,8 +1125,8 @@ function J() {
|
|
|
1125
1125
|
"X-Chatter-Entity-Encoding": "false"
|
|
1126
1126
|
};
|
|
1127
1127
|
}
|
|
1128
|
-
const
|
|
1129
|
-
function
|
|
1128
|
+
const $ = 300;
|
|
1129
|
+
function dt(s, e) {
|
|
1130
1130
|
try {
|
|
1131
1131
|
return JSON.parse(JSON.stringify(s));
|
|
1132
1132
|
} catch (t) {
|
|
@@ -1136,9 +1136,9 @@ function ht(s, e) {
|
|
|
1136
1136
|
throw n.cause = t, n;
|
|
1137
1137
|
}
|
|
1138
1138
|
}
|
|
1139
|
-
class
|
|
1139
|
+
class ht extends ce {
|
|
1140
1140
|
constructor(e, t, r) {
|
|
1141
|
-
super(t), this.url = r, this.query = e.query, this.normalizedOperationName = e.operationName ?? "", this.normalizedVariables =
|
|
1141
|
+
super(t), this.url = r, this.query = e.query, this.normalizedOperationName = e.operationName ?? "", this.normalizedVariables = dt(
|
|
1142
1142
|
e.variables ?? {},
|
|
1143
1143
|
this.normalizedOperationName
|
|
1144
1144
|
);
|
|
@@ -1161,7 +1161,7 @@ class ft extends le {
|
|
|
1161
1161
|
];
|
|
1162
1162
|
}
|
|
1163
1163
|
buildKey() {
|
|
1164
|
-
return
|
|
1164
|
+
return Y({
|
|
1165
1165
|
query: this.query,
|
|
1166
1166
|
variables: this.normalizedVariables,
|
|
1167
1167
|
operationName: this.normalizedOperationName
|
|
@@ -1182,7 +1182,7 @@ class ft extends le {
|
|
|
1182
1182
|
*/
|
|
1183
1183
|
readFromCache(e) {
|
|
1184
1184
|
const t = this.buildKey(), r = e.get(t)?.value;
|
|
1185
|
-
return r === void 0 ? w(D(new
|
|
1185
|
+
return r === void 0 ? w(D(new Z())) : w(k(r));
|
|
1186
1186
|
}
|
|
1187
1187
|
writeToCache(e, t) {
|
|
1188
1188
|
if (t.isOk() && t.value.data != null && Object.keys(t.value.data).length > 0) {
|
|
@@ -1192,7 +1192,7 @@ class ft extends le {
|
|
|
1192
1192
|
metadata: {
|
|
1193
1193
|
cacheControl: {
|
|
1194
1194
|
type: "max-age",
|
|
1195
|
-
maxAge:
|
|
1195
|
+
maxAge: $,
|
|
1196
1196
|
generatedTime: r
|
|
1197
1197
|
}
|
|
1198
1198
|
}
|
|
@@ -1203,7 +1203,7 @@ class ft extends le {
|
|
|
1203
1203
|
get cacheControlStrategyConfig() {
|
|
1204
1204
|
return {
|
|
1205
1205
|
type: "max-age",
|
|
1206
|
-
requestMaxAge:
|
|
1206
|
+
requestMaxAge: $,
|
|
1207
1207
|
now: Math.floor(Date.now() / 1e3)
|
|
1208
1208
|
};
|
|
1209
1209
|
}
|
|
@@ -1211,10 +1211,10 @@ class ft extends le {
|
|
|
1211
1211
|
return e.errors && e.errors.length > 0;
|
|
1212
1212
|
}
|
|
1213
1213
|
processFetchReturnValue(e) {
|
|
1214
|
-
return this.responseHasErrors(e) ? D(new
|
|
1214
|
+
return this.responseHasErrors(e) ? D(new ee(e)) : k(e);
|
|
1215
1215
|
}
|
|
1216
1216
|
}
|
|
1217
|
-
function
|
|
1217
|
+
function ft(s) {
|
|
1218
1218
|
return (e) => {
|
|
1219
1219
|
if (e.isOk()) {
|
|
1220
1220
|
const t = e.value;
|
|
@@ -1223,7 +1223,7 @@ function pt(s) {
|
|
|
1223
1223
|
s({ data: void 0, errors: b(e.error) });
|
|
1224
1224
|
};
|
|
1225
1225
|
}
|
|
1226
|
-
async function
|
|
1226
|
+
async function pt(s) {
|
|
1227
1227
|
let e, t, r;
|
|
1228
1228
|
try {
|
|
1229
1229
|
const n = await s.execute();
|
|
@@ -1235,14 +1235,14 @@ async function gt(s) {
|
|
|
1235
1235
|
data: e,
|
|
1236
1236
|
errors: t,
|
|
1237
1237
|
subscribe(n) {
|
|
1238
|
-
return r ? r(
|
|
1238
|
+
return r ? r(ft(n)) : E;
|
|
1239
1239
|
},
|
|
1240
1240
|
async refresh() {
|
|
1241
1241
|
await s.refresh();
|
|
1242
1242
|
}
|
|
1243
1243
|
};
|
|
1244
1244
|
}
|
|
1245
|
-
function
|
|
1245
|
+
function I(s) {
|
|
1246
1246
|
return {
|
|
1247
1247
|
data: void 0,
|
|
1248
1248
|
errors: s,
|
|
@@ -1262,55 +1262,55 @@ function mt({
|
|
|
1262
1262
|
operationName: a
|
|
1263
1263
|
}) {
|
|
1264
1264
|
const u = H(i);
|
|
1265
|
-
if (u.isErr()) return
|
|
1266
|
-
const
|
|
1267
|
-
if (
|
|
1268
|
-
return
|
|
1265
|
+
if (u.isErr()) return I(u.error);
|
|
1266
|
+
const h = u.value, p = q(h, a);
|
|
1267
|
+
if (p !== "query")
|
|
1268
|
+
return I([
|
|
1269
1269
|
{
|
|
1270
|
-
message: `DataSDK.graphql.query() requires a GraphQL query, received ${
|
|
1270
|
+
message: `DataSDK.graphql.query() requires a GraphQL query, received ${p}.`
|
|
1271
1271
|
}
|
|
1272
1272
|
]);
|
|
1273
|
-
let
|
|
1273
|
+
let f;
|
|
1274
1274
|
try {
|
|
1275
|
-
|
|
1275
|
+
f = new ht(
|
|
1276
1276
|
{
|
|
1277
|
-
query: R(
|
|
1277
|
+
query: R(h),
|
|
1278
1278
|
variables: o,
|
|
1279
1279
|
operationName: a
|
|
1280
1280
|
},
|
|
1281
1281
|
r,
|
|
1282
1282
|
e
|
|
1283
1283
|
);
|
|
1284
|
-
} catch (
|
|
1285
|
-
return
|
|
1284
|
+
} catch (l) {
|
|
1285
|
+
return I(b(l));
|
|
1286
1286
|
}
|
|
1287
|
-
return
|
|
1287
|
+
return pt(f);
|
|
1288
1288
|
}
|
|
1289
1289
|
return {
|
|
1290
1290
|
query: n,
|
|
1291
1291
|
mutate: (i) => j(t, i)
|
|
1292
1292
|
};
|
|
1293
1293
|
}
|
|
1294
|
-
const
|
|
1295
|
-
class
|
|
1294
|
+
const gt = 1, yt = `@salesforce/platform-sdk-data_v${gt}`, X = G(), wt = `${X}/ui-api`, W = `${X}/graphql`;
|
|
1295
|
+
class bt {
|
|
1296
1296
|
baseUrl;
|
|
1297
1297
|
clientFetch;
|
|
1298
1298
|
onStatus;
|
|
1299
1299
|
graphql;
|
|
1300
1300
|
constructor(e) {
|
|
1301
|
-
const t =
|
|
1302
|
-
this.baseUrl =
|
|
1301
|
+
const t = vt();
|
|
1302
|
+
this.baseUrl = Ct(e?.basePath ?? t.apiPath), this.onStatus = e?.onStatus ?? {}, this.clientFetch = lt({
|
|
1303
1303
|
csrf: {
|
|
1304
|
-
endpoint: `${this.baseUrl}${
|
|
1305
|
-
cacheName:
|
|
1304
|
+
endpoint: `${this.baseUrl}${wt}/session/csrf`,
|
|
1305
|
+
cacheName: yt,
|
|
1306
1306
|
protectedUrls: ["services/data/v", "services/apexrest"],
|
|
1307
1307
|
alwaysProtectedUrls: ["services/apexrest"]
|
|
1308
1308
|
}
|
|
1309
1309
|
});
|
|
1310
|
-
const n =
|
|
1310
|
+
const n = ut((i, o) => this.fetch(i, o));
|
|
1311
1311
|
this.graphql = mt({
|
|
1312
1312
|
bundle: n,
|
|
1313
|
-
url:
|
|
1313
|
+
url: W,
|
|
1314
1314
|
executeRaw: this.executeRawGraphQL.bind(this)
|
|
1315
1315
|
});
|
|
1316
1316
|
}
|
|
@@ -1329,7 +1329,7 @@ class vt {
|
|
|
1329
1329
|
variables: t,
|
|
1330
1330
|
operationName: r
|
|
1331
1331
|
}) {
|
|
1332
|
-
return (await this.fetch(
|
|
1332
|
+
return (await this.fetch(W, {
|
|
1333
1333
|
method: "POST",
|
|
1334
1334
|
body: JSON.stringify({ query: e, variables: t, operationName: r }),
|
|
1335
1335
|
headers: J()
|
|
@@ -1349,12 +1349,12 @@ class vt {
|
|
|
1349
1349
|
return e;
|
|
1350
1350
|
}
|
|
1351
1351
|
}
|
|
1352
|
-
function
|
|
1352
|
+
function vt() {
|
|
1353
1353
|
return {
|
|
1354
1354
|
apiPath: globalThis.SFDC_ENV?.apiPath
|
|
1355
1355
|
};
|
|
1356
1356
|
}
|
|
1357
|
-
function
|
|
1357
|
+
function Ct(s) {
|
|
1358
1358
|
if (!s || s === "/") return "";
|
|
1359
1359
|
let e = s;
|
|
1360
1360
|
return e.startsWith("/") || (e = `/${e}`), e.endsWith("/") && (e = e.slice(0, -1)), e;
|
|
@@ -1366,16 +1366,16 @@ function as(s, ...e) {
|
|
|
1366
1366
|
return t;
|
|
1367
1367
|
}
|
|
1368
1368
|
function cs(s) {
|
|
1369
|
-
return
|
|
1369
|
+
return M(
|
|
1370
1370
|
(async () => {
|
|
1371
1371
|
switch (C(s?.surface)) {
|
|
1372
1372
|
case c.OpenAI:
|
|
1373
|
-
return new
|
|
1373
|
+
return new Je();
|
|
1374
1374
|
case c.WebApp:
|
|
1375
1375
|
case c.MicroFrontend:
|
|
1376
|
-
return new
|
|
1376
|
+
return new bt(s?.webapp);
|
|
1377
1377
|
case c.Mosaic:
|
|
1378
|
-
return new
|
|
1378
|
+
return new Be(s?.mosaic);
|
|
1379
1379
|
case c.SalesforceACC:
|
|
1380
1380
|
case c.MCPApps:
|
|
1381
1381
|
return {};
|
|
@@ -1387,7 +1387,7 @@ function cs(s) {
|
|
|
1387
1387
|
);
|
|
1388
1388
|
}
|
|
1389
1389
|
function ls(s) {
|
|
1390
|
-
return
|
|
1390
|
+
return M(
|
|
1391
1391
|
(async () => {
|
|
1392
1392
|
switch (C(s?.surface)) {
|
|
1393
1393
|
case c.OpenAI:
|
|
@@ -1409,25 +1409,13 @@ function ls(s) {
|
|
|
1409
1409
|
"createLightningSDK"
|
|
1410
1410
|
);
|
|
1411
1411
|
}
|
|
1412
|
-
|
|
1413
|
-
buffer;
|
|
1414
|
-
constructor(e) {
|
|
1415
|
-
this.buffer = e;
|
|
1416
|
-
}
|
|
1417
|
-
wrapAction(e) {
|
|
1418
|
-
if (this.buffer.isEmpty)
|
|
1419
|
-
return e;
|
|
1420
|
-
const t = { envelopes: this.buffer.drain() };
|
|
1421
|
-
return { ...e, _telemetry: t };
|
|
1422
|
-
}
|
|
1423
|
-
}
|
|
1424
|
-
function _t(s) {
|
|
1412
|
+
function St(s) {
|
|
1425
1413
|
let e = "";
|
|
1426
1414
|
for (let r = 0; r < s.length; r += 8192)
|
|
1427
1415
|
e += String.fromCharCode.apply(null, Array.from(s.subarray(r, r + 8192)));
|
|
1428
1416
|
return btoa(e);
|
|
1429
1417
|
}
|
|
1430
|
-
class
|
|
1418
|
+
class Tt {
|
|
1431
1419
|
entries = [];
|
|
1432
1420
|
totalBytes = 0;
|
|
1433
1421
|
maxBufferSize;
|
|
@@ -1442,7 +1430,7 @@ class Et {
|
|
|
1442
1430
|
return this.entries.length === 0;
|
|
1443
1431
|
}
|
|
1444
1432
|
enqueue(e, t) {
|
|
1445
|
-
const r =
|
|
1433
|
+
const r = St(e), n = {
|
|
1446
1434
|
data: r,
|
|
1447
1435
|
traceId: t?.traceId,
|
|
1448
1436
|
instanceId: t?.instanceId,
|
|
@@ -1464,9 +1452,11 @@ class Et {
|
|
|
1464
1452
|
e > 0 && this.onError?.({ reason: "buffer_overflow", droppedCount: e });
|
|
1465
1453
|
}
|
|
1466
1454
|
}
|
|
1467
|
-
|
|
1455
|
+
const _t = "telemetry/upload";
|
|
1456
|
+
class Et {
|
|
1468
1457
|
buffer;
|
|
1469
1458
|
sdk;
|
|
1459
|
+
onError;
|
|
1470
1460
|
timerId = null;
|
|
1471
1461
|
disposed = !1;
|
|
1472
1462
|
handleVisibilityChange = () => {
|
|
@@ -1476,49 +1466,51 @@ class At {
|
|
|
1476
1466
|
this.flush();
|
|
1477
1467
|
};
|
|
1478
1468
|
constructor(e, t, r) {
|
|
1479
|
-
this.buffer = e, this.sdk = t, this.timerId = setInterval(() => this.flush(), r), document.addEventListener("visibilitychange", this.handleVisibilityChange), window.addEventListener("pagehide", this.handlePageHide);
|
|
1469
|
+
this.buffer = e, this.sdk = t, this.onError = r.onError, this.timerId = setInterval(() => this.flush(), r.flushInterval), document.addEventListener("visibilitychange", this.handleVisibilityChange), window.addEventListener("pagehide", this.handlePageHide);
|
|
1480
1470
|
}
|
|
1481
1471
|
flush() {
|
|
1482
|
-
if (this.buffer.isEmpty || !this.sdk.
|
|
1472
|
+
if (this.buffer.isEmpty || !this.sdk.callTool)
|
|
1483
1473
|
return;
|
|
1484
|
-
const
|
|
1485
|
-
this.sdk.
|
|
1474
|
+
const t = this.buffer.drain().map(At);
|
|
1475
|
+
this.sdk.callTool({ toolName: _t, params: { envelopes: t } }).catch((r) => {
|
|
1476
|
+
this.onError?.({ reason: "tool_call_failed", error: r });
|
|
1477
|
+
});
|
|
1486
1478
|
}
|
|
1487
1479
|
dispose() {
|
|
1488
1480
|
this.disposed || (this.disposed = !0, this.timerId !== null && (clearInterval(this.timerId), this.timerId = null), document.removeEventListener("visibilitychange", this.handleVisibilityChange), window.removeEventListener("pagehide", this.handlePageHide), this.flush());
|
|
1489
1481
|
}
|
|
1490
1482
|
}
|
|
1491
|
-
|
|
1483
|
+
function At(s) {
|
|
1484
|
+
const e = { base64Env: s.data };
|
|
1485
|
+
return s.traceId !== void 0 && (e.traceId = s.traceId), e;
|
|
1486
|
+
}
|
|
1487
|
+
const Mt = 65536, It = 3e4;
|
|
1492
1488
|
function us(s) {
|
|
1493
1489
|
const {
|
|
1494
1490
|
sdk: e,
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
} = s, o = new Et({ maxBufferSize: r, onError: i }), a = new Tt(o), u = new At(o, e, n);
|
|
1491
|
+
maxBufferSize: t = Mt,
|
|
1492
|
+
flushInterval: r = It,
|
|
1493
|
+
onError: n
|
|
1494
|
+
} = s, i = new Tt({ maxBufferSize: t, onError: n }), o = new Et(i, e, { flushInterval: r, onError: n });
|
|
1500
1495
|
return {
|
|
1501
|
-
enqueue(
|
|
1502
|
-
|
|
1503
|
-
},
|
|
1504
|
-
wrapAction(l) {
|
|
1505
|
-
return t ? a.wrapAction(l) : l;
|
|
1496
|
+
enqueue(a, u) {
|
|
1497
|
+
i.enqueue(a, u);
|
|
1506
1498
|
},
|
|
1507
1499
|
dispose() {
|
|
1508
|
-
|
|
1500
|
+
o.dispose();
|
|
1509
1501
|
}
|
|
1510
1502
|
};
|
|
1511
1503
|
}
|
|
1512
|
-
const
|
|
1504
|
+
const kt = 1e4, Dt = 10, Pt = 10, Lt = 250, Rt = 1e3;
|
|
1513
1505
|
function v(s, e) {
|
|
1514
1506
|
if (s !== void 0 && (typeof s != "number" || !Number.isFinite(s) || s <= 0))
|
|
1515
1507
|
throw new Error(`${e}, if defined, must be a finite number greater than 0`);
|
|
1516
1508
|
}
|
|
1517
|
-
function
|
|
1509
|
+
function Ot(s, e) {
|
|
1518
1510
|
if (typeof s != "function")
|
|
1519
1511
|
throw new Error(`${e} must be a function`);
|
|
1520
1512
|
}
|
|
1521
|
-
class
|
|
1513
|
+
class xt {
|
|
1522
1514
|
_collector;
|
|
1523
1515
|
_onEnvelope;
|
|
1524
1516
|
_onError;
|
|
@@ -1539,7 +1531,7 @@ class Ot {
|
|
|
1539
1531
|
_lastClickTriggeredAt = 0;
|
|
1540
1532
|
_isDisposed = !1;
|
|
1541
1533
|
constructor(e) {
|
|
1542
|
-
|
|
1534
|
+
Ot(e?.onEnvelope, "options.onEnvelope"), v(e.uploadInterval, "options.uploadInterval"), v(e.messagesLimit, "options.messagesLimit"), v(e.metricsLimit, "options.metricsLimit"), v(e.maxUniqueSchemas, "options.maxUniqueSchemas"), v(e.clickUploadDelay, "options.clickUploadDelay"), v(e.clickTriggerCooldown, "options.clickTriggerCooldown"), this._onEnvelope = e.onEnvelope, this._onError = e.onError, this._messagesLimit = e.messagesLimit ?? Dt, this._metricsLimit = e.metricsLimit ?? Pt, this._uploadInterval = e.uploadInterval ?? kt, this._clickUploadDelay = e.clickUploadDelay ?? Lt, this._clickTriggerCooldown = e.clickTriggerCooldown ?? Rt, this._enableClickTrigger = e.enableClickTrigger !== !1, this._enableVisibilityTrigger = e.enableVisibilityTrigger !== !1, this._collector = new ue({
|
|
1543
1535
|
environment: e.environment,
|
|
1544
1536
|
maxUniqueSchemas: e.maxUniqueSchemas
|
|
1545
1537
|
}), this._restartInterval(), this._attachWindowListeners();
|
|
@@ -1619,7 +1611,7 @@ class Ot {
|
|
|
1619
1611
|
metricsCount: this.metricsCount,
|
|
1620
1612
|
estimatedByteSize: this.estimatedByteSize,
|
|
1621
1613
|
triggeredAt: Date.now()
|
|
1622
|
-
}, r = this._collector.getRawContentsOfCoreEnvelope(), n =
|
|
1614
|
+
}, r = this._collector.getRawContentsOfCoreEnvelope(), n = le(r);
|
|
1623
1615
|
this._restartInterval();
|
|
1624
1616
|
try {
|
|
1625
1617
|
await this._onEnvelope(n, t);
|
|
@@ -1635,7 +1627,7 @@ class Ot {
|
|
|
1635
1627
|
function Ht(s, e) {
|
|
1636
1628
|
if (!s)
|
|
1637
1629
|
throw new Error("instrumentedApp is required");
|
|
1638
|
-
const t = new
|
|
1630
|
+
const t = new xt(e);
|
|
1639
1631
|
return s.registerLogCollector(t), s.registerMetricsCollector(t), e.enableClickTrigger !== !1 && s.activateClickTracker?.(), t;
|
|
1640
1632
|
}
|
|
1641
1633
|
function qt(s) {
|
|
@@ -1648,7 +1640,7 @@ function qt(s) {
|
|
|
1648
1640
|
window.removeEventListener("error", e), window.removeEventListener("unhandledrejection", t);
|
|
1649
1641
|
};
|
|
1650
1642
|
}
|
|
1651
|
-
function
|
|
1643
|
+
function g(s, e) {
|
|
1652
1644
|
return { surface: e };
|
|
1653
1645
|
}
|
|
1654
1646
|
const Nt = {
|
|
@@ -1658,23 +1650,23 @@ const Nt = {
|
|
|
1658
1650
|
},
|
|
1659
1651
|
setWidgetState: {
|
|
1660
1652
|
isAsync: !1,
|
|
1661
|
-
extractTags:
|
|
1653
|
+
extractTags: g
|
|
1662
1654
|
},
|
|
1663
1655
|
getWidgetState: {
|
|
1664
1656
|
isAsync: !1,
|
|
1665
|
-
extractTags:
|
|
1657
|
+
extractTags: g
|
|
1666
1658
|
},
|
|
1667
1659
|
sendMessageToHost: {
|
|
1668
1660
|
isAsync: !0,
|
|
1669
|
-
extractTags:
|
|
1661
|
+
extractTags: g
|
|
1670
1662
|
},
|
|
1671
1663
|
openLink: {
|
|
1672
1664
|
isAsync: !0,
|
|
1673
|
-
extractTags:
|
|
1665
|
+
extractTags: g
|
|
1674
1666
|
},
|
|
1675
1667
|
subscribe: {
|
|
1676
1668
|
isAsync: !1,
|
|
1677
|
-
extractTags:
|
|
1669
|
+
extractTags: g,
|
|
1678
1670
|
wrapArgs: (s, e) => {
|
|
1679
1671
|
const t = s[0];
|
|
1680
1672
|
return [
|
|
@@ -1694,15 +1686,15 @@ const Nt = {
|
|
|
1694
1686
|
},
|
|
1695
1687
|
accessToolOutput: {
|
|
1696
1688
|
isAsync: !1,
|
|
1697
|
-
extractTags:
|
|
1689
|
+
extractTags: g
|
|
1698
1690
|
},
|
|
1699
1691
|
accessToolInput: {
|
|
1700
1692
|
isAsync: !1,
|
|
1701
|
-
extractTags:
|
|
1693
|
+
extractTags: g
|
|
1702
1694
|
},
|
|
1703
1695
|
accessToolMetadata: {
|
|
1704
1696
|
isAsync: !1,
|
|
1705
|
-
extractTags:
|
|
1697
|
+
extractTags: g
|
|
1706
1698
|
}
|
|
1707
1699
|
};
|
|
1708
1700
|
function Ft(s, e, t) {
|
|
@@ -1710,96 +1702,86 @@ function Ft(s, e, t) {
|
|
|
1710
1702
|
get(r, n, i) {
|
|
1711
1703
|
const o = Reflect.get(r, n, i), a = Nt[n];
|
|
1712
1704
|
return !a || typeof o != "function" ? o : (...u) => {
|
|
1713
|
-
const
|
|
1714
|
-
return a.isAsync ? e.activityAsync(
|
|
1705
|
+
const h = a.extractTags(u, t), p = a.wrapArgs ? a.wrapArgs(u, e) : u, f = `sdk.${String(n)}`;
|
|
1706
|
+
return a.isAsync ? e.activityAsync(f, async () => {
|
|
1715
1707
|
try {
|
|
1716
|
-
const
|
|
1708
|
+
const l = await o.apply(
|
|
1717
1709
|
r,
|
|
1718
|
-
|
|
1710
|
+
p
|
|
1719
1711
|
);
|
|
1720
|
-
return e.incrementCounter(
|
|
1721
|
-
} catch (
|
|
1722
|
-
throw e.incrementCounter(
|
|
1712
|
+
return e.incrementCounter(f, 1, !1, h), l;
|
|
1713
|
+
} catch (l) {
|
|
1714
|
+
throw e.incrementCounter(f, 1, !0, h), l;
|
|
1723
1715
|
}
|
|
1724
|
-
}) : (e.incrementCounter(
|
|
1716
|
+
}) : (e.incrementCounter(f, 1, !1, h), o.apply(r, p));
|
|
1725
1717
|
};
|
|
1726
1718
|
}
|
|
1727
1719
|
});
|
|
1728
1720
|
}
|
|
1729
1721
|
async function ds(s) {
|
|
1730
|
-
const { appId: e, clientSessionId: t } = s, r = C(), n = Date.now(), i = s.sdk ?? await
|
|
1722
|
+
const { appId: e, clientSessionId: t } = s, r = C(), n = Date.now(), i = s.sdk ?? await He(), o = de("mcp-widget", {
|
|
1731
1723
|
appPayloadProvider: {
|
|
1732
1724
|
getPayload: () => ({
|
|
1733
|
-
schema:
|
|
1725
|
+
schema: he,
|
|
1734
1726
|
payload: { appId: e, surface: r }
|
|
1735
1727
|
})
|
|
1736
1728
|
},
|
|
1737
1729
|
clientSessionId: t
|
|
1738
|
-
}), a = o, u = Ft(i, a, r),
|
|
1739
|
-
let
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
const h = u.callTool;
|
|
1747
|
-
h && (u.callTool = (g) => {
|
|
1748
|
-
const Y = s.transport.wrapAction(g.params ?? {});
|
|
1749
|
-
return h.call(u, {
|
|
1750
|
-
...g,
|
|
1751
|
-
params: Y
|
|
1752
|
-
});
|
|
1753
|
-
});
|
|
1754
|
-
}
|
|
1755
|
-
let p, d = !1;
|
|
1730
|
+
}), a = o, u = Ft(i, a, r), h = qt(a);
|
|
1731
|
+
let p;
|
|
1732
|
+
s.transport && (p = Ht(o, {
|
|
1733
|
+
onEnvelope: (d) => {
|
|
1734
|
+
s.transport.enqueue(d);
|
|
1735
|
+
}
|
|
1736
|
+
}));
|
|
1737
|
+
let f, l = !1;
|
|
1756
1738
|
return {
|
|
1757
1739
|
instrumentedSDK: u,
|
|
1758
1740
|
app: o,
|
|
1759
|
-
trackEvent(
|
|
1760
|
-
|
|
1761
|
-
eventName:
|
|
1762
|
-
properties:
|
|
1741
|
+
trackEvent(d, m) {
|
|
1742
|
+
l || a.log(ye, {
|
|
1743
|
+
eventName: d,
|
|
1744
|
+
properties: m ? JSON.stringify(m) : ""
|
|
1763
1745
|
});
|
|
1764
1746
|
},
|
|
1765
|
-
trackInteraction(
|
|
1766
|
-
|
|
1767
|
-
elementId:
|
|
1768
|
-
properties:
|
|
1747
|
+
trackInteraction(d, m) {
|
|
1748
|
+
l || a.log(ge, {
|
|
1749
|
+
elementId: d,
|
|
1750
|
+
properties: m ? JSON.stringify(m) : ""
|
|
1769
1751
|
});
|
|
1770
1752
|
},
|
|
1771
|
-
trackError(
|
|
1772
|
-
|
|
1773
|
-
properties:
|
|
1753
|
+
trackError(d, m) {
|
|
1754
|
+
l || a.error(d, me, {
|
|
1755
|
+
properties: m ? JSON.stringify(m) : ""
|
|
1774
1756
|
});
|
|
1775
1757
|
},
|
|
1776
|
-
trackPageView(
|
|
1777
|
-
|
|
1758
|
+
trackPageView(d) {
|
|
1759
|
+
l || d !== f && (f = d, a.log(pe, { componentRef: d }));
|
|
1778
1760
|
},
|
|
1779
1761
|
dispose() {
|
|
1780
|
-
if (
|
|
1781
|
-
|
|
1782
|
-
const
|
|
1783
|
-
a.log(
|
|
1762
|
+
if (l) return;
|
|
1763
|
+
l = !0, h();
|
|
1764
|
+
const d = Date.now() - n;
|
|
1765
|
+
a.log(fe, { durationMs: d }), p?.dispose();
|
|
1784
1766
|
}
|
|
1785
1767
|
};
|
|
1786
1768
|
}
|
|
1787
1769
|
export {
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1770
|
+
_e as JsonRpcClient,
|
|
1771
|
+
Re as MCPAppsChatSDK,
|
|
1772
|
+
Fe as MCPAppsViewSDK,
|
|
1791
1773
|
y as McpAppsSession,
|
|
1792
1774
|
es as MessageChannelTransport,
|
|
1793
1775
|
c as Surface,
|
|
1794
|
-
|
|
1795
|
-
|
|
1776
|
+
xt as TelemetryUploader,
|
|
1777
|
+
Te as WindowPostMessageTransport,
|
|
1796
1778
|
ds as createAnalytics,
|
|
1797
|
-
|
|
1779
|
+
qe as createChatSDK,
|
|
1798
1780
|
cs as createDataSDK,
|
|
1799
1781
|
ls as createLightningSDK,
|
|
1800
1782
|
us as createTelemetryTransport,
|
|
1801
|
-
|
|
1802
|
-
|
|
1783
|
+
Ve as createViewSDK,
|
|
1784
|
+
He as getChatSDK,
|
|
1803
1785
|
ss as getChatSDKSync,
|
|
1804
1786
|
C as getSurface,
|
|
1805
1787
|
ts as getSurfaceCapabilities,
|
|
@@ -1808,12 +1790,12 @@ export {
|
|
|
1808
1790
|
as as gql,
|
|
1809
1791
|
A as isJsonRpcBase,
|
|
1810
1792
|
B as isJsonRpcErrorResponse,
|
|
1811
|
-
|
|
1793
|
+
Se as isJsonRpcNotification,
|
|
1812
1794
|
Zt as isJsonRpcRequest,
|
|
1813
|
-
|
|
1814
|
-
|
|
1795
|
+
Ce as isJsonRpcResponse,
|
|
1796
|
+
ve as isJsonRpcSuccessResponse,
|
|
1815
1797
|
Ht as registerTelemetryUploader,
|
|
1816
1798
|
rs as resetChatSDK,
|
|
1817
1799
|
os as resetViewSDK,
|
|
1818
|
-
|
|
1800
|
+
M as wrapSDKPromise
|
|
1819
1801
|
};
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { createTelemetryTransport } from './transport';
|
|
7
7
|
export { registerTelemetryUploader, TelemetryUploader } from './uploader/TelemetryUploader';
|
|
8
|
-
export type { TelemetryTransport, TelemetryTransportOptions,
|
|
8
|
+
export type { TelemetryTransport, TelemetryTransportOptions, EnvelopeEntry, EnvelopeMetadata, } from './types';
|
|
9
9
|
export type { TelemetryUploaderOptions, OnEnvelopeCallback, FlushReason, TelemetryUploadContext, TelemetryUploaderErrorContext, InstrumentedAppLike, DisposeOptions, } from './uploader/interfaces';
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/telemetry/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAC5F,YAAY,EACX,kBAAkB,EAClB,yBAAyB,EACzB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/telemetry/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAC5F,YAAY,EACX,kBAAkB,EAClB,yBAAyB,EACzB,aAAa,EACb,gBAAgB,GAChB,MAAM,SAAS,CAAC;AACjB,YAAY,EACX,wBAAwB,EACxB,kBAAkB,EAClB,WAAW,EACX,sBAAsB,EACtB,6BAA6B,EAC7B,mBAAmB,EACnB,cAAc,GACd,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ChatSDK } from '../core';
|
|
2
|
+
import { TelemetryBuffer } from './buffer';
|
|
3
|
+
interface ToolAdapterErrorContext {
|
|
4
|
+
reason: string;
|
|
5
|
+
error?: unknown;
|
|
6
|
+
}
|
|
7
|
+
export interface TelemetryToolAdapterOptions {
|
|
8
|
+
flushInterval: number;
|
|
9
|
+
onError?: (context: ToolAdapterErrorContext) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare class TelemetryToolAdapter {
|
|
12
|
+
private readonly buffer;
|
|
13
|
+
private readonly sdk;
|
|
14
|
+
private readonly onError?;
|
|
15
|
+
private timerId;
|
|
16
|
+
private disposed;
|
|
17
|
+
private readonly handleVisibilityChange;
|
|
18
|
+
private readonly handlePageHide;
|
|
19
|
+
constructor(buffer: TelemetryBuffer, sdk: ChatSDK, options: TelemetryToolAdapterOptions);
|
|
20
|
+
flush(): void;
|
|
21
|
+
dispose(): void;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=tool-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-adapter.d.ts","sourceRoot":"","sources":["../../src/telemetry/tool-adapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAKhD,UAAU,uBAAuB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,2BAA2B;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,IAAI,CAAC;CACrD;AAED,qBAAa,oBAAoB;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAU;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAA6C;IACtE,OAAO,CAAC,OAAO,CAA+C;IAC9D,OAAO,CAAC,QAAQ,CAAS;IAEzB,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAIrC;IAEF,OAAO,CAAC,QAAQ,CAAC,cAAc,CAE7B;gBAEU,MAAM,EAAE,eAAe,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,2BAA2B;IAUvF,KAAK,IAAI,IAAI;IAWb,OAAO,IAAI,IAAI;CAcf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/telemetry/transport.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,yBAAyB,EAAoB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/telemetry/transport.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,yBAAyB,EAAoB,MAAM,SAAS,CAAC;AAK/F,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,GAAG,kBAAkB,CAmB/F"}
|
|
@@ -11,22 +11,18 @@ export interface EnvelopeEntry {
|
|
|
11
11
|
componentRef?: string;
|
|
12
12
|
timestamp: number;
|
|
13
13
|
}
|
|
14
|
-
export interface TelemetryPayload {
|
|
15
|
-
envelopes: EnvelopeEntry[];
|
|
16
|
-
}
|
|
17
14
|
export interface TelemetryTransportOptions {
|
|
18
15
|
sdk: ChatSDK;
|
|
19
|
-
flushOnAction?: boolean;
|
|
20
16
|
maxBufferSize?: number;
|
|
21
17
|
flushInterval?: number;
|
|
22
18
|
onError?: (context: {
|
|
23
19
|
reason: string;
|
|
24
20
|
droppedCount?: number;
|
|
21
|
+
error?: unknown;
|
|
25
22
|
}) => void;
|
|
26
23
|
}
|
|
27
24
|
export interface TelemetryTransport {
|
|
28
25
|
enqueue(envelope: Uint8Array, metadata?: EnvelopeMetadata): void;
|
|
29
|
-
wrapAction(args: Record<string, unknown>): Record<string, unknown>;
|
|
30
26
|
dispose(): void;
|
|
31
27
|
}
|
|
32
28
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/telemetry/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,WAAW,gBAAgB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/telemetry/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,WAAW,gBAAgB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,yBAAyB;IACzC,GAAG,EAAE,OAAO,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;CACxF;AAED,MAAM,WAAW,kBAAkB;IAClC,OAAO,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACjE,OAAO,IAAI,IAAI,CAAC;CAChB"}
|
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TelemetryBuffer } from './buffer';
|
|
2
|
-
export declare class ActionPiggybackAdapter {
|
|
3
|
-
private readonly buffer;
|
|
4
|
-
constructor(buffer: TelemetryBuffer);
|
|
5
|
-
wrapAction(args: Record<string, unknown>): Record<string, unknown>;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=action-piggyback.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"action-piggyback.d.ts","sourceRoot":"","sources":["../../src/telemetry/action-piggyback.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD,qBAAa,sBAAsB;IAClC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;gBAE7B,MAAM,EAAE,eAAe;IAInC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAQlE"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ChatSDK } from '../core';
|
|
2
|
-
import { TelemetryBuffer } from './buffer';
|
|
3
|
-
export declare class WidgetStateFlushAdapter {
|
|
4
|
-
private readonly buffer;
|
|
5
|
-
private readonly sdk;
|
|
6
|
-
private timerId;
|
|
7
|
-
private disposed;
|
|
8
|
-
private readonly handleVisibilityChange;
|
|
9
|
-
private readonly handlePageHide;
|
|
10
|
-
constructor(buffer: TelemetryBuffer, sdk: ChatSDK, flushInterval: number);
|
|
11
|
-
flush(): void;
|
|
12
|
-
dispose(): void;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=widget-state-flush.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"widget-state-flush.d.ts","sourceRoot":"","sources":["../../src/telemetry/widget-state-flush.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD,qBAAa,uBAAuB;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAU;IAC9B,OAAO,CAAC,OAAO,CAA+C;IAC9D,OAAO,CAAC,QAAQ,CAAS;IAEzB,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAIrC;IAEF,OAAO,CAAC,QAAQ,CAAC,cAAc,CAE7B;gBAEU,MAAM,EAAE,eAAe,EAAE,GAAG,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM;IASxE,KAAK,IAAI,IAAI;IASb,OAAO,IAAI,IAAI;CAcf"}
|