@nfcard/validation 0.20.0 → 0.21.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.d.ts CHANGED
@@ -5191,6 +5191,15 @@ declare const tipJarSchema: z.ZodEffects<z.ZodUnknown, {
5191
5191
  handle: string;
5192
5192
  label?: undefined;
5193
5193
  } | undefined, unknown>;
5194
+ declare const bookingSchema: z.ZodEffects<z.ZodUnknown, {
5195
+ provider: _nfcard_types.BookingProviderId;
5196
+ handle: string;
5197
+ label: string;
5198
+ } | {
5199
+ provider: _nfcard_types.BookingProviderId;
5200
+ handle: string;
5201
+ label?: undefined;
5202
+ } | undefined, unknown>;
5194
5203
  declare const digitalConfigSchema: z.ZodObject<{
5195
5204
  templateId: z.ZodEnum<["minimal", "bold", "card", "aurora", "classic", "spotlight", "marquee", "riso"]>;
5196
5205
  accentColor: z.ZodString;
@@ -5287,6 +5296,15 @@ declare const digitalConfigSchema: z.ZodObject<{
5287
5296
  handle: string;
5288
5297
  label?: undefined;
5289
5298
  } | undefined, unknown>>;
5299
+ booking: z.ZodOptional<z.ZodEffects<z.ZodUnknown, {
5300
+ provider: _nfcard_types.BookingProviderId;
5301
+ handle: string;
5302
+ label: string;
5303
+ } | {
5304
+ provider: _nfcard_types.BookingProviderId;
5305
+ handle: string;
5306
+ label?: undefined;
5307
+ } | undefined, unknown>>;
5290
5308
  }, "strip", z.ZodTypeAny, {
5291
5309
  fontKey: string;
5292
5310
  templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
@@ -5331,6 +5349,15 @@ declare const digitalConfigSchema: z.ZodObject<{
5331
5349
  handle: string;
5332
5350
  label?: undefined;
5333
5351
  } | undefined;
5352
+ booking?: {
5353
+ provider: _nfcard_types.BookingProviderId;
5354
+ handle: string;
5355
+ label: string;
5356
+ } | {
5357
+ provider: _nfcard_types.BookingProviderId;
5358
+ handle: string;
5359
+ label?: undefined;
5360
+ } | undefined;
5334
5361
  }, {
5335
5362
  fontKey: string;
5336
5363
  templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
@@ -5367,6 +5394,7 @@ declare const digitalConfigSchema: z.ZodObject<{
5367
5394
  label?: string | undefined;
5368
5395
  }[] | undefined;
5369
5396
  tipJar?: unknown;
5397
+ booking?: unknown;
5370
5398
  }>;
5371
5399
  declare const entrySourceSchema: z.ZodObject<{
5372
5400
  output: z.ZodOptional<z.ZodEnum<["with-card", "digital-only"]>>;
@@ -8869,6 +8897,15 @@ declare const configurationCreateSchema: z.ZodObject<{
8869
8897
  handle: string;
8870
8898
  label?: undefined;
8871
8899
  } | undefined, unknown>>;
8900
+ booking: z.ZodOptional<z.ZodEffects<z.ZodUnknown, {
8901
+ provider: _nfcard_types.BookingProviderId;
8902
+ handle: string;
8903
+ label: string;
8904
+ } | {
8905
+ provider: _nfcard_types.BookingProviderId;
8906
+ handle: string;
8907
+ label?: undefined;
8908
+ } | undefined, unknown>>;
8872
8909
  }, "strip", z.ZodTypeAny, {
8873
8910
  fontKey: string;
8874
8911
  templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
@@ -8913,6 +8950,15 @@ declare const configurationCreateSchema: z.ZodObject<{
8913
8950
  handle: string;
8914
8951
  label?: undefined;
8915
8952
  } | undefined;
8953
+ booking?: {
8954
+ provider: _nfcard_types.BookingProviderId;
8955
+ handle: string;
8956
+ label: string;
8957
+ } | {
8958
+ provider: _nfcard_types.BookingProviderId;
8959
+ handle: string;
8960
+ label?: undefined;
8961
+ } | undefined;
8916
8962
  }, {
8917
8963
  fontKey: string;
8918
8964
  templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
@@ -8949,6 +8995,7 @@ declare const configurationCreateSchema: z.ZodObject<{
8949
8995
  label?: string | undefined;
8950
8996
  }[] | undefined;
8951
8997
  tipJar?: unknown;
8998
+ booking?: unknown;
8952
8999
  }>;
