@nfcard/validation 0.13.0 → 0.15.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
@@ -5143,7 +5143,7 @@ declare const ctaButtonsSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
5143
5143
  label?: string | undefined;
5144
5144
  }[]>;
5145
5145
  declare const digitalConfigSchema: z.ZodObject<{
5146
- templateId: z.ZodEnum<["minimal", "bold", "card", "aurora"]>;
5146
+ templateId: z.ZodEnum<["minimal", "bold", "card", "aurora", "classic", "spotlight", "marquee", "riso"]>;
5147
5147
  accentColor: z.ZodString;
5148
5148
  primaryColor: z.ZodOptional<z.ZodString>;
5149
5149
  secondaryColor: z.ZodOptional<z.ZodString>;
@@ -5231,7 +5231,7 @@ declare const digitalConfigSchema: z.ZodObject<{
5231
5231
  }[]>>;
5232
5232
  }, "strip", z.ZodTypeAny, {
5233
5233
  fontKey: string;
5234
- templateId: "minimal" | "bold" | "card" | "aurora";
5234
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
5235
5235
  accentColor: string;
5236
5236
  showAvatar: boolean;
5237
5237
  primaryColor?: string | undefined;
@@ -5266,7 +5266,7 @@ declare const digitalConfigSchema: z.ZodObject<{
5266
5266
  }[] | undefined;
5267
5267
  }, {
5268
5268
  fontKey: string;
5269
- templateId: "minimal" | "bold" | "card" | "aurora";
5269
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
5270
5270
  accentColor: string;
5271
5271
  showAvatar: boolean;
5272
5272
  primaryColor?: string | undefined;
@@ -5300,6 +5300,28 @@ declare const digitalConfigSchema: z.ZodObject<{
5300
5300
  label?: string | undefined;
5301
5301
  }[] | undefined;
5302
5302
  }>;
