@salesforce/platform-sdk 12.8.0 → 12.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/dist/analytics/analytics.d.ts +19 -15
  2. package/dist/analytics/analytics.d.ts.map +1 -1
  3. package/dist/analytics/error-listener.d.ts +3 -3
  4. package/dist/analytics/index.d.ts.map +1 -1
  5. package/dist/analytics/index.js +1 -1
  6. package/dist/analytics/method-configs.d.ts +8 -4
  7. package/dist/analytics/method-configs.d.ts.map +1 -1
  8. package/dist/analytics/pft.d.ts +22 -16
  9. package/dist/analytics/pft.d.ts.map +1 -1
  10. package/dist/analytics/proxy.d.ts +10 -8
  11. package/dist/analytics/proxy.d.ts.map +1 -1
  12. package/dist/analytics/types.d.ts +57 -43
  13. package/dist/analytics/types.d.ts.map +1 -1
  14. package/dist/{analytics-Dpz22kda.js → analytics-wESbWdca.js} +1 -1
  15. package/dist/app/index.d.ts +18 -13
  16. package/dist/app/index.d.ts.map +1 -1
  17. package/dist/app/index.js +5 -3
  18. package/dist/app/webapp.d.ts +5 -2
  19. package/dist/app/webapp.d.ts.map +1 -1
  20. package/dist/{capabilities-CKe8z6kZ.js → capabilities-B0mU0_G0.js} +1 -1
  21. package/dist/chat/index.js +1 -1
  22. package/dist/core/app.d.ts +31 -22
  23. package/dist/core/app.d.ts.map +1 -1
  24. package/dist/core/capabilities.d.ts +26 -17
  25. package/dist/core/capabilities.d.ts.map +1 -1
  26. package/dist/core/chat.d.ts +155 -125
  27. package/dist/core/chat.d.ts.map +1 -1
  28. package/dist/core/data.d.ts +146 -107
  29. package/dist/core/data.d.ts.map +1 -1
  30. package/dist/core/extension-attach.d.ts +65 -51
  31. package/dist/core/extension-attach.d.ts.map +1 -1
  32. package/dist/core/extension-types.d.ts +214 -153
  33. package/dist/core/extension-types.d.ts.map +1 -1
  34. package/dist/core/index.d.ts.map +1 -1
  35. package/dist/core/index.js +2 -2
  36. package/dist/core/lightning.d.ts +11 -19
  37. package/dist/core/lightning.d.ts.map +1 -1
  38. package/dist/core/mcpapps-session.d.ts +63 -52
  39. package/dist/core/mcpapps-session.d.ts.map +1 -1
  40. package/dist/core/options.d.ts +6 -4
  41. package/dist/core/options.d.ts.map +1 -1
  42. package/dist/core/platforms.d.ts +29 -29
  43. package/dist/core/sdk-promise.d.ts +7 -4
  44. package/dist/core/sdk-promise.d.ts.map +1 -1
  45. package/dist/core/surface.d.ts +89 -67
  46. package/dist/core/surface.d.ts.map +1 -1
  47. package/dist/core/view.d.ts +164 -113
  48. package/dist/core/view.d.ts.map +1 -1
  49. package/dist/data/extensions/index.d.ts +5 -2
  50. package/dist/data/extensions/index.d.ts.map +1 -1
  51. package/dist/data/extensions/labels/index.d.ts +72 -49
  52. package/dist/data/extensions/labels/index.d.ts.map +1 -1
  53. package/dist/data/extensions/labels/query.d.ts +38 -29
  54. package/dist/data/extensions/labels/query.d.ts.map +1 -1
  55. package/dist/data/gql.d.ts +8 -4
  56. package/dist/data/gql.d.ts.map +1 -1
  57. package/dist/data/index.d.ts +67 -48
  58. package/dist/data/index.d.ts.map +1 -1
  59. package/dist/data/index.js +265 -242
  60. package/dist/data/mosaic/fetch.d.ts +24 -15
  61. package/dist/data/mosaic/fetch.d.ts.map +1 -1
  62. package/dist/data/mosaic/index.d.ts +13 -9
  63. package/dist/data/mosaic/index.d.ts.map +1 -1
  64. package/dist/data/openai/index.d.ts +11 -5
  65. package/dist/data/openai/index.d.ts.map +1 -1
  66. package/dist/data/shared/graphql/cache/command.d.ts +60 -46
  67. package/dist/data/shared/graphql/cache/command.d.ts.map +1 -1
  68. package/dist/data/shared/graphql/cache/invoker.d.ts.map +1 -1
  69. package/dist/data/shared/graphql/cache/services.d.ts +21 -11
  70. package/dist/data/shared/graphql/cache/services.d.ts.map +1 -1
  71. package/dist/data/shared/graphql/cached-graphql.d.ts +9 -4
  72. package/dist/data/shared/graphql/cached-graphql.d.ts.map +1 -1
  73. package/dist/data/shared/graphql/graphql-parse.d.ts +6 -3
  74. package/dist/data/shared/graphql/graphql-parse.d.ts.map +1 -1
  75. package/dist/data/shared/graphql/headers.d.ts +34 -27
  76. package/dist/data/shared/graphql/headers.d.ts.map +1 -1
  77. package/dist/data/shared/graphql/parse-response.d.ts +31 -23
  78. package/dist/data/shared/graphql/parse-response.d.ts.map +1 -1
  79. package/dist/data/shared/graphql/uncached-graphql.d.ts +10 -6
  80. package/dist/data/shared/graphql/uncached-graphql.d.ts.map +1 -1
  81. package/dist/data/shared/url-utils.d.ts +1 -1
  82. package/dist/data/shared/url-utils.d.ts.map +1 -1
  83. package/dist/data/webapp/accept-language.interceptor.d.ts +26 -9
  84. package/dist/data/webapp/accept-language.interceptor.d.ts.map +1 -1
  85. package/dist/data/webapp/client-headers.interceptor.d.ts +4 -3
  86. package/dist/data/webapp/client-headers.interceptor.d.ts.map +1 -1
  87. package/dist/data/webapp/csrf/header.interceptor.d.ts +4 -4
  88. package/dist/data/webapp/csrf/header.interceptor.d.ts.map +1 -1
  89. package/dist/data/webapp/csrf/retry.policy.d.ts +12 -11
  90. package/dist/data/webapp/csrf/retry.policy.d.ts.map +1 -1
  91. package/dist/data/webapp/csrf/token-manager.d.ts +18 -12
  92. package/dist/data/webapp/csrf/token-manager.d.ts.map +1 -1
  93. package/dist/data/webapp/fetch.d.ts +12 -8
  94. package/dist/data/webapp/fetch.d.ts.map +1 -1
  95. package/dist/data/webapp/index.d.ts +12 -7
  96. package/dist/data/webapp/index.d.ts.map +1 -1
  97. package/dist/i18n/locale-format.d.ts +23 -21
  98. package/dist/i18n/locale-format.d.ts.map +1 -1
  99. package/dist/i18n/salesforce-backend.d.ts +19 -11
  100. package/dist/i18n/salesforce-backend.d.ts.map +1 -1
  101. package/dist/i18n/salesforce-detector.d.ts +22 -14
  102. package/dist/i18n/salesforce-detector.d.ts.map +1 -1
  103. package/dist/index.js +3 -3
  104. package/dist/lightning/embedding.d.ts.map +1 -1
  105. package/dist/lightning/index.d.ts +4 -4
  106. package/dist/lightning/index.d.ts.map +1 -1
  107. package/dist/lightning/index.js +2 -2
  108. package/dist/{surface-Dd2tqrPi.js → surface-DWDgqdpN.js} +18 -13
  109. package/dist/telemetry/tool-adapter.d.ts.map +1 -1
  110. package/dist/telemetry/uploader/TelemetryUploader.d.ts.map +1 -1
  111. package/dist/ui-embedding/index.d.ts.map +1 -1
  112. package/dist/ui-embedding/session.d.ts +7 -2
  113. package/dist/ui-embedding/session.d.ts.map +1 -1
  114. package/dist/ui-embedding/session.js +1 -1
  115. package/dist/view/index.js +1 -1
  116. package/package.json +2 -2
