@zowe/cli 7.2.5 → 7.4.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 (30) hide show
  1. package/lib/daemon/disable/Disable.handler.d.ts +15 -4
  2. package/lib/daemon/disable/Disable.handler.js +87 -41
  3. package/lib/daemon/disable/Disable.handler.js.map +1 -1
  4. package/lib/zosfiles/-strings-/en.d.ts +30 -0
  5. package/lib/zosfiles/-strings-/en.js +57 -19
  6. package/lib/zosfiles/-strings-/en.js.map +1 -1
  7. package/lib/zosfiles/ZosFiles.definition.js +3 -1
  8. package/lib/zosfiles/ZosFiles.definition.js.map +1 -1
  9. package/lib/zosfiles/compare/Compare.definition.d.ts +6 -0
  10. package/lib/zosfiles/compare/Compare.definition.js +31 -0
  11. package/lib/zosfiles/compare/Compare.definition.js.map +1 -0
  12. package/lib/zosfiles/compare/Compare.options.d.ts +7 -0
  13. package/lib/zosfiles/compare/Compare.options.js +124 -0
  14. package/lib/zosfiles/compare/Compare.options.js.map +1 -0
  15. package/lib/zosfiles/compare/ds/Dataset.definition.d.ts +6 -0
  16. package/lib/zosfiles/compare/ds/Dataset.definition.js +68 -0
  17. package/lib/zosfiles/compare/ds/Dataset.definition.js.map +1 -0
  18. package/lib/zosfiles/compare/ds/Dataset.handler.d.ts +10 -0
  19. package/lib/zosfiles/compare/ds/Dataset.handler.js +112 -0
  20. package/lib/zosfiles/compare/ds/Dataset.handler.js.map +1 -0
  21. package/lib/zosfiles/download/Download.definition.js +3 -1
  22. package/lib/zosfiles/download/Download.definition.js.map +1 -1
  23. package/lib/zosfiles/download/dsm/DataSetMatching.definition.d.ts +6 -0
  24. package/lib/zosfiles/download/dsm/DataSetMatching.definition.js +64 -0
  25. package/lib/zosfiles/download/dsm/DataSetMatching.definition.js.map +1 -0
  26. package/lib/zosfiles/download/dsm/DataSetMatching.handler.d.ts +10 -0
  27. package/lib/zosfiles/download/dsm/DataSetMatching.handler.js +93 -0
  28. package/lib/zosfiles/download/dsm/DataSetMatching.handler.js.map +1 -0
  29. package/npm-shrinkwrap.json +92 -93
  30. package/package.json +13 -13
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ /*
3
+ * This program and the accompanying materials are made available under the terms of the
4
+ * Eclipse Public License v2.0 which accompanies this distribution, and is available at
5
+ * https://www.eclipse.org/legal/epl-v20.html
6
+ *
7
+ * SPDX-License-Identifier: EPL-2.0
8
+ *
9
+ * Copyright Contributors to the Zowe Project.
10
+ *
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.DatasetDefinition = void 0;
14
+ const Compare_options_1 = require("../Compare.options");
15
+ // Does not use the import in anticipation of some internationalization work to be done later.
16
+ const strings = require("../../-strings-/en").default.COMPARE;
17
+ /**
18
+ * Compare data sets command definition containing its description, examples and/or options
19
+ * @type {ICommandDefinition}
20
+ */
21
+ exports.DatasetDefinition = {
22
+ name: "data-set",
23
+ aliases: ["ds"],
24
+ summary: strings.ACTIONS.DATA_SET.SUMMARY,
25
+ description: strings.ACTIONS.DATA_SET.DESCRIPTION,
26
+ type: "command",
27
+ handler: __dirname + "/Dataset.handler",
28
+ profile: {
29
+ optional: ["zosmf"],
30
+ },
31
+ positionals: [
32
+ {
33
+ name: "dataSetName1",
34
+ description: strings.ACTIONS.DATA_SET.POSITIONALS.DATASETNAME1,
35
+ type: "string",
36
+ required: true
37
+ },
38
+ {
39
+ name: "dataSetName2",
40
+ type: "string",
41
+ description: strings.ACTIONS.DATA_SET.POSITIONALS.DATASETNAME2,
42
+ required: true
43
+ }
44
+ ],
45
+ options: [
46
+ Compare_options_1.CompareOptions.binary,
47
+ Compare_options_1.CompareOptions.binary2,
48
+ Compare_options_1.CompareOptions.encoding,
49
+ Compare_options_1.CompareOptions.encoding2,
50
+ Compare_options_1.CompareOptions.record,
51
+ Compare_options_1.CompareOptions.record2,
52
+ Compare_options_1.CompareOptions.volume,
53
+ Compare_options_1.CompareOptions.volume2,
54
+ Compare_options_1.CompareOptions.seqnum,
55
+ Compare_options_1.CompareOptions.contextLines
56
+ ],
57
+ examples: [
58
+ {
59
+ description: strings.ACTIONS.DATA_SET.EXAMPLES.EX1,
60
+ options: `"sys1.samplib(antptso)" "sys1.samplib(antxtso)"`
61
+ },
62
+ {
63
+ description: strings.ACTIONS.DATA_SET.EXAMPLES.EX2,
64
+ options: `"sys1.samplib(antptso)" "sys1.samplib(antxtso)" --no-seqnum`
65
+ }
66
+ ]
67
+ };
68
+ //# sourceMappingURL=Dataset.definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dataset.definition.js","sourceRoot":"","sources":["../../../../src/zosfiles/compare/ds/Dataset.definition.ts"],"names":[],"mappings":";AAAA;;;;;;;;;EASE;;;AAGF,wDAAoD;AAGpD,8FAA8F;AAC9F,MAAM,OAAO,GAAI,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAA8B,CAAC,OAAO,CAAC;AAEtF;;;GAGG;AACU,QAAA,iBAAiB,GAAuB;IACjD,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,CAAC,IAAI,CAAC;IACf,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACzC,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW;IACjD,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,SAAS,GAAG,kBAAkB;IACvC,OAAO,EAAE;QACL,QAAQ,EAAE,CAAC,OAAO,CAAC;KACtB;IACD,WAAW,EAAE;QACT;YACI,IAAI,EAAE,cAAc;YACpB,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,YAAY;YAC9D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACjB;QACD;YACI,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,YAAY;YAC9D,QAAQ,EAAE,IAAI;SACjB;KACJ;IACD,OAAO,EAAE;QACL,gCAAc,CAAC,MAAM;QACrB,gCAAc,CAAC,OAAO;QACtB,gCAAc,CAAC,QAAQ;QACvB,gCAAc,CAAC,SAAS;QACxB,gCAAc,CAAC,MAAM;QACrB,gCAAc,CAAC,OAAO;QACtB,gCAAc,CAAC,MAAM;QACrB,gCAAc,CAAC,OAAO;QACtB,gCAAc,CAAC,MAAM;QACrB,gCAAc,CAAC,YAAY;KAC9B;IACD,QAAQ,EAAE;QACN;YACI,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG;YAClD,OAAO,EAAE,iDAAiD;SAC7D;QACD;YACI,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG;YAClD,OAAO,EAAE,6DAA6D;SACzE;KACJ;CACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { AbstractSession, IHandlerParameters } from "@zowe/imperative";
2
+ import { IZosFilesResponse } from "@zowe/zos-files-for-zowe-sdk";
3
+ import { ZosFilesBaseHandler } from "../../ZosFilesBase.handler";
4
+ /**
5
+ * Handler to view a data set's content
6
+ * @export
7
+ */
8
+ export default class DatasetHandler extends ZosFilesBaseHandler {
9
+ processWithSession(commandParameters: IHandlerParameters, session: AbstractSession): Promise<IZosFilesResponse>;
10
+ }
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ /*
3
+ * This program and the accompanying materials are made available under the terms of the
4
+ * Eclipse Public License v2.0 which accompanies this distribution, and is available at
5
+ * https://www.eclipse.org/legal/epl-v20.html
6
+ *
7
+ * SPDX-License-Identifier: EPL-2.0
8
+ *
9
+ * Copyright Contributors to the Zowe Project.
10
+ *
11
+ */
12
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ const imperative_1 = require("@zowe/imperative");
23
+ const zos_files_for_zowe_sdk_1 = require("@zowe/zos-files-for-zowe-sdk");
24
+ const ZosFilesBase_handler_1 = require("../../ZosFilesBase.handler");
25
+ const jest_diff_1 = require("jest-diff");
26
+ /**
27
+ * Handler to view a data set's content
28
+ * @export
29
+ */
30
+ class DatasetHandler extends ZosFilesBase_handler_1.ZosFilesBaseHandler {
31
+ processWithSession(commandParameters, session) {
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ const task = {
34
+ percentComplete: 0,
35
+ statusMessage: "Retrieving first dataset",
36
+ stageName: imperative_1.TaskStage.IN_PROGRESS
37
+ };
38
+ commandParameters.response.progress.startBar({ task });
39
+ const dsContentBuf1 = yield zos_files_for_zowe_sdk_1.Get.dataSet(session, commandParameters.arguments.dataSetName1, { binary: commandParameters.arguments.binary,
40
+ encoding: commandParameters.arguments.encoding,
41
+ record: commandParameters.arguments.record,
42
+ volume: commandParameters.arguments.volumeSerial,
43
+ responseTimeout: commandParameters.arguments.responseTimeout,
44
+ task: task
45
+ });
46
+ commandParameters.response.progress.endBar();
47
+ commandParameters.response.progress.startBar({ task });
48
+ let binary2 = commandParameters.arguments.binary2;
49
+ let encoding2 = commandParameters.arguments.encoding2;
50
+ let record2 = commandParameters.arguments.record2;
51
+ const volumeSerial2 = commandParameters.arguments.volumeSerial2;
52
+ if (binary2 == undefined) {
53
+ binary2 = commandParameters.arguments.binary;
54
+ }
55
+ if (encoding2 == undefined) {
56
+ encoding2 = commandParameters.arguments.encoding;
57
+ }
58
+ if (record2 == undefined) {
59
+ record2 = commandParameters.arguments.record;
60
+ }
61
+ task.statusMessage = "Retrieving second dataset";
62
+ const dsContentBuf2 = yield zos_files_for_zowe_sdk_1.Get.dataSet(session, commandParameters.arguments.dataSetName2, { binary: binary2,
63
+ encoding: encoding2,
64
+ record: record2,
65
+ volume: volumeSerial2,
66
+ responseTimeout: commandParameters.arguments.responseTimeout,
67
+ task: task
68
+ });
69
+ let dsContentString1 = "";
70
+ let dsContentString2 = "";
71
+ if (commandParameters.arguments.seqnum == false) {
72
+ const seqnumlen = 8;
73
+ const dsStringArray1 = dsContentBuf1.toString().split("\n");
74
+ for (const i in dsStringArray1) {
75
+ const sl = dsStringArray1[i].length;
76
+ const tempString = dsStringArray1[i].substring(0, sl - seqnumlen);
77
+ dsContentString1 += tempString + "\n";
78
+ }
79
+ const dsStringArray2 = dsContentBuf2.toString().split("\n");
80
+ for (const i in dsStringArray2) {
81
+ const sl = dsStringArray2[i].length;
82
+ const tempString = dsStringArray2[i].substring(0, sl - seqnumlen);
83
+ dsContentString2 += tempString + "\n";
84
+ }
85
+ }
86
+ else {
87
+ dsContentString1 = dsContentBuf1.toString();
88
+ dsContentString2 = dsContentBuf2.toString();
89
+ }
90
+ let jsonDiff = "";
91
+ let expandflag = true;
92
+ const contextLinesArg = commandParameters.arguments.contextLines;
93
+ if (contextLinesArg >= 0) {
94
+ expandflag = false;
95
+ }
96
+ jsonDiff = jest_diff_1.diff(dsContentString1, dsContentString2, { aAnnotation: "Removed",
97
+ bAnnotation: "Added",
98
+ aColor: imperative_1.TextUtils.chalk.red,
99
+ bColor: imperative_1.TextUtils.chalk.green,
100
+ contextLines: contextLinesArg,
101
+ expand: expandflag
102
+ });
103
+ return {
104
+ success: true,
105
+ commandResponse: jsonDiff,
106
+ apiResponse: {}
107
+ };
108
+ });
109
+ }
110
+ }
111
+ exports.default = DatasetHandler;
112
+ //# sourceMappingURL=Dataset.handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dataset.handler.js","sourceRoot":"","sources":["../../../../src/zosfiles/compare/ds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,aAAa,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAC5D,KAAI,MAAM,CAAC,IAAI,cAAc,EAAC;oBAC1B,MAAM,EAAE,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;oBACpC,MAAM,UAAU,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAC,EAAE,GAAG,SAAS,CAAC,CAAC;oBACjE,gBAAgB,IAAI,UAAU,GAAG,IAAI,CAAC;iBACzC;aACJ;iBAED;gBACI,gBAAgB,GAAG,aAAa,CAAC,QAAQ,EAAE,CAAC;gBAC5C,gBAAgB,GAAG,aAAa,CAAC,QAAQ,EAAE,CAAC;aAC/C;YAED,IAAI,QAAQ,GAAG,EAAE,CAAC;YAClB,IAAI,UAAU,GAAG,IAAI,CAAC;YACtB,MAAM,eAAe,GAAG,iBAAiB,CAAC,SAAS,CAAC,YAAY,CAAC;YACjE,IAAG,eAAe,IAAI,CAAC,EAAC;gBACpB,UAAU,GAAG,KAAK,CAAC;aACtB;YACD,QAAQ,GAAG,gBAAI,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,EAAC,WAAW,EAAE,SAAS;gBACvE,WAAW,EAAE,OAAO;gBACpB,MAAM,EAAE,sBAAS,CAAC,KAAK,CAAC,GAAG;gBAC3B,MAAM,EAAE,sBAAS,CAAC,KAAK,CAAC,KAAK;gBAC7B,YAAY,EAAE,eAAe;gBAC7B,MAAM,EAAE,UAAU;aACrB,CAAC,CAAC;YAEH,OAAO;gBACH,OAAO,EAAE,IAAI;gBACb,eAAe,EAAE,QAAQ;gBACzB,WAAW,EAAE,EAAE;aAClB,CAAC;QACN,CAAC;KAAA;CACJ;AA/FD,iCA+FC"}
@@ -14,6 +14,7 @@ exports.DownloadDefinition = void 0;
14
14
  const Dataset_definition_1 = require("./ds/Dataset.definition");
