@riverbankcms/sdk 0.90.1 → 0.91.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.
Files changed (70) hide show
  1. package/dist/{PreviewEditorSidebar-FNFRVSIM.mjs → PreviewEditorSidebar-3TT47WCF.mjs} +3 -3
  2. package/dist/{PreviewEditorUI-3WXJFQXG.mjs → PreviewEditorUI-ORCLLUNZ.mjs} +3 -3
  3. package/dist/SdkPreviewModeRuntime-GMCDQPZZ.mjs +8 -0
  4. package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +17 -0
  5. package/dist/_dts/core/src/string.d.ts +12 -0
  6. package/dist/_dts/sdk/src/cli/sync/validation.d.ts +2 -2
  7. package/dist/_dts/sdk/src/version.d.ts +1 -1
  8. package/dist/{chunk-SYYJZPKU.mjs → chunk-AFPMCLS7.mjs} +2 -2
  9. package/dist/{chunk-H6TT5ZXI.mjs → chunk-GDT2QGIL.mjs} +1 -1
  10. package/dist/{chunk-CR2VX432.mjs → chunk-RQUZYSES.mjs} +48 -36
  11. package/dist/{chunk-FA6LVZ7C.mjs → chunk-S3YHJWEU.mjs} +7 -7
  12. package/dist/{chunk-UG7I7S7W.mjs → chunk-U5YM4AWE.mjs} +1 -1
  13. package/dist/{chunk-BOQXMCSP.mjs → chunk-ZA2S7H34.mjs} +3 -3
  14. package/dist/cli/index.mjs +204 -335
  15. package/dist/cli/init-docs/content/workflow-add-block.md +48 -0
  16. package/dist/cli/init-docs/content/workflow-custom-block.md +10 -0
  17. package/dist/client/{accordion-4K7VGZ3I.mjs → accordion-AFX37652.mjs} +2 -2
  18. package/dist/client/{bookingForm-3QXA3CIS.mjs → bookingForm-32V5QCOW.mjs} +6 -6
  19. package/dist/client/bookings.mjs +16 -15
  20. package/dist/client/{carousel-BEJKNGQ7.mjs → carousel-TJGQJ7ER.mjs} +3 -3
  21. package/dist/client/{cart-44BBM6XG.mjs → cart-JUU2JEW4.mjs} +6 -6
  22. package/dist/client/{checkout-THMHEYKF.mjs → checkout-RD6BTFX4.mjs} +6 -6
  23. package/dist/client/{chunk-JV7ZNAOU.mjs → chunk-6QZIBNGV.mjs} +8 -8
  24. package/dist/client/{chunk-DQIRKNZE.mjs → chunk-6RN62XBV.mjs} +1 -1
  25. package/dist/client/{chunk-ZIAF2DA4.mjs → chunk-C4LP6BPG.mjs} +1 -1
  26. package/dist/client/{chunk-SLY6UDAS.mjs → chunk-CKXEUWWA.mjs} +2 -2
  27. package/dist/client/{chunk-5AJIMWKS.mjs → chunk-E6VIWZUG.mjs} +3 -3
  28. package/dist/client/{chunk-PEDNDLPB.mjs → chunk-FMZZHAIR.mjs} +2 -2
  29. package/dist/client/{chunk-KNTLBQ3N.mjs → chunk-ISAUXU5R.mjs} +1 -1
  30. package/dist/client/{chunk-HIHOQGIP.mjs → chunk-LJCX6V7Q.mjs} +9 -9
  31. package/dist/client/{chunk-B4H6QMPY.mjs → chunk-MLBNVN4H.mjs} +7 -5
  32. package/dist/client/{chunk-EJBHK74Y.mjs → chunk-PMNAV6LO.mjs} +1 -1
  33. package/dist/client/{chunk-4COPESPO.mjs → chunk-RMOFBBNA.mjs} +5 -5
  34. package/dist/client/{chunk-3H5CLFKT.mjs → chunk-RWYFG625.mjs} +9 -8
  35. package/dist/client/client.mjs +34 -31
  36. package/dist/client/{courseRegistration-URX7RCCK.mjs → courseRegistration-X63QAIVV.mjs} +6 -6
  37. package/dist/client/{eventCalendar-GTENOQCE.mjs → eventCalendar-5T24GCZL.mjs} +9 -9
  38. package/dist/client/{eventCombined-EZVB72MF.mjs → eventCombined-AZVTF22X.mjs} +9 -9
  39. package/dist/client/{eventDetails-CH4BJR5Z.mjs → eventDetails-7GPFNLGF.mjs} +9 -9
  40. package/dist/client/{eventListing-4BVOI5HS.mjs → eventListing-QEUMTMUM.mjs} +9 -9
  41. package/dist/client/{eventRegistration-37LPIKIE.mjs → eventRegistration-P2EDKCQZ.mjs} +9 -9
  42. package/dist/client/{form-FX3Y54YK.mjs → form-NUJ7H4IN.mjs} +3 -3
  43. package/dist/client/{headerSection-UOZZGVYL.mjs → headerSection-JB7LECPL.mjs} +3 -3
  44. package/dist/client/hooks.mjs +7 -7
  45. package/dist/client/{locationMap-VSIPKV35.mjs → locationMap-UEYWUCSW.mjs} +3 -3
  46. package/dist/client/{newsletterForm-6FRJKNAF.mjs → newsletterForm-S2YZQ2X7.mjs} +3 -3
  47. package/dist/client/{productDetail-6AHMLXCO.mjs → productDetail-H5MADGG7.mjs} +6 -6
  48. package/dist/client/{productList-M2CYIZVH.mjs → productList-DK7YON7H.mjs} +6 -6
  49. package/dist/client/rendering/client.mjs +31 -28
  50. package/dist/client/rendering/islands.mjs +19 -19
  51. package/dist/client/rendering.mjs +33 -30
  52. package/dist/client/{shop-AUOT6GEX.mjs → shop-6PA7RDRJ.mjs} +6 -6
  53. package/dist/client/spam-protection.mjs +10 -10
  54. package/dist/preview-next/client/runtime.mjs +5 -5
  55. package/dist/{sdk-runtime-6GPJNLU6.mjs → sdk-runtime-JP5347OB.mjs} +6 -6
  56. package/dist/server/components.mjs +13 -11
  57. package/dist/server/config-validation.mjs +7 -7
  58. package/dist/server/config.mjs +7 -7
  59. package/dist/server/data.mjs +7 -7
  60. package/dist/server/index.mjs +1 -1
  61. package/dist/server/navigation.mjs +2 -2
  62. package/dist/server/next.mjs +14 -12
  63. package/dist/server/page-converter.mjs +5 -5
  64. package/dist/server/prebuild.mjs +1 -1
  65. package/dist/server/rendering/server.mjs +13 -11
  66. package/dist/server/rendering.mjs +13 -11
  67. package/dist/server/routing.mjs +14 -14
  68. package/dist/server/server.mjs +8 -8
  69. package/package.json +1 -1
  70. package/dist/SdkPreviewModeRuntime-2UCIMKUB.mjs +0 -8
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import z42, { z, ZodError } from 'zod';
2
+ import z41, { z } from 'zod';
3
3
  import 'react/jsx-runtime';
4
4
  import { createJiti } from 'jiti';