5303
+ declare const entrySourceSchema: z.ZodObject<{
5304
+ output: z.ZodOptional<z.ZodEnum<["with-card", "digital-only"]>>;
5305
+ entryFlow: z.ZodOptional<z.ZodEnum<["order", "try"]>>;
5306
+ ref: z.ZodOptional<z.ZodString>;
5307
+ path: z.ZodOptional<z.ZodString>;
5308
+ referrer: z.ZodOptional<z.ZodString>;
5309
+ utm: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, Record<string, string>>>;
5310
+ }, "strict", z.ZodTypeAny, {
5311
+ path?: string | undefined;
5312
+ output?: "with-card" | "digital-only" | undefined;
5313
+ entryFlow?: "order" | "try" | undefined;
5314
+ ref?: string | undefined;
5315
+ referrer?: string | undefined;
5316
+ utm?: Record<string, string> | undefined;
5317
+ }, {
5318
+ path?: string | undefined;
5319
+ output?: "with-card" | "digital-only" | undefined;
5320
+ entryFlow?: "order" | "try" | undefined;
5321
+ ref?: string | undefined;
5322
+ referrer?: string | undefined;
5323
+ utm?: Record<string, string> | undefined;
5324
+ }>;
5303
5325
  declare const configurationCreateSchema: z.ZodObject<{
5304
5326
  sessionId: z.ZodString;
5305
5327
  userData: z.ZodObject<{
@@ -8678,7 +8700,7 @@ declare const configurationCreateSchema: z.ZodObject<{
8678
8700
  } | undefined;
8679
8701
  }>;
8680
8702
  digitalConfig: z.ZodObject<{
8681
- templateId: z.ZodEnum<["minimal", "bold", "card", "aurora"]>;
8703
+ templateId: z.ZodEnum<["minimal", "bold", "card", "aurora", "classic", "spotlight", "marquee", "riso"]>;
8682
8704
  accentColor: z.ZodString;
8683
8705
  primaryColor: z.ZodOptional<z.ZodString>;
8684
8706
  secondaryColor: z.ZodOptional<z.ZodString>;
@@ -8766,7 +8788,7 @@ declare const configurationCreateSchema: z.ZodObject<{
8766
8788
  }[]>>;
8767
8789
  }, "strip", z.ZodTypeAny, {
8768
8790
  fontKey: string;
8769
- templateId: "minimal" | "bold" | "card" | "aurora";
8791
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
8770
8792
  accentColor: string;
8771
8793
  showAvatar: boolean;
8772
8794
  primaryColor?: string | undefined;
@@ -8801,7 +8823,7 @@ declare const configurationCreateSchema: z.ZodObject<{
8801
8823
  }[] | undefined;
8802
8824
  }, {
8803
8825
  fontKey: string;
8804
- templateId: "minimal" | "bold" | "card" | "aurora";
8826
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
8805
8827
  accentColor: string;
8806
8828
  showAvatar: boolean;
8807
8829
  primaryColor?: string | undefined;
@@ -8838,6 +8860,28 @@ declare const configurationCreateSchema: z.ZodObject<{
8838
8860
  quantity: z.ZodDefault<z.ZodNumber>;
8839
8861
  existingProfileId: z.ZodOptional<z.ZodString>;
8840
8862
  physicalTemplateId: z.ZodOptional<z.ZodString>;
8863
+ entrySource: z.ZodOptional<z.ZodObject<{
8864
+ output: z.ZodOptional<z.ZodEnum<["with-card", "digital-only"]>>;
8865
+ entryFlow: z.ZodOptional<z.ZodEnum<["order", "try"]>>;
8866
+ ref: z.ZodOptional<z.ZodString>;
8867
+ path: z.ZodOptional<z.ZodString>;
8868
+ referrer: z.ZodOptional<z.ZodString>;
8869
+ utm: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, Record<string, string>>>;
8870
+ }, "strict", z.ZodTypeAny, {
8871
+ path?: string | undefined;
8872
+ output?: "with-card" | "digital-only" | undefined;
8873
+ entryFlow?: "order" | "try" | undefined;
8874
+ ref?: string | undefined;
8875
+ referrer?: string | undefined;
8876
+ utm?: Record<string, string> | undefined;
8877
+ }, {
8878
+ path?: string | undefined;
8879
+ output?: "with-card" | "digital-only" | undefined;
8880
+ entryFlow?: "order" | "try" | undefined;
8881
+ ref?: string | undefined;
8882
+ referrer?: string | undefined;
8883
+ utm?: Record<string, string> | undefined;
8884
+ }>>;
8841
8885
  }, "strip", z.ZodTypeAny, {
8842
8886
  sessionId: string;
8843
8887
  userData: {
@@ -9157,7 +9201,7 @@ declare const configurationCreateSchema: z.ZodObject<{
9157
9201
  };
9158
9202
  digitalConfig: {
9159
9203
  fontKey: string;
9160
- templateId: "minimal" | "bold" | "card" | "aurora";
9204
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
9161
9205
  accentColor: string;
9162
9206
  showAvatar: boolean;
9163
9207
  primaryColor?: string | undefined;
@@ -9194,6 +9238,14 @@ declare const configurationCreateSchema: z.ZodObject<{
9194
9238
  quantity: number;
9195
9239
  existingProfileId?: string | undefined;
9196
9240
  physicalTemplateId?: string | undefined;
9241
+ entrySource?: {
9242
+ path?: string | undefined;
9243
+ output?: "with-card" | "digital-only" | undefined;
9244
+ entryFlow?: "order" | "try" | undefined;
9245
+ ref?: string | undefined;
9246
+ referrer?: string | undefined;
9247
+ utm?: Record<string, string> | undefined;
9248
+ } | undefined;
9197
9249
  }, {
9198
9250
  sessionId: string;
9199
9251
  userData: {
@@ -9513,7 +9565,7 @@ declare const configurationCreateSchema: z.ZodObject<{
9513
9565
  };
9514
9566
  digitalConfig: {
9515
9567
  fontKey: string;
9516
- templateId: "minimal" | "bold" | "card" | "aurora";
9568
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
9517
9569
  accentColor: string;
9518
9570
  showAvatar: boolean;
9519
9571
  primaryColor?: string | undefined;
@@ -9550,6 +9602,14 @@ declare const configurationCreateSchema: z.ZodObject<{
9550
9602
  quantity?: number | undefined;
9551
9603
  existingProfileId?: string | undefined;
9552
9604
  physicalTemplateId?: string | undefined;
9605
+ entrySource?: {
9606
+ path?: string | undefined;
9607
+ output?: "with-card" | "digital-only" | undefined;
9608
+ entryFlow?: "order" | "try" | undefined;
9609
+ ref?: string | undefined;
9610
+ referrer?: string | undefined;
9611
+ utm?: Record<string, string> | undefined;
9612
+ } | undefined;
9553
9613
  }>;
9554
9614
  declare const configurationUpdateSchema: z.ZodObject<{
9555
9615
  userData: z.ZodOptional<z.ZodObject<{
@@ -12928,7 +12988,7 @@ declare const configurationUpdateSchema: z.ZodObject<{
12928
12988
  } | undefined;
12929
12989
  }>>;
12930
12990
  digitalConfig: z.ZodOptional<z.ZodObject<{
12931
- templateId: z.ZodEnum<["minimal", "bold", "card", "aurora"]>;
12991
+ templateId: z.ZodEnum<["minimal", "bold", "card", "aurora", "classic", "spotlight", "marquee", "riso"]>;
12932
12992
  accentColor: z.ZodString;
12933
12993
  primaryColor: z.ZodOptional<z.ZodString>;
12934
12994
  secondaryColor: z.ZodOptional<z.ZodString>;
@@ -13016,7 +13076,7 @@ declare const configurationUpdateSchema: z.ZodObject<{
13016
13076
  }[]>>;
13017
13077
  }, "strip", z.ZodTypeAny, {
13018
13078
  fontKey: string;
13019
- templateId: "minimal" | "bold" | "card" | "aurora";
13079
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
13020
13080
  accentColor: string;
13021
13081
  showAvatar: boolean;
13022
13082
  primaryColor?: string | undefined;
@@ -13051,7 +13111,7 @@ declare const configurationUpdateSchema: z.ZodObject<{
13051
13111
  }[] | undefined;
13052
13112
  }, {
13053
13113
  fontKey: string;
13054
- templateId: "minimal" | "bold" | "card" | "aurora";
13114
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
13055
13115
  accentColor: string;
13056
13116
  showAvatar: boolean;
13057
13117
  primaryColor?: string | undefined;
@@ -13406,7 +13466,7 @@ declare const configurationUpdateSchema: z.ZodObject<{
13406
13466
  } | undefined;
13407
13467
  digitalConfig?: {
13408
13468
  fontKey: string;
13409
- templateId: "minimal" | "bold" | "card" | "aurora";
13469
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
13410
13470
  accentColor: string;
13411
13471
  showAvatar: boolean;
13412
13472
  primaryColor?: string | undefined;
@@ -13761,7 +13821,7 @@ declare const configurationUpdateSchema: z.ZodObject<{
13761
13821
  } | undefined;
13762
13822
  digitalConfig?: {
13763
13823
  fontKey: string;
13764
- templateId: "minimal" | "bold" | "card" | "aurora";
13824
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
13765
13825
  accentColor: string;
13766
13826
  showAvatar: boolean;
13767
13827
  primaryColor?: string | undefined;
@@ -13814,7 +13874,7 @@ declare const createOrderSchema: z.ZodObject<{
13814
13874
  }>;
13815
13875
  declare const cardUpdateSchema: z.ZodObject<{
13816
13876
  digitalConfigOverride: z.ZodOptional<z.ZodObject<{
13817
- templateId: z.ZodOptional<z.ZodOptional<z.ZodEnum<["minimal", "bold", "card", "aurora"]>>>;
13877
+ templateId: z.ZodOptional<z.ZodOptional<z.ZodEnum<["minimal", "bold", "card", "aurora", "classic", "spotlight", "marquee", "riso"]>>>;
13818
13878
  accentColor: z.ZodOptional<z.ZodOptional<z.ZodString>>;
13819
13879
  primaryColor: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodString>>>;
13820
13880
  secondaryColor: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodString>>>;
@@ -13906,7 +13966,7 @@ declare const cardUpdateSchema: z.ZodObject<{
13906
13966
  profilePhotoUrl?: string | undefined;
13907
13967
  companyLogoUrl?: string | undefined;
13908
13968
  fontKey?: string | undefined;
13909
- templateId?: "minimal" | "bold" | "card" | "aurora" | undefined;
13969
+ templateId?: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso" | undefined;
13910
13970
  accentColor?: string | undefined;
13911
13971
  primaryColor?: string | undefined;
13912
13972
  secondaryColor?: string | undefined;
@@ -13943,7 +14003,7 @@ declare const cardUpdateSchema: z.ZodObject<{
13943
14003
  profilePhotoUrl?: string | undefined;
13944
14004
  companyLogoUrl?: string | undefined;
13945
14005
  fontKey?: string | undefined;
13946
- templateId?: "minimal" | "bold" | "card" | "aurora" | undefined;
14006
+ templateId?: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso" | undefined;
13947
14007
  accentColor?: string | undefined;
13948
14008
  primaryColor?: string | undefined;
13949
14009
  secondaryColor?: string | undefined;
@@ -13984,7 +14044,7 @@ declare const cardUpdateSchema: z.ZodObject<{
13984
14044
  profilePhotoUrl?: string | undefined;
13985
14045
  companyLogoUrl?: string | undefined;
13986
14046
  fontKey?: string | undefined;
13987
- templateId?: "minimal" | "bold" | "card" | "aurora" | undefined;
14047
+ templateId?: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso" | undefined;
13988
14048
  accentColor?: string | undefined;
13989
14049
  primaryColor?: string | undefined;
13990
14050
  secondaryColor?: string | undefined;
@@ -14024,7 +14084,7 @@ declare const cardUpdateSchema: z.ZodObject<{
14024
14084
  profilePhotoUrl?: string | undefined;
14025
14085
  companyLogoUrl?: string | undefined;
14026
14086
  fontKey?: string | undefined;
14027
- templateId?: "minimal" | "bold" | "card" | "aurora" | undefined;
14087
+ templateId?: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso" | undefined;
14028
14088
  accentColor?: string | undefined;
14029
14089
  primaryColor?: string | undefined;
14030
14090
  secondaryColor?: string | undefined;
@@ -14150,7 +14210,7 @@ declare const adminCardCreateSchema: z.ZodObject<{
14150
14210
  } | undefined;
14151
14211
  }>;
14152
14212
  digitalConfig: z.ZodObject<{
14153
- templateId: z.ZodEnum<["minimal", "bold", "card", "aurora"]>;
14213
+ templateId: z.ZodEnum<["minimal", "bold", "card", "aurora", "classic", "spotlight", "marquee", "riso"]>;
14154
14214
  accentColor: z.ZodString;
14155
14215
  primaryColor: z.ZodOptional<z.ZodString>;
14156
14216
  secondaryColor: z.ZodOptional<z.ZodString>;
@@ -14238,7 +14298,7 @@ declare const adminCardCreateSchema: z.ZodObject<{
14238
14298
  }[]>>;
14239
14299
  }, "strip", z.ZodTypeAny, {
14240
14300
  fontKey: string;
14241
- templateId: "minimal" | "bold" | "card" | "aurora";
14301
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
14242
14302
  accentColor: string;
14243
14303
  showAvatar: boolean;
14244
14304
  primaryColor?: string | undefined;
@@ -14273,7 +14333,7 @@ declare const adminCardCreateSchema: z.ZodObject<{
14273
14333
  }[] | undefined;
14274
14334
  }, {
14275
14335
  fontKey: string;
14276
- templateId: "minimal" | "bold" | "card" | "aurora";
14336
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
14277
14337
  accentColor: string;
14278
14338
  showAvatar: boolean;
14279
14339
  primaryColor?: string | undefined;
@@ -17621,7 +17681,7 @@ declare const adminCardCreateSchema: z.ZodObject<{
17621
17681
  };
17622
17682
  digitalConfig: {
17623
17683
  fontKey: string;
17624
- templateId: "minimal" | "bold" | "card" | "aurora";
17684
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
17625
17685
  accentColor: string;
17626
17686
  showAvatar: boolean;
17627
17687
  primaryColor?: string | undefined;
@@ -17974,7 +18034,7 @@ declare const adminCardCreateSchema: z.ZodObject<{
17974
18034
  };
17975
18035
  digitalConfig: {
17976
18036
  fontKey: string;
17977
- templateId: "minimal" | "bold" | "card" | "aurora";
18037
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
17978
18038
  accentColor: string;
17979
18039
  showAvatar: boolean;
17980
18040
  primaryColor?: string | undefined;
@@ -18485,7 +18545,7 @@ declare const profileCreateSchema: z.ZodObject<{
18485
18545
  } | undefined;
18486
18546
  }>;
18487
18547
  digitalConfig: z.ZodObject<{
18488
- templateId: z.ZodEnum<["minimal", "bold", "card", "aurora"]>;
18548
+ templateId: z.ZodEnum<["minimal", "bold", "card", "aurora", "classic", "spotlight", "marquee", "riso"]>;
18489
18549
  accentColor: z.ZodString;
18490
18550
  primaryColor: z.ZodOptional<z.ZodString>;
18491
18551
  secondaryColor: z.ZodOptional<z.ZodString>;
@@ -18573,7 +18633,7 @@ declare const profileCreateSchema: z.ZodObject<{
18573
18633
  }[]>>;
18574
18634
  }, "strip", z.ZodTypeAny, {
18575
18635
  fontKey: string;
18576
- templateId: "minimal" | "bold" | "card" | "aurora";
18636
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
18577
18637
  accentColor: string;
18578
18638
  showAvatar: boolean;
18579
18639
  primaryColor?: string | undefined;
@@ -18608,7 +18668,7 @@ declare const profileCreateSchema: z.ZodObject<{
18608
18668
  }[] | undefined;
18609
18669
  }, {
18610
18670
  fontKey: string;
18611
- templateId: "minimal" | "bold" | "card" | "aurora";
18671
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
18612
18672
  accentColor: string;
18613
18673
  showAvatar: boolean;
18614
18674
  primaryColor?: string | undefined;
@@ -18672,7 +18732,7 @@ declare const profileCreateSchema: z.ZodObject<{
18672
18732
  };
18673
18733
  digitalConfig: {
18674
18734
  fontKey: string;
18675
- templateId: "minimal" | "bold" | "card" | "aurora";
18735
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
18676
18736
  accentColor: string;
18677
18737
  showAvatar: boolean;
18678
18738
  primaryColor?: string | undefined;
@@ -18737,7 +18797,7 @@ declare const profileCreateSchema: z.ZodObject<{
18737
18797
  };
18738
18798
  digitalConfig: {
18739
18799
  fontKey: string;
18740
- templateId: "minimal" | "bold" | "card" | "aurora";
18800
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
18741
18801
  accentColor: string;
18742
18802
  showAvatar: boolean;
18743
18803
  primaryColor?: string | undefined;
@@ -18876,7 +18936,7 @@ declare const signupWithProfileSchema: z.ZodObject<{
18876
18936
  } | undefined;
18877
18937
  }>;
18878
18938
  digitalConfig: z.ZodObject<{
18879
- templateId: z.ZodEnum<["minimal", "bold", "card", "aurora"]>;
18939
+ templateId: z.ZodEnum<["minimal", "bold", "card", "aurora", "classic", "spotlight", "marquee", "riso"]>;
18880
18940
  accentColor: z.ZodString;
18881
18941
  primaryColor: z.ZodOptional<z.ZodString>;
18882
18942
  secondaryColor: z.ZodOptional<z.ZodString>;
@@ -18964,7 +19024,7 @@ declare const signupWithProfileSchema: z.ZodObject<{
18964
19024
  }[]>>;
18965
19025
  }, "strip", z.ZodTypeAny, {
18966
19026
  fontKey: string;
18967
- templateId: "minimal" | "bold" | "card" | "aurora";
19027
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
18968
19028
  accentColor: string;
18969
19029
  showAvatar: boolean;
18970
19030
  primaryColor?: string | undefined;
@@ -18999,7 +19059,7 @@ declare const signupWithProfileSchema: z.ZodObject<{
18999
19059
  }[] | undefined;
19000
19060
  }, {
19001
19061
  fontKey: string;
19002
- templateId: "minimal" | "bold" | "card" | "aurora";
19062
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
19003
19063
  accentColor: string;
19004
19064
  showAvatar: boolean;
19005
19065
  primaryColor?: string | undefined;
@@ -19061,7 +19121,7 @@ declare const signupWithProfileSchema: z.ZodObject<{
19061
19121
  };
19062
19122
  digitalConfig: {
19063
19123
  fontKey: string;
19064
- templateId: "minimal" | "bold" | "card" | "aurora";
19124
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
19065
19125
  accentColor: string;
19066
19126
  showAvatar: boolean;
19067
19127
  primaryColor?: string | undefined;
@@ -19130,7 +19190,7 @@ declare const signupWithProfileSchema: z.ZodObject<{
19130
19190
  };
19131
19191
  digitalConfig: {
19132
19192
  fontKey: string;
19133
- templateId: "minimal" | "bold" | "card" | "aurora";
19193
+ templateId: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso";
19134
19194
  accentColor: string;
19135
19195
  showAvatar: boolean;
19136
19196
  primaryColor?: string | undefined;
@@ -19265,7 +19325,7 @@ declare const profileUpdateSchema: z.ZodObject<{
19265
19325
  } | undefined;
19266
19326
  }>>;
19267
19327
  digitalConfig: z.ZodOptional<z.ZodObject<{
19268
- templateId: z.ZodOptional<z.ZodOptional<z.ZodEnum<["minimal", "bold", "card", "aurora"]>>>;
19328
+ templateId: z.ZodOptional<z.ZodOptional<z.ZodEnum<["minimal", "bold", "card", "aurora", "classic", "spotlight", "marquee", "riso"]>>>;
19269
19329
  accentColor: z.ZodOptional<z.ZodOptional<z.ZodString>>;
19270
19330
  primaryColor: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodString>>>;
19271
19331
  secondaryColor: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodString>>>;
@@ -19357,7 +19417,7 @@ declare const profileUpdateSchema: z.ZodObject<{
19357
19417
  profilePhotoUrl?: string | undefined;
19358
19418
  companyLogoUrl?: string | undefined;
19359
19419
  fontKey?: string | undefined;
19360
- templateId?: "minimal" | "bold" | "card" | "aurora" | undefined;
19420
+ templateId?: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso" | undefined;
19361
19421
  accentColor?: string | undefined;
19362
19422
  primaryColor?: string | undefined;
19363
19423
  secondaryColor?: string | undefined;
@@ -19394,7 +19454,7 @@ declare const profileUpdateSchema: z.ZodObject<{
19394
19454
  profilePhotoUrl?: string | undefined;
19395
19455
  companyLogoUrl?: string | undefined;
19396
19456
  fontKey?: string | undefined;
19397
- templateId?: "minimal" | "bold" | "card" | "aurora" | undefined;
19457
+ templateId?: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso" | undefined;
19398
19458
  accentColor?: string | undefined;
19399
19459
  primaryColor?: string | undefined;
19400
19460
  secondaryColor?: string | undefined;
@@ -19461,7 +19521,7 @@ declare const profileUpdateSchema: z.ZodObject<{
19461
19521
  profilePhotoUrl?: string | undefined;
19462
19522
  companyLogoUrl?: string | undefined;
19463
19523
  fontKey?: string | undefined;
19464
- templateId?: "minimal" | "bold" | "card" | "aurora" | undefined;
19524
+ templateId?: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso" | undefined;
19465
19525
  accentColor?: string | undefined;
19466
19526
  primaryColor?: string | undefined;
19467
19527
  secondaryColor?: string | undefined;
@@ -19528,7 +19588,7 @@ declare const profileUpdateSchema: z.ZodObject<{
19528
19588
  profilePhotoUrl?: string | undefined;
19529
19589
  companyLogoUrl?: string | undefined;
19530
19590
  fontKey?: string | undefined;
19531
- templateId?: "minimal" | "bold" | "card" | "aurora" | undefined;
19591
+ templateId?: "minimal" | "bold" | "card" | "aurora" | "classic" | "spotlight" | "marquee" | "riso" | undefined;
19532
19592
  accentColor?: string | undefined;
19533
19593
  primaryColor?: string | undefined;
19534
19594
  secondaryColor?: string | undefined;
@@ -19709,4 +19769,4 @@ declare function validatePhysicalConfig(data: unknown): ValidationResult<z.infer
19709
19769
  declare function validateDigitalConfig(data: unknown): ValidationResult<z.infer<typeof digitalConfigSchema>>;
19710
19770
  declare function validateConfiguration(data: unknown): ValidationResult<z.infer<typeof configurationCreateSchema>>;
19711
19771
 
19712
- export { CARD_H_MM, CARD_W_MM, CHIP_RADIUS_MM, CHIP_SCALE_FLOOR, type ChipAxis, EDGE_MARGIN_MM, 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_MIN_EM_MM, type ValidationResult, type Violation, adminCardCreateSchema, cardAssetSchema, cardDesignMaterialSchema, cardDesignPatternSchema, cardDesignSchema, cardElementSchema, cardElementsSchema, cardProfileUpdateSchema, cardUpdateSchema, chipAnchorToMm, comboIdSchema, configurationCreateSchema, configurationUpdateSchema, contactDetailTogglesSchema, contactExchangeSchema, cornersOnCard, createOrderSchema, ctaButtonSchema, ctaButtonsSchema, digitalConfigSchema, digitalVisibilitySchema, elementPrintability, elementTransformSchema, hubConfigSchema, hubProfilesUpdateSchema, isFiniteTransform, materialSchema, mmToNearestChipAnchor, obbCorners, patternFamilySchema, physicalConfigSchema, physicalContentOverridesSchema, profileAccessTokenCreateSchema, profileCreateSchema, profilePinVerifySchema, profileUpdateSchema, profileUserDataSchema, profileVisibilitySchema, sanitizeHttpUrl, sanitizeText, signupWithProfileSchema, socialLinksSchema, socialOverridesSchema, userDataSchema, validateConfiguration, validateDigitalConfig, validatePhysicalConfig, validateUserData, webAddressSchema };
19772
+ export { CARD_H_MM, CARD_W_MM, CHIP_RADIUS_MM, CHIP_SCALE_FLOOR, type ChipAxis, EDGE_MARGIN_MM, 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_MIN_EM_MM, type ValidationResult, type Violation, adminCardCreateSchema, cardAssetSchema, cardDesignMaterialSchema, cardDesignPatternSchema, cardDesignSchema, cardElementSchema, cardElementsSchema, cardProfileUpdateSchema, cardUpdateSchema, chipAnchorToMm, comboIdSchema, configurationCreateSchema, configurationUpdateSchema, contactDetailTogglesSchema, contactExchangeSchema, cornersOnCard, createOrderSchema, ctaButtonSchema, ctaButtonsSchema, digitalConfigSchema, digitalVisibilitySchema, elementPrintability, elementTransformSchema, entrySourceSchema, hubConfigSchema, hubProfilesUpdateSchema, isFiniteTransform, materialSchema, mmToNearestChipAnchor, obbCorners, patternFamilySchema, physicalConfigSchema, physicalContentOverridesSchema, profileAccessTokenCreateSchema, profileCreateSchema, profilePinVerifySchema, profileUpdateSchema, profileUserDataSchema, profileVisibilitySchema, sanitizeHttpUrl, sanitizeText, signupWithProfileSchema, socialLinksSchema, socialOverridesSchema, userDataSchema, validateConfiguration, validateDigitalConfig, validatePhysicalConfig, validateUserData, webAddressSchema };
package/dist/index.js CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nfcard/validation",
3
- "version": "0.13.0",
3
+ "version": "0.15.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.12.0"
20
+ "@nfcard/types": "0.13.0"
21
21
  },
22
22
  "devDependencies": {
23
23
  "tsup": "^8.0.0"
package/src/index.test.ts CHANGED
@@ -4,6 +4,7 @@ import {
4
4
  cardElementsSchema,
5
5
  comboIdSchema,
6
6
  configurationCreateSchema,
7
+ configurationUpdateSchema,
7
8
  contactExchangeSchema,
8
9
  createOrderSchema,
9
10
  ctaButtonsSchema,
@@ -549,6 +550,13 @@ describe('digitalConfigSchema / validateDigitalConfig', () => {
549
550
  expect(r.success).toBe(true);
550
551
  });
551
552
 
553
+ it('accepts the new family templateIds (classic/spotlight/marquee/riso)', () => {
554
+ for (const templateId of ['classic', 'spotlight', 'marquee', 'riso']) {
555
+ const r = validateDigitalConfig({ ...validDigitalConfig, templateId });
556
+ expect(r.success).toBe(true);
557
+ }
558
+ });
559
+
552
560
  it('rejects an empty fontKey', () => {
553
561
  const r = validateDigitalConfig({ ...validDigitalConfig, fontKey: '' });
554
562
  expect(r.success).toBe(false);
@@ -966,3 +974,74 @@ describe('physicalConfig.cardDesign (nested, not stripped)', () => {
966
974
  expect(physicalConfigSchema.safeParse(validPhysicalConfig).success).toBe(true);
967
975
  });
968
976
  });
977
+
978
+ // -- entrySourceSchema (NFCARD-392) --------------------------------
979
+
980
+ describe('entrySourceSchema on configurationCreateSchema', () => {
981
+ const base = {
982
+ sessionId: '550e8400-e29b-41d4-a716-446655440000',
983
+ userData: validUserData,
984
+ physicalConfig: validPhysicalConfig,
985
+ digitalConfig: validDigitalConfig,
986
+ };
987
+
988
+ it('accepts a full entry-attribution blob', () => {
989
+ const r = configurationCreateSchema.safeParse({
990
+ ...base,
991
+ entrySource: {
992
+ output: 'with-card',
993
+ entryFlow: 'order',
994
+ ref: 'PROMO24',
995
+ path: '/configurator',
996
+ referrer: 'google.com',
997
+ utm: { utm_source: 'ads', utm_campaign: 'launch' },
998
+ },
999
+ });
1000
+ expect(r.success).toBe(true);
1001
+ if (r.success) expect(r.data.entrySource?.output).toBe('with-card');
1002
+ });
1003
+
1004
+ it('is optional — older clients omit it entirely', () => {
1005
+ const r = configurationCreateSchema.safeParse(base);
1006
+ expect(r.success).toBe(true);
1007
+ if (r.success) expect(r.data.entrySource).toBeUndefined();
1008
+ });
1009
+
1010
+ it('rejects unknown keys (strict) and out-of-enum values', () => {
1011
+ expect(
1012
+ configurationCreateSchema.safeParse({
1013
+ ...base,
1014
+ entrySource: { output: 'with-card', evil: 'payload' },
1015
+ }).success,
1016
+ ).toBe(false);
1017
+ expect(
1018
+ configurationCreateSchema.safeParse({
1019
+ ...base,
1020
+ entrySource: { output: 'both-please' },
1021
+ }).success,
1022
+ ).toBe(false);
1023
+ });
1024
+
1025
+ it('bounds the utm map (max 10 entries, capped value length)', () => {
1026
+ const utm: Record<string, string> = {};
1027
+ for (let i = 0; i < 11; i++) utm['k' + i] = 'v';
1028
+ expect(
1029
+ configurationCreateSchema.safeParse({ ...base, entrySource: { utm } }).success,
1030
+ ).toBe(false);
1031
+ expect(
1032
+ configurationCreateSchema.safeParse({
1033
+ ...base,
1034
+ entrySource: { referrer: 'x'.repeat(300) },
1035
+ }).success,
1036
+ ).toBe(false);
1037
+ });
1038
+
1039
+ it('is create-only: the update schema strips/ignores it', () => {
1040
+ const r = configurationUpdateSchema.safeParse({
1041
+ entrySource: { output: 'with-card' },
1042
+ });
1043
+ // z.object strips unknown keys by default - the field must not survive.
1044
+ expect(r.success).toBe(true);
1045
+ if (r.success) expect((r.data as Record<string, unknown>).entrySource).toBeUndefined();
1046
+ });
1047
+ });
package/src/index.ts CHANGED
Binary file