@@ -1,13 +1,17 @@
1
1
  import { RawGraphQLExecutor } from './graphql-parse';
2
2
  import { DataSDKGraphQL } from '../../../core/data';
3
3
  /**
4
- * Build the `graphql` namespace for a surface with no cache. `query` returns
5
- * a Promise that resolves with `{data, errors, subscribe, refresh}`
6
- * once the first network response arrives. `subscribe` streams subsequent
7
- * snapshots triggered by `refresh()` — there is no cache to push background
8
- * updates. `mutate` is request/response.
4
+ * Builds the `graphql` namespace for a surface with no cache.
9
5
  *
10
- * Lets caching and non-caching surfaces present the same call-site API.
6
+ * @remarks
7
+ * `query` returns a promise that resolves with `{data, errors, subscribe,
8
+ * refresh}` once the first network response arrives. `subscribe` streams
9
+ * later snapshots that `refresh()` triggers — there is no cache to push
10
+ * background updates on its own. `mutate` follows a simple request-response
11
+ * pattern.
12
+ *
13
+ * This function lets caching and non-caching surfaces present the same
14
+ * call-site API.
11
15
  */
12
16
  export declare function buildUncachedGraphQL(executeRaw: RawGraphQLExecutor): DataSDKGraphQL;
13
17
  //# sourceMappingURL=uncached-graphql.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"uncached-graphql.d.ts","sourceRoot":"","sources":["../../../../src/data/shared/graphql/uncached-graphql.ts"],"names":[],"mappings":"AAMA,OAAO,EAON,KAAK,kBAAkB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACX,cAAc,EAMd,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,kBAAkB,GAAG,cAAc,CA+EnF"}
1
+ {"version":3,"file":"uncached-graphql.d.ts","sourceRoot":"","sources":["../../../../src/data/shared/graphql/uncached-graphql.ts"],"names":[],"mappings":"AAMA,OAAO,EAON,KAAK,kBAAkB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACX,cAAc,EAMd,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,kBAAkB,GAAG,cAAc,CA+EnF"}
@@ -4,6 +4,6 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
  export declare const API_VERSION: string;
7
- /** Builds the Salesforce data API path for the given version (defaults to {@link API_VERSION}). */
7
+ /** Builds the Salesforce data API path for the given version. Defaults to {@link API_VERSION} when the caller passes no version. */
8
8
  export declare function buildPathData(version?: string): string;
9
9
  //# sourceMappingURL=url-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"url-utils.d.ts","sourceRoot":"","sources":["../../../src/data/shared/url-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,WAAW,QAA0E,CAAC;AAEnG,mGAAmG;AACnG,wBAAgB,aAAa,CAAC,OAAO,GAAE,MAAoB,GAAG,MAAM,CAEnE"}
