@salesforce/ui-bundle 12.8.0 → 12.9.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.
@@ -24,10 +24,10 @@ export interface Account {
24
24
  } | null;
25
25
  }
26
26
  /**
27
- * Fetch accounts with annual revenue greater than the specified amount
27
+ * Fetches the accounts whose annual revenue is greater than a given amount.
28
28
  *
29
- * @param variables - Query variables including minRevenue threshold
30
- * @returns Array of accounts matching the criteria
29
+ * @param variables - The query variables, including the `minRevenue` threshold.
30
+ * @returns An array of the accounts that match the threshold.
31
31
  */
32
32
  export declare function getHighRevenueAccounts(variables: GetHighRevenueAccountsVariables): Promise<(Account | null | undefined)[]>;
33
33
  //# sourceMappingURL=accounts.d.ts.map
@@ -8,14 +8,20 @@ interface User {
8
8
  name: string;
9
9
  }
10
10
  /**
11
- * Fetch current user information from Salesforce via UI API GraphQL.
12
- * Guest (unauthenticated) sessions also resolve to a running user record on
13
- * the platform, so guests are filtered out here rather than relying on a
14
- * fetch failure to signal "not logged in". UserType is intentionally NOT
15
- * @optional in the query, but a missing/null/empty value in the response is
16
- * still treated as an error rather than assumed non-guest, since that's an
17
- * unexpected shape we can't safely authenticate against.
18
- * @returns User info or null if no session (or a guest session)
11
+ * Fetches the current user from Salesforce with a UI API GraphQL query.
12
+ *
13
+ * @remarks
14
+ * A guest (unauthenticated) session also resolves to a running user record on the
15
+ * platform. This function therefore filters out guests directly, and does not rely on a
16
+ * failed fetch to show that no user is logged in.
17
+ *
18
+ * The query does not mark `UserType` as `@optional` on purpose. If the response has a
19
+ * missing, null, or empty `UserType`, this function throws an error rather than treat the
20
+ * user as a non-guest, because that response shape is unexpected and the function cannot
21
+ * safely authenticate against it.
22
+ *
23
+ * @returns The user's information, or `null` when there is no active session or the
24
+ * session is a guest session.
19
25
  */
20
26
  export declare function getCurrentUser(): Promise<User | null>;
