@ezeep/ezeep-js 1.0.271 → 1.0.277

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/dist/cjs/{app-globals-D7ISNeUi.js → app-globals-L_3XPZxT.js} +7 -1
  2. package/dist/cjs/ezeep.cjs.js +4 -4
  3. package/dist/cjs/ezp-auth_15.cjs.entry.js +7240 -3678
  4. package/dist/cjs/{index-dv_gozsq.js → index-DM5v_sge.js} +3 -2
  5. package/dist/cjs/loader.cjs.js +3 -3
  6. package/dist/collection/collection-manifest.json +1 -1
  7. package/dist/collection/components/ezp-auth/ezp-auth.css +1 -1
  8. package/dist/collection/components/ezp-auth/ezp-auth.js +56 -15
  9. package/dist/collection/components/ezp-backdrop/ezp-backdrop.js +5 -5
  10. package/dist/collection/components/ezp-dialog/ezp-dialog.js +85 -13
  11. package/dist/collection/components/ezp-icon/ezp-icon.js +7 -2
  12. package/dist/collection/components/ezp-icon-button/ezp-icon-button.js +4 -1
  13. package/dist/collection/components/ezp-input/ezp-input.css +9 -12
  14. package/dist/collection/components/ezp-input/ezp-input.js +15 -13
  15. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +207 -323
  16. package/dist/collection/components/ezp-printing/ezp-printing.css +9 -9
  17. package/dist/collection/components/ezp-printing/ezp-printing.js +107 -35
  18. package/dist/collection/components/ezp-select/ezp-select.css +2 -2
  19. package/dist/collection/components/ezp-select/ezp-select.js +92 -13
  20. package/dist/collection/components/ezp-status/ezp-status.js +23 -13
  21. package/dist/collection/components/ezp-stepper/ezp-stepper.js +13 -6
  22. package/dist/collection/components/ezp-text-button/ezp-text-button.js +1 -1
  23. package/dist/collection/components/ezp-upload/ezp-upload.css +9 -9
  24. package/dist/collection/components/ezp-upload/ezp-upload.js +26 -8
  25. package/dist/collection/components/ezp-user-menu/ezp-user-menu.css +2 -1
  26. package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +15 -15
  27. package/dist/collection/services/auth.js +37 -36
  28. package/dist/collection/services/http.js +11 -0
  29. package/dist/collection/services/print-job.js +72 -0
  30. package/dist/collection/services/print.js +21 -69
  31. package/dist/collection/services/user.js +2 -9
  32. package/dist/collection/shared/constants.js +55 -0
  33. package/dist/collection/shared/global.js +7 -1
  34. package/dist/collection/shared/storage.js +71 -0
  35. package/dist/collection/types/shared/types.d.ts +40 -9
  36. package/dist/collection/utils/printer.js +68 -0
  37. package/dist/collection/utils/utils.js +24 -9
  38. package/dist/components/auth.js +1 -1
  39. package/dist/components/ezp-auth2.js +1 -1
  40. package/dist/components/ezp-backdrop2.js +1 -1
  41. package/dist/components/ezp-dialog2.js +1 -1
  42. package/dist/components/ezp-icon-button2.js +1 -1
  43. package/dist/components/ezp-icon2.js +1 -1
  44. package/dist/components/ezp-input2.js +1 -1
  45. package/dist/components/ezp-printer-selection2.js +1 -1
  46. package/dist/components/ezp-printing.js +1 -1
  47. package/dist/components/ezp-select2.js +1 -1
  48. package/dist/components/ezp-status2.js +1 -1
  49. package/dist/components/ezp-stepper2.js +1 -1
  50. package/dist/components/ezp-text-button2.js +1 -1
  51. package/dist/components/ezp-upload2.js +1 -1
  52. package/dist/components/ezp-user-menu.js +1 -1
  53. package/dist/components/ezp-user-menu2.js +1 -1
  54. package/dist/components/index.js +1 -1
  55. package/dist/components/utils.js +1 -0
  56. package/dist/directives/proxies.ts +82 -59
  57. package/dist/esm/{app-globals-CpP67t2l.js → app-globals-C0WTlb31.js} +7 -1
  58. package/dist/esm/ezeep.js +5 -5
  59. package/dist/esm/ezp-auth_15.entry.js +7240 -3678
  60. package/dist/esm/{index-BTfWEHH9.js → index-BButrLnB.js} +3 -3
  61. package/dist/esm/loader.js +4 -4
  62. package/dist/esm-es5/{app-globals-CpP67t2l.js → app-globals-C0WTlb31.js} +1 -1
  63. package/dist/esm-es5/ezeep.js +1 -1
  64. package/dist/esm-es5/ezp-auth_15.entry.js +2 -2
  65. package/dist/esm-es5/{index-BTfWEHH9.js → index-BButrLnB.js} +3 -3
  66. package/dist/esm-es5/loader.js +1 -1
  67. package/dist/ezeep/ezeep.esm.js +1 -1
  68. package/dist/ezeep/ezeep.js +1 -1
  69. package/dist/ezeep/p-644e48a0.system.entry.js +7 -0
  70. package/dist/ezeep/{p-BTfWEHH9.js → p-BButrLnB.js} +2 -2
  71. package/dist/ezeep/{p-CpP67t2l.js → p-C0WTlb31.js} +1 -1
  72. package/{www/build/p-DhXN1yGM.system.js → dist/ezeep/p-CYpousxy.system.js} +2 -2
  73. package/dist/ezeep/{p-5ok9OZMg.system.js → p-D4aCr1OK.system.js} +1 -1
  74. package/dist/ezeep/{p-CfQRcOh8.system.js → p-DCznw2Ee.system.js} +1 -1
  75. package/dist/ezeep/p-ebd2beda.entry.js +1 -0
  76. package/dist/ezeep/types/shared/types.d.ts +40 -9
  77. package/dist/types/components/ezp-auth/ezp-auth.d.ts +8 -5
  78. package/dist/types/components/ezp-backdrop/ezp-backdrop.d.ts +2 -2
  79. package/dist/types/components/ezp-dialog/ezp-dialog.d.ts +14 -3
  80. package/dist/types/components/ezp-input/ezp-input.d.ts +17 -14
  81. package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +23 -7
  82. package/dist/types/components/ezp-printing/ezp-printing.d.ts +25 -2
  83. package/dist/types/components/ezp-select/ezp-select.d.ts +10 -4
  84. package/dist/types/components/ezp-status/ezp-status.d.ts +6 -4
  85. package/dist/types/components/ezp-stepper/ezp-stepper.d.ts +1 -1
  86. package/dist/types/components/ezp-upload/ezp-upload.d.ts +4 -1
  87. package/dist/types/components/ezp-user-menu/ezp-user-menu.d.ts +5 -2
  88. package/dist/types/components.d.ts +38 -38
  89. package/dist/types/services/auth.d.ts +10 -0
  90. package/dist/types/services/http.d.ts +4 -0
  91. package/dist/types/services/print-job.d.ts +48 -0
  92. package/dist/types/services/print.d.ts +10 -9
  93. package/dist/types/services/user.d.ts +13 -2
  94. package/dist/types/shared/constants.d.ts +51 -0
  95. package/dist/types/shared/storage.d.ts +24 -0
  96. package/dist/types/shared/types.d.ts +40 -9
  97. package/dist/types/stencil-public-runtime.d.ts +1 -0
  98. package/dist/types/utils/printer.d.ts +22 -0
  99. package/dist/types/utils/utils.d.ts +22 -10
  100. package/package.json +30 -18
  101. package/readme.md +1 -0
  102. package/www/build/ezeep.esm.js +1 -1
  103. package/www/build/ezeep.js +1 -1
  104. package/www/build/p-644e48a0.system.entry.js +7 -0
  105. package/www/build/{p-BTfWEHH9.js → p-BButrLnB.js} +2 -2
  106. package/www/build/{p-CpP67t2l.js → p-C0WTlb31.js} +1 -1
  107. package/{dist/ezeep/p-DhXN1yGM.system.js → www/build/p-CYpousxy.system.js} +2 -2
  108. package/www/build/{p-5ok9OZMg.system.js → p-D4aCr1OK.system.js} +1 -1
  109. package/www/build/{p-CfQRcOh8.system.js → p-DCznw2Ee.system.js} +1 -1
  110. package/www/build/p-c7252f1c.js +1 -0
  111. package/www/build/p-ebd2beda.entry.js +1 -0
  112. package/www/data/locales/de.json +1 -0
  113. package/www/data/locales/en.json +1 -0
  114. package/www/index.html +2 -5
  115. package/dist/components/i18next.js +0 -1
  116. package/dist/ezeep/p-2177b8f4.system.entry.js +0 -7
  117. package/dist/ezeep/p-de8f6583.entry.js +0 -1
  118. package/www/build/p-2177b8f4.system.entry.js +0 -7
  119. package/www/build/p-256870db.js +0 -1
  120. package/www/build/p-de8f6583.entry.js +0 -1
