@connectedxm/zpl-generator 0.0.2-beta.3 → 0.0.2-beta.7
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 +749 -716
- package/dist/src/generate.d.ts +4 -3
- package/dist/src/interfaces.d.ts +39 -0
- package/dist/src/validate.d.ts +250 -44
- package/package.json +1 -1
package/dist/src/generate.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Badge, TextField } from './validate';
|
|
2
|
+
import { SourceData } from './interfaces';
|
|
2
3
|
/**
|
|
3
4
|
* Generates ZPL (Zebra Programming Language) from a Badge configuration.
|
|
4
5
|
* Switches on badge type and renders the complete label format for thermal printers.
|
|
5
6
|
*/
|
|
6
|
-
export declare function generate(badge: Badge): string;
|
|
7
|
+
export declare function generate(badge: Badge, data?: SourceData): string;
|
|
7
8
|
/**
|
|
8
9
|
* ZPL ^FB blocks have no vertical alignment — text always starts at line 1.
|
|
9
10
|
* To simulate "end" (bottom) alignment, we count how many lines the data
|
|
@@ -13,7 +14,7 @@ export declare function generate(badge: Badge): string;
|
|
|
13
14
|
* - wordWidths provided: simulate word-wrap using pre-measured pixel widths
|
|
14
15
|
* - wordWidths omitted: approximate chars per line from maxWidth / font width
|
|
15
16
|
*/
|
|
16
|
-
export declare function applyVerticalAlignment(field: TextField): string;
|
|
17
|
+
export declare function applyVerticalAlignment(field: TextField, value: string): string;
|
|
17
18
|
/**
|
|
18
19
|
* Counts how many lines the field data will occupy inside a ^FB field.
|
|
19
20
|
* Exported so consuming projects (e.g. React label previews) can reuse
|
|
@@ -26,4 +27,4 @@ export declare function applyVerticalAlignment(field: TextField): string;
|
|
|
26
27
|
* When wordWidths are not provided, falls back to a character-width
|
|
27
28
|
* heuristic using fontWidth (or fontHeight).
|
|
28
29
|
*/
|
|
29
|
-
export declare function countLines(field: TextField): number;
|
|
30
|
+
export declare function countLines(field: TextField, value: string): number;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface SourceAccount {
|
|
2
|
+
firstName: string;
|
|
3
|
+
lastName: string;
|
|
4
|
+
username: string;
|
|
5
|
+
title: string | undefined;
|
|
6
|
+
company: string | undefined;
|
|
7
|
+
city: string | undefined;
|
|
8
|
+
state: string | undefined;
|
|
9
|
+
country: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface SourceAccountAttribute {
|
|
12
|
+
id: string;
|
|
13
|
+
value: string;
|
|
14
|
+
}
|
|
15
|
+
export interface SourceAccountTier {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
}
|
|
19
|
+
export interface SourcePass {
|
|
20
|
+
id: string;
|
|
21
|
+
alternateId: string;
|
|
22
|
+
passType: string;
|
|
23
|
+
}
|
|
24
|
+
export interface SourcePassAttribute {
|
|
25
|
+
name: string;
|
|
26
|
+
value: string;
|
|
27
|
+
}
|
|
28
|
+
export interface SourcePassResponse {
|
|
29
|
+
questionId: string;
|
|
30
|
+
value: string;
|
|
31
|
+
}
|
|
32
|
+
export interface SourceData {
|
|
33
|
+
account: SourceAccount;
|
|
34
|
+
accountAttributes: SourceAccountAttribute[];
|
|
35
|
+
accountTier?: SourceAccountTier;
|
|
36
|
+
pass: SourcePass;
|
|
37
|
+
passResponses: SourcePassResponse[];
|
|
38
|
+
passAttributes: SourcePassAttribute[];
|
|
39
|
+
}
|
package/dist/src/validate.d.ts
CHANGED
|
@@ -188,6 +188,23 @@ export declare const verticalAlignmentSchema: z.ZodNativeEnum<{
|
|
|
188
188
|
readonly End: "end";
|
|
189
189
|
}>;
|
|
190
190
|
export type VerticalAlignment = z.infer<typeof verticalAlignmentSchema>;
|
|
191
|
+
export declare const SourceType: {
|
|
192
|
+
readonly account: "account";
|
|
193
|
+
readonly accountAttributes: "accountAttributes";
|
|
194
|
+
readonly accountTiers: "accountTiers";
|
|
195
|
+
readonly pass: "pass";
|
|
196
|
+
readonly passResponses: "passResponses";
|
|
197
|
+
readonly passAttributes: "passAttributes";
|
|
198
|
+
};
|
|
199
|
+
export declare const sourceTypeSchema: z.ZodNativeEnum<{
|
|
200
|
+
readonly account: "account";
|
|
201
|
+
readonly accountAttributes: "accountAttributes";
|
|
202
|
+
readonly accountTiers: "accountTiers";
|
|
203
|
+
readonly pass: "pass";
|
|
204
|
+
readonly passResponses: "passResponses";
|
|
205
|
+
readonly passAttributes: "passAttributes";
|
|
206
|
+
}>;
|
|
207
|
+
export type SourceType = z.infer<typeof sourceTypeSchema>;
|
|
191
208
|
export declare const wordWidthSchema: z.ZodObject<{
|
|
192
209
|
word: z.ZodString;
|
|
193
210
|
width: z.ZodNumber;
|
|
@@ -206,7 +223,17 @@ export declare const textFieldSchema: z.ZodObject<{
|
|
|
206
223
|
name: z.ZodString;
|
|
207
224
|
x: z.ZodNumber;
|
|
208
225
|
y: z.ZodNumber;
|
|
209
|
-
|
|
226
|
+
defaultValue: z.ZodString;
|
|
227
|
+
sourceType: z.ZodNativeEnum<{
|
|
228
|
+
readonly account: "account";
|
|
229
|
+
readonly accountAttributes: "accountAttributes";
|
|
230
|
+
readonly accountTiers: "accountTiers";
|
|
231
|
+
readonly pass: "pass";
|
|
232
|
+
readonly passResponses: "passResponses";
|
|
233
|
+
readonly passAttributes: "passAttributes";
|
|
234
|
+
}>;
|
|
235
|
+
sourceLookup: z.ZodString;
|
|
236
|
+
hideEmpty: z.ZodBoolean;
|
|
210
237
|
} & {
|
|
211
238
|
type: z.ZodLiteral<"text">;
|
|
212
239
|
font: z.ZodString;
|
|
@@ -250,7 +277,10 @@ export declare const textFieldSchema: z.ZodObject<{
|
|
|
250
277
|
name: string;
|
|
251
278
|
x: number;
|
|
252
279
|
y: number;
|
|
253
|
-
|
|
280
|
+
defaultValue: string;
|
|
281
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
282
|
+
sourceLookup: string;
|
|
283
|
+
hideEmpty: boolean;
|
|
254
284
|
font: string;
|
|
255
285
|
fontOrientation: "N" | "B" | "I" | "R";
|
|
256
286
|
fontHeight: number;
|
|
@@ -271,7 +301,10 @@ export declare const textFieldSchema: z.ZodObject<{
|
|
|
271
301
|
name: string;
|
|
272
302
|
x: number;
|
|
273
303
|
y: number;
|
|
274
|
-
|
|
304
|
+
defaultValue: string;
|
|
305
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
306
|
+
sourceLookup: string;
|
|
307
|
+
hideEmpty: boolean;
|
|
275
308
|
font: string;
|
|
276
309
|
fontOrientation: "N" | "B" | "I" | "R";
|
|
277
310
|
fontHeight: number;
|
|
@@ -293,7 +326,17 @@ export declare const barcodeFieldSchema: z.ZodObject<{
|
|
|
293
326
|
name: z.ZodString;
|
|
294
327
|
x: z.ZodNumber;
|
|
295
328
|
y: z.ZodNumber;
|
|
296
|
-
|
|
329
|
+
defaultValue: z.ZodString;
|
|
330
|
+
sourceType: z.ZodNativeEnum<{
|
|
331
|
+
readonly account: "account";
|
|
332
|
+
readonly accountAttributes: "accountAttributes";
|
|
333
|
+
readonly accountTiers: "accountTiers";
|
|
334
|
+
readonly pass: "pass";
|
|
335
|
+
readonly passResponses: "passResponses";
|
|
336
|
+
readonly passAttributes: "passAttributes";
|
|
337
|
+
}>;
|
|
338
|
+
sourceLookup: z.ZodString;
|
|
339
|
+
hideEmpty: z.ZodBoolean;
|
|
297
340
|
} & {
|
|
298
341
|
type: z.ZodLiteral<"barcode">;
|
|
299
342
|
barWidth: z.ZodNumber;
|
|
@@ -321,7 +364,10 @@ export declare const barcodeFieldSchema: z.ZodObject<{
|
|
|
321
364
|
name: string;
|
|
322
365
|
x: number;
|
|
323
366
|
y: number;
|
|
324
|
-
|
|
367
|
+
defaultValue: string;
|
|
368
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
369
|
+
sourceLookup: string;
|
|
370
|
+
hideEmpty: boolean;
|
|
325
371
|
barWidth: number;
|
|
326
372
|
orientation: "N" | "B" | "I" | "R";
|
|
327
373
|
height: number;
|
|
@@ -333,7 +379,10 @@ export declare const barcodeFieldSchema: z.ZodObject<{
|
|
|
333
379
|
name: string;
|
|
334
380
|
x: number;
|
|
335
381
|
y: number;
|
|
336
|
-
|
|
382
|
+
defaultValue: string;
|
|
383
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
384
|
+
sourceLookup: string;
|
|
385
|
+
hideEmpty: boolean;
|
|
337
386
|
barWidth: number;
|
|
338
387
|
orientation: "N" | "B" | "I" | "R";
|
|
339
388
|
height: number;
|
|
@@ -346,7 +395,17 @@ export declare const qrcodeFieldSchema: z.ZodObject<{
|
|
|
346
395
|
name: z.ZodString;
|
|
347
396
|
x: z.ZodNumber;
|
|
348
397
|
y: z.ZodNumber;
|
|
349
|
-
|
|
398
|
+
defaultValue: z.ZodString;
|
|
399
|
+
sourceType: z.ZodNativeEnum<{
|
|
400
|
+
readonly account: "account";
|
|
401
|
+
readonly accountAttributes: "accountAttributes";
|
|
402
|
+
readonly accountTiers: "accountTiers";
|
|
403
|
+
readonly pass: "pass";
|
|
404
|
+
readonly passResponses: "passResponses";
|
|
405
|
+
readonly passAttributes: "passAttributes";
|
|
406
|
+
}>;
|
|
407
|
+
sourceLookup: z.ZodString;
|
|
408
|
+
hideEmpty: z.ZodBoolean;
|
|
350
409
|
} & {
|
|
351
410
|
type: z.ZodLiteral<"qrcode">;
|
|
352
411
|
orientation: z.ZodLiteral<"N">;
|
|
@@ -364,7 +423,10 @@ export declare const qrcodeFieldSchema: z.ZodObject<{
|
|
|
364
423
|
name: string;
|
|
365
424
|
x: number;
|
|
366
425
|
y: number;
|
|
367
|
-
|
|
426
|
+
defaultValue: string;
|
|
427
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
428
|
+
sourceLookup: string;
|
|
429
|
+
hideEmpty: boolean;
|
|
368
430
|
orientation: "N";
|
|
369
431
|
model: "2";
|
|
370
432
|
magnification: number;
|
|
@@ -375,7 +437,10 @@ export declare const qrcodeFieldSchema: z.ZodObject<{
|
|
|
375
437
|
name: string;
|
|
376
438
|
x: number;
|
|
377
439
|
y: number;
|
|
378
|
-
|
|
440
|
+
defaultValue: string;
|
|
441
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
442
|
+
sourceLookup: string;
|
|
443
|
+
hideEmpty: boolean;
|
|
379
444
|
orientation: "N";
|
|
380
445
|
model: "2";
|
|
381
446
|
magnification: number;
|
|
@@ -387,7 +452,17 @@ export declare const fieldSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
387
452
|
name: z.ZodString;
|
|
388
453
|
x: z.ZodNumber;
|
|
389
454
|
y: z.ZodNumber;
|
|
390
|
-
|
|
455
|
+
defaultValue: z.ZodString;
|
|
456
|
+
sourceType: z.ZodNativeEnum<{
|
|
457
|
+
readonly account: "account";
|
|
458
|
+
readonly accountAttributes: "accountAttributes";
|
|
459
|
+
readonly accountTiers: "accountTiers";
|
|
460
|
+
readonly pass: "pass";
|
|
461
|
+
readonly passResponses: "passResponses";
|
|
462
|
+
readonly passAttributes: "passAttributes";
|
|
463
|
+
}>;
|
|
464
|
+
sourceLookup: z.ZodString;
|
|
465
|
+
hideEmpty: z.ZodBoolean;
|
|
391
466
|
} & {
|
|
392
467
|
type: z.ZodLiteral<"text">;
|
|
393
468
|
font: z.ZodString;
|
|
@@ -431,7 +506,10 @@ export declare const fieldSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
431
506
|
name: string;
|
|
432
507
|
x: number;
|
|
433
508
|
y: number;
|
|
434
|
-
|
|
509
|
+
defaultValue: string;
|
|
510
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
511
|
+
sourceLookup: string;
|
|
512
|
+
hideEmpty: boolean;
|
|
435
513
|
font: string;
|
|
436
514
|
fontOrientation: "N" | "B" | "I" | "R";
|
|
437
515
|
fontHeight: number;
|
|
@@ -452,7 +530,10 @@ export declare const fieldSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
452
530
|
name: string;
|
|
453
531
|
x: number;
|
|
454
532
|
y: number;
|
|
455
|
-
|
|
533
|
+
defaultValue: string;
|
|
534
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
535
|
+
sourceLookup: string;
|
|
536
|
+
hideEmpty: boolean;
|
|
456
537
|
font: string;
|
|
457
538
|
fontOrientation: "N" | "B" | "I" | "R";
|
|
458
539
|
fontHeight: number;
|
|
@@ -472,7 +553,17 @@ export declare const fieldSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
472
553
|
name: z.ZodString;
|
|
473
554
|
x: z.ZodNumber;
|
|
474
555
|
y: z.ZodNumber;
|
|
475
|
-
|
|
556
|
+
defaultValue: z.ZodString;
|
|
557
|
+
sourceType: z.ZodNativeEnum<{
|
|
558
|
+
readonly account: "account";
|
|
559
|
+
readonly accountAttributes: "accountAttributes";
|
|
560
|
+
readonly accountTiers: "accountTiers";
|
|
561
|
+
readonly pass: "pass";
|
|
562
|
+
readonly passResponses: "passResponses";
|
|
563
|
+
readonly passAttributes: "passAttributes";
|
|
564
|
+
}>;
|
|
565
|
+
sourceLookup: z.ZodString;
|
|
566
|
+
hideEmpty: z.ZodBoolean;
|
|
476
567
|
} & {
|
|
477
568
|
type: z.ZodLiteral<"barcode">;
|
|
478
569
|
barWidth: z.ZodNumber;
|
|
@@ -500,7 +591,10 @@ export declare const fieldSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
500
591
|
name: string;
|
|
501
592
|
x: number;
|
|
502
593
|
y: number;
|
|
503
|
-
|
|
594
|
+
defaultValue: string;
|
|
595
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
596
|
+
sourceLookup: string;
|
|
597
|
+
hideEmpty: boolean;
|
|
504
598
|
barWidth: number;
|
|
505
599
|
orientation: "N" | "B" | "I" | "R";
|
|
506
600
|
height: number;
|
|
@@ -512,7 +606,10 @@ export declare const fieldSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
512
606
|
name: string;
|
|
513
607
|
x: number;
|
|
514
608
|
y: number;
|
|
515
|
-
|
|
609
|
+
defaultValue: string;
|
|
610
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
611
|
+
sourceLookup: string;
|
|
612
|
+
hideEmpty: boolean;
|
|
516
613
|
barWidth: number;
|
|
517
614
|
orientation: "N" | "B" | "I" | "R";
|
|
518
615
|
height: number;
|
|
@@ -523,7 +620,17 @@ export declare const fieldSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
523
620
|
name: z.ZodString;
|
|
524
621
|
x: z.ZodNumber;
|
|
525
622
|
y: z.ZodNumber;
|
|
526
|
-
|
|
623
|
+
defaultValue: z.ZodString;
|
|
624
|
+
sourceType: z.ZodNativeEnum<{
|
|
625
|
+
readonly account: "account";
|
|
626
|
+
readonly accountAttributes: "accountAttributes";
|
|
627
|
+
readonly accountTiers: "accountTiers";
|
|
628
|
+
readonly pass: "pass";
|
|
629
|
+
readonly passResponses: "passResponses";
|
|
630
|
+
readonly passAttributes: "passAttributes";
|
|
631
|
+
}>;
|
|
632
|
+
sourceLookup: z.ZodString;
|
|
633
|
+
hideEmpty: z.ZodBoolean;
|
|
527
634
|
} & {
|
|
528
635
|
type: z.ZodLiteral<"qrcode">;
|
|
529
636
|
orientation: z.ZodLiteral<"N">;
|
|
@@ -541,7 +648,10 @@ export declare const fieldSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
541
648
|
name: string;
|
|
542
649
|
x: number;
|
|
543
650
|
y: number;
|
|
544
|
-
|
|
651
|
+
defaultValue: string;
|
|
652
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
653
|
+
sourceLookup: string;
|
|
654
|
+
hideEmpty: boolean;
|
|
545
655
|
orientation: "N";
|
|
546
656
|
model: "2";
|
|
547
657
|
magnification: number;
|
|
@@ -552,7 +662,10 @@ export declare const fieldSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
552
662
|
name: string;
|
|
553
663
|
x: number;
|
|
554
664
|
y: number;
|
|
555
|
-
|
|
665
|
+
defaultValue: string;
|
|
666
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
667
|
+
sourceLookup: string;
|
|
668
|
+
hideEmpty: boolean;
|
|
556
669
|
orientation: "N";
|
|
557
670
|
model: "2";
|
|
558
671
|
magnification: number;
|
|
@@ -637,7 +750,17 @@ export declare const badgeSchema: z.ZodObject<{
|
|
|
637
750
|
name: z.ZodString;
|
|
638
751
|
x: z.ZodNumber;
|
|
639
752
|
y: z.ZodNumber;
|
|
640
|
-
|
|
753
|
+
defaultValue: z.ZodString;
|
|
754
|
+
sourceType: z.ZodNativeEnum<{
|
|
755
|
+
readonly account: "account";
|
|
756
|
+
readonly accountAttributes: "accountAttributes";
|
|
757
|
+
readonly accountTiers: "accountTiers";
|
|
758
|
+
readonly pass: "pass";
|
|
759
|
+
readonly passResponses: "passResponses";
|
|
760
|
+
readonly passAttributes: "passAttributes";
|
|
761
|
+
}>;
|
|
762
|
+
sourceLookup: z.ZodString;
|
|
763
|
+
hideEmpty: z.ZodBoolean;
|
|
641
764
|
} & {
|
|
642
765
|
type: z.ZodLiteral<"text">;
|
|
643
766
|
font: z.ZodString;
|
|
@@ -681,7 +804,10 @@ export declare const badgeSchema: z.ZodObject<{
|
|
|
681
804
|
name: string;
|
|
682
805
|
x: number;
|
|
683
806
|
y: number;
|
|
684
|
-
|
|
807
|
+
defaultValue: string;
|
|
808
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
809
|
+
sourceLookup: string;
|
|
810
|
+
hideEmpty: boolean;
|
|
685
811
|
font: string;
|
|
686
812
|
fontOrientation: "N" | "B" | "I" | "R";
|
|
687
813
|
fontHeight: number;
|
|
@@ -702,7 +828,10 @@ export declare const badgeSchema: z.ZodObject<{
|
|
|
702
828
|
name: string;
|
|
703
829
|
x: number;
|
|
704
830
|
y: number;
|
|
705
|
-
|
|
831
|
+
defaultValue: string;
|
|
832
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
833
|
+
sourceLookup: string;
|
|
834
|
+
hideEmpty: boolean;
|
|
706
835
|
font: string;
|
|
707
836
|
fontOrientation: "N" | "B" | "I" | "R";
|
|
708
837
|
fontHeight: number;
|
|
@@ -722,7 +851,17 @@ export declare const badgeSchema: z.ZodObject<{
|
|
|
722
851
|
name: z.ZodString;
|
|
723
852
|
x: z.ZodNumber;
|
|
724
853
|
y: z.ZodNumber;
|
|
725
|
-
|
|
854
|
+
defaultValue: z.ZodString;
|
|
855
|
+
sourceType: z.ZodNativeEnum<{
|
|
856
|
+
readonly account: "account";
|
|
857
|
+
readonly accountAttributes: "accountAttributes";
|
|
858
|
+
readonly accountTiers: "accountTiers";
|
|
859
|
+
readonly pass: "pass";
|
|
860
|
+
readonly passResponses: "passResponses";
|
|
861
|
+
readonly passAttributes: "passAttributes";
|
|
862
|
+
}>;
|
|
863
|
+
sourceLookup: z.ZodString;
|
|
864
|
+
hideEmpty: z.ZodBoolean;
|
|
726
865
|
} & {
|
|
727
866
|
type: z.ZodLiteral<"barcode">;
|
|
728
867
|
barWidth: z.ZodNumber;
|
|
@@ -750,7 +889,10 @@ export declare const badgeSchema: z.ZodObject<{
|
|
|
750
889
|
name: string;
|
|
751
890
|
x: number;
|
|
752
891
|
y: number;
|
|
753
|
-
|
|
892
|
+
defaultValue: string;
|
|
893
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
894
|
+
sourceLookup: string;
|
|
895
|
+
hideEmpty: boolean;
|
|
754
896
|
barWidth: number;
|
|
755
897
|
orientation: "N" | "B" | "I" | "R";
|
|
756
898
|
height: number;
|
|
@@ -762,7 +904,10 @@ export declare const badgeSchema: z.ZodObject<{
|
|
|
762
904
|
name: string;
|
|
763
905
|
x: number;
|
|
764
906
|
y: number;
|
|
765
|
-
|
|
907
|
+
defaultValue: string;
|
|
908
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
909
|
+
sourceLookup: string;
|
|
910
|
+
hideEmpty: boolean;
|
|
766
911
|
barWidth: number;
|
|
767
912
|
orientation: "N" | "B" | "I" | "R";
|
|
768
913
|
height: number;
|
|
@@ -773,7 +918,17 @@ export declare const badgeSchema: z.ZodObject<{
|
|
|
773
918
|
name: z.ZodString;
|
|
774
919
|
x: z.ZodNumber;
|
|
775
920
|
y: z.ZodNumber;
|
|
776
|
-
|
|
921
|
+
defaultValue: z.ZodString;
|
|
922
|
+
sourceType: z.ZodNativeEnum<{
|
|
923
|
+
readonly account: "account";
|
|
924
|
+
readonly accountAttributes: "accountAttributes";
|
|
925
|
+
readonly accountTiers: "accountTiers";
|
|
926
|
+
readonly pass: "pass";
|
|
927
|
+
readonly passResponses: "passResponses";
|
|
928
|
+
readonly passAttributes: "passAttributes";
|
|
929
|
+
}>;
|
|
930
|
+
sourceLookup: z.ZodString;
|
|
931
|
+
hideEmpty: z.ZodBoolean;
|
|
777
932
|
} & {
|
|
778
933
|
type: z.ZodLiteral<"qrcode">;
|
|
779
934
|
orientation: z.ZodLiteral<"N">;
|
|
@@ -791,7 +946,10 @@ export declare const badgeSchema: z.ZodObject<{
|
|
|
791
946
|
name: string;
|
|
792
947
|
x: number;
|
|
793
948
|
y: number;
|
|
794
|
-
|
|
949
|
+
defaultValue: string;
|
|
950
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
951
|
+
sourceLookup: string;
|
|
952
|
+
hideEmpty: boolean;
|
|
795
953
|
orientation: "N";
|
|
796
954
|
model: "2";
|
|
797
955
|
magnification: number;
|
|
@@ -802,7 +960,10 @@ export declare const badgeSchema: z.ZodObject<{
|
|
|
802
960
|
name: string;
|
|
803
961
|
x: number;
|
|
804
962
|
y: number;
|
|
805
|
-
|
|
963
|
+
defaultValue: string;
|
|
964
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
965
|
+
sourceLookup: string;
|
|
966
|
+
hideEmpty: boolean;
|
|
806
967
|
orientation: "N";
|
|
807
968
|
model: "2";
|
|
808
969
|
magnification: number;
|
|
@@ -836,7 +997,10 @@ export declare const badgeSchema: z.ZodObject<{
|
|
|
836
997
|
name: string;
|
|
837
998
|
x: number;
|
|
838
999
|
y: number;
|
|
839
|
-
|
|
1000
|
+
defaultValue: string;
|
|
1001
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
1002
|
+
sourceLookup: string;
|
|
1003
|
+
hideEmpty: boolean;
|
|
840
1004
|
font: string;
|
|
841
1005
|
fontOrientation: "N" | "B" | "I" | "R";
|
|
842
1006
|
fontHeight: number;
|
|
@@ -857,7 +1021,10 @@ export declare const badgeSchema: z.ZodObject<{
|
|
|
857
1021
|
name: string;
|
|
858
1022
|
x: number;
|
|
859
1023
|
y: number;
|
|
860
|
-
|
|
1024
|
+
defaultValue: string;
|
|
1025
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
1026
|
+
sourceLookup: string;
|
|
1027
|
+
hideEmpty: boolean;
|
|
861
1028
|
barWidth: number;
|
|
862
1029
|
orientation: "N" | "B" | "I" | "R";
|
|
863
1030
|
height: number;
|
|
@@ -869,7 +1036,10 @@ export declare const badgeSchema: z.ZodObject<{
|
|
|
869
1036
|
name: string;
|
|
870
1037
|
x: number;
|
|
871
1038
|
y: number;
|
|
872
|
-
|
|
1039
|
+
defaultValue: string;
|
|
1040
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
1041
|
+
sourceLookup: string;
|
|
1042
|
+
hideEmpty: boolean;
|
|
873
1043
|
orientation: "N";
|
|
874
1044
|
model: "2";
|
|
875
1045
|
magnification: number;
|
|
@@ -903,7 +1073,10 @@ export declare const badgeSchema: z.ZodObject<{
|
|
|
903
1073
|
name: string;
|
|
904
1074
|
x: number;
|
|
905
1075
|
y: number;
|
|
906
|
-
|
|
1076
|
+
defaultValue: string;
|
|
1077
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
1078
|
+
sourceLookup: string;
|
|
1079
|
+
hideEmpty: boolean;
|
|
907
1080
|
font: string;
|
|
908
1081
|
fontOrientation: "N" | "B" | "I" | "R";
|
|
909
1082
|
fontHeight: number;
|
|
@@ -924,7 +1097,10 @@ export declare const badgeSchema: z.ZodObject<{
|
|
|
924
1097
|
name: string;
|
|
925
1098
|
x: number;
|
|
926
1099
|
y: number;
|
|
927
|
-
|
|
1100
|
+
defaultValue: string;
|
|
1101
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
1102
|
+
sourceLookup: string;
|
|
1103
|
+
hideEmpty: boolean;
|
|
928
1104
|
barWidth: number;
|
|
929
1105
|
orientation: "N" | "B" | "I" | "R";
|
|
930
1106
|
height: number;
|
|
@@ -936,7 +1112,10 @@ export declare const badgeSchema: z.ZodObject<{
|
|
|
936
1112
|
name: string;
|
|
937
1113
|
x: number;
|
|
938
1114
|
y: number;
|
|
939
|
-
|
|
1115
|
+
defaultValue: string;
|
|
1116
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
1117
|
+
sourceLookup: string;
|
|
1118
|
+
hideEmpty: boolean;
|
|
940
1119
|
orientation: "N";
|
|
941
1120
|
model: "2";
|
|
942
1121
|
magnification: number;
|
|
@@ -963,7 +1142,7 @@ export type BaseBadge = Badge;
|
|
|
963
1142
|
* }
|
|
964
1143
|
* ```
|
|
965
1144
|
*/
|
|
966
|
-
export declare function validateBadge(data:
|
|
1145
|
+
export declare function validateBadge(data: Badge): z.SafeParseReturnType<{
|
|
967
1146
|
reverse: "N" | "Y";
|
|
968
1147
|
type: "thermal";
|
|
969
1148
|
tearOffAdjustment: number;
|
|
@@ -990,7 +1169,10 @@ export declare function validateBadge(data: unknown): z.SafeParseReturnType<{
|
|
|
990
1169
|
name: string;
|
|
991
1170
|
x: number;
|
|
992
1171
|
y: number;
|
|
993
|
-
|
|
1172
|
+
defaultValue: string;
|
|
1173
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
1174
|
+
sourceLookup: string;
|
|
1175
|
+
hideEmpty: boolean;
|
|
994
1176
|
font: string;
|
|
995
1177
|
fontOrientation: "N" | "B" | "I" | "R";
|
|
996
1178
|
fontHeight: number;
|
|
@@ -1011,7 +1193,10 @@ export declare function validateBadge(data: unknown): z.SafeParseReturnType<{
|
|
|
1011
1193
|
name: string;
|
|
1012
1194
|
x: number;
|
|
1013
1195
|
y: number;
|
|
1014
|
-
|
|
1196
|
+
defaultValue: string;
|
|
1197
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
1198
|
+
sourceLookup: string;
|
|
1199
|
+
hideEmpty: boolean;
|
|
1015
1200
|
barWidth: number;
|
|
1016
1201
|
orientation: "N" | "B" | "I" | "R";
|
|
1017
1202
|
height: number;
|
|
@@ -1023,7 +1208,10 @@ export declare function validateBadge(data: unknown): z.SafeParseReturnType<{
|
|
|
1023
1208
|
name: string;
|
|
1024
1209
|
x: number;
|
|
1025
1210
|
y: number;
|
|
1026
|
-
|
|
1211
|
+
defaultValue: string;
|
|
1212
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
1213
|
+
sourceLookup: string;
|
|
1214
|
+
hideEmpty: boolean;
|
|
1027
1215
|
orientation: "N";
|
|
1028
1216
|
model: "2";
|
|
1029
1217
|
magnification: number;
|
|
@@ -1057,7 +1245,10 @@ export declare function validateBadge(data: unknown): z.SafeParseReturnType<{
|
|
|
1057
1245
|
name: string;
|
|
1058
1246
|
x: number;
|
|
1059
1247
|
y: number;
|
|
1060
|
-
|
|
1248
|
+
defaultValue: string;
|
|
1249
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
1250
|
+
sourceLookup: string;
|
|
1251
|
+
hideEmpty: boolean;
|
|
1061
1252
|
font: string;
|
|
1062
1253
|
fontOrientation: "N" | "B" | "I" | "R";
|
|
1063
1254
|
fontHeight: number;
|
|
@@ -1078,7 +1269,10 @@ export declare function validateBadge(data: unknown): z.SafeParseReturnType<{
|
|
|
1078
1269
|
name: string;
|
|
1079
1270
|
x: number;
|
|
1080
1271
|
y: number;
|
|
1081
|
-
|
|
1272
|
+
defaultValue: string;
|
|
1273
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
1274
|
+
sourceLookup: string;
|
|
1275
|
+
hideEmpty: boolean;
|
|
1082
1276
|
barWidth: number;
|
|
1083
1277
|
orientation: "N" | "B" | "I" | "R";
|
|
1084
1278
|
height: number;
|
|
@@ -1090,7 +1284,10 @@ export declare function validateBadge(data: unknown): z.SafeParseReturnType<{
|
|
|
1090
1284
|
name: string;
|
|
1091
1285
|
x: number;
|
|
1092
1286
|
y: number;
|
|
1093
|
-
|
|
1287
|
+
defaultValue: string;
|
|
1288
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
1289
|
+
sourceLookup: string;
|
|
1290
|
+
hideEmpty: boolean;
|
|
1094
1291
|
orientation: "N";
|
|
1095
1292
|
model: "2";
|
|
1096
1293
|
magnification: number;
|
|
@@ -1105,7 +1302,7 @@ export declare function validateBadge(data: unknown): z.SafeParseReturnType<{
|
|
|
1105
1302
|
* @returns A validated Badge object
|
|
1106
1303
|
* @throws ZodError if validation fails
|
|
1107
1304
|
*/
|
|
1108
|
-
export declare function validateBadgeOrThrow(data:
|
|
1305
|
+
export declare function validateBadgeOrThrow(data: Badge): {
|
|
1109
1306
|
reverse: "N" | "Y";
|
|
1110
1307
|
type: "thermal";
|
|
1111
1308
|
tearOffAdjustment: number;
|
|
@@ -1132,7 +1329,10 @@ export declare function validateBadgeOrThrow(data: unknown): {
|
|
|
1132
1329
|
name: string;
|
|
1133
1330
|
x: number;
|
|
1134
1331
|
y: number;
|
|
1135
|
-
|
|
1332
|
+
defaultValue: string;
|
|
1333
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
1334
|
+
sourceLookup: string;
|
|
1335
|
+
hideEmpty: boolean;
|
|
1136
1336
|
font: string;
|
|
1137
1337
|
fontOrientation: "N" | "B" | "I" | "R";
|
|
1138
1338
|
fontHeight: number;
|
|
@@ -1153,7 +1353,10 @@ export declare function validateBadgeOrThrow(data: unknown): {
|
|
|
1153
1353
|
name: string;
|
|
1154
1354
|
x: number;
|
|
1155
1355
|
y: number;
|
|
1156
|
-
|
|
1356
|
+
defaultValue: string;
|
|
1357
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
1358
|
+
sourceLookup: string;
|
|
1359
|
+
hideEmpty: boolean;
|
|
1157
1360
|
barWidth: number;
|
|
1158
1361
|
orientation: "N" | "B" | "I" | "R";
|
|
1159
1362
|
height: number;
|
|
@@ -1165,7 +1368,10 @@ export declare function validateBadgeOrThrow(data: unknown): {
|
|
|
1165
1368
|
name: string;
|
|
1166
1369
|
x: number;
|
|
1167
1370
|
y: number;
|
|
1168
|
-
|
|
1371
|
+
defaultValue: string;
|
|
1372
|
+
sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
|
|
1373
|
+
sourceLookup: string;
|
|
1374
|
+
hideEmpty: boolean;
|
|
1169
1375
|
orientation: "N";
|
|
1170
1376
|
model: "2";
|
|
1171
1377
|
magnification: number;
|