@nfcard/validation 0.4.0 → 0.5.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
@@ -3159,7 +3159,7 @@ declare const profileUserDataSchema: z.ZodObject<{
3159
3159
  }>;
3160
3160
  declare const profileCreateSchema: z.ZodObject<{
3161
3161
  cardId: z.ZodOptional<z.ZodString>;
3162
- label: z.ZodString;
3162
+ label: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
3163
3163
  icon: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
3164
3164
  userData: z.ZodObject<{
3165
3165
  firstName: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
@@ -3438,8 +3438,8 @@ declare const profileCreateSchema: z.ZodObject<{
3438
3438
  customUrlLabel?: string | undefined;
3439
3439
  } | undefined;
3440
3440
  };
3441
- label: string;
3442
3441
  cardId?: string | undefined;
3442
+ label?: string | undefined;
3443
3443
  icon?: string | undefined;
3444
3444
  accessPin?: string | undefined;
3445
3445
  }, {
@@ -3498,9 +3498,9 @@ declare const profileCreateSchema: z.ZodObject<{
3498
3498
  customUrlLabel?: string | undefined;
3499
3499
  } | undefined;
3500
3500
  };
3501
- label: string;
3502
3501
  visibility?: "public" | "private" | "link_only" | undefined;
3503
3502
  cardId?: string | undefined;
3503
+ label?: string | undefined;
3504
3504
  icon?: string | undefined;
3505
3505
  accessPin?: string | undefined;
3506
3506
  }>;
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.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Shared Zod validation schemas for the NFCard product family.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.test.ts CHANGED
@@ -482,12 +482,21 @@ describe('profileCreateSchema', () => {
482
482
  expect(r.success).toBe(false);
483
483
  });
484
484
 
485
- it('rejects missing label', () => {
485
+ it('accepts a missing label (NFCARD-128 — blank profile, label set later in the editor)', () => {
486
486
  const r = profileCreateSchema.safeParse({
487
487
  userData: { ...validUserData, email: '' },
488
488
  digitalConfig: validDigitalConfig,
489
489
  });
490
- expect(r.success).toBe(false);
490
+ expect(r.success).toBe(true);
491
+ });
492
+
493
+ it('accepts an empty label', () => {
494
+ const r = profileCreateSchema.safeParse({
495
+ label: '',
496
+ userData: { ...validUserData, email: '' },
497
+ digitalConfig: validDigitalConfig,
498
+ });
499
+ expect(r.success).toBe(true);
491
500
  });
492
501
  });
493
502
 
package/src/index.ts CHANGED
Binary file