@salesforce/metadata-visualizer-web 1.0.1

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 (66) hide show
  1. package/LICENSE.txt +27 -0
  2. package/README.md +269 -0
  3. package/dist/WebVisualizationEngine.d.ts +165 -0
  4. package/dist/WebVisualizationEngine.d.ts.map +1 -0
  5. package/dist/WebVisualizationEngine.js +284 -0
  6. package/dist/WebVisualizationEngine.js.map +1 -0
  7. package/dist/createWebVisualizationEngine.d.ts +27 -0
  8. package/dist/createWebVisualizationEngine.d.ts.map +1 -0
  9. package/dist/createWebVisualizationEngine.js +91 -0
  10. package/dist/createWebVisualizationEngine.js.map +1 -0
  11. package/dist/design-system/platform.css +623 -0
  12. package/dist/errors/index.d.ts +25 -0
  13. package/dist/errors/index.d.ts.map +1 -0
  14. package/dist/errors/index.js +31 -0
  15. package/dist/errors/index.js.map +1 -0
  16. package/dist/index.d.ts +22 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.js +18 -0
  19. package/dist/index.js.map +1 -0
  20. package/dist/internal/CompositeFileSystem.d.ts +28 -0
  21. package/dist/internal/CompositeFileSystem.d.ts.map +1 -0
  22. package/dist/internal/CompositeFileSystem.js +82 -0
  23. package/dist/internal/CompositeFileSystem.js.map +1 -0
  24. package/dist/internal/assetInliner.d.ts +30 -0
  25. package/dist/internal/assetInliner.d.ts.map +1 -0
  26. package/dist/internal/assetInliner.js +126 -0
  27. package/dist/internal/assetInliner.js.map +1 -0
  28. package/dist/internal/constants.d.ts +20 -0
  29. package/dist/internal/constants.d.ts.map +1 -0
  30. package/dist/internal/constants.js +34 -0
  31. package/dist/internal/constants.js.map +1 -0
  32. package/dist/internal/htmlPipeline.d.ts +50 -0
  33. package/dist/internal/htmlPipeline.d.ts.map +1 -0
  34. package/dist/internal/htmlPipeline.js +86 -0
  35. package/dist/internal/htmlPipeline.js.map +1 -0
  36. package/dist/pluginAssets/BundledPluginAssetReader.d.ts +34 -0
  37. package/dist/pluginAssets/BundledPluginAssetReader.d.ts.map +1 -0
  38. package/dist/pluginAssets/BundledPluginAssetReader.js +77 -0
  39. package/dist/pluginAssets/BundledPluginAssetReader.js.map +1 -0
  40. package/dist/plugins/flexipage/ui/assets/index-BAFqMU7k.js +48 -0
  41. package/dist/plugins/flexipage/ui/assets/index-U3SB2gLS.css +1 -0
  42. package/dist/plugins/flexipage/ui/index.html +16 -0
  43. package/dist/plugins/schema/ui/assets/index-DCLgZby3.css +1 -0
  44. package/dist/plugins/schema/ui/assets/index-Ho7jg9o_.js +70 -0
  45. package/dist/plugins/schema/ui/index.html +14 -0
  46. package/dist/types/HttpAsset.d.ts +18 -0
  47. package/dist/types/HttpAsset.d.ts.map +1 -0
  48. package/dist/types/HttpAsset.js +8 -0
  49. package/dist/types/HttpAsset.js.map +1 -0
  50. package/dist/types/PluginDataUpdateMessage.d.ts +24 -0
  51. package/dist/types/PluginDataUpdateMessage.d.ts.map +1 -0
  52. package/dist/types/PluginDataUpdateMessage.js +8 -0
  53. package/dist/types/PluginDataUpdateMessage.js.map +1 -0
  54. package/dist/types/PluginInfo.d.ts +20 -0
  55. package/dist/types/PluginInfo.d.ts.map +1 -0
  56. package/dist/types/PluginInfo.js +8 -0
  57. package/dist/types/PluginInfo.js.map +1 -0
  58. package/dist/types/VisualizeOutcome.d.ts +19 -0
  59. package/dist/types/VisualizeOutcome.d.ts.map +1 -0
  60. package/dist/types/VisualizeOutcome.js +8 -0
  61. package/dist/types/VisualizeOutcome.js.map +1 -0
  62. package/dist/types/WebAdapterOptions.d.ts +22 -0
  63. package/dist/types/WebAdapterOptions.d.ts.map +1 -0
  64. package/dist/types/WebAdapterOptions.js +8 -0
  65. package/dist/types/WebAdapterOptions.js.map +1 -0
  66. package/package.json +77 -0
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Schema ERD Visualizer</title>
7
+ <script type="module" crossorigin src="./assets/index-Ho7jg9o_.js"></script>
8
+ <link rel="stylesheet" crossorigin href="./assets/index-DCLgZby3.css">
9
+ <link rel="stylesheet" href="@dist/design-system/platform.css" data-platform-styles="true">
10
+ </head>
11
+ <body>
12
+ <div id="root"></div>
13
+ </body>
14
+ </html>
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright (c) 2025, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ **/
7
+ /**
8
+ * Uniform return shape for the adapter's content getters.
9
+ * The host sets `Content-Type` from `contentType`, optionally honors
10
+ * `cacheControl`, and writes `body` to the response. The adapter does
11
+ * not impose a transport (Fastify, Express, etc.).
12
+ */
13
+ export interface HttpAsset<TBody = string | Uint8Array> {
14
+ readonly contentType: string;
15
+ readonly body: TBody;
16
+ readonly cacheControl?: string;
17
+ }
18
+ //# sourceMappingURL=HttpAsset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpAsset.d.ts","sourceRoot":"","sources":["../../src/types/HttpAsset.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ;;;;;GAKG;AACH,MAAM,WAAW,SAAS,CAAC,KAAK,GAAG,MAAM,GAAG,UAAU;IACpD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright (c) 2025, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ **/
7
+ export {};
8
+ //# sourceMappingURL=HttpAsset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpAsset.js","sourceRoot":"","sources":["../../src/types/HttpAsset.ts"],"names":[],"mappings":"AAAA;;;;;IAKI"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Copyright (c) 2025, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ **/
7
+ import type { WebviewMessageType, PluginDataResponse } from '@salesforce/metadata-core-sdk';
8
+ /**
9
+ * Message structure for plugin data updates.
10
+ * Posted to the plugin iframe when metadata is re-parsed.
11
+ * Plugins listening via onDataUpdate() in HostCommunicationUtils will receive this.
12
+ *
13
+ * - `type` is the literal `'PLUGIN_DATA_UPDATE'` so consumers can narrow on it in
14
+ * a discriminated-union switch and get a compile-time guarantee.
15
+ * - `payload` reuses `PluginDataResponse<T>` from core-sdk (the same shape `getPluginData`
16
+ * resolves with), so plugin code can treat both initial and update payloads identically.
17
+ * - `T` defaults to `unknown` to preserve backward compatibility while giving callers
18
+ * that know their plugin's data shape a path to type-safety: `PluginDataUpdateMessage<MyData>`.
19
+ */
20
+ export interface PluginDataUpdateMessage<T = unknown> {
21
+ type: typeof WebviewMessageType.PLUGIN_DATA_UPDATE;
22
+ payload: PluginDataResponse<T>;
23
+ }
24
+ //# sourceMappingURL=PluginDataUpdateMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PluginDataUpdateMessage.d.ts","sourceRoot":"","sources":["../../src/types/PluginDataUpdateMessage.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAE5F;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,GAAG,OAAO;IAClD,IAAI,EAAE,OAAO,kBAAkB,CAAC,kBAAkB,CAAC;IACnD,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;CAChC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright (c) 2025, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ **/
7
+ export {};
8
+ //# sourceMappingURL=PluginDataUpdateMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PluginDataUpdateMessage.js","sourceRoot":"","sources":["../../src/types/PluginDataUpdateMessage.ts"],"names":[],"mappings":"AAAA;;;;;IAKI"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) 2025, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ **/
7
+ /**
8
+ * Public-facing description of a registered plugin.
9
+ *
10
+ * The host uses this to drive its "what can I visualize?" UI and to map
11
+ * file names to plugin IDs. It contains only display-and-routing facts —
12
+ * no parser references, no asset paths, no internal flags.
13
+ */
14
+ export interface PluginInfo {
15
+ readonly id: string;
16
+ readonly displayName: string;
17
+ readonly filePatterns: readonly string[];
18
+ readonly priority?: number;
19
+ }
20
+ //# sourceMappingURL=PluginInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PluginInfo.d.ts","sourceRoot":"","sources":["../../src/types/PluginInfo.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright (c) 2025, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ **/
7
+ export {};
8
+ //# sourceMappingURL=PluginInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PluginInfo.js","sourceRoot":"","sources":["../../src/types/PluginInfo.ts"],"names":[],"mappings":"AAAA;;;;;IAKI"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright (c) 2025, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ **/
7
+ import type { VisualizationResult } from '@salesforce/metadata-visualizer-core';
8
+ import type { PluginError } from '@salesforce/metadata-core-sdk';
9
+ /**
10
+ * Wraps a single `visualize()` call. Either `result` is non-null (success)
11
+ * or `error` holds the structured failure the framework's ErrorManager
12
+ * captured during this specific call. Both fields are populated in-band so
13
+ * callers don't need to read shared engine state.
14
+ */
15
+ export interface VisualizeOutcome {
16
+ readonly result: VisualizationResult | null;
17
+ readonly error: PluginError | null;
18
+ }
19
+ //# sourceMappingURL=VisualizeOutcome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VisualizeOutcome.d.ts","sourceRoot":"","sources":["../../src/types/VisualizeOutcome.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC5C,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;CACpC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright (c) 2025, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ **/
7
+ export {};
8
+ //# sourceMappingURL=VisualizeOutcome.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VisualizeOutcome.js","sourceRoot":"","sources":["../../src/types/VisualizeOutcome.ts"],"names":[],"mappings":"AAAA;;;;;IAKI"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright (c) 2025, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ **/
7
+ import type { IFileSystem, ITelemetry } from '@salesforce/metadata-core-sdk';
8
+ /**
9
+ * Options accepted by `createWebVisualizationEngine`.
10
+ *
11
+ * Required:
12
+ * - `fileSystem`: the host's IFileSystem implementation, scoped to the
13
+ * user project the request is for.
14
+ *
15
+ * Optional:
16
+ * - `telemetry`: telemetry integration for tracking usage and errors.
17
+ */
18
+ export interface WebAdapterOptions {
19
+ readonly fileSystem: IFileSystem;
20
+ readonly telemetry?: ITelemetry;
21
+ }
22
+ //# sourceMappingURL=WebAdapterOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebAdapterOptions.d.ts","sourceRoot":"","sources":["../../src/types/WebAdapterOptions.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC7E;;;;;;;;;GASG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC;CACjC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright (c) 2025, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ **/
7
+ export {};
8
+ //# sourceMappingURL=WebAdapterOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebAdapterOptions.js","sourceRoot":"","sources":["../../src/types/WebAdapterOptions.ts"],"names":[],"mappings":"AAAA;;;;;IAKI"}
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@salesforce/metadata-visualizer-web",
3
+ "version": "1.0.1",
4
+ "description": "Web/HTTP SDK for the Salesforce Metadata Visualizer framework. Lets any HTTP server plug a host-supplied IFileSystem into the framework and serve plugin visualizations.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "author": "salesforce",
9
+ "license": "BSD-3-Clause",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/forcedotcom/salesforce-metadata-visualizer-support"
13
+ },
14
+ "homepage": "https://github.com/forcedotcom/salesforce-metadata-visualizer-support#readme",
15
+ "bugs": {
16
+ "url": "https://github.com/forcedotcom/salesforce-metadata-visualizer-support/issues"
17
+ },
18
+ "keywords": [
19
+ "salesforce",
20
+ "metadata",
21
+ "visualizer",
22
+ "browser",
23
+ "http",
24
+ "sfdx"
25
+ ],
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "engines": {
30
+ "node": ">=18.0.0"
31
+ },
32
+ "exports": {
33
+ ".": {
34
+ "types": "./dist/index.d.ts",
35
+ "default": "./dist/index.js"
36
+ }
37
+ },
38
+ "files": [
39
+ "dist/**/*",
40
+ "README.md",
41
+ "LICENSE.txt"
42
+ ],
43
+ "scripts": {
44
+ "build": "npm run clean && tsc && node scripts/copy-plugin-assets.mjs",
45
+ "watch": "tsc --watch",
46
+ "test": "jest --coverage",
47
+ "test:watch": "jest --watch",
48
+ "test:architecture": "jest architecture.test",
49
+ "lint": "eslint src",
50
+ "lint:fix": "eslint src --ext .ts --fix",
51
+ "format": "prettier --write \"src/**/*.ts\" --ignore-path ../../.prettierignore",
52
+ "format:check": "prettier --check \"src/**/*.ts\" --ignore-path ../../.prettierignore",
53
+ "typecheck": "tsc --noEmit",
54
+ "clean": "rimraf dist tsconfig.tsbuildinfo",
55
+ "verify": "npm run lint && npm run typecheck && npm run build && npm run test"
56
+ },
57
+ "dependencies": {
58
+ "@salesforce/metadata-core-sdk": "^1.3.0",
59
+ "@salesforce/metadata-visualizer-core": "^1.2.0"
60
+ },
61
+ "devDependencies": {
62
+ "@eslint/js": "^9.15.0",
63
+ "@tony.ganchev/eslint-plugin-header": "^3.1.6",
64
+ "@types/jest": "^29.5.14",
65
+ "@types/node": "^18.19.68",
66
+ "eslint": "^9.15.0",
67
+ "eslint-config-prettier": "^9.1.0",
68
+ "eslint-plugin-jest": "^28.9.0",
69
+ "eslint-plugin-prettier": "^5.2.1",
70
+ "jest": "^29.7.0",
71
+ "prettier": "^3.4.2",
72
+ "rimraf": "^6.0.1",
73
+ "ts-jest": "^29.2.5",
74
+ "typescript": "^5.7.2",
75
+ "typescript-eslint": "^8.15.0"
76
+ }
77
+ }