8953
9000
  quantity: z.ZodDefault<z.ZodNumber>;
8954
9001
  existingProfileId: z.ZodOptional<z.ZodString>;
@@ -9342,6 +9389,15 @@ declare const configurationCreateSchema: z.ZodObject<{
9342
9389
  handle: string;
9343
9390
  label?: undefined;
9344
9391
  } | undefined;
9392
+ booking?: {
9393
+ provider: _nfcard_types.BookingProviderId;
9394
+ handle: string;
9395
+ label: string;
9396
+ } | {
9397
+ provider: _nfcard_types.BookingProviderId;
9398
+ handle: string;
9399
+ label?: undefined;
9400
+ } | undefined;
9345
9401
  };
9346
9402
  quantity: number;
9347
9403
  existingProfileId?: string | undefined;
@@ -9709,6 +9765,7 @@ declare const configurationCreateSchema: z.ZodObject<{
9709
9765
  label?: string | undefined;
9710
9766
  }[] | undefined;
9711
9767
  tipJar?: unknown;
9768
+ booking?: unknown;
9712
9769
  };
9713
9770
  quantity?: number | undefined;
9714
9771
  existingProfileId?: string | undefined;
@@ -13196,6 +13253,15 @@ declare const configurationUpdateSchema: z.ZodObject<{
13196
13253
  handle: string;
13197
13254
  label?: undefined;
13198
13255
  } | undefined, unknown>>;
13256
+ booking: z.ZodOptional<z.ZodEffects<z.ZodUnknown, {
13257
+ provider: _nfcard_types.BookingProviderId;
13258
+ handle: string;
13259
+ label: string;
13260
+ } | {
13261
+ provider: _nfcard_types.BookingProviderId;
13262
+ handle: string;
13263
+ label?: undefined;
13264
+ } | undefined, unknown>>;
13199
13265
  }, "strip", z.ZodTypeAny, {
13200
13266
  fontKey: string;
13201
13267
  templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
@@ -13240,6 +13306,15 @@ declare const configurationUpdateSchema: z.ZodObject<{
13240
13306
  handle: string;
13241
13307
  label?: undefined;
13242
13308
  } | undefined;
13309
+ booking?: {
13310
+ provider: _nfcard_types.BookingProviderId;
13311
+ handle: string;
13312
+ label: string;
13313
+ } | {
13314
+ provider: _nfcard_types.BookingProviderId;
13315
+ handle: string;
13316
+ label?: undefined;
13317
+ } | undefined;
13243
13318
  }, {
13244
13319
  fontKey: string;
13245
13320
  templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
@@ -13276,6 +13351,7 @@ declare const configurationUpdateSchema: z.ZodObject<{
13276
13351
  label?: string | undefined;
13277
13352
  }[] | undefined;
13278
13353
  tipJar?: unknown;
13354
+ booking?: unknown;
13279
13355
  }>>;
13280
13356
  quantity: z.ZodOptional<z.ZodNumber>;
13281
13357
  existingProfileId: z.ZodOptional<z.ZodString>;
@@ -13640,6 +13716,15 @@ declare const configurationUpdateSchema: z.ZodObject<{
13640
13716
  handle: string;
13641
13717
  label?: undefined;
13642
13718
  } | undefined;
13719
+ booking?: {
13720
+ provider: _nfcard_types.BookingProviderId;
13721
+ handle: string;
13722
+ label: string;
13723
+ } | {
13724
+ provider: _nfcard_types.BookingProviderId;
13725
+ handle: string;
13726
+ label?: undefined;
13727
+ } | undefined;
13643
13728
  } | undefined;
13644
13729
  quantity?: number | undefined;
13645
13730
  existingProfileId?: string | undefined;
@@ -13996,6 +14081,7 @@ declare const configurationUpdateSchema: z.ZodObject<{
13996
14081
  label?: string | undefined;
13997
14082
  }[] | undefined;
13998
14083
  tipJar?: unknown;
14084
+ booking?: unknown;
13999
14085
  } | undefined;
14000
14086
  quantity?: number | undefined;
14001
14087
  existingProfileId?: string | undefined;
@@ -14111,6 +14197,15 @@ declare const cardUpdateSchema: z.ZodObject<{
14111
14197
  handle: string;
14112
14198
  label?: undefined;
14113
14199
  } | undefined, unknown>>>>;
