@salesforce/plugin-deploy-retrieve 1.1.3 → 1.3.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +35 -7
  3. package/lib/commands/deploy/metadata.d.ts +15 -12
  4. package/lib/commands/deploy/metadata.js +79 -70
  5. package/lib/commands/deploy/metadata.js.map +1 -1
  6. package/lib/commands/deploy.d.ts +2 -0
  7. package/lib/commands/deploy.js +19 -0
  8. package/lib/commands/deploy.js.map +1 -1
  9. package/lib/commands/retrieve/metadata.d.ts +5 -3
  10. package/lib/commands/retrieve/metadata.js +49 -47
  11. package/lib/commands/retrieve/metadata.js.map +1 -1
  12. package/lib/hooks/deploy.js +1 -1
  13. package/lib/hooks/deploy.js.map +1 -1
  14. package/lib/utils/deploy.d.ts +29 -0
  15. package/lib/utils/deploy.js +81 -0
  16. package/lib/utils/deploy.js.map +1 -0
  17. package/lib/utils/metadataDeployer.d.ts +1 -1
  18. package/lib/utils/metadataDeployer.js +14 -13
  19. package/lib/utils/metadataDeployer.js.map +1 -1
  20. package/lib/utils/output.d.ts +8 -9
  21. package/lib/utils/output.js +127 -29
  22. package/lib/utils/output.js.map +1 -1
  23. package/lib/utils/progressBar.d.ts +1 -1
  24. package/lib/utils/project.d.ts +3 -0
  25. package/lib/utils/project.js +22 -0
  26. package/lib/utils/project.js.map +1 -0
  27. package/lib/utils/{testLevel.d.ts → types.d.ts} +10 -0
  28. package/lib/utils/{testLevel.js → types.js} +7 -2
  29. package/lib/utils/types.js.map +1 -0
  30. package/messages/deploy.md +16 -3
  31. package/messages/deploy.metadata.md +42 -2
  32. package/messages/retrieve.metadata.md +10 -2
  33. package/oclif.manifest.json +1 -1
  34. package/package.json +30 -14
  35. package/schemas/deploy-metadata.json +5 -2
  36. package/lib/utils/componentSetBuilder.d.ts +0 -28
  37. package/lib/utils/componentSetBuilder.js +0 -124
  38. package/lib/utils/componentSetBuilder.js.map +0 -1
  39. package/lib/utils/config.d.ts +0 -1
  40. package/lib/utils/config.js +0 -18
  41. package/lib/utils/config.js.map +0 -1
  42. package/lib/utils/orgs.d.ts +0 -4
  43. package/lib/utils/orgs.js +0 -39
  44. package/lib/utils/orgs.js.map +0 -1
  45. package/lib/utils/requiredFlagValidator.d.ts +0 -3
  46. package/lib/utils/requiredFlagValidator.js +0 -19
  47. package/lib/utils/requiredFlagValidator.js.map +0 -1
  48. package/lib/utils/testLevel.js.map +0 -1
  49. package/messages/required.flag.md +0 -3
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-deploy-retrieve",
3
3
  "description": "deploy and retrieve commands for sf",