15
15
  const AllMembers_definition_1 = require("./am/AllMembers.definition");
16
16
  const UssFile_definition_1 = require("./uss/UssFile.definition");
17
+ const DataSetMatching_definition_1 = require("./dsm/DataSetMatching.definition");
17
18
  // Does not use the import in anticipation of some internationalization work to be done later.
18
19
  const strings = require("../-strings-/en").default.DOWNLOAD;
19
20
  /**
@@ -29,7 +30,8 @@ exports.DownloadDefinition = {
29
30
  children: [
30
31
  Dataset_definition_1.DatasetDefinition,
31
32
  AllMembers_definition_1.AllMembersDefinition,
32
- UssFile_definition_1.UssFileDefinition
33
+ UssFile_definition_1.UssFileDefinition,
34
+ DataSetMatching_definition_1.DataSetMatchingDefinition
33
35
  ]
34
36
  };
35
37
  //# sourceMappingURL=Download.definition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Download.definition.js","sourceRoot":"","sources":["../../../src/zosfiles/download/Download.definition.ts"],"names":[],"mappings":";AAAA;;;;;;;;;EASE;;;AAGF,gEAA4D;AAC5D,sEAAkE;AAGlE,iEAA6D;AAE7D,8FAA8F;AAC9F,MAAM,OAAO,GAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAA8B,CAAC,QAAQ,CAAC;AAEpF;;;GAGG;AACU,QAAA,kBAAkB,GAAuB;IAClD,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,CAAC,IAAI,CAAC;IACf,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,OAAO,CAAC,OAAO;IACxB,WAAW,EAAE,OAAO,CAAC,WAAW;IAChC,QAAQ,EAAE;QACN,sCAAiB;QACjB,4CAAoB;QACpB,sCAAiB;KACpB;CACJ,CAAC"}
1
+ {"version":3,"file":"Download.definition.js","sourceRoot":"","sources":["../../../src/zosfiles/download/Download.definition.ts"],"names":[],"mappings":";AAAA;;;;;;;;;EASE;;;AAGF,gEAA4D;AAC5D,sEAAkE;AAGlE,iEAA6D;AAC7D,iFAA6E;AAE7E,8FAA8F;AAC9F,MAAM,OAAO,GAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAA8B,CAAC,QAAQ,CAAC;AAEpF;;;GAGG;AACU,QAAA,kBAAkB,GAAuB;IAClD,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,CAAC,IAAI,CAAC;IACf,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,OAAO,CAAC,OAAO;IACxB,WAAW,EAAE,OAAO,CAAC,WAAW;IAChC,QAAQ,EAAE;QACN,sCAAiB;QACjB,4CAAoB;QACpB,sCAAiB;QACjB,sDAAyB;KAC5B;CACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { ICommandDefinition } from "@zowe/imperative";
2
+ /**
3
+ * Download all members command definition containing its description, examples and/or options
4
+ * @type {ICommandDefinition}
5
+ */
6
+ export declare const DataSetMatchingDefinition: ICommandDefinition;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ /*
3
+ * This program and the accompanying materials are made available under the terms of the
4
+ * Eclipse Public License v2.0 which accompanies this distribution, and is available at
5
+ * https://www.eclipse.org/legal/epl-v20.html
6
+ *
7
+ * SPDX-License-Identifier: EPL-2.0
8
+ *
9
+ * Copyright Contributors to the Zowe Project.
10
+ *
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.DataSetMatchingDefinition = void 0;
14
+ const Download_options_1 = require("../Download.options");
15
+ // Does not use the import in anticipation of some internationalization work to be done later.
16
+ const strings = require("../../-strings-/en").default.DOWNLOAD.ACTIONS.DATA_SETS_MATCHING;
17
+ /**
18
+ * Download all members command definition containing its description, examples and/or options
19
+ * @type {ICommandDefinition}
20
+ */
21
+ exports.DataSetMatchingDefinition = {
22
+ name: "data-set-matching",
23
+ aliases: ["dsm"],
24
+ summary: strings.SUMMARY,
25
+ description: strings.DESCRIPTION,
26
+ type: "command",
27
+ handler: __dirname + "/DataSetMatching.handler",
28
+ profile: {
29
+ optional: ["zosmf"]
30
+ },
31
+ positionals: [
32
+ {
33
+ name: "pattern",
34
+ description: strings.POSITIONALS.PATTERN,
35
+ type: "string",
36
+ required: true
37
+ }
38
+ ],
39
+ options: [
40
+ Download_options_1.DownloadOptions.volume,
41
+ Download_options_1.DownloadOptions.directory,
42
+ Download_options_1.DownloadOptions.binary,
43
+ Download_options_1.DownloadOptions.record,
44
+ Download_options_1.DownloadOptions.encoding,
45
+ Download_options_1.DownloadOptions.extension,
46
+ Download_options_1.DownloadOptions.excludePattern,
47
+ Download_options_1.DownloadOptions.extensionMap,
48
+ Download_options_1.DownloadOptions.maxConcurrentRequests,
49
+ Download_options_1.DownloadOptions.preserveOriginalLetterCase,
50
+ Download_options_1.DownloadOptions.failFast
51
+ ].sort((a, b) => a.name.localeCompare(b.name)),
52
+ examples: [
53
+ {
54
+ description: strings.EXAMPLES.EX1,
55
+ options: `"ibmuser.**.cntl, ibmuser.**.jcl" --directory jcl --extension .jcl`
56
+ },
57
+ {
58
+ description: strings.EXAMPLES.EX2,
59
+ options: `"ibmuser.public.project.*, ibmuser.project.private.*" --exclude-patterns "ibmuser.public.**.*lib" ` +
60
+ `--directory project --extension-map cpgm=c,asmpgm=asm,java=java,chdr=c,jcl=jcl,cntl=jcl`
61
+ }
62
+ ]
63
+ };
64
+ //# sourceMappingURL=DataSetMatching.definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataSetMatching.definition.js","sourceRoot":"","sources":["../../../../src/zosfiles/download/dsm/DataSetMatching.definition.ts"],"names":[],"mappings":";AAAA;;;;;;;;;EASE;;;AAGF,0DAAsD;AAGtD,8FAA8F;AAC9F,MAAM,OAAO,GAAI,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAA8B,CAAC,QAAQ,CAAC,OAAO,CAAC,kBAAkB,CAAC;AAElH;;;GAGG;AACU,QAAA,yBAAyB,GAAuB;IACzD,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,CAAC,KAAK,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC,OAAO;IACxB,WAAW,EAAE,OAAO,CAAC,WAAW;IAChC,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,SAAS,GAAG,0BAA0B;IAC/C,OAAO,EAAE;QACL,QAAQ,EAAE,CAAC,OAAO,CAAC;KACtB;IACD,WAAW,EAAE;QACT;YACI,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,OAAO;YACxC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACjB;KACJ;IACD,OAAO,EAAE;QACL,kCAAe,CAAC,MAAM;QACtB,kCAAe,CAAC,SAAS;QACzB,kCAAe,CAAC,MAAM;QACtB,kCAAe,CAAC,MAAM;QACtB,kCAAe,CAAC,QAAQ;QACxB,kCAAe,CAAC,SAAS;QACzB,kCAAe,CAAC,cAAc;QAC9B,kCAAe,CAAC,YAAY;QAC5B,kCAAe,CAAC,qBAAqB;QACrC,kCAAe,CAAC,0BAA0B;QAC1C,kCAAe,CAAC,QAAQ;KAC3B,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC9C,QAAQ,EAAE;QACN;YACI,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG;YACjC,OAAO,EAAE,oEAAoE;SAChF;QACD;YACI,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG;YACjC,OAAO,EAAE,oGAAoG;gBAC7G,yFAAyF;SAC5F;KACJ;CACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { AbstractSession, IHandlerParameters } from "@zowe/imperative";
2
+ import { IZosFilesResponse } from "@zowe/zos-files-for-zowe-sdk";
3
+ import { ZosFilesBaseHandler } from "../../ZosFilesBase.handler";
4
+ /**
5
+ * Handler to download all members from a pds
6
+ * @export
7
+ */
8
+ export default class DataSetMatchingHandler extends ZosFilesBaseHandler {
9
+ processWithSession(commandParameters: IHandlerParameters, session: AbstractSession): Promise<IZosFilesResponse>;
10
+ }
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ /*
3
+ * This program and the accompanying materials are made available under the terms of the
4
+ * Eclipse Public License v2.0 which accompanies this distribution, and is available at
5
+ * https://www.eclipse.org/legal/epl-v20.html
6
+ *
7
+ * SPDX-License-Identifier: EPL-2.0
8
+ *
9
+ * Copyright Contributors to the Zowe Project.
10
+ *
11
+ */
12
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ const imperative_1 = require("@zowe/imperative");
23
+ const zos_files_for_zowe_sdk_1 = require("@zowe/zos-files-for-zowe-sdk");
24
+ const ZosFilesBase_handler_1 = require("../../ZosFilesBase.handler");
25
+ /**
26
+ * Handler to download all members from a pds
27
+ * @export
28
+ */
29
+ class DataSetMatchingHandler extends ZosFilesBase_handler_1.ZosFilesBaseHandler {
30
+ processWithSession(commandParameters, session) {
31
+ var _a;
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ const extensionMap = {};
34
+ try {
35
+ if (commandParameters.arguments.extensionMap) {
36
+ commandParameters.arguments.extensionMap = commandParameters.arguments.extensionMap.toLowerCase();
37
+ const unoptimizedMap = commandParameters.arguments.extensionMap.split(",");
38
+ for (const entry of unoptimizedMap) {
39
+ const splitEntry = entry.split("=");
40
+ imperative_1.ImperativeExpect.toBeEqual(splitEntry.length, 2);
41
+ extensionMap[splitEntry[0]] = splitEntry[1];
42
+ }
43
+ }
44
+ }
45
+ catch (err) {
46
+ throw new imperative_1.ImperativeError({ msg: "An error occurred processing the extension map.", causeErrors: err });
47
+ }
48
+ const listStatus = {
49
+ statusMessage: "Searching for data sets",
50
+ percentComplete: 0,
51
+ stageName: imperative_1.TaskStage.IN_PROGRESS
52
+ };
53
+ const listOptions = {
54
+ excludePatterns: (_a = commandParameters.arguments.excludePatterns) === null || _a === void 0 ? void 0 : _a.split(","),
55
+ maxConcurrentRequests: commandParameters.arguments.maxConcurrentRequests,
56
+ task: listStatus,
57
+ responseTimeout: commandParameters.arguments.responseTimeout
58
+ };
59
+ commandParameters.response.progress.startBar({ task: listStatus });
60
+ const response = yield zos_files_for_zowe_sdk_1.List.dataSetsMatchingPattern(session, commandParameters.arguments.pattern.split(","), listOptions);
61
+ commandParameters.response.progress.endBar();
62
+ if (response.success) {
63
+ commandParameters.response.console.log(`\r${response.commandResponse}\n`);
64
+ }
65
+ else {
66
+ return response;
67
+ }
68
+ const downloadStatus = {
69
+ statusMessage: "Downloading data sets",
70
+ percentComplete: 0,
71
+ stageName: imperative_1.TaskStage.IN_PROGRESS
72
+ };
73
+ const downloadOptions = {
74
+ volume: commandParameters.arguments.volumeSerial,
75
+ binary: commandParameters.arguments.binary,
76
+ record: commandParameters.arguments.record,
77
+ encoding: commandParameters.arguments.encoding,
78
+ directory: commandParameters.arguments.directory,
79
+ extension: commandParameters.arguments.extension,
80
+ extensionMap: commandParameters.arguments.extensionMap ? extensionMap : undefined,
81
+ maxConcurrentRequests: commandParameters.arguments.maxConcurrentRequests,
82
+ preserveOriginalLetterCase: commandParameters.arguments.preserveOriginalLetterCase,
83
+ failFast: commandParameters.arguments.failFast,
84
+ task: downloadStatus,
85
+ responseTimeout: commandParameters.arguments.responseTimeout
86
+ };
87
+ commandParameters.response.progress.startBar({ task: downloadStatus });
88
+ return zos_files_for_zowe_sdk_1.Download.allDataSets(session, response.apiResponse, downloadOptions);
89
+ });
90
+ }
91
+ }
92
+ exports.default = DataSetMatchingHandler;
93
+ //# sourceMappingURL=DataSetMatching.handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataSetMatching.handler.js","sourceRoot":"","sources":["../../../../src/zosfiles/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