5
5
  import * as fs11 from 'fs';
@@ -229,11 +229,11 @@ function isValidTimeZone(timeZone) {
229
229
  }
230
230
  function getSafeTimeZone(timeZone) {
231
231
  const normalized = typeof timeZone === "string" ? timeZone.trim() : "";
232
- return normalized && isValidTimeZone(normalized) ? normalized : FALLBACK_TIMEZONE;
232
+ return normalized.length > 0 && isValidTimeZone(normalized) ? normalized : FALLBACK_TIMEZONE;
233
233
  }
234
234
  function parseStrictBookingTimeZone(timeZone) {
235
235
  const normalized = timeZone.trim();
236
- if (!normalized || !isValidTimeZone(normalized)) {
236
+ if (normalized.length === 0 || !isValidTimeZone(normalized)) {
237
237
  return null;
238
238
  }
239
239
  return normalized;
@@ -307,7 +307,7 @@ function parseScheduledBookingDateTime(input) {
307
307
  try {
308
308
  const startsAt = toUtcIsoDateTimeString(input.startsAt);
309
309
  const timeZone = parseStrictBookingTimeZone(input.timeZone);
310
- if (!timeZone) {
310
+ if (timeZone === null) {
311
311
  return {
312
312
  ok: false,
313
313
  field: "timeZone",
@@ -373,10 +373,10 @@ function normalizeLocationAddressText(value) {
373
373
  return null;
374
374
  }
375
375
  const trimmed = value.trim();
376
- return trimmed ? trimmed : null;
376
+ return trimmed.length > 0 ? trimmed : null;
377
377
  }
378
378
  function hasLocationCoordinates(value) {
379
- return typeof value?.lat === "number" && typeof value?.lng === "number";
379
+ return value != null && typeof value.lat === "number" && typeof value.lng === "number";
380
380
  }
381
381
  function toLocationCoordinates(value) {
382
382
  if (!hasLocationCoordinates(value)) {
@@ -392,6 +392,18 @@ var init_location = __esm({
392
392
  }
393
393
  });
394
394
 
395
+ // ../core/src/string.ts
396
+ function isNonEmptyString(value) {
397
+ return typeof value === "string" && value.length > 0;
398
+ }
399
+ function hasText(value) {
400
+ return isNonEmptyString(value);
401
+ }
402
+ var init_string = __esm({
403
+ "../core/src/string.ts"() {
404
+ }
405
+ });
406
+
395
407
  // ../core/src/business-address.ts
396
408
  var init_business_address = __esm({
397
409
  "../core/src/business-address.ts"() {
@@ -512,12 +524,6 @@ var init_slug = __esm({
512
524
  }
513
525
  });
514
526
 
515
- // ../core/src/string.ts
516
- var init_string = __esm({
517
- "../core/src/string.ts"() {
518
- }
519
- });
520
-
521
527
  // ../core/src/uuid.ts
522
528
  var init_uuid = __esm({
523
529
  "../core/src/uuid.ts"() {
@@ -4894,44 +4900,44 @@ var init_styleTags = __esm({
4894
4900
  var hotspotSchema, rotationSchema, rectSchema, aspectCropSchema, transformSchema, mediaSchema;
4895
4901
  var init_media = __esm({
4896
4902
  "../theme-core/src/lib/media.ts"() {
4897
- hotspotSchema = z42.object({
4898
- x: z42.number().min(0).max(1),
4899
- y: z42.number().min(0).max(1),
4900
- radius: z42.number().optional()
4903
+ hotspotSchema = z41.object({
4904
+ x: z41.number().min(0).max(1),
4905
+ y: z41.number().min(0).max(1),
4906
+ radius: z41.number().optional()
4901
4907
  });
4902
- rotationSchema = z42.union([z42.literal(0), z42.literal(90), z42.literal(180), z42.literal(270)]);
4903
- rectSchema = z42.tuple([z42.number(), z42.number(), z42.number(), z42.number()]);
4904
- aspectCropSchema = z42.object({
4905
- aspect: z42.preprocess((value) => value == null ? void 0 : value, z42.string().optional()),
4906
- rect: z42.preprocess((value) => value == null ? void 0 : value, rectSchema.optional()),
4907
- hotspot: z42.preprocess((value) => value == null ? void 0 : value, hotspotSchema.optional()),
4908
- rotation: z42.preprocess((value) => value == null ? void 0 : value, rotationSchema.optional())
4908
+ rotationSchema = z41.union([z41.literal(0), z41.literal(90), z41.literal(180), z41.literal(270)]);
4909
+ rectSchema = z41.tuple([z41.number(), z41.number(), z41.number(), z41.number()]);
4910
+ aspectCropSchema = z41.object({
4911
+ aspect: z41.preprocess((value) => value == null ? void 0 : value, z41.string().optional()),
4912
+ rect: z41.preprocess((value) => value == null ? void 0 : value, rectSchema.optional()),
4913
+ hotspot: z41.preprocess((value) => value == null ? void 0 : value, hotspotSchema.optional()),
4914
+ rotation: z41.preprocess((value) => value == null ? void 0 : value, rotationSchema.optional())
4909
4915
  });
4910
- transformSchema = z42.object({
4911
- aspectCrops: z42.preprocess((value) => {
4916
+ transformSchema = z41.object({
4917
+ aspectCrops: z41.preprocess((value) => {
4912
4918
  if (!value || typeof value !== "object" || Array.isArray(value)) {
4913
4919
  return void 0;
4914
4920
  }
4915
4921
  return value;
4916
- }, z42.record(z42.string(), aspectCropSchema.catch({}))).optional(),
4922
+ }, z41.record(z41.string(), aspectCropSchema.catch({}))).optional(),
4917
4923
  rect: rectSchema.optional(),
4918
4924
  hotspot: hotspotSchema.optional(),
4919
4925
  rotation: rotationSchema.optional()
4920
4926
  });
4921
- mediaSchema = z42.object({
4922
- type: z42.enum(["image", "video", "audio", "document", "spreadsheet", "archive"]),
4923
- purpose: z42.string().optional(),
4924
- placeholder: z42.boolean().default(true).optional(),
4925
- assetId: z42.string().optional(),
4926
- identifier: z42.string().optional(),
4927
- src: z42.string().optional(),
4928
- alt: z42.string().optional(),
4929
- filename: z42.string().optional(),
4930
- mimeType: z42.string().optional(),
4931
- width: z42.number().optional(),
4932
- height: z42.number().optional(),
4933
- storageBucket: z42.string().optional(),
4934
- storagePath: z42.string().optional(),
4927
+ mediaSchema = z41.object({
4928
+ type: z41.enum(["image", "video", "audio", "document", "spreadsheet", "archive"]),
4929
+ purpose: z41.string().optional(),
4930
+ placeholder: z41.boolean().default(true).optional(),
4931
+ assetId: z41.string().optional(),
4932
+ identifier: z41.string().optional(),
4933
+ src: z41.string().optional(),
4934
+ alt: z41.string().optional(),
4935
+ filename: z41.string().optional(),
4936
+ mimeType: z41.string().optional(),
4937
+ width: z41.number().optional(),
4938
+ height: z41.number().optional(),
4939
+ storageBucket: z41.string().optional(),
4940
+ storagePath: z41.string().optional(),
4935
4941
  transform: transformSchema.optional()
4936
4942
  });
4937
4943
  }
@@ -18545,66 +18551,66 @@ var init_media2 = __esm({
18545
18551
  "archive",
18546
18552
  "audio"
18547
18553
  ];
18548
- hotspotSchema2 = z42.object({
18549
- x: z42.number().min(0).max(1),
18550
- y: z42.number().min(0).max(1),
18551
- radius: z42.number().optional()
18554
+ hotspotSchema2 = z41.object({
18555
+ x: z41.number().min(0).max(1),
18556
+ y: z41.number().min(0).max(1),
18557
+ radius: z41.number().optional()
18552
18558
  });
18553
- rotationSchema2 = z42.union([z42.literal(0), z42.literal(90), z42.literal(180), z42.literal(270)]);
18554
- rectSchema2 = z42.tuple([z42.number(), z42.number(), z42.number(), z42.number()]);
18555
- aspectCropSchema2 = z42.object({
18556
- aspect: z42.preprocess((value) => value == null ? void 0 : value, z42.string().optional()),
18557
- rect: z42.preprocess((value) => value == null ? void 0 : value, rectSchema2.optional()),
18558
- hotspot: z42.preprocess((value) => value == null ? void 0 : value, hotspotSchema2.optional()),
18559
- rotation: z42.preprocess((value) => value == null ? void 0 : value, rotationSchema2.optional())
18559
+ rotationSchema2 = z41.union([z41.literal(0), z41.literal(90), z41.literal(180), z41.literal(270)]);
18560
+ rectSchema2 = z41.tuple([z41.number(), z41.number(), z41.number(), z41.number()]);
18561
+ aspectCropSchema2 = z41.object({
18562
+ aspect: z41.preprocess((value) => value == null ? void 0 : value, z41.string().optional()),
18563
+ rect: z41.preprocess((value) => value == null ? void 0 : value, rectSchema2.optional()),
18564
+ hotspot: z41.preprocess((value) => value == null ? void 0 : value, hotspotSchema2.optional()),
18565
+ rotation: z41.preprocess((value) => value == null ? void 0 : value, rotationSchema2.optional())
18560
18566
  });
18561
- transformSchema2 = z42.object({
18562
- aspectCrops: z42.preprocess((value) => {
18567
+ transformSchema2 = z41.object({
18568
+ aspectCrops: z41.preprocess((value) => {
18563
18569
  if (!value || typeof value !== "object" || Array.isArray(value)) {
18564
18570
  return void 0;
18565
18571
  }
18566
18572
  return value;
18567
- }, z42.record(z42.string(), aspectCropSchema2.catch({}))).optional(),
18573
+ }, z41.record(z41.string(), aspectCropSchema2.catch({}))).optional(),
18568
18574
  rect: rectSchema2.optional(),
18569
18575
  hotspot: hotspotSchema2.optional(),
18570
18576
  rotation: rotationSchema2.optional()
18571
18577
  });
18572
- mediaPosterSchema = z42.discriminatedUnion("tag", [
18573
- z42.object({
18574
- tag: z42.literal("storage"),
18575
- assetId: z42.string().optional(),
18576
- storageBucket: z42.string().min(1),
18577
- storagePath: z42.string().min(1)
18578
+ mediaPosterSchema = z41.discriminatedUnion("tag", [
18579
+ z41.object({
18580
+ tag: z41.literal("storage"),
18581
+ assetId: z41.string().optional(),
18582
+ storageBucket: z41.string().min(1),
18583
+ storagePath: z41.string().min(1)
18578
18584
  }),
18579
- z42.object({
18580
- tag: z42.literal("external-src"),
18581
- assetId: z42.string().optional(),
18582
- src: z42.string().url()
18585
+ z41.object({
18586
+ tag: z41.literal("external-src"),
18587
+ assetId: z41.string().optional(),
18588
+ src: z41.string().url()
18583
18589
  })
18584
18590
  ]);
18585
- mediaBaseSchema = z42.object({
18586
- purpose: z42.string().optional(),
18587
- placeholder: z42.boolean().default(true).optional(),
18588
- assetId: z42.string().optional(),
18589
- identifier: z42.string().optional(),
18590
- src: z42.string().optional(),
18591
- alt: z42.string().optional(),
18592
- filename: z42.string().optional(),
18593
- mimeType: z42.string().optional(),
18594
- width: z42.number().optional(),
18595
- height: z42.number().optional(),
18596
- storageBucket: z42.string().optional(),
18597
- storagePath: z42.string().optional(),
18591
+ mediaBaseSchema = z41.object({
18592
+ purpose: z41.string().optional(),
18593
+ placeholder: z41.boolean().default(true).optional(),
18594
+ assetId: z41.string().optional(),
18595
+ identifier: z41.string().optional(),
18596
+ src: z41.string().optional(),
18597
+ alt: z41.string().optional(),
18598
+ filename: z41.string().optional(),
18599
+ mimeType: z41.string().optional(),
18600
+ width: z41.number().optional(),
18601
+ height: z41.number().optional(),
18602
+ storageBucket: z41.string().optional(),
18603
+ storagePath: z41.string().optional(),
18598
18604
  poster: mediaPosterSchema.optional(),
18599
18605
  transform: transformSchema2.optional()
18600
18606
  });
18601
- imageMediaSchema = mediaBaseSchema.extend({ type: z42.literal("image") });
18602
- videoMediaSchema = mediaBaseSchema.extend({ type: z42.literal("video") });
18603
- audioMediaSchema = mediaBaseSchema.extend({ type: z42.literal("audio") });
18604
- documentMediaSchema = mediaBaseSchema.extend({ type: z42.literal("document") });
18605
- spreadsheetMediaSchema = mediaBaseSchema.extend({ type: z42.literal("spreadsheet") });
18606
- archiveMediaSchema = mediaBaseSchema.extend({ type: z42.literal("archive") });
18607
- mediaSchema2 = z42.discriminatedUnion("type", [
18607
+ imageMediaSchema = mediaBaseSchema.extend({ type: z41.literal("image") });
18608
+ videoMediaSchema = mediaBaseSchema.extend({ type: z41.literal("video") });
18609
+ audioMediaSchema = mediaBaseSchema.extend({ type: z41.literal("audio") });
18610
+ documentMediaSchema = mediaBaseSchema.extend({ type: z41.literal("document") });
18611
+ spreadsheetMediaSchema = mediaBaseSchema.extend({ type: z41.literal("spreadsheet") });
18612
+ archiveMediaSchema = mediaBaseSchema.extend({ type: z41.literal("archive") });
18613
+ mediaSchema2 = z41.discriminatedUnion("type", [
18608
18614
  imageMediaSchema,
18609
18615
  videoMediaSchema,
18610
18616
  audioMediaSchema,
@@ -29017,12 +29023,16 @@ function validationContext(options = {}) {
29017
29023
  allowIncomplete: isDraft || (options.allowIncomplete ?? false)
29018
29024
  };
29019
29025
  }
29026
+ function strictValidationContext(options = {}) {
29027
+ const ctx = validationContext(options);
29028
+ return {
29029
+ ...ctx,
29030
+ allowNull: options.allowNull ?? false
29031
+ };
29032
+ }
29020
29033
  function formatFieldPath(path28) {
29021
29034
  return path28.map((segment) => String(segment)).join(".");
29022
29035
  }
29023
- function toZodIssuePath(path28) {
29024
- return [...path28];
29025
- }
29026
29036
  function fieldIssueToMessage(issue5) {
29027
29037
  switch (issue5.kind) {
29028
29038
  case "required":
@@ -29259,70 +29269,10 @@ function resolveSelectConstraintSource(field) {
29259
29269
  return assertNever2(source);
29260
29270
  }
29261
29271
  }
29262
- function normalizeStoredContentValues(plans, content, options = {}) {
29263
- if (!content || typeof content !== "object" || Array.isArray(content)) {
29264
- return {};
29265
- }
29266
- const planMap = new Map(plans.map((plan) => [plan.fieldId, plan]));
29267
- const normalized = {};
29268
- const ctx = validationContext(options);
29269
- for (const [key, value] of Object.entries(content)) {
29270
- const plan = planMap.get(key);
29271
- normalized[key] = plan ? normalizeStoredFieldValueWithContext(plan, value, ctx) : value;
29272
- }
29273
- return normalized;
29274
- }
29275
- function normalizeStoredFieldValueWithContext(plan, value, ctx) {
29276
- if (value === null && !plan.required) {
29277
- return void 0;
29278
- }
29279
- switch (plan.kind) {
29280
- case "group":
29281
- return normalizeStoredObjectChildren(plan.children, value, childValidationContext(plan, ctx));
29282
- case "repeater":
29283
- return normalizeStoredRepeaterItems(plan, value, ctx);
29284
- case "string":
29285
- case "number":
29286
- case "boolean":
29287
- case "richText":
29288
- case "media":
29289
- case "link":
29290
- case "select":
29291
- case "passthrough":
29292
- return normalizeFieldValue(plan, value, ctx);
29293
- default:
29294
- return assertNever2(plan);
29295
- }
29296
- }
29297
- function normalizeStoredObjectChildren(children, value, ctx) {
29298
- if (!value || typeof value !== "object" || Array.isArray(value)) {
29299
- return value;
29300
- }
29301
- const normalized = { ...value };
29302
- for (const child of children) {
29303
- normalized[child.fieldId] = normalizeStoredFieldValueWithContext(
29304
- child,
29305
- normalized[child.fieldId],
29306
- ctx
29307
- );
29308
- }
29309
- return normalized;
29310
- }
29311
- function normalizeStoredRepeaterItems(plan, value, ctx) {
29312
- if (!isUnknownArray(value)) {
29313
- return value;
29314
- }
29315
- return value.map((item) => {
29316
- if (!item || typeof item !== "object" || Array.isArray(item)) {
29317
- return item;
29318
- }
29319
- const itemRecord = item;
29320
- const fields3 = plan.repeatedItemVariants ? plan.repeatedItemVariants.find((variant) => variant.typeId === itemRecord._type)?.fields : plan.repeatedItemPlan;
29321
- if (!fields3) {
29322
- return item;
29323
- }
29324
- return normalizeStoredObjectChildren(fields3, itemRecord, ctx);
29325
- });
29272
+ function validateFieldValue(plan, value, options = {}) {
29273
+ const ctx = strictValidationContext(options);
29274
+ const normalized = normalizeFieldValue(plan, value, ctx);
29275
+ return validateNormalizedFieldValue(plan, normalized, ctx);
29326
29276
  }
29327
29277
  function normalizeFieldValue(plan, value, ctx) {
29328
29278
  switch (plan.kind) {
@@ -29600,72 +29550,32 @@ function requiredIssue(plan, value) {
29600
29550
  if (Array.isArray(value)) return issue(plan, "required", { emptyOrigin: "array" });
29601
29551
  return issue(plan, "required");
29602
29552
  }
29603
- function fieldPlanToZod(plan, options = {}) {
29604
- const ctx = validationContext(options);
29605
- return z.any().transform((value) => normalizeFieldValue(plan, value, ctx)).superRefine((value, zodCtx) => {
29606
- for (const validationIssue of validateNormalizedFieldValue(plan, value, ctx)) {
29607
- addFieldIssueToZodContext(zodCtx, validationIssue, plan.path);
29608
- }
29609
- });
29553
+ function validateManifestValues(fields3, values, options = {}) {
29554
+ return deriveFieldValidationPlans(fields3).flatMap(
29555
+ (plan) => validateFieldValue(plan, values[plan.fieldId], options)
29556
+ );
29610
29557
  }
29611
- function addFieldIssueToZodContext(zodCtx, validationIssue, rootPath) {
29612
- const message = fieldIssueToMessage(validationIssue);
29613
- const path28 = relativeZodIssuePath(validationIssue.path, rootPath);
29614
- const issuePath = path28.length > 0 ? { path: toZodIssuePath(path28) } : {};
29615
- switch (validationIssue.kind) {
29616
- case "required":
29617
- if (validationIssue.emptyOrigin) {
29618
- zodCtx.addIssue({
29619
- ...issuePath,
29620
- code: "too_small",
29621
- origin: validationIssue.emptyOrigin,
29622
- minimum: 1,
29623
- inclusive: true,
29624
- message
29625
- });
29626
- return;
29627
- }
29628
- zodCtx.addIssue({ ...issuePath, code: "invalid_type", expected: "nonoptional", message });
29629
- return;
29630
- case "tooLong":
29631
- zodCtx.addIssue({
29632
- ...issuePath,
29633
- code: "too_big",
29634
- origin: "string",
29635
- maximum: validationIssue.maximum,
29636
- inclusive: true,
29637
- message
29638
- });
29639
- return;
29640
- case "invalidOption":
29641
- zodCtx.addIssue({ ...issuePath, code: "invalid_value", values: [], message });
29642
- return;
29643
- case "wrongType":
29644
- case "invalidEmail":
29645
- case "invalidPhone":
29646
- case "invalidPattern":
29647
- case "invalidUrl":
29648
- case "invalidDate":
29649
- case "invalidTime":
29650
- case "invalidDateTime":
29651
- case "invalidNumber":
29652
- case "tooSmall":
29653
- case "tooLarge":
29654
- case "invalidSlug":
29655
- case "tooFewItems":
29656
- case "tooManyItems":
29657
- case "invalidRichText":
29658
- case "invalidMedia":
29659
- case "invalidLink":
29660
- case "invalidReference":
29661
- zodCtx.addIssue({ ...issuePath, code: "custom", message });
29662
- return;
29663
- default:
29664
- assertNever2(validationIssue);
29665
- }
29558
+ function validateManifestContentForPush(fields3, values, options = {}) {
29559
+ const issues = validateManifestValues(fields3, values, options).map(toManifestContentValidationIssue);
29560
+ return issues.length === 0 ? { kind: "valid", issues: [] } : { kind: "invalid", issues };
29561
+ }
29562
+ function isTopLevelRequiredManifestContentIssue(issue5) {
29563
+ return issue5.requiredScope === "topLevel";
29666
29564
  }
29667
- function relativeZodIssuePath(path28, rootPath) {
29668
- return startsWithFieldPath(path28, rootPath) ? path28.slice(rootPath.length) : path28;
29565
+ function formatManifestContentValidationIssue(issue5) {
29566
+ return `Invalid content${issue5.field ? ` in "${issue5.field}"` : ""}: ${issue5.message}`;
29567
+ }
29568
+ function toManifestContentValidationIssue(issue5) {
29569
+ return {
29570
+ kind: issue5.kind,
29571
+ field: formatFieldPath(issue5.path),
29572
+ message: fieldIssueToMessage(issue5),
29573
+ requiredScope: requiredScopeForIssue(issue5)
29574
+ };
29575
+ }
29576
+ function requiredScopeForIssue(issue5) {
29577
+ if (issue5.kind !== "required") return null;
29578
+ return issue5.path.length === 1 ? "topLevel" : "nested";
29669
29579
  }
29670
29580
  function compilePattern(pattern) {
29671
29581
  try {
@@ -29746,13 +29656,6 @@ function isValidSelectValue(value, values, multiple) {
29746
29656
  }
29747
29657
  return typeof value === "string" && values.includes(value);
29748
29658
  }
29749
- function isEmptyValue(value) {
29750
- if (value === null || value === void 0) return true;
29751
- if (typeof value === "string" && value.trim() === "") return true;
29752
- if (Array.isArray(value) && value.length === 0) return true;
29753
- if (isEmptyRichTextDoc(value)) return true;
29754
- return false;
29755
- }
29756
29659
  function isPlainObject(value) {
29757
29660
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
29758
29661
  }
@@ -29763,16 +29666,6 @@ function isValidRichTextDoc(value) {
29763
29666
  const doc = richTextDoc(value);
29764
29667
  return Boolean(isPlainObject(doc) && doc.type === "doc");
29765
29668
  }
29766
- function isEmptyRichTextDoc(value) {
29767
- const doc = richTextDoc(value);
29768
- if (!isPlainObject(doc)) return false;
29769
- if (doc.type !== "doc") return false;
29770
- const content = doc.content;
29771
- if (!Array.isArray(content) || content.length === 0) return true;
29772
- if (content.length !== 1) return false;
29773
- const first = content[0];
29774
- return first?.type === "paragraph" && (!Array.isArray(first.content) || first.content.length === 0);
29775
- }
29776
29669
  function richTextDoc(value) {
29777
29670
  if (!isPlainObject(value)) return value;
29778
29671
  return isPlainObject(value.doc) ? value.doc : value;
@@ -29787,44 +29680,6 @@ function registerManifest(manifest) {
29787
29680
  manifestStore.set(manifest.name, manifest);
29788
29681
  return manifest;
29789
29682
  }
29790
- function preprocessEmptyValues(content) {
29791
- if (!content || typeof content !== "object" || Array.isArray(content)) {
29792
- return {};
29793
- }
29794
- const result = {};
29795
- for (const [key, value] of Object.entries(content)) {
29796
- result[key] = isEmptyValue(value) ? void 0 : value;
29797
- }
29798
- return result;
29799
- }
29800
- function createManifestValidator(manifestOrFields, options = {}) {
29801
- const isDraft = options.mode === "draft";
29802
- const plans = derivePlansFromManifestOrFields(manifestOrFields);
29803
- const baseSchema = deriveContentZodFromPlans(plans, options);
29804
- if (isDraft) {
29805
- return z.preprocess(
29806
- (content) => preprocessEmptyValues(
29807
- normalizeStoredContentValues(plans, content, options)
29808
- ),
29809
- baseSchema
29810
- );
29811
- }
29812
- return z.preprocess(
29813
- (content) => normalizeStoredContentValues(plans, content, options),
29814
- baseSchema
29815
- );
29816
- }
29817
- function deriveContentZodFromPlans(plans, options) {
29818
- const shape = {};
29819
- for (const plan of plans) {
29820
- shape[plan.fieldId] = fieldPlanToZod(plan, options);
29821
- }
29822
- return z.object(shape).catchall(z.unknown()).passthrough();
29823
- }
29824
- function derivePlansFromManifestOrFields(manifestOrFields) {
29825
- const fields3 = Array.isArray(manifestOrFields) ? manifestOrFields : manifestOrFields.fields ?? [];
29826
- return deriveFieldValidationPlans(fields3);
29827
- }
29828
29683
 
29829
29684
  // ../blocks/src/system/blocks/index.ts
29830
29685
  init_site_styles();
@@ -41542,11 +41397,11 @@ function extractRouteUpdatedAt(candidate) {
41542
41397
  }
41543
41398
  function resolveRouteTargetForStage(routeIdValue, routes, stageInput) {
41544
41399
  const routeId = typeof routeIdValue === "string" ? routeIdValue : null;
41545
- if (!routeId || !routes) return null;
41400
+ if (routeId === null || routeId.length === 0 || routes === void 0) return null;
41546
41401
  const routeEntry = routes[routeId];
41547
41402
  if (!isRouteVisibleInStage(routeEntry, stageInput)) return null;
41548
41403
  const href = extractRouteHref(routeEntry, stageInput);
41549
- if (!href) return null;
41404
+ if (href === null) return null;
41550
41405
  return {
41551
41406
  routeId,
41552
41407
  href,
@@ -48481,6 +48336,11 @@ var MIME_TYPES = {
48481
48336
  ".mp4": "video/mp4",
48482
48337
  ".webm": "video/webm",
48483
48338
  ".mov": "video/quicktime",
48339
+ ".mp3": "audio/mpeg",
48340
+ ".m4a": "audio/mp4",
48341
+ ".wav": "audio/wav",
48342
+ ".ogg": "audio/ogg",
48343
+ ".flac": "audio/flac",
48484
48344
  ".pdf": "application/pdf"
48485
48345
  };
48486
48346
  var EXTENSIONS_BY_MIME = {
@@ -48494,6 +48354,13 @@ var EXTENSIONS_BY_MIME = {
48494
48354
  "video/mp4": ".mp4",
48495
48355
  "video/webm": ".webm",
48496
48356
  "video/quicktime": ".mov",
48357
+ "audio/mpeg": ".mp3",
48358
+ "audio/mp4": ".m4a",
48359
+ "audio/wav": ".wav",
48360
+ "audio/x-wav": ".wav",
48361
+ "audio/ogg": ".ogg",
48362
+ "audio/webm": ".webm",
48363
+ "audio/flac": ".flac",
48497
48364
  "application/pdf": ".pdf"
48498
48365
  };
48499
48366
  function getMimeType(filename) {
@@ -54408,7 +54275,8 @@ var salesWindowSchema = z.object({
54408
54275
  });
54409
54276
  });
54410
54277
  function validateChronologicalFields(input) {
54411
- if (!input.start || !input.end) return;
54278
+ if (input.start === void 0 || input.start.length === 0) return;
54279
+ if (input.end === void 0 || input.end.length === 0) return;
54412
54280
  if (Date.parse(input.start) < Date.parse(input.end)) return;
54413
54281
  input.ctx.addIssue({
54414
54282
  code: "custom",
@@ -54592,7 +54460,7 @@ var upsertNavigationMenuCommandSchema = z.object({
54592
54460
  location: z.enum(navigationLocations).optional(),
54593
54461
  role: z.enum(navigationMenuRoles).optional(),
54594
54462
  items: z.array(navigationItemSchema).readonly()
54595
- }).strict().refine((input) => input.name || input.location, {
54463
+ }).strict().refine((input) => input.name !== void 0 || input.location !== void 0, {
54596
54464
  message: "Navigation commands require either input.name or input.location."
54597
54465
  })
54598
54466
  }).strict();
@@ -54932,14 +54800,14 @@ var upsertBookingPassProductCommandSchema = z.object({
54932
54800
  productUseCase: z.enum(bookingPassProductUseCases).default("event_pass"),
54933
54801
  appointmentScope: appointmentPackageScopeSchema.optional()
54934
54802
  }).strict().superRefine((input, ctx) => {
54935
- if (input.productUseCase === "event_pass" && input.appointmentScope) {
54803
+ if (input.productUseCase === "event_pass" && input.appointmentScope !== void 0) {
54936
54804
  ctx.addIssue({
54937
54805
  code: "custom",
54938
54806
  path: ["appointmentScope"],
54939
54807
  message: "appointmentScope is only valid for appointment_package passes"
54940
54808
  });
54941
54809
  }
54942
- if (input.productUseCase === "appointment_package" && !input.appointmentScope) {
54810
+ if (input.productUseCase === "appointment_package" && input.appointmentScope === void 0) {
54943
54811
  ctx.addIssue({
54944
54812
  code: "custom",
54945
54813
  path: ["appointmentScope"],
@@ -55248,7 +55116,7 @@ var siteCommandBatchSchema = z.object({
55248
55116
  commands: z.array(siteCommandSchema).readonly()
55249
55117
  }).strict();
55250
55118
  function entryIdentifierForCommand(command) {
55251
- if (command.input.identifier) return command.input.identifier;
55119
+ if (command.input.identifier !== void 0 && command.input.identifier.length > 0) return command.input.identifier;
55252
55120
  switch (command.type) {
55253
55121
  case "upsertContentEntry":
55254
55122
  return refSlug(command.ref);
@@ -55259,13 +55127,13 @@ function entryIdentifierForCommand(command) {
55259
55127
  }
55260
55128
  }
55261
55129
  function pageIdentifierForCommand(command) {
55262
- if (command.input.identifier) return command.input.identifier;
55130
+ if (command.input.identifier !== void 0 && command.input.identifier.length > 0) return command.input.identifier;
55263
55131
  switch (command.type) {
55264
55132
  case "upsertPage":
55265
55133
  return refSlug(command.ref);
55266
55134
  case "publishPage":
55267
55135
  case "unpublishPage": {
55268
- if (!command.input.pageRef) {
55136
+ if (command.input.pageRef === void 0) {
55269
55137
  throw new Error(`Page command ${command.ref} is missing identifier and pageRef.`);
55270
55138
  }
55271
55139
  return refSlug(command.input.pageRef);
@@ -55279,7 +55147,7 @@ function pageIdentifierForBlockCommand(command) {
55279
55147
  return command.input.pageIdentifier;
55280
55148
  }
55281
55149
  function blockIdentifierForCommand(command) {
55282
- if (command.input.identifier) return command.input.identifier;
55150
+ if (command.input.identifier !== void 0 && command.input.identifier.length > 0) return command.input.identifier;
55283
55151
  switch (command.type) {
55284
55152
  case "upsertPageBlock":
55285
55153
  return refSlug(command.ref);
@@ -55885,7 +55753,7 @@ function getSiteCommandMetadata(type) {
55885
55753
  }
55886
55754
  function getSiteCommandLifecycleIntent(command) {
55887
55755
  if (command.type === "ensureTeamMemberProfile") {
55888
- return command.input.publish ? "publish" : "mutation";
55756
+ return command.input.publish === true ? "publish" : "mutation";
55889
55757
  }
55890
55758
  return getSiteCommandMetadata(command.type).lifecycleIntent;
55891
55759
  }
@@ -56040,7 +55908,7 @@ function commandRefContributions(command) {
56040
55908
  provides: [{ ref: command.ref, field: "ref" }],
56041
55909
  requires: [
56042
55910
  { ref: command.input.resourceRef, field: "input.resourceRef" },
56043
- ...command.input.serviceRef ? [{ ref: command.input.serviceRef, field: "input.serviceRef" }] : []
55911
+ ...command.input.serviceRef !== void 0 && command.input.serviceRef !== null ? [{ ref: command.input.serviceRef, field: "input.serviceRef" }] : []
56044
55912
  ]
56045
55913
  };
56046
55914
  case "upsertBlockTree":
@@ -56054,22 +55922,22 @@ function commandRefContributions(command) {
56054
55922
  case "upsertPageBlock":
56055
55923
  return {
56056
55924
  provides: [{ ref: command.ref, field: "ref" }],
56057
- requires: command.input.pageRef ? [{ ref: command.input.pageRef, field: "input.pageRef" }] : []
55925
+ requires: command.input.pageRef !== void 0 ? [{ ref: command.input.pageRef, field: "input.pageRef" }] : []
56058
55926
  };
56059
55927
  case "patchPageBlockContent":
56060
55928
  return {
56061
55929
  provides: [],
56062
- requires: command.input.pageRef ? [{ ref: command.input.pageRef, field: "input.pageRef" }] : []
55930
+ requires: command.input.pageRef !== void 0 ? [{ ref: command.input.pageRef, field: "input.pageRef" }] : []
56063
55931
  };
56064
55932
  case "deletePageBlock":
56065
55933
  return {
56066
55934
  provides: [],
56067
- requires: command.input.pageRef ? [{ ref: command.input.pageRef, field: "input.pageRef" }] : []
55935
+ requires: command.input.pageRef !== void 0 ? [{ ref: command.input.pageRef, field: "input.pageRef" }] : []
56068
55936
  };
56069
55937
  case "reorderPageBlocks":
56070
55938
  return {
56071
55939
  provides: [{ ref: command.ref, field: "ref" }],
56072
- requires: command.input.pageRef ? [{ ref: command.input.pageRef, field: "input.pageRef" }] : [],
55940
+ requires: command.input.pageRef !== void 0 ? [{ ref: command.input.pageRef, field: "input.pageRef" }] : [],
56073
55941
  requiresIfProvided: command.input.blocks.map((block, index) => ({
56074
55942
  ref: block.blockRef,
56075
55943
  field: `input.blocks[${index}].blockRef`
@@ -56079,7 +55947,7 @@ function commandRefContributions(command) {
56079
55947
  return {
56080
55948
  provides: [{ ref: command.ref, field: "ref" }],
56081
55949
  requires: [
56082
- ...command.input.linkedSubjectRef ? [{ ref: command.input.linkedSubjectRef, field: "input.linkedSubjectRef" }] : [],
55950
+ ...command.input.linkedSubjectRef !== void 0 ? [{ ref: command.input.linkedSubjectRef, field: "input.linkedSubjectRef" }] : [],
56083
55951
  ...(command.input.mediaRefs ?? []).map((ref, index) => ({
56084
55952
  ref,
56085
55953
  field: `input.mediaRefs[${index}]`
@@ -56096,18 +55964,18 @@ function commandRefContributions(command) {
56096
55964
  case "unpublishPage":
56097
55965
  return {
56098
55966
  provides: [],
56099
- requires: command.input.pageRef ? [{ ref: command.input.pageRef, field: "input.pageRef" }] : []
55967
+ requires: command.input.pageRef !== void 0 ? [{ ref: command.input.pageRef, field: "input.pageRef" }] : []
56100
55968
  };
56101
55969
  case "publishContentEntry":
56102
55970
  return {
56103
55971
  provides: [],
56104
- requires: command.input.contentEntryRef ? [{ ref: command.input.contentEntryRef, field: "input.contentEntryRef" }] : []
55972
+ requires: command.input.contentEntryRef !== void 0 ? [{ ref: command.input.contentEntryRef, field: "input.contentEntryRef" }] : []
56105
55973
  };
56106
55974
  case "unpublishContentEntry":
56107
55975
  case "deleteContentEntry":
56108
55976
  return {
56109
55977
  provides: [],
56110
- requires: command.input.contentEntryRef ? [{ ref: command.input.contentEntryRef, field: "input.contentEntryRef" }] : []
55978
+ requires: command.input.contentEntryRef !== void 0 ? [{ ref: command.input.contentEntryRef, field: "input.contentEntryRef" }] : []
56111
55979
  };
56112
55980
  default:
56113
55981
  return assertNever(command);
@@ -56152,7 +56020,7 @@ function collectOfferingRequires(input, intervals, intervalPath) {
56152
56020
  ];
56153
56021
  }
56154
56022
  function optionalRef(ref, field) {
56155
- return ref ? [{ ref, field }] : [];
56023
+ return ref !== void 0 && ref.length > 0 ? [{ ref, field }] : [];
56156
56024
  }
56157
56025
  function collectVenueRefsFromIntervals(intervals, path28) {
56158
56026
  return intervals.flatMap((interval, index) => optionalRef(interval.venueRef, `${path28}[${index}].venueRef`));
@@ -56217,19 +56085,19 @@ function eventSeriesStaticExecutionGaps(command) {
56217
56085
  "event_external_payment_unsupported",
56218
56086
  "External-payment event commands need public checkout/link policy mapping before mutation."
56219
56087
  )] : [],
56220
- ...command.input.waitlist && command.input.waitlist.kind !== "disabled" ? [staticGap(
56088
+ ...command.input.waitlist !== void 0 && command.input.waitlist.kind !== "disabled" ? [staticGap(
56221
56089
  "event_waitlist_requires_waitlist_adapter",
56222
56090
  "Event waitlist commands need waitlist service mapping before mutation."
56223
56091
  )] : [],
56224
- ...command.input.content?.imageRef || command.input.content?.mediaRefs ? [staticGap(
56092
+ ...command.input.content?.imageRef !== void 0 || command.input.content?.mediaRefs !== void 0 ? [staticGap(
56225
56093
  "event_media_content_requires_media_adapter",
56226
56094
  "Event media content needs media adapter mapping before mutation."
56227
56095
  )] : [],
56228
- ...command.input.content?.contentEntryRef ? [staticGap(
56096
+ ...command.input.content?.contentEntryRef !== void 0 ? [staticGap(
56229
56097
  "event_linked_content_requires_content_adapter",
56230
56098
  "Event linked content-entry refs need content adapter mapping before mutation."
56231
56099
  )] : [],
56232
- ...command.input.staffRefs?.length ? [staticGap(
56100
+ ...(command.input.staffRefs?.length ?? 0) > 0 ? [staticGap(
56233
56101
  "event_staff_assignment_unsupported",
56234
56102
  "Event staff refs need staff assignment mapping before mutation."
56235
56103
  )] : [],
@@ -56255,11 +56123,11 @@ function courseStaticExecutionGaps(command) {
56255
56123
  "course_external_payment_unsupported",
56256
56124
  "External-payment course commands need public checkout/link policy mapping before mutation."
56257
56125
  )] : [],
56258
- ...command.input.waitlist && command.input.waitlist.kind !== "disabled" ? [staticGap(
56126
+ ...command.input.waitlist !== void 0 && command.input.waitlist.kind !== "disabled" ? [staticGap(
56259
56127
  "course_waitlist_requires_waitlist_adapter",
56260
56128
  "Course waitlist commands need waitlist service mapping before mutation."
56261
56129
  )] : [],
56262
- ...command.input.staffRefs?.length ? [staticGap(
56130
+ ...(command.input.staffRefs?.length ?? 0) > 0 ? [staticGap(
56263
56131
  "course_staff_assignment_unsupported",
56264
56132
  "Course staff refs need staff assignment mapping before mutation."
56265
56133
  )] : []
@@ -56526,7 +56394,7 @@ function validateBatchRefs(batch) {
56526
56394
  requiresByCommand.set(command.ref, [...dedupeContributions(requires)]);
56527
56395
  for (const { ref } of provides) {
56528
56396
  const existing = providerByRef.get(ref);
56529
- if (existing) {
56397
+ if (existing !== void 0) {
56530
56398
  errors.push({
56531
56399
  code: "duplicate_resource_ref",
56532
56400
  resourceRef: ref,
@@ -56583,7 +56451,7 @@ function addInBatchProvidedRefRequirement(input) {
56583
56451
  const nextRequires = [...dedupeContributions([...currentRequires, input.requirement])];
56584
56452
  input.requiresByCommand.set(input.commandRef, nextRequires);
56585
56453
  const contribution = input.contributionsByCommand.get(input.commandRef);
56586
- if (contribution) {
56454
+ if (contribution !== void 0) {
56587
56455
  input.contributionsByCommand.set(input.commandRef, {
56588
56456
  ...contribution,
56589
56457
  requires: nextRequires
@@ -56629,7 +56497,7 @@ function checkPortalOrdersHaveUniqueSubjects(batch) {
56629
56497
  if (command.type !== "seedPortalOrder") continue;
56630
56498
  const key = portalOrderSubjectKey(command.input.subject);
56631
56499
  const previous = seenBySubject.get(key);
56632
- if (previous) {
56500
+ if (previous !== void 0) {
56633
56501
  errors.push(commandInvariantViolation(
56634
56502
  command.ref,
56635
56503
  "input.subject",
@@ -56751,7 +56619,7 @@ function checkTicketQuantitiesWithinCapacity(indexes) {
56751
56619
  function checkTicketsTargetTicketPricedEvents(indexes) {
56752
56620
  return indexes.ticketGroups.flatMap((tickets) => tickets.flatMap((ticket) => {
56753
56621
  const event = indexes.eventByRef.get(ticket.input.eventRef);
56754
- if (!event || event.input.pricing.kind === "ticket_types") return [];
56622
+ if (event === void 0 || event.input.pricing.kind === "ticket_types") return [];
56755
56623
  return [commandInvariantViolation(
56756
56624
  ticket.ref,
56757
56625
  "input.eventRef",
@@ -56762,10 +56630,10 @@ function checkTicketsTargetTicketPricedEvents(indexes) {
56762
56630
  function checkTicketCurrencyMatchesEvent(indexes) {
56763
56631
  return indexes.ticketGroups.flatMap((tickets) => tickets.flatMap((ticket) => {
56764
56632
  const event = indexes.eventByRef.get(ticket.input.eventRef);
56765
- if (!event || event.input.pricing.kind !== "ticket_types") return [];
56633
+ if (event === void 0 || event.input.pricing.kind !== "ticket_types") return [];
56766
56634
  const expectedCurrency = event.input.pricing.currency;
56767
56635
  const ticketCurrency = ticket.input.price.currency;
56768
- if (!expectedCurrency || !ticketCurrency || ticketCurrency === expectedCurrency) return [];
56636
+ if (!hasText(expectedCurrency) || !hasText(ticketCurrency) || ticketCurrency === expectedCurrency) return [];
56769
56637
  return [commandInvariantViolation(
56770
56638
  ticket.ref,
56771
56639
  "input.price.currency",
@@ -56793,10 +56661,11 @@ function orderCommands(commands, providerByRef, requiresByCommand) {
56793
56661
  const requires = requiresByCommand.get(command.ref) ?? [];
56794
56662
  for (const { ref } of requires) {
56795
56663
  const provider = providerByRef.get(ref);
56796
- if (!provider || provider === command.ref) continue;
56664
+ if (provider === void 0 || provider === command.ref) continue;
56797
56665
  if (!outgoing.has(provider)) outgoing.set(provider, /* @__PURE__ */ new Set());
56798
- if (!outgoing.get(provider)?.has(command.ref)) {
56799
- outgoing.get(provider)?.add(command.ref);
56666
+ const dependents = outgoing.get(provider);
56667
+ if (dependents !== void 0 && !dependents.has(command.ref)) {
56668
+ dependents.add(command.ref);
56800
56669
  indegree.set(command.ref, (indegree.get(command.ref) ?? 0) + 1);
56801
56670
  }
56802
56671
  }
@@ -56806,9 +56675,9 @@ function orderCommands(commands, providerByRef, requiresByCommand) {
56806
56675
  while (ready.length > 0) {
56807
56676
  ready.sort((left, right) => (authorIndex.get(left) ?? 0) - (authorIndex.get(right) ?? 0) || left.localeCompare(right));
56808
56677
  const nextRef = ready.shift();
56809
- if (!nextRef) continue;
56678
+ if (nextRef === void 0) continue;
56810
56679
  const command = commandByRef.get(nextRef);
56811
- if (command) ordered.push(command);
56680
+ if (command !== void 0) ordered.push(command);
56812
56681
  for (const dependent of outgoing.get(nextRef) ?? []) {
56813
56682
  const nextDegree = (indegree.get(dependent) ?? 0) - 1;
56814
56683
  indegree.set(dependent, nextDegree);
@@ -56931,7 +56800,7 @@ function stableStringify(value) {
56931
56800
  }
56932
56801
  function sortValue(value) {
56933
56802
  if (Array.isArray(value)) return value.map(sortValue);
56934
- if (value && typeof value === "object") return sortRecord(value);
56803
+ if (value !== null && typeof value === "object") return sortRecord(value);
56935
56804
  return value;
56936
56805
  }
56937
56806
  function sortRecord(record) {
@@ -58728,6 +58597,8 @@ function recordNavigationFailure(result, identifier, message) {
58728
58597
 
58729
58598
  // src/cli/site-commands/pageCommands.ts
58730
58599
  init_src();
58600
+
58601
+ // src/cli/sync/validation.ts
58731
58602
  function assertNeverField(field) {
58732
58603
  throw new Error(`Unhandled field type while extracting field ids: ${JSON.stringify(field)}`);
58733
58604
  }
@@ -58805,31 +58676,17 @@ function getDataKeys(data) {
58805
58676
  return new Set(Object.keys(data));
58806
58677
  }
58807
58678
  function validateBlockContent(data, manifest, customFields) {
58808
- const warnings = [];
58809
- try {
58810
- const manifestWithCustomFields = customFields ? { ...manifest, fields: [...manifest.fields, ...customFields] } : manifest;
58811
- const normalizedFields = parseFieldDefinitions([...manifestWithCustomFields.fields]);
58812
- const validator = createManifestValidator(normalizedFields, {
58813
- allowNull: true,
58814
- allowIncomplete: true
58815
- });
58816
- validator.parse(data);
58817
- } catch (error) {
58818
- if (error instanceof ZodError) {
58819
- for (const issue5 of error.issues) {
58820
- const fieldPath = issue5.path.join(".");
58821
- if (issue5.code === "invalid_type" && issue5.received === "undefined") {
58822
- continue;
58823
- }
58824
- warnings.push({
58825
- type: "invalid_content",
58826
- field: fieldPath || "(root)",
58827
- message: `Invalid content${fieldPath ? ` in "${fieldPath}"` : ""}: ${issue5.message}`
58828
- });
58829
- }
58830
- }
58831
- }
58832
- return warnings;
58679
+ const manifestWithCustomFields = customFields ? { ...manifest, fields: [...manifest.fields, ...customFields] } : manifest;
58680
+ const normalizedFields = parseFieldDefinitions([...manifestWithCustomFields.fields]);
58681
+ const validation = validateManifestContentForPush(normalizedFields, data);
58682
+ if (validation.kind === "valid") return [];
58683
+ return validation.issues.filter((issue5) => !isTopLevelRequiredManifestContentIssue(issue5)).map((issue5) => {
58684
+ return {
58685
+ type: "invalid_content",
58686
+ field: issue5.field || "(root)",
58687
+ message: formatManifestContentValidationIssue(issue5)
58688
+ };
58689
+ });
58833
58690
  }
58834
58691
  function validateBlockData(data, manifest, customFields) {
58835
58692
  const warnings = [];
@@ -64508,6 +64365,12 @@ function buildBlockTypesTemplate() {
64508
64365
  "",
64509
64366
  "Reference list of all built-in CMS block types.",
64510
64367
  "The generated section is updated by `riverbankcms init-docs`.",
64368
+ "",
64369
+ "Authoring notes:",
64370
+ "- Fields marked `required` must be present with a valid value.",
64371
+ "- Optional fields may be omitted from pushed JSON; you do not need to include every key or set unused fields to `null`.",
64372
+ "- Defaults shown here document the editor/rendering contract. Include an optional field only when you want to override the default.",
64373
+ "- Required nested fields apply when their parent object or repeater item is present.",
64511
64374
  ""
64512
64375
  ].join("\n");
64513
64376
  const generated = buildBlockTypesGeneratedSection();
@@ -64526,6 +64389,12 @@ function buildSiteBlockTypesTemplate(state) {
64526
64389
  "- System blocks (`block.*`) with `blockFieldExtensions` and `blockFieldOptions` merged in",
64527
64390
  "- Custom blocks (`custom.*`) from `riverbank.config.ts`",
64528
64391
  "",
64392
+ "Authoring notes:",
64393
+ "- Fields marked `required` must be present with a valid value.",
64394
+ "- Optional fields may be omitted from pushed JSON; you do not need to include every key or set unused fields to `null`.",
64395
+ "- Defaults shown here document the editor/rendering contract. Include an optional field only when you want to override the default.",
64396
+ "- Required nested fields apply when their parent object or repeater item is present.",
64397
+ "",
64529
64398
  "The generated section is updated by `riverbankcms init-docs`.",
64530
64399
  ""
64531
64400
  ].join("\n");
@@ -65565,7 +65434,7 @@ var SimpleCache = class {
65565
65434
  };
65566
65435
 
65567
65436
  // src/version.ts
65568
- var SDK_VERSION = "0.90.1";
65437
+ var SDK_VERSION = "0.91.0";
65569
65438
 
65570
65439
  // src/client/error.ts
65571
65440
  var RiverbankApiError = class _RiverbankApiError extends Error {