4
- "version": "1.1.3",
4
+ "version": "1.3.0",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/forcedotcom/cli/issues",
7
7
  "dependencies": {
8
- "@oclif/core": "^1.6.0",
8
+ "@oclif/core": "^1.6.4",
9
9
  "@salesforce/core": "^3.8.0",
10
- "@salesforce/sf-plugins-core": "^1.7.2",
11
- "@sf/sdr": "npm:@salesforce/source-deploy-retrieve@^5.12.4",
10
+ "@salesforce/sf-plugins-core": "^1.11.0",
11
+ "@salesforce/source-deploy-retrieve": "^5.12.4",
12
12
  "chalk": "^4.1.2",
13
13
  "fs-extra": "^10.0.1",
14
14
  "shelljs": "^0.8.5",
@@ -17,11 +17,13 @@
17
17
  "devDependencies": {
18
18
  "@oclif/plugin-command-snapshot": "^3.1.3",
19
19
  "@salesforce/cli-plugins-testkit": "^1.5.20",
20
- "@salesforce/dev-config": "^2.1.3",
21
- "@salesforce/dev-scripts": "^1.0.4",
22
- "@salesforce/plugin-command-reference": "^1.3.18",
20
+ "@salesforce/dev-config": "^3.0.1",
21
+ "@salesforce/dev-scripts": "^2.0.1",
22
+ "@salesforce/plugin-command-reference": "^2.2.1",
23
23
  "@salesforce/plugin-config": "^2.3.0",
24
24
  "@salesforce/plugin-functions": "^1.7.0",
25
+ "@salesforce/plugin-source": "^1.8.18",
26
+ "@salesforce/plugin-user": "^1.7.1",
25
27
  "@salesforce/prettier-config": "^0.0.2",
26
28
  "@salesforce/source-testkit": "^0.0.18",
27
29
  "@salesforce/ts-sinon": "1.3.21",
@@ -30,6 +32,7 @@
30
32
  "@typescript-eslint/eslint-plugin": "^4.33.0",
31
33
  "@typescript-eslint/parser": "^4.33.0",
32
34
  "chai": "^4.3.6",
35
+ "cross-env": "^7.0.3",
33
36
  "cz-conventional-changelog": "^3.3.0",
34
37
  "eslint": "^7.32.0",
35
38
  "eslint-config-prettier": "^6.15.0",
@@ -42,16 +45,21 @@
42
45
  "eslint-plugin-prettier": "^3.4.1",
43
46
  "husky": "^7.0.4",
44
47
  "lint-staged": "^11.2.6",
45
- "mocha": "^8.4.0",
48
+ "mocha": "^9.1.3",
46
49
  "nyc": "^15.1.0",
47
- "oclif": "^2.6.0",
50
+ "oclif": "^2.6.3",
48
51
  "prettier": "^2.5.1",
49
52
  "pretty-quick": "^3.1.3",
53
+ "salesforcedx-templates": "^49.8.0",
50
54
  "shx": "0.3.4",
51
55
  "sinon": "11.1.2",
52
56
  "ts-node": "^10.7.0",
53
57
  "typescript": "^4.6.2"
54
58
  },
59
+ "resolutions": {
60
+ "@oclif/core": "^1.6.4",
61
+ "@salesforce/sf-plugins-core": "^1.11.0"
62
+ },
55
63
  "config": {
56
64
  "commitizen": {
57
65
  "path": "cz-conventional-changelog"
@@ -84,11 +92,14 @@
84
92
  "sf:deploy": "./lib/hooks/deploy"
85
93
  },
86
94
  "devPlugins": [
87
- "@oclif/plugin-help",
88
95
  "@oclif/plugin-command-snapshot",
96
+ "@oclif/plugin-help",
89
97
  "@salesforce/plugin-command-reference",
90
98
  "@salesforce/plugin-config",
91
- "@salesforce/plugin-functions"
99
+ "@salesforce/plugin-functions",
100
+ "@salesforce/plugin-source",
101
+ "@salesforce/plugin-user",
102
+ "salesforcedx-templates"
92
103
  ],
93
104
  "topics": {
94
105
  "deploy": {
@@ -118,7 +129,12 @@
118
129
  "test:command-reference": "./bin/dev commandreference:generate --erroronwarnings",
119
130
  "test:deprecation-policy": "./bin/dev snapshot:compare",
120
131
  "test:json-schema": "./bin/dev schema:compare",
121
- "test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000",
132
+ "test:nuts": "ts-node ./test/nuts/generateNuts.ts && nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0",
133
+ "test:nuts:deploy:metadata:manifest": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.manifest ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0",
134
+ "test:nuts:deploy:metadata:metadata": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.metadata ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0",
135
+ "test:nuts:deploy:metadata:source-dir": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.source-dir ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0",
136
+ "test:nuts:deploy:metadata:test-level": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.test-level ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0",
137
+ "test:nuts:static": "nyc mocha \"test/commands/**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0",
122
138
  "version": "oclif readme"
123
139
  },
124
140
  "publishConfig": {
@@ -126,7 +142,7 @@
126
142
  },
127
143
  "main": "lib/index.js",
128
144
  "sfdx": {
129
- "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-deploy-retrieve/1.1.3.crt",
130
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-deploy-retrieve/1.1.3.sig"
145
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-deploy-retrieve/1.3.0.crt",
146
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-deploy-retrieve/1.3.0.sig"
131
147
  }
132
148
  }
@@ -11,11 +11,14 @@
11
11
  "$ref": "#/definitions/FileResponse"
12
12
  }
13
13
  },
