@salesforce/metadata-enrichment 0.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.
- package/LICENSE.txt +206 -0
- package/README.md +80 -0
- package/lib/common/index.d.ts +1 -0
- package/lib/common/index.js +17 -0
- package/lib/common/index.js.map +1 -0
- package/lib/common/types.d.ts +7 -0
- package/lib/common/types.js +17 -0
- package/lib/common/types.js.map +1 -0
- package/lib/enrichment/constants/api.d.ts +3 -0
- package/lib/enrichment/constants/api.js +19 -0
- package/lib/enrichment/constants/api.js.map +1 -0
- package/lib/enrichment/constants/index.d.ts +2 -0
- package/lib/enrichment/constants/index.js +18 -0
- package/lib/enrichment/constants/index.js.map +1 -0
- package/lib/enrichment/constants/mimeTypes.d.ts +1 -0
- package/lib/enrichment/constants/mimeTypes.js +23 -0
- package/lib/enrichment/constants/mimeTypes.js.map +1 -0
- package/lib/enrichment/enrichmentHandler.d.ts +35 -0
- package/lib/enrichment/enrichmentHandler.js +157 -0
- package/lib/enrichment/enrichmentHandler.js.map +1 -0
- package/lib/enrichment/enrichmentMetrics.d.ts +22 -0
- package/lib/enrichment/enrichmentMetrics.js +85 -0
- package/lib/enrichment/enrichmentMetrics.js.map +1 -0
- package/lib/enrichment/index.d.ts +5 -0
- package/lib/enrichment/index.js +19 -0
- package/lib/enrichment/index.js.map +1 -0
- package/lib/enrichment/types/index.d.ts +2 -0
- package/lib/enrichment/types/index.js +17 -0
- package/lib/enrichment/types/index.js.map +1 -0
- package/lib/enrichment/types/requestTypes.d.ts +15 -0
- package/lib/enrichment/types/requestTypes.js +17 -0
- package/lib/enrichment/types/requestTypes.js.map +1 -0
- package/lib/enrichment/types/responseTypes.d.ts +18 -0
- package/lib/enrichment/types/responseTypes.js +17 -0
- package/lib/enrichment/types/responseTypes.js.map +1 -0
- package/lib/files/fileProcessor.d.ts +14 -0
- package/lib/files/fileProcessor.js +65 -0
- package/lib/files/fileProcessor.js.map +1 -0
- package/lib/files/index.d.ts +2 -0
- package/lib/files/index.js +17 -0
- package/lib/files/index.js.map +1 -0
- package/lib/files/lwcProcessor.d.ts +11 -0
- package/lib/files/lwcProcessor.js +121 -0
- package/lib/files/lwcProcessor.js.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/messages/enrichment.md +15 -0
- package/package.json +154 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { EnrichmentStatus } from './enrichmentHandler.js';
|
|
17
|
+
export class EnrichmentMetrics {
|
|
18
|
+
success;
|
|
19
|
+
fail;
|
|
20
|
+
skipped;
|
|
21
|
+
total;
|
|
22
|
+
constructor() {
|
|
23
|
+
this.success = {
|
|
24
|
+
count: 0,
|
|
25
|
+
components: [],
|
|
26
|
+
};
|
|
27
|
+
this.fail = {
|
|
28
|
+
count: 0,
|
|
29
|
+
components: [],
|
|
30
|
+
};
|
|
31
|
+
this.skipped = {
|
|
32
|
+
count: 0,
|
|
33
|
+
components: [],
|
|
34
|
+
};
|
|
35
|
+
this.total = 0;
|
|
36
|
+
}
|
|
37
|
+
static createEnrichmentMetrics(enrichmentResults) {
|
|
38
|
+
const metrics = new EnrichmentMetrics();
|
|
39
|
+
for (const record of enrichmentResults) {
|
|
40
|
+
const componentName = record.componentName;
|
|
41
|
+
let typeName = '';
|
|
42
|
+
if (record.componentType) {
|
|
43
|
+
typeName = record.componentType.name;
|
|
44
|
+
}
|
|
45
|
+
else if (record.response?.results && record.response.results.length > 0) {
|
|
46
|
+
typeName = record.response.results[0].metadataType;
|
|
47
|
+
}
|
|
48
|
+
// Skip records where we can't determine the metadata type
|
|
49
|
+
if (!typeName) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
const component = {
|
|
53
|
+
typeName,
|
|
54
|
+
componentName,
|
|
55
|
+
message: record.message ?? (record.status === EnrichmentStatus.SUCCESS ? '' : 'Enrichment request failed'),
|
|
56
|
+
};
|
|
57
|
+
if (record.status === EnrichmentStatus.SUCCESS) {
|
|
58
|
+
metrics.addSuccessComponent(component);
|
|
59
|
+
}
|
|
60
|
+
else if (record.status === EnrichmentStatus.SKIPPED) {
|
|
61
|
+
metrics.addSkippedComponent(component);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
metrics.addFailComponent(component);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return metrics;
|
|
68
|
+
}
|
|
69
|
+
addSuccessComponent(component) {
|
|
70
|
+
this.success.components.push(component);
|
|
71
|
+
this.success.count++;
|
|
72
|
+
this.total++;
|
|
73
|
+
}
|
|
74
|
+
addFailComponent(component) {
|
|
75
|
+
this.fail.components.push(component);
|
|
76
|
+
this.fail.count++;
|
|
77
|
+
this.total++;
|
|
78
|
+
}
|
|
79
|
+
addSkippedComponent(component) {
|
|
80
|
+
this.skipped.components.push(component);
|
|
81
|
+
this.skipped.count++;
|
|
82
|
+
this.total++;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=enrichmentMetrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enrichmentMetrics.js","sourceRoot":"","sources":["../../src/enrichment/enrichmentMetrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;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gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,2BAA2B,CAAC;aAC3G,CAAC;YAEF,IAAI,MAAM,CAAC,MAAM,KAAK,gBAAgB,CAAC,OAAO,EAAE,CAAC;gBAC/C,OAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;YACzC,CAAC;iBAAM,IAAI,MAAM,CAAC,MAAM,KAAK,gBAAgB,CAAC,OAAO,EAAE,CAAC;gBACtD,OAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;YACzC,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;YACtC,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAEM,mBAAmB,CAAC,SAAoC;QAC7D,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAEM,gBAAgB,CAAC,SAAoC;QAC1D,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACrC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAClB,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAEM,mBAAmB,CAAC,SAAoC;QAC7D,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;CACF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { getMimeTypeFromExtension, EnrichmentHandler, EnrichmentStatus } from './enrichmentHandler.js';
|
|
2
|
+
export { API_ENDPOINT_ENRICHMENT, LWC_MIME_TYPES } from './constants/index.js';
|
|
3
|
+
export { EnrichmentMetrics } from './enrichmentMetrics.js';
|
|
4
|
+
export type { EnrichmentRequestRecord } from './enrichmentHandler.js';
|
|
5
|
+
export type { ContentBundleFile, ContentBundle, EnrichmentRequestBody, EnrichmentMetadata, EnrichmentResult, EnrichMetadataResult, } from './types/index.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export { getMimeTypeFromExtension, EnrichmentHandler, EnrichmentStatus } from './enrichmentHandler.js';
|
|
17
|
+
export { API_ENDPOINT_ENRICHMENT, LWC_MIME_TYPES } from './constants/index.js';
|
|
18
|
+
export { EnrichmentMetrics } from './enrichmentMetrics.js';
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/enrichment/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACvG,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/enrichment/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ContentBundleFile = {
|
|
2
|
+
filename: string;
|
|
3
|
+
mimeType: string;
|
|
4
|
+
content: string;
|
|
5
|
+
encoding: 'PlainText';
|
|
6
|
+
};
|
|
7
|
+
export type ContentBundle = {
|
|
8
|
+
resourceName: string;
|
|
9
|
+
files: Record<string, ContentBundleFile>;
|
|
10
|
+
};
|
|
11
|
+
export type EnrichmentRequestBody = {
|
|
12
|
+
contentBundles: ContentBundle[];
|
|
13
|
+
metadataType: 'Generic';
|
|
14
|
+
maxTokens: number;
|
|
15
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=requestTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestTypes.js","sourceRoot":"","sources":["../../../src/enrichment/types/requestTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type EnrichmentMetadata = {
|
|
2
|
+
durationMs: number;
|
|
3
|
+
failureCount: number;
|
|
4
|
+
successCount: number;
|
|
5
|
+
timestamp: string;
|
|
6
|
+
};
|
|
7
|
+
export type EnrichmentResult = {
|
|
8
|
+
resourceId: string;
|
|
9
|
+
resourceName: string;
|
|
10
|
+
metadataType: string;
|
|
11
|
+
modelUsed: string;
|
|
12
|
+
description: string;
|
|
13
|
+
descriptionScore: number;
|
|
14
|
+
};
|
|
15
|
+
export type EnrichMetadataResult = {
|
|
16
|
+
metadata: EnrichmentMetadata;
|
|
17
|
+
results: EnrichmentResult[];
|
|
18
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=responseTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responseTypes.js","sourceRoot":"","sources":["../../../src/enrichment/types/responseTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SourceComponent } from '@salesforce/source-deploy-retrieve';
|
|
2
|
+
import type { EnrichmentRequestRecord } from '../enrichment/enrichmentHandler.js';
|
|
3
|
+
export type FileReadResult = {
|
|
4
|
+
componentName: string;
|
|
5
|
+
filePath: string;
|
|
6
|
+
fileContents: string;
|
|
7
|
+
mimeType: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class FileProcessor {
|
|
10
|
+
static updateMetadataFiles(componentsToProcess: SourceComponent[], enrichmentRecords: Set<EnrichmentRequestRecord>): Promise<Set<EnrichmentRequestRecord>>;
|
|
11
|
+
static readComponentFile(componentName: string, filePath: string): Promise<FileReadResult | null>;
|
|
12
|
+
static readComponentFiles(component: SourceComponent): Promise<FileReadResult[]>;
|
|
13
|
+
private static groupComponentsByType;
|
|
14
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { readFile } from 'node:fs/promises';
|
|
17
|
+
import { getMimeTypeFromExtension } from '../enrichment/enrichmentHandler.js';
|
|
18
|
+
import { LwcProcessor } from './lwcProcessor.js';
|
|
19
|
+
export class FileProcessor {
|
|
20
|
+
static async updateMetadataFiles(componentsToProcess, enrichmentRecords) {
|
|
21
|
+
const componentsByType = FileProcessor.groupComponentsByType(componentsToProcess);
|
|
22
|
+
// Only LightningComponentBundle components are supported for now
|
|
23
|
+
const lightningComponentBundles = componentsByType.get('LightningComponentBundle') ?? [];
|
|
24
|
+
if (lightningComponentBundles.length === 0) {
|
|
25
|
+
return enrichmentRecords;
|
|
26
|
+
}
|
|
27
|
+
return LwcProcessor.updateMetadataFiles(lightningComponentBundles, enrichmentRecords);
|
|
28
|
+
}
|
|
29
|
+
static async readComponentFile(componentName, filePath) {
|
|
30
|
+
try {
|
|
31
|
+
const fileContents = await readFile(filePath, 'utf-8');
|
|
32
|
+
const mimeType = getMimeTypeFromExtension(filePath);
|
|
33
|
+
return {
|
|
34
|
+
componentName,
|
|
35
|
+
filePath,
|
|
36
|
+
fileContents,
|
|
37
|
+
mimeType,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
static async readComponentFiles(component) {
|
|
45
|
+
const componentName = component.fullName ?? component.name;
|
|
46
|
+
if (!componentName) {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
const filePaths = Array.from(component.walkContent());
|
|
50
|
+
const fileReadPromises = filePaths.map((filePath) => FileProcessor.readComponentFile(componentName, filePath));
|
|
51
|
+
const fileResults = await Promise.all(fileReadPromises);
|
|
52
|
+
return fileResults.filter((result) => result !== null);
|
|
53
|
+
}
|
|
54
|
+
static groupComponentsByType(components) {
|
|
55
|
+
const componentsByType = new Map();
|
|
56
|
+
for (const component of components) {
|
|
57
|
+
const componentTypeName = component.type?.name ?? 'Unknown';
|
|
58
|
+
const existing = componentsByType.get(componentTypeName) ?? [];
|
|
59
|
+
existing.push(component);
|
|
60
|
+
componentsByType.set(componentTypeName, existing);
|
|
61
|
+
}
|
|
62
|
+
return componentsByType;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=fileProcessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileProcessor.js","sourceRoot":"","sources":["../../src/files/fileProcessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AASjD,MAAM,OAAO,aAAa;IAEjB,MAAM,CAAC,KAAK,CAAC,mBAAmB,CACrC,mBAAsC,EACtC,iBAA+C;QAE/C,MAAM,gBAAgB,GAAG,aAAa,CAAC,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;QAElF,iEAAiE;QACjE,MAAM,yBAAyB,GAAG,gBAAgB,CAAC,GAAG,CAAC,0BAA0B,CAAC,IAAI,EAAE,CAAC;QACzF,IAAI,yBAAyB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3C,OAAO,iBAAiB,CAAC;QAC3B,CAAC;QACD,OAAO,YAAY,CAAC,mBAAmB,CAAC,yBAAyB,EAAE,iBAAiB,CAAC,CAAC;IACxF,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,aAAqB,EAAE,QAAgB;QAC3E,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACvD,MAAM,QAAQ,GAAG,wBAAwB,CAAC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,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export { FileProcessor } from './fileProcessor.js';
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/files/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SourceComponent } from '@salesforce/source-deploy-retrieve';
|
|
2
|
+
import type { EnrichmentRequestRecord } from '../enrichment/enrichmentHandler.js';
|
|
3
|
+
import type { EnrichmentResult } from '../enrichment/types/index.js';
|
|
4
|
+
import type { FileReadResult } from './fileProcessor.js';
|
|
5
|
+
export declare class LwcProcessor {
|
|
6
|
+
static readComponentFiles(sourceComponents: SourceComponent[]): Promise<FileReadResult[]>;
|
|
7
|
+
static updateMetadataFiles(lightningComponentBundles: SourceComponent[], enrichmentRecords: Set<EnrichmentRequestRecord>): Promise<Set<EnrichmentRequestRecord>>;
|
|
8
|
+
static updateMetaXml(xmlContent: string, result: EnrichmentResult): string;
|
|
9
|
+
static isMetaXmlFile(filePath: string): boolean;
|
|
10
|
+
private static isSkipUpliftEnabled;
|
|
11
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { basename } from 'node:path';
|
|
17
|
+
import { writeFile } from 'node:fs/promises';
|
|
18
|
+
import { SfError } from '@salesforce/core';
|
|
19
|
+
import { Messages } from '@salesforce/core/messages';
|
|
20
|
+
import { XMLParser, XMLBuilder } from 'fast-xml-parser';
|
|
21
|
+
import { EnrichmentStatus } from '../enrichment/enrichmentHandler.js';
|
|
22
|
+
import { FileProcessor } from './fileProcessor.js';
|
|
23
|
+
Messages.importMessagesDirectory(import.meta.dirname);
|
|
24
|
+
const messages = Messages.loadMessages('@salesforce/metadata-enrichment', 'enrichment');
|
|
25
|
+
export class LwcProcessor {
|
|
26
|
+
static async readComponentFiles(sourceComponents) {
|
|
27
|
+
const fileReadPromises = [];
|
|
28
|
+
for (const component of sourceComponents) {
|
|
29
|
+
const componentName = component.fullName ?? component.name;
|
|
30
|
+
if (!componentName || !component.xml) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
fileReadPromises.push(FileProcessor.readComponentFile(componentName, component.xml));
|
|
34
|
+
}
|
|
35
|
+
const fileResults = await Promise.all(fileReadPromises);
|
|
36
|
+
return fileResults.filter((result) => result !== null);
|
|
37
|
+
}
|
|
38
|
+
static async updateMetadataFiles(lightningComponentBundles, enrichmentRecords) {
|
|
39
|
+
const fileContents = await LwcProcessor.readComponentFiles(lightningComponentBundles);
|
|
40
|
+
for (const file of fileContents) {
|
|
41
|
+
if (!LwcProcessor.isMetaXmlFile(file.filePath)) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
let enrichmentRecord;
|
|
45
|
+
for (const record of enrichmentRecords) {
|
|
46
|
+
if (record.componentName === file.componentName) {
|
|
47
|
+
enrichmentRecord = record;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (!enrichmentRecord?.response) {
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
const enrichmentResult = enrichmentRecord.response.results[0];
|
|
55
|
+
if (!enrichmentResult) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
// Check if skipUplift is enabled before processing
|
|
59
|
+
if (LwcProcessor.isSkipUpliftEnabled(file.fileContents)) {
|
|
60
|
+
enrichmentRecord.message = 'skipUplift is set to true';
|
|
61
|
+
enrichmentRecord.status = EnrichmentStatus.SKIPPED;
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
const updatedXml = LwcProcessor.updateMetaXml(file.fileContents, enrichmentResult);
|
|
66
|
+
// eslint-disable-next-line no-await-in-loop
|
|
67
|
+
await writeFile(file.filePath, updatedXml, 'utf-8');
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
71
|
+
enrichmentRecord.message = errorMessage;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return enrichmentRecords;
|
|
75
|
+
}
|
|
76
|
+
static updateMetaXml(xmlContent, result) {
|
|
77
|
+
const parser = new XMLParser({
|
|
78
|
+
htmlEntities: true,
|
|
79
|
+
ignoreAttributes: false,
|
|
80
|
+
processEntities: false,
|
|
81
|
+
trimValues: true,
|
|
82
|
+
});
|
|
83
|
+
const builder = new XMLBuilder({
|
|
84
|
+
format: true,
|
|
85
|
+
ignoreAttributes: false,
|
|
86
|
+
processEntities: false,
|
|
87
|
+
});
|
|
88
|
+
try {
|
|
89
|
+
const xmlObj = parser.parse(xmlContent);
|
|
90
|
+
if (!xmlObj.LightningComponentBundle) {
|
|
91
|
+
xmlObj.LightningComponentBundle = {};
|
|
92
|
+
}
|
|
93
|
+
xmlObj.LightningComponentBundle.ai = {
|
|
94
|
+
skipUplift: 'false',
|
|
95
|
+
description: result.description,
|
|
96
|
+
score: String(result.descriptionScore),
|
|
97
|
+
};
|
|
98
|
+
const builtXml = builder.build(xmlObj);
|
|
99
|
+
return builtXml.trim().replace(/\n{3,}/g, '\n\n');
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
throw new SfError(messages.getMessage('error.parsing.xml', [error instanceof Error ? error.message : String(error)]));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
static isMetaXmlFile(filePath) {
|
|
106
|
+
const fileName = basename(filePath);
|
|
107
|
+
return fileName.endsWith('.js-meta.xml');
|
|
108
|
+
}
|
|
109
|
+
static isSkipUpliftEnabled(xmlContent) {
|
|
110
|
+
try {
|
|
111
|
+
const parser = new XMLParser({ ignoreAttributes: false, preserveOrder: false, trimValues: true });
|
|
112
|
+
const xmlObj = parser.parse(xmlContent);
|
|
113
|
+
const skipUplift = xmlObj.LightningComponentBundle?.ai?.skipUplift;
|
|
114
|
+
return skipUplift === true || String(skipUplift).toLowerCase() === 'true';
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=lwcProcessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lwcProcessor.js","sourceRoot":"","sources":["../../src/files/lwcProcessor.ts"],"names":[],"mappings":"AAAA;;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AC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACxH,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,QAAgB;QAC1C,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACpC,OAAO,QAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IAC3C,CAAC;IAEO,MAAM,CAAC,mBAAmB,CAAC,UAAkB;QACnD,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,gBAAgB,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;YAClG,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU,CAErC,CAAC;YAEF,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,EAAE,EAAE,EAAE,UAAU,CAAC;YACnE,OAAO,UAAU,KAAK,IAAI,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC;QAC5E,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { FileProcessor } from './files/index.js';
|
|
2
|
+
export type { FileReadResult } from './files/index.js';
|
|
3
|
+
export { getMimeTypeFromExtension, EnrichmentHandler, EnrichmentStatus, API_ENDPOINT_ENRICHMENT, LWC_MIME_TYPES, EnrichmentMetrics, } from './enrichment/index.js';
|
|
4
|
+
export type { ContentBundleFile, ContentBundle, EnrichmentRequestBody, EnrichmentMetadata, EnrichmentResult, EnrichMetadataResult, EnrichmentRequestRecord, } from './enrichment/index.js';
|
|
5
|
+
export type { ComponentEnrichmentStatus, MetadataTypeAndName } from './common/index.js';
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export { FileProcessor } from './files/index.js';
|
|
17
|
+
export { getMimeTypeFromExtension, EnrichmentHandler, EnrichmentStatus, API_ENDPOINT_ENRICHMENT, LWC_MIME_TYPES, EnrichmentMetrics, } from './enrichment/index.js';
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACd,iBAAiB,GAClB,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# error.enrichment.request
|
|
2
|
+
|
|
3
|
+
Error sending request for component %s %s
|
|
4
|
+
|
|
5
|
+
# error.parsing.xml
|
|
6
|
+
|
|
7
|
+
Failed to parse XML: %s
|
|
8
|
+
|
|
9
|
+
# error.file.read.failed
|
|
10
|
+
|
|
11
|
+
Failed to read file for component %s
|
|
12
|
+
|
|
13
|
+
# error.enrich.lwc.only
|
|
14
|
+
|
|
15
|
+
Enrichment only supports Lightning Web Components (LightningComponentBundle)
|