@salesforce/plugin-packaging 1.18.2 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,22 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ export type FileDownloadEntry = {
3
+ fullName: string;
4
+ type: string;
5
+ filePath: string;
6
+ };
7
+ export type PackageVersionRetrieveCommandResult = FileDownloadEntry[];
8
+ export declare class PackageVersionRetrieveCommand extends SfCommand<PackageVersionRetrieveCommandResult> {
9
+ static readonly hidden = true;
10
+ static readonly summary: string;
11
+ static readonly description: string;
12
+ static readonly examples: string[];
13
+ static readonly requiresProject = true;
14
+ static readonly flags: {
15
+ loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
16
+ 'api-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
17
+ 'target-org': import("@oclif/core/lib/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
18
+ package: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
19
+ 'output-dir': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
20
+ };
21
+ run(): Promise<PackageVersionRetrieveCommandResult>;
22
+ }
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2022, 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.PackageVersionRetrieveCommand = void 0;
10
+ const path = require("path");
11
+ const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
12
+ const core_1 = require("@salesforce/core");
13
+ const packaging_1 = require("@salesforce/packaging");
14
+ core_1.Messages.importMessagesDirectory(__dirname);
15
+ const messages = core_1.Messages.loadMessages('@salesforce/plugin-packaging', 'package_version_retrieve');
16
+ class PackageVersionRetrieveCommand extends sf_plugins_core_1.SfCommand {
17
+ async run() {
18
+ const { flags } = await this.parse(PackageVersionRetrieveCommand);
19
+ const connection = flags['target-org'].getConnection(flags['api-version']);
20
+ const options = {
21
+ subscriberPackageVersionId: flags.package ?? '',
22
+ destinationFolder: flags['output-dir'],
23
+ };
24
+ const result = await packaging_1.Package.downloadPackageVersionMetadata(this.project, options, connection);
25
+ const results = [];
26
+ result.converted?.forEach((component) => {
27
+ if (component.xml) {
28
+ results.push({
29
+ fullName: component.fullName,
30
+ type: component.type.name,
31
+ filePath: path.relative('.', component.xml),
32
+ });
33
+ }
34
+ if (component.content) {
35
+ results.push({
36
+ fullName: component.fullName,
37
+ type: component.type.name,
38
+ filePath: path.relative('.', component.content),
39
+ });
40
+ }
41
+ });
42
+ const columnData = {
43
+ fullName: {
44
+ header: messages.getMessage('headers.fullName'),
45
+ },
46
+ type: {
47
+ header: messages.getMessage('headers.type'),
48
+ },
49
+ filePath: {
50
+ header: messages.getMessage('headers.filePath'),
51
+ },
52
+ };
53
+ this.table(results, columnData, { 'no-truncate': true });
54
+ return results;
55
+ }
56
+ }
57
+ exports.PackageVersionRetrieveCommand = PackageVersionRetrieveCommand;
58
+ PackageVersionRetrieveCommand.hidden = true;
59
+ PackageVersionRetrieveCommand.summary = messages.getMessage('summary');
60
+ PackageVersionRetrieveCommand.description = messages.getMessage('description');
61
+ PackageVersionRetrieveCommand.examples = messages.getMessages('examples');
62
+ PackageVersionRetrieveCommand.requiresProject = true;
63
+ PackageVersionRetrieveCommand.flags = {
64
+ loglevel: sf_plugins_core_1.loglevel,
65
+ 'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
66
+ 'target-org': sf_plugins_core_1.requiredOrgFlagWithDeprecations,
67
+ package: sf_plugins_core_1.Flags.string({
68
+ char: 'p',
69
+ summary: messages.getMessage('flags.package.summary'),
70
+ required: true,
71
+ }),
72
+ 'output-dir': sf_plugins_core_1.Flags.directory({
73
+ char: 'd',
74
+ summary: messages.getMessage('flags.outputDir.summary'),
75
+ default: 'force-app',
76
+ }),
77
+ };
78
+ //# sourceMappingURL=retrieve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retrieve.js","sourceRoot":"","sources":["../../../../src/commands/package/version/retrieve.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,6BAA6B;AAC7B,iEAMqC;AACrC,2CAA4C;AAE5C,qDAAsF;AAEtF,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,8BAA8B,EAAE,0BAA0B,CAAC,CAAC;AAUnG,MAAa,6BAA8B,SAAQ,2BAA8C;IAsBxF,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAClE,MAAM,UAAU,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QAC3E,MAAM,OAAO,GAAG;YACd,0BAA0B,EAAE,KAAK,CAAC,OAAO,IAAI,EAAE;YAC/C,iBAAiB,EAAE,KAAK,CAAC,YAAY,CAAC;SACvC,CAAC;QAEF,MAAM,MAAM,GAAyC,MAAM,mBAAO,CAAC,8BAA8B,CAC/F,IAAI,CAAC,OAAO,EACZ,OAAO,EACP,UAAU,CACX,CAAC;QACF,MAAM,OAAO,GAAwC,EAAE,CAAC;QAExD,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;YACtC,IAAI,SAAS,CAAC,GAAG,EAAE;gBACjB,OAAO,CAAC,IAAI,CAAC;oBACX,QAAQ,EAAE,SAAS,CAAC,Q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IAC7C,OAAO,EAAE,uBAAK,CAAC,MAAM,CAAC;QACpB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,uBAAuB,CAAC;QACrD,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,YAAY,EAAE,uBAAK,CAAC,SAAS,CAAC;QAC5B,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,yBAAyB,CAAC;QACvD,OAAO,EAAE,WAAW;KACrB,CAAC;CACH,CAAC"}
@@ -0,0 +1,43 @@
1
+ # summary
2
+
3
+ Retrieve package metadata for a specified package version.
4
+
5
+ # description
6
+
7
+ Retrieving a package version downloads the metadata into the directory you specify.
8
+
9
+ You can retrieve metadata for a second- or first-generation managed package, or an unlocked package.
10
+
11
+ Specify the subscriber package version ID (starts with 04t) and the path to an empty directory when you run this command.
12
+
13
+ # examples
14
+
15
+ - Retrieve package metadata for a subscriber package version ID (starts with 04t) into my-folder/ within your Salesforce DX project directory:
16
+
17
+ <%= config.bin %> <%= command.id %> --package 04t... --output-dir my-folder –-target-org my-scratch
18
+
19
+ If you omit --target-org, this command runs against your default org.
20
+
21
+ # flags.package.summary
22
+
23
+ Subscriber package version ID (starts with 04t).
24
+
25
+ # flags.outputDir.summary
26
+
27
+ Path within your Salesforce DX project directory in which to download the metadata. This directory must be empty.
28
+
29
+ # headers.fullName
30
+
31
+ FULL NAME
32
+
33
+ # headers.type
34
+
35
+ TYPE
36
+
37
+ # headers.filePath
38
+
39
+ PROJECT PATH
40
+
41
+ # error.failedToDownloadZip
42
+
43
+ Can’t retrieve package version metadata. Ensure that you've specified the correct 04t ID for the package version and then retry this command.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.18.2",
2
+ "version": "1.19.0",
3
3
  "commands": {
4
4
  "package:convert": {
5
5
  "id": "package:convert",
@@ -1830,6 +1830,78 @@
1830
1830
  "requiresProject": true,
1831
1831
  "hasDynamicHelp": true
1832
1832
  },
1833
+ "package:version:retrieve": {
1834
+ "id": "package:version:retrieve",
1835
+ "summary": "Retrieve package metadata for a specified package version.",
1836
+ "description": "Retrieving a package version downloads the metadata into the directory you specify.\n\nYou can retrieve metadata for a second- or first-generation managed package, or an unlocked package.\n\nSpecify the subscriber package version ID (starts with 04t) and the path to an empty directory when you run this command.",
1837
+ "strict": true,
1838
+ "pluginName": "@salesforce/plugin-packaging",
1839
+ "pluginAlias": "@salesforce/plugin-packaging",
1840
+ "pluginType": "core",
1841
+ "hidden": true,
1842
+ "aliases": [],
1843
+ "examples": [
1844
+ "Retrieve package metadata for a subscriber package version ID (starts with 04t) into my-folder/ within your Salesforce DX project directory:\n<%= config.bin %> <%= command.id %> --package 04t... --output-dir my-folder –-target-org my-scratch\nIf you omit --target-org, this command runs against your default org."
1845
+ ],
1846
+ "flags": {
1847
+ "json": {
1848
+ "name": "json",
1849
+ "type": "boolean",
1850
+ "description": "Format output as json.",
1851
+ "helpGroup": "GLOBAL",
1852
+ "allowNo": false
1853
+ },
1854
+ "loglevel": {
1855
+ "name": "loglevel",
1856
+ "type": "option",
1857
+ "hidden": true,
1858
+ "multiple": false,
1859
+ "deprecated": {
1860
+ "message": "The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable."
1861
+ }
1862
+ },
1863
+ "api-version": {
1864
+ "name": "api-version",
1865
+ "type": "option",
1866
+ "description": "Override the api version used for api requests made by this command",
1867
+ "multiple": false,
1868
+ "aliases": [
1869
+ "apiversion"
1870
+ ]
1871
+ },
1872
+ "target-org": {
1873
+ "name": "target-org",
1874
+ "type": "option",
1875
+ "char": "o",
1876
+ "summary": "Username or alias of the target org.",
1877
+ "required": true,
1878
+ "multiple": false,
1879
+ "aliases": [
1880
+ "targetusername",
1881
+ "u"
1882
+ ]
1883
+ },
1884
+ "package": {
1885
+ "name": "package",
1886
+ "type": "option",
1887
+ "char": "p",
1888
+ "summary": "Subscriber package version ID (starts with 04t).",
1889
+ "required": true,
1890
+ "multiple": false
1891
+ },
1892
+ "output-dir": {
1893
+ "name": "output-dir",
1894
+ "type": "option",
1895
+ "char": "d",
1896
+ "summary": "Path within your Salesforce DX project directory in which to download the metadata. This directory must be empty.",
1897
+ "multiple": false,
1898
+ "default": "force-app"
1899
+ }
1900
+ },
1901
+ "args": {},
1902
+ "requiresProject": true,
1903
+ "hasDynamicHelp": true
1904
+ },
1833
1905
  "package:version:update": {
1834
1906
  "id": "package:version:update",
1835
1907
  "summary": "Update a package version.",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-packaging",
3
3
  "description": "SFDX plugin that support Salesforce Packaging Platform",
4
- "version": "1.18.2",
4
+ "version": "1.19.0",
5
5
  "main": "lib/index.js",
6
6
  "author": "Salesforce",
7
7
  "bugs": "https://github.com/forcedotcom/cli/issues",
@@ -259,7 +259,7 @@
259
259
  }
260
260
  },
261
261
  "sfdx": {
262
- "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-packaging/1.18.2.crt",
263
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-packaging/1.18.2.sig"
262
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-packaging/1.19.0.crt",
263
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-packaging/1.19.0.sig"
264
264
  }
265
265
  }
@@ -0,0 +1,28 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$ref": "#/definitions/PackageVersionRetrieveCommandResult",
4
+ "definitions": {
5
+ "PackageVersionRetrieveCommandResult": {
6
+ "type": "array",
7
+ "items": {
8
+ "$ref": "#/definitions/FileDownloadEntry"
9
+ }
10
+ },
11
+ "FileDownloadEntry": {
12
+ "type": "object",
13
+ "properties": {
14
+ "fullName": {
15
+ "type": "string"
16
+ },
17
+ "type": {
18
+ "type": "string"
19
+ },
20
+ "filePath": {
21
+ "type": "string"
22
+ }
23
+ },
24
+ "required": ["fullName", "type", "filePath"],
25
+ "additionalProperties": false
26
+ }
27
+ }
28
+ }