@salesforce/platform-sdk 11.43.1 → 11.43.2

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.
@@ -5,7 +5,7 @@ import { Analytics, AnalyticsOptions } from './types';
5
5
  * Handles all setup internally:
6
6
  * - Creates a ChatSDK instance via getChatSDK() (unless one is provided)
7
7
  * - Calls registerInstrumentedApp() with appPayloadProvider pre-wired
8
- * to attach appId and surface (always), plus axlPftId and pftId (when set)
8
+ * to attach appId and surface (always), plus the customer pftId (when set)
9
9
  * to every o11y log entry
10
10
  * - Wraps the ChatSDK in a Proxy for auto-instrumentation
11
11
  * - Sets up global error listeners (window.onerror, unhandledrejection)
@@ -5,5 +5,5 @@
5
5
  */
6
6
  export { createAnalytics } from './analytics';
7
7
  export type { Analytics, AnalyticsOptions } from './types';
8
- export { AXL_PFT_ID, PFT_META_KEY, validatePftId } from './pft';
8
+ export { PFT_META_KEY, validatePftId } from './pft';
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/analytics/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAM3D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/analytics/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAM3D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC"}
@@ -1,7 +1,6 @@
1
- import { A as t, P as e, c as A, v as P } from "../analytics-xqWfpWnv.js";
1
+ import { P as e, c as s, v as c } from "../analytics-Dpz22kda.js";
2
2
  export {
3
- t as AXL_PFT_ID,
4
3
  e as PFT_META_KEY,
5
- A as createAnalytics,
6
- P as validatePftId
4
+ s as createAnalytics,
5
+ c as validatePftId
7
6
  };
@@ -9,13 +9,6 @@
9
9
  * with other `_meta` consumers.
10
10
  */
11
11
  export declare const PFT_META_KEY = "sfdc.pftId";
12
- /**
13
- * The AXL team's own Product Feature Taxonomy (PFT) Id, emitted on every event
14
- * as `axlPftId` alongside the customer `pftId` (W-22315201). A fixed constant —
15
- * intentionally not in {@link AnalyticsOptions} or any setter, so consumers
16
- * cannot override or suppress it. A unit test asserts it passes validatePftId.
17
- */
18
- export declare const AXL_PFT_ID = "aJCEE000000FgYP4A0";
19
12
  /**
20
13
  * Validates a PFT Id at the SDK boundary.
21
14
  *
@@ -1 +1 @@
1
- {"version":3,"file":"pft.d.ts","sourceRoot":"","sources":["../../src/analytics/pft.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwBH;;;;GAIG;AACH,eAAO,MAAM,YAAY,eAAe,CAAC;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,UAAU,uBAAuB,CAAC;AAiB/C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,MAAM,CAqBvD"}
1
+ {"version":3,"file":"pft.d.ts","sourceRoot":"","sources":["../../src/analytics/pft.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwBH;;;;GAIG;AACH,eAAO,MAAM,YAAY,eAAe,CAAC;AAiBzC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,MAAM,CAqBvD"}
@@ -1,11 +1,11 @@
1
- import { registerInstrumentedApp as A } from "o11y/client";
2
- import { g as E, S } from "./surface-Dd2tqrPi.js";
3
- import { w as T } from "./sdk-promise-D0sy7OW1.js";
4
- import { getChatSDK as x } from "./chat/index.js";
5
- import { r as v } from "./TelemetryUploader-DKkdppe9.js";
6
- import { analyticsContextSchema as C, sessionSchema as _, pageViewSchema as k, errorContextSchema as F, interactionSchema as D, customEventSchema as L } from "o11y_schema/sf_mcpanalytics";
1
+ import { registerInstrumentedApp as S } from "o11y/client";
2
+ import { g as E, S as T } from "./surface-Dd2tqrPi.js";
3
+ import { w as A } from "./sdk-promise-D0sy7OW1.js";
4
+ import { getChatSDK as v } from "./chat/index.js";
5
+ import { r as x } from "./TelemetryUploader-DKkdppe9.js";
6
+ import { analyticsContextSchema as C, sessionSchema as k, pageViewSchema as _, errorContextSchema as D, interactionSchema as F, customEventSchema as L } from "o11y_schema/sf_mcpanalytics";
7
7
  function N(e) {
8
- const n = (r, f, g, o, c) => {
8
+ const n = (r, f, p, s, c) => {
9
9
  e.error(c ?? r);
10
10
  }, a = (r) => {
11
11
  e.error(r.reason);
@@ -14,32 +14,32 @@ function N(e) {
14
14
  window.removeEventListener("error", n), window.removeEventListener("unhandledrejection", a);
15
15
  };
16
16
  }
17
- const J = "aJC", U = "sfdc.pftId", K = "aJCEE000000FgYP4A0", P = /* @__PURE__ */ new Set(), O = /^aJC[0-9A-Za-z]{12}(?:[0-9A-Za-z]{3})?$/;
17
+ const J = "aJC", U = "sfdc.pftId", h = /* @__PURE__ */ new Set(), K = /^aJC[0-9A-Za-z]{12}(?:[0-9A-Za-z]{3})?$/;
18
18
  function I(e) {
19
- return typeof e != "string" || e.length === 0 ? !1 : e.length !== 15 && e.length !== 18 ? (h(e, "Expected a 15- or 18-character Salesforce ID"), !1) : O.test(e) ? !0 : (h(e, `Expected a Product Feature Id (prefix "${J}", base62).`), !1);
19
+ return typeof e != "string" || e.length === 0 ? !1 : e.length !== 15 && e.length !== 18 ? (P(e, "Expected a 15- or 18-character Salesforce ID"), !1) : K.test(e) ? !0 : (P(e, `Expected a Product Feature Id (prefix "${J}", base62).`), !1);
20
20
  }