14200
+ booking: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodUnknown, {
14201
+ provider: _nfcard_types.BookingProviderId;
14202
+ handle: string;
14203
+ label: string;
14204
+ } | {
14205
+ provider: _nfcard_types.BookingProviderId;
14206
+ handle: string;
14207
+ label?: undefined;
14208
+ } | undefined, unknown>>>>;
14114
14209
  profilePhotoUrl: z.ZodOptional<z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>>;
14115
14210
  companyLogoUrl: z.ZodOptional<z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>>;
14116
14211
  }, "strip", z.ZodTypeAny, {
@@ -14159,6 +14254,15 @@ declare const cardUpdateSchema: z.ZodObject<{
14159
14254
  handle: string;
14160
14255
  label?: undefined;
14161
14256
  } | undefined;
14257
+ booking?: {
14258
+ provider: _nfcard_types.BookingProviderId;
14259
+ handle: string;
14260
+ label: string;
14261
+ } | {
14262
+ provider: _nfcard_types.BookingProviderId;
14263
+ handle: string;
14264
+ label?: undefined;
14265
+ } | undefined;
14162
14266
  }, {
14163
14267
  profilePhotoUrl?: string | undefined;
14164
14268
  companyLogoUrl?: string | undefined;
@@ -14197,6 +14301,7 @@ declare const cardUpdateSchema: z.ZodObject<{
14197
14301
  label?: string | undefined;
14198
14302
  }[] | undefined;
14199
14303
  tipJar?: unknown;
14304
+ booking?: unknown;
14200
14305
  }>>;
14201
14306
  status: z.ZodOptional<z.ZodEnum<["active", "suspended", "archived"]>>;
14202
14307
  }, "strip", z.ZodTypeAny, {
@@ -14247,6 +14352,15 @@ declare const cardUpdateSchema: z.ZodObject<{
14247
14352
  handle: string;
14248
14353
  label?: undefined;
14249
14354
  } | undefined;
14355
+ booking?: {
14356
+ provider: _nfcard_types.BookingProviderId;
14357
+ handle: string;
14358
+ label: string;
14359
+ } | {
14360
+ provider: _nfcard_types.BookingProviderId;
14361
+ handle: string;
14362
+ label?: undefined;
14363
+ } | undefined;
14250
14364
  } | undefined;
14251
14365
  }, {
14252
14366
  status?: "active" | "suspended" | "archived" | undefined;
@@ -14288,6 +14402,7 @@ declare const cardUpdateSchema: z.ZodObject<{
14288
14402
  label?: string | undefined;
14289
14403
  }[] | undefined;
14290
14404
  tipJar?: unknown;
14405
+ booking?: unknown;
14291
14406
  } | undefined;
14292
14407
  }>;
14293
14408
  declare const adminCardCreateSchema: z.ZodObject<{
@@ -14476,6 +14591,15 @@ declare const adminCardCreateSchema: z.ZodObject<{
14476
14591
  handle: string;
14477
14592
  label?: undefined;
14478
14593
  } | undefined, unknown>>;
14594
+ booking: z.ZodOptional<z.ZodEffects<z.ZodUnknown, {
14595
+ provider: _nfcard_types.BookingProviderId;
14596
+ handle: string;
14597
+ label: string;
14598
+ } | {
14599
+ provider: _nfcard_types.BookingProviderId;
14600
+ handle: string;
14601
+ label?: undefined;
14602
+ } | undefined, unknown>>;
14479
14603
  }, "strip", z.ZodTypeAny, {
14480
14604
  fontKey: string;
14481
14605
  templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
@@ -14520,6 +14644,15 @@ declare const adminCardCreateSchema: z.ZodObject<{
14520
14644
  handle: string;
14521
14645
  label?: undefined;
14522
14646
  } | undefined;
14647
+ booking?: {
14648
+ provider: _nfcard_types.BookingProviderId;
14649
+ handle: string;
14650
+ label: string;
14651
+ } | {
14652
+ provider: _nfcard_types.BookingProviderId;
14653
+ handle: string;
14654
+ label?: undefined;
14655
+ } | undefined;
14523
14656
  }, {
14524
14657
  fontKey: string;
14525
14658
  templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
@@ -14556,6 +14689,7 @@ declare const adminCardCreateSchema: z.ZodObject<{
14556
14689
  label?: string | undefined;
14557
14690
  }[] | undefined;
14558
14691
  tipJar?: unknown;
14692
+ booking?: unknown;
14559
14693
  }>;
