@ezeep/ezeep-js 1.0.239 → 1.0.241
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/dist/cjs/ezeep.cjs.js +1 -1
- package/dist/cjs/ezp-auth_15.cjs.entry.js +82 -37
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +83 -37
- package/dist/custom-elements/index.js +83 -38
- package/dist/esm/ezeep.js +1 -1
- package/dist/esm/ezp-auth_15.entry.js +82 -37
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/ezeep.js +1 -1
- package/dist/esm-es5/ezp-auth_15.entry.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/{p-0afb1821.system.entry.js → p-816cb3ae.system.entry.js} +3 -3
- package/dist/ezeep/p-84bd195a.system.js +1 -1
- package/dist/ezeep/{p-69fc0c9c.entry.js → p-cf66aca1.entry.js} +2 -2
- package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +1 -0
- package/package.json +1 -1
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/{p-0afb1821.system.entry.js → p-816cb3ae.system.entry.js} +3 -3
- package/www/build/p-84bd195a.system.js +1 -1
- package/www/build/{p-69fc0c9c.entry.js → p-cf66aca1.entry.js} +2 -2
package/dist/cjs/ezeep.cjs.js
CHANGED
|
@@ -17,5 +17,5 @@ const patchBrowser = () => {
|
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(options => {
|
|
19
19
|
appGlobals.globalScripts();
|
|
20
|
-
return index.bootstrapLazy([["ezp-auth_15.cjs",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[1,"ezp-user-menu",{"name":[1],"open":[1028]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}],[1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
|
|
20
|
+
return index.bootstrapLazy([["ezp-auth_15.cjs",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"hubDriverError":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[1,"ezp-user-menu",{"name":[1],"open":[1028]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}],[1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
|
|
21
21
|
});
|
|
@@ -32815,6 +32815,7 @@ let EzpPrinterSelection = class {
|
|
|
32815
32815
|
this.printFailed = false;
|
|
32816
32816
|
this.notSupported = false;
|
|
32817
32817
|
this.noPrinters = false;
|
|
32818
|
+
this.hubDriverError = false;
|
|
32818
32819
|
this.userMenuOpen = false;
|
|
32819
32820
|
this.printStopped = false;
|
|
32820
32821
|
this.selectedPrinterConfig = {
|
|
@@ -32864,6 +32865,7 @@ let EzpPrinterSelection = class {
|
|
|
32864
32865
|
this.failedFiles = [];
|
|
32865
32866
|
this.successfulFiles = [];
|
|
32866
32867
|
this.partialSuccess = false;
|
|
32868
|
+
this.hubDriverError = false;
|
|
32867
32869
|
this.printCancel.emit();
|
|
32868
32870
|
};
|
|
32869
32871
|
this.validateData = (data) => {
|
|
@@ -32883,6 +32885,7 @@ let EzpPrinterSelection = class {
|
|
|
32883
32885
|
this.failedFiles = [];
|
|
32884
32886
|
this.successfulFiles = [];
|
|
32885
32887
|
this.partialSuccess = false;
|
|
32888
|
+
this.hubDriverError = false;
|
|
32886
32889
|
// we have to initialse this obj with empty strings to display the select component
|
|
32887
32890
|
// but don't want to send any attributes with empty strings to the API
|
|
32888
32891
|
if (this.selectedPrinterConfig.Trays &&
|
|
@@ -32923,7 +32926,13 @@ let EzpPrinterSelection = class {
|
|
|
32923
32926
|
this.printFailed = true;
|
|
32924
32927
|
this.printProcessing = false;
|
|
32925
32928
|
}
|
|
32926
|
-
if (
|
|
32929
|
+
else if (this.selectedPrinter.is_queue &&
|
|
32930
|
+
(data.code === 412 || data.code === 500 || data.code === 503)) {
|
|
32931
|
+
// Hub printer specific errors - likely driver not assigned
|
|
32932
|
+
this.hubDriverError = true;
|
|
32933
|
+
this.printProcessing = false;
|
|
32934
|
+
}
|
|
32935
|
+
else if (data.jobid) {
|
|
32927
32936
|
printStore.state.jobID = data.jobid;
|
|
32928
32937
|
poll({
|
|
32929
32938
|
fn: this.printService.getPrintStatus,
|
|
@@ -32932,22 +32941,40 @@ let EzpPrinterSelection = class {
|
|
|
32932
32941
|
maxAttempts: this.MAX_POLL_ATTEMPTS,
|
|
32933
32942
|
}).catch((err) => {
|
|
32934
32943
|
console.warn(err);
|
|
32935
|
-
this
|
|
32944
|
+
// Check if this is a hub printer and the error might be driver-related
|
|
32945
|
+
if (this.selectedPrinter.is_queue) {
|
|
32946
|
+
this.hubDriverError = true;
|
|
32947
|
+
}
|
|
32948
|
+
else {
|
|
32949
|
+
this.printFailed = true;
|
|
32950
|
+
}
|
|
32936
32951
|
this.printProcessing = false;
|
|
32937
32952
|
});
|
|
32938
32953
|
}
|
|
32939
32954
|
else {
|
|
32940
|
-
|
|
32955
|
+
// No job ID returned - check if it's a hub printer
|
|
32956
|
+
if (this.selectedPrinter.is_queue) {
|
|
32957
|
+
this.hubDriverError = true;
|
|
32958
|
+
}
|
|
32959
|
+
else {
|
|
32960
|
+
this.printFailed = true;
|
|
32961
|
+
}
|
|
32941
32962
|
this.printProcessing = false;
|
|
32942
32963
|
}
|
|
32943
32964
|
})
|
|
32944
32965
|
.catch((error) => {
|
|
32945
32966
|
console.log(error);
|
|
32946
|
-
this
|
|
32967
|
+
// Check if this is a hub printer and the error might be driver-related
|
|
32968
|
+
if (this.selectedPrinter.is_queue) {
|
|
32969
|
+
this.hubDriverError = true;
|
|
32970
|
+
}
|
|
32971
|
+
else {
|
|
32972
|
+
this.printFailed = true;
|
|
32973
|
+
}
|
|
32947
32974
|
this.printProcessing = false;
|
|
32948
32975
|
});
|
|
32949
32976
|
}
|
|
32950
|
-
if (this.files && this.files.length > 1) {
|
|
32977
|
+
else if (this.files && this.files.length > 1) {
|
|
32951
32978
|
await this.processMultipleFiles(this.files, cleanPrintProperties);
|
|
32952
32979
|
}
|
|
32953
32980
|
else if (this.files && this.files.length === 1) {
|
|
@@ -33005,12 +33032,12 @@ let EzpPrinterSelection = class {
|
|
|
33005
33032
|
this.printCancel.emit();
|
|
33006
33033
|
break;
|
|
33007
33034
|
case 'print-failed':
|
|
33008
|
-
this.printProcessing = false;
|
|
33009
33035
|
this.printFailed = false;
|
|
33010
|
-
this.failedFiles = [];
|
|
33011
|
-
this.successfulFiles = [];
|
|
33012
33036
|
break;
|
|
33013
|
-
case '
|
|
33037
|
+
case 'hub-driver-error':
|
|
33038
|
+
this.hubDriverError = false;
|
|
33039
|
+
break;
|
|
33040
|
+
case 'not-supported':
|
|
33014
33041
|
this.noPrinters = false;
|
|
33015
33042
|
break;
|
|
33016
33043
|
}
|
|
@@ -33025,6 +33052,11 @@ let EzpPrinterSelection = class {
|
|
|
33025
33052
|
this.printProcessing = false;
|
|
33026
33053
|
this.handlePrint();
|
|
33027
33054
|
break;
|
|
33055
|
+
case 'hub-driver-error':
|
|
33056
|
+
this.hubDriverError = false;
|
|
33057
|
+
this.printProcessing = false;
|
|
33058
|
+
this.handlePrint();
|
|
33059
|
+
break;
|
|
33028
33060
|
}
|
|
33029
33061
|
}
|
|
33030
33062
|
getPropertiesFromLocalStorage() {
|
|
@@ -33162,7 +33194,13 @@ let EzpPrinterSelection = class {
|
|
|
33162
33194
|
catch (error) {
|
|
33163
33195
|
console.error(`Error processing file ${file.name}:`, error);
|
|
33164
33196
|
this.failedFiles.push(file.name);
|
|
33165
|
-
//
|
|
33197
|
+
// Check if this is a hub driver error
|
|
33198
|
+
if (error.message && error.message.includes('Hub printer driver error')) {
|
|
33199
|
+
this.hubDriverError = true;
|
|
33200
|
+
this.printProcessing = false;
|
|
33201
|
+
return; // Stop processing other files if it's a hub driver issue
|
|
33202
|
+
}
|
|
33203
|
+
// Continue with the next file
|
|
33166
33204
|
}
|
|
33167
33205
|
}
|
|
33168
33206
|
// Determine final status based on results
|
|
@@ -33202,6 +33240,11 @@ let EzpPrinterSelection = class {
|
|
|
33202
33240
|
if (data.code === 804) {
|
|
33203
33241
|
throw new Error(`Print failed for file: ${file.name}`);
|
|
33204
33242
|
}
|
|
33243
|
+
// Check for hub printer driver errors
|
|
33244
|
+
if (this.selectedPrinter.is_queue &&
|
|
33245
|
+
(data.code === 412 || data.code === 500 || data.code === 503)) {
|
|
33246
|
+
throw new Error(`Hub printer driver error for file: ${file.name}`);
|
|
33247
|
+
}
|
|
33205
33248
|
if (data.jobid) {
|
|
33206
33249
|
printStore.state.jobID = data.jobid;
|
|
33207
33250
|
// Wait for this print job to complete before processing the next file
|
|
@@ -33222,34 +33265,36 @@ let EzpPrinterSelection = class {
|
|
|
33222
33265
|
this.uploading = false;
|
|
33223
33266
|
}
|
|
33224
33267
|
async waitForPrintCompletion() {
|
|
33225
|
-
|
|
33226
|
-
|
|
33227
|
-
|
|
33228
|
-
|
|
33229
|
-
|
|
33230
|
-
|
|
33231
|
-
|
|
33232
|
-
resolve();
|
|
33233
|
-
}
|
|
33234
|
-
else if (data.jobstatus === 1246 || data.jobstatus === 129) {
|
|
33235
|
-
// Still processing, keep polling
|
|
33236
|
-
setTimeout(poll, this.POLL_INTERVAL);
|
|
33237
|
-
}
|
|
33238
|
-
else if (data.jobstatus === 3011 || data.jobstatus === 2) {
|
|
33239
|
-
// Failure
|
|
33240
|
-
reject(new Error('Print job failed: ' + (data.jobstatusstring || data.jobstatus)));
|
|
33241
|
-
}
|
|
33242
|
-
else {
|
|
33243
|
-
// Unknown status, treat as failure for safety
|
|
33244
|
-
reject(new Error('Unknown print job status: ' + data.jobstatus));
|
|
33245
|
-
}
|
|
33268
|
+
while (true) {
|
|
33269
|
+
try {
|
|
33270
|
+
const data = await this.printService.getPrintStatus();
|
|
33271
|
+
console.log('[waitForPrintCompletion] Poll response:', data);
|
|
33272
|
+
if (data.jobstatus === 0) {
|
|
33273
|
+
// Success
|
|
33274
|
+
return;
|
|
33246
33275
|
}
|
|
33247
|
-
|
|
33248
|
-
|
|
33276
|
+
else if (data.jobstatus === 1246 || data.jobstatus === 129) {
|
|
33277
|
+
// Still processing, wait before next poll
|
|
33278
|
+
await new Promise((resolve) => setTimeout(resolve, this.POLL_INTERVAL));
|
|
33249
33279
|
}
|
|
33250
|
-
|
|
33251
|
-
|
|
33252
|
-
|
|
33280
|
+
else if (data.jobstatus === 3011 || data.jobstatus === 2) {
|
|
33281
|
+
// Failure
|
|
33282
|
+
throw new Error('Print job failed: ' + (data.jobstatusstring || data.jobstatus));
|
|
33283
|
+
}
|
|
33284
|
+
else if (this.selectedPrinter.is_queue &&
|
|
33285
|
+
(data.jobstatus === 412 || data.jobstatus === 500 || data.jobstatus === 503)) {
|
|
33286
|
+
// Hub printer driver error
|
|
33287
|
+
throw new Error('Hub printer driver error: ' + (data.jobstatusstring || data.jobstatus));
|
|
33288
|
+
}
|
|
33289
|
+
else {
|
|
33290
|
+
// Unknown status, treat as failure for safety
|
|
33291
|
+
throw new Error('Unknown print job status: ' + data.jobstatus);
|
|
33292
|
+
}
|
|
33293
|
+
}
|
|
33294
|
+
catch (error) {
|
|
33295
|
+
throw error;
|
|
33296
|
+
}
|
|
33297
|
+
}
|
|
33253
33298
|
}
|
|
33254
33299
|
getFileExtension(filename) {
|
|
33255
33300
|
const extension = filename.split('.').pop();
|
|
@@ -33407,7 +33452,7 @@ let EzpPrinterSelection = class {
|
|
|
33407
33452
|
? this.partialSuccess
|
|
33408
33453
|
? `${i18next.t('printer_selection.print_success')} (${this.successfulFiles.length}/${this.totalFiles} ${i18next.t('printer_selection.files')} - ${this.failedFiles.length} failed`
|
|
33409
33454
|
: `${i18next.t('printer_selection.print_success')} (${this.totalFiles} ${i18next.t('printer_selection.files')})`
|
|
33410
|
-
: i18next.t('printer_selection.print_success'), instance: "print-success", close: true })) : this.printFailed ? (index.h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "print-failed", close: true, retry: true })) : this.notSupported ? (index.h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.not_supported'), instance: "not-supported", retry: true })) : this.noPrinters ? (index.h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.no_printers'), instance: "no-printers", close: true })) : null)), !this.hideheader && (index.h("div", { id: "header" }, index.h("ezp-label", { weight: "heavy", text: i18next.t('printer_selection.print') + `${!this.notSupported ? ':' : ''}` }), index.h("ezp-label", { text: !this.notSupported
|
|
33455
|
+
: i18next.t('printer_selection.print_success'), instance: "print-success", close: true })) : this.printFailed ? (index.h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "print-failed", close: true, retry: true })) : this.notSupported ? (index.h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.not_supported'), instance: "not-supported", retry: true })) : this.hubDriverError ? (index.h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "hub-driver-error", close: true, retry: true })) : this.noPrinters ? (index.h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.no_printers'), instance: "no-printers", close: true })) : null)), !this.hideheader && (index.h("div", { id: "header" }, index.h("ezp-label", { weight: "heavy", text: i18next.t('printer_selection.print') + `${!this.notSupported ? ':' : ''}` }), index.h("ezp-label", { text: !this.notSupported
|
|
33411
33456
|
? this.files && this.files.length > 1
|
|
33412
33457
|
? i18next.t('printer_selection.files_selected', { count: this.files.length })
|
|
33413
33458
|
: this.filename
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -16,7 +16,7 @@ const defineCustomElements = (win, options) => {
|
|
|
16
16
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
17
17
|
return patchEsm().then(() => {
|
|
18
18
|
appGlobals.globalScripts();
|
|
19
|
-
return index.bootstrapLazy([["ezp-auth_15.cjs",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[1,"ezp-user-menu",{"name":[1],"open":[1028]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}],[1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
|
|
19
|
+
return index.bootstrapLazy([["ezp-auth_15.cjs",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"hubDriverError":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[1,"ezp-user-menu",{"name":[1],"open":[1028]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}],[1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -48,6 +48,7 @@ export class EzpPrinterSelection {
|
|
|
48
48
|
this.printFailed = false;
|
|
49
49
|
this.notSupported = false;
|
|
50
50
|
this.noPrinters = false;
|
|
51
|
+
this.hubDriverError = false;
|
|
51
52
|
this.userMenuOpen = false;
|
|
52
53
|
this.printStopped = false;
|
|
53
54
|
this.selectedPrinterConfig = {
|
|
@@ -97,6 +98,7 @@ export class EzpPrinterSelection {
|
|
|
97
98
|
this.failedFiles = [];
|
|
98
99
|
this.successfulFiles = [];
|
|
99
100
|
this.partialSuccess = false;
|
|
101
|
+
this.hubDriverError = false;
|
|
100
102
|
this.printCancel.emit();
|
|
101
103
|
};
|
|
102
104
|
this.validateData = (data) => {
|
|
@@ -116,6 +118,7 @@ export class EzpPrinterSelection {
|
|
|
116
118
|
this.failedFiles = [];
|
|
117
119
|
this.successfulFiles = [];
|
|
118
120
|
this.partialSuccess = false;
|
|
121
|
+
this.hubDriverError = false;
|
|
119
122
|
// we have to initialse this obj with empty strings to display the select component
|
|
120
123
|
// but don't want to send any attributes with empty strings to the API
|
|
121
124
|
if (this.selectedPrinterConfig.Trays &&
|
|
@@ -156,7 +159,13 @@ export class EzpPrinterSelection {
|
|
|
156
159
|
this.printFailed = true;
|
|
157
160
|
this.printProcessing = false;
|
|
158
161
|
}
|
|
159
|
-
if (
|
|
162
|
+
else if (this.selectedPrinter.is_queue &&
|
|
163
|
+
(data.code === 412 || data.code === 500 || data.code === 503)) {
|
|
164
|
+
// Hub printer specific errors - likely driver not assigned
|
|
165
|
+
this.hubDriverError = true;
|
|
166
|
+
this.printProcessing = false;
|
|
167
|
+
}
|
|
168
|
+
else if (data.jobid) {
|
|
160
169
|
printStore.state.jobID = data.jobid;
|
|
161
170
|
poll({
|
|
162
171
|
fn: this.printService.getPrintStatus,
|
|
@@ -165,22 +174,40 @@ export class EzpPrinterSelection {
|
|
|
165
174
|
maxAttempts: this.MAX_POLL_ATTEMPTS,
|
|
166
175
|
}).catch((err) => {
|
|
167
176
|
console.warn(err);
|
|
168
|
-
this
|
|
177
|
+
// Check if this is a hub printer and the error might be driver-related
|
|
178
|
+
if (this.selectedPrinter.is_queue) {
|
|
179
|
+
this.hubDriverError = true;
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
this.printFailed = true;
|
|
183
|
+
}
|
|
169
184
|
this.printProcessing = false;
|
|
170
185
|
});
|
|
171
186
|
}
|
|
172
187
|
else {
|
|
173
|
-
|
|
188
|
+
// No job ID returned - check if it's a hub printer
|
|
189
|
+
if (this.selectedPrinter.is_queue) {
|
|
190
|
+
this.hubDriverError = true;
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
this.printFailed = true;
|
|
194
|
+
}
|
|
174
195
|
this.printProcessing = false;
|
|
175
196
|
}
|
|
176
197
|
})
|
|
177
198
|
.catch((error) => {
|
|
178
199
|
console.log(error);
|
|
179
|
-
this
|
|
200
|
+
// Check if this is a hub printer and the error might be driver-related
|
|
201
|
+
if (this.selectedPrinter.is_queue) {
|
|
202
|
+
this.hubDriverError = true;
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
this.printFailed = true;
|
|
206
|
+
}
|
|
180
207
|
this.printProcessing = false;
|
|
181
208
|
});
|
|
182
209
|
}
|
|
183
|
-
if (this.files && this.files.length > 1) {
|
|
210
|
+
else if (this.files && this.files.length > 1) {
|
|
184
211
|
await this.processMultipleFiles(this.files, cleanPrintProperties);
|
|
185
212
|
}
|
|
186
213
|
else if (this.files && this.files.length === 1) {
|
|
@@ -238,12 +265,12 @@ export class EzpPrinterSelection {
|
|
|
238
265
|
this.printCancel.emit();
|
|
239
266
|
break;
|
|
240
267
|
case 'print-failed':
|
|
241
|
-
this.printProcessing = false;
|
|
242
268
|
this.printFailed = false;
|
|
243
|
-
this.failedFiles = [];
|
|
244
|
-
this.successfulFiles = [];
|
|
245
269
|
break;
|
|
246
|
-
case '
|
|
270
|
+
case 'hub-driver-error':
|
|
271
|
+
this.hubDriverError = false;
|
|
272
|
+
break;
|
|
273
|
+
case 'not-supported':
|
|
247
274
|
this.noPrinters = false;
|
|
248
275
|
break;
|
|
249
276
|
}
|
|
@@ -258,6 +285,11 @@ export class EzpPrinterSelection {
|
|
|
258
285
|
this.printProcessing = false;
|
|
259
286
|
this.handlePrint();
|
|
260
287
|
break;
|
|
288
|
+
case 'hub-driver-error':
|
|
289
|
+
this.hubDriverError = false;
|
|
290
|
+
this.printProcessing = false;
|
|
291
|
+
this.handlePrint();
|
|
292
|
+
break;
|
|
261
293
|
}
|
|
262
294
|
}
|
|
263
295
|
getPropertiesFromLocalStorage() {
|
|
@@ -397,7 +429,13 @@ export class EzpPrinterSelection {
|
|
|
397
429
|
catch (error) {
|
|
398
430
|
console.error(`Error processing file ${file.name}:`, error);
|
|
399
431
|
this.failedFiles.push(file.name);
|
|
400
|
-
//
|
|
432
|
+
// Check if this is a hub driver error
|
|
433
|
+
if (error.message && error.message.includes('Hub printer driver error')) {
|
|
434
|
+
this.hubDriverError = true;
|
|
435
|
+
this.printProcessing = false;
|
|
436
|
+
return; // Stop processing other files if it's a hub driver issue
|
|
437
|
+
}
|
|
438
|
+
// Continue with the next file
|
|
401
439
|
}
|
|
402
440
|
}
|
|
403
441
|
// Determine final status based on results
|
|
@@ -437,6 +475,11 @@ export class EzpPrinterSelection {
|
|
|
437
475
|
if (data.code === 804) {
|
|
438
476
|
throw new Error(`Print failed for file: ${file.name}`);
|
|
439
477
|
}
|
|
478
|
+
// Check for hub printer driver errors
|
|
479
|
+
if (this.selectedPrinter.is_queue &&
|
|
480
|
+
(data.code === 412 || data.code === 500 || data.code === 503)) {
|
|
481
|
+
throw new Error(`Hub printer driver error for file: ${file.name}`);
|
|
482
|
+
}
|
|
440
483
|
if (data.jobid) {
|
|
441
484
|
printStore.state.jobID = data.jobid;
|
|
442
485
|
// Wait for this print job to complete before processing the next file
|
|
@@ -457,34 +500,36 @@ export class EzpPrinterSelection {
|
|
|
457
500
|
this.uploading = false;
|
|
458
501
|
}
|
|
459
502
|
async waitForPrintCompletion() {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
resolve();
|
|
468
|
-
}
|
|
469
|
-
else if (data.jobstatus === 1246 || data.jobstatus === 129) {
|
|
470
|
-
// Still processing, keep polling
|
|
471
|
-
setTimeout(poll, this.POLL_INTERVAL);
|
|
472
|
-
}
|
|
473
|
-
else if (data.jobstatus === 3011 || data.jobstatus === 2) {
|
|
474
|
-
// Failure
|
|
475
|
-
reject(new Error('Print job failed: ' + (data.jobstatusstring || data.jobstatus)));
|
|
476
|
-
}
|
|
477
|
-
else {
|
|
478
|
-
// Unknown status, treat as failure for safety
|
|
479
|
-
reject(new Error('Unknown print job status: ' + data.jobstatus));
|
|
480
|
-
}
|
|
503
|
+
while (true) {
|
|
504
|
+
try {
|
|
505
|
+
const data = await this.printService.getPrintStatus();
|
|
506
|
+
console.log('[waitForPrintCompletion] Poll response:', data);
|
|
507
|
+
if (data.jobstatus === 0) {
|
|
508
|
+
// Success
|
|
509
|
+
return;
|
|
481
510
|
}
|
|
482
|
-
|
|
483
|
-
|
|
511
|
+
else if (data.jobstatus === 1246 || data.jobstatus === 129) {
|
|
512
|
+
// Still processing, wait before next poll
|
|
513
|
+
await new Promise((resolve) => setTimeout(resolve, this.POLL_INTERVAL));
|
|
484
514
|
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
515
|
+
else if (data.jobstatus === 3011 || data.jobstatus === 2) {
|
|
516
|
+
// Failure
|
|
517
|
+
throw new Error('Print job failed: ' + (data.jobstatusstring || data.jobstatus));
|
|
518
|
+
}
|
|
519
|
+
else if (this.selectedPrinter.is_queue &&
|
|
520
|
+
(data.jobstatus === 412 || data.jobstatus === 500 || data.jobstatus === 503)) {
|
|
521
|
+
// Hub printer driver error
|
|
522
|
+
throw new Error('Hub printer driver error: ' + (data.jobstatusstring || data.jobstatus));
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
// Unknown status, treat as failure for safety
|
|
526
|
+
throw new Error('Unknown print job status: ' + data.jobstatus);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
catch (error) {
|
|
530
|
+
throw error;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
488
533
|
}
|
|
489
534
|
getFileExtension(filename) {
|
|
490
535
|
const extension = filename.split('.').pop();
|
|
@@ -644,7 +689,7 @@ export class EzpPrinterSelection {
|
|
|
644
689
|
? this.partialSuccess
|
|
645
690
|
? `${i18next.t('printer_selection.print_success')} (${this.successfulFiles.length}/${this.totalFiles} ${i18next.t('printer_selection.files')} - ${this.failedFiles.length} failed`
|
|
646
691
|
: `${i18next.t('printer_selection.print_success')} (${this.totalFiles} ${i18next.t('printer_selection.files')})`
|
|
647
|
-
: i18next.t('printer_selection.print_success'), instance: "print-success", close: true })) : this.printFailed ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "print-failed", close: true, retry: true })) : this.notSupported ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.not_supported'), instance: "not-supported", retry: true })) : this.noPrinters ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.no_printers'), instance: "no-printers", close: true })) : null)),
|
|
692
|
+
: i18next.t('printer_selection.print_success'), instance: "print-success", close: true })) : this.printFailed ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "print-failed", close: true, retry: true })) : this.notSupported ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.not_supported'), instance: "not-supported", retry: true })) : this.hubDriverError ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "hub-driver-error", close: true, retry: true })) : this.noPrinters ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.no_printers'), instance: "no-printers", close: true })) : null)),
|
|
648
693
|
!this.hideheader && (h("div", { id: "header" },
|
|
649
694
|
h("ezp-label", { weight: "heavy", text: i18next.t('printer_selection.print') + `${!this.notSupported ? ':' : ''}` }),
|
|
650
695
|
h("ezp-label", { text: !this.notSupported
|
|
@@ -928,6 +973,7 @@ export class EzpPrinterSelection {
|
|
|
928
973
|
"printFailed": {},
|
|
929
974
|
"notSupported": {},
|
|
930
975
|
"noPrinters": {},
|
|
976
|
+
"hubDriverError": {},
|
|
931
977
|
"userMenuOpen": {},
|
|
932
978
|
"printStopped": {},
|
|
933
979
|
"userName": {},
|