@@ -249,9 +249,9 @@ export namespace Components {
249
249
  */
250
250
  "placeholder": string;
251
251
  /**
252
- * Description...
252
+ * The currently-selected option, matched by title (string) or id (number).
253
253
  */
254
- "preSelected": any;
254
+ "preSelected": string | number | null;
255
255
  /**
256
256
  * Description...
257
257
  * @default 'horizontal'
@@ -388,8 +388,8 @@ export interface EzpUserMenuCustomEvent<T> extends CustomEvent<T> {
388
388
  declare global {
389
389
  interface HTMLEzpAuthElementEventMap {
390
390
  "authCancel": MouseEvent;
391
- "authSuccess": any;
392
- "userCancel": any;
391
+ "authSuccess": void;
392
+ "userCancel": void;
393
393
  }
394
394
  interface HTMLEzpAuthElement extends Components.EzpAuth, HTMLStencilElement {
395
395
  addEventListener<K extends keyof HTMLEzpAuthElementEventMap>(type: K, listener: (this: HTMLEzpAuthElement, ev: EzpAuthCustomEvent<HTMLEzpAuthElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
@@ -406,8 +406,8 @@ declare global {
406
406
  new (): HTMLEzpAuthElement;
407
407
  };
408
408
  interface HTMLEzpBackdropElementEventMap {
409
- "backdropHideStart": any;
410
- "backdropHideEnd": any;
409
+ "backdropHideStart": void;
410
+ "backdropHideEnd": void;
411
411
  }
412
412
  interface HTMLEzpBackdropElement extends Components.EzpBackdrop, HTMLStencilElement {
413
413
  addEventListener<K extends keyof HTMLEzpBackdropElementEventMap>(type: K, listener: (this: HTMLEzpBackdropElement, ev: EzpBackdropCustomEvent<HTMLEzpBackdropElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
@@ -424,8 +424,8 @@ declare global {
424
424
  new (): HTMLEzpBackdropElement;
425
425
  };
426
426
  interface HTMLEzpDialogElementEventMap {
427
- "dialogClose": any;
428
- "dialogAction": any;
427
+ "dialogClose": string;
428
+ "dialogAction": string;
429
429
  }
430
430
  interface HTMLEzpDialogElement extends Components.EzpDialog, HTMLStencilElement {
431
431
  addEventListener<K extends keyof HTMLEzpDialogElementEventMap>(type: K, listener: (this: HTMLEzpDialogElement, ev: EzpDialogCustomEvent<HTMLEzpDialogElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
@@ -454,7 +454,7 @@ declare global {
454
454
  new (): HTMLEzpIconButtonElement;
455
455
  };
456
456
  interface HTMLEzpInputElementEventMap {
457
- "inputValueChanged": any;
457
+ "inputValueChanged": { type: string; value: string | number };
458
458
  }
459
459
  interface HTMLEzpInputElement extends Components.EzpInput, HTMLStencilElement {
460
460
  addEventListener<K extends keyof HTMLEzpInputElementEventMap>(type: K, listener: (this: HTMLEzpInputElement, ev: EzpInputCustomEvent<HTMLEzpInputElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
@@ -496,7 +496,7 @@ declare global {
496
496
  new (): HTMLEzpPrinterSelectionElement;
497
497
  };
498
498
  interface HTMLEzpPrintingElementEventMap {
499
- "printFinished": any;
499
+ "printFinished": void;
500
500
  }
501
501
  interface HTMLEzpPrintingElement extends Components.EzpPrinting, HTMLStencilElement {
502
502
  addEventListener<K extends keyof HTMLEzpPrintingElementEventMap>(type: K, listener: (this: HTMLEzpPrintingElement, ev: EzpPrintingCustomEvent<HTMLEzpPrintingElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
@@ -513,8 +513,8 @@ declare global {
513
513
  new (): HTMLEzpPrintingElement;
514
514
  };
515
515
  interface HTMLEzpSelectElementEventMap {
516
- "selectToggle": any;
517
- "selectSelection": any;
516
+ "selectToggle": boolean;
517
+ "selectSelection": SelectOptionType;
518
518
  }
519
519
  interface HTMLEzpSelectElement extends Components.EzpSelect, HTMLStencilElement {
520
520
  addEventListener<K extends keyof HTMLEzpSelectElementEventMap>(type: K, listener: (this: HTMLEzpSelectElement, ev: EzpSelectCustomEvent<HTMLEzpSelectElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
@@ -531,9 +531,9 @@ declare global {
531
531
  new (): HTMLEzpSelectElement;
532
532
  };
533
533
  interface HTMLEzpStatusElementEventMap {
534
- "statusCancel": any;
535
- "statusClose": any;
536
- "statusRetry": any;
534
+ "statusCancel": string;
535
+ "statusClose": string;
536
+ "statusRetry": string;
537
537
  }
538
538
  interface HTMLEzpStatusElement extends Components.EzpStatus, HTMLStencilElement {
539
539
  addEventListener<K extends keyof HTMLEzpStatusElementEventMap>(type: K, listener: (this: HTMLEzpStatusElement, ev: EzpStatusCustomEvent<HTMLEzpStatusElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
@@ -550,7 +550,7 @@ declare global {
550
550
  new (): HTMLEzpStatusElement;
551
551
  };
552
552
  interface HTMLEzpStepperElementEventMap {
553
- "stepperChanged": any;
553
+ "stepperChanged": number;
554
554
  }
555
555
  interface HTMLEzpStepperElement extends Components.EzpStepper, HTMLStencilElement {
556
556
  addEventListener<K extends keyof HTMLEzpStepperElementEventMap>(type: K, listener: (this: HTMLEzpStepperElement, ev: EzpStepperCustomEvent<HTMLEzpStepperElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
@@ -573,7 +573,7 @@ declare global {
573
573
  new (): HTMLEzpTextButtonElement;
574
574
  };
575
575
  interface HTMLEzpUploadElementEventMap {
576
- "uploadFile": any;
576
+ "uploadFile": File[];
577
577
  }
578
578
  interface HTMLEzpUploadElement extends Components.EzpUpload, HTMLStencilElement {
579
579
  addEventListener<K extends keyof HTMLEzpUploadElementEventMap>(type: K, listener: (this: HTMLEzpUploadElement, ev: EzpUploadCustomEvent<HTMLEzpUploadElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
@@ -590,8 +590,8 @@ declare global {
590
590
  new (): HTMLEzpUploadElement;
591
591
  };
592
592
  interface HTMLEzpUserMenuElementEventMap {
593
- "userMenuClosure": any;
594
- "logoutEmitter": any;
593
+ "userMenuClosure": void;
594
+ "logoutEmitter": void;
595
595
  }
596
596
  interface HTMLEzpUserMenuElement extends Components.EzpUserMenu, HTMLStencilElement {
597
597
  addEventListener<K extends keyof HTMLEzpUserMenuElementEventMap>(type: K, listener: (this: HTMLEzpUserMenuElement, ev: EzpUserMenuCustomEvent<HTMLEzpUserMenuElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
@@ -633,14 +633,14 @@ declare namespace LocalJSX {
633
633
  "code"?: string;
634
634
  "hidelogin"?: boolean;
635
635
  "onAuthCancel"?: (event: EzpAuthCustomEvent<MouseEvent>) => void;
636
- "onAuthSuccess"?: (event: EzpAuthCustomEvent<any>) => void;
637
- "onUserCancel"?: (event: EzpAuthCustomEvent<any>) => void;
636
+ "onAuthSuccess"?: (event: EzpAuthCustomEvent<void>) => void;
637
+ "onUserCancel"?: (event: EzpAuthCustomEvent<void>) => void;
638
638
  "redirectURI"?: string;
639
639
  "trigger"?: string;
640
640
  }
641
641
  interface EzpBackdrop {
642
- "onBackdropHideEnd"?: (event: EzpBackdropCustomEvent<any>) => void;
643
- "onBackdropHideStart"?: (event: EzpBackdropCustomEvent<any>) => void;
642
+ "onBackdropHideEnd"?: (event: EzpBackdropCustomEvent<void>) => void;
643
+ "onBackdropHideStart"?: (event: EzpBackdropCustomEvent<void>) => void;
644
644
  /**
645
645
  * @default true
646
646
  */
@@ -666,11 +666,11 @@ declare namespace LocalJSX {
666
666
  */
667
667
  "iconSize"?: IconSizeTypes;
668
668
  "instance"?: string;
669
- "onDialogAction"?: (event: EzpDialogCustomEvent<any>) => void;
669
+ "onDialogAction"?: (event: EzpDialogCustomEvent<string>) => void;
670
670
  /**
671
671
  * Events
672
672
  */
673
- "onDialogClose"?: (event: EzpDialogCustomEvent<any>) => void;
673
+ "onDialogClose"?: (event: EzpDialogCustomEvent<string>) => void;
674
674
  }
675
675
  interface EzpIcon {
676
676
  /**
@@ -735,7 +735,7 @@ declare namespace LocalJSX {
735
735
  /**
736
736
  * Events
737
737
  */
738
- "onInputValueChanged"?: (event: EzpInputCustomEvent<any>) => void;
738
+ "onInputValueChanged"?: (event: EzpInputCustomEvent<{ type: string; value: string | number }>) => void;
739
739
  /**
740
740
  * Description...
741
741
  * @default ''
@@ -845,7 +845,7 @@ declare namespace LocalJSX {
845
845
  /**
846
846
  * Events
847
847
  */
848
- "onPrintFinished"?: (event: EzpPrintingCustomEvent<any>) => void;
848
+ "onPrintFinished"?: (event: EzpPrintingCustomEvent<void>) => void;
849
849
  "printapihosturl"?: string;
850
850
  "redirecturi"?: string;
851
851
  /**
@@ -873,11 +873,11 @@ declare namespace LocalJSX {
873
873
  * @default 'Label'
874
874
  */
875
875
  "label"?: string;
876
- "onSelectSelection"?: (event: EzpSelectCustomEvent<any>) => void;
876
+ "onSelectSelection"?: (event: EzpSelectCustomEvent<SelectOptionType>) => void;
877
877
  /**
878
878
  * Events
879
879
  */
880
- "onSelectToggle"?: (event: EzpSelectCustomEvent<any>) => void;
880
+ "onSelectToggle"?: (event: EzpSelectCustomEvent<boolean>) => void;
881
881
  /**
882
882
  * Description...
883
883
  */
@@ -892,9 +892,9 @@ declare namespace LocalJSX {
892
892
  */
893
893
  "placeholder"?: string;
894
894
  /**
895
- * Description...
895
+ * The currently-selected option, matched by title (string) or id (number).
896
896
  */
897
- "preSelected"?: any;
897
+ "preSelected"?: string | number | null;
898
898
  /**
899
899
  * Description...
900
900
  * @default 'horizontal'
@@ -914,9 +914,9 @@ declare namespace LocalJSX {
914
914
  /**
915
915
  * Events
916
916
  */
917
- "onStatusCancel"?: (event: EzpStatusCustomEvent<any>) => void;
918
- "onStatusClose"?: (event: EzpStatusCustomEvent<any>) => void;
919
- "onStatusRetry"?: (event: EzpStatusCustomEvent<any>) => void;
917
+ "onStatusCancel"?: (event: EzpStatusCustomEvent<string>) => void;
918
+ "onStatusClose"?: (event: EzpStatusCustomEvent<string>) => void;
919
+ "onStatusRetry"?: (event: EzpStatusCustomEvent<string>) => void;
920
920
  /**
921
921
  * @default false
922
922
  */
@@ -945,7 +945,7 @@ declare namespace LocalJSX {
945
945
  /**
946
946
  * Events
947
947
  */
948
- "onStepperChanged"?: (event: EzpStepperCustomEvent<any>) => void;
948
+ "onStepperChanged"?: (event: EzpStepperCustomEvent<number>) => void;
949
949
  }
950
950
  interface EzpTextButton {
951
951
  /**
@@ -985,18 +985,18 @@ declare namespace LocalJSX {
985
985
  /**
986
986
  * Events
987
987
  */
988
- "onUploadFile"?: (event: EzpUploadCustomEvent<any>) => void;
988
+ "onUploadFile"?: (event: EzpUploadCustomEvent<File[]>) => void;
989
989
  }
990
990
  interface EzpUserMenu {
991
991
  /**
992
992
  * @default 'John Doe'
993
993
  */
994
994
  "name"?: string;
995
- "onLogoutEmitter"?: (event: EzpUserMenuCustomEvent<any>) => void;
995
+ "onLogoutEmitter"?: (event: EzpUserMenuCustomEvent<void>) => void;
996
996
  /**
997
997
  * Events
998
998
  */
999
- "onUserMenuClosure"?: (event: EzpUserMenuCustomEvent<any>) => void;
999
+ "onUserMenuClosure"?: (event: EzpUserMenuCustomEvent<void>) => void;
1000
1000
  /**
1001
1001
  * @default false
1002
1002
  */
@@ -14,6 +14,15 @@ export declare class EzpAuthorizationService {
14
14
  generateCodeVerifier(): void;
15
15
  generateCodeChallenge(codeVerifier: string): Promise<void>;
16
16
  buildAuthURI(): void;
17
+ /** Shared auth headers for the OAuth token endpoints (Basic auth, form body). */
18
+ private oauthHeaders;
19
+ /**
20
+ * Persist tokens. The access token is kept in memory only (auth store +
21
+ * instance field) — it is deliberately NOT written to localStorage, so an XSS
22
+ * on the host page can't read it. Only the refresh token (needed to re-auth
23
+ * after a reload) and the isAuthorized hint are persisted.
24
+ */
25
+ private persistTokens;
17
26
  getAccessToken(): Promise<void>;
18
27
  refreshTokens(): Promise<void>;
19
28
  revokeRefreshToken(): void;
@@ -28,6 +37,7 @@ declare const authStore: import("@stencil/store").ObservableMap<{
28
37
  authApiHostUrl: string;
29
38
  redirectUri: string;
30
39
  authUri: string;
40
+ clientID: string;
31
41
  }>;
32
42
  export default authStore;
33
43
  export declare function sendCodeToParentWindow(): void;
@@ -0,0 +1,4 @@
1
+ /** Authorization header for a Bearer-token request. */
2
+ export declare function bearer(accessToken: string): Record<string, string>;
3
+ /** GET a URL with a Bearer token and parse the JSON body. */
4
+ export declare function authGetJson<T = any>(url: string, accessToken: string): Promise<T>;
@@ -0,0 +1,48 @@
1
+ import { PrinterProperties, JobStatusResponse, PrintResponse } from '../shared/types';
2
+ /**
3
+ * The slice of `EzpPrintService` this orchestrator needs. Declared structurally
4
+ * so the print flow can be unit-tested with a plain mock, and so this module
5
+ * has no dependency back on the service implementation.
6
+ */
7
+ export interface PrintApi {
8
+ prepareFileUpload(accessToken: string): Promise<{
9
+ fileid: string;
10
+ sasUri: string;
11
+ }>;
12
+ uploadBlobFiles(sasUri: string, file: File): Promise<{
13
+ _response: {
14
+ status: number;
15
+ };
16
+ }>;
17
+ printByFileID(accessToken: string, fileID: string, fileType: string, printerID: string, properties: PrinterProperties, filename?: string): Promise<PrintResponse>;
18
+ getPrintStatus(): Promise<JobStatusResponse>;
19
+ }
20
+ /** Lower-cased file extension, or '' when there is none. */
21
+ export declare function fileExtension(filename: string): string;
22
+ /**
23
+ * Poll the print status until the job reaches a terminal state. Resolves on
24
+ * success; throws on failure, a hub-driver error, or when the polling budget is
25
+ * exhausted (so a stuck job fails instead of polling forever). Unknown statuses
26
+ * are treated as failures for safety.
27
+ */
28
+ export declare function waitForJobCompletion(getStatus: () => Promise<JobStatusResponse>, isQueue: boolean, pollIntervalMs?: number, maxAttempts?: number): Promise<void>;
29
+ export interface PrintJobContext {
30
+ service: PrintApi;
31
+ accessToken: string;
32
+ printerId: string;
33
+ isQueue: boolean;
34
+ properties: PrinterProperties;
35
+ pollIntervalMs?: number;
36
+ }
37
+ /** Progress hooks so a UI can reflect the prepare/upload/job stages. */
38
+ export interface PrintJobHooks {
39
+ onPreparing?: (value: boolean) => void;
40
+ onUploading?: (value: boolean) => void;
41
+ onJobId?: (jobId: string) => void;
42
+ }
43
+ /**
44
+ * Upload one file then print it, waiting for the job to finish. Throws (with a
45
+ * message that includes "Hub printer driver error" for queue-driver failures) on
46
+ * any failure, so callers can aggregate per-file outcomes.
47
+ */
48
+ export declare function uploadAndPrintFile(ctx: PrintJobContext, file: File, hooks?: PrintJobHooks): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { /* PrinterProperties, */ PrinterConfig, PrinterProperties } from '../shared/types';
1
+ import { PrinterConfig, PrinterProperties, Printer, PrintResponse, JobStatusResponse, PrepareUploadResponse } from '../shared/types';
2
2
  export declare class EzpPrintService {
3
3
  constructor(redirectURI: string, clientID: string);
4
4
  clientID: string;
@@ -9,20 +9,21 @@ export declare class EzpPrintService {
9
9
  abortController: AbortController | null;
10
10
  private checkStoredRefreshToken;
11
11
  registerFetchInterceptor(): void;
12
- getPrinterList(accessToken: string): Promise<any>;
12
+ getPrinterList(accessToken: string): Promise<Printer[]>;
13
13
  getConfig(accessToken: string): Promise<Response>;
14
- getPrinterProperties(accessToken: string, printerID: string): Promise<any>;
15
- getAllPrinterProperties(accessToken: string): Promise<any>;
14
+ getPrinterProperties(accessToken: string, printerID: string): Promise<PrinterConfig[]>;
15
+ getAllPrinterProperties(accessToken: string): Promise<PrinterConfig[]>;
16
16
  printFileByUrl(accessToken: string, fileUrl: string, fileType: string, printerID: string, properties: PrinterProperties, filename?: string, printAndDelete?: boolean): Promise<Response>;
17
17
  abortPrint(): void;
18
- printByFileID(accessToken: string, fileID: string, fileType: string, printerID: string, properties: PrinterProperties, filename?: string, printAndDelete?: boolean): Promise<any>;
19
- prepareFileUpload(accessToken: string): Promise<any>;
20
- uploadFile(sasURI: string, formData: FormData): Promise<any>;
18
+ /** Shared POST to the `Print` endpoint. Returns the raw response. */
19
+ private printRequest;
20
+ printByFileID(accessToken: string, fileID: string, fileType: string, printerID: string, properties: PrinterProperties, filename?: string, printAndDelete?: boolean): Promise<PrintResponse>;
21
+ prepareFileUpload(accessToken: string): Promise<PrepareUploadResponse>;
21
22
  uploadBlobFiles(sasUri: string, file: File): Promise<import("@azure/storage-blob").BlobUploadCommonResponse>;
22
- getPrintStatus: () => Promise<any>;
23
+ getPrintStatus: () => Promise<JobStatusResponse>;
23
24
  }
24
25
  declare const printStore: import("@stencil/store").ObservableMap<{
25
- printers: any[];
26
+ printers: never[];
26
27
  jobID: string;
27
28
  printFinished: boolean;
28
29
  printApiHostUrl: string;
@@ -1,8 +1,19 @@
1
+ /**
2
+ * Shape of the `/v1/users/me` response that the UI actually reads. The API uses
3
+ * snake_case (`display_name`) — the only field consumed today. Indexed so other
4
+ * fields remain accessible without being individually typed.
5
+ */
6
+ export interface UserInfo {
7
+ display_name: string;
8
+ /** The user's account language (e.g. "en", "de") — used to sync the UI language. */
9
+ preferred_language?: string | null;
10
+ [key: string]: unknown;
11
+ }
1
12
  export declare class EzpUserService {
2
- getUserInfo(): Promise<any>;
13
+ getUserInfo(): Promise<UserInfo>;
3
14
  }
4
15
  declare const userStore: import("@stencil/store").ObservableMap<{
5
- user: any;
16
+ user: UserInfo | null;
6
17
  theme: string;
7
18
  appearance: string;
8
19
  }>;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Centralised magic numbers used across the print/auth flow.
3
+ *
4
+ * These previously appeared as inline literals in `ezp-printer-selection`,
5
+ * `print.ts` and `utils.ts`, with the same job-status codes duplicated across
6
+ * three separate state machines. Keep them here so the meaning is explicit and
7
+ * there is a single source of truth.
8
+ */
9
+ /** Print-job status codes returned by `sfapi/Status`. */
10
+ export declare enum JobStatus {
11
+ Success = 0,
12
+ /** Job accepted / spooling — keep polling. */
13
+ Processing = 1246,
14
+ /** Job rendering — keep polling. */
15
+ Rendering = 129,
16
+ Failed = 3011,
17
+ /** Generic failure. */
18
+ Error = 2
19
+ }
20
+ /** Status codes that mean "still working — keep polling". */
21
+ export declare const PROCESSING_JOB_STATUSES: readonly number[];
22
+ /** Status codes that mean "terminal failure". */
23
+ export declare const FAILED_JOB_STATUSES: readonly number[];
24
+ /**
25
+ * Status/error codes that, for hub (queue) printers, indicate the print driver
26
+ * is missing or misconfigured rather than a transient failure. Surfaced to the
27
+ * user as a distinct "driver error" message.
28
+ */
29
+ export declare const HUB_DRIVER_ERROR_CODES: readonly number[];
30
+ /** `Print` response `code` meaning the upload expired and a fileid re-print is required. */
31
+ export declare const FILE_EXPIRED_STATUS = 412;
32
+ /** `Print` response `code` meaning the job was rejected outright. */
33
+ export declare const PRINT_REJECTED_CODE = 804;
34
+ /** Successful Azure Blob upload (`uploadData`) HTTP status. */
35
+ export declare const BLOB_UPLOAD_CREATED = 201;
36
+ /** Paper-format id that represents a custom (user-defined width/length) size. */
37
+ export declare const PAPER_ID = 256;
38
+ /** Print-status polling cadence and bounds. */
39
+ export declare const POLL_INTERVAL_MS = 2000;
40
+ /**
41
+ * Overall polling budget before a still-processing job is treated as failed.
42
+ * Prevents polling the status endpoint indefinitely on a stuck job (only hub
43
+ * printers had a timeout before). Generous — 10 minutes — to tolerate slow
44
+ * server-side rendering of large documents.
45
+ */
46
+ export declare const POLL_TIMEOUT_MS: number;
47
+ export declare const MAX_POLL_ATTEMPTS: number;
48
+ /** Fallback timeout for hub printers so the UI never hangs indefinitely. */
49
+ export declare const HUB_TIMEOUT_MS = 30000;
50
+ /** How often the access token is proactively refreshed, in seconds. */
51
+ export declare const TOKEN_REFRESH_INTERVAL_S = 1800;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Single typed entry point for the `localStorage` keys this library persists.
3
+ *
4
+ * Previously these keys were referenced as string literals in ~30 places across
5
+ * services and components, with inconsistent naming (`access_token` vs
6
+ * `refreshToken`). The literal key strings are preserved here exactly so that
7
+ * users who are already signed in keep their session across an upgrade.
8
+ */
9
+ import { PrinterProperties, Printer } from './types';
10
+ export declare const storage: {
11
+ getRefreshToken(): string | null;
12
+ setRefreshToken(token: string): void;
13
+ getIsAuthorized(): boolean;
14
+ setIsAuthorized(value: boolean): void;
15
+ hasIsAuthorized(): boolean;
16
+ getProperties(): PrinterProperties | null;
17
+ setProperties(properties: PrinterProperties): void;
18
+ getPrinter(): Printer | null;
19
+ setPrinter(printer: Printer): void;
20
+ /** Remove everything tied to the current session (used on logout). */
21
+ clearSession(): void;
22
+ /** Remove just the saved printer + its properties (used when the saved printer is gone). */
23
+ clearSavedPrinter(): void;
24
+ };
@@ -55,6 +55,37 @@ export type AppearanceTypes = 'system' | 'light' | 'dark'
55
55
  export type TriggerTypes = 'custom' | 'file' | 'button'
56
56
  export type AlertType = { open: boolean; heading: string; description: string }
57
57
  export type SystemAppearanceTypes = 'light' | 'dark'
58
+
59
+ /**
60
+ * Payload emitted by selection-style components (`ezp-select`, `ezp-input`,
61
+ * `ezp-stepper`) and consumed by `ezp-printer-selection.setSelectedProperties`.
62
+ */
63
+ export interface PropertyChangeDetail {
64
+ type: string
65
+ id?: string | number | boolean
66
+ title?: string
67
+ is_queue?: boolean
68
+ value?: string | number
69
+ }
70
+
71
+ /** Response of `sfapi/Print` (POST). */
72
+ export interface PrintResponse {
73
+ code?: number
74
+ jobid?: string
75
+ fileid?: string
76
+ }
77
+
78
+ /** Response of `sfapi/Status`. */
79
+ export interface JobStatusResponse {
80
+ jobstatus: number
81
+ jobstatusstring?: string
82
+ }
83
+
84
+ /** Response of `sfapi/PrepareUpload`. */
85
+ export interface PrepareUploadResponse {
86
+ fileid: string
87
+ sasUri: string
88
+ }
58
89
  export interface PrinterProperties {
59
90
  paper?: string
60
91
  paperid?: number | string
@@ -64,11 +95,11 @@ export interface PrinterProperties {
64
95
  orientation?: number | string
65
96
  copies?: number | string
66
97
  resolution?: string | number
67
- paperlength? : string | number
68
- paperwidth? : string | number
98
+ paperlength?: string | number
99
+ paperwidth?: string | number
69
100
  defaultSource?: number | string
70
- trayname?: string
71
- PageRanges? : string
101
+ trayname?: string
102
+ PageRanges?: string
72
103
  }
73
104
 
74
105
  export interface Printer {
@@ -87,8 +118,8 @@ export interface PaperFormat {
87
118
  }
88
119
 
89
120
  export interface Trays {
90
- Default : boolean
91
- Index: number
121
+ Default: boolean
122
+ Index: number
92
123
  Name: string
93
124
  }
94
125
 
@@ -101,7 +132,7 @@ export interface PrinterConfig {
101
132
  Resolution?: string
102
133
  Paper?: string
103
134
  Tray?: string
104
- },
135
+ }
105
136
  Collate?: boolean
106
137
  Color?: boolean
107
138
  ColorSupported?: boolean
@@ -123,7 +154,7 @@ export interface PrinterConfig {
123
154
  }
124
155
 
125
156
  export interface User {
126
- azureProfile: any
157
+ azureProfile: unknown
127
158
  dateJoined: string
128
159
  displayName: string
129
160
  email: string
@@ -137,5 +168,5 @@ export interface User {
137
168
  isVerfified: boolean
138
169
  lastName: string
139
170
  roles: Array<string>
140
- userInvitations: any
171
+ userInvitations: unknown
141
172
  }
@@ -1070,6 +1070,7 @@ export declare namespace JSXBase {
1070
1070
  importance?: 'low' | 'auto' | 'high';
1071
1071
  height?: number | string;
1072
1072
  loading?: 'lazy' | 'auto' | 'eager';
1073
+ referrerPolicy?: ReferrerPolicy;
1073
1074
  sizes?: string;
1074
1075
  src?: string;
1075
1076
  srcSet?: string;
@@ -0,0 +1,22 @@
1
+ import { PrinterConfig, PrinterProperties } from '../shared/types';
2
+ /**
3
+ * Derive the default print properties for a printer from its configuration.
4
+ *
5
+ * This logic previously lived inline and **duplicated verbatim** in
6
+ * `ezp-printer-selection` (in `setSelectedProperties` and `connectedCallback`).
7
+ * It mutates `properties` in place — matching the original behaviour exactly —
8
+ * and returns it for convenience.
9
+ */
10
+ export declare function applyPrinterDefaults(config: PrinterConfig, properties: PrinterProperties): PrinterProperties;
11
+ /** Does this printer config report an explicit "no usable trays" state? */
12
+ export declare function hasNoTrays(config: PrinterConfig): boolean;
13
+ /** Does this printer config expose at least one selectable tray? */
14
+ export declare function hasTrays(config: PrinterConfig): boolean;
15
+ export type JobOutcome = 'success' | 'processing' | 'failed' | 'hub-error';
16
+ /**
17
+ * Classify a print-job status code into a single outcome. Centralises the
18
+ * status logic that was previously duplicated (with slightly inconsistent code
19
+ * sets) across `validateData`, `waitForPrintCompletion` and the inline checks
20
+ * in `handlePrint`. Unknown codes are treated as failures for safety.
21
+ */
22
+ export declare function classifyJobStatus(jobstatus: number, isQueue: boolean): JobOutcome;
@@ -1,19 +1,31 @@
1
1
  import { PrinterProperties } from './../shared/types';
2
+ export { PAPER_ID } from '../shared/constants';
3
+ /**
4
+ * Re-render a Stencil component whenever the i18next language changes.
5
+ * i18next fires `languageChanged` but has no hook into Stencil's render cycle,
6
+ * so any component that calls `i18next.t()` in render() must force an update —
7
+ * otherwise a runtime language switch leaves already-mounted text stale.
8
+ * Call from connectedCallback and invoke the returned disposer in
9
+ * disconnectedCallback.
10
+ */
11
+ export declare function subscribeToLanguageChange(component: unknown): () => void;
2
12
  export declare function encodeFormData(data: {
3
13
  [x: string]: string | number | boolean;
4
14
  }): string;
5
15
  export declare function capitalize(string: string): string;
6
16
  export declare function initi18n(language?: string): void;
7
- export declare const poll: ({ fn, validate, interval, maxAttempts }: {
8
- fn: any;
9
- validate: any;
10
- interval: any;
11
- maxAttempts: any;
12
- }) => Promise<unknown>;
17
+ interface PollOptions<T> {
18
+ fn: () => Promise<T>;
19
+ validate: (result: T) => boolean;
20
+ interval: number;
21
+ maxAttempts: number;
22
+ }
23
+ export declare const poll: <T = any>({ fn, validate, interval, maxAttempts, }: PollOptions<T>) => Promise<T>;
13
24
  export declare const removeEmptyStrings: (obj: {
14
25
  [x: string]: any;
15
- }) => {};
26
+ }) => {
27
+ [key: string]: any;
28
+ };
16
29
  export declare const managePaperDimensions: (properties: PrinterProperties) => PrinterProperties;
17
- export declare const formatPageRange: (pageRange: any) => any;
18
- export declare const validatePageRange: (pageRange: any) => boolean;
19
- export declare const PAPER_ID = 256;
30
+ export declare const formatPageRange: (pageRange: string) => string;
31
+ export declare const validatePageRange: (pageRange: string) => boolean;