14560
14694
  physicalConfig: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodObject<{
14561
14695
  material: z.ZodEnum<["plastic", "3dprint_standard", "metal", "bamboo"]>;
@@ -17913,6 +18047,15 @@ declare const adminCardCreateSchema: z.ZodObject<{
17913
18047
  handle: string;
17914
18048
  label?: undefined;
17915
18049
  } | undefined;
18050
+ booking?: {
18051
+ provider: _nfcard_types.BookingProviderId;
18052
+ handle: string;
18053
+ label: string;
18054
+ } | {
18055
+ provider: _nfcard_types.BookingProviderId;
18056
+ handle: string;
18057
+ label?: undefined;
18058
+ } | undefined;
17916
18059
  };
17917
18060
  targetUserId: string;
17918
18061
  physicalConfig?: {
@@ -18267,6 +18410,7 @@ declare const adminCardCreateSchema: z.ZodObject<{
18267
18410
  label?: string | undefined;
18268
18411
  }[] | undefined;
18269
18412
  tipJar?: unknown;
18413
+ booking?: unknown;
18270
18414
  };
18271
18415
  targetUserId: string;
18272
18416
  physicalConfig?: {
@@ -18840,6 +18984,15 @@ declare const profileCreateSchema: z.ZodObject<{
18840
18984
  handle: string;
18841
18985
  label?: undefined;
18842
18986
  } | undefined, unknown>>;
18987
+ booking: z.ZodOptional<z.ZodEffects<z.ZodUnknown, {
18988
+ provider: _nfcard_types.BookingProviderId;
18989
+ handle: string;
18990
+ label: string;
18991
+ } | {
18992
+ provider: _nfcard_types.BookingProviderId;
18993
+ handle: string;
18994
+ label?: undefined;
18995
+ } | undefined, unknown>>;
18843
18996
  }, "strip", z.ZodTypeAny, {
18844
18997
  fontKey: string;
18845
18998
  templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
@@ -18884,6 +19037,15 @@ declare const profileCreateSchema: z.ZodObject<{
18884
19037
  handle: string;
18885
19038
  label?: undefined;
18886
19039
  } | undefined;
19040
+ booking?: {
19041
+ provider: _nfcard_types.BookingProviderId;
19042
+ handle: string;
19043
+ label: string;
19044
+ } | {
19045
+ provider: _nfcard_types.BookingProviderId;
19046
+ handle: string;
19047
+ label?: undefined;
19048
+ } | undefined;
18887
19049
  }, {
18888
19050
  fontKey: string;
18889
19051
  templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
@@ -18920,6 +19082,7 @@ declare const profileCreateSchema: z.ZodObject<{
18920
19082
  label?: string | undefined;
18921
19083
  }[] | undefined;
18922
19084
  tipJar?: unknown;
19085
+ booking?: unknown;
18923
19086
  }>;
18924
19087
  visibility: z.ZodDefault<z.ZodEnum<["public", "private", "link_only"]>>;
18925
19088
  accessPin: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
@@ -18993,6 +19156,15 @@ declare const profileCreateSchema: z.ZodObject<{
18993
19156
  handle: string;
18994
19157
  label?: undefined;
18995
19158
  } | undefined;
19159
+ booking?: {
19160
+ provider: _nfcard_types.BookingProviderId;
19161
+ handle: string;
19162
+ label: string;
19163
+ } | {
19164
+ provider: _nfcard_types.BookingProviderId;
19165
+ handle: string;
19166
+ label?: undefined;
19167
+ } | undefined;
18996
19168
  };
18997
19169
  label?: string | undefined;
18998
19170
  cardId?: string | undefined;
@@ -19059,6 +19231,7 @@ declare const profileCreateSchema: z.ZodObject<{
19059
19231
  label?: string | undefined;
19060
19232
  }[] | undefined;
19061
19233
  tipJar?: unknown;
19234
+ booking?: unknown;
19062
19235
  };
19063
19236
  label?: string | undefined;
19064
19237
  visibility?: "public" | "private" | "link_only" | undefined;
@@ -19260,6 +19433,15 @@ declare const signupWithProfileSchema: z.ZodObject<{
19260
19433
  handle: string;
19261
19434
  label?: undefined;
19262
19435
  } | undefined, unknown>>;
