@zowe/cli 7.4.0 → 7.5.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 (47) hide show
  1. package/lib/zosfiles/-strings-/en.d.ts +61 -0
  2. package/lib/zosfiles/-strings-/en.js +67 -2
  3. package/lib/zosfiles/-strings-/en.js.map +1 -1
  4. package/lib/zosfiles/ZosFilesBase.handler.js +1 -1
  5. package/lib/zosfiles/ZosFilesBase.handler.js.map +1 -1
  6. package/lib/zosfiles/compare/Compare.definition.js +11 -1
  7. package/lib/zosfiles/compare/Compare.definition.js.map +1 -1
  8. package/lib/zosfiles/compare/Compare.options.js +9 -0
  9. package/lib/zosfiles/compare/Compare.options.js.map +1 -1
  10. package/lib/zosfiles/compare/ds/Dataset.definition.js +2 -1
  11. package/lib/zosfiles/compare/ds/Dataset.definition.js.map +1 -1
  12. package/lib/zosfiles/compare/ds/Dataset.handler.js +19 -15
  13. package/lib/zosfiles/compare/ds/Dataset.handler.js.map +1 -1
  14. package/lib/zosfiles/compare/lf-ds/LocalfileDataset.definition.d.ts +6 -0
  15. package/lib/zosfiles/compare/lf-ds/LocalfileDataset.definition.js +65 -0
  16. package/lib/zosfiles/compare/lf-ds/LocalfileDataset.definition.js.map +1 -0
  17. package/lib/zosfiles/compare/lf-ds/LocalfileDataset.handler.d.ts +10 -0
  18. package/lib/zosfiles/compare/lf-ds/LocalfileDataset.handler.js +123 -0
  19. package/lib/zosfiles/compare/lf-ds/LocalfileDataset.handler.js.map +1 -0
  20. package/lib/zosfiles/compare/lf-sdd/LocalfileSpooldd.definition.d.ts +6 -0
  21. package/lib/zosfiles/compare/lf-sdd/LocalfileSpooldd.definition.js +61 -0
  22. package/lib/zosfiles/compare/lf-sdd/LocalfileSpooldd.definition.js.map +1 -0
  23. package/lib/zosfiles/compare/lf-sdd/LocalfileSpooldd.handler.d.ts +10 -0
  24. package/lib/zosfiles/compare/lf-sdd/LocalfileSpooldd.handler.js +113 -0
  25. package/lib/zosfiles/compare/lf-sdd/LocalfileSpooldd.handler.js.map +1 -0
  26. package/lib/zosfiles/compare/lf-uss/LocalfileUss.definition.d.ts +6 -0
  27. package/lib/zosfiles/compare/lf-uss/LocalfileUss.definition.js +63 -0
  28. package/lib/zosfiles/compare/lf-uss/LocalfileUss.definition.js.map +1 -0
  29. package/lib/zosfiles/compare/lf-uss/LocalfileUss.handler.d.ts +10 -0
  30. package/lib/zosfiles/compare/lf-uss/LocalfileUss.handler.js +121 -0
  31. package/lib/zosfiles/compare/lf-uss/LocalfileUss.handler.js.map +1 -0
  32. package/lib/zosfiles/compare/sdd/Spooldd.definition.d.ts +6 -0
  33. package/lib/zosfiles/compare/sdd/Spooldd.definition.js +60 -0
  34. package/lib/zosfiles/compare/sdd/Spooldd.definition.js.map +1 -0
  35. package/lib/zosfiles/compare/sdd/Spooldd.handler.d.ts +10 -0
  36. package/lib/zosfiles/compare/sdd/Spooldd.handler.js +80 -0
  37. package/lib/zosfiles/compare/sdd/Spooldd.handler.js.map +1 -0
  38. package/lib/zosfiles/compare/uss/UssFile.definition.d.ts +6 -0
  39. package/lib/zosfiles/compare/uss/UssFile.definition.js +65 -0
  40. package/lib/zosfiles/compare/uss/UssFile.definition.js.map +1 -0
  41. package/lib/zosfiles/compare/uss/UssFile.handler.d.ts +10 -0
  42. package/lib/zosfiles/compare/uss/UssFile.handler.js +107 -0
  43. package/lib/zosfiles/compare/uss/UssFile.handler.js.map +1 -0
  44. package/lib/zosfiles/download/dsm/DataSetMatching.definition.js +2 -2
  45. package/lib/zosfiles/download/dsm/DataSetMatching.definition.js.map +1 -1
  46. package/npm-shrinkwrap.json +266 -137
  47. package/package.json +14 -13
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalfileDataset.handler.js","sourceRoot":"","sources":["../../../../src/zosfiles/compare/lf-ds/LocalfileDataset.handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;EASE;;;;;;;;;;;AAEF,yBAAyB;AACzB,6BAA6B;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AE,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;oBACnC,MAAM,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC,CAAC;oBACjE,eAAe,IAAI,UAAU,GAAG,IAAI,CAAC;iBACxC;aACJ;iBACI;gBACD,eAAe,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;gBAC1C,eAAe,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;aAC7C;YAED,wEAAwE;YACxE,IAAI,WAAW,EAAE;gBAEb,MAAM,sBAAS,CAAC,iBAAiB,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;gBAEpE,OAAO;oBACH,OAAO,EAAE,IAAI;oBACb,eAAe,EAAE,uDAAuD;oBACxE,WAAW,EAAE,EAAE;iBAClB,CAAC;aACL;YAED,IAAI,QAAQ,GAAG,EAAE,CAAC;YAClB,MAAM,eAAe,GAAG,iBAAiB,CAAC,SAAS,CAAC,YAAY,CAAC;YAEjE,QAAQ,GAAG,MAAM,sBAAS,CAAC,aAAa,CAAC,eAAe,EAAE,eAAe,EAAE;gBACvE,YAAY,EAAE,UAAU;gBACxB,eAAe,EAAE,eAAe;aACnC,CAAC,CAAC;YAGH,OAAO;gBACH,OAAO,EAAE,IAAI;gBACb,eAAe,EAAE,QAAQ;gBACzB,WAAW,EAAE,EAAE;aAClB,CAAC;QACN,CAAC;KAAA;CACJ;AA3GD,0CA2GC"}
@@ -0,0 +1,6 @@
1
+ import { ICommandDefinition } from "@zowe/imperative";
2
+ /**
3
+ * Compare local-file-spool-dd command definition containing its description, examples and/or options
4
+ * @type {ICommandDefinition}
5
+ */
6
+ export declare const LocalfileSpoolddDefinition: ICommandDefinition;
@@ -0,0 +1,61 @@
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.LocalfileSpoolddDefinition = 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 local-file-spool-dd command definition containing its description, examples and/or options
19
+ * @type {ICommandDefinition}
20
+ */
21
+ exports.LocalfileSpoolddDefinition = {
22
+ name: "local-file-spool-dd",
23
+ aliases: ["lf-sdd"],
24
+ summary: strings.ACTIONS.LOCAL_FILE_SPOOL_DD.SUMMARY,
25
+ description: strings.ACTIONS.LOCAL_FILE_SPOOL_DD.DESCRIPTION,
26
+ type: "command",
27
+ handler: __dirname + "/LocalfileSpooldd.handler",
28
+ profile: {
29
+ optional: ["zosmf"],
30
+ },
31
+ positionals: [
32
+ {
33
+ name: "localFilePath",
34
+ description: strings.ACTIONS.LOCAL_FILE_SPOOL_DD.POSITIONALS.LOCALFILEPATH,
35
+ type: "string",
36
+ required: true
37
+ },
38
+ {
39
+ name: "spoolDescription",
40
+ type: "string",
41
+ description: strings.ACTIONS.LOCAL_FILE_SPOOL_DD.POSITIONALS.SPOOLDDDESCRIPTION,
42
+ required: true
43
+ }
44
+ ],
45
+ options: [
46
+ Compare_options_1.CompareOptions.seqnum,
47
+ Compare_options_1.CompareOptions.contextLines,
48
+ Compare_options_1.CompareOptions.browserView
49
+ ],
50
+ examples: [
51
+ {
52
+ description: strings.ACTIONS.LOCAL_FILE_SPOOL_DD.EXAMPLES.EX1,
53
+ options: `"./a.txt" "jobName:jobId:spoolId"`
54
+ },
55
+ {
56
+ description: strings.ACTIONS.LOCAL_FILE_SPOOL_DD.EXAMPLES.EX2,
57
+ options: `"./a.txt" "jobName:jobId:spoolId" --no-seqnum`
58
+ }
59
+ ]
60
+ };
61
+ //# sourceMappingURL=LocalfileSpooldd.definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalfileSpooldd.definition.js","sourceRoot":"","sources":["../../../../src/zosfiles/compare/lf-sdd/LocalfileSpooldd.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,0BAA0B,GAAuB;IAC1D,IAAI,EAAE,qBAAqB;IAC3B,OAAO,EAAE,CAAC,QAAQ,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,OAAO;IACpD,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,WAAW;IAC5D,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,SAAS,GAAG,2BAA2B;IAChD,OAAO,EAAE;QACL,QAAQ,EAAE,CAAC,OAAO,CAAC;KACtB;IACD,WAAW,EAAE;QACT;YACI,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,WAAW,CAAC,aAAa;YAC1E,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACjB;QACD;YACI,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,WAAW,CAAC,kBAAkB;YAC/E,QAAQ,EAAE,IAAI;SACjB;KACJ;IACD,OAAO,EAAE;QACL,gCAAc,CAAC,MAAM;QACrB,gCAAc,CAAC,YAAY;QAC3B,gCAAc,CAAC,WAAW;KAC7B;IACD,QAAQ,EAAE;QACN;YACI,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG;YAC7D,OAAO,EAAE,mCAAmC;SAC/C;QACD;YACI,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG;YAC7D,OAAO,EAAE,+CAA+C;SAC3D;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 compare spooldd's content
6
+ * @export
7
+ */
8
+ export default class LocalfileSpoolddHandler extends ZosFilesBaseHandler {
9
+ processWithSession(commandParameters: IHandlerParameters, session: AbstractSession): Promise<IZosFilesResponse>;
10
+ }
@@ -0,0 +1,113 @@
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 path = require("path");
23
+ const fs = require("fs");
24
+ const imperative_1 = require("@zowe/imperative");
25
+ const zos_jobs_for_zowe_sdk_1 = require("@zowe/zos-jobs-for-zowe-sdk");
26
+ const ZosFilesBase_handler_1 = require("../../ZosFilesBase.handler");
27
+ /**
28
+ * Handler to compare spooldd's content
29
+ * @export
30
+ */
31
+ class LocalfileSpoolddHandler extends ZosFilesBase_handler_1.ZosFilesBaseHandler {
32
+ processWithSession(commandParameters, session) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ const task = {
35
+ percentComplete: 0,
36
+ statusMessage: "Retrieving local file",
37
+ stageName: imperative_1.TaskStage.IN_PROGRESS
38
+ };
39
+ const descriptionSeperator = ":";
40
+ commandParameters.response.progress.startBar({ task });
41
+ // retrieving local file
42
+ let localFile;
43
+ // resolving to full path if local path passed is not absolute
44
+ if (path.isAbsolute(commandParameters.arguments.localFilePath)) {
45
+ localFile = commandParameters.arguments.localFilePath;
46
+ }
47
+ else {
48
+ localFile = path.resolve(commandParameters.arguments.localFilePath);
49
+ }
50
+ // check if the path given is of a file or not
51
+ try {
52
+ if (!fs.lstatSync(localFile).isFile()) {
53
+ throw new imperative_1.ImperativeError({
54
+ msg: 'Path given is not of a file, do recheck your path again'
55
+ });
56
+ }
57
+ }
58
+ catch (error) {
59
+ if (error instanceof imperative_1.ImperativeError)
60
+ throw error;
61
+ throw new imperative_1.ImperativeError({
62
+ msg: 'Path not found. Please check the path and try again'
63
+ });
64
+ }
65
+ const lfContentBuf = fs.readFileSync(localFile);
66
+ let lfContentString = "";
67
+ if (!commandParameters.arguments.seqnum) {
68
+ const seqnumlen = 8;
69
+ const lfStringArray = lfContentBuf.toString().split("\n");
70
+ for (const i in lfStringArray) {
71
+ const sl = lfStringArray[i].length;
72
+ const tempString = lfStringArray[i].substring(0, sl - seqnumlen);
73
+ lfContentString += tempString + "\n";
74
+ }
75
+ }
76
+ else {
77
+ lfContentString = lfContentBuf.toString();
78
+ }
79
+ commandParameters.response.progress.endBar();
80
+ commandParameters.response.progress.startBar({ task });
81
+ task.statusMessage = "Retrieving spooldd";
82
+ // retrieving information for spooldd
83
+ const spoolDescription = commandParameters.arguments.spoolDescription;
84
+ const spoolDescArr = spoolDescription.split(descriptionSeperator);
85
+ const jobName = spoolDescArr[0];
86
+ const jobId = spoolDescArr[1];
87
+ const spoolId = Number(spoolDescArr[2]);
88
+ const spoolContentString = yield zos_jobs_for_zowe_sdk_1.GetJobs.getSpoolContentById(session, jobName, jobId, spoolId);
89
+ // CHECHKING IIF THE BROWSER VIEW IS TRUE, OPEN UP THE DIFFS IN BROWSER
90
+ if (commandParameters.arguments.browserView) {
91
+ yield imperative_1.DiffUtils.openDiffInbrowser(lfContentString, spoolContentString);
92
+ return {
93
+ success: true,
94
+ commandResponse: "Launching local-file and spool-dd diffs in browser...",
95
+ apiResponse: {}
96
+ };
97
+ }
98
+ let jsonDiff = "";
99
+ const contextLinesArg = commandParameters.arguments.contextlines;
100
+ jsonDiff = yield imperative_1.DiffUtils.getDiffString(lfContentString, spoolContentString, {
101
+ outputFormat: 'terminal',
102
+ contextLinesArg: contextLinesArg
103
+ });
104
+ return {
105
+ success: true,
106
+ commandResponse: jsonDiff,
107
+ apiResponse: {}
108
+ };
109
+ });
110
+ }
111
+ }
112
+ exports.default = LocalfileSpoolddHandler;
113
+ //# sourceMappingURL=LocalfileSpooldd.handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalfileSpooldd.handler.js","sourceRoot":"","sources":["../../../../src/zosfiles/compare/lf-sdd/LocalfileSpooldd.handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;EASE;;;;;;;;;;;AAEF,6BAA6B;AAC7B,yBAAyB;AAGzB,iDAA+H;AAE/H,uEAAsD;AACtD,qEAAiE;AACjE;;;GAGG;AACH,MAAqB,uBAAwB,SAAQ,0CAAmB;IACvD,kBAAkB,CAAC,iBAAqC,EAAE,OAAwB;;YAC3F,MAAM,IAAI,GAAoB;gBAC1B,eAAe,EAAE,CAAC;gBAClB,aAAa,EAAE,uBAAuB;gBACtC,SAAS,EAAE,sBAAS,CAAC,WAAW;aACnC,CAAC;YACF,MAAM,oBAAoB,GAAW,GAAG,CAAC;YACzC,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,E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AAC;YAGH,OAAO;gBACH,OAAO,EAAE,IAAI;gBACb,eAAe,EAAE,QAAQ;gBACzB,WAAW,EAAE,EAAE;aAClB,CAAC;QACN,CAAC;KAAA;CACJ;AA3FD,0CA2FC"}
@@ -0,0 +1,6 @@
1
+ import { ICommandDefinition } from "@zowe/imperative";
2
+ /**
3
+ * Compare local files and data sets command definition containing its description, examples and/or options
4
+ * @type {ICommandDefinition}
5
+ */
6
+ export declare const LocalfileUssFileDefinition: ICommandDefinition;
@@ -0,0 +1,63 @@
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.LocalfileUssFileDefinition = 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 local files and data sets command definition containing its description, examples and/or options
19
+ * @type {ICommandDefinition}
20
+ */
21
+ exports.LocalfileUssFileDefinition = {
22
+ name: "local-file-uss-file",
23
+ aliases: ["lf-uss"],
24
+ summary: strings.ACTIONS.LOCAL_FILE_USS_FILE.SUMMARY,
25
+ description: strings.ACTIONS.LOCAL_FILE_USS_FILE.DESCRIPTION,
26
+ type: "command",
27
+ handler: __dirname + "/LocalfileUss.handler",
28
+ profile: {
29
+ optional: ["zosmf"],
30
+ },
31
+ positionals: [
32
+ {
33
+ name: "localFilePath",
34
+ description: strings.ACTIONS.LOCAL_FILE_USS_FILE.POSITIONALS.LOCALFILEPATH,
35
+ type: "string",
36
+ required: true
37
+ },
38
+ {
39
+ name: "ussFilePath",
40
+ type: "string",
41
+ description: strings.ACTIONS.LOCAL_FILE_USS_FILE.POSITIONALS.USSFILEPATH,
42
+ required: true
43
+ }
44
+ ],
45
+ options: [
46
+ Compare_options_1.CompareOptions.binary,
47
+ Compare_options_1.CompareOptions.encoding,
48
+ Compare_options_1.CompareOptions.seqnum,
49
+ Compare_options_1.CompareOptions.contextLines,
50
+ Compare_options_1.CompareOptions.browserView
51
+ ],
52
+ examples: [
53
+ {
54
+ description: strings.ACTIONS.LOCAL_FILE_USS_FILE.EXAMPLES.EX1,
55
+ options: `"./a.txt" "/u/user/test.txt"`
56
+ },
57
+ {
58
+ description: strings.ACTIONS.LOCAL_FILE_USS_FILE.EXAMPLES.EX2,
59
+ options: `"./a.txt" "/u/user/test.txt" --no-seqnum`
60
+ }
61
+ ]
62
+ };
63
+ //# sourceMappingURL=LocalfileUss.definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalfileUss.definition.js","sourceRoot":"","sources":["../../../../src/zosfiles/compare/lf-uss/LocalfileUss.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,0BAA0B,GAAuB;IAC1D,IAAI,EAAE,qBAAqB;IAC3B,OAAO,EAAE,CAAC,QAAQ,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,OAAO;IACpD,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,WAAW;IAC5D,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,SAAS,GAAG,uBAAuB;IAC5C,OAAO,EAAE;QACL,QAAQ,EAAE,CAAC,OAAO,CAAC;KACtB;IACD,WAAW,EAAE;QACT;YACI,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,WAAW,CAAC,aAAa;YAC1E,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACjB;QACD;YACI,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,WAAW,CAAC,WAAW;YACxE,QAAQ,EAAE,IAAI;SACjB;KACJ;IACD,OAAO,EAAE;QACL,gCAAc,CAAC,MAAM;QACrB,gCAAc,CAAC,QAAQ;QACvB,gCAAc,CAAC,MAAM;QACrB,gCAAc,CAAC,YAAY;QAC3B,gCAAc,CAAC,WAAW;KAC7B;IACD,QAAQ,EAAE;QACN;YACI,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG;YAC7D,OAAO,EAAE,8BAA8B;SAC1C;QACD;YACI,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG;YAC7D,OAAO,EAAE,0CAA0C;SACtD;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 compare the local file and uss file's content
6
+ * @export
7
+ */
8
+ export default class LocalfileUssHandler extends ZosFilesBaseHandler {
9
+ processWithSession(commandParameters: IHandlerParameters, session: AbstractSession): Promise<IZosFilesResponse>;
10
+ }
@@ -0,0 +1,121 @@
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 fs = require("fs");
23
+ const path = require("path");
24
+ const imperative_1 = require("@zowe/imperative");
25
+ const zos_files_for_zowe_sdk_1 = require("@zowe/zos-files-for-zowe-sdk");
26
+ const ZosFilesBase_handler_1 = require("../../ZosFilesBase.handler");
27
+ /**
28
+ * Handler to compare the local file and uss file's content
29
+ * @export
30
+ */
31
+ class LocalfileUssHandler extends ZosFilesBase_handler_1.ZosFilesBaseHandler {
32
+ processWithSession(commandParameters, session) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ const task = {
35
+ percentComplete: 0,
36
+ statusMessage: "Retrieving local file",
37
+ stageName: imperative_1.TaskStage.IN_PROGRESS
38
+ };
39
+ commandParameters.response.progress.startBar({ task });
40
+ let localFile;
41
+ // resolving to full path if local path passed is not absolute
42
+ if (path.isAbsolute(commandParameters.arguments.localFilePath)) {
43
+ localFile = commandParameters.arguments.localFilePath;
44
+ }
45
+ else {
46
+ localFile = path.resolve(commandParameters.arguments.localFilePath);
47
+ }
48
+ // check if the path given is of a file or not
49
+ try {
50
+ if (!fs.lstatSync(localFile).isFile()) {
51
+ throw new imperative_1.ImperativeError({
52
+ msg: 'Path given is not of a file, do recheck your path again'
53
+ });
54
+ }
55
+ }
56
+ catch (error) {
57
+ if (error instanceof imperative_1.ImperativeError)
58
+ throw error;
59
+ throw new imperative_1.ImperativeError({
60
+ msg: 'Path not found. Please check the path and try again'
61
+ });
62
+ }
63
+ // reading local file as buffer
64
+ const lfContentBuf = fs.readFileSync(localFile);
65
+ commandParameters.response.progress.endBar();
66
+ // retrieving the data-set to compare
67
+ commandParameters.response.progress.startBar({ task });
68
+ task.statusMessage = "Retrieving uss file";
69
+ const ussContentBuf = yield zos_files_for_zowe_sdk_1.Get.USSFile(session, commandParameters.arguments.ussFilePath, {
70
+ binary: commandParameters.arguments.binary,
71
+ encoding: commandParameters.arguments.encoding,
72
+ responseTimeout: commandParameters.arguments.responseTimeout,
73
+ task: task
74
+ });
75
+ const browserView = commandParameters.arguments.browserView;
76
+ let lfContentString = "";
77
+ let ussContentString = "";
78
+ if (!commandParameters.arguments.seqnum) {
79
+ const seqnumlen = 8;
80
+ const lfStringArray = lfContentBuf.toString().split("\n");
81
+ for (const i in lfStringArray) {
82
+ const sl = lfStringArray[i].length;
83
+ const tempString = lfStringArray[i].substring(0, sl - seqnumlen);
84
+ lfContentString += tempString + "\n";
85
+ }
86
+ const ussStringArray = ussContentBuf.toString().split("\n");
87
+ for (const i in ussStringArray) {
88
+ const sl = ussStringArray[i].length;
89
+ const tempString = ussStringArray[i].substring(0, sl - seqnumlen);
90
+ ussContentString += tempString + "\n";
91
+ }
92
+ }
93
+ else {
94
+ lfContentString = lfContentBuf.toString();
95
+ ussContentString = ussContentBuf.toString();
96
+ }
97
+ // CHECHKING IIF THE BROWSER VIEW IS TRUE, OPEN UP THE DIFFS IN BROWSER
98
+ if (browserView) {
99
+ yield imperative_1.DiffUtils.openDiffInbrowser(lfContentString, ussContentString);
100
+ return {
101
+ success: true,
102
+ commandResponse: "Launching local-filee and uss-file diffs in browser...",
103
+ apiResponse: {}
104
+ };
105
+ }
106
+ let jsonDiff = "";
107
+ const contextLinesArg = commandParameters.arguments.contextlines;
108
+ jsonDiff = yield imperative_1.DiffUtils.getDiffString(lfContentString, ussContentString, {
109
+ outputFormat: 'terminal',
110
+ contextLinesArg: contextLinesArg
111
+ });
112
+ return {
113
+ success: true,
114
+ commandResponse: jsonDiff,
115
+ apiResponse: {}
116
+ };
117
+ });
118
+ }
119
+ }
120
+ exports.default = LocalfileUssHandler;
121
+ //# sourceMappingURL=LocalfileUss.handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalfileUss.handler.js","sourceRoot":"","sources":["../../../../src/zosfiles/compare/lf-uss/LocalfileUss.handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;EASE;;;;;;;;;;;AAEF,yBAAyB;AACzB,6BAA6B;AAE7B,iDAA+H;AAC/H,yEAAsE;AACtE,qEAAiE;AAEjE;;;GAGG;AACH,MAAqB,mBAAoB,SAAQ,0CAAmB;IACnD,kBAAkB,CAAC,iBAAqC,EAAE,OAAwB;;YAC3F,MAAM,IAAI,GAAoB;gBAC1B,eAAe,EAAE,CAAC;gBAClB,aAAa,EAAE,uBAAuB;gBACtC,SAAS,EAAE,sBAAS,CAAC,WAAW;aACnC,CAAC;YAEF,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;YAEvD,IAAI,SAAiB,CAAC;YAEtB,8DAA8D;YAC9D,IAAI,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE;gBAC5D,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC,aAAa,CAAC;aACzD;iBAAM;gBACH,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;aACvE;YAED,8CAA8C;YAC9C,IAAI;gBACA,IAAG,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAC;oBACjC,MAAM,IAAI,4BAAe,CAAC;wBACtB,GAAG,EAAE,yDAAyD;qBACjE,CAAC,CAAC;iBACN;aACJ;YAAC,OAAO,KAAK,EAAE;gBACZ,IAAI,KAAK,YAAY,4BAAe;oBAAE,MAAM,KAAK,CAAC;gBAClD,MAAM,IAAI,4BAAe,CAAC;oBACtB,GAAG,EAAE,qDAAqD;iBAC7D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AAc,GAAG,aAAa,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAC5D,KAAK,MAAM,CAAC,IAAI,cAAc,EAAE;oBAC5B,MAAM,EAAE,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;oBACpC,MAAM,UAAU,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC,CAAC;oBAClE,gBAAgB,IAAI,UAAU,GAAG,IAAI,CAAC;iBACzC;aACJ;iBACI;gBACD,eAAe,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;gBAC1C,gBAAgB,GAAG,aAAa,CAAC,QAAQ,EAAE,CAAC;aAC/C;YAED,wEAAwE;YACxE,IAAI,WAAW,EAAE;gBAEb,MAAM,sBAAS,CAAC,iBAAiB,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC;gBAErE,OAAO;oBACH,OAAO,EAAE,IAAI;oBACb,eAAe,EAAE,wDAAwD;oBACzE,WAAW,EAAE,EAAE;iBAClB,CAAC;aACL;YAED,IAAI,QAAQ,GAAG,EAAE,CAAC;YAClB,MAAM,eAAe,GAAG,iBAAiB,CAAC,SAAS,CAAC,YAAY,CAAC;YAEjE,QAAQ,GAAG,MAAM,sBAAS,CAAC,aAAa,CAAC,eAAe,EAAE,gBAAgB,EAAE;gBACxE,YAAY,EAAE,UAAU;gBACxB,eAAe,EAAE,eAAe;aACnC,CAAC,CAAC;YAGH,OAAO;gBACH,OAAO,EAAE,IAAI;gBACb,eAAe,EAAE,QAAQ;gBACzB,WAAW,EAAE,EAAE;aAClB,CAAC;QACN,CAAC;KAAA;CACJ;AAzGD,sCAyGC"}
@@ -0,0 +1,6 @@
1
+ import { ICommandDefinition } from "@zowe/imperative";
2
+ /**
3
+ * Compare spool-dds command definition containing its description, examples and/or options
4
+ * @type {ICommandDefinition}
5
+ */
6
+ export declare const SpoolddDefinition: ICommandDefinition;
@@ -0,0 +1,60 @@
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.SpoolddDefinition = 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 spool-dds command definition containing its description, examples and/or options
19
+ * @type {ICommandDefinition}
20
+ */
21
+ exports.SpoolddDefinition = {
22
+ name: "spool-dd",
23
+ aliases: ["sdd"],
24
+ summary: strings.ACTIONS.SPOOL_DD.SUMMARY,
25
+ description: strings.ACTIONS.SPOOL_DD.DESCRIPTION,
26
+ type: "command",
27
+ handler: __dirname + "/Spooldd.handler",
28
+ profile: {
29
+ optional: ["zosmf"],
30
+ },
31
+ positionals: [
32
+ {
33
+ name: "spoolDescription1",
34
+ description: strings.ACTIONS.SPOOL_DD.POSITIONALS.SPOOLDDDESCRIPTION1,
35
+ type: "string",
36
+ required: true
37
+ },
38
+ {
39
+ name: "spoolDescription2",
40
+ type: "string",
41
+ description: strings.ACTIONS.SPOOL_DD.POSITIONALS.SPOOLDDDESCRIPTION2,
42
+ required: true
43
+ }
44
+ ],
45
+ options: [
46
+ Compare_options_1.CompareOptions.contextLines,
47
+ Compare_options_1.CompareOptions.browserView
48
+ ],
49
+ examples: [
50
+ {
51
+ description: strings.ACTIONS.SPOOL_DD.EXAMPLES.EX1,
52
+ options: `"jobName1:jobId1:spoolId1" "jobName2:jobId2:spoolId2"`
53
+ },
54
+ {
55
+ description: strings.ACTIONS.SPOOL_DD.EXAMPLES.EX2,
56
+ options: `"jobName1:jobId1:spoolId1" "jobName2:jobId2:spoolId2" --no-seqnum`
57
+ }
58
+ ]
59
+ };
60
+ //# sourceMappingURL=Spooldd.definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spooldd.definition.js","sourceRoot":"","sources":["../../../../src/zosfiles/compare/sdd/Spooldd.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,KAAK,CAAC;IAChB,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,mBAAmB;YACzB,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,mBAAmB;YACrE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACjB;QACD;YACI,IAAI,EAAE,mBAAmB;YACzB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,mBAAmB;YACrE,QAAQ,EAAE,IAAI;SACjB;KACJ;IACD,OAAO,EAAE;QACL,gCAAc,CAAC,YAAY;QAC3B,gCAAc,CAAC,WAAW;KAC7B;IACD,QAAQ,EAAE;QACN;YACI,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG;YAClD,OAAO,EAAE,uDAAuD;SACnE;QACD;YACI,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG;YAClD,OAAO,EAAE,mEAAmE;SAC/E;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 compare spooldd's content
6
+ * @export
7
+ */
8
+ export default class SpoolddHandler extends ZosFilesBaseHandler {
9
+ processWithSession(commandParameters: IHandlerParameters, session: AbstractSession): Promise<IZosFilesResponse>;
10
+ }
@@ -0,0 +1,80 @@
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_jobs_for_zowe_sdk_1 = require("@zowe/zos-jobs-for-zowe-sdk");
24
+ const ZosFilesBase_handler_1 = require("../../ZosFilesBase.handler");
25
+ /**
26
+ * Handler to compare spooldd's content
27
+ * @export
28
+ */
29
+ class SpoolddHandler extends ZosFilesBase_handler_1.ZosFilesBaseHandler {
30
+ processWithSession(commandParameters, session) {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ const task = {
33
+ percentComplete: 0,
34
+ statusMessage: "Retrieving first spool dd",
35
+ stageName: imperative_1.TaskStage.IN_PROGRESS
36
+ };
37
+ const descriptionSeperator = ":";
38
+ commandParameters.response.progress.startBar({ task });
39
+ const spoolDescription1 = commandParameters.arguments.spoolDescription1;
40
+ // retrieving information for first spooldd
41
+ const spoolDescArr1 = spoolDescription1.split(descriptionSeperator);
42
+ const jobName1 = spoolDescArr1[0];
43
+ const jobId1 = spoolDescArr1[1];
44
+ const spoolId1 = Number(spoolDescArr1[2]);
45
+ const spoolContentString1 = yield zos_jobs_for_zowe_sdk_1.GetJobs.getSpoolContentById(session, jobName1, jobId1, spoolId1);
46
+ commandParameters.response.progress.endBar();
47
+ commandParameters.response.progress.startBar({ task });
48
+ task.statusMessage = "Retrieving second spooldd";
49
+ // retrieving information for second spooldd
50
+ const spoolDescription2 = commandParameters.arguments.spoolDescription2;
51
+ const spoolDescArr2 = spoolDescription2.split(descriptionSeperator);
52
+ const jobName2 = spoolDescArr2[0];
53
+ const jobId2 = spoolDescArr2[1];
54
+ const spoolId2 = Number(spoolDescArr2[2]);
55
+ const spoolContentString2 = yield zos_jobs_for_zowe_sdk_1.GetJobs.getSpoolContentById(session, jobName2, jobId2, spoolId2);
56
+ // CHECHKING IIF THE BROWSER VIEW IS TRUE, OPEN UP THE DIFFS IN BROWSER
57
+ if (commandParameters.arguments.browserView) {
58
+ yield imperative_1.DiffUtils.openDiffInbrowser(spoolContentString1, spoolContentString2);
59
+ return {
60
+ success: true,
61
+ commandResponse: "Launching spool-dds' diffs in browser...",
62
+ apiResponse: {}
63
+ };
64
+ }
65
+ let jsonDiff = "";
66
+ const contextLinesArg = commandParameters.arguments.contextlines;
67
+ jsonDiff = yield imperative_1.DiffUtils.getDiffString(spoolContentString1, spoolContentString2, {
68
+ outputFormat: 'terminal',
69
+ contextLinesArg: contextLinesArg
70
+ });
71
+ return {
72
+ success: true,
73
+ commandResponse: jsonDiff,
74
+ apiResponse: {}
75
+ };
76
+ });
77
+ }
78
+ }
79
+ exports.default = SpoolddHandler;
80
+ //# sourceMappingURL=Spooldd.handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spooldd.handler.js","sourceRoot":"","sources":["../../../../src/zosfiles/compare/sdd/Spooldd.handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;EASE;;;;;;;;;;;AAEF,iDAA8G;AAE9G,uEAAsD;AACtD,qEAAiE;AACjE;;;GAGG;AACH,MAAqB,cAAe,SAAQ,0CAAmB;IAC9C,kBAAkB,CAAC,iBAAqC,EAAE,OAAwB;;YAC3F,MAAM,IAAI,GAAoB;gBAC1B,eAAe,EAAE,CAAC;gBAClB,aAAa,EAAE,2BAA2B;gBAC1C,SAAS,EAAE,sBAAS,CAAC,WAAW;aACnC,CAAC;YACF,MAAM,oBAAoB,GAAW,GAAG,CAAC;YACzC,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;YACvD,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,SAAS,CAAC,iBAAiB,CAAC;YAExE,2CAA2C;YAC3C,MAAM,aAAa,GAAG,iBAAiB,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;YACpE,MAAM,QAAQ,GAAW,aAAa,CAAC,CAAC,CAAC,CAAC;YAC1C,MAAM,MAAM,GAAW,aAAa,CAAC,CAAC,CAAC,CAAC;YACxC,MAAM,QAAQ,GAAW,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;YAClD,MAAM,mBAAmB,GAAG,MAAM,+BAAO,CAAC,mBAAmB,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;YAEnG,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YAC7C,iBAA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1,6 @@
1
+ import { ICommandDefinition } from "@zowe/imperative";
2
+ /**
3
+ * Compare uss-files command definition containing its description, examples and/or options
4
+ * @type {ICommandDefinition}
5
+ */
6
+ export declare const UssFileDefinition: ICommandDefinition;