@connectedxm/zpl-generator 0.0.4-beta.9 → 0.0.5
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.es.js +702 -682
- package/dist/src/generate.d.ts +3 -1
- package/dist/src/validate.d.ts +139 -14
- package/package.json +1 -1
package/dist/src/generate.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Badge, Field, TextField } from './validate';
|
|
2
2
|
import { SourceData } from './interfaces';
|
|
3
|
-
export declare function generate(badge: Badge, data?: SourceData
|
|
3
|
+
export declare function generate(badge: Badge, data?: SourceData, overrides?: {
|
|
4
|
+
[key: string]: string;
|
|
5
|
+
}): string;
|
|
4
6
|
export declare function getFieldValue(field: Field, data?: SourceData): string | undefined;
|
|
5
7
|
/**
|
|
6
8
|
* Counts how many lines the field data will occupy inside a ^FB field.
|
package/dist/src/validate.d.ts
CHANGED
|
@@ -229,6 +229,10 @@ export declare const textFieldSchema: z.ZodObject<{
|
|
|
229
229
|
x: z.ZodNumber;
|
|
230
230
|
y: z.ZodNumber;
|
|
231
231
|
defaultValue: z.ZodString;
|
|
232
|
+
verticalAlignment: z.ZodEnum<{
|
|
233
|
+
readonly Start: "start";
|
|
234
|
+
readonly End: "end";
|
|
235
|
+
}>;
|
|
232
236
|
sourceType: z.ZodEnum<{
|
|
233
237
|
readonly account: "account";
|
|
234
238
|
readonly accountAttributes: "accountAttributes";
|
|
@@ -260,10 +264,6 @@ export declare const textFieldSchema: z.ZodObject<{
|
|
|
260
264
|
readonly Justified: "J";
|
|
261
265
|
}>;
|
|
262
266
|
hangingIndent: z.ZodNumber;
|
|
263
|
-
verticalAlignment: z.ZodEnum<{
|
|
264
|
-
readonly Start: "start";
|
|
265
|
-
readonly End: "end";
|
|
266
|
-
}>;
|
|
267
267
|
charsPerLine: z.ZodNumber;
|
|
268
268
|
transformation: z.ZodEnum<{
|
|
269
269
|
readonly None: "None";
|
|
@@ -280,6 +280,10 @@ export declare const barcodeFieldSchema: z.ZodObject<{
|
|
|
280
280
|
x: z.ZodNumber;
|
|
281
281
|
y: z.ZodNumber;
|
|
282
282
|
defaultValue: z.ZodString;
|
|
283
|
+
verticalAlignment: z.ZodEnum<{
|
|
284
|
+
readonly Start: "start";
|
|
285
|
+
readonly End: "end";
|
|
286
|
+
}>;
|
|
283
287
|
sourceType: z.ZodEnum<{
|
|
284
288
|
readonly account: "account";
|
|
285
289
|
readonly accountAttributes: "accountAttributes";
|
|
@@ -320,6 +324,10 @@ export declare const qrcodeFieldSchema: z.ZodObject<{
|
|
|
320
324
|
x: z.ZodNumber;
|
|
321
325
|
y: z.ZodNumber;
|
|
322
326
|
defaultValue: z.ZodString;
|
|
327
|
+
verticalAlignment: z.ZodEnum<{
|
|
328
|
+
readonly Start: "start";
|
|
329
|
+
readonly End: "end";
|
|
330
|
+
}>;
|
|
323
331
|
sourceType: z.ZodEnum<{
|
|
324
332
|
readonly account: "account";
|
|
325
333
|
readonly accountAttributes: "accountAttributes";
|
|
@@ -345,11 +353,40 @@ export declare const qrcodeFieldSchema: z.ZodObject<{
|
|
|
345
353
|
mask: z.ZodNumber;
|
|
346
354
|
}, z.core.$strip>;
|
|
347
355
|
export type QrcodeField = z.infer<typeof qrcodeFieldSchema>;
|
|
356
|
+
export declare const imageFieldSchema: z.ZodObject<{
|
|
357
|
+
name: z.ZodString;
|
|
358
|
+
x: z.ZodNumber;
|
|
359
|
+
y: z.ZodNumber;
|
|
360
|
+
defaultValue: z.ZodString;
|
|
361
|
+
verticalAlignment: z.ZodEnum<{
|
|
362
|
+
readonly Start: "start";
|
|
363
|
+
readonly End: "end";
|
|
364
|
+
}>;
|
|
365
|
+
sourceType: z.ZodEnum<{
|
|
366
|
+
readonly account: "account";
|
|
367
|
+
readonly accountAttributes: "accountAttributes";
|
|
368
|
+
readonly accountTiers: "accountTiers";
|
|
369
|
+
readonly pass: "pass";
|
|
370
|
+
readonly passResponses: "passResponses";
|
|
371
|
+
readonly passAttributes: "passAttributes";
|
|
372
|
+
}>;
|
|
373
|
+
sourceLookup: z.ZodString;
|
|
374
|
+
sourceSeperator: z.ZodString;
|
|
375
|
+
hideEmpty: z.ZodBoolean;
|
|
376
|
+
editable: z.ZodBoolean;
|
|
377
|
+
type: z.ZodLiteral<"image">;
|
|
378
|
+
data: z.ZodString;
|
|
379
|
+
}, z.core.$strip>;
|
|
380
|
+
export type ImageField = z.infer<typeof imageFieldSchema>;
|
|
348
381
|
export declare const fieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
349
382
|
name: z.ZodString;
|
|
350
383
|
x: z.ZodNumber;
|
|
351
384
|
y: z.ZodNumber;
|
|
352
385
|
defaultValue: z.ZodString;
|
|
386
|
+
verticalAlignment: z.ZodEnum<{
|
|
387
|
+
readonly Start: "start";
|
|
388
|
+
readonly End: "end";
|
|
389
|
+
}>;
|
|
353
390
|
sourceType: z.ZodEnum<{
|
|
354
391
|
readonly account: "account";
|
|
355
392
|
readonly accountAttributes: "accountAttributes";
|
|
@@ -381,10 +418,6 @@ export declare const fieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
381
418
|
readonly Justified: "J";
|
|
382
419
|
}>;
|
|
383
420
|
hangingIndent: z.ZodNumber;
|
|
384
|
-
verticalAlignment: z.ZodEnum<{
|
|
385
|
-
readonly Start: "start";
|
|
386
|
-
readonly End: "end";
|
|
387
|
-
}>;
|
|
388
421
|
charsPerLine: z.ZodNumber;
|
|
389
422
|
transformation: z.ZodEnum<{
|
|
390
423
|
readonly None: "None";
|
|
@@ -399,6 +432,10 @@ export declare const fieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
399
432
|
x: z.ZodNumber;
|
|
400
433
|
y: z.ZodNumber;
|
|
401
434
|
defaultValue: z.ZodString;
|
|
435
|
+
verticalAlignment: z.ZodEnum<{
|
|
436
|
+
readonly Start: "start";
|
|
437
|
+
readonly End: "end";
|
|
438
|
+
}>;
|
|
402
439
|
sourceType: z.ZodEnum<{
|
|
403
440
|
readonly account: "account";
|
|
404
441
|
readonly accountAttributes: "accountAttributes";
|
|
@@ -437,6 +474,10 @@ export declare const fieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
437
474
|
x: z.ZodNumber;
|
|
438
475
|
y: z.ZodNumber;
|
|
439
476
|
defaultValue: z.ZodString;
|
|
477
|
+
verticalAlignment: z.ZodEnum<{
|
|
478
|
+
readonly Start: "start";
|
|
479
|
+
readonly End: "end";
|
|
480
|
+
}>;
|
|
440
481
|
sourceType: z.ZodEnum<{
|
|
441
482
|
readonly account: "account";
|
|
442
483
|
readonly accountAttributes: "accountAttributes";
|
|
@@ -460,6 +501,29 @@ export declare const fieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
460
501
|
readonly Lower: "L";
|
|
461
502
|
}>;
|
|
462
503
|
mask: z.ZodNumber;
|
|
504
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
505
|
+
name: z.ZodString;
|
|
506
|
+
x: z.ZodNumber;
|
|
507
|
+
y: z.ZodNumber;
|
|
508
|
+
defaultValue: z.ZodString;
|
|
509
|
+
verticalAlignment: z.ZodEnum<{
|
|
510
|
+
readonly Start: "start";
|
|
511
|
+
readonly End: "end";
|
|
512
|
+
}>;
|
|
513
|
+
sourceType: z.ZodEnum<{
|
|
514
|
+
readonly account: "account";
|
|
515
|
+
readonly accountAttributes: "accountAttributes";
|
|
516
|
+
readonly accountTiers: "accountTiers";
|
|
517
|
+
readonly pass: "pass";
|
|
518
|
+
readonly passResponses: "passResponses";
|
|
519
|
+
readonly passAttributes: "passAttributes";
|
|
520
|
+
}>;
|
|
521
|
+
sourceLookup: z.ZodString;
|
|
522
|
+
sourceSeperator: z.ZodString;
|
|
523
|
+
hideEmpty: z.ZodBoolean;
|
|
524
|
+
editable: z.ZodBoolean;
|
|
525
|
+
type: z.ZodLiteral<"image">;
|
|
526
|
+
data: z.ZodString;
|
|
463
527
|
}, z.core.$strip>], "type">;
|
|
464
528
|
export type Field = z.infer<typeof fieldSchema>;
|
|
465
529
|
export declare const fontSchema: z.ZodObject<{
|
|
@@ -545,6 +609,10 @@ export declare const badgeSchema: z.ZodObject<{
|
|
|
545
609
|
x: z.ZodNumber;
|
|
546
610
|
y: z.ZodNumber;
|
|
547
611
|
defaultValue: z.ZodString;
|
|
612
|
+
verticalAlignment: z.ZodEnum<{
|
|
613
|
+
readonly Start: "start";
|
|
614
|
+
readonly End: "end";
|
|
615
|
+
}>;
|
|
548
616
|
sourceType: z.ZodEnum<{
|
|
549
617
|
readonly account: "account";
|
|
550
618
|
readonly accountAttributes: "accountAttributes";
|
|
@@ -576,10 +644,6 @@ export declare const badgeSchema: z.ZodObject<{
|
|
|
576
644
|
readonly Justified: "J";
|
|
577
645
|
}>;
|
|
578
646
|
hangingIndent: z.ZodNumber;
|
|
579
|
-
verticalAlignment: z.ZodEnum<{
|
|
580
|
-
readonly Start: "start";
|
|
581
|
-
readonly End: "end";
|
|
582
|
-
}>;
|
|
583
647
|
charsPerLine: z.ZodNumber;
|
|
584
648
|
transformation: z.ZodEnum<{
|
|
585
649
|
readonly None: "None";
|
|
@@ -594,6 +658,10 @@ export declare const badgeSchema: z.ZodObject<{
|
|
|
594
658
|
x: z.ZodNumber;
|
|
595
659
|
y: z.ZodNumber;
|
|
596
660
|
defaultValue: z.ZodString;
|
|
661
|
+
verticalAlignment: z.ZodEnum<{
|
|
662
|
+
readonly Start: "start";
|
|
663
|
+
readonly End: "end";
|
|
664
|
+
}>;
|
|
597
665
|
sourceType: z.ZodEnum<{
|
|
598
666
|
readonly account: "account";
|
|
599
667
|
readonly accountAttributes: "accountAttributes";
|
|
@@ -632,6 +700,10 @@ export declare const badgeSchema: z.ZodObject<{
|
|
|
632
700
|
x: z.ZodNumber;
|
|
633
701
|
y: z.ZodNumber;
|
|
634
702
|
defaultValue: z.ZodString;
|
|
703
|
+
verticalAlignment: z.ZodEnum<{
|
|
704
|
+
readonly Start: "start";
|
|
705
|
+
readonly End: "end";
|
|
706
|
+
}>;
|
|
635
707
|
sourceType: z.ZodEnum<{
|
|
636
708
|
readonly account: "account";
|
|
637
709
|
readonly accountAttributes: "accountAttributes";
|
|
@@ -655,6 +727,29 @@ export declare const badgeSchema: z.ZodObject<{
|
|
|
655
727
|
readonly Lower: "L";
|
|
656
728
|
}>;
|
|
657
729
|
mask: z.ZodNumber;
|
|
730
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
731
|
+
name: z.ZodString;
|
|
732
|
+
x: z.ZodNumber;
|
|
733
|
+
y: z.ZodNumber;
|
|
734
|
+
defaultValue: z.ZodString;
|
|
735
|
+
verticalAlignment: z.ZodEnum<{
|
|
736
|
+
readonly Start: "start";
|
|
737
|
+
readonly End: "end";
|
|
738
|
+
}>;
|
|
739
|
+
sourceType: z.ZodEnum<{
|
|
740
|
+
readonly account: "account";
|
|
741
|
+
readonly accountAttributes: "accountAttributes";
|
|
742
|
+
readonly accountTiers: "accountTiers";
|
|
743
|
+
readonly pass: "pass";
|
|
744
|
+
readonly passResponses: "passResponses";
|
|
745
|
+
readonly passAttributes: "passAttributes";
|
|
746
|
+
}>;
|
|
747
|
+
sourceLookup: z.ZodString;
|
|
748
|
+
sourceSeperator: z.ZodString;
|
|
749
|
+
hideEmpty: z.ZodBoolean;
|
|
750
|
+
editable: z.ZodBoolean;
|
|
751
|
+
type: z.ZodLiteral<"image">;
|
|
752
|
+
data: z.ZodString;
|
|
658
753
|
}, z.core.$strip>], "type">>;
|
|
659
754
|
fonts: z.ZodArray<z.ZodObject<{
|
|
660
755
|
name: z.ZodString;
|
|
@@ -707,6 +802,7 @@ export declare function validateBadge(data: Badge): z.ZodSafeParseResult<{
|
|
|
707
802
|
x: number;
|
|
708
803
|
y: number;
|
|
709
804
|
defaultValue: string;
|
|
805
|
+
verticalAlignment: "start" | "end";
|
|
710
806
|
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
711
807
|
sourceLookup: string;
|
|
712
808
|
sourceSeperator: string;
|
|
@@ -721,7 +817,6 @@ export declare function validateBadge(data: Badge): z.ZodSafeParseResult<{
|
|
|
721
817
|
lineSpacing: number;
|
|
722
818
|
alignment: "R" | "C" | "L" | "J";
|
|
723
819
|
hangingIndent: number;
|
|
724
|
-
verticalAlignment: "start" | "end";
|
|
725
820
|
charsPerLine: number;
|
|
726
821
|
transformation: "None" | "Uppercase" | "Lowercase" | "Capitalize";
|
|
727
822
|
maxCharacters: number;
|
|
@@ -731,6 +826,7 @@ export declare function validateBadge(data: Badge): z.ZodSafeParseResult<{
|
|
|
731
826
|
x: number;
|
|
732
827
|
y: number;
|
|
733
828
|
defaultValue: string;
|
|
829
|
+
verticalAlignment: "start" | "end";
|
|
734
830
|
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
735
831
|
sourceLookup: string;
|
|
736
832
|
sourceSeperator: string;
|
|
@@ -748,6 +844,7 @@ export declare function validateBadge(data: Badge): z.ZodSafeParseResult<{
|
|
|
748
844
|
x: number;
|
|
749
845
|
y: number;
|
|
750
846
|
defaultValue: string;
|
|
847
|
+
verticalAlignment: "start" | "end";
|
|
751
848
|
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
752
849
|
sourceLookup: string;
|
|
753
850
|
sourceSeperator: string;
|
|
@@ -759,6 +856,19 @@ export declare function validateBadge(data: Badge): z.ZodSafeParseResult<{
|
|
|
759
856
|
magnification: number;
|
|
760
857
|
errorCorrection: "M" | "L" | "H" | "Q";
|
|
761
858
|
mask: number;
|
|
859
|
+
} | {
|
|
860
|
+
name: string;
|
|
861
|
+
x: number;
|
|
862
|
+
y: number;
|
|
863
|
+
defaultValue: string;
|
|
864
|
+
verticalAlignment: "start" | "end";
|
|
865
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
866
|
+
sourceLookup: string;
|
|
867
|
+
sourceSeperator: string;
|
|
868
|
+
hideEmpty: boolean;
|
|
869
|
+
editable: boolean;
|
|
870
|
+
type: "image";
|
|
871
|
+
data: string;
|
|
762
872
|
})[];
|
|
763
873
|
fonts: {
|
|
764
874
|
name: string;
|
|
@@ -799,6 +909,7 @@ export declare function validateBadgeOrThrow(data: Badge): {
|
|
|
799
909
|
x: number;
|
|
800
910
|
y: number;
|
|
801
911
|
defaultValue: string;
|
|
912
|
+
verticalAlignment: "start" | "end";
|
|
802
913
|
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
803
914
|
sourceLookup: string;
|
|
804
915
|
sourceSeperator: string;
|
|
@@ -813,7 +924,6 @@ export declare function validateBadgeOrThrow(data: Badge): {
|
|
|
813
924
|
lineSpacing: number;
|
|
814
925
|
alignment: "R" | "C" | "L" | "J";
|
|
815
926
|
hangingIndent: number;
|
|
816
|
-
verticalAlignment: "start" | "end";
|
|
817
927
|
charsPerLine: number;
|
|
818
928
|
transformation: "None" | "Uppercase" | "Lowercase" | "Capitalize";
|
|
819
929
|
maxCharacters: number;
|
|
@@ -823,6 +933,7 @@ export declare function validateBadgeOrThrow(data: Badge): {
|
|
|
823
933
|
x: number;
|
|
824
934
|
y: number;
|
|
825
935
|
defaultValue: string;
|
|
936
|
+
verticalAlignment: "start" | "end";
|
|
826
937
|
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
827
938
|
sourceLookup: string;
|
|
828
939
|
sourceSeperator: string;
|
|
@@ -840,6 +951,7 @@ export declare function validateBadgeOrThrow(data: Badge): {
|
|
|
840
951
|
x: number;
|
|
841
952
|
y: number;
|
|
842
953
|
defaultValue: string;
|
|
954
|
+
verticalAlignment: "start" | "end";
|
|
843
955
|
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
844
956
|
sourceLookup: string;
|
|
845
957
|
sourceSeperator: string;
|
|
@@ -851,6 +963,19 @@ export declare function validateBadgeOrThrow(data: Badge): {
|
|
|
851
963
|
magnification: number;
|
|
852
964
|
errorCorrection: "M" | "L" | "H" | "Q";
|
|
853
965
|
mask: number;
|
|
966
|
+
} | {
|
|
967
|
+
name: string;
|
|
968
|
+
x: number;
|
|
969
|
+
y: number;
|
|
970
|
+
defaultValue: string;
|
|
971
|
+
verticalAlignment: "start" | "end";
|
|
972
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
973
|
+
sourceLookup: string;
|
|
974
|
+
sourceSeperator: string;
|
|
975
|
+
hideEmpty: boolean;
|
|
976
|
+
editable: boolean;
|
|
977
|
+
type: "image";
|
|
978
|
+
data: string;
|
|
854
979
|
})[];
|
|
855
980
|
fonts: {
|
|
856
981
|
name: string;
|