19436
+ booking: z.ZodOptional<z.ZodEffects<z.ZodUnknown, {
19437
+ provider: _nfcard_types.BookingProviderId;
19438
+ handle: string;
19439
+ label: string;
19440
+ } | {
19441
+ provider: _nfcard_types.BookingProviderId;
19442
+ handle: string;
19443
+ label?: undefined;
19444
+ } | undefined, unknown>>;
19263
19445
  }, "strip", z.ZodTypeAny, {
19264
19446
  fontKey: string;
19265
19447
  templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
@@ -19304,6 +19486,15 @@ declare const signupWithProfileSchema: z.ZodObject<{
19304
19486
  handle: string;
19305
19487
  label?: undefined;
19306
19488
  } | undefined;
19489
+ booking?: {
19490
+ provider: _nfcard_types.BookingProviderId;
19491
+ handle: string;
19492
+ label: string;
19493
+ } | {
19494
+ provider: _nfcard_types.BookingProviderId;
19495
+ handle: string;
19496
+ label?: undefined;
19497
+ } | undefined;
19307
19498
  }, {
19308
19499
  fontKey: string;
19309
19500
  templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
@@ -19340,6 +19531,7 @@ declare const signupWithProfileSchema: z.ZodObject<{
19340
19531
  label?: string | undefined;
19341
19532
  }[] | undefined;
19342
19533
  tipJar?: unknown;
19534
+ booking?: unknown;
19343
19535
  }>;
19344
19536
  }, "strip", z.ZodTypeAny, {
19345
19537
  email: string;
@@ -19411,6 +19603,15 @@ declare const signupWithProfileSchema: z.ZodObject<{
19411
19603
  handle: string;
19412
19604
  label?: undefined;
19413
19605
  } | undefined;
19606
+ booking?: {
19607
+ provider: _nfcard_types.BookingProviderId;
19608
+ handle: string;
19609
+ label: string;
19610
+ } | {
19611
+ provider: _nfcard_types.BookingProviderId;
19612
+ handle: string;
19613
+ label?: undefined;
19614
+ } | undefined;
19414
19615
  };
19415
19616
  password: string;
19416
19617
  acceptedTerms: true;
@@ -19481,6 +19682,7 @@ declare const signupWithProfileSchema: z.ZodObject<{
19481
19682
  label?: string | undefined;
19482
19683
  }[] | undefined;
19483
19684
  tipJar?: unknown;
19685
+ booking?: unknown;
19484
19686
  };
19485
19687
  password: string;
19486
19688
  acceptedTerms: true;
@@ -19678,6 +19880,15 @@ declare const profileUpdateSchema: z.ZodObject<{
19678
19880
  handle: string;
19679
19881
  label?: undefined;
19680
19882
  } | undefined, unknown>>>>;
19883
+ booking: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodUnknown, {
19884
+ provider: _nfcard_types.BookingProviderId;
19885
+ handle: string;
19886
+ label: string;
19887
+ } | {
19888
+ provider: _nfcard_types.BookingProviderId;
19889
+ handle: string;
19890
+ label?: undefined;
19891
+ } | undefined, unknown>>>>;
19681
19892
  profilePhotoUrl: z.ZodOptional<z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>>;
19682
19893
  companyLogoUrl: z.ZodOptional<z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>>;
19683
19894
  }, "strip", z.ZodTypeAny, {
@@ -19726,6 +19937,15 @@ declare const profileUpdateSchema: z.ZodObject<{
19726
19937
  handle: string;
19727
19938
  label?: undefined;
19728
19939
  } | undefined;
19940
+ booking?: {
19941
+ provider: _nfcard_types.BookingProviderId;
19942
+ handle: string;
19943
+ label: string;
19944
+ } | {
19945
+ provider: _nfcard_types.BookingProviderId;
19946
+ handle: string;
19947
+ label?: undefined;
19948
+ } | undefined;
19729
19949
  }, {
19730
19950
  profilePhotoUrl?: string | undefined;
19731
19951
  companyLogoUrl?: string | undefined;
@@ -19764,6 +19984,7 @@ declare const profileUpdateSchema: z.ZodObject<{
19764
19984
  label?: string | undefined;
19765
19985
  }[] | undefined;
19766
19986
  tipJar?: unknown;
19987
+ booking?: unknown;
19767
19988
  }>>;
