@salesforce/metadata-plugins 1.13.0 → 1.14.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.
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Copyright (c) 2026, 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 { KeyValueTableParser } from './KeyValueTableParser.js';
8
+ import { matchesFilePattern } from '../../shared/utils/patternMatcher.js';
9
+ export class KeyValueTableVisualizer {
10
+ constructor() {
11
+ this.pluginMetadata = {
12
+ id: 'keyvaluetable',
13
+ name: 'Salesforce Key-Value Table Metadata Visualizer',
14
+ displayName: 'Key-Value Table',
15
+ description: 'Overview, field table and list tables for Custom Metadata records, Custom Permissions, Field Sets, Global/Standard Value Sets, List Views, Custom Tabs, Custom Labels, Value Set Translations, Workflow Alerts, Business Processes, Web Links, Remote Site Settings, Field Source-Target Relationships, Sharing Reasons, Feature Parameters, Compact Layouts, Workflow Field Updates, Roles, Public Groups, Profiles, Report/Document/Email Folders',
16
+ author: 'Metadata Visualizer Team',
17
+ filePatterns: [
18
+ '.md-meta.xml',
19
+ '.customPermission-meta.xml',
20
+ '.tab-meta.xml',
21
+ '.fieldSet-meta.xml',
22
+ '.globalValueSet-meta.xml',
23
+ '.labels-meta.xml',
24
+ '.listView-meta.xml',
25
+ '.standardValueSet-meta.xml',
26
+ '.globalValueSetTranslation-meta.xml',
27
+ '.standardValueSetTranslation-meta.xml',
28
+ '.workflowAlert-meta.xml',
29
+ '.businessProcess-meta.xml',
30
+ '.webLink-meta.xml',
31
+ '.remoteSite-meta.xml',
32
+ '.fieldSrcTrgtRelationship-meta.xml',
33
+ '.sharingReason-meta.xml',
34
+ '.featureParameterInteger-meta.xml',
35
+ '.featureParameterBoolean-meta.xml',
36
+ '.compactLayout-meta.xml',
37
+ '.role-meta.xml',
38
+ '.group-meta.xml',
39
+ '.profile-meta.xml',
40
+ '.reportFolder-meta.xml',
41
+ '.documentFolder-meta.xml',
42
+ '.emailFolder-meta.xml',
43
+ '.workflowFieldUpdate-meta.xml',
44
+ ],
45
+ priority: 10,
46
+ };
47
+ this.parser = new KeyValueTableParser();
48
+ }
49
+ getMetadataPluginInfo() {
50
+ return this.pluginMetadata;
51
+ }
52
+ canHandle(filePath) {
53
+ return this.getMetadataPluginInfo().filePatterns.some((pattern) => matchesFilePattern(filePath, pattern));
54
+ }
55
+ async initialize(context) {
56
+ this.logger = context.logger.createChild(this.getMetadataPluginInfo().id);
57
+ this.logger.info('Key-Value Table visualizer initialized');
58
+ this.parser.setPlatformContext(context);
59
+ }
60
+ dispose() {
61
+ this.logger?.info(`Disposing ${this.getMetadataPluginInfo().name}`);
62
+ }
63
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2026, 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
+ /** `disableProtocolSecurity` / `remote_site` / `ISBNCode` → `Disable Protocol Security` / `Remote site` / `ISBN Code`. */
8
+ export declare function humanize(name: string): string;
9
+ //# sourceMappingURL=humanize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"humanize.d.ts","sourceRoot":"","sources":["../../../src/plugins/keyvaluetable/humanize.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ,0HAA0H;AAC1H,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO7C"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright (c) 2026, 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
+ /** `disableProtocolSecurity` / `remote_site` / `ISBNCode` → `Disable Protocol Security` / `Remote site` / `ISBN Code`. */
8
+ export function humanize(name) {
9
+ const spaced = name
10
+ .replace(/[_-]+/g, ' ')
11
+ .replace(/([a-z0-9])([A-Z])/g, '$1 $2')
12
+ .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')
13
+ .trim();
14
+ return spaced.charAt(0).toUpperCase() + spaced.slice(1);
15
+ }
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Copyright (c) 2026, 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 interface KeyValueEntry {
8
+ /** XML element name, e.g. `disableProtocolSecurity`. */
9
+ key: string;
10
+ /** Entity-decoded value; nested elements are flattened to `name: value` lines. */
11
+ value: string;
12
+ /** Section the entry belongs to, e.g. `System Information`; ungrouped entries share the main Settings section. */
13
+ group?: string;
14
+ }
15
+ export interface KeyValueStatus {
16
+ label: 'Active' | 'Inactive';
17
+ active: boolean;
18
+ }
19
+ /** A repeated child element shown as its own titled table. */
20
+ export interface KeyValueTable {
21
+ title: string;
22
+ columns: string[];
23
+ rows: string[][];
24
+ }
25
+ /** One element of a nested structure; `children` holds its nested elements in file order. */
26
+ export interface KeyValueTreeNode {
27
+ /** XML element name. */
28
+ key: string;
29
+ /** Scalar text; absent for elements that only contain other elements. */
30
+ value?: string;
31
+ /** Short identifying text for a container (its `name` / `label` / `fullName` ...). */
32
+ summary?: string;
33
+ children?: KeyValueTreeNode[];
34
+ /** Children were dropped because the depth or node cap was reached. */
35
+ truncated?: boolean;
36
+ }
37
+ /** A top-level element nested deeper than one level, shown as an expandable tree. */
38
+ export interface KeyValueTree {
39
+ title: string;
40
+ nodes: KeyValueTreeNode[];
41
+ nodeCount: number;
42
+ truncated: boolean;
43
+ }
44
+ /**
45
+ * Parsed shape of a flat metadata file: one root element whose children are
46
+ * top-level key/value pairs (WebLink, RemoteSiteSetting, CustomMetadata, ...),
47
+ * plus zero or more repeated child lists, e.g. CustomMetadata `values` or
48
+ * CustomPermission `requiredPermission`. `entries` holds only the scalar fields.
49
+ */
50
+ export interface KeyValueTableData {
51
+ /** `<fullName>`, else the file name without its suffix. */
52
+ apiName: string;
53
+ filePath: string;
54
+ /** XML root element, e.g. `RemoteSiteSetting`. */
55
+ metadataType: string;
56
+ /** Human label of the type, e.g. `Remote Site Setting`. */
57
+ metadataTypeLabel: string;
58
+ /** Owning object for sub-components such as WebLink (from the folder path). */
59
+ objectName?: string;
60
+ /** First of `label`, `masterLabel`, `name`, `fullName`, else the file name. */
61
+ title: string;
62
+ description?: string;
63
+ /** Present when the file carries `isActive`. */
64
+ status?: KeyValueStatus;
65
+ /** `license` (permission sets) or `userLicense` (profiles), when present. */
66
+ license?: string;
67
+ /** Every top-level scalar element, in file order. */
68
+ entries: KeyValueEntry[];
69
+ /** Repeated child lists; empty for types without any. */
70
+ lists: KeyValueTable[];
71
+ /** Top-level elements nested deeper than one level; omitted when there are none. */
72
+ trees?: KeyValueTree[];
73
+ metadata: {
74
+ parsedAt: string;
75
+ entryCount: number;
76
+ };
77
+ }
78
+ //# sourceMappingURL=KeyValueTableData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeyValueTableData.d.ts","sourceRoot":"","sources":["../../../../src/plugins/keyvaluetable/types/KeyValueTableData.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ,MAAM,WAAW,aAAa;IAC5B,wDAAwD;IACxD,GAAG,EAAE,MAAM,CAAC;IACZ,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAC;IACd,kHAAkH;IAClH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC7B,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,8DAA8D;AAC9D,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,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AM,CAAC;KACpB,CAAC;CACH"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2026, 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 {};