1
+ {"version":3,"file":"url-utils.d.ts","sourceRoot":"","sources":["../../../src/data/shared/url-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,WAAW,QAA0E,CAAC;AAEnG,oIAAoI;AACpI,wBAAgB,aAAa,CAAC,OAAO,GAAE,MAAoB,GAAG,MAAM,CAEnE"}
@@ -1,19 +1,36 @@
1
1
  import { RequestInterceptor } from '@conduit-client/service-fetch-network/v1';
2
2
  export declare const ACCEPT_LANGUAGE_HEADER = "Accept-Language";
3
3
  /**
4
- * A request interceptor that propagates the site's active language to every
5
- * outgoing SDK request as an `Accept-Language` header.
4
+ * Precedence rule (single source): explicit header wins, else env language, else
5
+ * none. Callers pass whether an explicit header is present; get the language to
6
+ * add or `undefined`. Shared by the wire and cache-key paths so they can't disagree.
7
+ */
8
+ export declare function envAcceptLanguageToAdd(hasExplicit: boolean): string | undefined;
9
+ /**
10
+ * Resolve the effective headers for both the cache key and the wire request:
11
+ * fill in env `Accept-Language` unless already set (see
12
+ * {@link envAcceptLanguageToAdd}). Returns the original `headers` untouched when
13
+ * nothing is added, keeping the cache key byte-identical.
14
+ */
15
+ export declare function withEnvAcceptLanguage(headers: HeadersInit | undefined): HeadersInit | undefined;
16
+ /**
17
+ * Adds an `Accept-Language` header to every outgoing SDK request, set to the
18
+ * site's active language.
6
19
  *
7
- * The language is read from the SFDC runtime environment
20
+ * @remarks
21
+ * The interceptor reads the language from the SFDC runtime environment
8
22
  * ({@link globalThis.SFDC_ENV}`.language`), the same channel that carries the
9
- * API path — never from the URL. Behavior:
23
+ * API path. It never reads the language from the URL.
10
24
  *
11
- * - No env language present -> no-op (falls back to platform/org default).
12
- * - Caller already set `Accept-Language` (on `init` or on a `Request` input)
13
- * -> preserved, never overwritten.
25
+ * Behavior:
26
+ * - When no environment language is present, the interceptor does nothing. The
27
+ * request falls back to the platform or org default.
28
+ * - When the caller already set `Accept-Language` (on `init` or on a `Request`
29
+ * input), the interceptor preserves it and never overwrites it.
14
30
  *
15
- * Since both REST (`fetch`) and GraphQL requests flow through the same fetch
16
- * service, wiring this once into the request chain covers both paths.
31
+ * Both REST (`fetch`) and GraphQL requests flow through the same fetch
32
+ * service, so this interceptor covers both paths once it is wired into the
33
+ * request chain.
17
34
  */
18
35
  export declare const acceptLanguageInterceptor: RequestInterceptor;
19
36
  //# sourceMappingURL=accept-language.interceptor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"accept-language.interceptor.d.ts","sourceRoot":"","sources":["../../../src/data/webapp/accept-language.interceptor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGN,KAAK,kBAAkB,EACvB,MAAM,0CAA0C,CAAC;AAGlD,eAAO,MAAM,sBAAsB,oBAAoB,CAAC;AAExD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,yBAAyB,EAAE,kBAwBvC,CAAC"}
1
+ {"version":3,"file":"accept-language.interceptor.d.ts","sourceRoot":"","sources":["../../../src/data/webapp/accept-language.interceptor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGN,KAAK,kBAAkB,EACvB,MAAM,0CAA0C,CAAC;AAGlD,eAAO,MAAM,sBAAsB,oBAAoB,CAAC;AAExD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAE/E;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAQ/F;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,yBAAyB,EAAE,kBAqBvC,CAAC"}
@@ -2,11 +2,12 @@ import { RequestInterceptor } from '@conduit-client/service-fetch-network/v1';
2
2
  export declare const CLIENT_NAME_HEADER = "X-SFDC-Client-Name";
3
3
  export declare const CLIENT_VERSION_HEADER = "X-SFDC-Client-Version";
4
4
  /**
5
- * A request interceptor that stamps every outgoing request with SDK identity headers.
5
+ * Adds SDK identity headers to every outgoing request.
6
6
  *
7
+ * @remarks
7
8
  * Added headers:
8
- * X-SFDC-Client-Name: the SDK package name
9
- * X-SFDC-Client-Version: the SDK version
9
+ * - `X-SFDC-Client-Name` — the SDK package name.
10
+ * - `X-SFDC-Client-Version` — the SDK version.
10
11
  */
11
12
  export declare const clientHeadersInterceptor: RequestInterceptor;
12
13
  //# sourceMappingURL=client-headers.interceptor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client-headers.interceptor.d.ts","sourceRoot":"","sources":["../../../src/data/webapp/client-headers.interceptor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGN,KAAK,kBAAkB,EACvB,MAAM,0CAA0C,CAAC;AAGlD,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AACvD,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAK7D;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,EAAE,kBAItC,CAAC"}
1
+ {"version":3,"file":"client-headers.interceptor.d.ts","sourceRoot":"","sources":["../../../src/data/webapp/client-headers.interceptor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGN,KAAK,kBAAkB,EACvB,MAAM,0CAA0C,CAAC;AAGlD,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AACvD,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAK7D;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,EAAE,kBAItC,CAAC"}
@@ -1,16 +1,16 @@
1
1
  import { RequestInterceptor } from '@conduit-client/service-fetch-network/v1';
2
2
  import { CsrfTokenManager } from './token-manager';
3
3
  export interface HeaderInterceptorConfig {
4
- /** URLs that require CSRF tokens on mutating methods (POST, PUT, PATCH, DELETE). */
4
+ /** The URLs that require a CSRF token on mutating methods: POST, PUT, PATCH, and DELETE. */
5
5
  protectedUrls?: string[];
6
6
  /**
7
- * URLs that require CSRF tokens on all methods including GET.
8
- * Use for endpoints that are sensitive regardless of HTTP method (e.g. Apex REST).
7
+ * The URLs that require a CSRF token on every method, including GET.
8
+ * Use this for endpoints that are sensitive regardless of the HTTP method, for example Apex REST.
9
9
  */
10
10
  alwaysProtectedUrls?: string[];
11
11
  }
12
12
  /**
13
- * Builds a configured interceptor for applying CSRF header to requests
13
+ * Builds an interceptor that adds a CSRF token header to protected requests.
14
14
  *
15
15
  * @param csrfTokenManager
16
16
  * @param config
@@ -1 +1 @@
1
- {"version":3,"file":"header.interceptor.d.ts","sourceRoot":"","sources":["../../../../src/data/webapp/csrf/header.interceptor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGN,KAAK,kBAAkB,EACvB,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxD,MAAM,WAAW,uBAAuB;IACvC,oFAAoF;IACpF,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC/B,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,GAAE,uBAA4B,GAClC,kBAAkB,CAuBpB"}
1
+ {"version":3,"file":"header.interceptor.d.ts","sourceRoot":"","sources":["../../../../src/data/webapp/csrf/header.interceptor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGN,KAAK,kBAAkB,EACvB,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxD,MAAM,WAAW,uBAAuB;IACvC,4FAA4F;IAC5F,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC/B,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,GAAE,uBAA4B,GAClC,kBAAkB,CAuBpB"}
@@ -1,30 +1,31 @@
1
1
  import { RetryPolicy, RetryContext } from '@conduit-client/service-retry/v1';
2
2
  import { CsrfTokenManager } from './token-manager';
3
3
  /**
4
- * Retry policy that handles CSRF token expiration errors.
5
- *
6
- * When a request fails with a CSRF token error this policy will:
7
- * 1. Detect the error condition in shouldRetry
8
- * 2. Refresh the CSRF token in prepareRetry hook
9
- * 3. Retry the request once (maxRetries = 1)
4
+ * Retries a request once when it fails because of an expired CSRF token.
10
5
  *
6
+ * @remarks
7
+ * When a request fails with a CSRF token error, this policy:
8
+ * 1. Detects the error in `shouldRetry`.
9
+ * 2. Refreshes the CSRF token in the `prepareRetry` hook.
10
+ * 3. Retries the request once (`maxRetries = 1`).
11
11
  */
12
12
  export declare class CsrfTokenRetryPolicy extends RetryPolicy<Response> {
13
13
  private csrfTokenManager;
14
14
  constructor(csrfTokenManager: CsrfTokenManager);
15
15
  /**
16
- * Determines if a failed request should be retried due to CSRF token issues.
16
+ * Returns true when a CSRF token issue caused the request to fail.
17
17
  */
18
18
  shouldRetry(result: Response, context: RetryContext<Response>): Promise<boolean>;
19
19
  /**
20
- * CSRF token refresh should happen immediately with no delay.
20
+ * Returns zero, so the CSRF token refresh happens immediately with no added delay.
21
21
  */
22
22
  calculateDelay(_result: Response, _context: RetryContext<Response>): Promise<number>;
23
23
  /**
24
- * Called by retry service before each retry attempt.
24
+ * Refreshes the CSRF token before the retry service retries the request.
25
25
  *
26
- * @param _result - The failed response that triggered the retry (unused, already validated)
27
- * @param _context - Current retry context (unused but part of interface)
26
+ * @param _result - The failed response that triggered the retry. Unused; `shouldRetry`
27
+ * already validated it.
28
+ * @param _context - The current retry context. Unused, but required by the interface.
28
29
  */
29
30
  prepareRetry(_result: Response, _context: RetryContext<Response>): Promise<void>;
30
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"retry.policy.d.ts","sourceRoot":"","sources":["../../../../src/data/webapp/csrf/retry.policy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxD;;;;;;;;GAQG;AACH,qBAAa,oBAAqB,SAAQ,WAAW,CAAC,QAAQ,CAAC;IAClD,OAAO,CAAC,gBAAgB;gBAAhB,gBAAgB,EAAE,gBAAgB;IAKtD;;OAEG;IACG,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAUtF;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAI1F;;;;;OAKG;IACY,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAI/F"}
1
+ {"version":3,"file":"retry.policy.d.ts","sourceRoot":"","sources":["../../../../src/data/webapp/csrf/retry.policy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxD;;;;;;;;GAQG;AACH,qBAAa,oBAAqB,SAAQ,WAAW,CAAC,QAAQ,CAAC;IAClD,OAAO,CAAC,gBAAgB;gBAAhB,gBAAgB,EAAE,gBAAgB;IAKtD;;OAEG;IACG,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAUtF;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAI1F;;;;;;OAMG;IACY,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAI/F"}
@@ -4,8 +4,10 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
  /**
7
- * Manages CSRF token fetching and caching for secure requests.
8
- * Implements a singleton pattern to ensure consistent token management across the application.
7
+ * Fetches and caches a CSRF token for secure requests.
8
+ *
9
+ * @remarks
10
+ * This class uses a singleton pattern, so token management stays consistent across the app.
9
11
  */
10
12
  declare class CsrfTokenManager {
11
13
  private endpoint;
@@ -14,27 +16,31 @@ declare class CsrfTokenManager {
14
16
  private refreshPromise;
15
17
  constructor(endpoint: string, cacheName?: string | undefined);
16
18
  /**
17
- * Returns the current token value as a Promise.
18
- * Lazy-loads the token on first call (from cache or by fetching).
19
+ * Returns the current CSRF token.
20
+ *
21
+ * @remarks
22
+ * The first call loads the token lazily, either from the cache or with a fetch request.
19
23
  */
20
24
  getToken(): Promise<string>;
21
25
  /**
22
- * Obtains and returns a new token value as a promise.
23
- * This will clear the cached token and fetch a fresh one.
24
- * If a refresh is already in progress, all callers share the same in-flight promise.
26
+ * Clears the cached CSRF token and fetches a fresh one.
27
+ *
28
+ * @remarks
29
+ * The returned promise resolves to the new token. When a refresh is already in progress,
30
+ * every caller shares the same in-flight promise.
25
31
  */
26
32
  refreshToken(): Promise<string | undefined>;
27
33
  /**
28
- * Obtains a CSRF token, using cache when available or fetching a new one.
34
+ * Returns a CSRF token from the cache, or fetches a new one when the cache has none.
29
35
  *
30
- * @returns Promise that resolves to the CSRF token string
36
+ * @returns The CSRF token.
31
37
  */
32
38
  private obtainToken;
33
39
  /**
34
- * Provides a safe way to interact with the Cache API with fallback for unsupported environments.
40
+ * Runs a callback against the Cache API, and returns `undefined` when the API is unavailable.
35
41
  *
36
- * @param callback - Function that receives the cache instance and returns a promise
37
- * @returns The result of the callback, or undefined if caches API is not available
42
+ * @param callback - The function that receives the cache instance and returns a promise.
43
+ * @returns The result of the callback, or `undefined` when the Cache API is not available.
38
44
  */
39
45
  private withCache;
40
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"token-manager.d.ts","sourceRoot":"","sources":["../../../../src/data/webapp/csrf/token-manager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,cAAM,gBAAgB;IAKpB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,SAAS,CAAC;IALnB,OAAO,CAAC,YAAY,CAAkB;IACtC,OAAO,CAAC,cAAc,CAA8B;gBAG3C,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,YAAA;IAK3B;;;OAGG;IACG,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;IAIjC;;;;OAIG;IACH,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAmB3C;;;;OAIG;YACW,WAAW;IAsBzB;;;;;OAKG;YACW,SAAS;CASvB;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"token-manager.d.ts","sourceRoot":"","sources":["../../../../src/data/webapp/csrf/token-manager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,cAAM,gBAAgB;IAKpB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,SAAS,CAAC;IALnB,OAAO,CAAC,YAAY,CAAkB;IACtC,OAAO,CAAC,cAAc,CAA8B;gBAG3C,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,YAAA;IAK3B;;;;;OAKG;IACG,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;IAIjC;;;;;;OAMG;IACH,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAmB3C;;;;OAIG;YACW,WAAW;IAuBzB;;;;;OAKG;YACW,SAAS;CASvB;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -9,18 +9,22 @@ export interface FetchConfig {
9
9
  csrf: CsrfConfig;
10
10
  }
11
11
  /**
12
- * Module-level registry so all SDK instances sharing the same CSRF endpoint
13
- * share one CsrfTokenManager — one tokenPromise, one network fetch per lifecycle.
14
- * Exported for test isolation only; not part of the public API.
12
+ * The module-level registry that lets SDK instances sharing a CSRF endpoint share one
13
+ * `CsrfTokenManager` — one token promise and one network fetch per lifecycle.
14
+ *
15
+ * @remarks
16
+ * Exported only for test isolation. It is not part of the public API.
15
17
  */
16
18
  export declare const tokenManagerRegistry: Map<string, CsrfTokenManager>;
17
19
  /**
18
- * Creates an enhanced fetch function with automatic CSRF token handling.
19
- * The returned function automatically adds CSRF tokens to protected requests
20
- * and handles token refresh when tokens become invalid.
20
+ * Creates a fetch function that handles CSRF tokens automatically.
21
+ *
22
+ * @remarks
23
+ * The returned function adds a CSRF token to protected requests, and refreshes the token
24
+ * when it becomes invalid.
21
25
  *
22
- * @param config - Optional configuration for CSRF handling
23
- * @returns An enhanced fetch function that handles CSRF protection
26
+ * @param config - The configuration for CSRF handling.
27
+ * @returns A fetch function that handles CSRF protection.
24
28
  */
25
29
  export declare function createFetchService(config: FetchConfig): FetchService;
26
30
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/data/webapp/fetch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEN,KAAK,YAAY,EACjB,MAAM,0CAA0C,CAAC;AAIlD,OAAO,EAEN,KAAK,sBAAsB,EAC3B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,UAAU,UAAW,SAAQ,sBAAsB;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,UAAU,CAAC;CACjB;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,+BAAsC,CAAC;AAExE;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,YAAY,CAgBpE"}
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/data/webapp/fetch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEN,KAAK,YAAY,EACjB,MAAM,0CAA0C,CAAC;AAIlD,OAAO,EAEN,KAAK,sBAAsB,EAC3B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,UAAU,UAAW,SAAQ,sBAAsB;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,UAAU,CAAC;CACjB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,+BAAsC,CAAC;AAExE;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,YAAY,CAgBpE"}
@@ -1,7 +1,7 @@
1
1
  import { DataSDK, DataSDKGraphQL } from '../../core';
2
2
  import { WebAppDataSDKOptions } from '../index';
3
3
  /**
4
- * Data SDK implementation for web apps, which is based on making `fetch` calls to REST endpoints
4
+ * A `DataSDK` implementation for web apps that makes `fetch` calls to REST endpoints.
5
5
  */
6
6
  export declare class WebAppDataSDK implements DataSDK {
7
7
  private readonly baseUrl;
@@ -13,15 +13,20 @@ export declare class WebAppDataSDK implements DataSDK {
13
13
  constructor(options?: WebAppDataSDKOptions);
14
14
  fetch(input: string | URL | Request, init?: RequestInit): Promise<Response>;
15
15
  /**
16
- * Raw GraphQL POST. On the WebApp surface this is the mutate-only path:
17
- * `graphql.mutate` calls it directly. The `graphql.query` (cache) path does
18
- * NOT route through here — the OneStore cache command in `@conduit-client`
19
- * issues its own fetch and parses the response itself.
16
+ * Sends a raw GraphQL POST request.
17
+ *
18
+ * @remarks
19
+ * On the WebApp surface, this is the mutate-only path: `graphql.mutate` calls this method
20
+ * directly. The `graphql.query` (cache) path does not route through this method. The OneStore
21
+ * cache command in `@conduit-client` issues its own fetch and parses the response itself.
20
22
  */
21
23
  private executeRawGraphQL;
22
24
  /**
23
- * If the url is relative, convert to it to an absolute Salesforce URL. This is due to the way Code
24
- * Builder deployments structure the url for Salesforce
25
+ * Converts a relative URL to an absolute Salesforce URL.
26
+ *
27
+ * @remarks
28
+ * Code Builder deployments need this conversion, because they structure Salesforce URLs
29
+ * differently.
25
30
  */
26
31
  private applySalesforceBase;
27
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/webapp/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,YAAY,CAAC;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAWrD;;GAEG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyD;IAClF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;gBAErB,OAAO,CAAC,EAAE,oBAAoB;IAmCpC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IAUjF;;;;;OAKG;YACW,iBAAiB;IAgB/B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;CAa3B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/webapp/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,YAAY,CAAC;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAYrD;;GAEG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyD;IAClF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;gBAErB,OAAO,CAAC,EAAE,oBAAoB;IAmCpC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IAUjF;;;;;;;OAOG;YACW,iBAAiB;IAgB/B;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB;CAa3B"}
@@ -1,11 +1,12 @@
1
1
  import { I18nContext } from './salesforce-detector';
2
2
  /**
3
- * Locale-aware formatting functions bound to a single {@link I18nContext}.
3
+ * A set of locale-aware formatting functions for a single {@link I18nContext}.
4
4
  *
5
- * Each function wraps a built-in `Intl` formatter constructed from the
6
- * context's locale (plus, where relevant, its currency and time zone).
7
- * Callers can override any default by passing their own options: the
8
- * context-derived defaults are merged first, so caller options always win.
5
+ * @remarks
6
+ * Each function wraps an `Intl` formatter built from the context's locale,
7
+ * with its currency and time zone where relevant. Callers can override any
8
+ * default with their own options. The context-derived defaults merge first,
9
+ * so a caller's options always win.
9
10
  */
10
11
  export interface I18nFormatters {
11
12
  formatDate(value: Date | number, options?: Intl.DateTimeFormatOptions): string;
@@ -13,25 +14,26 @@ export interface I18nFormatters {
13
14
  formatCurrency(value: number, options?: Intl.NumberFormatOptions): string;
14
15
  }
15
16
  /**
16
- * Build a set of locale-aware formatters bound to the given {@link I18nContext}.
17
+ * Creates a set of locale-aware formatters for the given {@link I18nContext}.
17
18
  *
18
- * This factory is pure and synchronous: it takes an already-fetched context
19
- * rather than fetching one itself, so it never imports `DataSDK` or calls
20
- * `fetchI18nContext`. This mirrors the factory shape of
21
- * `createSalesforceDetector` and keeps the returned formatters trivially
22
- * unit-testable with a plain `I18nContext` fixture.
19
+ * @remarks
20
+ * This factory is pure and synchronous. It takes an already-fetched context
21
+ * instead of fetching one itself, so it never imports `DataSDK` or calls
22
+ * `fetchI18nContext`. This design matches the factory shape of
23
+ * `createSalesforceDetector`, and it keeps the returned formatters easy to
24
+ * unit-test with a plain `I18nContext` fixture.
23
25
  *
24
- * The formatters are built from `ctx.locale`, the formatting axis, not
25
- * `ctx.lang`, the translation axis. The platform i18n context returns
26
- * `locale` as a BCP 47 tag (for example `"en-US"` or `"en-GB"`), which `Intl`
27
- * accepts directly. Using `locale` rather than `lang` is deliberate: a user
28
- * can share a language but differ in locale (for example `lang: "en"` with
29
- * `locale: "en-GB"`), and only `locale` carries the region that decides date
30
- * order and digit grouping.
26
+ * The formatters use `ctx.locale`, the formatting axis, not `ctx.lang`, the
27
+ * translation axis. The platform i18n context returns `locale` as a BCP 47
28
+ * tag, for example `"en-US"` or `"en-GB"`, and `Intl` accepts this tag
29
+ * directly. This function uses `locale` instead of `lang` on purpose: a user
30
+ * can share a language but use a different locale, for example `lang: "en"`
31
+ * with `locale: "en-GB"`. Only `locale` carries the region that decides the
32
+ * date order and digit grouping.
31
33
  *
32
- * @param ctx the resolved i18n context to format against (locale, currency,
33
- * and time zone are read from it as defaults)
34
- * @returns an {@link I18nFormatters} bound to `ctx`
34
+ * @param ctx - The resolved i18n context to format against. Its locale,
35
+ * currency, and time zone become the default values.
36
+ * @returns An {@link I18nFormatters} bound to `ctx`.
35
37
  */
36
38
  export declare function createI18nFormatters(ctx: I18nContext): I18nFormatters;
37
39
  //# sourceMappingURL=locale-format.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"locale-format.d.ts","sourceRoot":"","sources":["../../src/i18n/locale-format.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC9B,UAAU,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAC;IAC/E,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC;IACxE,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC;CAC1E;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,WAAW,GAAG,cAAc,CAkDrE"}
1
+ {"version":3,"file":"locale-format.d.ts","sourceRoot":"","sources":["../../src/i18n/locale-format.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC9B,UAAU,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAC;IAC/E,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC;IACxE,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC;CAC1E;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,WAAW,GAAG,cAAc,CAuDrE"}
@@ -1,23 +1,31 @@
1
1
  import { DataSDK } from '../core';
2
2
  /**
3
- * How the server resolves a label with no translation for the requested locale.
4
- * `BASE_VALUE` returns the org-default (base) value; `USER_DEFAULT` returns the
5
- * logged-in user's language first; `NONE` returns nothing.
3
+ * How the server resolves a label that has no translation for the requested
4
+ * locale.
5
+ *
6
+ * @remarks
7
+ * - `BASE_VALUE` returns the org-default (base) value.
8
+ * - `USER_DEFAULT` returns the current user's language first.
9
+ * - `NONE` returns nothing.
6
10
  */
7
11
  export type LabelFallback = "BASE_VALUE" | "USER_DEFAULT" | "NONE";
8
12
  export interface SalesforceBackendOptions {
9
13
  dataSDK: DataSDK;
10
14
  labelManifest?: string[];
11
15
  /**
12
- * Fallback strategy for labels with no translation for the requested locale.
13
- * Defaults to `BASE_VALUE`. Pass `USER_DEFAULT` for the server's old behavior
14
- * (prefer the user's language), for example on a guest / b2c site. Pass `NONE`
15
- * to suppress fallback entirely: a label with no matching translation is then
16
- * absent from the result map.
16
+ * The fallback strategy for a label with no translation for the requested
17
+ * locale. Defaults to `BASE_VALUE`.
17
18
  *
18
- * Note: the GraphQL `labels()` server default is `USER_DEFAULT`; this SDK opts
19
- * into `BASE_VALUE` because it resolves an explicit target locale, so direct
20
- * GraphQL callers and the SDK intentionally differ on the default.
19
+ * @remarks
20
+ * Pass `USER_DEFAULT` for the server's old behavior, which prefers the
21
+ * current user's language, for example on a guest or B2C site. Pass
22
+ * `NONE` to turn off fallback entirely. A label with no matching
23
+ * translation is then absent from the result map.
24
+ *
25
+ * The GraphQL `labels()` query defaults to `USER_DEFAULT` on the server.
26
+ * This SDK uses `BASE_VALUE` instead, because it resolves an explicit
27
+ * target locale. So direct GraphQL callers and this SDK intentionally use
28
+ * different defaults.
21
29
  */
22
30
  labelFallback?: LabelFallback;
23
31
  }
@@ -1 +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;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,cAAc,GAAG,MAAM,CAAC;AASnE,MAAM,WAAW,wBAAwB;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB;;;;;;;;;;OAUG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;CAC9B;AAeD,KAAK,YAAY,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,KAAK,KAAK,IAAI,CAAC;AA0CjF,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;YA2BV,UAAU;CA4BxB"}
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;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,cAAc,GAAG,MAAM,CAAC;AASnE,MAAM,WAAW,wBAAwB;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB;;;;;;;;;;;;;;OAcG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;CAC9B;AAeD,KAAK,YAAY,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,KAAK,KAAK,IAAI,CAAC;AA0CjF,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;YA4BV,UAAU;CA4BxB"}
@@ -1,9 +1,12 @@
1
1
  import { DataSDK } from '../core';
2
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.
3
+ * The subset of the `i18next` `LanguageDetectorModule` contract that this
4
+ * detector implements.
5
+ *
6
+ * @remarks
7
+ * This interface is declared locally so `platform-sdk` does not depend on
8
+ * `i18next`. The returned object is structurally compatible with
9
+ * `i18next`'s `.use()` plugin slot.
7
10
  */
8
11
  interface LanguageDetectorModule {
9
12
  type: "languageDetector";
@@ -18,18 +21,23 @@ export interface I18nContext {
18
21
  }
19
22
  export declare function fetchI18nContext(dataSDK: DataSDK): Promise<I18nContext>;
20
23
  /**
21
- * Reload the cached i18n context: clear the memoized value and immediately
22
- * re-query the platform, resolving to the fresh context.
24
+ * Reloads the cached i18n context.
25
+ *
26
+ * @remarks
27
+ * This function clears the memoized value, then immediately queries the
28
+ * platform again and resolves to the fresh context.
23
29
  *
24
- * The context is fetched once and memoized for the lifetime of the page, so a
25
- * locale change normally only takes effect on a full page reload. Call this
26
- * after an in-session locale change: clearing and re-fetching are a single
27
- * operation, so a caller cannot clear the cache and then forget to refill it.
30
+ * The context is fetched once and memoized for the life of the page. A
31
+ * locale change therefore only takes effect after a full page reload. Call
32
+ * this function after a locale change within the session. Clearing and
33
+ * re-fetching happen as a single operation, so a caller cannot clear the
34
+ * cache and then forget to refill it.
28
35
  *
29
- * The cache is cleared before the re-query runs, so if the re-query fails the
30
- * returned promise rejects and the cache is left empty — `detect()` reverts to
31
- * `undefined` until a later successful fetch. Callers should handle rejection
32
- * rather than assume a reload always repopulates.
36
+ * This function clears the cache before it re-queries the platform. So if
37
+ * the re-query fails, the returned promise rejects and the cache stays
38
+ * empty. `detect()` then reverts to `undefined` until a later successful
39
+ * fetch. Callers should handle the rejection rather than assume that a
40
+ * reload always fills the cache again.
33
41
  */
34
42
  export declare function reloadI18nContext(dataSDK: DataSDK): Promise<I18nContext>;
35
43
  export declare function createSalesforceDetector(_dataSDK: DataSDK): LanguageDetectorModule;
@@ -1 +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;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAG9E;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,OAAO,GAAG,sBAAsB,CAQlF"}
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;;;;;;;;GAQG;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;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAG9E;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,OAAO,GAAG,sBAAsB,CAQlF"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
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
- import { g as c } from "./capabilities-CKe8z6kZ.js";
1
+ import { M as t, a, S as p, g as s, i as o, b as i, r as S } from "./surface-DWDgqdpN.js";
2
+ import { g as c } from "./capabilities-B0mU0_G0.js";
3
3
  import { w as D } from "./sdk-promise-D0sy7OW1.js";
4
4
  import { MCPAppsChatSDK as n, createChatSDK as K, getChatSDK as l, getChatSDKSync as x, resetChatSDK as A } from "./chat/index.js";
5
5
  import { MCPAppsViewSDK as d, createViewSDK as w, getViewSDK as T, getViewSDKSync as h, resetViewSDK as u } from "./view/index.js";
@@ -8,7 +8,7 @@ import { createLightningSDK as E } from "./lightning/index.js";
8
8
  import { WebAppCurrentApp as I, getCurrentApp as U } from "./app/index.js";
9
9
  import { c as q } from "./transport-D9QstWle.js";
10
10
  import { T as F, r as L } from "./TelemetryUploader-DKkdppe9.js";
11
- import { P as W, c as Y, v as j } from "./analytics-Dpz22kda.js";
11
+ import { P as W, c as Y, v as j } from "./analytics-wESbWdca.js";
12
12
  export {
13
13
  n as MCPAppsChatSDK,
14
14
  d as MCPAppsViewSDK,
@@ -1 +1 @@
1
- {"version":3,"file":"embedding.d.ts","sourceRoot":"","sources":["../../src/lightning/embedding.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAM5C,qBAAa,qBAAsB,YAAW,YAAY;IAOrC,OAAO,CAAC,QAAQ,CAAC,OAAO;WAN/B,MAAM,IAAI,OAAO,CAAC,qBAAqB,CAAC;IAMrD,OAAO;CACP"}
1
+ {"version":3,"file":"embedding.d.ts","sourceRoot":"","sources":["../../src/lightning/embedding.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAO5C,qBAAa,qBAAsB,YAAW,YAAY;IAOrC,OAAO,CAAC,QAAQ,CAAC,OAAO;WAN/B,MAAM,IAAI,OAAO,CAAC,qBAAqB,CAAC;IAMrD,OAAO;CACP"}
@@ -1,14 +1,14 @@
1
1
  import { LightningSDK, SDKOptions } from '../core';
2
2
  /**
3
- * Options for creating a LightningSDK instance.
3
+ * Options for creating a `LightningSDK` instance.
4
4
  */
5
5
  export interface LightningSDKOptions extends SDKOptions {
6
6
  }
7
7
  /**
8
- * Create and initialize a LightningSDK instance based on the detected surface
8
+ * Creates and initializes a `LightningSDK` instance for the detected surface.
9
9
  *
10
- * @param options - Optional configuration including surface override
11
- * @returns Promise resolving to an initialized LightningSDK instance
10
+ * @param options - Configuration for the SDK, including a surface override.
11
+ * @returns An initialized `LightningSDK` instance.
12
12
  */
13
13
  export declare function createLightningSDK(options?: LightningSDKOptions): Promise<LightningSDK>;
14
14
  export type { LightningSDK, SDKOptions } from '../core';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lightning/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGxD;;GAEG;AAEH,MAAM,WAAW,mBAAoB,SAAQ,UAAU;CAAG;AAE1D;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC,CA4BvF;AAED,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lightning/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGxD;;GAEG;AAEH,MAAM,WAAW,mBAAoB,SAAQ,UAAU;CAAG;AAE1D;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC,CA6BvF;AAED,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
@@ -1,8 +1,8 @@
1
- import { g as n, S as r } from "../surface-Dd2tqrPi.js";
1
+ import { g as n, S as r } from "../surface-DWDgqdpN.js";
2
2
  import { w as a } from "../sdk-promise-D0sy7OW1.js";
3
3
  import { requireSharedSession as c } from "../ui-embedding/session.js";
4
4
  class t {
5
- // @ts-expect-error TS6138: `session` is unread until the first method body lands
5
+ // @ts-expect-error TS6138: `session` stays unread until the first method body lands
6
6
  constructor(e) {
7
7
  this.session = e;
8
8
  }