@crowsgear/escl-protocol-scanner 1.1.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/LICENSE +21 -21
- package/README.ko.md +177 -0
- package/README.md +177 -173
- package/dist/main.d.ts +5 -5
- package/dist/main.js +1 -1
- package/dist/services/client.js +22 -22
- package/dist/services/discovery.d.ts +1 -1
- package/dist/services/discovery.d.ts.map +1 -1
- package/dist/services/discovery.js +45 -35
- package/dist/services/discovery.js.map +1 -1
- package/package.json +70 -70
- package/python/__main__.py +23 -0
- package/python/app.py +91 -0
- package/python/base/__init__.py +2 -0
- package/python/base/service.py +23 -0
- package/python/common/__init__.py +4 -0
- package/python/common/exceptions.py +28 -0
- package/python/common/logger.py +25 -0
- package/python/common/response.py +26 -0
- package/python/decorators/__init__.py +2 -0
- package/python/decorators/scanner.py +30 -0
- package/python/escl-scanner.spec +98 -84
- package/python/services/__init__.py +2 -0
- package/python/services/escl/__init__.py +3 -0
- package/python/services/escl/discovery.py +53 -0
- package/python/services/escl/protocol.py +358 -0
- package/python/services/scanner.py +31 -0
- package/scripts/check-python-deps.js +269 -206
- package/dist/client.d.ts +0 -78
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -384
- package/dist/client.js.map +0 -1
- package/dist/discovery.d.ts +0 -80
- package/dist/discovery.d.ts.map +0 -1
- package/dist/discovery.js +0 -304
- package/dist/discovery.js.map +0 -1
- package/dist/types.d.ts +0 -172
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -7
- package/dist/types.js.map +0 -1
- package/python/__pycache__/base.cpython-312.pyc +0 -0
- package/python/__pycache__/escl_backend.cpython-312.pyc +0 -0
- package/python/base.py +0 -57
- package/python/escl_backend.py +0 -559
- package/python/escl_main.py +0 -119
package/dist/client.js
DELETED
|
@@ -1,384 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* eSCL Protocol Client for Node.js
|
|
4
|
-
* HTTP client for communicating with eSCL/AirPrint network scanners
|
|
5
|
-
*/
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(o, k2, desc);
|
|
13
|
-
}) : (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
o[k2] = m[k];
|
|
16
|
-
}));
|
|
17
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
-
}) : function(o, v) {
|
|
20
|
-
o["default"] = v;
|
|
21
|
-
});
|
|
22
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
-
var ownKeys = function(o) {
|
|
24
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
-
var ar = [];
|
|
26
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
-
return ar;
|
|
28
|
-
};
|
|
29
|
-
return ownKeys(o);
|
|
30
|
-
};
|
|
31
|
-
return function (mod) {
|
|
32
|
-
if (mod && mod.__esModule) return mod;
|
|
33
|
-
var result = {};
|
|
34
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
-
__setModuleDefault(result, mod);
|
|
36
|
-
return result;
|
|
37
|
-
};
|
|
38
|
-
})();
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.ESCLClient = void 0;
|
|
41
|
-
const http = __importStar(require("http"));
|
|
42
|
-
/**
|
|
43
|
-
* eSCL HTTP Client
|
|
44
|
-
* Handles all HTTP communication with eSCL-compatible network scanners
|
|
45
|
-
*/
|
|
46
|
-
class ESCLClient {
|
|
47
|
-
constructor(timeout) {
|
|
48
|
-
this.timeout = 10000;
|
|
49
|
-
if (timeout) {
|
|
50
|
-
this.timeout = timeout;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Get scanner capabilities
|
|
55
|
-
* @param scanner Target scanner
|
|
56
|
-
* @param debug Enable debug logging (default: false)
|
|
57
|
-
* @returns Scanner capabilities
|
|
58
|
-
*/
|
|
59
|
-
async getCapabilities(scanner, debug = false) {
|
|
60
|
-
try {
|
|
61
|
-
const response = await this.httpGet(`http://${scanner.host}:${scanner.port}/eSCL/ScannerCapabilities`);
|
|
62
|
-
return this.parseCapabilities(response, debug);
|
|
63
|
-
}
|
|
64
|
-
catch (error) {
|
|
65
|
-
console.error(`Failed to get capabilities for ${scanner.name}:`, error);
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Start scan job
|
|
71
|
-
* @param scanner Target scanner
|
|
72
|
-
* @param dpi Resolution in DPI
|
|
73
|
-
* @param colorMode Color mode (BlackAndWhite1, Grayscale8, RGB24)
|
|
74
|
-
* @param source Scan source (Platen, Feeder)
|
|
75
|
-
* @param documentFormat Document format MIME type
|
|
76
|
-
* @param width Scan width in mm (optional)
|
|
77
|
-
* @param height Scan height in mm (optional)
|
|
78
|
-
* @returns Scan job UUID
|
|
79
|
-
*/
|
|
80
|
-
async createScanJob(scanner, dpi, colorMode, source, documentFormat, width, height) {
|
|
81
|
-
try {
|
|
82
|
-
const scanSettings = this.buildScanSettings(dpi, colorMode, source, documentFormat, width, height);
|
|
83
|
-
const jobResponse = await this.httpPost(`http://${scanner.host}:${scanner.port}/eSCL/ScanJobs`, scanSettings);
|
|
84
|
-
// Extract job UUID from Location header or response
|
|
85
|
-
const jobMatch = jobResponse.match(/\/eSCL\/ScanJobs\/([a-f0-9-]+)/);
|
|
86
|
-
if (jobMatch) {
|
|
87
|
-
return jobMatch[1];
|
|
88
|
-
}
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
catch (error) {
|
|
92
|
-
const statusCode = error.code || (error.message && parseInt(error.message.match(/HTTP (\d+)/)?.[1]));
|
|
93
|
-
/* 409: 스캐너가 다른 작업을 처리 중 */
|
|
94
|
-
if (statusCode === 409) {
|
|
95
|
-
throw new Error('[SCANNER_BUSY] 스캐너가 다른 작업을 처리 중입니다. 잠시 후 다시 시도해주세요.');
|
|
96
|
-
}
|
|
97
|
-
/* 500: ADF 모드에서 문서 없음 */
|
|
98
|
-
if (statusCode === 500 && source === 'Feeder') {
|
|
99
|
-
throw new Error('[ADF_NO_DOCUMENT] 문서가 급지기(ADF)에 올려져 있지 않습니다.');
|
|
100
|
-
}
|
|
101
|
-
/* 503: 스캐너 서비스 불가 */
|
|
102
|
-
if (statusCode === 503) {
|
|
103
|
-
throw new Error('[SCANNER_UNAVAILABLE] 스캐너를 사용할 수 없습니다. 스캐너 상태를 확인해주세요.');
|
|
104
|
-
}
|
|
105
|
-
console.error(`Failed to create scan job on ${scanner.name}:`, error);
|
|
106
|
-
throw error;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Poll scan job status
|
|
111
|
-
* @param scanner Target scanner
|
|
112
|
-
* @param jobId Scan job ID
|
|
113
|
-
* @returns Job status and image URLs if complete
|
|
114
|
-
*/
|
|
115
|
-
async getScanJobStatus(scanner, jobId) {
|
|
116
|
-
try {
|
|
117
|
-
const response = await this.httpGet(`http://${scanner.host}:${scanner.port}/eSCL/ScanJobs/${jobId}`);
|
|
118
|
-
const status = response.match(/<JobState>(\w+)<\/JobState>/)?.[1] || 'Unknown';
|
|
119
|
-
const images = [];
|
|
120
|
-
// Extract image URLs
|
|
121
|
-
const imageMatches = response.matchAll(/<DocumentURI>([^<]+)<\/DocumentURI>/g);
|
|
122
|
-
for (const match of imageMatches) {
|
|
123
|
-
images.push(match[1]);
|
|
124
|
-
}
|
|
125
|
-
return {
|
|
126
|
-
status: status,
|
|
127
|
-
images
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
catch (error) {
|
|
131
|
-
console.error(`Failed to get scan job status:`, error);
|
|
132
|
-
return { status: 'Unknown', images: [] };
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Download scanned image
|
|
137
|
-
* @param scanner Target scanner
|
|
138
|
-
* @param imageUrl Relative image URL
|
|
139
|
-
* @returns PNG image data as Buffer
|
|
140
|
-
*/
|
|
141
|
-
async downloadImage(scanner, imageUrl) {
|
|
142
|
-
try {
|
|
143
|
-
const fullUrl = `http://${scanner.host}:${scanner.port}${imageUrl}`;
|
|
144
|
-
return await this.httpGetBinary(fullUrl);
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
console.error(`Failed to download image:`, error);
|
|
148
|
-
return null;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Build eSCL scan settings XML
|
|
153
|
-
* @param dpi Resolution in DPI
|
|
154
|
-
* @param colorMode Color mode
|
|
155
|
-
* @param source Scan source
|
|
156
|
-
* @param documentFormat Document format MIME type
|
|
157
|
-
* @param width Scan width in mm (optional)
|
|
158
|
-
* @param height Scan height in mm (optional)
|
|
159
|
-
*/
|
|
160
|
-
buildScanSettings(dpi, colorMode, source, documentFormat, width, height) {
|
|
161
|
-
const ESCL_NS = 'http://schemas.hp.com/imaging/escl/2011/05/03';
|
|
162
|
-
const PWG_NS = 'http://www.pwg.org/schemas/2010/12/sm';
|
|
163
|
-
/* mm to 1/300 inch 변환 */
|
|
164
|
-
const widthInUnits = Math.round((width || 210) / 25.4 * 300);
|
|
165
|
-
const heightInUnits = Math.round((height || 297) / 25.4 * 300);
|
|
166
|
-
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
167
|
-
<scan:ScanSettings xmlns:scan="${ESCL_NS}" xmlns:pwg="${PWG_NS}">
|
|
168
|
-
<pwg:Version>2.0</pwg:Version>
|
|
169
|
-
<scan:Intent>Document</scan:Intent>
|
|
170
|
-
<pwg:ScanRegions>
|
|
171
|
-
<pwg:ScanRegion>
|
|
172
|
-
<pwg:ContentRegionUnits>escl:ThreeHundredthsOfInches</pwg:ContentRegionUnits>
|
|
173
|
-
<pwg:XOffset>0</pwg:XOffset>
|
|
174
|
-
<pwg:YOffset>0</pwg:YOffset>
|
|
175
|
-
<pwg:Width>${widthInUnits}</pwg:Width>
|
|
176
|
-
<pwg:Height>${heightInUnits}</pwg:Height>
|
|
177
|
-
</pwg:ScanRegion>
|
|
178
|
-
</pwg:ScanRegions>
|
|
179
|
-
<scan:Justification>
|
|
180
|
-
<pwg:XImagePosition>Center</pwg:XImagePosition>
|
|
181
|
-
<pwg:YImagePosition>Center</pwg:YImagePosition>
|
|
182
|
-
</scan:Justification>
|
|
183
|
-
<pwg:InputSource>${source}</pwg:InputSource>
|
|
184
|
-
<scan:ColorMode>${colorMode}</scan:ColorMode>
|
|
185
|
-
<scan:XResolution>${dpi}</scan:XResolution>
|
|
186
|
-
<scan:YResolution>${dpi}</scan:YResolution>
|
|
187
|
-
<pwg:DocumentFormat>${documentFormat}</pwg:DocumentFormat>
|
|
188
|
-
</scan:ScanSettings>`;
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Parse scanner capabilities from XML response
|
|
192
|
-
* @param xml XML response from scanner
|
|
193
|
-
* @param debug Enable debug logging (default: false)
|
|
194
|
-
*/
|
|
195
|
-
parseCapabilities(xml, debug = false) {
|
|
196
|
-
const resolutions = [];
|
|
197
|
-
const colorModes = [];
|
|
198
|
-
const sources = [];
|
|
199
|
-
const documentFormats = [];
|
|
200
|
-
// Debug: Print raw XML for inspection (only if debug enabled)
|
|
201
|
-
if (debug) {
|
|
202
|
-
console.log('[eSCL] Capabilities XML response (full):');
|
|
203
|
-
console.log(xml);
|
|
204
|
-
}
|
|
205
|
-
// eSCL uses XML namespaces, need to handle scan: and pwg: prefixes
|
|
206
|
-
// Extract resolutions - look for XResolution inside DiscreteResolution
|
|
207
|
-
const discreteResMatches = xml.matchAll(/<[a-z]*:?DiscreteResolution>[\s\S]*?<[a-z]*:?XResolution>(\d+)<\/[a-z]*:?XResolution>[\s\S]*?<\/[a-z]*:?DiscreteResolution>/g);
|
|
208
|
-
for (const match of discreteResMatches) {
|
|
209
|
-
resolutions.push(parseInt(match[1], 10));
|
|
210
|
-
}
|
|
211
|
-
// Also try simpler pattern for XResolution
|
|
212
|
-
if (resolutions.length === 0) {
|
|
213
|
-
const xResMatches = xml.matchAll(/<[a-z]*:?XResolution>(\d+)<\/[a-z]*:?XResolution>/g);
|
|
214
|
-
for (const match of xResMatches) {
|
|
215
|
-
const res = parseInt(match[1], 10);
|
|
216
|
-
if (!resolutions.includes(res)) {
|
|
217
|
-
resolutions.push(res);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
// Extract color modes - handle namespaced tags
|
|
222
|
-
const colorMatches = xml.matchAll(/<[a-z]*:?ColorMode>(\w+)<\/[a-z]*:?ColorMode>/g);
|
|
223
|
-
for (const match of colorMatches) {
|
|
224
|
-
const mode = match[1];
|
|
225
|
-
if (['BlackAndWhite1', 'Grayscale8', 'RGB24'].includes(mode)) {
|
|
226
|
-
colorModes.push(mode);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
// Extract sources - look for InputSource tags or check for Platen/Adf elements
|
|
230
|
-
const sourceMatches = xml.matchAll(/<[a-z]*:?InputSource>(\w+)<\/[a-z]*:?InputSource>/g);
|
|
231
|
-
for (const match of sourceMatches) {
|
|
232
|
-
const source = match[1];
|
|
233
|
-
if (['Platen', 'Adf', 'Feeder'].includes(source)) {
|
|
234
|
-
sources.push(source);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
// If no InputSource tags found, check for Platen/Adf elements directly
|
|
238
|
-
if (sources.length === 0) {
|
|
239
|
-
if (/<[a-z]*:?Platen[\s>]/.test(xml)) {
|
|
240
|
-
sources.push('Platen');
|
|
241
|
-
}
|
|
242
|
-
if (/<[a-z]*:?Adf[\s>]/.test(xml)) {
|
|
243
|
-
sources.push('Adf');
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
// Extract document formats (MIME types)
|
|
247
|
-
// Look for <pwg:DocumentFormat> and <scan:DocumentFormatExt> tags
|
|
248
|
-
const formatMatches = xml.matchAll(/<[a-z]*:?DocumentFormat(?:Ext)?>([^<]+)<\/[a-z]*:?DocumentFormat(?:Ext)?>/g);
|
|
249
|
-
for (const match of formatMatches) {
|
|
250
|
-
const format = match[1].trim();
|
|
251
|
-
if (format && !documentFormats.includes(format)) {
|
|
252
|
-
documentFormats.push(format);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
// If no formats found, default to jpeg (most common)
|
|
256
|
-
if (documentFormats.length === 0) {
|
|
257
|
-
documentFormats.push('image/jpeg');
|
|
258
|
-
}
|
|
259
|
-
// Extract max width and height (in 1/300 inch units, convert to mm)
|
|
260
|
-
let maxWidth;
|
|
261
|
-
let maxHeight;
|
|
262
|
-
const maxWidthMatch = xml.match(/<[a-z]*:?MaxWidth>(\d+)<\/[a-z]*:?MaxWidth>/);
|
|
263
|
-
const maxHeightMatch = xml.match(/<[a-z]*:?MaxHeight>(\d+)<\/[a-z]*:?MaxHeight>/);
|
|
264
|
-
if (maxWidthMatch) {
|
|
265
|
-
maxWidth = Math.round(parseInt(maxWidthMatch[1], 10) / 300 * 25.4);
|
|
266
|
-
}
|
|
267
|
-
if (maxHeightMatch) {
|
|
268
|
-
maxHeight = Math.round(parseInt(maxHeightMatch[1], 10) / 300 * 25.4);
|
|
269
|
-
}
|
|
270
|
-
// Remove duplicates from resolutions
|
|
271
|
-
const uniqueResolutions = Array.from(new Set(resolutions)).sort((a, b) => a - b);
|
|
272
|
-
const uniqueColorModes = Array.from(new Set(colorModes));
|
|
273
|
-
const uniqueSources = Array.from(new Set(sources));
|
|
274
|
-
const uniqueDocumentFormats = Array.from(new Set(documentFormats));
|
|
275
|
-
if (debug) {
|
|
276
|
-
console.log('[eSCL] Parsed capabilities:', {
|
|
277
|
-
resolutions: uniqueResolutions,
|
|
278
|
-
colorModes: uniqueColorModes,
|
|
279
|
-
sources: uniqueSources,
|
|
280
|
-
documentFormats: uniqueDocumentFormats,
|
|
281
|
-
maxWidth,
|
|
282
|
-
maxHeight
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
return {
|
|
286
|
-
resolutions: uniqueResolutions,
|
|
287
|
-
colorModes: uniqueColorModes,
|
|
288
|
-
sources: uniqueSources,
|
|
289
|
-
documentFormats: uniqueDocumentFormats,
|
|
290
|
-
maxWidth,
|
|
291
|
-
maxHeight
|
|
292
|
-
};
|
|
293
|
-
}
|
|
294
|
-
/**
|
|
295
|
-
* HTTP GET request
|
|
296
|
-
*/
|
|
297
|
-
httpGet(url) {
|
|
298
|
-
return new Promise((resolve, reject) => {
|
|
299
|
-
const req = http.get(url, { timeout: this.timeout }, (res) => {
|
|
300
|
-
let data = '';
|
|
301
|
-
res.on('data', (chunk) => {
|
|
302
|
-
data += chunk;
|
|
303
|
-
});
|
|
304
|
-
res.on('end', () => {
|
|
305
|
-
if (res.statusCode === 200) {
|
|
306
|
-
resolve(data);
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
reject(new Error(`HTTP ${res.statusCode}`));
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
});
|
|
313
|
-
req.on('timeout', () => {
|
|
314
|
-
req.destroy();
|
|
315
|
-
reject(new Error('Request timeout'));
|
|
316
|
-
});
|
|
317
|
-
req.on('error', reject);
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
/**
|
|
321
|
-
* HTTP GET request (binary)
|
|
322
|
-
*/
|
|
323
|
-
httpGetBinary(url) {
|
|
324
|
-
return new Promise((resolve, reject) => {
|
|
325
|
-
const req = http.get(url, { timeout: this.timeout }, (res) => {
|
|
326
|
-
const chunks = [];
|
|
327
|
-
res.on('data', (chunk) => {
|
|
328
|
-
chunks.push(chunk);
|
|
329
|
-
});
|
|
330
|
-
res.on('end', () => {
|
|
331
|
-
if (res.statusCode === 200) {
|
|
332
|
-
resolve(Buffer.concat(chunks));
|
|
333
|
-
}
|
|
334
|
-
else {
|
|
335
|
-
reject(new Error(`HTTP ${res.statusCode}`));
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
});
|
|
339
|
-
req.on('timeout', () => {
|
|
340
|
-
req.destroy();
|
|
341
|
-
reject(new Error('Request timeout'));
|
|
342
|
-
});
|
|
343
|
-
req.on('error', reject);
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* HTTP POST request
|
|
348
|
-
*/
|
|
349
|
-
httpPost(url, body) {
|
|
350
|
-
return new Promise((resolve, reject) => {
|
|
351
|
-
const options = {
|
|
352
|
-
method: 'POST',
|
|
353
|
-
headers: {
|
|
354
|
-
'Content-Type': 'application/xml',
|
|
355
|
-
'Content-Length': Buffer.byteLength(body)
|
|
356
|
-
},
|
|
357
|
-
timeout: this.timeout
|
|
358
|
-
};
|
|
359
|
-
const req = http.request(url, options, (res) => {
|
|
360
|
-
let data = '';
|
|
361
|
-
res.on('data', (chunk) => {
|
|
362
|
-
data += chunk;
|
|
363
|
-
});
|
|
364
|
-
res.on('end', () => {
|
|
365
|
-
if (res.statusCode === 201 || res.statusCode === 200) {
|
|
366
|
-
resolve(data || res.headers.location || '');
|
|
367
|
-
}
|
|
368
|
-
else {
|
|
369
|
-
reject(new Error(`HTTP ${res.statusCode}`));
|
|
370
|
-
}
|
|
371
|
-
});
|
|
372
|
-
});
|
|
373
|
-
req.on('timeout', () => {
|
|
374
|
-
req.destroy();
|
|
375
|
-
reject(new Error('Request timeout'));
|
|
376
|
-
});
|
|
377
|
-
req.on('error', reject);
|
|
378
|
-
req.write(body);
|
|
379
|
-
req.end();
|
|
380
|
-
});
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
exports.ESCLClient = ESCLClient;
|
|
384
|
-
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA6B;AAG7B;;;GAGG;AACH,MAAa,UAAU;IAGrB,YAAY,OAAgB;QAFpB,YAAO,GAAW,KAAK,CAAC;QAG9B,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACzB,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,eAAe,CAAC,OAAoB,EAAE,QAAiB,KAAK;QAChE,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CACjC,UAAU,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,2BAA2B,CAClE,CAAC;YAEF,OAAO,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QACjD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,kCAAkC,OAAO,CAAC,IAAI,GAAG,EAAE,KAAK,CAAC,CAAC;YACxE,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,aAAa,CACjB,OAAoB,EACpB,GAAW,EACX,SAAiB,EACjB,MAAc,EACd,cAAsB,EACtB,KAAc,EACd,MAAe;QAEf,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;YACnG,MAAM,WAA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AC;oBAC9C,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,GAAG,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;gBACrB,GAAG,CAAC,OAAO,EAAE,CAAC;gBACd,MAAM,CAAC,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;YACvC,CAAC,CAAC,CAAC;YAEH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YACxB,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAChB,GAAG,CAAC,GAAG,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAtYD,gCAsYC"}
|
package/dist/discovery.d.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* eSCL Scanner Discovery via Python Subprocess or Binary
|
|
3
|
-
* Uses Python's zeroconf library for mDNS discovery
|
|
4
|
-
* Prefers pre-built binary if available, falls back to Python script
|
|
5
|
-
*/
|
|
6
|
-
import { ESCLScanner, DiscoveryResponse } from './types';
|
|
7
|
-
/**
|
|
8
|
-
* eSCL Scanner Discovery Service Options
|
|
9
|
-
*/
|
|
10
|
-
export interface ESCLDiscoveryOptions {
|
|
11
|
-
/** Custom Python executable path (e.g., /path/to/venv/bin/python3) */
|
|
12
|
-
pythonPath?: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* eSCL Scanner Discovery Service
|
|
16
|
-
* Spawns Python subprocess or binary to handle mDNS discovery using zeroconf
|
|
17
|
-
*/
|
|
18
|
-
export declare class ESCLDiscovery {
|
|
19
|
-
private pythonProcess;
|
|
20
|
-
private discovered;
|
|
21
|
-
private listeners;
|
|
22
|
-
private timeout;
|
|
23
|
-
private processReady;
|
|
24
|
-
private pythonPath;
|
|
25
|
-
private binaryPath;
|
|
26
|
-
constructor(timeout?: number, options?: ESCLDiscoveryOptions);
|
|
27
|
-
/**
|
|
28
|
-
* Get path to pre-built binary if available
|
|
29
|
-
* @returns Binary path or null if not found
|
|
30
|
-
*/
|
|
31
|
-
private getBinaryPath;
|
|
32
|
-
/**
|
|
33
|
-
* Validate Python path exists and is executable
|
|
34
|
-
* Skipped if pre-built binary is available
|
|
35
|
-
* @throws Error if Python path is invalid and no binary available
|
|
36
|
-
*/
|
|
37
|
-
private validatePythonPath;
|
|
38
|
-
/**
|
|
39
|
-
* Start discovering scanners
|
|
40
|
-
* @param timeout Optional timeout in milliseconds (default: 5000ms)
|
|
41
|
-
* @returns Promise resolving with discovery response containing success status and scanner data
|
|
42
|
-
*/
|
|
43
|
-
startDiscovery(timeout?: number): Promise<DiscoveryResponse>;
|
|
44
|
-
/**
|
|
45
|
-
* Stop active discovery and cleanup subprocess
|
|
46
|
-
*/
|
|
47
|
-
stopDiscovery(): void;
|
|
48
|
-
/**
|
|
49
|
-
* Get currently discovered scanners
|
|
50
|
-
*/
|
|
51
|
-
getScanners(): ESCLScanner[];
|
|
52
|
-
/**
|
|
53
|
-
* Subscribe to scanner discovery updates
|
|
54
|
-
*/
|
|
55
|
-
onScannerDiscovered(callback: (scanners: ESCLScanner[]) => void): void;
|
|
56
|
-
/**
|
|
57
|
-
* Unsubscribe from scanner discovery updates
|
|
58
|
-
*/
|
|
59
|
-
offScannerDiscovered(callback: (scanners: ESCLScanner[]) => void): void;
|
|
60
|
-
/**
|
|
61
|
-
* Start Python subprocess or binary for eSCL operations
|
|
62
|
-
*/
|
|
63
|
-
private startPythonService;
|
|
64
|
-
/**
|
|
65
|
-
* Cleanup Python subprocess
|
|
66
|
-
*/
|
|
67
|
-
private cleanup;
|
|
68
|
-
/**
|
|
69
|
-
* Notify all listeners of scanner changes
|
|
70
|
-
*/
|
|
71
|
-
private notifyListeners;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Convenience function for quick scanner discovery
|
|
75
|
-
* @param timeout Discovery timeout in milliseconds (default: 5000)
|
|
76
|
-
* @param options Discovery options including pythonPath
|
|
77
|
-
* @returns Discovery response with success status and scanner data
|
|
78
|
-
*/
|
|
79
|
-
export declare function discoverScanners(timeout?: number, options?: ESCLDiscoveryOptions): Promise<DiscoveryResponse>;
|
|
80
|
-
//# sourceMappingURL=discovery.d.ts.map
|
package/dist/discovery.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAAE,WAAW,EAA6B,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEpF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,UAAU,CAAuC;IACzD,OAAO,CAAC,SAAS,CAAqD;IACtE,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,YAAY,CAAkB;IACtC,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,UAAU,CAAuB;gBAE7B,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB;IAW5D;;;OAGG;IACH,OAAO,CAAC,aAAa;IAYrB;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IA4B1B;;;;OAIG;IACG,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAoDlE;;OAEG;IACH,aAAa,IAAI,IAAI;IAIrB;;OAEG;IACH,WAAW,IAAI,WAAW,EAAE;IAI5B;;OAEG;IACH,mBAAmB,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,IAAI,GAAG,IAAI;IAItE;;OAEG;IACH,oBAAoB,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,IAAI,GAAG,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