21
- function h(e, n) {
22
- P.has(e) || (P.add(e), console.debug(`[platform-sdk:analytics] Ignoring invalid PFT Id "${e}". ${n}`));
21
+ function P(e, n) {
22
+ h.has(e) || (h.add(e), console.debug(`[platform-sdk:analytics] Ignoring invalid PFT Id "${e}". ${n}`));
23
23
  }
24
- function p(e) {
24
+ function g(e) {
25
25
  return {};
26
26
  }
27
- const $ = {
27
+ const O = {
28
28
  callTool: {
29
29
  isAsync: !0,
30
30
  extractTags: (e) => ({ toolName: e[0]?.toolName ?? "unknown" })
31
31
  },
32
32
  setWidgetState: {
33
33
  isAsync: !1,
34
- extractTags: p
34
+ extractTags: g
35
35
  },
36
36
  sendMessageToHost: {
37
37
  isAsync: !0,
38
- extractTags: p
38
+ extractTags: g
39
39
  },
40
40
  openLink: {
41
41
  isAsync: !0,
42
- extractTags: p
42
+ extractTags: g
43
43
  },
44
44
  readResource: {
45
45
  isAsync: !0,
@@ -53,42 +53,39 @@ const $ = {
53
53
  extractTags: (e) => ({ mode: e[0] ?? "unknown" })
54
54
  }
55
55
  };
56
- function M(e, n, a) {
56
+ function $(e, n, a) {
57
57
  return new Proxy(e, {
58
- get(r, f, g) {
59
- const o = Reflect.get(r, f, g), c = $[f];
60
- return !c || typeof o != "function" ? o : (...u) => {
61
- const s = { ...a(), ...c.extractTags(u) }, d = `sdk.${String(f)}`;
58
+ get(r, f, p) {
59
+ const s = Reflect.get(r, f, p), c = O[f];
60
+ return !c || typeof s != "function" ? s : (...u) => {
61
+ const o = { ...a(), ...c.extractTags(u) }, d = `sdk.${String(f)}`;
62
62
  return c.isAsync ? n.activityAsync(d, async () => {
63
63
  try {
64
- const m = await o.apply(r, u);
65
- return n.incrementCounter(d, 1, !1, s), m;
64
+ const m = await s.apply(r, u);
65
+ return n.incrementCounter(d, 1, !1, o), m;
66
66
  } catch (m) {
67
- throw n.incrementCounter(d, 1, !0, s), m;
67
+ throw n.incrementCounter(d, 1, !0, o), m;
68
68
  }
69
- }) : (n.incrementCounter(d, 1, !1, s), o.apply(r, u));
69
+ }) : (n.incrementCounter(d, 1, !1, o), s.apply(r, u));
70
70
  };
71
71
  }
72
72
  });
73
73
  }
74
74
  function W(e) {
75
- return T(R(e), "createAnalytics");
75
+ return A(M(e), "createAnalytics");
76
76
  }
77
- async function R(e) {
77
+ async function M(e) {
78
78
  const { appId: n, clientSessionId: a } = e;
79
79
  let r;
80
80
  try {
81
81
  r = await E();
82
82
  } catch {
83
- r = S.WebApp;
83
+ r = T.WebApp;
84
84
  }
85
- const f = Date.now(), g = e.sdk ?? await x();
86
- let o = null;
87
- e.pftId !== void 0 && I(e.pftId) && (o = e.pftId);
88
- const c = () => ({
89
- axlPftId: K,
90
- ...o !== null ? { pftId: o } : {}
91
- }), u = A("mcp-widget", {
85
+ const f = Date.now(), p = e.sdk ?? await v();
86
+ let s = null;
87
+ e.pftId !== void 0 && I(e.pftId) && (s = e.pftId);
88
+ const c = () => s !== null ? { pftId: s } : {}, u = S("mcp-widget", {
92
89
  appPayloadProvider: {
93
90
  getPayload: () => ({
94
91
  schema: C,
@@ -100,12 +97,12 @@ async function R(e) {
100
97
  })
101
98
  },
102
99
  clientSessionId: a
103
- }), s = u, d = M(g, s, () => ({
100
+ }), o = u, d = $(p, o, () => ({
104
101
  surface: r,
105
102
  ...c()
106
- })), m = N(s);
103
+ })), m = N(o);
107
104
  let y;
108
- e.transport && (y = v(u, {
105
+ e.transport && (y = x(u, {
109
106
  onEnvelope: (t) => {
110
107
  e.transport.enqueue(t);
111
108
  }
@@ -115,38 +112,37 @@ async function R(e) {
115
112
  instrumentedSDK: d,
116
113
  app: u,
117
114
  trackEvent(t, i) {
118
- l || s.log(L, {
115
+ l || o.log(L, {
119
116
  eventName: t,
120
117
  properties: i ? JSON.stringify(i) : ""
121
118
  });
122
119
  },
123
120
  trackInteraction(t, i) {
124
- l || s.log(D, {
121
+ l || o.log(F, {
125
122
  elementId: t,
126
123
  properties: i ? JSON.stringify(i) : ""
127
124
  });
128
125
  },
129
126
  trackError(t, i) {
130
- l || s.error(t, F, {
127
+ l || o.error(t, D, {
131
128
  properties: i ? JSON.stringify(i) : ""
132
129
  });
133
130
  },
134
131
  trackPageView(t) {
135
- l || t !== w && (w = t, s.log(k, { componentRef: t }));
132
+ l || t !== w && (w = t, o.log(_, { componentRef: t }));
136
133
  },
137
134
  setPftId(t) {
138
- l || I(t) && (o = t);
135
+ l || I(t) && (s = t);
139
136
  },
140
137
  dispose() {
141
138
  if (l) return;
142
139
  l = !0, m();
143
140
  const t = Date.now() - f;
144
- s.log(_, { durationMs: t }), y?.dispose();
141
+ o.log(k, { durationMs: t }), y?.dispose();
145
142
  }
146
143
  };
147
144
  }
148
145
  export {
149
- K as A,
150
146
  U as P,
151
147
  W as c,
152
148
  I as v
@@ -245,7 +245,7 @@ const w = "Accept-Language", me = (r) => {
245
245
  return u(r);
246
246
  const [t, n] = r;
247
247
  return (t instanceof Request && !n?.headers ? t.headers.has(w) : new Headers(n?.headers).has(w)) ? u(r) : u(b(w, e, r));
248
- }, ye = "X-SFDC-Client-Name", be = "X-SFDC-Client-Version", ve = "@salesforce/platform-sdk", Se = "11.43.1", ge = (r) => {
248
+ }, ye = "X-SFDC-Client-Name", be = "X-SFDC-Client-Version", ve = "@salesforce/platform-sdk", Se = "11.43.2", ge = (r) => {
249
249
  let e = b(ye, ve, r);
250
250
  return e = b(be, Se, e), u(e);
251
251
  }, we = "X-CSRF-Token";
package/dist/index.d.ts CHANGED
@@ -10,5 +10,5 @@ export { createDataSDK, type DataSDKOptions, type WebAppDataSDKOptions, type Mos
10
10
  export { createLightningSDK, type LightningSDKOptions } from './lightning';
11
11
  export { getCurrentApp, type CurrentAppOptions, type AppIdentity, type CurrentApp, WebAppCurrentApp, } from './app';
12
12
  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';
13
- export { AXL_PFT_ID, createAnalytics, PFT_META_KEY, validatePftId, type Analytics, type AnalyticsOptions, } from './analytics';
13
+ export { createAnalytics, PFT_META_KEY, validatePftId, type Analytics, type AnalyticsOptions, } from './analytics';
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -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,aAAa,EACb,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,gBAAgB,GAChB,MAAM,OAAO,CAAC;AAGf,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,YAAY,EACZ,aAAa,EACb,KAAK,SAAS,EACd,KAAK,gBAAgB,GACrB,MAAM,aAAa,CAAC"}
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,aAAa,EACb,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,gBAAgB,GAChB,MAAM,OAAO,CAAC;AAGf,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,eAAe,EACf,YAAY,EACZ,aAAa,EACb,KAAK,SAAS,EACd,KAAK,gBAAgB,GACrB,MAAM,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -1,44 +1,43 @@
1
- import { M as a, a as t, S as p, g as s, i as o, b as i, r as S } from "./surface-Dd2tqrPi.js";
1
+ import { M as t, a, S as p, g as s, i as o, b as i, r as S } from "./surface-Dd2tqrPi.js";
2
2
  import { g as c } from "./capabilities-5BWkCbcP.js";
3
- import { w as D } from "./sdk-promise-D0sy7OW1.js";
4
- import { MCPAppsChatSDK as K, createChatSDK as l, getChatSDK as A, getChatSDKSync as n, resetChatSDK as x } from "./chat/index.js";
5
- import { MCPAppsViewSDK as T, createViewSDK as d, getViewSDK as w, getViewSDKSync as P, resetViewSDK as h } from "./view/index.js";
6
- import { createDataSDK as y, gql as M } from "./data/index.js";
3
+ import { w as g } from "./sdk-promise-D0sy7OW1.js";
4
+ import { MCPAppsChatSDK as K, createChatSDK as l, getChatSDK as n, getChatSDKSync as x, resetChatSDK as A } from "./chat/index.js";
5
+ import { MCPAppsViewSDK as d, createViewSDK as w, getViewSDK as T, getViewSDKSync as h, resetViewSDK as u } from "./view/index.js";
6
+ import { createDataSDK as M, gql as P } from "./data/index.js";
7
7
  import { createLightningSDK as b } from "./lightning/index.js";
8
- import { WebAppCurrentApp as _, getCurrentApp as v } from "./app/index.js";
9
- import { c as F } from "./transport-D9QstWle.js";
10
- import { T as U, r as q } from "./TelemetryUploader-DKkdppe9.js";
11
- import { A as N, P as W, c as X, v as Y } from "./analytics-xqWfpWnv.js";
8
+ import { WebAppCurrentApp as v, getCurrentApp as I } from "./app/index.js";
9
+ import { c as _ } from "./transport-D9QstWle.js";
10
+ import { T as z, r as F } from "./TelemetryUploader-DKkdppe9.js";
11
+ import { P as N, c as W, v as Y } from "./analytics-Dpz22kda.js";
12
12
  export {
13
- N as AXL_PFT_ID,
14
13
  K as MCPAppsChatSDK,
15
- T as MCPAppsViewSDK,
16
- a as McpAppsNotAvailableError,
17
- t as McpAppsSession,
18
- W as PFT_META_KEY,
14
+ d as MCPAppsViewSDK,
15
+ t as McpAppsNotAvailableError,
16
+ a as McpAppsSession,
17
+ N as PFT_META_KEY,
19
18
  p as Surface,
20
- U as TelemetryUploader,
21
- _ as WebAppCurrentApp,
22
- X as createAnalytics,
19
+ z as TelemetryUploader,
20
+ v as WebAppCurrentApp,
21
+ W as createAnalytics,
23
22
  l as createChatSDK,
24
- y as createDataSDK,
23
+ M as createDataSDK,
25
24
  b as createLightningSDK,
26
- F as createTelemetryTransport,
27
- d as createViewSDK,
28
- A as getChatSDK,
29
- n as getChatSDKSync,
30
- v as getCurrentApp,
25
+ _ as createTelemetryTransport,
26
+ w as createViewSDK,
27
+ n as getChatSDK,
28
+ x as getChatSDKSync,
29
+ I as getCurrentApp,
31
30
  c as getSurfaceCapabilities,
32
31
  s as getVerifiedSurface,
33
- w as getViewSDK,
34
- P as getViewSDKSync,
35
- M as gql,
32
+ T as getViewSDK,
33
+ h as getViewSDKSync,
34
+ P as gql,
36
35
  o as initialize,
37
36
  i as isSfEmbeddingIframe,
38
- q as registerTelemetryUploader,
39
- x as resetChatSDK,
37
+ F as registerTelemetryUploader,
38
+ A as resetChatSDK,
40
39
  S as resetSurface,
41
- h as resetViewSDK,
40
+ u as resetViewSDK,
42
41
  Y as validatePftId,
43
- D as wrapSDKPromise
42
+ g as wrapSDKPromise
44
43
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/platform-sdk",
3
- "version": "11.43.1",
3
+ "version": "11.43.2",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -123,7 +123,7 @@
123
123
  "@conduit-client/service-pubsub": "3.19.6",
124
124
  "@conduit-client/service-retry": "3.19.6",
125
125
  "@conduit-client/utils": "3.19.6",
126
- "@salesforce/jsonrpc": "^11.43.1",
126
+ "@salesforce/jsonrpc": "^11.43.2",
127
127
  "@salesforce/sf-embedding-bridge": "2.2.5-rc.2"
128
128
  },
129
129
  "peerDependencies": {