14
+ "jobId": {
15
+ "type": "string"
16
+ },
14
17
  "tests": {
15
18
  "$ref": "#/definitions/TestResults"
16
19
  }
17
20
  },
18
- "required": ["files"],
21
+ "required": ["files", "jobId"],
19
22
  "additionalProperties": false
20
23
  },
21
24
  "FileResponse": {
@@ -88,7 +91,7 @@
88
91
  "type": "number"
89
92
  },
90
93
  "time": {
91
- "type": "number"
94
+ "type": "string"
92
95
  }
93
96
  },
94
97
  "required": ["passing", "failing", "total"],
@@ -1,28 +0,0 @@
1
- import { ComponentSet } from '@sf/sdr';
2
- export declare type ManifestOption = {
3
- manifestPath: string;
4
- directoryPaths: string[];
5
- };
6
- export declare type MetadataOption = {
7
- metadataEntries: string[];
8
- directoryPaths: string[];
9
- };
10
- export declare type ComponentSetOptions = {
11
- packagenames?: string[];
12
- sourcepath?: string[];
13
- manifest?: ManifestOption;
14
- metadata?: MetadataOption;
15
- apiversion?: string;
16
- sourceapiversion?: string;
17
- };
18
- export declare class ComponentSetBuilder {
19
- /**
20
- * Builds a ComponentSet that can be used for source conversion,
21
- * deployment, or retrieval, using all specified options.
22
- *
23
- * @see https://github.com/forcedotcom/source-deploy-retrieve/blob/develop/src/collections/componentSet.ts
24
- *
25
- * @param options: options for creating a ComponentSet
26
- */
27
- static build(options: ComponentSetOptions): Promise<ComponentSet>;
28
- }
@@ -1,124 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright (c) 2021, salesforce.com, inc.
4
- * All rights reserved.
5
- * Licensed under the BSD 3-Clause license.
6
- * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.ComponentSetBuilder = void 0;
10
- const path = require("path");
11
- const sdr_1 = require("@sf/sdr");
12
- const core_1 = require("@salesforce/core");
13
- const fs_extra_1 = require("fs-extra");
14
- class ComponentSetBuilder {
15
- /**
16
- * Builds a ComponentSet that can be used for source conversion,
17
- * deployment, or retrieval, using all specified options.
18
- *
19
- * @see https://github.com/forcedotcom/source-deploy-retrieve/blob/develop/src/collections/componentSet.ts
20
- *
21
- * @param options: options for creating a ComponentSet
22
- */
23
- static async build(options) {
24
- var _a, _b;
25
- const logger = core_1.Logger.childFromRoot('createComponentSet');
26
- let componentSet;
27
- const { sourcepath, manifest, metadata, packagenames, apiversion, sourceapiversion } = options;
28
- try {
29
- if (sourcepath) {
30
- logger.debug(`Building ComponentSet from sourcepath: ${sourcepath.toString()}`);
31
- const fsPaths = [];
32
- sourcepath.forEach((filepath) => {
33
- if (!(0, fs_extra_1.pathExistsSync)(filepath)) {
34
- throw new core_1.SfdxError(`The sourcepath "${filepath}" is not a valid source file path.`);
35
- }
36
- fsPaths.push(path.resolve(filepath));
37
- });
38
- componentSet = sdr_1.ComponentSet.fromSource({ fsPaths });
39
- }
40
- // Return empty ComponentSet and use packageNames in the library via `.retrieve` options
41
- if (packagenames) {
42
- logger.debug(`Building ComponentSet for packagenames: ${packagenames.toString()}`);
43
- componentSet !== null && componentSet !== void 0 ? componentSet : (componentSet = new sdr_1.ComponentSet());
44
- }
45
- // Resolve manifest with source in package directories.
46
- if (manifest) {
47
- logger.debug(`Building ComponentSet from manifest: ${manifest.manifestPath}`);
48
- const directoryPaths = options.manifest.directoryPaths;
49
- logger.debug(`Searching in packageDir: ${directoryPaths.join(', ')} for matching metadata`);
50
- componentSet = await sdr_1.ComponentSet.fromManifest({
51
- manifestPath: manifest.manifestPath,
52
- resolveSourcePaths: options.manifest.directoryPaths,
53
- forceAddWildcards: true,
54
- });
55
- }
56
- // Resolve metadata entries with source in package directories.
57
- if (metadata) {
58
- logger.debug(`Building ComponentSet from metadata: ${metadata.metadataEntries.toString()}`);
59
- const registry = new sdr_1.RegistryAccess();
60
- const compSetFilter = new sdr_1.ComponentSet();
61
- componentSet !== null && componentSet !== void 0 ? componentSet : (componentSet = new sdr_1.ComponentSet());
62
- // Build a Set of metadata entries
63
- metadata.metadataEntries.forEach((rawEntry) => {
64
- const splitEntry = rawEntry.split(':');
65
- // The registry will throw if it doesn't know what this type is.
66
- registry.getTypeByName(splitEntry[0]);
67
- const entry = {
68
- type: splitEntry[0],
69
- fullName: splitEntry.length === 1 ? '*' : splitEntry[1],
70
- };
71
- // Add to the filtered ComponentSet for resolved source paths,
72
- // and the unfiltered ComponentSet to build the correct manifest.
73
- compSetFilter.add(entry);
74
- componentSet.add(entry);
75
- });
76
- const directoryPaths = options.metadata.directoryPaths;
77
- logger.debug(`Searching for matching metadata in directories: ${directoryPaths.join(', ')}`);
78
- const resolvedComponents = sdr_1.ComponentSet.fromSource({ fsPaths: directoryPaths, include: compSetFilter });
79
- componentSet.forceIgnoredPaths = resolvedComponents.forceIgnoredPaths;
80
- for (const comp of resolvedComponents) {
81
- componentSet.add(comp);
82
- }
83
- }
84
- }
85
- catch (e) {
86
- if (e.message.includes('Missing metadata type definition in registry for id')) {
87
- // to remain generic to catch missing metadata types regardless of parameters, split on '
88
- // example message : Missing metadata type definition in registry for id 'NonExistentType'
89
- const issueType = e.message.split("'")[1];
90
- throw new core_1.SfdxError(`The specified metadata type is unsupported: [${issueType}]`);
91
- }
92
- else {
93
- throw e;
94
- }
95
- }
96
- // This is only for debug output of matched files based on the command flags.
97
- // It will log up to 20 file matches.
98
- if (logger.debugEnabled && componentSet.size) {
99
- logger.debug(`Matching metadata files (${componentSet.size}):`);
100
- const components = componentSet.getSourceComponents().toArray();
101
- for (let i = 0; i < componentSet.size; i++) {
102
- if ((_a = components[i]) === null || _a === void 0 ? void 0 : _a.content) {
103
- logger.debug(components[i].content);
104
- }
105
- else if ((_b = components[i]) === null || _b === void 0 ? void 0 : _b.xml) {
106
- logger.debug(components[i].xml);
107
- }
108
- if (i > 18) {
109
- logger.debug(`(showing 20 of ${componentSet.size} matches)`);
110
- break;
111
- }
112
- }
113
- }
114
- if (apiversion) {
115
- componentSet.apiVersion = apiversion;
116
- }
117
- if (sourceapiversion) {
118
- componentSet.sourceApiVersion = sourceapiversion;
119
- }
120
- return componentSet;
121
- }
122
- }
123
- exports.ComponentSetBuilder = ComponentSetBuilder;
124
- //# sourceMappingURL=componentSetBuilder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"componentSetBuilder.js","sourceRoot":"","sources":["../../src/utils/componentSetBuilder.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,6BAA6B;AAC7B,iCAAuD;AACvD,2CAAqD;AACrD,uCAA0C;AAmB1C,MAAa,mBAAmB;IAC9B;;;;;;;OAOG;IACI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAA4B;;QACpD,MAAM,MAAM,GAAG,aAAM,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;QAC1D,IAAI,YAA0B,CAAC;QAE/B,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC;QAC/F,IAAI;YACF,IAAI,UAAU,EAAE;gBACd,MAAM,CAAC,KAAK,CAAC,0CAA0C,UAAU,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;gBAChF,MAAM,OAAO,GAAa,EAAE,CAAC;gBAC7B,UAAU,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;oBAC9B,IAAI,CAAC,IAAA,yBAAc,EAAC,QAAQ,CAAC,EAAE;wBAC7B,MAAM,IAAI,gBAAS,CAAC,mBAAmB,QAAQ,oCAAoC,CAAC,CAAC;qBACtF;oBACD,OAAO,CAAC,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AAS,CAAC,gDAAgD,SAAS,GAAG,CAAC,CAAC;aACnF;iBAAM;gBACL,MAAM,CAAC,CAAC;aACT;SACF;QAED,6EAA6E;QAC7E,qCAAqC;QACrC,IAAI,MAAM,CAAC,YAAY,IAAI,YAAY,CAAC,IAAI,EAAE;YAC5C,MAAM,CAAC,KAAK,CAAC,4BAA4B,YAAY,CAAC,IAAI,IAAI,CAAC,CAAC;YAChE,MAAM,UAAU,GAAG,YAAY,CAAC,mBAAmB,EAAE,CAAC,OAAO,EAAE,CAAC;YAChE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;gBAC1C,IAAI,MAAA,UAAU,CAAC,CAAC,CAAC,0CAAE,OAAO,EAAE;oBAC1B,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;iBACrC;qBAAM,IAAI,MAAA,UAAU,CAAC,CAAC,CAAC,0CAAE,GAAG,EAAE;oBAC7B,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;iBACjC;gBAED,IAAI,CAAC,GAAG,EAAE,EAAE;oBACV,MAAM,CAAC,KAAK,CAAC,kBAAkB,YAAY,CAAC,IAAI,WAAW,CAAC,CAAC;oBAC7D,MAAM;iBACP;aACF;SACF;QAED,IAAI,UAAU,EAAE;YACd,YAAY,CAAC,UAAU,GAAG,UAAU,CAAC;SACtC;QAED,IAAI,gBAAgB,EAAE;YACpB,YAAY,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;SAClD;QAED,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AAnHD,kDAmHC"}
@@ -1 +0,0 @@
1
- export declare const resolveRestDeploy: () => string;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveRestDeploy = void 0;
4
- /*
5
- * Copyright (c) 2020, 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 core_1 = require("@salesforce/core");
11
- const resolveRestDeploy = function () {
12
- const restDeploy = (core_1.ConfigAggregator.getValue(core_1.SfdxPropertyKeys.REST_DEPLOY).value === 'true' ? true : false)
13
- ? 'REST'
14
- : 'SOAP';
15
- return restDeploy;
16
- };
17
- exports.resolveRestDeploy = resolveRestDeploy;
18
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2CAAsE;AAE/D,MAAM,iBAAiB,GAAG;IAC/B,MAAM,UAAU,GAAG,CAAC,uBAAgB,CAAC,QAAQ,CAAC,uBAAgB,CAAC,WAAW,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;QAC1G,CAAC,CAAC,MAAM;QACR,CAAC,CAAC,MAAM,CAAC;IACX,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AALW,QAAA,iBAAiB,qBAK5B"}
@@ -1,4 +0,0 @@
1
- import { Nullable } from '@salesforce/ts-types';
2
- export declare const resolveTargetOrg: (targetOrg: Nullable<string>) => Promise<string>;
3
- export declare const getPackageDirs: () => Promise<string[]>;
4
- export declare const getSourceApiVersion: () => Promise<string>;
package/lib/utils/orgs.js DELETED
@@ -1,39 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright (c) 2020, salesforce.com, inc.
4
- * All rights reserved.
5
- * Licensed under the BSD 3-Clause license.
6
- * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.getSourceApiVersion = exports.getPackageDirs = exports.resolveTargetOrg = void 0;
10
- const core_1 = require("@salesforce/core");
11
- const ts_types_1 = require("@salesforce/ts-types");
12
- const resolveTargetOrg = async (targetOrg) => {
13
- const configuredTargetOrg = getConfigValue(core_1.OrgConfigProperties.TARGET_ORG);
14
- const aliasOrUsername = targetOrg || configuredTargetOrg;
15
- if (!aliasOrUsername) {
16
- throw new core_1.SfdxError('no target environment specified', 'NoTargetEnv', [
17
- 'specify target environment with the --target-org flag',
18
- 'set the default environment with "sf config set target-org"',
19
- ]);
20
- }
21
- return (await core_1.GlobalInfo.getInstance()).aliases.resolveUsername(aliasOrUsername);
22
- };
23
- exports.resolveTargetOrg = resolveTargetOrg;
24
- const getPackageDirs = async () => {
25
- const project = await core_1.SfdxProject.resolve();
26
- return project.getUniquePackageDirectories().map((pDir) => pDir.fullPath);
27
- };
28
- exports.getPackageDirs = getPackageDirs;
29
- const getConfigValue = (key) => {
30
- var _a;
31
- return (_a = core_1.ConfigAggregator.getValue(key)) === null || _a === void 0 ? void 0 : _a.value;
32
- };
33
- const getSourceApiVersion = async () => {
34
- const project = await core_1.SfdxProject.resolve();
35
- const projectConfig = await project.resolveProjectConfig();
36
- return (0, ts_types_1.getString)(projectConfig, 'sourceApiVersion');
37
- };
38
- exports.getSourceApiVersion = getSourceApiVersion;
39
- //# sourceMappingURL=orgs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"orgs.js","sourceRoot":"","sources":["../../src/utils/orgs.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2CAA6G;AAC7G,mDAAoE;AAE7D,MAAM,gBAAgB,GAAG,KAAK,EAAE,SAA2B,EAAmB,EAAE;IACrF,MAAM,mBAAmB,GAAG,cAAc,CAAS,0BAAmB,CAAC,UAAU,CAAC,CAAC;IACnF,MAAM,eAAe,GAAG,SAAS,IAAI,mBAAmB,CAAC;IAEzD,IAAI,CAAC,eAAe,EAAE;QACpB,MAAM,IAAI,gBAAS,CAAC,iCAAiC,EAAE,aAAa,EAAE;YACpE,uDAAuD;YACvD,6DAA6D;SAC9D,CAAC,CAAC;KACJ;IACD,OAAO,CAAC,MAAM,iBAAU,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC;AACnF,CAAC,CAAC;AAXW,QAAA,gBAAgB,oBAW3B;AAEK,MAAM,cAAc,GAAG,KAAK,IAAuB,EAAE;IAC1D,MAAM,OAAO,GAAG,MAAM,kBAAW,CAAC,OAAO,EAAE,CAAC;IAC5C,OAAO,OAAO,CAAC,2BAA2B,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC5E,CAAC,CAAC;AAHW,QAAA,cAAc,kBAGzB;AAEF,MAAM,cAAc,GAAG,CAAoB,GAAW,EAAK,EAAE;;IAC3D,OAAO,MAAA,uBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC,0CAAE,KAAU,CAAC;AACpD,CAAC,CAAC;AAEK,MAAM,mBAAmB,GAAG,KAAK,IAAqB,EAAE;IAC7D,MAAM,OAAO,GAAG,MAAM,kBAAW,CAAC,OAAO,EAAE,CAAC;IAC5C,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAC3D,OAAO,IAAA,oBAAS,EAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC;AACtD,CAAC,CAAC;AAJW,QAAA,mBAAmB,uBAI9B"}
@@ -1,3 +0,0 @@
1
- export declare function validateOneOfCommandFlags(oneOf: string[], flags: {
2
- [name: string]: unknown;
3
- }): void;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateOneOfCommandFlags = void 0;
4
- /*
5
- * Copyright (c) 2020, 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 core_1 = require("@salesforce/core");
11
- core_1.Messages.importMessagesDirectory(__dirname);
12
- const messages = core_1.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'required.flag');
13
- function validateOneOfCommandFlags(oneOf, flags) {
14
- if (!Object.keys(flags).some((flag) => oneOf.includes(flag))) {
15
- throw messages.createError('errors.RequiredOneOfFlagsMissing', [oneOf.join(', ')]);
16
- }
17
- }
18
- exports.validateOneOfCommandFlags = validateOneOfCommandFlags;
19
- //# sourceMappingURL=requiredFlagValidator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"requiredFlagValidator.js","sourceRoot":"","sources":["../../src/utils/requiredFlagValidator.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2CAA4C;AAE5C,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,oCAAoC,EAAE,eAAe,CAAC,CAAC;AAE9F,SAAgB,yBAAyB,CAAC,KAAe,EAAE,KAAkC;IAC3F,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE;QAC5D,MAAM,QAAQ,CAAC,WAAW,CAAC,kCAAkC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACpF;AACH,CAAC;AAJD,8DAIC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"testLevel.js","sourceRoot":"","sources":["../../src/utils/testLevel.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,oCAAuB,CAAA;IACvB,oDAAuC,CAAA;IACvC,4CAA+B,CAAA;IAC/B,kDAAqC,CAAA;AACvC,CAAC,EALW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAKpB"}
@@ -1,3 +0,0 @@
1
- # errors.RequiredOneOfFlagsMissing
2
-
3
- This command expects one of the following flags %s to be provided.