19768
19989
  visibility: z.ZodOptional<z.ZodEnum<["public", "private", "link_only"]>>;
19769
19990
  accessPin: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
@@ -19840,6 +20061,15 @@ declare const profileUpdateSchema: z.ZodObject<{
19840
20061
  handle: string;
19841
20062
  label?: undefined;
19842
20063
  } | undefined;
20064
+ booking?: {
20065
+ provider: _nfcard_types.BookingProviderId;
20066
+ handle: string;
20067
+ label: string;
20068
+ } | {
20069
+ provider: _nfcard_types.BookingProviderId;
20070
+ handle: string;
20071
+ label?: undefined;
20072
+ } | undefined;
19843
20073
  } | undefined;
19844
20074
  icon?: string | undefined;
19845
20075
  accessPin?: string | undefined;
@@ -19908,6 +20138,7 @@ declare const profileUpdateSchema: z.ZodObject<{
19908
20138
  label?: string | undefined;
19909
20139
  }[] | undefined;
19910
20140
  tipJar?: unknown;
20141
+ booking?: unknown;
19911
20142
  } | undefined;
19912
20143
  icon?: string | undefined;
19913
20144
  accessPin?: string | undefined;
@@ -20056,4 +20287,4 @@ declare function validatePhysicalConfig(data: unknown): ValidationResult<z.infer
20056
20287
  declare function validateDigitalConfig(data: unknown): ValidationResult<z.infer<typeof digitalConfigSchema>>;
20057
20288
  declare function validateConfiguration(data: unknown): ValidationResult<z.infer<typeof configurationCreateSchema>>;
20058
20289
 
20059
- export { ADVANCE_FALLBACK_EM, CARD_H_MM, CARD_W_MM, CHIP_RADIUS_MM, CHIP_SCALE_FLOOR, type ChipAxis, EDGE_MARGIN_MM, EMPTY_TEXT_FLOOR_EM, ITALIC_OVERHANG_EM, MAX_CTA_BUTTONS, MIN_WALL_MM, NFC_COIL_DIAMETER_MM, NFC_RADIAL_CLEARANCE_MM, type PrintabilityCtx, type Pt, QR_MATRIX_CELLS, QR_MIN_SIZE_MM, QR_MODULE_MIN_MM, TEXT_LINE_FACTOR_EM, TEXT_MIN_EM_MM, type ValidationResult, type Violation, adminCardCreateSchema, cardAssetSchema, cardDesignMaterialSchema, cardDesignPatternSchema, cardDesignSchema, cardElementSchema, cardElementsSchema, cardProfileUpdateSchema, cardUpdateSchema, chipAnchorToMm, chipPlacementMaxXY, comboIdSchema, configurationCreateSchema, configurationUpdateSchema, contactDetailTogglesSchema, contactExchangeSchema, cornersOnCard, createOrderSchema, ctaButtonSchema, ctaButtonsSchema, digitalConfigSchema, digitalVisibilitySchema, elementPrintability, elementTransformSchema, entrySourceSchema, footprintOf, hubConfigSchema, hubProfilesUpdateSchema, isFiniteTransform, materialSchema, mmToNearestChipAnchor, obbCorners, patternFamilySchema, physicalConfigSchema, physicalContentOverridesSchema, profileAccessTokenCreateSchema, profileCreateSchema, profilePinVerifySchema, profileUpdateSchema, profileUserDataSchema, profileVisibilitySchema, sanitizeHttpUrl, sanitizeText, signupWithProfileSchema, socialLinksSchema, socialOverridesSchema, textAdvanceEm, tipJarSchema, userDataSchema, validateConfiguration, validateDigitalConfig, validatePhysicalConfig, validateUserData, webAddressSchema };
20290
+ export { ADVANCE_FALLBACK_EM, CARD_H_MM, CARD_W_MM, CHIP_RADIUS_MM, CHIP_SCALE_FLOOR, type ChipAxis, EDGE_MARGIN_MM, EMPTY_TEXT_FLOOR_EM, ITALIC_OVERHANG_EM, MAX_CTA_BUTTONS, MIN_WALL_MM, NFC_COIL_DIAMETER_MM, NFC_RADIAL_CLEARANCE_MM, type PrintabilityCtx, type Pt, QR_MATRIX_CELLS, QR_MIN_SIZE_MM, QR_MODULE_MIN_MM, TEXT_LINE_FACTOR_EM, TEXT_MIN_EM_MM, type ValidationResult, type Violation, adminCardCreateSchema, bookingSchema, cardAssetSchema, cardDesignMaterialSchema, cardDesignPatternSchema, cardDesignSchema, cardElementSchema, cardElementsSchema, cardProfileUpdateSchema, cardUpdateSchema, chipAnchorToMm, chipPlacementMaxXY, comboIdSchema, configurationCreateSchema, configurationUpdateSchema, contactDetailTogglesSchema, contactExchangeSchema, cornersOnCard, createOrderSchema, ctaButtonSchema, ctaButtonsSchema, digitalConfigSchema, digitalVisibilitySchema, elementPrintability, elementTransformSchema, entrySourceSchema, footprintOf, hubConfigSchema, hubProfilesUpdateSchema, isFiniteTransform, materialSchema, mmToNearestChipAnchor, obbCorners, patternFamilySchema, physicalConfigSchema, physicalContentOverridesSchema, profileAccessTokenCreateSchema, profileCreateSchema, profilePinVerifySchema, profileUpdateSchema, profileUserDataSchema, profileVisibilitySchema, sanitizeHttpUrl, sanitizeText, signupWithProfileSchema, socialLinksSchema, socialOverridesSchema, textAdvanceEm, tipJarSchema, userDataSchema, validateConfiguration, validateDigitalConfig, validatePhysicalConfig, validateUserData, webAddressSchema };
package/dist/index.js CHANGED
@@ -1,6 +1,11 @@
1
1
  // src/index.ts
