@salesforce/source-deploy-retrieve 10.5.6 → 10.6.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/lib/src/client/deployMessages.d.ts +20 -0
- package/lib/src/client/deployMessages.js +146 -0
- package/lib/src/client/deployMessages.js.map +1 -0
- package/lib/src/client/diagnosticUtil.d.ts +4 -8
- package/lib/src/client/diagnosticUtil.js +53 -112
- package/lib/src/client/diagnosticUtil.js.map +1 -1
- package/lib/src/client/index.d.ts +2 -2
- package/lib/src/client/index.js.map +1 -1
- package/lib/src/client/metadataApiDeploy.d.ts +4 -21
- package/lib/src/client/metadataApiDeploy.js +66 -200
- package/lib/src/client/metadataApiDeploy.js.map +1 -1
- package/lib/src/client/metadataApiRetrieve.d.ts +6 -12
- package/lib/src/client/metadataApiRetrieve.js +62 -165
- package/lib/src/client/metadataApiRetrieve.js.map +1 -1
- package/lib/src/client/metadataTransfer.d.ts +6 -6
- package/lib/src/client/metadataTransfer.js +58 -52
- package/lib/src/client/metadataTransfer.js.map +1 -1
- package/lib/src/client/retrieveExtract.d.ts +15 -0
- package/lib/src/client/retrieveExtract.js +130 -0
- package/lib/src/client/retrieveExtract.js.map +1 -0
- package/lib/src/client/types.d.ts +10 -4
- package/lib/src/client/types.js +1 -0
- package/lib/src/client/types.js.map +1 -1
- package/lib/src/collections/componentSet.d.ts +6 -3
- package/lib/src/collections/componentSet.js +31 -23
- package/lib/src/collections/componentSet.js.map +1 -1
- package/lib/src/collections/componentSetBuilder.d.ts +10 -1
- package/lib/src/collections/componentSetBuilder.js +139 -133
- package/lib/src/collections/componentSetBuilder.js.map +1 -1
- package/lib/src/collections/types.d.ts +2 -1
- package/lib/src/collections/types.js +2 -1
- package/lib/src/collections/types.js.map +1 -1
- package/lib/src/common/types.d.ts +2 -2
- package/lib/src/convert/convertContext/convertContext.d.ts +13 -0
- package/lib/src/convert/convertContext/convertContext.js +27 -0
- package/lib/src/convert/convertContext/convertContext.js.map +1 -0
- package/lib/src/convert/convertContext/decompositionFinalizer.d.ts +19 -0
- package/lib/src/convert/convertContext/decompositionFinalizer.js +27 -0
- package/lib/src/convert/convertContext/decompositionFinalizer.js.map +1 -0
- package/lib/src/convert/convertContext/nonDecompositionFinalizer.d.ts +42 -0
- package/lib/src/convert/convertContext/nonDecompositionFinalizer.js +167 -0
- package/lib/src/convert/convertContext/nonDecompositionFinalizer.js.map +1 -0
- package/lib/src/convert/convertContext/recompositionFinalizer.d.ts +29 -0
- package/lib/src/convert/convertContext/recompositionFinalizer.js +122 -0
- package/lib/src/convert/convertContext/recompositionFinalizer.js.map +1 -0
- package/lib/src/convert/convertContext/transactionFinalizer.d.ts +5 -0
- package/lib/src/convert/convertContext/transactionFinalizer.js +7 -0
- package/lib/src/convert/convertContext/transactionFinalizer.js.map +1 -0
- package/lib/src/convert/metadataConverter.d.ts +3 -3
- package/lib/src/convert/metadataConverter.js +37 -27
- package/lib/src/convert/metadataConverter.js.map +1 -1
- package/lib/src/convert/replacements.d.ts +1 -1
- package/lib/src/convert/streams.d.ts +10 -8
- package/lib/src/convert/streams.js +40 -31
- package/lib/src/convert/streams.js.map +1 -1
- package/lib/src/convert/transformers/baseMetadataTransformer.d.ts +3 -3
- package/lib/src/convert/transformers/baseMetadataTransformer.js +3 -3
- package/lib/src/convert/transformers/baseMetadataTransformer.js.map +1 -1
- package/lib/src/convert/transformers/decomposedMetadataTransformer.d.ts +2 -10
- package/lib/src/convert/transformers/decomposedMetadataTransformer.js +172 -164
- package/lib/src/convert/transformers/decomposedMetadataTransformer.js.map +1 -1
- package/lib/src/convert/transformers/defaultMetadataTransformer.d.ts +1 -1
- package/lib/src/convert/transformers/defaultMetadataTransformer.js +9 -9
- package/lib/src/convert/transformers/defaultMetadataTransformer.js.map +1 -1
- package/lib/src/convert/transformers/metadataTransformerFactory.d.ts +2 -2
- package/lib/src/convert/transformers/metadataTransformerFactory.js +1 -1
- package/lib/src/convert/transformers/metadataTransformerFactory.js.map +1 -1
- package/lib/src/convert/transformers/nonDecomposedMetadataTransformer.d.ts +1 -1
- package/lib/src/convert/transformers/nonDecomposedMetadataTransformer.js +7 -7
- package/lib/src/convert/transformers/nonDecomposedMetadataTransformer.js.map +1 -1
- package/lib/src/convert/transformers/staticResourceMetadataTransformer.d.ts +2 -2
- package/lib/src/convert/transformers/staticResourceMetadataTransformer.js +4 -4
- package/lib/src/convert/transformers/staticResourceMetadataTransformer.js.map +1 -1
- package/lib/src/convert/types.d.ts +13 -1
- package/lib/src/registry/coverage.js +10 -10
- package/lib/src/registry/coverage.js.map +1 -1
- package/lib/src/registry/presets/decomposeCustomLabelsBeta.json +43 -0
- package/lib/src/registry/presets/decomposePermissionSetBeta.json +186 -0
- package/lib/src/registry/presets/decomposeSharingRulesBeta.json +81 -0
- package/lib/src/registry/presets/decomposeWorkflowBeta.json +103 -0
- package/lib/src/registry/registry.d.ts +1 -1
- package/lib/src/registry/registry.js +2 -2
- package/lib/src/registry/registry.js.map +1 -1
- package/lib/src/registry/registryAccess.d.ts +2 -1
- package/lib/src/registry/registryAccess.js +6 -3
- package/lib/src/registry/registryAccess.js.map +1 -1
- package/lib/src/registry/standardvalueset.js +2 -2
- package/lib/src/registry/standardvalueset.js.map +1 -1
- package/lib/src/registry/types.d.ts +1 -1
- package/lib/src/registry/variants.d.ts +12 -0
- package/lib/src/registry/variants.js +71 -0
- package/lib/src/registry/variants.js.map +1 -0
- package/lib/src/resolve/adapters/baseSourceAdapter.d.ts +3 -13
- package/lib/src/resolve/adapters/baseSourceAdapter.js +61 -61
- package/lib/src/resolve/adapters/baseSourceAdapter.js.map +1 -1
- package/lib/src/resolve/adapters/bundleSourceAdapter.d.ts +1 -1
- package/lib/src/resolve/adapters/decomposedSourceAdapter.d.ts +2 -2
- package/lib/src/resolve/adapters/decomposedSourceAdapter.js +13 -12
- package/lib/src/resolve/adapters/decomposedSourceAdapter.js.map +1 -1
- package/lib/src/resolve/adapters/defaultSourceAdapter.d.ts +1 -1
- package/lib/src/resolve/adapters/digitalExperienceSourceAdapter.d.ts +2 -2
- package/lib/src/resolve/adapters/digitalExperienceSourceAdapter.js +10 -10
- package/lib/src/resolve/adapters/digitalExperienceSourceAdapter.js.map +1 -1
- package/lib/src/resolve/adapters/matchingContentSourceAdapter.d.ts +1 -2
- package/lib/src/resolve/adapters/matchingContentSourceAdapter.js +4 -7
- package/lib/src/resolve/adapters/matchingContentSourceAdapter.js.map +1 -1
- package/lib/src/resolve/adapters/mixedContentSourceAdapter.d.ts +1 -1
- package/lib/src/resolve/adapters/sourceAdapterFactory.d.ts +2 -1
- package/lib/src/resolve/adapters/sourceAdapterFactory.js +6 -16
- package/lib/src/resolve/adapters/sourceAdapterFactory.js.map +1 -1
- package/lib/src/resolve/connectionResolver.d.ts +1 -1
- package/lib/src/resolve/connectionResolver.js +9 -16
- package/lib/src/resolve/connectionResolver.js.map +1 -1
- package/lib/src/resolve/forceIgnore.d.ts +1 -1
- package/lib/src/resolve/manifestResolver.d.ts +1 -1
- package/lib/src/resolve/manifestResolver.js +39 -35
- package/lib/src/resolve/manifestResolver.js.map +1 -1
- package/lib/src/resolve/metadataResolver.d.ts +2 -47
- package/lib/src/resolve/metadataResolver.js +206 -215
- package/lib/src/resolve/metadataResolver.js.map +1 -1
- package/lib/src/resolve/sourceComponent.d.ts +3 -4
- package/lib/src/resolve/sourceComponent.js +17 -42
- package/lib/src/resolve/sourceComponent.js.map +1 -1
- package/lib/src/resolve/treeContainers.js +5 -14
- package/lib/src/resolve/treeContainers.js.map +1 -1
- package/lib/src/resolve/types.d.ts +2 -2
- package/lib/src/utils/decomposed.d.ts +7 -0
- package/lib/src/utils/decomposed.js +19 -0
- package/lib/src/utils/decomposed.js.map +1 -0
- package/lib/src/utils/filePathGenerator.js +2 -2
- package/lib/src/utils/filePathGenerator.js.map +1 -1
- package/lib/src/utils/fileSystemHandler.d.ts +1 -1
- package/lib/src/utils/index.d.ts +1 -1
- package/lib/src/utils/index.js +2 -1
- package/lib/src/utils/index.js.map +1 -1
- package/lib/src/utils/path.d.ts +17 -2
- package/lib/src/utils/path.js +44 -1
- package/lib/src/utils/path.js.map +1 -1
- package/package.json +5 -8
- package/LICENSE +0 -29
- package/lib/src/convert/convertContext.d.ts +0 -92
- package/lib/src/convert/convertContext.js +0 -304
- package/lib/src/convert/convertContext.js.map +0 -1
- package/lib/src/convert/transformers/index.d.ts +0 -1
- package/lib/src/convert/transformers/index.js +0 -12
- package/lib/src/convert/transformers/index.js.map +0 -1
|
@@ -9,12 +9,15 @@ exports.RegistryAccess = void 0;
|
|
|
9
9
|
*/
|
|
10
10
|
const core_1 = require("@salesforce/core");
|
|
11
11
|
const Levenshtein = require("fast-levenshtein");
|
|
12
|
-
const
|
|
12
|
+
const variants_1 = require("./variants");
|
|
13
13
|
;
|
|
14
14
|
const messages = new core_1.Messages('@salesforce/source-deploy-retrieve', 'sdr', new Map([["md_request_fail", "Metadata API request failed: %s"], ["error_convert_invalid_format", "Invalid conversion format '%s'"], ["error_could_not_infer_type", "%s: Could not infer a metadata type"], ["error_unexpected_child_type", "Unexpected child metadata [%s] found for parent type [%s]"], ["noParent", "Could not find parent type for %s (%s)"], ["error_expected_source_files", "%s: Expected source files for type '%s'"], ["error_failed_convert", "Component conversion failed: %s"], ["error_merge_metadata_target_unsupported", "Merge convert for metadata target format currently unsupported"], ["error_missing_adapter", "Missing adapter '%s' for metadata type '%s'"], ["error_missing_transformer", "Missing transformer '%s' for metadata type '%s'"], ["error_missing_type_definition", "Missing metadata type definition in registry for id '%s'."], ["error_missing_child_type_definition", "Type %s does not have a child type definition %s."], ["noChildTypes", "No child types found in registry for %s (reading %s at %s)"], ["error_no_metadata_xml_ignore", "Metadata xml file %s is forceignored but is required for %s."], ["noSourceIgnore", "%s metadata types require source files, but %s is forceignored."], ["noSourceIgnore.actions", "- Metadata types with content are composed of two files: a content file (ie MyApexClass.cls) and a -meta.xml file (i.e MyApexClass.cls-meta.xml). You must include both files in your .forceignore file. Or try appending \u201C\\*\u201D to your existing .forceignore entry.\n\nSee <https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm> for examples"], ["error_path_not_found", "%s: File or folder not found"], ["noContentFound", "SourceComponent %s (metadata type = %s) is missing its content file."], ["noContentFound.actions", ["Ensure the content file exists in the expected location.", "If the content file is in your .forceignore file, ensure the meta-xml file is also ignored to completely exclude it."]], ["error_parsing_xml", "SourceComponent %s (metadata type = %s) does not have an associated metadata xml to parse"], ["error_expected_file_path", "%s: path is to a directory, expected a file"], ["error_expected_directory_path", "%s: path is to a file, expected a directory"], ["error_directory_not_found_or_not_directory", "%s: path is not a directory"], ["error_no_directory_stream", "%s doesn't support readable streams on directories."], ["error_no_source_to_deploy", "No source-backed components present in the package."], ["error_no_components_to_retrieve", "No components in the package to retrieve."], ["error_static_resource_expected_archive_type", "A StaticResource directory must have a content type of application/zip or application/jar - found %s for %s."], ["error_static_resource_missing_resource_file", "A StaticResource must have an associated .resource file, missing %s.resource-meta.xml"], ["error_no_job_id", "The %s operation is missing a job ID. Initialize an operation with an ID, or start a new job."], ["missingApiVersion", "Could not determine an API version to use for the generated manifest. Tried looking for sourceApiVersion in sfdx-project.json, apiVersion from config vars, and the highest apiVersion from the APEX REST endpoint. Using API version 58.0 as a last resort."], ["invalid_xml_parsing", "error parsing %s due to:\\n message: %s\\n line: %s\\n code: %s"], ["zipBufferError", "Zip buffer was not created during conversion"], ["undefinedComponentSet", "Unable to construct a componentSet. Check the logs for more information."], ["replacementsFileNotRead", "The file \"%s\" specified in the \"replacements\" property of sfdx-project.json could not be read."], ["unsupportedBundleType", "Unsupported Bundle Type: %s"], ["filePathGeneratorNoTypeSupport", "Type not supported for filepath generation: %s"], ["missingFolderType", "The registry has %s as is inFolder but it does not have a folderType"], ["tooManyFiles", "Multiple files found for path: %s."], ["cantGetName", "Unable to calculate fullName from path: %s (%s)"], ["missingMetaFileSuffix", "The metadata registry is configured incorrectly for %s. Expected a metaFileSuffix."], ["uniqueIdElementNotInRegistry", "No uniqueIdElement found in registry for %s (reading %s at %s)."], ["uniqueIdElementNotInChild", "The uniqueIdElement %s was not found the child (reading %s at %s)."], ["suggest_type_header", "A metadata type lookup for \"%s\" found the following close matches:"], ["suggest_type_did_you_mean", "-- Did you mean \".%s%s\" instead for the \"%s\" metadata type?"], ["suggest_type_more_suggestions", "Additional suggestions:\nConfirm the file name, extension, and directory names are correct. Validate against the registry at:\n<https://github.com/forcedotcom/source-deploy-retrieve/blob/main/src/registry/metadataRegistry.json>\n\nIf the type is not listed in the registry, check that it has Metadata API support via the Metadata Coverage Report:\n<https://developer.salesforce.com/docs/metadata-coverage>\n\nIf the type is available via Metadata API but not in the registry\n\n- Open an issue <https://github.com/forcedotcom/cli/issues>\n- Add the type via PR. Instructions: <https://github.com/forcedotcom/source-deploy-retrieve/blob/main/contributing/metadata.md>"]]));
|
|
15
15
|
class RegistryAccess {
|
|
16
|
-
constructor(registry
|
|
17
|
-
this.registry = registry;
|
|
16
|
+
constructor(registry, projectDir) {
|
|
17
|
+
this.registry = registry ?? (0, variants_1.getEffectiveRegistry)({ projectDir });
|
|
18
|
+
}
|
|
19
|
+
getRegistry() {
|
|
20
|
+
return this.registry;
|
|
18
21
|
}
|
|
19
22
|
/**
|
|
20
23
|
* Query a metadata type by its name.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registryAccess.js","sourceRoot":"","sources":["../../../src/registry/registryAccess.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2CAAqD;AACrD,gDAAgD;
|
|
1
|
+
{"version":3,"file":"registryAccess.js","sourceRoot":"","sources":["../../../src/registry/registryAccess.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2CAAqD;AACrD,gDAAgD;AAEhD,yCAAkD;;AAOlD,MAAM,QAAQ,OAAG,eAAQ,CAAc,oCAAoC,EAAE,KAAK,6pKAAC,CAAC;AAEpF,MAAa,cAAc;IAMzB,YAAmB,QAA2B,EAAE,U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QAClB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACrB,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvF,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED;;;;;OAKG;IACI,aAAa,CAAC,SAAiB;QACpC,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;QAC7C,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YACpC,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YACrD,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;CACF;AAjKD,wCAiKC"}
|
|
@@ -7,10 +7,10 @@ exports.standardValueSet = void 0;
|
|
|
7
7
|
* Licensed under the BSD 3-Clause license.
|
|
8
8
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
9
|
*/
|
|
10
|
-
const
|
|
10
|
+
const collections_1 = require("../utils/collections");
|
|
11
11
|
const standardValueSetData = require("./stdValueSetRegistry.json");
|
|
12
12
|
/**
|
|
13
13
|
* The standardValueSet fullNames.
|
|
14
14
|
*/
|
|
15
|
-
exports.standardValueSet = (0,
|
|
15
|
+
exports.standardValueSet = (0, collections_1.deepFreeze)(standardValueSetData);
|
|
16
16
|
//# sourceMappingURL=standardvalueset.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standardvalueset.js","sourceRoot":"","sources":["../../../src/registry/standardvalueset.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,
|
|
1
|
+
{"version":3,"file":"standardvalueset.js","sourceRoot":"","sources":["../../../src/registry/standardvalueset.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,sDAAkD;AAClD,mEAAmE;AAEnE;;GAEG;AACU,QAAA,gBAAgB,GAAG,IAAA,wBAAU,EAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -128,7 +128,7 @@ export interface MetadataType {
|
|
|
128
128
|
* Configuration for resolving and converting components of the type.
|
|
129
129
|
*/
|
|
130
130
|
strategies?: {
|
|
131
|
-
adapter: '
|
|
131
|
+
adapter: 'mixedContent' | 'matchingContentFile' | 'decomposed' | 'digitalExperience' | 'bundle' | 'default';
|
|
132
132
|
transformer?: 'decomposed' | 'staticResource' | 'nonDecomposed' | 'standard';
|
|
133
133
|
decomposition?: 'topLevel' | 'folderPerType';
|
|
134
134
|
recomposition?: 'startEmpty';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MetadataRegistry } from './types';
|
|
2
|
+
export type RegistryLoadInput = {
|
|
3
|
+
/** The project directory to look at sfdx-project.json file
|
|
4
|
+
* will default to the current working directory
|
|
5
|
+
* if no project file is found, the standard registry will be returned without modifications
|
|
6
|
+
*/
|
|
7
|
+
projectDir?: string;
|
|
8
|
+
};
|
|
9
|
+
/** combine the standard registration with any overrides specific in the sfdx-project.json */
|
|
10
|
+
export declare const getEffectiveRegistry: (input?: RegistryLoadInput) => MetadataRegistry;
|
|
11
|
+
/** merge the children of the top-level properties (ex: types, suffixes, etc) on 2 registries */
|
|
12
|
+
export declare const firstLevelMerge: (original: MetadataRegistry, overrides: MetadataRegistry) => MetadataRegistry;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.firstLevelMerge = exports.getEffectiveRegistry = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* Copyright (c) 2023, salesforce.com, inc.
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
* Licensed under the BSD 3-Clause license.
|
|
8
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
|
+
*/
|
|
10
|
+
const fs = require("node:fs");
|
|
11
|
+
const path = require("node:path");
|
|
12
|
+
const core_1 = require("@salesforce/core");
|
|
13
|
+
const collections_1 = require("../utils/collections");
|
|
14
|
+
const registryData = require("./metadataRegistry.json");
|
|
15
|
+
/** combine the standard registration with any overrides specific in the sfdx-project.json */
|
|
16
|
+
const getEffectiveRegistry = (input) => (0, collections_1.deepFreeze)((0, exports.firstLevelMerge)(registryData, loadVariants(input)));
|
|
17
|
+
exports.getEffectiveRegistry = getEffectiveRegistry;
|
|
18
|
+
/** read the project to get additional registry customizations and presets */
|
|
19
|
+
const loadVariants = ({ projectDir } = {}) => {
|
|
20
|
+
const logger = core_1.Logger.childFromRoot('variants');
|
|
21
|
+
try {
|
|
22
|
+
const projJson = core_1.SfProject.getInstance(projectDir ?? process.cwd()).getSfProjectJson();
|
|
23
|
+
// there might not be any customizations in a project, so we default to the emptyRegistry
|
|
24
|
+
const customizations = projJson.get('registryCustomizations') ?? emptyRegistry;
|
|
25
|
+
const presets = projJson.get('registryPresets') ?? [];
|
|
26
|
+
if (Object.keys(customizations.types).length > 0) {
|
|
27
|
+
logger.debug(`found registryCustomizations for types [${Object.keys(customizations.types).join(',')}] in ${projJson.getPath()}`);
|
|
28
|
+
}
|
|
29
|
+
if (presets.length > 0) {
|
|
30
|
+
logger.debug(`using registryPresets [${presets.join(',')}] in ${projJson.getPath()}`);
|
|
31
|
+
}
|
|
32
|
+
const registryFromPresets = presets.reduce((prev, curr) => (0, exports.firstLevelMerge)(prev, loadPreset(curr)), emptyRegistry);
|
|
33
|
+
return (0, exports.firstLevelMerge)(registryFromPresets, customizations);
|
|
34
|
+
}
|
|
35
|
+
catch (e) {
|
|
36
|
+
logger.debug('no project found, using standard registry');
|
|
37
|
+
// there might not be a project at all and that's ok
|
|
38
|
+
return emptyRegistry;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
// TODO: this type should maybe live somewhere else and be part of the sfdx-project schema
|
|
42
|
+
// but we don't want circular dependency from sfdx-core to SDR
|
|
43
|
+
// type CustomRegistry = {
|
|
44
|
+
// registryCustomizations: MetadataRegistry;
|
|
45
|
+
// registryPresets: string[];
|
|
46
|
+
// };
|
|
47
|
+
const loadPreset = (preset) => {
|
|
48
|
+
const pathToCheck = path.join(__dirname, 'presets', `${preset}.json`);
|
|
49
|
+
try {
|
|
50
|
+
const rawPreset = fs.readFileSync(pathToCheck, 'utf-8');
|
|
51
|
+
return JSON.parse(rawPreset);
|
|
52
|
+
}
|
|
53
|
+
catch (e) {
|
|
54
|
+
throw new Error(`Failed to load preset ${preset} in ${pathToCheck}`);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const emptyRegistry = {
|
|
58
|
+
types: {},
|
|
59
|
+
childTypes: {},
|
|
60
|
+
suffixes: {},
|
|
61
|
+
strictDirectoryNames: {},
|
|
62
|
+
};
|
|
63
|
+
/** merge the children of the top-level properties (ex: types, suffixes, etc) on 2 registries */
|
|
64
|
+
const firstLevelMerge = (original, overrides) => ({
|
|
65
|
+
types: { ...original.types, ...(overrides.types ?? {}) },
|
|
66
|
+
childTypes: { ...original.childTypes, ...(overrides.childTypes ?? {}) },
|
|
67
|
+
suffixes: { ...original.suffixes, ...(overrides.suffixes ?? {}) },
|
|
68
|
+
strictDirectoryNames: { ...original.strictDirectoryNames, ...(overrides.strictDirectoryNames ?? {}) },
|
|
69
|
+
});
|
|
70
|
+
exports.firstLevelMerge = firstLevelMerge;
|
|
71
|
+
//# sourceMappingURL=variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variants.js","sourceRoot":"","sources":["../../../src/registry/variants.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,8BAA8B;AAC9B,kCAAkC;AAClC,2CAAqD;AACrD,sDAAkD;AAElD,wDAAwD;AA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C,SAAS,CAAC,UAAU,IAAI,EAAE,CAAC,EAAE;IACvE,QAAQ,EAAE,EAAE,GAAG,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,SAAS,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE;IACjE,oBAAoB,EAAE,EAAE,GAAG,QAAQ,CAAC,oBAAoB,EAAE,GAAG,CAAC,SAAS,CAAC,oBAAoB,IAAI,EAAE,CAAC,EAAE;CACtG,CAAC,CAAC;AALU,QAAA,eAAe,mBAKzB"}
|
|
@@ -2,8 +2,9 @@ import { MetadataXml, SourceAdapter } from '../types';
|
|
|
2
2
|
import { ForceIgnore } from '../forceIgnore';
|
|
3
3
|
import { TreeContainer } from '../treeContainers';
|
|
4
4
|
import { SourceComponent } from '../sourceComponent';
|
|
5
|
-
import { SourcePath } from '../../common';
|
|
6
|
-
import { MetadataType
|
|
5
|
+
import { SourcePath } from '../../common/types';
|
|
6
|
+
import { MetadataType } from '../../registry/types';
|
|
7
|
+
import { RegistryAccess } from '../../registry/registryAccess';
|
|
7
8
|
export declare abstract class BaseSourceAdapter implements SourceAdapter {
|
|
8
9
|
protected type: MetadataType;
|
|
9
10
|
protected registry: RegistryAccess;
|
|
@@ -30,17 +31,6 @@ export declare abstract class BaseSourceAdapter implements SourceAdapter {
|
|
|
30
31
|
*/
|
|
31
32
|
protected parseAsRootMetadataXml(path: SourcePath): MetadataXml | undefined;
|
|
32
33
|
protected parseMetadataXml(path: SourcePath): MetadataXml | undefined;
|
|
33
|
-
/**
|
|
34
|
-
* If the path given to `getComponent` serves as the sole definition (metadata and content)
|
|
35
|
-
* for a component, parse the name and return it. This allows matching files in metadata
|
|
36
|
-
* format such as:
|
|
37
|
-
*
|
|
38
|
-
* .../tabs/MyTab.tab
|
|
39
|
-
*
|
|
40
|
-
* @param path File path of a metadata component
|
|
41
|
-
*/
|
|
42
|
-
private parseAsContentMetadataXml;
|
|
43
|
-
private calculateName;
|
|
44
34
|
/**
|
|
45
35
|
* Determine the related root metadata xml when the path given to `getComponent` isn't one.
|
|
46
36
|
*
|
|
@@ -10,15 +10,15 @@ exports.BaseSourceAdapter = void 0;
|
|
|
10
10
|
const node_path_1 = require("node:path");
|
|
11
11
|
const core_1 = require("@salesforce/core");
|
|
12
12
|
const ts_types_1 = require("@salesforce/ts-types");
|
|
13
|
-
const
|
|
13
|
+
const path_1 = require("../../utils/path");
|
|
14
14
|
const forceIgnore_1 = require("../forceIgnore");
|
|
15
15
|
const treeContainers_1 = require("../treeContainers");
|
|
16
16
|
const sourceComponent_1 = require("../sourceComponent");
|
|
17
|
-
const
|
|
17
|
+
const registryAccess_1 = require("../../registry/registryAccess");
|
|
18
18
|
;
|
|
19
19
|
const messages = new core_1.Messages('@salesforce/source-deploy-retrieve', 'sdr', new Map([["md_request_fail", "Metadata API request failed: %s"], ["error_convert_invalid_format", "Invalid conversion format '%s'"], ["error_could_not_infer_type", "%s: Could not infer a metadata type"], ["error_unexpected_child_type", "Unexpected child metadata [%s] found for parent type [%s]"], ["noParent", "Could not find parent type for %s (%s)"], ["error_expected_source_files", "%s: Expected source files for type '%s'"], ["error_failed_convert", "Component conversion failed: %s"], ["error_merge_metadata_target_unsupported", "Merge convert for metadata target format currently unsupported"], ["error_missing_adapter", "Missing adapter '%s' for metadata type '%s'"], ["error_missing_transformer", "Missing transformer '%s' for metadata type '%s'"], ["error_missing_type_definition", "Missing metadata type definition in registry for id '%s'."], ["error_missing_child_type_definition", "Type %s does not have a child type definition %s."], ["noChildTypes", "No child types found in registry for %s (reading %s at %s)"], ["error_no_metadata_xml_ignore", "Metadata xml file %s is forceignored but is required for %s."], ["noSourceIgnore", "%s metadata types require source files, but %s is forceignored."], ["noSourceIgnore.actions", "- Metadata types with content are composed of two files: a content file (ie MyApexClass.cls) and a -meta.xml file (i.e MyApexClass.cls-meta.xml). You must include both files in your .forceignore file. Or try appending \u201C\\*\u201D to your existing .forceignore entry.\n\nSee <https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm> for examples"], ["error_path_not_found", "%s: File or folder not found"], ["noContentFound", "SourceComponent %s (metadata type = %s) is missing its content file."], ["noContentFound.actions", ["Ensure the content file exists in the expected location.", "If the content file is in your .forceignore file, ensure the meta-xml file is also ignored to completely exclude it."]], ["error_parsing_xml", "SourceComponent %s (metadata type = %s) does not have an associated metadata xml to parse"], ["error_expected_file_path", "%s: path is to a directory, expected a file"], ["error_expected_directory_path", "%s: path is to a file, expected a directory"], ["error_directory_not_found_or_not_directory", "%s: path is not a directory"], ["error_no_directory_stream", "%s doesn't support readable streams on directories."], ["error_no_source_to_deploy", "No source-backed components present in the package."], ["error_no_components_to_retrieve", "No components in the package to retrieve."], ["error_static_resource_expected_archive_type", "A StaticResource directory must have a content type of application/zip or application/jar - found %s for %s."], ["error_static_resource_missing_resource_file", "A StaticResource must have an associated .resource file, missing %s.resource-meta.xml"], ["error_no_job_id", "The %s operation is missing a job ID. Initialize an operation with an ID, or start a new job."], ["missingApiVersion", "Could not determine an API version to use for the generated manifest. Tried looking for sourceApiVersion in sfdx-project.json, apiVersion from config vars, and the highest apiVersion from the APEX REST endpoint. Using API version 58.0 as a last resort."], ["invalid_xml_parsing", "error parsing %s due to:\\n message: %s\\n line: %s\\n code: %s"], ["zipBufferError", "Zip buffer was not created during conversion"], ["undefinedComponentSet", "Unable to construct a componentSet. Check the logs for more information."], ["replacementsFileNotRead", "The file \"%s\" specified in the \"replacements\" property of sfdx-project.json could not be read."], ["unsupportedBundleType", "Unsupported Bundle Type: %s"], ["filePathGeneratorNoTypeSupport", "Type not supported for filepath generation: %s"], ["missingFolderType", "The registry has %s as is inFolder but it does not have a folderType"], ["tooManyFiles", "Multiple files found for path: %s."], ["cantGetName", "Unable to calculate fullName from path: %s (%s)"], ["missingMetaFileSuffix", "The metadata registry is configured incorrectly for %s. Expected a metaFileSuffix."], ["uniqueIdElementNotInRegistry", "No uniqueIdElement found in registry for %s (reading %s at %s)."], ["uniqueIdElementNotInChild", "The uniqueIdElement %s was not found the child (reading %s at %s)."], ["suggest_type_header", "A metadata type lookup for \"%s\" found the following close matches:"], ["suggest_type_did_you_mean", "-- Did you mean \".%s%s\" instead for the \"%s\" metadata type?"], ["suggest_type_more_suggestions", "Additional suggestions:\nConfirm the file name, extension, and directory names are correct. Validate against the registry at:\n<https://github.com/forcedotcom/source-deploy-retrieve/blob/main/src/registry/metadataRegistry.json>\n\nIf the type is not listed in the registry, check that it has Metadata API support via the Metadata Coverage Report:\n<https://developer.salesforce.com/docs/metadata-coverage>\n\nIf the type is available via Metadata API but not in the registry\n\n- Open an issue <https://github.com/forcedotcom/cli/issues>\n- Add the type via PR. Instructions: <https://github.com/forcedotcom/source-deploy-retrieve/blob/main/contributing/metadata.md>"]]));
|
|
20
20
|
class BaseSourceAdapter {
|
|
21
|
-
constructor(type, registry = new
|
|
21
|
+
constructor(type, registry = new registryAccess_1.RegistryAccess(), forceIgnore = new forceIgnore_1.ForceIgnore(), tree = new treeContainers_1.NodeFSTreeContainer()) {
|
|
22
22
|
/**
|
|
23
23
|
* Whether or not an adapter should expect a component to be in its own, self-named
|
|
24
24
|
* folder, including its root metadata xml file.
|
|
@@ -43,7 +43,7 @@ class BaseSourceAdapter {
|
|
|
43
43
|
}
|
|
44
44
|
let component;
|
|
45
45
|
if (rootMetadata) {
|
|
46
|
-
const name = this.
|
|
46
|
+
const name = calculateName(this.registry)(this.type)(rootMetadata);
|
|
47
47
|
component = new sourceComponent_1.SourceComponent({
|
|
48
48
|
name,
|
|
49
49
|
type: this.type,
|
|
@@ -89,72 +89,48 @@ class BaseSourceAdapter {
|
|
|
89
89
|
return folderMetadataXml;
|
|
90
90
|
}
|
|
91
91
|
if (!this.allowMetadataWithContent()) {
|
|
92
|
-
return this.
|
|
92
|
+
return parseAsContentMetadataXml(this.type)(path);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
// allowed to preserve API
|
|
96
96
|
// eslint-disable-next-line class-methods-use-this
|
|
97
97
|
parseMetadataXml(path) {
|
|
98
|
-
return (0,
|
|
98
|
+
return (0, path_1.parseMetadataXml)(path);
|
|
99
99
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
const parentPath = (0, node_path_1.dirname)(path);
|
|
119
|
-
const parts = parentPath.split(node_path_1.sep);
|
|
120
|
-
const typeFolderIndex = parts.lastIndexOf(this.type.directoryName);
|
|
121
|
-
// nestedTypes (ex: territory2) have a folderType equal to their type but are themselves
|
|
122
|
-
// in a folder per metadata item, with child folders for rules/territories
|
|
123
|
-
const allowedIndex = this.type.folderType === this.type.id ? parts.length - 2 : parts.length - 1;
|
|
124
|
-
if (typeFolderIndex !== allowedIndex) {
|
|
125
|
-
return undefined;
|
|
126
|
-
}
|
|
127
|
-
const match = new RegExp(/(.+)\.(.+)/).exec((0, node_path_1.basename)(path));
|
|
128
|
-
if (match && this.type.suffix === match[2]) {
|
|
129
|
-
return { fullName: match[1], suffix: match[2], path };
|
|
100
|
+
}
|
|
101
|
+
exports.BaseSourceAdapter = BaseSourceAdapter;
|
|
102
|
+
/**
|
|
103
|
+
* If the path given to `getComponent` serves as the sole definition (metadata and content)
|
|
104
|
+
* for a component, parse the name and return it. This allows matching files in metadata
|
|
105
|
+
* format such as:
|
|
106
|
+
*
|
|
107
|
+
* .../tabs/MyTab.tab
|
|
108
|
+
*
|
|
109
|
+
* @param path File path of a metadata component
|
|
110
|
+
*/
|
|
111
|
+
const parseAsContentMetadataXml = (type) => (path) => {
|
|
112
|
+
// InFolder metadata can be nested more than 1 level beneath its
|
|
113
|
+
// associated directoryName.
|
|
114
|
+
if (type.inFolder) {
|
|
115
|
+
const fullName = (0, path_1.parseNestedFullName)(path, type.directoryName);
|
|
116
|
+
if (fullName && type.suffix) {
|
|
117
|
+
return { fullName, suffix: type.suffix, path };
|
|
130
118
|
}
|
|
131
119
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
// not using folders? then name is fullname
|
|
141
|
-
if (!folderType) {
|
|
142
|
-
return rootMetadata.fullName;
|
|
143
|
-
}
|
|
144
|
-
const grandparentType = this.registry.getTypeByName(folderType);
|
|
145
|
-
// type is nested inside another type (ex: Territory2Model). So the names are modelName.ruleName or modelName.territoryName
|
|
146
|
-
if (grandparentType.folderType && grandparentType.folderType !== this.type.id) {
|
|
147
|
-
const splits = rootMetadata.path.split(node_path_1.sep);
|
|
148
|
-
return `${splits[splits.indexOf(grandparentType.directoryName) + 1]}.${rootMetadata.fullName}`;
|
|
149
|
-
}
|
|
150
|
-
// this is the top level of nested types (ex: in a Territory2Model, the Territory2Model)
|
|
151
|
-
if (grandparentType.folderType === this.type.id) {
|
|
152
|
-
return rootMetadata.fullName;
|
|
153
|
-
}
|
|
154
|
-
throw messages.createError('cantGetName', [rootMetadata.path, this.type.name]);
|
|
120
|
+
const parentPath = (0, node_path_1.dirname)(path);
|
|
121
|
+
const parts = parentPath.split(node_path_1.sep);
|
|
122
|
+
const typeFolderIndex = parts.lastIndexOf(type.directoryName);
|
|
123
|
+
// nestedTypes (ex: territory2) have a folderType equal to their type but are themselves
|
|
124
|
+
// in a folder per metadata item, with child folders for rules/territories
|
|
125
|
+
const allowedIndex = type.folderType === type.id ? parts.length - 2 : parts.length - 1;
|
|
126
|
+
if (typeFolderIndex !== allowedIndex) {
|
|
127
|
+
return undefined;
|
|
155
128
|
}
|
|
156
|
-
|
|
157
|
-
|
|
129
|
+
const match = new RegExp(/(.+)\.(.+)/).exec((0, node_path_1.basename)(path));
|
|
130
|
+
if (match && type.suffix === match[2]) {
|
|
131
|
+
return { fullName: match[1], suffix: match[2], path };
|
|
132
|
+
}
|
|
133
|
+
};
|
|
158
134
|
const parseAsFolderMetadataXml = (fsPath) => {
|
|
159
135
|
const match = new RegExp(/(.+)-meta\.xml$/).exec((0, node_path_1.basename)(fsPath));
|
|
160
136
|
const parts = fsPath.split(node_path_1.sep);
|
|
@@ -162,4 +138,28 @@ const parseAsFolderMetadataXml = (fsPath) => {
|
|
|
162
138
|
return { fullName: match[1], suffix: undefined, path: fsPath };
|
|
163
139
|
}
|
|
164
140
|
};
|
|
141
|
+
// Given a MetadataXml, build a fullName from the path and type.
|
|
142
|
+
const calculateName = (registry) => (type) => (rootMetadata) => {
|
|
143
|
+
const { directoryName, inFolder, folderType, folderContentType } = type;
|
|
144
|
+
// inFolder types (report, dashboard, emailTemplate, document) and their folder
|
|
145
|
+
// container types (reportFolder, dashboardFolder, emailFolder, documentFolder)
|
|
146
|
+
if (folderContentType ?? inFolder) {
|
|
147
|
+
return (0, ts_types_1.ensureString)((0, path_1.parseNestedFullName)(rootMetadata.path, directoryName), `Unable to calculate fullName from component at path: ${rootMetadata.path} (${type.name})`);
|
|
148
|
+
}
|
|
149
|
+
// not using folders? then name is fullname
|
|
150
|
+
if (!folderType) {
|
|
151
|
+
return rootMetadata.fullName;
|
|
152
|
+
}
|
|
153
|
+
const grandparentType = registry.getTypeByName(folderType);
|
|
154
|
+
// type is nested inside another type (ex: Territory2Model). So the names are modelName.ruleName or modelName.territoryName
|
|
155
|
+
if (grandparentType.folderType && grandparentType.folderType !== type.id) {
|
|
156
|
+
const splits = rootMetadata.path.split(node_path_1.sep);
|
|
157
|
+
return `${splits[splits.indexOf(grandparentType.directoryName) + 1]}.${rootMetadata.fullName}`;
|
|
158
|
+
}
|
|
159
|
+
// this is the top level of nested types (ex: in a Territory2Model, the Territory2Model)
|
|
160
|
+
if (grandparentType.folderType === type.id) {
|
|
161
|
+
return rootMetadata.fullName;
|
|
162
|
+
}
|
|
163
|
+
throw messages.createError('cantGetName', [rootMetadata.path, type.name]);
|
|
164
|
+
};
|
|
165
165
|
//# sourceMappingURL=baseSourceAdapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseSourceAdapter.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/baseSourceAdapter.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,yCAAmD;AACnD,2CAAqD;AACrD,mDAAoD;AAEpD,
|
|
1
|
+
{"version":3,"file":"baseSourceAdapter.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/baseSourceAdapter.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,yCAAmD;AACnD,2CAAqD;AACrD,mDAAoD;AAEpD,2CAAyE;AACzE,gDAA6C;AAC7C,sDAAuE;AACvE,wDAAqD;AAGrD,kEAA+D;;AAG/D,MAAM,QAAQ,OAAG,eAAQ,CAAc,oCAAoC,EAAE,KAAK,6pKAAC,CAAC;AAEpF,MAAsB,iBAAiB;IAarC,YACE,IAAkB,EAClB,QAAQ,GAAG,IAAI,+BAAc,EAAE,EAC/B,cAA2B,IAAI,yBAAW,EAAE,EAC5C,OAAsB,IAAI,oCAAmB,EAAE;QAXjD;;;WAGG;QACO,cAAS,GAAG,KAAK,CAAC;QAClB,wBAAmB,GAAG,IAAI,CAAC;QAQnC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAEM,YAAY,CAAC,IAAgB,EAAE,iBAAiB,GAAG,IAAI;QAC5D,IAAI,YAAY,GAAG,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;QACrD,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,gBAAgB,GAAG,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;YAC3D,IAAI,gBAAgB,EAAE,CAAC;gBACr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AG,CAAC,CAAC;QAC5C,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,YAAY,CAAC,QAAQ,EAAE,CAAC;IACjG,CAAC;IACD,wFAAwF;IACxF,IAAI,eAAe,CAAC,UAAU,KAAK,IAAI,CAAC,EAAE,EAAE,CAAC;QAC3C,OAAO,YAAY,CAAC,QAAQ,CAAC;IAC/B,CAAC;IACD,MAAM,QAAQ,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5E,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SourcePath } from '../../common';
|
|
1
|
+
import { SourcePath } from '../../common/types';
|
|
2
2
|
import { SourceComponent } from '../sourceComponent';
|
|
3
3
|
import { MixedContentSourceAdapter } from './mixedContentSourceAdapter';
|
|
4
4
|
/**
|
|
@@ -34,7 +34,7 @@ export declare class DecomposedSourceAdapter extends MixedContentSourceAdapter {
|
|
|
34
34
|
protected metadataWithContent: boolean;
|
|
35
35
|
getComponent(path: SourcePath, isResolvingSource?: boolean): SourceComponent | undefined;
|
|
36
36
|
/**
|
|
37
|
-
* If the trigger turns out to be part of
|
|
37
|
+
* If the trigger turns out to be part of an addressable child component, `populate` will build
|
|
38
38
|
* the child component, set its parent property to the one created by the
|
|
39
39
|
* `BaseSourceAdapter`, and return the child component instead.
|
|
40
40
|
*/
|
|
@@ -9,7 +9,7 @@ exports.DecomposedSourceAdapter = void 0;
|
|
|
9
9
|
*/
|
|
10
10
|
const core_1 = require("@salesforce/core");
|
|
11
11
|
const sourceComponent_1 = require("../sourceComponent");
|
|
12
|
-
const
|
|
12
|
+
const path_1 = require("../../utils/path");
|
|
13
13
|
const mixedContentSourceAdapter_1 = require("./mixedContentSourceAdapter");
|
|
14
14
|
;
|
|
15
15
|
const messages = new core_1.Messages('@salesforce/source-deploy-retrieve', 'sdr', new Map([["md_request_fail", "Metadata API request failed: %s"], ["error_convert_invalid_format", "Invalid conversion format '%s'"], ["error_could_not_infer_type", "%s: Could not infer a metadata type"], ["error_unexpected_child_type", "Unexpected child metadata [%s] found for parent type [%s]"], ["noParent", "Could not find parent type for %s (%s)"], ["error_expected_source_files", "%s: Expected source files for type '%s'"], ["error_failed_convert", "Component conversion failed: %s"], ["error_merge_metadata_target_unsupported", "Merge convert for metadata target format currently unsupported"], ["error_missing_adapter", "Missing adapter '%s' for metadata type '%s'"], ["error_missing_transformer", "Missing transformer '%s' for metadata type '%s'"], ["error_missing_type_definition", "Missing metadata type definition in registry for id '%s'."], ["error_missing_child_type_definition", "Type %s does not have a child type definition %s."], ["noChildTypes", "No child types found in registry for %s (reading %s at %s)"], ["error_no_metadata_xml_ignore", "Metadata xml file %s is forceignored but is required for %s."], ["noSourceIgnore", "%s metadata types require source files, but %s is forceignored."], ["noSourceIgnore.actions", "- Metadata types with content are composed of two files: a content file (ie MyApexClass.cls) and a -meta.xml file (i.e MyApexClass.cls-meta.xml). You must include both files in your .forceignore file. Or try appending \u201C\\*\u201D to your existing .forceignore entry.\n\nSee <https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm> for examples"], ["error_path_not_found", "%s: File or folder not found"], ["noContentFound", "SourceComponent %s (metadata type = %s) is missing its content file."], ["noContentFound.actions", ["Ensure the content file exists in the expected location.", "If the content file is in your .forceignore file, ensure the meta-xml file is also ignored to completely exclude it."]], ["error_parsing_xml", "SourceComponent %s (metadata type = %s) does not have an associated metadata xml to parse"], ["error_expected_file_path", "%s: path is to a directory, expected a file"], ["error_expected_directory_path", "%s: path is to a file, expected a directory"], ["error_directory_not_found_or_not_directory", "%s: path is not a directory"], ["error_no_directory_stream", "%s doesn't support readable streams on directories."], ["error_no_source_to_deploy", "No source-backed components present in the package."], ["error_no_components_to_retrieve", "No components in the package to retrieve."], ["error_static_resource_expected_archive_type", "A StaticResource directory must have a content type of application/zip or application/jar - found %s for %s."], ["error_static_resource_missing_resource_file", "A StaticResource must have an associated .resource file, missing %s.resource-meta.xml"], ["error_no_job_id", "The %s operation is missing a job ID. Initialize an operation with an ID, or start a new job."], ["missingApiVersion", "Could not determine an API version to use for the generated manifest. Tried looking for sourceApiVersion in sfdx-project.json, apiVersion from config vars, and the highest apiVersion from the APEX REST endpoint. Using API version 58.0 as a last resort."], ["invalid_xml_parsing", "error parsing %s due to:\\n message: %s\\n line: %s\\n code: %s"], ["zipBufferError", "Zip buffer was not created during conversion"], ["undefinedComponentSet", "Unable to construct a componentSet. Check the logs for more information."], ["replacementsFileNotRead", "The file \"%s\" specified in the \"replacements\" property of sfdx-project.json could not be read."], ["unsupportedBundleType", "Unsupported Bundle Type: %s"], ["filePathGeneratorNoTypeSupport", "Type not supported for filepath generation: %s"], ["missingFolderType", "The registry has %s as is inFolder but it does not have a folderType"], ["tooManyFiles", "Multiple files found for path: %s."], ["cantGetName", "Unable to calculate fullName from path: %s (%s)"], ["missingMetaFileSuffix", "The metadata registry is configured incorrectly for %s. Expected a metaFileSuffix."], ["uniqueIdElementNotInRegistry", "No uniqueIdElement found in registry for %s (reading %s at %s)."], ["uniqueIdElementNotInChild", "The uniqueIdElement %s was not found the child (reading %s at %s)."], ["suggest_type_header", "A metadata type lookup for \"%s\" found the following close matches:"], ["suggest_type_did_you_mean", "-- Did you mean \".%s%s\" instead for the \"%s\" metadata type?"], ["suggest_type_more_suggestions", "Additional suggestions:\nConfirm the file name, extension, and directory names are correct. Validate against the registry at:\n<https://github.com/forcedotcom/source-deploy-retrieve/blob/main/src/registry/metadataRegistry.json>\n\nIf the type is not listed in the registry, check that it has Metadata API support via the Metadata Coverage Report:\n<https://developer.salesforce.com/docs/metadata-coverage>\n\nIf the type is available via Metadata API but not in the registry\n\n- Open an issue <https://github.com/forcedotcom/cli/issues>\n- Add the type via PR. Instructions: <https://github.com/forcedotcom/source-deploy-retrieve/blob/main/contributing/metadata.md>"]]));
|
|
@@ -52,13 +52,13 @@ class DecomposedSourceAdapter extends mixedContentSourceAdapter_1.MixedContentSo
|
|
|
52
52
|
if (!rootMetadata) {
|
|
53
53
|
const rootMetadataPath = this.getRootMetadataXmlPath(path);
|
|
54
54
|
if (rootMetadataPath) {
|
|
55
|
-
rootMetadata = (0,
|
|
55
|
+
rootMetadata = (0, path_1.parseMetadataXml)(rootMetadataPath);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
let component;
|
|
59
59
|
if (rootMetadata) {
|
|
60
60
|
const componentName = this.type.folderType
|
|
61
|
-
? `${(0,
|
|
61
|
+
? `${(0, path_1.parentName)(rootMetadata.path)}/${rootMetadata.fullName}`
|
|
62
62
|
: rootMetadata.fullName;
|
|
63
63
|
component = new sourceComponent_1.SourceComponent({
|
|
64
64
|
name: componentName,
|
|
@@ -69,26 +69,27 @@ class DecomposedSourceAdapter extends mixedContentSourceAdapter_1.MixedContentSo
|
|
|
69
69
|
return this.populate(path, component, isResolvingSource);
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
|
-
* If the trigger turns out to be part of
|
|
72
|
+
* If the trigger turns out to be part of an addressable child component, `populate` will build
|
|
73
73
|
* the child component, set its parent property to the one created by the
|
|
74
74
|
* `BaseSourceAdapter`, and return the child component instead.
|
|
75
75
|
*/
|
|
76
76
|
populate(trigger, component, isResolvingSource) {
|
|
77
|
-
const metaXml = (0,
|
|
77
|
+
const metaXml = (0, path_1.parseMetadataXml)(trigger);
|
|
78
78
|
if (metaXml?.suffix) {
|
|
79
79
|
const pathToContent = this.trimPathToContent(trigger);
|
|
80
80
|
const childTypeId = this.type.children?.suffixes?.[metaXml.suffix];
|
|
81
81
|
const triggerIsAChild = !!childTypeId;
|
|
82
82
|
const strategy = this.type.strategies?.decomposition;
|
|
83
|
-
if (triggerIsAChild &&
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
if (triggerIsAChild &&
|
|
84
|
+
this.type.children &&
|
|
85
|
+
!this.type.children.types[childTypeId].unaddressableWithoutParent &&
|
|
86
|
+
this.type.children.types[childTypeId].isAddressable !== false) {
|
|
87
|
+
if (strategy === 'folderPerType' || strategy === 'topLevel' || isResolvingSource) {
|
|
88
|
+
const parent = component ??
|
|
89
|
+
new sourceComponent_1.SourceComponent({
|
|
90
|
+
name: strategy === 'folderPerType' ? (0, path_1.baseName)(pathToContent) : pathToContent,
|
|
89
91
|
type: this.type,
|
|
90
92
|
}, this.tree, this.forceIgnore);
|
|
91
|
-
}
|
|
92
93
|
parent.content = pathToContent;
|
|
93
94
|
return new sourceComponent_1.SourceComponent({
|
|
94
95
|
name: metaXml.fullName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decomposedSourceAdapter.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/decomposedSourceAdapter.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2CAAqD;AAErD,wDAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"decomposedSourceAdapter.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/decomposedSourceAdapter.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2CAAqD;AAErD,wDAAqD;AACrD,2CAA0E;AAC1E,2EAAwE;;AAGxE,MAAM,QAAQ,OAAG,eAAQ,CAAc,oCAAoC,EAAE,KAAK,6pKAAC,CAAC;AAEpF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAa,uBAAwB,SAAQ,qDAAyB;IAAtE;;QACY,cAAS,GAAG,IAAI,CAAC;QACjB,wBAAmB,GAAG,KAAK,CAAC;IAwFxC,CAAC;IAtFQ,YAAY,CAAC,IAAgB,EAAE,iBAAiB,GAAG,IAAI;QAC5D,IAAI,YAAY,GAAG,KAAK,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;QAEtD,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,gBAAg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QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA1FD,0DA0FC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SourcePath } from '../../common/types';
|
|
2
|
+
import { SourceComponent } from '../sourceComponent';
|
|
2
3
|
import { MetadataXml } from '../types';
|
|
3
|
-
import { SourcePath } from '../../common';
|
|
4
4
|
import { BundleSourceAdapter } from './bundleSourceAdapter';
|
|
5
5
|
/**
|
|
6
6
|
* Source Adapter for DigitalExperience metadata types. This metadata type is a bundled type of the format
|