@salesforce/ui-bundle 1.117.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.
Files changed (68) hide show
  1. package/LICENSE.txt +82 -0
  2. package/README.md +3 -0
  3. package/dist/api/clients.d.ts +22 -0
  4. package/dist/api/clients.d.ts.map +1 -0
  5. package/dist/api/clients.js +84 -0
  6. package/dist/api/graphql-operations-types.d.ts +225 -0
  7. package/dist/api/graphql-operations-types.d.ts.map +1 -0
  8. package/dist/api/index.d.ts +10 -0
  9. package/dist/api/index.d.ts.map +1 -0
  10. package/dist/api/index.js +13 -0
  11. package/dist/api/utils/accounts.d.ts +33 -0
  12. package/dist/api/utils/accounts.d.ts.map +1 -0
  13. package/dist/api/utils/accounts.js +47 -0
  14. package/dist/api/utils/records.d.ts +16 -0
  15. package/dist/api/utils/records.d.ts.map +1 -0
  16. package/dist/api/utils/records.js +26 -0
  17. package/dist/api/utils/user.d.ts +17 -0
  18. package/dist/api/utils/user.d.ts.map +1 -0
  19. package/dist/api/utils/user.js +25 -0
  20. package/dist/app/index.d.ts +10 -0
  21. package/dist/app/index.d.ts.map +1 -0
  22. package/dist/app/index.js +7 -0
  23. package/dist/app/manifest.d.ts +34 -0
  24. package/dist/app/manifest.d.ts.map +1 -0
  25. package/dist/app/manifest.js +28 -0
  26. package/dist/app/org.d.ts +28 -0
  27. package/dist/app/org.d.ts.map +1 -0
  28. package/dist/app/org.js +67 -0
  29. package/dist/design/design-mode-interactions.js +761 -0
  30. package/dist/design/index.d.ts +12 -0
  31. package/dist/design/index.d.ts.map +1 -0
  32. package/dist/design/index.js +14 -0
  33. package/dist/design/interactions/communicationManager.d.ts +25 -0
  34. package/dist/design/interactions/communicationManager.d.ts.map +1 -0
  35. package/dist/design/interactions/componentMatcher.d.ts +43 -0
  36. package/dist/design/interactions/componentMatcher.d.ts.map +1 -0
  37. package/dist/design/interactions/editableManager.d.ts +25 -0
  38. package/dist/design/interactions/editableManager.d.ts.map +1 -0
  39. package/dist/design/interactions/eventHandlers.d.ts +40 -0
  40. package/dist/design/interactions/eventHandlers.d.ts.map +1 -0
  41. package/dist/design/interactions/index.d.ts +7 -0
  42. package/dist/design/interactions/index.d.ts.map +1 -0
  43. package/dist/design/interactions/interactionsController.d.ts +36 -0
  44. package/dist/design/interactions/interactionsController.d.ts.map +1 -0
  45. package/dist/design/interactions/styleManager.d.ts +49 -0
  46. package/dist/design/interactions/styleManager.d.ts.map +1 -0
  47. package/dist/design/interactions/utils/cssUtils.d.ts +54 -0
  48. package/dist/design/interactions/utils/cssUtils.d.ts.map +1 -0
  49. package/dist/design/interactions/utils/sourceUtils.d.ts +36 -0
  50. package/dist/design/interactions/utils/sourceUtils.d.ts.map +1 -0
  51. package/dist/index.d.ts +10 -0
  52. package/dist/index.d.ts.map +1 -0
  53. package/dist/index.js +25 -0
  54. package/dist/package.json.js +4 -0
  55. package/dist/proxy/handler.d.ts +38 -0
  56. package/dist/proxy/handler.d.ts.map +1 -0
  57. package/dist/proxy/handler.js +530 -0
  58. package/dist/proxy/index.d.ts +8 -0
  59. package/dist/proxy/index.d.ts.map +1 -0
  60. package/dist/proxy/index.js +7 -0
  61. package/dist/proxy/livePreviewScript.d.ts +21 -0
  62. package/dist/proxy/livePreviewScript.d.ts.map +1 -0
  63. package/dist/proxy/livePreviewScript.js +16 -0
  64. package/dist/proxy/routing.d.ts +35 -0
  65. package/dist/proxy/routing.d.ts.map +1 -0
  66. package/dist/proxy/routing.js +83 -0
  67. package/dist/proxy/templates/livePreviewScript.js +553 -0
  68. package/package.json +65 -0
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ export interface UIBundleManifest {
7
+ name?: string;
8
+ outputDir: string;
9
+ routing?: RoutingConfig;
10
+ }
11
+ export interface RoutingConfig {
12
+ rewrites?: RewriteRule[];
13
+ redirects?: RedirectRule[];
14
+ trailingSlash?: "always" | "never" | "auto";
15
+ fallback?: string;
16
+ }
17
+ export interface RewriteRule {
18
+ route: string;
19
+ target: string;
20
+ }
21
+ export interface RedirectRule {
22
+ route: string;
23
+ target: string;
24
+ statusCode: 301 | 302 | 307 | 308;
25
+ }
26
+ /**
27
+ * Load and parse UI Bundle manifest (ui-bundle.json)
28
+ *
29
+ * @param manifestPath - Path to the ui-bundle.json file
30
+ * @returns Promise resolving to the parsed manifest
31
+ * @throws Error if manifest file not found or validation fails
32
+ */
33
+ export declare function loadManifest(manifestPath: string): Promise<UIBundleManifest>;
34
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/app/manifest.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,WAAW,gBAAgB;IAEhC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,SAAS,EAAE,MAAM,CAAC;IAElB,OAAO,CAAC,EAAE,aAAa,CAAC;CACxB;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,EAAE,MAAM,CAAC;IAEd,MAAM,EAAE,MAAM,CAAC;IAEf,UAAU,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CAClC;AAsBD;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAclF"}
@@ -0,0 +1,28 @@
1
+ import { readFile } from "node:fs/promises";
2
+ function validateManifest(manifest) {
3
+ const errors = [];
4
+ if (!manifest.outputDir) {
5
+ errors.push("outputDir");
6
+ }
7
+ if (errors.length > 0) {
8
+ throw new Error(
9
+ `Manifest missing required field${errors.length > 1 ? "s" : ""}: ${errors.join(", ")}`
10
+ );
11
+ }
12
+ }
13
+ async function loadManifest(manifestPath) {
14
+ try {
15
+ const content = await readFile(manifestPath, "utf-8");
16
+ const manifest = JSON.parse(content);
17
+ validateManifest(manifest);
18
+ return manifest;
19
+ } catch (error) {
20
+ if (error instanceof Error && "code" in error && error.code === "ENOENT") {
21
+ throw new Error(`Manifest not found at: ${manifestPath}`);
22
+ }
23
+ throw error;
24
+ }
25
+ }
26
+ export {
27
+ loadManifest
28
+ };
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ export interface OrgInfo {
7
+ orgId: string;
8
+ apiVersion: string;
9
+ instanceUrl: string;
10
+ rawInstanceUrl: string;
11
+ username: string;
12
+ accessToken: string;
13
+ orgAlias?: string;
14
+ }
15
+ /**
16
+ * Get Salesforce org info and authentication details
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
20
+ */
21
+ export declare function getOrgInfo(orgAlias?: string): Promise<OrgInfo | undefined>;
22
+ /**
23
+ * Refresh Salesforce org authentication
24
+ *
25
+ * @param orgAlias
26
+ */
27
+ export declare function refreshOrgAuth(orgAlias: string): Promise<OrgInfo | undefined>;
28
+ //# sourceMappingURL=org.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"org.d.ts","sourceRoot":"","sources":["../../src/app/org.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,WAAW,OAAO;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAmBhF;AAuBD;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAQnF"}
@@ -0,0 +1,67 @@
1
+ import { Org } from "@salesforce/core";
2
+ async function getOrgInfo(orgAlias) {
3
+ const org = await createOrg(orgAlias);
4
+ if (!org) {
5
+ return;
6
+ }
7
+ const connection = org.getConnection();
8
+ const authInfo = connection.getAuthInfo();
9
+ const authFields = authInfo.getFields();
10
+ return {
11
+ apiVersion: connection.getApiVersion(),
12
+ orgId: authFields.orgId ?? "",
13
+ instanceUrl: toLightningDomain(connection.instanceUrl),
14
+ rawInstanceUrl: connection.instanceUrl,
15
+ username: authFields.username ?? "",
16
+ accessToken: connection.accessToken ?? "",
17
+ orgAlias
18
+ };
19
+ }
20
+ async function createOrg(orgAlias) {
21
+ try {
22
+ if (!orgAlias) {
23
+ return await Org.create({});
24
+ }
25
+ return await Org.create({ aliasOrUsername: orgAlias });
26
+ } catch (error) {
27
+ const target = orgAlias ? `org "${orgAlias}"` : "default org";
28
+ if (error instanceof Error && error.name === "NoUsernameFoundError") {
29
+ console.warn(
30
+ `No ${target} found. Run "sf org login" to authenticate an org, or "sf config set target-org=<username>" to set a default.`
31
+ );
32
+ } else {
33
+ console.warn(
34
+ `Failed to connect to ${target}: ${error instanceof Error ? error.message : error}`
35
+ );
36
+ }
37
+ }
38
+ }
39
+ async function refreshOrgAuth(orgAlias) {
40
+ const org = await createOrg(orgAlias);
41
+ if (!org) {
42
+ return;
43
+ }
44
+ await org.refreshAuth();
45
+ return getOrgInfo(orgAlias);
46
+ }
47
+ function replaceLast(originalString, searchString, replacementString) {
48
+ const lastIndex = originalString.lastIndexOf(searchString);
49
+ if (lastIndex === -1) {
50
+ return originalString;
51
+ }
52
+ const before = originalString.slice(0, lastIndex);
53
+ const after = originalString.slice(lastIndex + searchString.length);
54
+ return before + replacementString + after;
55
+ }
56
+ function toLightningDomain(instanceUrl) {
57
+ if (!instanceUrl.includes(".my.")) {
58
+ return instanceUrl;
59
+ }
60
+ let url = replaceLast(instanceUrl, ".my.", ".lightning.");
61
+ url = replaceLast(url, ".salesforce", ".force");
62
+ return url;
63
+ }
64
+ export {
65
+ getOrgInfo,
66
+ refreshOrgAuth
67
+ };