@teamkeel/functions-runtime 0.423.3 → 0.425.0
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/index.cjs +286 -272
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +36 -4
- package/dist/index.d.ts +36 -4
- package/dist/index.js +286 -272
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.d.cts
CHANGED
|
@@ -630,19 +630,51 @@ type UiElementPrint<H extends NullableHardware> = DisplayElementWithRequiredConf
|
|
|
630
630
|
autoContinue?: boolean;
|
|
631
631
|
}>;
|
|
632
632
|
type PrintData<H extends NullableHardware> = {
|
|
633
|
-
|
|
634
|
-
printer?: H extends Hardware ? H["printers"][number]["name"] : never;
|
|
633
|
+
/** The name of the print job. */
|
|
635
634
|
name?: string;
|
|
635
|
+
/** The printer to use for the print job. Printers are defined in keelconfig.yaml. */
|
|
636
|
+
printer?: H extends Hardware ? H["printers"][number]["name"] : never;
|
|
637
|
+
} & (PrintDataZpl | PrintDataRawPdf);
|
|
638
|
+
type PrintDataZpl = {
|
|
639
|
+
type: "zpl";
|
|
640
|
+
} & ({
|
|
636
641
|
data: string | string[];
|
|
642
|
+
url?: never;
|
|
643
|
+
} | {
|
|
644
|
+
data?: never;
|
|
645
|
+
url: string;
|
|
646
|
+
});
|
|
647
|
+
type PrintDataRawPdf = {
|
|
648
|
+
type: "rawPdf";
|
|
649
|
+
url: string;
|
|
650
|
+
data?: never;
|
|
651
|
+
/** The DPI of the PDF
|
|
652
|
+
* @default 300
|
|
653
|
+
*/
|
|
654
|
+
dpi?: number;
|
|
655
|
+
/** The width of the page in dots.
|
|
656
|
+
* e.g. 4" at 300 dpi is 1200 dots.
|
|
657
|
+
* @default 1200
|
|
658
|
+
*/
|
|
659
|
+
pageWidth?: number;
|
|
660
|
+
/** The height of the page in dots.
|
|
661
|
+
* e.g. 6" at 300 dpi is 1800 dots.
|
|
662
|
+
* @default 1800
|
|
663
|
+
*/
|
|
664
|
+
pageHeight?: number;
|
|
637
665
|
};
|
|
638
666
|
interface UiElementPrintApiResponse extends BaseUiDisplayResponse<"ui.interactive.print"> {
|
|
639
667
|
title?: string;
|
|
640
668
|
description?: string;
|
|
641
669
|
data: {
|
|
642
|
-
type: "
|
|
670
|
+
type: "zpl" | "rawPdf";
|
|
671
|
+
name?: string;
|
|
643
672
|
data?: string[];
|
|
644
673
|
url?: string;
|
|
645
674
|
printer?: string;
|
|
675
|
+
dpi?: number;
|
|
676
|
+
pageWidth?: number;
|
|
677
|
+
pageHeight?: number;
|
|
646
678
|
}[];
|
|
647
679
|
autoPrint: boolean;
|
|
648
680
|
autoContinue: boolean;
|
|
@@ -835,7 +867,7 @@ interface BaseInputConfig<T, O extends boolean = boolean> {
|
|
|
835
867
|
validate?: ValidateFn<T>;
|
|
836
868
|
onLeave?: CallbackFn<T, T>;
|
|
837
869
|
}
|
|
838
|
-
type ValidateFn<T> = (data: T) => Promise<boolean | string> | boolean | string;
|
|
870
|
+
type ValidateFn<T> = (data: T, action?: string) => Promise<boolean | string> | boolean | string;
|
|
839
871
|
type CallbackFn<InputT, OutputT> = (data: InputT) => Promise<OutputT> | OutputT;
|
|
840
872
|
interface BaseUiInputResponse<K, TData> {
|
|
841
873
|
__type: K;
|
package/dist/index.d.ts
CHANGED
|
@@ -630,19 +630,51 @@ type UiElementPrint<H extends NullableHardware> = DisplayElementWithRequiredConf
|
|
|
630
630
|
autoContinue?: boolean;
|
|
631
631
|
}>;
|
|
632
632
|
type PrintData<H extends NullableHardware> = {
|
|
633
|
-
|
|
634
|
-
printer?: H extends Hardware ? H["printers"][number]["name"] : never;
|
|
633
|
+
/** The name of the print job. */
|
|
635
634
|
name?: string;
|
|
635
|
+
/** The printer to use for the print job. Printers are defined in keelconfig.yaml. */
|
|
636
|
+
printer?: H extends Hardware ? H["printers"][number]["name"] : never;
|
|
637
|
+
} & (PrintDataZpl | PrintDataRawPdf);
|
|
638
|
+
type PrintDataZpl = {
|
|
639
|
+
type: "zpl";
|
|
640
|
+
} & ({
|
|
636
641
|
data: string | string[];
|
|
642
|
+
url?: never;
|
|
643
|
+
} | {
|
|
644
|
+
data?: never;
|
|
645
|
+
url: string;
|
|
646
|
+
});
|
|
647
|
+
type PrintDataRawPdf = {
|
|
648
|
+
type: "rawPdf";
|
|
649
|
+
url: string;
|
|
650
|
+
data?: never;
|
|
651
|
+
/** The DPI of the PDF
|
|
652
|
+
* @default 300
|
|
653
|
+
*/
|
|
654
|
+
dpi?: number;
|
|
655
|
+
/** The width of the page in dots.
|
|
656
|
+
* e.g. 4" at 300 dpi is 1200 dots.
|
|
657
|
+
* @default 1200
|
|
658
|
+
*/
|
|
659
|
+
pageWidth?: number;
|
|
660
|
+
/** The height of the page in dots.
|
|
661
|
+
* e.g. 6" at 300 dpi is 1800 dots.
|
|
662
|
+
* @default 1800
|
|
663
|
+
*/
|
|
664
|
+
pageHeight?: number;
|
|
637
665
|
};
|
|
638
666
|
interface UiElementPrintApiResponse extends BaseUiDisplayResponse<"ui.interactive.print"> {
|
|
639
667
|
title?: string;
|
|
640
668
|
description?: string;
|
|
641
669
|
data: {
|
|
642
|
-
type: "
|
|
670
|
+
type: "zpl" | "rawPdf";
|
|
671
|
+
name?: string;
|
|
643
672
|
data?: string[];
|
|
644
673
|
url?: string;
|
|
645
674
|
printer?: string;
|
|
675
|
+
dpi?: number;
|
|
676
|
+
pageWidth?: number;
|
|
677
|
+
pageHeight?: number;
|
|
646
678
|
}[];
|
|
647
679
|
autoPrint: boolean;
|
|
648
680
|
autoContinue: boolean;
|
|
@@ -835,7 +867,7 @@ interface BaseInputConfig<T, O extends boolean = boolean> {
|
|
|
835
867
|
validate?: ValidateFn<T>;
|
|
836
868
|
onLeave?: CallbackFn<T, T>;
|
|
837
869
|
}
|
|
838
|
-
type ValidateFn<T> = (data: T) => Promise<boolean | string> | boolean | string;
|
|
870
|
+
type ValidateFn<T> = (data: T, action?: string) => Promise<boolean | string> | boolean | string;
|
|
839
871
|
type CallbackFn<InputT, OutputT> = (data: InputT) => Promise<OutputT> | OutputT;
|
|
840
872
|
interface BaseUiInputResponse<K, TData> {
|
|
841
873
|
__type: K;
|