21
27
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/api/utils/user.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,UAAU,IAAI;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACb;AA4BD;;;;;;;;;GASG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAuC3D"}
1
+ {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/api/utils/user.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,UAAU,IAAI;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACb;AA4BD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAuC3D"}
@@ -4,24 +4,28 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
  /**
7
- * Deployment target for a full UI Bundle web app. Declares where the bundle
8
- * surfaces in Salesforce; drives the `<target>` of the generated
7
+ * The deployment target for a full UI Bundle web app. Declares where the bundle
8
+ * appears in Salesforce, and drives the `<target>` element of the generated
9
9
  * `*.uibundle-meta.xml` (and any companion metadata).
10
10
  *
11
- * NOTE: This is a BUILD-TIME concept, not a field of the deployed
12
- * `ui-bundle.json` manifest. The platform's manifest schema only accepts
13
- * `outputDir`, `routing`, and `headers`; declaring `target` in the manifest
14
- * makes the bundle fail deploy with InvalidUiBundleConfigError. The target is
15
- * therefore supplied to the build (see the vite plugin's `generateMetaXml`
16
- * option) and emitted into the `*.uibundle-meta.xml`, which is the metadata
17
- * artifact the platform actually reads for targets.
11
+ * @remarks
12
+ * This is a build-time concept, not a field of the deployed `ui-bundle.json`
13
+ * manifest. The platform's manifest schema accepts only `outputDir`, `routing`,
14
+ * and `headers`. If you declare `target` in the manifest, the bundle fails to
15
+ * deploy with `InvalidUiBundleConfigError`.
18
16
  *
19
- * - `Experience` — surfaced through an Experience Site (site-container metadata).
20
- * - `CustomApplication` — surfaced as a Lightning Custom Application.
21
- * - `AppLauncher` — reachable from the Lightning App Launcher. This is a
22
- * convenience alias: App Launcher visibility is provided by a Custom
23
- * Application, so it maps to the same `CustomApplication` bundle target plus
24
- * the companion app + permission-set metadata.
17
+ * You therefore supply the target to the build (see the Vite plugin's
18
+ * `generateMetaXml` option). The build emits the target into the
19
+ * `*.uibundle-meta.xml`, which is the metadata artifact that the platform reads
20
+ * for targets.
21
+ *
22
+ * The target values are:
23
+ * - `Experience` — the bundle appears through an Experience Site (site-container metadata).
24
+ * - `CustomApplication` — the bundle appears as a Lightning Custom Application.
25
+ * - `AppLauncher` — the bundle is reachable from the Lightning App Launcher. This
26
+ * value is a convenience alias. A Custom Application provides App Launcher
27
+ * visibility, so `AppLauncher` maps to the same `CustomApplication` bundle
28
+ * target, plus the companion app and permission-set metadata.
25
29
  */
26
30
  export type UIBundleTarget = "Experience" | "CustomApplication" | "AppLauncher";
27
31
  export interface UIBundleManifest {
@@ -31,12 +35,15 @@ export interface UIBundleManifest {
31
35
  }
32
36
  export declare const UI_BUNDLE_TARGETS: readonly UIBundleTarget[];
33
37
  /**
34
- * Resolve a build-time target to the value emitted in the `*.uibundle-meta.xml`
35
- * `<target>` element. `AppLauncher` is an alias that maps to `CustomApplication`
36
- * (App Launcher visibility is provided by a Custom Application).
38
+ * Resolves a build-time target to the value that the build emits in the
39
+ * `<target>` element of the `*.uibundle-meta.xml`.
40
+ *
41
+ * @remarks
42
+ * `AppLauncher` is an alias for `CustomApplication`, because a Custom Application
43
+ * provides App Launcher visibility.
37
44
  *
38
- * @param target - The build-time target
39
- * @returns The `<target>` value for the UIBundle metadata, or undefined for none
45
+ * @param target - The build-time target.
46
+ * @returns The `<target>` value for the UIBundle metadata, or `undefined` when there is none.
40
47
  */
41
48
  export declare function resolveMetaTarget(target?: UIBundleTarget): "Experience" | "CustomApplication" | undefined;
42
49
  export interface RoutingConfig {
@@ -55,11 +62,11 @@ export interface RedirectRule {
55
62
  statusCode: 301 | 302 | 307 | 308;
56
63
  }
57
64
  /**
58
- * Load and parse UI Bundle manifest (ui-bundle.json)
65
+ * Loads and parses a UI Bundle manifest (ui-bundle.json).
59
66
  *
60
- * @param manifestPath - Path to the ui-bundle.json file
61
- * @returns Promise resolving to the parsed manifest
62
- * @throws Error if manifest file not found or validation fails
67
+ * @param manifestPath - The path to the ui-bundle.json file.
68
+ * @returns The parsed manifest.
69
+ * @throws {Error} When the manifest file is not found, or validation fails.
63
70
  */
64
71
  export declare function loadManifest(manifestPath: string): Promise<UIBundleManifest>;
65
72
  //# sourceMappingURL=manifest.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/app/manifest.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,mBAAmB,GAAG,aAAa,CAAC;AAIhF,MAAM,WAAW,gBAAgB;IAEhC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,SAAS,EAAE,MAAM,CAAC;IAElB,OAAO,CAAC,EAAE,aAAa,CAAC;CACxB;AAGD,eAAO,MAAM,iBAAiB,EAAE,SAAS,cAAc,EAItD,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAChC,MAAM,CAAC,EAAE,cAAc,GACrB,YAAY,GAAG,mBAAmB,GAAG,SAAS,CAQhD;AAGD,MAAM,WAAW,aAAa;IAE7B,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IAEzB,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;IAE3B,aAAa,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IAE5C,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,WAAW,WAAW;IAE3B,KAAK,EAAE,MAAM,CAAC;IAEd,MAAM,EAAE,MAAM,CAAC;CACf;AAGD,MAAM,WAAW,YAAY;IAE5B,KAAK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B,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAclF"}
@@ -1,5 +1,5 @@
1
1
  import { UIBundleManifest, UIBundleTarget } from './manifest';
2
- /** Options for generating a UIBundle meta XML. */
2
+ /** The options for generating a UIBundle meta XML file. */
3
3
  export interface MetaXmlOptions {
4
4
  target?: UIBundleTarget;
5
5
  masterLabel?: string;
@@ -8,15 +8,17 @@ export interface MetaXmlOptions {
8
8
  version?: number;
9
9
  }
10
10
  /**
11
- * Generate the contents of a `*.uibundle-meta.xml` file. The `target` option
12
- * drives the `<target>` element (see {@link resolveMetaTarget}); `AppLauncher`
13
- * resolves to `CustomApplication`. The manifest supplies the default master
14
- * label (via `manifest.name`).
11
+ * Generates the contents of a `*.uibundle-meta.xml` file.
15
12
  *
16
- * @param manifest - The parsed ui-bundle.json manifest (for the name fallback)
17
- * @param bundleName - The bundle's developer name (used as the default label)
18
- * @param options - Target + optional overrides (label, description, isActive, version)
19
- * @returns The XML document text for the `*.uibundle-meta.xml` file
13
+ * @remarks
14
+ * The `target` option drives the `<target>` element (see {@link resolveMetaTarget}).
15
+ * `AppLauncher` resolves to `CustomApplication`. The manifest supplies the default
16
+ * master label through `manifest.name`.
17
+ *
18
+ * @param manifest - The parsed ui-bundle.json manifest. Supplies the name fallback.
19
+ * @param bundleName - The bundle's developer name. Used as the default label.
20
+ * @param options - The target and optional overrides (label, description, isActive, version).
21
+ * @returns The XML document text for the `*.uibundle-meta.xml` file.
20
22
  */
21
23
  export declare function generateUIBundleMetaXml(manifest: UIBundleManifest, bundleName: string, options?: MetaXmlOptions): string;
22
24
  //# sourceMappingURL=meta-xml.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"meta-xml.d.ts","sourceRoot":"","sources":["../../src/app/meta-xml.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAqB,MAAM,YAAY,CAAC;AAc3F,kDAAkD;AAClD,MAAM,WAAW,cAAc;IAI9B,MAAM,CAAC,EAAE,cAAc,CAAC;IAExB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACtC,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,cAAmB,GAC1B,MAAM,CA0BR"}
1
+ {"version":3,"file":"meta-xml.d.ts","sourceRoot":"","sources":["../../src/app/meta-xml.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAqB,MAAM,YAAY,CAAC;AAc3F,2DAA2D;AAC3D,MAAM,WAAW,cAAc;IAI9B,MAAM,CAAC,EAAE,cAAc,CAAC;IAExB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CACtC,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,cAAmB,GAC1B,MAAM,CA0BR"}
package/dist/app/org.d.ts CHANGED
@@ -13,16 +13,16 @@ export interface OrgInfo {
13
13
  orgAlias?: string;
14
14
  }
15
15
  /**
16
- * Get Salesforce org info and authentication details
16
+ * Gets the Salesforce org information and authentication details.
17
17
  *
18
- * @param orgAlias - Optional org alias or username, uses default org if not provided
19
- * @returns Promise resolving to org info or null if authentication fails
18
+ * @param orgAlias - The org alias or username. Uses the default org when you omit it.
19
+ * @returns The org information, or `undefined` when authentication fails.
20
20
  */
21
21
  export declare function getOrgInfo(orgAlias?: string): Promise<OrgInfo | undefined>;
22
22
  /**
23
- * Refresh Salesforce org authentication
23
+ * Refreshes the authentication for a Salesforce org.
24
24
  *
25
- * @param orgAlias
25
+ * @param orgAlias - The org alias or username to refresh.
26
26
  */
27
27
  export declare function refreshOrgAuth(orgAlias: string): Promise<OrgInfo | undefined>;
28
28
  //# sourceMappingURL=org.d.ts.map
@@ -1,4 +1,4 @@
1
- const version = "12.8.0";
1
+ const version = "12.9.0";
2
2
  export {
3
3
  version
4
4
  };
@@ -1,50 +1,50 @@
1
1
  import { IncomingMessage, ServerResponse } from 'node:http';
2
2
  import { OrgInfo, UIBundleManifest } from '../app/index';
3
- /**
4
- * URL parameter to trigger health check response
5
- */
3
+ /** The URL parameter that triggers the health-check response. */
6
4
  export declare const UIBUNDLE_HEALTH_CHECK_PARAM = "sfProxyHealthCheck";
7
- /**
8
- * Response header indicating the proxy is active
9
- */
5
+ /** The response header that indicates the proxy is active. */
10
6
  export declare const UIBUNDLE_PROXY_HEADER = "X-Salesforce-UIBundle-Proxy";
11
7
  /**
12
- * Configuration options for the UI Bundle proxy handler
8
+ * The configuration options for the UI Bundle proxy handler.
13
9
  */
14
10
  export interface ProxyOptions {
15
11
  debug?: boolean;
16
12
  onTokenRefresh?: (updatedOrgInfo: OrgInfo) => void;
17
13
  /**
18
- * UI-only preview mode. When true, the handler carries no org credential and
19
- * returns an explicit `403` (`ORG_DATA_DISABLED`) for every org-data route it
20
- * owns — the matched REST/GraphQL/file-upload routes, the Lightning Out
21
- * frontdoor, and the whole `${basePath}/services/*` surface (fail-closed, so
22
- * an endpoint `matchRoute` doesn't recognize is still blocked rather than
23
- * falling through) — while letting all other requests (shell, HMR, assets,
24
- * pure routing rewrites/redirects) fall through. Mirrors starting the dev
25
- * server without authenticating the SF CLI, but as a deliberate kill-switch
26
- * rather than a no-org error condition.
14
+ * UI-only preview mode.
15
+ *
16
+ * @remarks
17
+ * When `true`, the handler carries no org credential. It returns an explicit
18
+ * `403` (`ORG_DATA_DISABLED`) for every org-data route that it owns:
19
+ * - the matched REST, GraphQL, and file-upload routes;
20
+ * - the Lightning Out frontdoor;
21
+ * - the whole `${basePath}/services/*` surface. This surface is fail-closed, so
22
+ * the handler still blocks an endpoint that `matchRoute` does not recognize,
23
+ * rather than let the endpoint fall through.
24
+ *
25
+ * The handler lets all other requests fall through: the shell, HMR, assets, and
26
+ * pure routing rewrites and redirects. This mode mirrors a dev server that starts
27
+ * without an authenticated SF CLI, but it is a deliberate kill-switch rather than
28
+ * a no-org error condition.
27
29
  */
28
30
  uiOnly?: boolean;
29
31
  }
30
- /**
31
- * Proxy handler function type
32
- */
32
+ /** The proxy handler function type. */
33
33
  export type ProxyHandler = (req: IncomingMessage, res: ServerResponse, next?: () => void) => Promise<void>;
34
34
  /**
35
- * Create proxy request handler
35
+ * Creates a proxy request handler.
36
36
  *
37
- * @param manifest - UI Bundle manifest configuration
38
- * @param orgInfo - Salesforce org information
39
- * @param target - Target URL for dev server forwarding (optional)
40
- * @param basePath - Base path for routing (optional)
41
- * @param options - Proxy configuration options
42
- * @returns Async request handler function for Node.js HTTP server
37
+ * @param manifest - The UI Bundle manifest configuration.
38
+ * @param orgInfo - The Salesforce org information.
39
+ * @param target - The target URL for dev-server forwarding.
40
+ * @param basePath - The base path for routing.
41
+ * @param options - The proxy configuration options.
42
+ * @returns An async request handler function for a Node.js HTTP server.
43
43
  */
44
44
  export declare function createProxyHandler(manifest: UIBundleManifest, orgInfo?: OrgInfo, target?: string, basePath?: string, options?: ProxyOptions): ProxyHandler;
45
45
  /**
46
- * Inject Live Preview script into HTML content.
47
- * Used by the Vite plugin's transformIndexHtml hook and the standalone proxy's sendResponse.
46
+ * Injects the Live Preview script into HTML content. The Vite plugin's
47
+ * transformIndexHtml hook and the standalone proxy's sendResponse both use it.
48
48
  */
49
49
  export declare function injectLivePreviewScript(html: string): string;
50
50
  //# sourceMappingURL=handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/proxy/handler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAKjE,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAG9D;;GAEG;AACH,eAAO,MAAM,2BAA2B,uBAAuB,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,qBAAqB,gCAAgC,CAAC;AAyBnE;;GAEG;AACH,MAAM,WAAW,YAAY;IAE5B,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,cAAc,CAAC,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;IACnD;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAC1B,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,IAAI,CAAC,EAAE,MAAM,IAAI,KACb,OAAO,CAAC,IAAI,CAAC,CAAC;AA6xBnB;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CACjC,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,CAAC,EAAE,OAAO,EACjB,MAAM,CAAC,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,YAAY,GACpB,YAAY,CAGd;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5D"}
1
+ {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/proxy/handler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAKjE,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAG9D,iEAAiE;AACjE,eAAO,MAAM,2BAA2B,uBAAuB,CAAC;AAEhE,8DAA8D;AAC9D,eAAO,MAAM,qBAAqB,gCAAgC,CAAC;AAuBnE;;GAEG;AACH,MAAM,WAAW,YAAY;IAE5B,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,cAAc,CAAC,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;IACnD;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,uCAAuC;AACvC,MAAM,MAAM,YAAY,GAAG,CAC1B,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,IAAI,CAAC,EAAE,MAAM,IAAI,KACb,OAAO,CAAC,IAAI,CAAC,CAAC;AA4yBnB;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CACjC,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,CAAC,EAAE,OAAO,EACjB,MAAM,CAAC,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,YAAY,GACpB,YAAY,CAGd;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5D"}
@@ -270,7 +270,8 @@ class UIBundleProxyHandler {
270
270
  ...getFilteredHeaders(req.headers),
271
271
  Cookie: `sid=${orgInfo.accessToken}`,
272
272
  Accept: req.headers.accept ?? "application/json",
273
- // necessary for Apex requests, for which SessionUtil.validateSessionUsage won't accept OAuth token as `sid` cookie
273
+ // Apex requests need this header, because SessionUtil.validateSessionUsage does not
274
+ // accept the OAuth token as the `sid` cookie.
274
275
  Authorization: `Bearer ${orgInfo.accessToken}`
275
276
  }
276
277
  }));
@@ -414,8 +415,8 @@ class UIBundleProxyHandler {
414
415
  return html + scriptTag;
415
416
  }
416
417
  /**
417
- * Proxy POST /chatter/handlers/file/body (XHR/file upload) to Salesforce.
418
- * Uses rawInstanceUrl for Chatter API. Preserves multipart/form-data from XHR.
418
+ * Proxies POST /chatter/handlers/file/body (XHR or file upload) to Salesforce.
419
+ * Uses rawInstanceUrl for the Chatter API. Preserves multipart/form-data from XHR.
419
420
  */
420
421
  async handleFileUpload(req, res) {
421
422
  try {
@@ -491,8 +492,8 @@ class UIBundleProxyHandler {
491
492
  }
492
493
  }
493
494
  /**
494
- * Proxy CometD long-poll requests (/cometd/<version>) and shared worker scripts
495
- * (/jslibrary/<hash>/streaming-v2/CometdWorkerJs.js) to Salesforce using session cookies.
495
+ * Proxies CometD long-poll requests (/cometd/<version>) and shared worker scripts
496
+ * (/jslibrary/<hash>/streaming-v2/CometdWorkerJs.js) to Salesforce with session cookies.
496
497
  */
497
498
  async handleCometD(req, res, apiPath) {
498
499
  try {
@@ -4,18 +4,20 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
  /**
7
- * Returns the JavaScript source that gets injected into previewed UI Bundles.
8
- * Reads from templates/livePreviewScript.js at runtime (copied to dist/ by postbuild).
9
- * Cached after first read.
7
+ * Returns the JavaScript source that the proxy injects into previewed UI Bundles.
10
8
  *
11
- * Responsibilities:
12
- * - Fetch interceptor for network-error detection (runs synchronously on load)
13
- * - Runtime / compile / HMR error listeners
14
- * - Error deduplication
15
- * - postMessage bridge to the VS Code webview (when running inside an iframe)
16
- * - Copy / paste / right-click bridge for VS Code webview
9
+ * @remarks
10
+ * Reads from templates/livePreviewScript.js at runtime (the postbuild step copies it
11
+ * to dist/). Caches the source after the first read.
12
+ *
13
+ * The script has these responsibilities:
14
+ * - A fetch interceptor for network-error detection (runs synchronously on load).
15
+ * - Runtime, compile, and HMR error listeners.
16
+ * - Error deduplication.
17
+ * - A postMessage bridge to the VS Code webview (when the script runs inside an iframe).
18
+ * - A copy, paste, and right-click bridge for the VS Code webview.
17
19
  */
18
20
  export declare function getLivePreviewScriptContent(): string;
19
- /** Data attribute used to detect (and prevent) double injection. */
21
+ /** The data attribute that detects and prevents double injection. */
20
22
  export declare const LIVE_PREVIEW_SCRIPT_MARKER = "data-live-preview";
21
23
  //# sourceMappingURL=livePreviewScript.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"livePreviewScript.d.ts","sourceRoot":"","sources":["../../src/proxy/livePreviewScript.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,IAAI,MAAM,CAKpD;AAED,oEAAoE;AACpE,eAAO,MAAM,0BAA0B,sBAAsB,CAAC"}
1
+ {"version":3,"file":"livePreviewScript.d.ts","sourceRoot":"","sources":["../../src/proxy/livePreviewScript.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,2BAA2B,IAAI,MAAM,CAKpD;AAED,qEAAqE;AACrE,eAAO,MAAM,0BAA0B,sBAAsB,CAAC"}
@@ -23,30 +23,33 @@ interface ApiRouteMatch {
23
23
  myDomain?: boolean;
24
24
  }
25
25
  /**
26
- * Match URL path against routing rules
26
+ * Matches a URL path against the routing rules.
27
27
  *
28
- * @param pathname - The URL pathname to match
29
- * @param basePath - Optional base path of Salesforce server
30
- * @param rewrites - Optional array of rewrite rules
31
- * @param redirects - Optional array of redirect rules
32
- * @returns Route match result indicating the type and target, or null if no match
28
+ * @param pathname - The URL pathname to match.
29
+ * @param basePath - The base path of the Salesforce server.
30
+ * @param rewrites - The rewrite rules.
31
+ * @param redirects - The redirect rules.
32
+ * @returns The route match, which gives the type and target, or `null` when nothing matches.
33
33
  */
34
34
  export declare function matchRoute(pathname: string, basePath?: string, rewrites?: RewriteRule[], redirects?: RedirectRule[]): RouteMatch | null;
35
35
  /**
36
- * Check if a path matches any of the given glob patterns
37
- * Supports glob wildcards: * (matches anything except /), ** (matches anything including /), ? (single character)
36
+ * Checks whether a path matches any of the given glob patterns.
38
37
  *
39
- * @param path - The path to test
40
- * @param patterns - Array of glob patterns to match against
41
- * @returns True if the path matches any pattern, false otherwise
38
+ * @remarks
39
+ * Supports these glob wildcards: `*` matches anything except `/`, `**` matches
40
+ * anything including `/`, and `?` matches a single character.
41
+ *
42
+ * @param path - The path to test.
43
+ * @param patterns - The glob patterns to match against.
44
+ * @returns `true` when the path matches any pattern, otherwise `false`.
42
45
  */
43
46
  export declare function matchesPattern(path: string, patterns: string[] | undefined): boolean;
44
47
  /**
45
- * Apply trailing slash rules to pathname
48
+ * Applies the trailing-slash rules to a pathname.
46
49
  *
47
- * @param pathname - The URL pathname
48
- * @param trailingSlash - Trailing slash handling strategy
49
- * @returns Modified pathname with trailing slash applied according to rules
50
+ * @param pathname - The URL pathname.
51
+ * @param trailingSlash - The trailing-slash handling strategy.
52
+ * @returns The pathname, with the trailing-slash rules applied.
50
53
  */
51
54
  export declare function applyTrailingSlash(pathname: string, trailingSlash?: "always" | "never" | "auto"): string;
52
55
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../src/proxy/routing.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE9D,MAAM,MAAM,UAAU,GACrB,iBAAiB,GAAG,iBAAiB,GAAG,aAAa,GAAG,iBAAiB,GAAG,kBAAkB,CAAC;AAEhG,UAAU,iBAAiB;IAC1B,IAAI,EAAE,KAAK,GAAG,aAAa,CAAC;CAC5B;AAKD,UAAU,iBAAiB;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACb;AAED,UAAU,iBAAiB;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,UAAU,kBAAkB;IAC3B,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CAClC;AAED,UAAU,aAAa;IACtB,I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,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CAClC;AAED,UAAU,aAAa;IACtB,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IAKb,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AASD;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACzB,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,WAAW,EAAE,EACxB,SAAS,CAAC,EAAE,YAAY,EAAE,GACxB,UAAU,GAAG,IAAI,CA2GnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,OAAO,CAMpF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CACjC,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,GACzC,MAAM,CAiBR"}
@@ -1 +1 @@
1
- {"version":3,"file":"cometD.d.ts","sourceRoot":"","sources":["../../../src/proxy/utils/cometD.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAKhD,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAqC/F;AAYD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAK/D"}
1
+ {"version":3,"file":"cometD.d.ts","sourceRoot":"","sources":["../../../src/proxy/utils/cometD.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAMhD,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAqC/F;AAaD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAK/D"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/ui-bundle",
3
3
  "description": "Core package for Salesforce UI Bundles",
4
- "version": "12.8.0",
4
+ "version": "12.9.0",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@salesforce/core": "^8.23.4",
42
- "@salesforce/platform-sdk": "^12.8.0",
42
+ "@salesforce/platform-sdk": "^12.9.0",
43
43
  "micromatch": "^4.0.8",
44
44
  "path-to-regexp": "^8.4.2"
45
45
  },