@zowe/cli 7.10.4 → 7.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/daemon/DaemonDecider.js +3 -0
- package/lib/daemon/DaemonDecider.js.map +1 -1
- package/lib/zosfiles/compare/CompareBase.handler.d.ts +38 -0
- package/lib/zosfiles/compare/CompareBase.handler.js +62 -0
- package/lib/zosfiles/compare/CompareBase.handler.js.map +1 -0
- package/lib/zosfiles/compare/CompareBaseHelper.d.ts +92 -0
- package/lib/zosfiles/compare/CompareBaseHelper.js +173 -0
- package/lib/zosfiles/compare/CompareBaseHelper.js.map +1 -0
- package/lib/zosfiles/compare/doc/ICompareFileOptions.d.ts +14 -0
- package/lib/zosfiles/compare/doc/ICompareFileOptions.js +13 -0
- package/lib/zosfiles/compare/doc/ICompareFileOptions.js.map +1 -0
- package/lib/zosfiles/compare/ds/Dataset.handler.d.ts +7 -5
- package/lib/zosfiles/compare/ds/Dataset.handler.js +9 -80
- package/lib/zosfiles/compare/ds/Dataset.handler.js.map +1 -1
- package/lib/zosfiles/compare/lf-ds/LocalfileDataset.handler.d.ts +8 -6
- package/lib/zosfiles/compare/lf-ds/LocalfileDataset.handler.js +10 -94
- package/lib/zosfiles/compare/lf-ds/LocalfileDataset.handler.js.map +1 -1
- package/lib/zosfiles/compare/lf-sdd/LocalfileSpooldd.handler.d.ts +7 -5
- package/lib/zosfiles/compare/lf-sdd/LocalfileSpooldd.handler.js +10 -90
- package/lib/zosfiles/compare/lf-sdd/LocalfileSpooldd.handler.js.map +1 -1
- package/lib/zosfiles/compare/lf-uss/LocalfileUss.handler.d.ts +7 -5
- package/lib/zosfiles/compare/lf-uss/LocalfileUss.handler.js +9 -91
- package/lib/zosfiles/compare/lf-uss/LocalfileUss.handler.js.map +1 -1
- package/lib/zosfiles/compare/sdd/Spooldd.handler.d.ts +7 -5
- package/lib/zosfiles/compare/sdd/Spooldd.handler.js +11 -58
- package/lib/zosfiles/compare/sdd/Spooldd.handler.js.map +1 -1
- package/lib/zosfiles/compare/uss/UssFile.handler.d.ts +7 -5
- package/lib/zosfiles/compare/uss/UssFile.handler.js +9 -71
- package/lib/zosfiles/compare/uss/UssFile.handler.js.map +1 -1
- package/npm-shrinkwrap.json +86 -86
- package/package.json +13 -13
- package/prebuilds/Cargo.lock +1 -1
- package/prebuilds/Cargo.toml +1 -1
- package/prebuilds/zowe-linux.tgz +0 -0
- package/prebuilds/zowe-macos.tgz +0 -0
- package/prebuilds/zowe-windows.tgz +0 -0
|
@@ -19,105 +19,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
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
22
|
const zos_files_for_zowe_sdk_1 = require("@zowe/zos-files-for-zowe-sdk");
|
|
26
|
-
const
|
|
23
|
+
const CompareBase_handler_1 = require("../CompareBase.handler");
|
|
27
24
|
/**
|
|
28
|
-
* Handler to
|
|
25
|
+
* Handler to compare a localfile and a dataset content
|
|
29
26
|
* @export
|
|
30
27
|
*/
|
|
31
|
-
class LocalfileDatasetHandler extends
|
|
32
|
-
|
|
28
|
+
class LocalfileDatasetHandler extends CompareBase_handler_1.CompareBaseHandler {
|
|
29
|
+
getFile1(session, args, helper) {
|
|
33
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
commandParameters.response.progress.startBar({ task });
|
|
41
|
-
let localFile;
|
|
42
|
-
if (path.isAbsolute(commandParameters.arguments.localFilePath)) {
|
|
43
|
-
// resolving to full path if local path passed is not absolute
|
|
44
|
-
localFile = commandParameters.arguments.localFilePath;
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
localFile = path.resolve(commandParameters.arguments.localFilePath);
|
|
48
|
-
}
|
|
49
|
-
const localFileHandle = fs.openSync(localFile, 'r');
|
|
50
|
-
let lfContentBuf;
|
|
51
|
-
try {
|
|
52
|
-
// check if the path given is of a file or not
|
|
53
|
-
try {
|
|
54
|
-
if (!fs.fstatSync(localFileHandle).isFile()) {
|
|
55
|
-
throw new imperative_1.ImperativeError({
|
|
56
|
-
msg: 'Path given is not of a file, do recheck your path again'
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
if (error instanceof imperative_1.ImperativeError)
|
|
62
|
-
throw error;
|
|
63
|
-
throw new imperative_1.ImperativeError({
|
|
64
|
-
msg: 'Path not found. Please check the path and try again'
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
// reading local file as buffer
|
|
68
|
-
lfContentBuf = fs.readFileSync(localFileHandle);
|
|
69
|
-
}
|
|
70
|
-
finally {
|
|
71
|
-
fs.closeSync(localFileHandle);
|
|
72
|
-
}
|
|
73
|
-
commandParameters.response.progress.endBar();
|
|
74
|
-
// RETRIEVING THE DATA-SET TO COMPARE
|
|
75
|
-
task.statusMessage = "Retrieving dataset";
|
|
76
|
-
commandParameters.response.progress.startBar({ task });
|
|
77
|
-
const dsContentBuf = yield zos_files_for_zowe_sdk_1.Get.dataSet(session, commandParameters.arguments.dataSetName, {
|
|
78
|
-
binary: commandParameters.arguments.binary,
|
|
79
|
-
encoding: commandParameters.arguments.encoding,
|
|
80
|
-
record: commandParameters.arguments.record,
|
|
81
|
-
volume: commandParameters.arguments.volumeSerial,
|
|
82
|
-
responseTimeout: commandParameters.arguments.responseTimeout,
|
|
83
|
-
task: task
|
|
84
|
-
});
|
|
85
|
-
commandParameters.response.progress.endBar();
|
|
86
|
-
//CHECKING IF NEEDING TO SPLIT CONTENT STRINGS FOR SEQNUM OPTION
|
|
87
|
-
let lfContentString = "";
|
|
88
|
-
let dsContentString = "";
|
|
89
|
-
const seqnumlen = 8;
|
|
90
|
-
if (commandParameters.arguments.seqnum === false) {
|
|
91
|
-
lfContentString = lfContentBuf.toString().split("\n")
|
|
92
|
-
.map((line) => line.slice(0, -seqnumlen))
|
|
93
|
-
.join("\n");
|
|
94
|
-
dsContentString = dsContentBuf.toString().split("\n")
|
|
95
|
-
.map((line) => line.slice(0, -seqnumlen))
|
|
96
|
-
.join("\n");
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
lfContentString = lfContentBuf.toString();
|
|
100
|
-
dsContentString = dsContentBuf.toString();
|
|
101
|
-
}
|
|
102
|
-
// CHECK TO OPEN UP DIFF IN BROWSER WINDOW
|
|
103
|
-
if (commandParameters.arguments.browserView) {
|
|
104
|
-
yield imperative_1.DiffUtils.openDiffInbrowser(lfContentString, dsContentString);
|
|
105
|
-
return {
|
|
106
|
-
success: true,
|
|
107
|
-
commandResponse: "Launching local-file and data-set diffs in browser...",
|
|
108
|
-
apiResponse: {}
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
// RETURNING DIFF
|
|
112
|
-
const jsonDiff = yield imperative_1.DiffUtils.getDiffString(imperative_1.IO.processNewlines(lfContentString), imperative_1.IO.processNewlines(dsContentString), {
|
|
113
|
-
outputFormat: 'terminal',
|
|
114
|
-
contextLinesArg: commandParameters.arguments.contextLines
|
|
115
|
-
});
|
|
116
|
-
return {
|
|
117
|
-
success: true,
|
|
118
|
-
commandResponse: jsonDiff,
|
|
119
|
-
apiResponse: {}
|
|
120
|
-
};
|
|
31
|
+
return helper.prepareLocalFile(args.localFilePath);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
getFile2(session, args, helper) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
return yield zos_files_for_zowe_sdk_1.Get.dataSet(session, args.dataSetName, Object.assign(Object.assign({}, helper.file2Options), { task: helper.task }));
|
|
121
37
|
});
|
|
122
38
|
}
|
|
123
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalfileDataset.handler.js","sourceRoot":"","sources":["../../../../src/zosfiles/compare/lf-ds/LocalfileDataset.handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;EASE;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"LocalfileDataset.handler.js","sourceRoot":"","sources":["../../../../src/zosfiles/compare/lf-ds/LocalfileDataset.handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;EASE;;;;;;;;;;;AAGF,yEAAmD;AAEnD,gEAA4D;AAE5D;;;GAGG;AACH,MAAqB,uBAAwB,SAAQ,wCAAkB;IACtD,QAAQ,CAAC,OAAwB,EAAE,IAAuB,EAAE,MAAyB;;YAC9F,OAAO,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACvD,CAAC;KAAA;IACY,QAAQ,CAAC,OAAwB,EAAE,IAAuB,EAAE,MAAyB;;YAC9F,OAAO,MAAM,4BAAG,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,kCAAO,MAAM,CAAC,YAAY,KAAE,IAAI,EAAE,MAAM,CAAC,IAAI,IAAG,CAAC;QACvG,CAAC;KAAA;CACJ;AAPD,0CAOC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { AbstractSession, ICommandArguments } from "@zowe/imperative";
|
|
3
|
+
import { CompareBaseHelper } from "../CompareBaseHelper";
|
|
4
|
+
import { CompareBaseHandler } from "../CompareBase.handler";
|
|
4
5
|
/**
|
|
5
6
|
* Handler to compare spooldd's content
|
|
6
7
|
* @export
|
|
7
8
|
*/
|
|
8
|
-
export default class LocalfileSpoolddHandler extends
|
|
9
|
-
|
|
9
|
+
export default class LocalfileSpoolddHandler extends CompareBaseHandler {
|
|
10
|
+
getFile1(session: AbstractSession, args: ICommandArguments, helper: CompareBaseHelper): Promise<string | Buffer>;
|
|
11
|
+
getFile2(session: AbstractSession, args: ICommandArguments, helper: CompareBaseHelper): Promise<string | Buffer>;
|
|
10
12
|
}
|
|
@@ -19,102 +19,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
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
22
|
const zos_jobs_for_zowe_sdk_1 = require("@zowe/zos-jobs-for-zowe-sdk");
|
|
26
|
-
const
|
|
23
|
+
const CompareBase_handler_1 = require("../CompareBase.handler");
|
|
27
24
|
/**
|
|
28
25
|
* Handler to compare spooldd's content
|
|
29
26
|
* @export
|
|
30
27
|
*/
|
|
31
|
-
class LocalfileSpoolddHandler extends
|
|
32
|
-
|
|
28
|
+
class LocalfileSpoolddHandler extends CompareBase_handler_1.CompareBaseHandler {
|
|
29
|
+
getFile1(session, args, helper) {
|
|
33
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
commandParameters.response.progress.startBar({ task });
|
|
42
|
-
let localFile;
|
|
43
|
-
if (path.isAbsolute(commandParameters.arguments.localFilePath)) {
|
|
44
|
-
// resolving to full path if local path passed is not absolute
|
|
45
|
-
localFile = commandParameters.arguments.localFilePath;
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
localFile = path.resolve(commandParameters.arguments.localFilePath);
|
|
49
|
-
}
|
|
50
|
-
const localFileHandle = fs.openSync(localFile, 'r');
|
|
51
|
-
let lfContentBuf;
|
|
52
|
-
try {
|
|
53
|
-
// check if the path given is of a file or not
|
|
54
|
-
try {
|
|
55
|
-
if (!fs.fstatSync(localFileHandle).isFile()) {
|
|
56
|
-
throw new imperative_1.ImperativeError({
|
|
57
|
-
msg: 'Path given is not of a file, do recheck your path again'
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
catch (error) {
|
|
62
|
-
if (error instanceof imperative_1.ImperativeError)
|
|
63
|
-
throw error;
|
|
64
|
-
throw new imperative_1.ImperativeError({
|
|
65
|
-
msg: 'Path not found. Please check the path and try again'
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
// reading local file as buffer
|
|
69
|
-
lfContentBuf = fs.readFileSync(localFileHandle);
|
|
70
|
-
}
|
|
71
|
-
finally {
|
|
72
|
-
fs.closeSync(localFileHandle);
|
|
73
|
-
}
|
|
74
|
-
commandParameters.response.progress.endBar();
|
|
75
|
-
// RETRIEVING SPOOLDD
|
|
76
|
-
task.statusMessage = "Retrieving spooldd";
|
|
77
|
-
commandParameters.response.progress.startBar({ task });
|
|
78
|
-
const spoolDescription = commandParameters.arguments.spoolDescription;
|
|
79
|
-
const spoolDescArr = spoolDescription.split(descriptionSeperator);
|
|
80
|
-
const jobName = spoolDescArr[0];
|
|
81
|
-
const jobId = spoolDescArr[1];
|
|
82
|
-
const spoolId = Number(spoolDescArr[2]);
|
|
83
|
-
let spoolContentString = yield zos_jobs_for_zowe_sdk_1.GetJobs.getSpoolContentById(session, jobName, jobId, spoolId);
|
|
84
|
-
commandParameters.response.progress.endBar();
|
|
85
|
-
//CHECKING IF NEEDING TO SPLIT CONTENT STRINGS FOR SEQNUM OPTION
|
|
86
|
-
let lfContentString = "";
|
|
87
|
-
const seqnumlen = 8;
|
|
88
|
-
if (commandParameters.arguments.seqnum === false) {
|
|
89
|
-
lfContentString = lfContentBuf.toString().split("\n")
|
|
90
|
-
.map((line) => line.slice(0, -seqnumlen))
|
|
91
|
-
.join("\n");
|
|
92
|
-
spoolContentString = spoolContentString.split("\n")
|
|
93
|
-
.map((line) => line.slice(0, -seqnumlen))
|
|
94
|
-
.join("\n");
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
lfContentString = lfContentBuf.toString();
|
|
98
|
-
}
|
|
99
|
-
// CHECK TO OPEN UP DIFF IN BROWSER WINDOW
|
|
100
|
-
if (commandParameters.arguments.browserView) {
|
|
101
|
-
yield imperative_1.DiffUtils.openDiffInbrowser(lfContentString, spoolContentString);
|
|
102
|
-
return {
|
|
103
|
-
success: true,
|
|
104
|
-
commandResponse: "Launching local-file and spool-dd diffs in browser...",
|
|
105
|
-
apiResponse: {}
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
// RETURNING DIFF
|
|
109
|
-
const jsonDiff = yield imperative_1.DiffUtils.getDiffString(lfContentString, spoolContentString, {
|
|
110
|
-
outputFormat: 'terminal',
|
|
111
|
-
contextLinesArg: commandParameters.arguments.contextLines
|
|
112
|
-
});
|
|
113
|
-
return {
|
|
114
|
-
success: true,
|
|
115
|
-
commandResponse: jsonDiff,
|
|
116
|
-
apiResponse: {}
|
|
117
|
-
};
|
|
31
|
+
return helper.prepareLocalFile(args.localFilePath);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
getFile2(session, args, helper) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
const { jobName, jobId, spoolId } = helper.prepareSpoolDescriptor(args.spoolDescription);
|
|
37
|
+
return yield zos_jobs_for_zowe_sdk_1.GetJobs.getSpoolContentById(session, jobName, jobId, spoolId);
|
|
118
38
|
});
|
|
119
39
|
}
|
|
120
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalfileSpooldd.handler.js","sourceRoot":"","sources":["../../../../src/zosfiles/compare/lf-sdd/LocalfileSpooldd.handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;EASE;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"LocalfileSpooldd.handler.js","sourceRoot":"","sources":["../../../../src/zosfiles/compare/lf-sdd/LocalfileSpooldd.handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;EASE;;;;;;;;;;;AAGF,uEAAsD;AAEtD,gEAA4D;AAE5D;;;GAGG;AACH,MAAqB,uBAAwB,SAAQ,wCAAkB;IACtD,QAAQ,CAAC,OAAwB,EAAE,IAAuB,EAAE,MAAyB;;YAC9F,OAAO,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACvD,CAAC;KAAA;IACY,QAAQ,CAAC,OAAwB,EAAE,IAAuB,EAAE,MAAyB;;YAC9F,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YACzF,OAAO,MAAM,+BAAO,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAC/E,CAAC;KAAA;CACJ;AARD,0CAQC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { AbstractSession, ICommandArguments } from "@zowe/imperative";
|
|
3
|
+
import { CompareBaseHelper } from '../CompareBaseHelper';
|
|
4
|
+
import { CompareBaseHandler } from '../CompareBase.handler';
|
|
4
5
|
/**
|
|
5
6
|
* Handler to compare the local file and uss file's content
|
|
6
7
|
* @export
|
|
7
8
|
*/
|
|
8
|
-
export default class LocalfileUssHandler extends
|
|
9
|
-
|
|
9
|
+
export default class LocalfileUssHandler extends CompareBaseHandler {
|
|
10
|
+
getFile1(session: AbstractSession, args: ICommandArguments, helper: CompareBaseHelper): Promise<string | Buffer>;
|
|
11
|
+
getFile2(session: AbstractSession, args: ICommandArguments, helper: CompareBaseHelper): Promise<string | Buffer>;
|
|
10
12
|
}
|
|
@@ -19,103 +19,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
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
22
|
const zos_files_for_zowe_sdk_1 = require("@zowe/zos-files-for-zowe-sdk");
|
|
26
|
-
const
|
|
23
|
+
const CompareBase_handler_1 = require("../CompareBase.handler");
|
|
27
24
|
/**
|
|
28
25
|
* Handler to compare the local file and uss file's content
|
|
29
26
|
* @export
|
|
30
27
|
*/
|
|
31
|
-
class LocalfileUssHandler extends
|
|
32
|
-
|
|
28
|
+
class LocalfileUssHandler extends CompareBase_handler_1.CompareBaseHandler {
|
|
29
|
+
getFile1(session, args, helper) {
|
|
33
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
commandParameters.response.progress.startBar({ task });
|
|
41
|
-
let localFile;
|
|
42
|
-
if (path.isAbsolute(commandParameters.arguments.localFilePath)) {
|
|
43
|
-
// resolving to full path if local path passed is not absolute
|
|
44
|
-
localFile = commandParameters.arguments.localFilePath;
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
localFile = path.resolve(commandParameters.arguments.localFilePath);
|
|
48
|
-
}
|
|
49
|
-
const localFileHandle = fs.openSync(localFile, 'r');
|
|
50
|
-
let lfContentBuf;
|
|
51
|
-
try {
|
|
52
|
-
// check if the path given is of a file or not
|
|
53
|
-
try {
|
|
54
|
-
if (!fs.fstatSync(localFileHandle).isFile()) {
|
|
55
|
-
throw new imperative_1.ImperativeError({
|
|
56
|
-
msg: 'Path given is not of a file, do recheck your path again'
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
if (error instanceof imperative_1.ImperativeError)
|
|
62
|
-
throw error;
|
|
63
|
-
throw new imperative_1.ImperativeError({
|
|
64
|
-
msg: 'Path not found. Please check the path and try again'
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
// reading local file as buffer
|
|
68
|
-
lfContentBuf = fs.readFileSync(localFileHandle);
|
|
69
|
-
}
|
|
70
|
-
finally {
|
|
71
|
-
fs.closeSync(localFileHandle);
|
|
72
|
-
}
|
|
73
|
-
commandParameters.response.progress.endBar();
|
|
74
|
-
// RETRIEVING USS FILE TO COMPARE
|
|
75
|
-
task.statusMessage = "Retrieving uss file";
|
|
76
|
-
commandParameters.response.progress.startBar({ task });
|
|
77
|
-
const ussContentBuf = yield zos_files_for_zowe_sdk_1.Get.USSFile(session, commandParameters.arguments.ussFilePath, {
|
|
78
|
-
binary: commandParameters.arguments.binary,
|
|
79
|
-
encoding: commandParameters.arguments.encoding,
|
|
80
|
-
responseTimeout: commandParameters.arguments.responseTimeout,
|
|
81
|
-
task: task
|
|
82
|
-
});
|
|
83
|
-
commandParameters.response.progress.endBar();
|
|
84
|
-
//CHECKING IF NEEDING TO SPLIT CONTENT STRINGS FOR SEQNUM OPTION
|
|
85
|
-
let lfContentString = "";
|
|
86
|
-
let ussContentString = "";
|
|
87
|
-
const seqnumlen = 8;
|
|
88
|
-
if (commandParameters.arguments.seqnum === false) {
|
|
89
|
-
lfContentString = lfContentBuf.toString().split("\n")
|
|
90
|
-
.map((line) => line.slice(0, -seqnumlen))
|
|
91
|
-
.join("\n");
|
|
92
|
-
ussContentString = ussContentBuf.toString().split("\n")
|
|
93
|
-
.map((line) => line.slice(0, -seqnumlen))
|
|
94
|
-
.join("\n");
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
lfContentString = lfContentBuf.toString();
|
|
98
|
-
ussContentString = ussContentBuf.toString();
|
|
99
|
-
}
|
|
100
|
-
// CHECK TO OPEN UP DIFF IN BROWSER WINDOW
|
|
101
|
-
if (commandParameters.arguments.browserView) {
|
|
102
|
-
yield imperative_1.DiffUtils.openDiffInbrowser(lfContentString, ussContentString);
|
|
103
|
-
return {
|
|
104
|
-
success: true,
|
|
105
|
-
commandResponse: "Launching local-filee and uss-file diffs in browser...",
|
|
106
|
-
apiResponse: {}
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
// RETURNING DIFF
|
|
110
|
-
const jsonDiff = yield imperative_1.DiffUtils.getDiffString(lfContentString, ussContentString, {
|
|
111
|
-
outputFormat: 'terminal',
|
|
112
|
-
contextLinesArg: commandParameters.arguments.contextLines
|
|
113
|
-
});
|
|
114
|
-
return {
|
|
115
|
-
success: true,
|
|
116
|
-
commandResponse: jsonDiff,
|
|
117
|
-
apiResponse: {}
|
|
118
|
-
};
|
|
31
|
+
return helper.prepareLocalFile(args.localFilePath);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
getFile2(session, args, helper) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
return yield zos_files_for_zowe_sdk_1.Get.USSFile(session, args.ussFilePath, Object.assign(Object.assign({}, helper.file2Options), { task: helper.task }));
|
|
119
37
|
});
|
|
120
38
|
}
|
|
121
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalfileUss.handler.js","sourceRoot":"","sources":["../../../../src/zosfiles/compare/lf-uss/LocalfileUss.handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;EASE;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"LocalfileUss.handler.js","sourceRoot":"","sources":["../../../../src/zosfiles/compare/lf-uss/LocalfileUss.handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;EASE;;;;;;;;;;;AAGF,yEAAmD;AAEnD,gEAA4D;AAE5D;;;GAGG;AACH,MAAqB,mBAAoB,SAAQ,wCAAkB;IAClD,QAAQ,CAAC,OAAwB,EAAE,IAAuB,EAAE,MAAyB;;YAC9F,OAAO,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACvD,CAAC;KAAA;IACY,QAAQ,CAAC,OAAwB,EAAE,IAAuB,EAAE,MAAyB;;YAC9F,OAAO,MAAM,4BAAG,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,kCAAO,MAAM,CAAC,YAAY,KAAE,IAAI,EAAE,MAAM,CAAC,IAAI,IAAG,CAAC;QACvG,CAAC;KAAA;CACJ;AAPD,sCAOC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { AbstractSession, ICommandArguments } from "@zowe/imperative";
|
|
3
|
+
import { CompareBaseHandler } from "../CompareBase.handler";
|
|
4
|
+
import { CompareBaseHelper } from "../CompareBaseHelper";
|
|
4
5
|
/**
|
|
5
6
|
* Handler to compare spooldd's content
|
|
6
7
|
* @export
|
|
7
8
|
*/
|
|
8
|
-
export default class SpoolddHandler extends
|
|
9
|
-
|
|
9
|
+
export default class SpoolddHandler extends CompareBaseHandler {
|
|
10
|
+
getFile1(session: AbstractSession, args: ICommandArguments, helper: CompareBaseHelper): Promise<string | Buffer>;
|
|
11
|
+
getFile2(session: AbstractSession, args: ICommandArguments, helper: CompareBaseHelper): Promise<string | Buffer>;
|
|
10
12
|
}
|
|
@@ -19,70 +19,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
const imperative_1 = require("@zowe/imperative");
|
|
23
22
|
const zos_jobs_for_zowe_sdk_1 = require("@zowe/zos-jobs-for-zowe-sdk");
|
|
24
|
-
const
|
|
23
|
+
const CompareBase_handler_1 = require("../CompareBase.handler");
|
|
25
24
|
/**
|
|
26
25
|
* Handler to compare spooldd's content
|
|
27
26
|
* @export
|
|
28
27
|
*/
|
|
29
|
-
class SpoolddHandler extends
|
|
30
|
-
|
|
28
|
+
class SpoolddHandler extends CompareBase_handler_1.CompareBaseHandler {
|
|
29
|
+
getFile1(session, args, helper) {
|
|
31
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const spoolDescription1 = commandParameters.arguments.spoolDescription1;
|
|
41
|
-
const spoolDescArr1 = spoolDescription1.split(descriptionSeperator);
|
|
42
|
-
const jobName1 = spoolDescArr1[0];
|
|
43
|
-
const jobId1 = spoolDescArr1[1];
|
|
44
|
-
const spoolId1 = Number(spoolDescArr1[2]);
|
|
45
|
-
let spoolContentString1 = yield zos_jobs_for_zowe_sdk_1.GetJobs.getSpoolContentById(session, jobName1, jobId1, spoolId1);
|
|
46
|
-
commandParameters.response.progress.endBar();
|
|
47
|
-
// RETRIEVING INFO FOR SECOND SPOOLDD
|
|
48
|
-
task.statusMessage = "Retrieving second spooldd";
|
|
49
|
-
commandParameters.response.progress.startBar({ task });
|
|
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
|
-
let spoolContentString2 = yield zos_jobs_for_zowe_sdk_1.GetJobs.getSpoolContentById(session, jobName2, jobId2, spoolId2);
|
|
56
|
-
commandParameters.response.progress.endBar();
|
|
57
|
-
//CHECKING IF NEEDING TO SPLIT CONTENT STRINGS FOR SEQNUM OPTION
|
|
58
|
-
const seqnumlen = 8;
|
|
59
|
-
if (commandParameters.arguments.seqnum === false) {
|
|
60
|
-
spoolContentString1 = spoolContentString1.split("\n")
|
|
61
|
-
.map((line) => line.slice(0, -seqnumlen))
|
|
62
|
-
.join("\n");
|
|
63
|
-
spoolContentString2 = spoolContentString2.split("\n")
|
|
64
|
-
.map((line) => line.slice(0, -seqnumlen))
|
|
65
|
-
.join("\n");
|
|
66
|
-
}
|
|
67
|
-
// CHECK TO OPEN UP DIFF IN BROWSER WINDOW
|
|
68
|
-
if (commandParameters.arguments.browserView) {
|
|
69
|
-
yield imperative_1.DiffUtils.openDiffInbrowser(spoolContentString1, spoolContentString2);
|
|
70
|
-
return {
|
|
71
|
-
success: true,
|
|
72
|
-
commandResponse: "Launching spool-dds' diffs in browser...",
|
|
73
|
-
apiResponse: {}
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
// RETURNING DIFF
|
|
77
|
-
const jsonDiff = yield imperative_1.DiffUtils.getDiffString(spoolContentString1, spoolContentString2, {
|
|
78
|
-
outputFormat: 'terminal',
|
|
79
|
-
contextLinesArg: commandParameters.arguments.contextLines
|
|
80
|
-
});
|
|
81
|
-
return {
|
|
82
|
-
success: true,
|
|
83
|
-
commandResponse: jsonDiff,
|
|
84
|
-
apiResponse: {}
|
|
85
|
-
};
|
|
31
|
+
const { jobName, jobId, spoolId } = helper.prepareSpoolDescriptor(args.spoolDescription1);
|
|
32
|
+
return yield zos_jobs_for_zowe_sdk_1.GetJobs.getSpoolContentById(session, jobName, jobId, spoolId);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
getFile2(session, args, helper) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const { jobName, jobId, spoolId } = helper.prepareSpoolDescriptor(args.spoolDescription2);
|
|
38
|
+
return yield zos_jobs_for_zowe_sdk_1.GetJobs.getSpoolContentById(session, jobName, jobId, spoolId);
|
|
86
39
|
});
|
|
87
40
|
}
|
|
88
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spooldd.handler.js","sourceRoot":"","sources":["../../../../src/zosfiles/compare/sdd/Spooldd.handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;EASE;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Spooldd.handler.js","sourceRoot":"","sources":["../../../../src/zosfiles/compare/sdd/Spooldd.handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;EASE;;;;;;;;;;;AAGF,uEAAsD;AACtD,gEAA4D;AAG5D;;;GAGG;AACH,MAAqB,cAAe,SAAQ,wCAAkB;IAC7C,QAAQ,CAAC,OAAwB,EAAE,IAAuB,EAAE,MAAyB;;YAC9F,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;YAC1F,OAAO,MAAM,+BAAO,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAC/E,CAAC;KAAA;IACY,QAAQ,CAAC,OAAwB,EAAE,IAAuB,EAAE,MAAyB;;YAC9F,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;YAC1F,OAAO,MAAM,+BAAO,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAC/E,CAAC;KAAA;CACJ;AATD,iCASC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { AbstractSession, ICommandArguments } from "@zowe/imperative";
|
|
3
|
+
import { CompareBaseHandler } from "../CompareBase.handler";
|
|
4
|
+
import { CompareBaseHelper } from "../CompareBaseHelper";
|
|
4
5
|
/**
|
|
5
6
|
* Handler to view a data set's content
|
|
6
7
|
* @export
|
|
7
8
|
*/
|
|
8
|
-
export default class UssFileHandler extends
|
|
9
|
-
|
|
9
|
+
export default class UssFileHandler extends CompareBaseHandler {
|
|
10
|
+
getFile1(session: AbstractSession, args: ICommandArguments, helper: CompareBaseHelper): Promise<string | Buffer>;
|
|
11
|
+
getFile2(session: AbstractSession, args: ICommandArguments, helper: CompareBaseHelper): Promise<string | Buffer>;
|
|
10
12
|
}
|