node-hp-scan-to 1.0.1 → 1.2.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/README.md +92 -11
- package/dist/Destination.d.ts +8 -7
- package/dist/Destination.js +115 -84
- package/dist/Destination.js.map +1 -1
- package/dist/Event.d.ts +21 -17
- package/dist/Event.js +46 -30
- package/dist/Event.js.map +1 -1
- package/dist/EventTable.d.ts +11 -11
- package/dist/EventTable.js +26 -26
- package/dist/EventTable.js.map +1 -1
- package/dist/HPApi.d.ts +42 -29
- package/dist/HPApi.js +528 -333
- package/dist/HPApi.js.map +1 -1
- package/dist/Job.d.ts +36 -24
- package/dist/Job.js +94 -62
- package/dist/Job.js.map +1 -1
- package/dist/JpegUtil.d.ts +26 -0
- package/dist/JpegUtil.js +238 -0
- package/dist/JpegUtil.js.map +1 -0
- package/dist/PathHelper.d.ts +5 -0
- package/dist/PathHelper.js +79 -0
- package/dist/PathHelper.js.map +1 -0
- package/dist/ScanContent.d.ts +12 -0
- package/dist/ScanContent.js +82 -0
- package/dist/ScanContent.js.map +1 -0
- package/dist/ScanJobSettings.d.ts +6 -6
- package/dist/ScanJobSettings.js +95 -94
- package/dist/ScanJobSettings.js.map +1 -1
- package/dist/ScanStatus.d.ts +18 -18
- package/dist/ScanStatus.js +35 -29
- package/dist/ScanStatus.js.map +1 -1
- package/dist/WalkupScanDestination.d.ts +24 -24
- package/dist/WalkupScanDestination.js +40 -40
- package/dist/WalkupScanDestination.js.map +1 -1
- package/dist/WalkupScanDestinations.d.ts +11 -11
- package/dist/WalkupScanDestinations.js +26 -26
- package/dist/WalkupScanDestinations.js.map +1 -1
- package/dist/WalkupScanToCompDestination.d.ts +26 -0
- package/dist/WalkupScanToCompDestination.js +44 -0
- package/dist/WalkupScanToCompDestination.js.map +1 -0
- package/dist/WalkupScanToCompDestinations.d.ts +11 -0
- package/dist/WalkupScanToCompDestinations.js +27 -0
- package/dist/WalkupScanToCompDestinations.js.map +1 -0
- package/dist/WalkupScanToCompEvent.d.ts +10 -0
- package/dist/WalkupScanToCompEvent.js +17 -0
- package/dist/WalkupScanToCompEvent.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +630 -292
- package/dist/index.js.map +1 -1
- package/nodemon.json +5 -5
- package/package.json +72 -57
- package/src/Destination.ts +63 -45
- package/src/Event.ts +45 -31
- package/src/EventTable.ts +25 -25
- package/src/HPApi.ts +365 -222
- package/src/Job.ts +100 -62
- package/src/JpegUtil.ts +319 -0
- package/src/PathHelper.ts +44 -0
- package/src/ScanContent.ts +34 -0
- package/src/ScanJobSettings.ts +55 -55
- package/src/ScanStatus.ts +36 -31
- package/src/WalkupScanDestination.ts +46 -44
- package/src/WalkupScanDestinations.ts +29 -27
- package/src/WalkupScanToCompDestination.ts +55 -0
- package/src/WalkupScanToCompDestinations.ts +34 -0
- package/src/WalkupScanToCompEvent.ts +18 -0
- package/src/index.ts +555 -205
- package/tsconfig.json +34 -0
package/dist/index.js
CHANGED
|
@@ -1,293 +1,631 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
case
|
|
24
|
-
case
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (
|
|
29
|
-
if (t &&
|
|
30
|
-
if (t[
|
|
31
|
-
_.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
function
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return [3 /*break*/,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
case
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
case
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
case
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
case
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
return [3 /*break*/,
|
|
189
|
-
case
|
|
190
|
-
console.log("
|
|
191
|
-
|
|
192
|
-
case
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
case
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
function
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
case
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
_a.
|
|
224
|
-
return [
|
|
225
|
-
case 3:
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
case
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
case
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
case
|
|
286
|
-
|
|
287
|
-
return [
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// noinspection XmlDeprecatedElement,HtmlDeprecatedTag
|
|
3
|
+
"use strict";
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
14
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
15
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
16
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
17
|
+
function step(op) {
|
|
18
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
19
|
+
while (_) try {
|
|
20
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
21
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
22
|
+
switch (op[0]) {
|
|
23
|
+
case 0: case 1: t = op; break;
|
|
24
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
25
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
26
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
27
|
+
default:
|
|
28
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
29
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
30
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
31
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
32
|
+
if (t[2]) _.ops.pop();
|
|
33
|
+
_.trys.pop(); continue;
|
|
34
|
+
}
|
|
35
|
+
op = body.call(thisArg, _);
|
|
36
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
37
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
var os_1 = __importDefault(require("os"));
|
|
45
|
+
var promises_1 = __importDefault(require("fs/promises"));
|
|
46
|
+
var commander_1 = require("commander");
|
|
47
|
+
var bonjour_1 = __importDefault(require("bonjour"));
|
|
48
|
+
var Destination_1 = __importDefault(require("./Destination"));
|
|
49
|
+
var ScanJobSettings_1 = __importDefault(require("./ScanJobSettings"));
|
|
50
|
+
var HPApi_1 = __importDefault(require("./HPApi"));
|
|
51
|
+
var JpegUtil_1 = __importDefault(require("./JpegUtil"));
|
|
52
|
+
var PathHelper_1 = __importDefault(require("./PathHelper"));
|
|
53
|
+
var ScanContent_1 = require("./ScanContent");
|
|
54
|
+
var program = new commander_1.Command();
|
|
55
|
+
function delay(t) {
|
|
56
|
+
return new Promise(function (resolve) {
|
|
57
|
+
setTimeout(resolve, t);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function waitForScanEvent(resourceURI, afterEtag) {
|
|
61
|
+
if (afterEtag === void 0) { afterEtag = null; }
|
|
62
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
63
|
+
var eventTable, acceptedScanEvent, currentEtag;
|
|
64
|
+
return __generator(this, function (_a) {
|
|
65
|
+
switch (_a.label) {
|
|
66
|
+
case 0:
|
|
67
|
+
console.log("Start listening for new ScanEvent");
|
|
68
|
+
return [4 /*yield*/, HPApi_1.default.getEvents(afterEtag !== null && afterEtag !== void 0 ? afterEtag : "")];
|
|
69
|
+
case 1:
|
|
70
|
+
eventTable = _a.sent();
|
|
71
|
+
acceptedScanEvent = null;
|
|
72
|
+
currentEtag = eventTable.etag;
|
|
73
|
+
_a.label = 2;
|
|
74
|
+
case 2:
|
|
75
|
+
if (!(acceptedScanEvent == null)) return [3 /*break*/, 4];
|
|
76
|
+
return [4 /*yield*/, HPApi_1.default.getEvents(currentEtag, 1200)];
|
|
77
|
+
case 3:
|
|
78
|
+
eventTable = _a.sent();
|
|
79
|
+
currentEtag = eventTable.etag;
|
|
80
|
+
acceptedScanEvent = eventTable.eventTable.events.find(function (ev) {
|
|
81
|
+
return ev.isScanEvent &&
|
|
82
|
+
ev.destinationURI &&
|
|
83
|
+
ev.destinationURI.indexOf(resourceURI) >= 0;
|
|
84
|
+
});
|
|
85
|
+
return [3 /*break*/, 2];
|
|
86
|
+
case 4: return [2 /*return*/, acceptedScanEvent];
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function waitPrinterUntilItIsReadyToUploadOrCompleted(jobUrl) {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
93
|
+
var job, isReadyToUpload;
|
|
94
|
+
return __generator(this, function (_a) {
|
|
95
|
+
switch (_a.label) {
|
|
96
|
+
case 0:
|
|
97
|
+
job = null;
|
|
98
|
+
isReadyToUpload = false;
|
|
99
|
+
_a.label = 1;
|
|
100
|
+
case 1: return [4 /*yield*/, HPApi_1.default.getJob(jobUrl)];
|
|
101
|
+
case 2:
|
|
102
|
+
job = _a.sent();
|
|
103
|
+
if (job.jobState === "Canceled") {
|
|
104
|
+
return [2 /*return*/, job];
|
|
105
|
+
}
|
|
106
|
+
else if (job.pageState === "ReadyToUpload" ||
|
|
107
|
+
job.jobState === "Completed") {
|
|
108
|
+
isReadyToUpload = true;
|
|
109
|
+
}
|
|
110
|
+
else if (job.jobState == "Processing") {
|
|
111
|
+
isReadyToUpload = false;
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
console.log("Unknown jobState: ".concat(job.jobState));
|
|
115
|
+
}
|
|
116
|
+
return [4 /*yield*/, delay(300)];
|
|
117
|
+
case 3:
|
|
118
|
+
_a.sent();
|
|
119
|
+
_a.label = 4;
|
|
120
|
+
case 4:
|
|
121
|
+
if (!isReadyToUpload) return [3 /*break*/, 1];
|
|
122
|
+
_a.label = 5;
|
|
123
|
+
case 5: return [2 /*return*/, job];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
function register() {
|
|
129
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
130
|
+
var destination, hostname, toComp, walkupScanDestinations, destinations, walkupScanDestinations, destinations, resourceURI;
|
|
131
|
+
return __generator(this, function (_a) {
|
|
132
|
+
switch (_a.label) {
|
|
133
|
+
case 0:
|
|
134
|
+
hostname = os_1.default.hostname();
|
|
135
|
+
return [4 /*yield*/, HPApi_1.default.getWalkupScanToCompCaps()];
|
|
136
|
+
case 1:
|
|
137
|
+
toComp = _a.sent();
|
|
138
|
+
if (!toComp) return [3 /*break*/, 3];
|
|
139
|
+
return [4 /*yield*/, HPApi_1.default.getWalkupScanToCompDestinations()];
|
|
140
|
+
case 2:
|
|
141
|
+
walkupScanDestinations = _a.sent();
|
|
142
|
+
destinations = walkupScanDestinations.destinations;
|
|
143
|
+
console.log("Host destinations fetched:", destinations.map(function (d) { return d.name; }).join(", "));
|
|
144
|
+
destination = destinations.find(function (x) { return x.name === hostname; });
|
|
145
|
+
return [3 /*break*/, 5];
|
|
146
|
+
case 3: return [4 /*yield*/, HPApi_1.default.getWalkupScanDestinations()];
|
|
147
|
+
case 4:
|
|
148
|
+
walkupScanDestinations = _a.sent();
|
|
149
|
+
destinations = walkupScanDestinations.destinations;
|
|
150
|
+
console.log("Host destinations fetched:", destinations.map(function (d) { return d.name; }).join(", "));
|
|
151
|
+
destination = destinations.find(function (x) { return x.name === hostname; });
|
|
152
|
+
_a.label = 5;
|
|
153
|
+
case 5:
|
|
154
|
+
if (!destination) return [3 /*break*/, 6];
|
|
155
|
+
console.log("Re-using existing destination: ".concat(hostname, " - ").concat(destination.resourceURI));
|
|
156
|
+
resourceURI = destination.resourceURI;
|
|
157
|
+
return [3 /*break*/, 8];
|
|
158
|
+
case 6: return [4 /*yield*/, HPApi_1.default.registerDestination(new Destination_1.default(hostname, hostname, toComp), toComp)];
|
|
159
|
+
case 7:
|
|
160
|
+
resourceURI = _a.sent();
|
|
161
|
+
console.log("New Destination registered: ".concat(hostname, " - ").concat(resourceURI));
|
|
162
|
+
_a.label = 8;
|
|
163
|
+
case 8: return [2 /*return*/, resourceURI];
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
function TryGetDestination(event) {
|
|
169
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
170
|
+
var destination, i, destinationURI, shortcut;
|
|
171
|
+
return __generator(this, function (_a) {
|
|
172
|
+
switch (_a.label) {
|
|
173
|
+
case 0:
|
|
174
|
+
destination = null;
|
|
175
|
+
i = 0;
|
|
176
|
+
_a.label = 1;
|
|
177
|
+
case 1:
|
|
178
|
+
if (!(i < 20)) return [3 /*break*/, 7];
|
|
179
|
+
destinationURI = event.destinationURI;
|
|
180
|
+
if (!destinationURI) return [3 /*break*/, 3];
|
|
181
|
+
return [4 /*yield*/, HPApi_1.default.getDestination(destinationURI)];
|
|
182
|
+
case 2:
|
|
183
|
+
destination = _a.sent();
|
|
184
|
+
shortcut = destination.shortcut;
|
|
185
|
+
if (shortcut !== "") {
|
|
186
|
+
return [2 /*return*/, destination];
|
|
187
|
+
}
|
|
188
|
+
return [3 /*break*/, 4];
|
|
189
|
+
case 3:
|
|
190
|
+
console.log("No destination URI found");
|
|
191
|
+
_a.label = 4;
|
|
192
|
+
case 4:
|
|
193
|
+
console.log("No shortcut yet available, attempt: ".concat(i + 1, "/20"));
|
|
194
|
+
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 1000); })];
|
|
195
|
+
case 5:
|
|
196
|
+
_a.sent(); //wait 1s
|
|
197
|
+
_a.label = 6;
|
|
198
|
+
case 6:
|
|
199
|
+
i++;
|
|
200
|
+
return [3 /*break*/, 1];
|
|
201
|
+
case 7:
|
|
202
|
+
console.log("Failing to detect destination shortcut");
|
|
203
|
+
console.log(JSON.stringify(destination));
|
|
204
|
+
return [2 /*return*/, null];
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
function fixJpegSize(filePath) {
|
|
210
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
211
|
+
var buffer, height;
|
|
212
|
+
return __generator(this, function (_a) {
|
|
213
|
+
switch (_a.label) {
|
|
214
|
+
case 0: return [4 /*yield*/, promises_1.default.readFile(filePath)];
|
|
215
|
+
case 1:
|
|
216
|
+
buffer = _a.sent();
|
|
217
|
+
height = JpegUtil_1.default.fixSizeWithDNL(buffer);
|
|
218
|
+
if (!(height != null)) return [3 /*break*/, 3];
|
|
219
|
+
// rewrite the fixed file
|
|
220
|
+
return [4 /*yield*/, promises_1.default.writeFile(filePath, buffer)];
|
|
221
|
+
case 2:
|
|
222
|
+
// rewrite the fixed file
|
|
223
|
+
_a.sent();
|
|
224
|
+
return [2 /*return*/, height];
|
|
225
|
+
case 3: return [2 /*return*/, null];
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
function createScanPage(job, currentPageNumber, filePath, sizeFixed) {
|
|
231
|
+
var height = sizeFixed !== null && sizeFixed !== void 0 ? sizeFixed : job.imageHeight;
|
|
232
|
+
return {
|
|
233
|
+
path: filePath,
|
|
234
|
+
pageNumber: currentPageNumber,
|
|
235
|
+
width: job.imageWidth,
|
|
236
|
+
height: height,
|
|
237
|
+
xResolution: job.xResolution,
|
|
238
|
+
yResolution: job.yResolution,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
function handleProcessingState(job, inputSource, folder, scanCount, currentPageNumber) {
|
|
242
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
243
|
+
var destinationFilePath, filePath, sizeFixed;
|
|
244
|
+
return __generator(this, function (_a) {
|
|
245
|
+
switch (_a.label) {
|
|
246
|
+
case 0:
|
|
247
|
+
if (!(job.pageState == "ReadyToUpload" &&
|
|
248
|
+
job.binaryURL != null &&
|
|
249
|
+
job.currentPageNumber != null)) return [3 /*break*/, 4];
|
|
250
|
+
console.log("Ready to download page job page ".concat(job.currentPageNumber, " at:"), job.binaryURL);
|
|
251
|
+
destinationFilePath = PathHelper_1.default.getFileForPage(folder, scanCount, currentPageNumber, program.opts().pattern, "jpg");
|
|
252
|
+
return [4 /*yield*/, HPApi_1.default.downloadPage(job.binaryURL, destinationFilePath)];
|
|
253
|
+
case 1:
|
|
254
|
+
filePath = _a.sent();
|
|
255
|
+
console.log("Page downloaded to:", filePath);
|
|
256
|
+
sizeFixed = null;
|
|
257
|
+
if (!(inputSource == "Adf")) return [3 /*break*/, 3];
|
|
258
|
+
return [4 /*yield*/, fixJpegSize(filePath)];
|
|
259
|
+
case 2:
|
|
260
|
+
sizeFixed = _a.sent();
|
|
261
|
+
if (sizeFixed == null) {
|
|
262
|
+
console.log("File size has not been fixed, DNF may not have been found and approximate height is: ".concat(job.imageHeight));
|
|
263
|
+
}
|
|
264
|
+
_a.label = 3;
|
|
265
|
+
case 3: return [2 /*return*/, createScanPage(job, currentPageNumber, filePath, sizeFixed)];
|
|
266
|
+
case 4:
|
|
267
|
+
console.log("Unknown pageState: ".concat(job.pageState));
|
|
268
|
+
return [4 /*yield*/, delay(200)];
|
|
269
|
+
case 5:
|
|
270
|
+
_a.sent();
|
|
271
|
+
return [2 /*return*/, null];
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
function waitScanRequest(compEventURI) {
|
|
277
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
278
|
+
var waitMax, i, walkupScanToCompEvent, message;
|
|
279
|
+
return __generator(this, function (_a) {
|
|
280
|
+
switch (_a.label) {
|
|
281
|
+
case 0:
|
|
282
|
+
waitMax = 50;
|
|
283
|
+
i = 0;
|
|
284
|
+
_a.label = 1;
|
|
285
|
+
case 1:
|
|
286
|
+
if (!(i < waitMax)) return [3 /*break*/, 5];
|
|
287
|
+
return [4 /*yield*/, HPApi_1.default.getWalkupScanToCompEvent(compEventURI)];
|
|
288
|
+
case 2:
|
|
289
|
+
walkupScanToCompEvent = _a.sent();
|
|
290
|
+
message = walkupScanToCompEvent.eventType;
|
|
291
|
+
if (message === "HostSelected") {
|
|
292
|
+
// this ok to wait
|
|
293
|
+
}
|
|
294
|
+
else if (message === "ScanRequested") {
|
|
295
|
+
return [3 /*break*/, 5];
|
|
296
|
+
}
|
|
297
|
+
else if (message === "ScanNewPageRequested") {
|
|
298
|
+
return [3 /*break*/, 5];
|
|
299
|
+
}
|
|
300
|
+
else if (message === "ScanPagesComplete") {
|
|
301
|
+
console.log("no more page to scan, scan is finished");
|
|
302
|
+
return [2 /*return*/, false];
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
console.log("Unknown eventType: ".concat(message));
|
|
306
|
+
return [2 /*return*/, false];
|
|
307
|
+
}
|
|
308
|
+
console.log("Waiting user input: ".concat(i + 1, "/").concat(waitMax));
|
|
309
|
+
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 1000); })];
|
|
310
|
+
case 3:
|
|
311
|
+
_a.sent(); //wait 1s
|
|
312
|
+
_a.label = 4;
|
|
313
|
+
case 4:
|
|
314
|
+
i++;
|
|
315
|
+
return [3 /*break*/, 1];
|
|
316
|
+
case 5: return [2 /*return*/, true];
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
function executeScanJob(scanJobSettings, inputSource, folder, scanCount, scanJobContent) {
|
|
322
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
323
|
+
var jobUrl, job, page;
|
|
324
|
+
return __generator(this, function (_a) {
|
|
325
|
+
switch (_a.label) {
|
|
326
|
+
case 0: return [4 /*yield*/, HPApi_1.default.postJob(scanJobSettings)];
|
|
327
|
+
case 1:
|
|
328
|
+
jobUrl = _a.sent();
|
|
329
|
+
console.log("New job created:", jobUrl);
|
|
330
|
+
return [4 /*yield*/, HPApi_1.default.getJob(jobUrl)];
|
|
331
|
+
case 2:
|
|
332
|
+
job = _a.sent();
|
|
333
|
+
_a.label = 3;
|
|
334
|
+
case 3:
|
|
335
|
+
if (!(job.jobState !== "Completed")) return [3 /*break*/, 10];
|
|
336
|
+
return [4 /*yield*/, waitPrinterUntilItIsReadyToUploadOrCompleted(jobUrl)];
|
|
337
|
+
case 4:
|
|
338
|
+
job = _a.sent();
|
|
339
|
+
if (job.jobState == "Completed") {
|
|
340
|
+
return [3 /*break*/, 3];
|
|
341
|
+
}
|
|
342
|
+
if (!(job.jobState === "Processing")) return [3 /*break*/, 6];
|
|
343
|
+
return [4 /*yield*/, handleProcessingState(job, inputSource, folder, scanCount, scanJobContent.elements.length + 1)];
|
|
344
|
+
case 5:
|
|
345
|
+
page = _a.sent();
|
|
346
|
+
if (page != null) {
|
|
347
|
+
scanJobContent.elements.push(page);
|
|
348
|
+
}
|
|
349
|
+
return [3 /*break*/, 9];
|
|
350
|
+
case 6:
|
|
351
|
+
if (!(job.jobState === "Canceled")) return [3 /*break*/, 7];
|
|
352
|
+
console.log("Job cancelled by device");
|
|
353
|
+
return [3 /*break*/, 10];
|
|
354
|
+
case 7:
|
|
355
|
+
console.log("Unhandled jobState: ".concat(job.jobState));
|
|
356
|
+
return [4 /*yield*/, delay(200)];
|
|
357
|
+
case 8:
|
|
358
|
+
_a.sent();
|
|
359
|
+
_a.label = 9;
|
|
360
|
+
case 9: return [3 /*break*/, 3];
|
|
361
|
+
case 10:
|
|
362
|
+
console.log("Job state: ".concat(job.jobState, ", totalPages: ").concat(job.totalPageNumber, ":"));
|
|
363
|
+
return [2 /*return*/];
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
function waitScanNewPageRequest(compEventURI) {
|
|
369
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
370
|
+
var startNewScanJob, wait, walkupScanToCompEvent, message;
|
|
371
|
+
return __generator(this, function (_a) {
|
|
372
|
+
switch (_a.label) {
|
|
373
|
+
case 0:
|
|
374
|
+
startNewScanJob = false;
|
|
375
|
+
wait = true;
|
|
376
|
+
_a.label = 1;
|
|
377
|
+
case 1:
|
|
378
|
+
if (!wait) return [3 /*break*/, 4];
|
|
379
|
+
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 1000); })];
|
|
380
|
+
case 2:
|
|
381
|
+
_a.sent(); //wait 1s
|
|
382
|
+
return [4 /*yield*/, HPApi_1.default.getWalkupScanToCompEvent(compEventURI)];
|
|
383
|
+
case 3:
|
|
384
|
+
walkupScanToCompEvent = _a.sent();
|
|
385
|
+
message = walkupScanToCompEvent.eventType;
|
|
386
|
+
if (message === "ScanNewPageRequested") {
|
|
387
|
+
startNewScanJob = true;
|
|
388
|
+
wait = false;
|
|
389
|
+
}
|
|
390
|
+
else if (message === "ScanPagesComplete") {
|
|
391
|
+
wait = false;
|
|
392
|
+
}
|
|
393
|
+
else if (message === "ScanRequested") {
|
|
394
|
+
// continue waiting
|
|
395
|
+
}
|
|
396
|
+
else {
|
|
397
|
+
wait = false;
|
|
398
|
+
console.log("Unknown eventType: ".concat(message));
|
|
399
|
+
}
|
|
400
|
+
return [3 /*break*/, 1];
|
|
401
|
+
case 4: return [2 /*return*/, startNewScanJob];
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
function executeScanJobs(scanJobSettings, inputSource, folder, scanCount, scanJobContent, firstEvent) {
|
|
407
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
408
|
+
var lastEvent, startNewScanJob;
|
|
409
|
+
return __generator(this, function (_a) {
|
|
410
|
+
switch (_a.label) {
|
|
411
|
+
case 0: return [4 /*yield*/, executeScanJob(scanJobSettings, inputSource, folder, scanCount, scanJobContent)];
|
|
412
|
+
case 1:
|
|
413
|
+
_a.sent();
|
|
414
|
+
lastEvent = firstEvent;
|
|
415
|
+
if (!(lastEvent.compEventURI &&
|
|
416
|
+
inputSource !== "Adf" &&
|
|
417
|
+
lastEvent.destinationURI)) return [3 /*break*/, 8];
|
|
418
|
+
return [4 /*yield*/, waitForScanEvent(lastEvent.destinationURI, lastEvent.agingStamp)];
|
|
419
|
+
case 2:
|
|
420
|
+
lastEvent = _a.sent();
|
|
421
|
+
if (!lastEvent.compEventURI) {
|
|
422
|
+
return [2 /*return*/];
|
|
423
|
+
}
|
|
424
|
+
return [4 /*yield*/, waitScanNewPageRequest(lastEvent.compEventURI)];
|
|
425
|
+
case 3:
|
|
426
|
+
startNewScanJob = _a.sent();
|
|
427
|
+
_a.label = 4;
|
|
428
|
+
case 4:
|
|
429
|
+
if (!startNewScanJob) return [3 /*break*/, 8];
|
|
430
|
+
return [4 /*yield*/, executeScanJob(scanJobSettings, inputSource, folder, scanCount, scanJobContent)];
|
|
431
|
+
case 5:
|
|
432
|
+
_a.sent();
|
|
433
|
+
if (!lastEvent.destinationURI) {
|
|
434
|
+
return [3 /*break*/, 8];
|
|
435
|
+
}
|
|
436
|
+
return [4 /*yield*/, waitForScanEvent(lastEvent.destinationURI, lastEvent.agingStamp)];
|
|
437
|
+
case 6:
|
|
438
|
+
lastEvent = _a.sent();
|
|
439
|
+
if (!lastEvent.compEventURI) {
|
|
440
|
+
return [2 /*return*/];
|
|
441
|
+
}
|
|
442
|
+
return [4 /*yield*/, waitScanNewPageRequest(lastEvent.compEventURI)];
|
|
443
|
+
case 7:
|
|
444
|
+
startNewScanJob = _a.sent();
|
|
445
|
+
return [3 /*break*/, 4];
|
|
446
|
+
case 8: return [2 /*return*/];
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
function mergeToPdf(folder, scanCount, scanJobContent) {
|
|
452
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
453
|
+
var pdfFilePath;
|
|
454
|
+
return __generator(this, function (_a) {
|
|
455
|
+
switch (_a.label) {
|
|
456
|
+
case 0:
|
|
457
|
+
pdfFilePath = PathHelper_1.default.getFileForScan(folder, scanCount, program.opts().pattern, "pdf");
|
|
458
|
+
return [4 /*yield*/, (0, ScanContent_1.createPdfFrom)(scanJobContent, pdfFilePath)];
|
|
459
|
+
case 1:
|
|
460
|
+
_a.sent();
|
|
461
|
+
scanJobContent.elements.forEach(function (e) { return promises_1.default.unlink(e.path); });
|
|
462
|
+
return [2 /*return*/, pdfFilePath];
|
|
463
|
+
}
|
|
464
|
+
});
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
function displayPdfScan(pdfFilePath, scanJobContent) {
|
|
468
|
+
console.log("The following page(s) have been rendered inside '".concat(pdfFilePath, "': "));
|
|
469
|
+
scanJobContent.elements.forEach(function (e) {
|
|
470
|
+
return console.log("\t- page ".concat(e.pageNumber.toString().padStart(3, " "), " - ").concat(e.width, "x").concat(e.height));
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
function displayJpegScan(scanJobContent) {
|
|
474
|
+
scanJobContent.elements.forEach(function (e) {
|
|
475
|
+
return console.log("\t- page ".concat(e.pageNumber.toString().padStart(3, " "), " - ").concat(e.width, "x").concat(e.height, " - ").concat(e.path));
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
function saveScan(event, folder, scanCount) {
|
|
479
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
480
|
+
var proceedToScan, destination, contentType, toPdf, scanStatus, inputSource, scanJobSettings, scanJobContent, pdfFilePath;
|
|
481
|
+
return __generator(this, function (_a) {
|
|
482
|
+
switch (_a.label) {
|
|
483
|
+
case 0:
|
|
484
|
+
if (!event.compEventURI) return [3 /*break*/, 2];
|
|
485
|
+
return [4 /*yield*/, waitScanRequest(event.compEventURI)];
|
|
486
|
+
case 1:
|
|
487
|
+
proceedToScan = _a.sent();
|
|
488
|
+
if (!proceedToScan) {
|
|
489
|
+
return [2 /*return*/];
|
|
490
|
+
}
|
|
491
|
+
_a.label = 2;
|
|
492
|
+
case 2: return [4 /*yield*/, TryGetDestination(event)];
|
|
493
|
+
case 3:
|
|
494
|
+
destination = _a.sent();
|
|
495
|
+
if (!destination) {
|
|
496
|
+
console.log("No shortcut selected!");
|
|
497
|
+
return [2 /*return*/];
|
|
498
|
+
}
|
|
499
|
+
console.log("Selected shortcut: " + destination.shortcut);
|
|
500
|
+
contentType = destination.getContentType();
|
|
501
|
+
toPdf = destination.shortcut === "SavePDF" || destination.shortcut === "EmailPDF";
|
|
502
|
+
return [4 /*yield*/, HPApi_1.default.getScanStatus()];
|
|
503
|
+
case 4:
|
|
504
|
+
scanStatus = _a.sent();
|
|
505
|
+
console.log("Afd is : " + scanStatus.adfState);
|
|
506
|
+
inputSource = scanStatus.getInputSource();
|
|
507
|
+
scanJobSettings = new ScanJobSettings_1.default(inputSource, contentType);
|
|
508
|
+
scanJobContent = { elements: [] };
|
|
509
|
+
return [4 /*yield*/, executeScanJobs(scanJobSettings, inputSource, folder, scanCount, scanJobContent, event)];
|
|
510
|
+
case 5:
|
|
511
|
+
_a.sent();
|
|
512
|
+
console.log("Scan of page(s) completed totalPages: ".concat(scanJobContent.elements.length, ":"));
|
|
513
|
+
if (!toPdf) return [3 /*break*/, 7];
|
|
514
|
+
return [4 /*yield*/, mergeToPdf(folder, scanCount, scanJobContent)];
|
|
515
|
+
case 6:
|
|
516
|
+
pdfFilePath = _a.sent();
|
|
517
|
+
displayPdfScan(pdfFilePath, scanJobContent);
|
|
518
|
+
return [3 /*break*/, 8];
|
|
519
|
+
case 7:
|
|
520
|
+
displayJpegScan(scanJobContent);
|
|
521
|
+
_a.label = 8;
|
|
522
|
+
case 8: return [2 /*return*/];
|
|
523
|
+
}
|
|
524
|
+
});
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
var iteration = 0;
|
|
528
|
+
function init() {
|
|
529
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
530
|
+
var folder, scanCount, keepActive, errorCount, resourceURI, event_1, e_1;
|
|
531
|
+
return __generator(this, function (_a) {
|
|
532
|
+
switch (_a.label) {
|
|
533
|
+
case 0: return [4 /*yield*/, PathHelper_1.default.getOutputFolder(program.opts().directory)];
|
|
534
|
+
case 1:
|
|
535
|
+
folder = _a.sent();
|
|
536
|
+
console.log("Target folder: ".concat(folder));
|
|
537
|
+
scanCount = 0;
|
|
538
|
+
keepActive = true;
|
|
539
|
+
errorCount = 0;
|
|
540
|
+
_a.label = 2;
|
|
541
|
+
case 2:
|
|
542
|
+
if (!keepActive) return [3 /*break*/, 10];
|
|
543
|
+
console.log("Running iteration: ".concat(iteration, " - errorCount: ").concat(errorCount));
|
|
544
|
+
_a.label = 3;
|
|
545
|
+
case 3:
|
|
546
|
+
_a.trys.push([3, 7, , 8]);
|
|
547
|
+
return [4 /*yield*/, register()];
|
|
548
|
+
case 4:
|
|
549
|
+
resourceURI = _a.sent();
|
|
550
|
+
console.log("Waiting scan event for:", resourceURI);
|
|
551
|
+
return [4 /*yield*/, waitForScanEvent(resourceURI)];
|
|
552
|
+
case 5:
|
|
553
|
+
event_1 = _a.sent();
|
|
554
|
+
scanCount++;
|
|
555
|
+
console.log("Scan event captured, saving scan #".concat(scanCount));
|
|
556
|
+
return [4 /*yield*/, saveScan(event_1, folder, scanCount)];
|
|
557
|
+
case 6:
|
|
558
|
+
_a.sent();
|
|
559
|
+
return [3 /*break*/, 8];
|
|
560
|
+
case 7:
|
|
561
|
+
e_1 = _a.sent();
|
|
562
|
+
errorCount++;
|
|
563
|
+
console.error(e_1);
|
|
564
|
+
console.log(e_1);
|
|
565
|
+
return [3 /*break*/, 8];
|
|
566
|
+
case 8:
|
|
567
|
+
if (errorCount === 50) {
|
|
568
|
+
keepActive = false;
|
|
569
|
+
}
|
|
570
|
+
return [4 /*yield*/, delay(1000)];
|
|
571
|
+
case 9:
|
|
572
|
+
_a.sent();
|
|
573
|
+
return [3 /*break*/, 2];
|
|
574
|
+
case 10: return [2 /*return*/];
|
|
575
|
+
}
|
|
576
|
+
});
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
function findOfficejetIp() {
|
|
580
|
+
return new Promise(function (resolve) {
|
|
581
|
+
var bonjour = (0, bonjour_1.default)();
|
|
582
|
+
console.log("Searching printer...");
|
|
583
|
+
var browser = bonjour.find({
|
|
584
|
+
type: "http",
|
|
585
|
+
}, function (service) {
|
|
586
|
+
console.log(".");
|
|
587
|
+
if (service.name.startsWith(program.opts().name) &&
|
|
588
|
+
service.port === 80 &&
|
|
589
|
+
service.type === "http" &&
|
|
590
|
+
service.addresses != null) {
|
|
591
|
+
browser.stop();
|
|
592
|
+
bonjour.destroy();
|
|
593
|
+
console.log("Found: ".concat(service.name));
|
|
594
|
+
resolve(service.addresses[0]);
|
|
595
|
+
}
|
|
596
|
+
});
|
|
597
|
+
browser.start();
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
function main() {
|
|
601
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
602
|
+
var ip, debug;
|
|
603
|
+
return __generator(this, function (_a) {
|
|
604
|
+
switch (_a.label) {
|
|
605
|
+
case 0:
|
|
606
|
+
program.option("-ip, --address <ip>", "IP address of the printer (this overrides -p)");
|
|
607
|
+
program.option("-n, --name <name>", "Name of the printer for service discovery", "HP Smart Tank Plus 570 series"); //or i.e. 'Deskjet 3520 series'
|
|
608
|
+
program.option("-d, --directory <dir>", "Directory where scans are saved (defaults to /tmp/scan-to-pc<random>)");
|
|
609
|
+
program.option("-p, --pattern <pattern>", 'Pattern for filename (i.e. "scan"_dd.mm.yyyy_hh:MM:ss, without this its scanPage<number>)');
|
|
610
|
+
program.option("-D, --debug", "Enable debug");
|
|
611
|
+
program.parse(process.argv);
|
|
612
|
+
ip = program.opts().address || "192.168.1.53";
|
|
613
|
+
if (!!ip) return [3 /*break*/, 2];
|
|
614
|
+
return [4 /*yield*/, findOfficejetIp()];
|
|
615
|
+
case 1:
|
|
616
|
+
ip = _a.sent();
|
|
617
|
+
_a.label = 2;
|
|
618
|
+
case 2:
|
|
619
|
+
debug = program.opts().debug != null;
|
|
620
|
+
HPApi_1.default.setDebug(debug);
|
|
621
|
+
HPApi_1.default.setPrinterIP(ip);
|
|
622
|
+
return [4 /*yield*/, init()];
|
|
623
|
+
case 3:
|
|
624
|
+
_a.sent();
|
|
625
|
+
return [2 /*return*/];
|
|
626
|
+
}
|
|
627
|
+
});
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
main();
|
|
293
631
|
//# sourceMappingURL=index.js.map
|