2
2
  import { z } from "zod";
3
- import { isTipProviderId, normalizeTipHandle } from "@nfcard/types";
3
+ import {
4
+ isTipProviderId,
5
+ normalizeTipHandle,
6
+ isBookingProviderId,
7
+ normalizeBookingHandle
8
+ } from "@nfcard/types";
4
9
 
5
10
  // src/printability.ts
6
11
  var CARD_W_MM = 85.6;
@@ -745,6 +750,15 @@ var tipJarSchema = z.unknown().transform((raw) => {
745
750
  const label = typeof rec.label === "string" ? sanitizeText(rec.label, 40) : "";
746
751
  return label ? { provider: rec.provider, handle, label } : { provider: rec.provider, handle };
747
752
  });
753
+ var bookingSchema = z.unknown().transform((raw) => {
754
+ if (!raw || typeof raw !== "object") return void 0;
755
+ const rec = raw;
756
+ if (!isBookingProviderId(rec.provider)) return void 0;
757
+ const handle = normalizeBookingHandle(rec.provider, rec.handle);
758
+ if (!handle) return void 0;
759
+ const label = typeof rec.label === "string" ? sanitizeText(rec.label, 40) : "";
760
+ return label ? { provider: rec.provider, handle, label } : { provider: rec.provider, handle };
761
+ });
748
762
  var digitalConfigSchema = z.object({
749
763
  templateId: z.enum(["minimal", "bold", "card", "aurora", "classic", "spotlight", "marquee", "riso"]),
750
764
  accentColor: z.string().regex(/^#[0-9A-Fa-f]{6}$/),
@@ -764,7 +778,8 @@ var digitalConfigSchema = z.object({
764
778
  // public renderer additionally gates them on the owner's tier (free →
765
779
  // none). Optional, so existing profiles/configs validate unchanged.
766
780
  ctaButtons: ctaButtonsSchema.optional(),
767
- tipJar: tipJarSchema.optional()
781
+ tipJar: tipJarSchema.optional(),
782
+ booking: bookingSchema.optional()
768
783
  });
769
784
  var entrySourceSchema = z.object({
770
785
  output: z.enum(["with-card", "digital-only"]).optional(),
@@ -976,6 +991,7 @@ export {
976
991
  TEXT_LINE_FACTOR_EM,
977
992
  TEXT_MIN_EM_MM,
978
993
  adminCardCreateSchema,
994
+ bookingSchema,
979
995
  cardAssetSchema,
980
996
  cardDesignMaterialSchema,
981
997
  cardDesignPatternSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nfcard/validation",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "description": "Shared Zod validation schemas for the NFCard product family.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -17,7 +17,7 @@
17
17
  ],
18
18
  "dependencies": {
19
19
  "zod": "^3.24.0",
20
- "@nfcard/types": "0.14.0"
20
+ "@nfcard/types": "0.15.0"
21
21
  },
22
22
  "devDependencies": {
23
23
  "tsup": "^8.0.0"
@@ -0,0 +1,85 @@
1
+ import { describe, expect, it } from 'vitest'
2
+ import { bookingSchema, digitalConfigSchema } from './index'
3
+
4
+ const baseConfig = {
5
+ templateId: 'classic' as const,
6
+ accentColor: '#123456',
7
+ fontKey: 'inter',
8
+ showAvatar: true,
9
+ }
10
+
11
+ describe('bookingSchema', () => {
12
+ it('accepts a valid provider + handle and stores only { provider, handle }', () => {
13
+ expect(bookingSchema.parse({ provider: 'salonic', handle: 'kiss-fodraszat' })).toEqual({
14
+ provider: 'salonic',
15
+ handle: 'kiss-fodraszat',
16
+ })
17
+ })
18
+
19
+ it('normalizes a pasted booking-page URL down to the subdomain handle', () => {
20
+ expect(
21
+ bookingSchema.parse({
22
+ provider: 'salonic',
23
+ handle: 'https://kiss-fodraszat.salonic.hu/booking?x=1',
24
+ }),
25
+ ).toEqual({ provider: 'salonic', handle: 'kiss-fodraszat' })
26
+ })
27
+
28
+ it('lowercases the handle', () => {
29
+ expect(bookingSchema.parse({ provider: 'reservio', handle: 'HighBrow' })).toEqual({
30
+ provider: 'reservio',
31
+ handle: 'highbrow',
32
+ })
33
+ })
34
+
35
+ it('keeps a sanitized custom label, capped at 40 chars', () => {
36
+ const out = bookingSchema.parse({
37
+ provider: 'salonic',
38
+ handle: 'kiss-fodraszat',
39
+ label: '<b>Foglalj</b> ' + 'x'.repeat(60),
40
+ })
41
+ expect(out?.provider).toBe('salonic')
42
+ expect(out?.label).not.toContain('<')
43
+ expect((out?.label ?? '').length).toBeLessThanOrEqual(40)
44
+ })
45
+
46
+ it('drops everything invalid to undefined instead of throwing (never 400)', () => {
47
+ expect(bookingSchema.parse(undefined)).toBeUndefined()
48
+ expect(bookingSchema.parse(null)).toBeUndefined()
49
+ expect(bookingSchema.parse('nonsense')).toBeUndefined()
50
+ expect(bookingSchema.parse({})).toBeUndefined()
51
+ expect(bookingSchema.parse({ provider: 'booksy', handle: 'szalon' })).toBeUndefined()
52
+ expect(bookingSchema.parse({ provider: 'salonic', handle: 'www' })).toBeUndefined() // reserved
53
+ expect(bookingSchema.parse({ provider: 'salonic', handle: '-bad' })).toBeUndefined() // bad DNS label
54
+ expect(
55
+ bookingSchema.parse({ provider: 'salonic', handle: 'https://evil.com/szalon' }),
56
+ ).toBeUndefined()
57
+ expect(
58
+ bookingSchema.parse({ provider: 'salonic', handle: 'javascript:alert(1)' }),
59
+ ).toBeUndefined()
60
+ expect(bookingSchema.parse({ provider: 'salonic', handle: 123 })).toBeUndefined()
61
+ })
62
+ })
63
+
64
+ describe('digitalConfigSchema — booking field', () => {
65
+ it('round-trips a valid booking', () => {
66
+ const parsed = digitalConfigSchema.parse({
67
+ ...baseConfig,
68
+ booking: { provider: 'salonic', handle: 'kiss-fodraszat' },
69
+ })
70
+ expect(parsed.booking).toEqual({ provider: 'salonic', handle: 'kiss-fodraszat' })
71
+ })
72
+
73
+ it('drops an invalid booking without failing the whole config save', () => {
74
+ const parsed = digitalConfigSchema.parse({
75
+ ...baseConfig,
76
+ booking: { provider: 'salonic', handle: 'https://evil.com/x' },
77
+ })
78
+ expect(parsed.booking).toBeUndefined()
79
+ })
80
+
81
+ it('is optional — a config without a booking parses fine', () => {
82
+ const parsed = digitalConfigSchema.parse(baseConfig)
83
+ expect(parsed.booking).toBeUndefined()
84
+ })
85
+ })
package/src/index.ts CHANGED
Binary file