riverbankcms 0.31.1 → 0.31.2

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { $t as buttonStyleSelectionSchema, At as resolveMediaIdentifier, Bt as MAX_MANAGEMENT_MEDIA_UPLOAD_BYTES, C as entryIdentifierForCommand, Cn as ICON_PICKER_PRESETS, Ct as PUBLIC_FILE_FIELD_KINDS, Dn as asFooterLookId, Dt as buildMediaIdentifierFromFilename, En as SUPPORTED_LOADER_ENDPOINTS, Er as createContentEntryRef, Ft as getMimeType, Ir as slugPart, K as themeSchema, Kn as asAppearancePresetId, Ln as SYSTEM_BLOCK_KINDS, Lt as normalizeAmbiguousStoragePathForSite, Mn as headerLayoutIdValues, N as footerPreferencesSchema, Nn as headerStyleIdValues, Nr as createSiteCommandSiteRef, On as asHeaderLayoutId, P as headerPreferencesSchema, Pt as getExtensionForMimeType, Tr as createCommandRef, Tt as mediaTypeDiscriminants, V as footerModeSchema, Xn as asDesignBlockId, Zn as asDesignBoundaryId, _ as evaluateSiteCommandBatchExposure, br as require_dist, f as stableStringify, jn as footerLookIdValues, jt as slugifyMediaIdentifier, k as eventBookingOfferIntentSchema, kn as asHeaderStyleId, l as resolvePageUpsertSeo, lr as RESOLVED_INTERNAL_LINK_ENTITY_TYPES, m as parseAndPlanCommandBatchForTypes, n as sdkCourseBookingSettingsSchema, nr as asSiteStyleId, p as createDryRunReport, pt as getDirectImageUrlForSiteScopedPath, r as sdkEventOccurrenceInputSchema, rr as makeBoundaryId, s as eventVisibilitySchema, tr as asPageFlowPresetId, ut as parseAspectRatioValue, v as evaluateSiteCommandExposure, wt as isDisplayMediaKind, xr as bookingQuestionAttachmentSchema, y as getSiteCommandMetadata, zt as FILE_SIZE_LIMITS } from "./sdk-event-upsert-0U4hsDpo.mjs";
3
- import { $t as businessCancellationRefusalCodes, An as unsafeAsAppointmentResourceId, C as isPublicReadEndpoint, Cn as unsafeAsPositiveCents, En as assertNever, G as parseFooterCompositionV1, Gt as isSettleableOrderInstalmentPlanStatus, Ht as validateBookingPaymentOptionKinds, In as unsafeAsPassId, It as resolveBookingTimeZoneId, Jt as getBookingInstalmentDepositRefundability, Kt as addIntervalPreservingMonthAnchor, Ln as parseDatedOfferingCapacityHoldAuditRef, M as exposeSecret, Mn as parseCustomerId, N as parseManagementKey, Nt as parseBookingLocalDate, Pn as parseMembershipId, Qt as splitAmountWithRemainderInFirst, Rn as parseDatedOfferingCapacityHoldId, S as getPublicReadCachePolicy, Sn as unsafeAsNonNegativeCents, Tn as parseCurrencyCode, Ut as isLiveOrderInstalmentPlanStatus, W as parseMailingListProviderScope, Wt as isSettleableFlexibleBalanceContractStatus, Xt as getBookingInstalmentProtectedDepositAmountCents, Zt as omitZeroAmountFutureRows, _n as isNonNegativeWholeCents$1, _r as err, ar as parseSiteId, b as PUBLIC_AVAILABILITY_FRESHNESS_SECONDS, bn as toCents, d as canonicalizeConfiguredBookingVerticalConfig, en as scheduleBookingReasonCodes, er as unsafeAsCheckoutLineId, et as assertAllowedPublicUrl, f as parseVerticalId, fr as unsafeAsEventInstanceId, g as EVENT_PRESET_VALUES, gr as unsafeAsPricingOptionId, gt as formatDate, h as DEFAULT_EVENT_TYPE_PRESETS, hr as unsafeAsOccurrenceId, ir as parseApiKeyId, j as createSecret, jn as unsafeAsStaffMemberId, lr as parseEventSeriesId, m as resolveSiteVerticalBookingConfig, mn as fromArray, mr as unsafeAsEventSeriesId, n as committedWriteProofSchema, nn as resolveFlexibleBalanceInitialPaymentCents, nr as parsePageId, or as parseUserId, ot as locationValueSchema, p as parseVerticalPresetId, pr as unsafeAsEventOfferingId, pt as trimmedStringOrNull, qt as clampConfiguredAmount, s as resolveEventCatalogue, t as OFFLINE_PAYMENT_METHODS, tn as resolveFlexibleBalanceDueAt, tr as parseEditorSessionGeneration, u as areConfiguredBookingVerticalConfigsEqual, ur as parseRetiredCourseId, ut as publicLocationSchema, v as SURFACE_EVENT_PRESET_VALUES, vn as parseNonNegativeCents, vr as ok, w as publicReadFreshnessSeconds, x as PUBLIC_CONTENT_FRESHNESS_SECONDS, xn as toNonNegativeCents, yn as parsePositiveCents } from "./src-exrglXYU.mjs";
4
- import { n as CliSdkPeerError, t as loadConfigFile } from "./load-config-DIyqYeRP.mjs";
2
+ import { $n as headerStyleIdValues, A as footerPreferencesSchema, Cr as makeBoundaryId, Dt as resolveMediaIdentifier, Ir as createSiteCommandSiteRef, It as FILE_SIZE_LIMITS, Jn as asHeaderLayoutId, Kn as SUPPORTED_LOADER_ENDPOINTS, Lt as MAX_MANAGEMENT_MEDIA_UPLOAD_BYTES, Mt as getMimeType, Nn as RESOLVED_INTERNAL_LINK_ENTITY_TYPES, Or as createCommandRef, Ot as slugifyMediaIdentifier, Pt as normalizeAmbiguousStoragePathForSite, Qn as headerLayoutIdValues, R as footerModeSchema, Sn as eventBookingOfferIntentSchema, Sr as asSiteStyleId, St as mediaTypeDiscriminants, U as themeSchema, Un as ICON_PICKER_PRESETS, Xt as buttonStyleSelectionSchema, Yn as asHeaderStyleId, Zn as footerLookIdValues, _r as asDesignBoundaryId, b as getSiteCommandMetadata, bt as PUBLIC_FILE_FIELD_KINDS, fr as asAppearancePresetId, gr as asDesignBlockId, h as parseAndPlanCommandBatchForTypes, j as headerPreferencesSchema, jt as getExtensionForMimeType, kr as createContentEntryRef, l as resolvePageUpsertSeo, m as createDryRunReport, n as sdkCourseBookingSettingsSchema, p as stableStringify, qn as asFooterLookId, r as sdkEventOccurrenceInputSchema, rr as SYSTEM_BLOCK_KINDS, s as eventVisibilitySchema, st as parseAspectRatioValue, ut as getDirectImageUrlForSiteScopedPath, v as evaluateSiteCommandBatchExposure, w as entryIdentifierForCommand, wr as bookingQuestionAttachmentSchema, wt as buildMediaIdentifierFromFilename, xn as require_dist, xr as asPageFlowPresetId, xt as isDisplayMediaKind, y as evaluateSiteCommandExposure, zr as slugPart } from "./sdk-event-upsert-BMYgDeSe.mjs";
3
+ import { $t as businessCancellationRefusalCodes, C as isPublicReadEndpoint, Cn as unsafeAsNonNegativeCents, Dn as assertNever, En as parseCurrencyCode, Fn as parseMembershipId, G as parseFooterCompositionV1, Gt as isSettleableOrderInstalmentPlanStatus, Ht as validateBookingPaymentOptionKinds, It as resolveBookingTimeZoneId, Jt as getBookingInstalmentDepositRefundability, Kt as addIntervalPreservingMonthAnchor, Ln as unsafeAsPassId, M as exposeSecret, Mn as unsafeAsStaffMemberId, N as parseManagementKey, Nn as parseCustomerId, Nt as parseBookingLocalDate, Qt as splitAmountWithRemainderInFirst, Rn as parseDatedOfferingCapacityHoldAuditRef, S as getPublicReadCachePolicy, Sn as toNonNegativeCents, Ut as isLiveOrderInstalmentPlanStatus, W as parseMailingListProviderScope, Wt as isSettleableFlexibleBalanceContractStatus, Xt as getBookingInstalmentProtectedDepositAmountCents, Zt as omitZeroAmountFutureRows, _r as unsafeAsPricingOptionId, ar as parseApiKeyId, b as PUBLIC_AVAILABILITY_FRESHNESS_SECONDS, bn as parsePositiveCents, c as resolveEventCatalogue, d as canonicalizeConfiguredBookingVerticalConfig, dr as parseRetiredCourseId, en as scheduleBookingReasonCodes, et as assertAllowedPublicUrl, f as parseVerticalId, g as EVENT_PRESET_VALUES, gr as unsafeAsOccurrenceId, gt as formatDate, h as DEFAULT_EVENT_TYPE_PRESETS, hn as fromArray, hr as unsafeAsEventSeriesId, j as createSecret, jn as unsafeAsAppointmentResourceId, m as resolveSiteVerticalBookingConfig, mr as unsafeAsEventOfferingId, n as OFFLINE_PAYMENT_METHODS, nn as resolveFlexibleBalanceInitialPaymentCents, nr as parseEditorSessionGeneration, or as parseSiteId, ot as locationValueSchema, p as parseVerticalPresetId, pr as unsafeAsEventInstanceId, pt as trimmedStringOrNull, qt as clampConfiguredAmount, r as committedWriteProofSchema, rr as parsePageId, sr as parseUserId, tn as resolveFlexibleBalanceDueAt, tr as unsafeAsCheckoutLineId, u as areConfiguredBookingVerticalConfigsEqual, ur as parseEventSeriesId, ut as publicLocationSchema, v as SURFACE_EVENT_PRESET_VALUES, vn as isNonNegativeWholeCents$1, vr as err, w as publicReadFreshnessSeconds, wn as unsafeAsPositiveCents, x as PUBLIC_CONTENT_FRESHNESS_SECONDS, xn as toCents, yn as parseNonNegativeCents, yr as ok, zn as parseDatedOfferingCapacityHoldId } from "./src-BXMUcFYN.mjs";
4
+ import { n as CliSdkPeerError, t as loadConfigFile } from "./load-config-CMeJVHDQ.mjs";
5
5
  import { Command } from "commander";
6
6
  import { safeParse, z } from "zod";
7
7
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -1845,6 +1845,7 @@ const arrangementTimeOffSchema = z.object({
1845
1845
  startsAt: z.iso.datetime({ offset: true }),
1846
1846
  endsAt: z.iso.datetime({ offset: true }),
1847
1847
  reason: z.string().nullable(),
1848
+ deferredAppointmentIds: z.array(z.string().uuid()).max(200).optional(),
1848
1849
  selections: z.array(z.object({
1849
1850
  arrangementId: z.string().uuid(),
1850
1851
  appointmentId: z.string().uuid(),
@@ -2228,6 +2229,39 @@ const APPOINTMENT_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
2228
2229
  "server:internal_error"
2229
2230
  ]
2230
2231
  },
2232
+ resolveTeamMemberProfileEditorOwner: {
2233
+ path: "/sites/{siteId}/bookings/profile-editor/{entryId}/owner",
2234
+ method: "GET",
2235
+ auth: "user",
2236
+ responseKind: "json",
2237
+ errors: [
2238
+ "auth:forbidden",
2239
+ "resource:not_found",
2240
+ "server:internal_error"
2241
+ ]
2242
+ },
2243
+ getTeamMemberProfileContent: {
2244
+ path: "/sites/{siteId}/bookings/resources/{resourceId}/profile/{entryId}",
2245
+ method: "GET",
2246
+ auth: "user",
2247
+ responseKind: "json",
2248
+ errors: [
2249
+ "auth:forbidden",
2250
+ "resource:not_found",
2251
+ "server:internal_error"
2252
+ ]
2253
+ },
2254
+ listTeamMemberProfileContentSlots: {
2255
+ path: "/sites/{siteId}/bookings/resources/{resourceId}/profile/{entryId}/slots",
2256
+ method: "GET",
2257
+ auth: "user",
2258
+ responseKind: "json",
2259
+ errors: [
2260
+ "auth:forbidden",
2261
+ "resource:not_found",
2262
+ "server:internal_error"
2263
+ ]
2264
+ },
2231
2265
  updateTeamMemberProfilePolicy: {
2232
2266
  path: "/sites/{siteId}/bookings/resources/profile-policy",
2233
2267
  method: "PUT",
@@ -9226,6 +9260,18 @@ const EVENT_MANAGEMENT_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
9226
9260
  "server:internal_error"
9227
9261
  ]
9228
9262
  },
9263
+ previewWholeSeriesRunCancellation: {
9264
+ path: "/sites/{siteId}/bookings/events/{eventId}/runs/{runId}/cancellation",
9265
+ method: "GET",
9266
+ tags: ["site-{siteId}", "event-series-{siteId}"],
9267
+ auth: "user",
9268
+ responseKind: "json",
9269
+ errors: [
9270
+ "auth:forbidden",
9271
+ "resource:not_found",
9272
+ "server:internal_error"
9273
+ ]
9274
+ },
9229
9275
  cancelWholeSeriesRun: {
9230
9276
  path: "/sites/{siteId}/bookings/events/{eventId}/runs/{runId}/cancellation",
9231
9277
  method: "POST",
@@ -9756,6 +9802,20 @@ const BILLING_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
9756
9802
  responseKind: "json",
9757
9803
  errors: []
9758
9804
  },
9805
+ previewPlanChange: {
9806
+ path: "/billing/plan/preview",
9807
+ method: "POST",
9808
+ tags: ["billing"],
9809
+ auth: "user",
9810
+ responseKind: "json",
9811
+ errors: [
9812
+ "validation:invalid_input",
9813
+ "auth:unauthenticated",
9814
+ "resource:conflict",
9815
+ "server:internal_error",
9816
+ "external:service_error"
9817
+ ]
9818
+ },
9759
9819
  changePlan: {
9760
9820
  path: "/billing/plan/change",
9761
9821
  method: "POST",
@@ -14202,6 +14262,70 @@ const ENDPOINT_DEFINITIONS = {
14202
14262
  "server:internal_error"
14203
14263
  ]
14204
14264
  },
14265
+ endCustomerMembershipNow: {
14266
+ path: "/sites/{siteId}/bookings/customer-memberships/{customerMembershipId}/end",
14267
+ method: "POST",
14268
+ tags: [
14269
+ "site-{siteId}",
14270
+ "bookings",
14271
+ "customer-membership-{customerMembershipId}"
14272
+ ],
14273
+ auth: "user",
14274
+ responseKind: "json",
14275
+ errors: [
14276
+ "validation:invalid_input",
14277
+ "resource:not_found",
14278
+ "server:internal_error"
14279
+ ]
14280
+ },
14281
+ resumeCustomerMembership: {
14282
+ path: "/sites/{siteId}/bookings/customer-memberships/{customerMembershipId}/resume",
14283
+ method: "POST",
14284
+ tags: [
14285
+ "site-{siteId}",
14286
+ "bookings",
14287
+ "customer-membership-{customerMembershipId}"
14288
+ ],
14289
+ auth: "user",
14290
+ responseKind: "json",
14291
+ errors: [
14292
+ "validation:invalid_input",
14293
+ "resource:not_found",
14294
+ "server:internal_error"
14295
+ ]
14296
+ },
14297
+ finishCustomerMembershipChange: {
14298
+ path: "/sites/{siteId}/bookings/customer-memberships/{customerMembershipId}/finish",
14299
+ method: "POST",
14300
+ tags: [
14301
+ "site-{siteId}",
14302
+ "bookings",
14303
+ "customer-membership-{customerMembershipId}"
14304
+ ],
14305
+ auth: "user",
14306
+ responseKind: "json",
14307
+ errors: [
14308
+ "validation:invalid_input",
14309
+ "resource:not_found",
14310
+ "server:internal_error"
14311
+ ]
14312
+ },
14313
+ correctCustomerMembershipDates: {
14314
+ path: "/sites/{siteId}/bookings/customer-memberships/{customerMembershipId}",
14315
+ method: "PATCH",
14316
+ tags: [
14317
+ "site-{siteId}",
14318
+ "bookings",
14319
+ "customer-membership-{customerMembershipId}"
14320
+ ],
14321
+ auth: "user",
14322
+ responseKind: "json",
14323
+ errors: [
14324
+ "validation:invalid_input",
14325
+ "resource:not_found",
14326
+ "server:internal_error"
14327
+ ]
14328
+ },
14205
14329
  refundCustomerMembershipPayment: {
14206
14330
  path: "/sites/{siteId}/bookings/customer-memberships/{customerMembershipId}/refund",
14207
14331
  method: "POST",
@@ -15621,6 +15745,13 @@ const ENDPOINT_DEFINITIONS = {
15621
15745
  auth: "public",
15622
15746
  responseKind: "json"
15623
15747
  },
15748
+ portalResumeMembership: {
15749
+ path: "/portal/memberships/{customerMembershipId}/resume",
15750
+ method: "POST",
15751
+ auth: "public",
15752
+ responseKind: "json",
15753
+ errors: []
15754
+ },
15624
15755
  portalSendMagicLink: {
15625
15756
  path: "/portal/auth/send-magic-link",
15626
15757
  method: "POST",
@@ -15809,6 +15940,69 @@ function commandHeaders(endpoint, headers, operationId) {
15809
15940
  return result;
15810
15941
  }
15811
15942
 
15943
+ //#endregion
15944
+ //#region ../api/src/common/billingPlanChange.ts
15945
+ const accessBlockedSchema = z.object({
15946
+ kind: z.literal("access_blocked"),
15947
+ sites: z.array(z.object({
15948
+ siteId: z.string().uuid(),
15949
+ siteName: z.string(),
15950
+ reasons: z.array(z.enum([
15951
+ "website_collaboration_exceeds_target",
15952
+ "operational_access_not_supported",
15953
+ "multiple_active_staff"
15954
+ ]))
15955
+ }))
15956
+ });
15957
+ /** Why a plan change was refused: team access to remove first, or a preview too old to charge from. */
15958
+ const billingPlanChangeFailureSchema = z.discriminatedUnion("kind", [accessBlockedSchema, z.object({ kind: z.literal("preview_expired") })]);
15959
+ /**
15960
+ * The figures a plan change was confirmed from: the preview's proration date
15961
+ * and the monthly price it showed. The server refuses the change as
15962
+ * `preview_expired` when the date is too old or the price it works out now is
15963
+ * different, so an owner is never charged from figures they didn't see.
15964
+ */
15965
+ const planChangeQuoteSchema = z.object({
15966
+ prorationDate: z.number().int().positive(),
15967
+ monthlyPricePence: z.number().int().nonnegative()
15968
+ });
15969
+
15970
+ //#endregion
15971
+ //#region ../api/src/common/billingReturn.ts
15972
+ /**
15973
+ * Where an owner came from when a dashboard prompt sent them to Billing, so the
15974
+ * page can lead with the plan they came for and, after checkout, offer the way
15975
+ * back. It's a closed set rather than a URL, so a link can't be turned into an
15976
+ * open redirect. Launch keeps its own checkout continuation; this is only the
15977
+ * "Back to…" convenience.
15978
+ */
15979
+ const BILLING_RETURN_PAGES = [
15980
+ "site_team",
15981
+ "site_domains",
15982
+ "site_media",
15983
+ "site_home",
15984
+ "launch"
15985
+ ];
15986
+ const billingReturnSchema = z.object({
15987
+ page: z.enum(BILLING_RETURN_PAGES),
15988
+ siteId: z.string().uuid()
15989
+ });
15990
+ /** `site_team:<site uuid>`, the form a `from` query parameter carries. */
15991
+ function serializeBillingReturn(value) {
15992
+ return `${value.page}:${value.siteId}`;
15993
+ }
15994
+ /** Anything that isn't exactly one known page and a uuid is ignored. */
15995
+ function parseBillingReturn(raw) {
15996
+ if (!raw) return null;
15997
+ const separator = raw.indexOf(":");
15998
+ if (separator < 0) return null;
15999
+ const parsed = billingReturnSchema.safeParse({
16000
+ page: raw.slice(0, separator),
16001
+ siteId: raw.slice(separator + 1)
16002
+ });
16003
+ return parsed.success ? parsed.data : null;
16004
+ }
16005
+
15812
16006
  //#endregion
15813
16007
  //#region ../api/src/bookingVerticals.ts
15814
16008
  /**
@@ -16196,6 +16390,15 @@ const pageDesignBoundaryTreatmentSchema = z.discriminatedUnion("kind", [
16196
16390
  ]),
16197
16391
  echo: z.literal(true).optional()
16198
16392
  }).strict(),
16393
+ z.object({
16394
+ kind: z.literal("arc-edge"),
16395
+ height: z.enum([
16396
+ "compact",
16397
+ "medium",
16398
+ "large"
16399
+ ]),
16400
+ echo: z.literal(true).optional()
16401
+ }).strict(),
16199
16402
  z.object({
16200
16403
  kind: z.literal("angle-edge"),
16201
16404
  height: z.enum([
@@ -23075,6 +23278,13 @@ const BOOKING_QUESTION_ANSWER_EXPORT_SCOPE_VALUES = [
23075
23278
  BOOKING_QUESTION_ANSWER_EXPORT_SCOPES.appointments,
23076
23279
  BOOKING_QUESTION_ANSWER_EXPORT_SCOPES.eventSeries
23077
23280
  ];
23281
+ /** Periods shared by appointment list, export and dashboard URL contracts. */
23282
+ const APPOINTMENT_LIST_PERIODS = [
23283
+ "upcoming",
23284
+ "past",
23285
+ "all",
23286
+ "no_shows"
23287
+ ];
23078
23288
 
23079
23289
  //#endregion
23080
23290
  //#region ../api/src/bookingPeople.ts
@@ -25695,10 +25905,9 @@ function buildDashboardSettingsNavPlan(ctx) {
25695
25905
  function buildDashboardTeamMemberNavPlan(ctx) {
25696
25906
  const ownResourceId = getOwnAppointmentResourceId(ctx.staffScope);
25697
25907
  return [
25698
- ...hasAppointmentStaffAccess(ctx.staffScope) ? buildAppointmentStaffNavPlan(ownResourceId) : [],
25699
- ...ownResourceId ? [{
25700
- id: "team.calendarSync",
25701
- label: "My Calendar Sync",
25908
+ ...hasAppointmentStaffAccess(ctx.staffScope) ? buildAppointmentStaffNavPlan(ownResourceId) : ownResourceId ? [{
25909
+ id: "team.availability",
25910
+ label: "My Hours and Calendars",
25702
25911
  destination: {
25703
25912
  kind: "appointment_resource_calendar",
25704
25913
  resourceId: ownResourceId
@@ -25729,7 +25938,7 @@ function buildAppointmentStaffNavPlan(resourceId) {
25729
25938
  destination: { kind: "appointments_calendar" }
25730
25939
  }, {
25731
25940
  id: "team.availability",
25732
- label: "My Availability",
25941
+ label: "My Hours and Calendars",
25733
25942
  destination: resourceId ? {
25734
25943
  kind: "appointment_resource_availability",
25735
25944
  resourceId
@@ -26475,7 +26684,7 @@ function buildStaffAppointmentsNavGroup(ownResourceId) {
26475
26684
  }];
26476
26685
  if (ownResourceId) {
26477
26686
  appointmentItems.push({
26478
- label: "My Availability",
26687
+ label: "My Hours and Calendars",
26479
26688
  destination: {
26480
26689
  kind: "appointment_resource_availability",
26481
26690
  resourceId: ownResourceId
@@ -26484,15 +26693,7 @@ function buildStaffAppointmentsNavGroup(ownResourceId) {
26484
26693
  "availability",
26485
26694
  "schedule",
26486
26695
  "hours",
26487
- "time slots"
26488
- ]
26489
- }, {
26490
- label: "My Calendars",
26491
- destination: {
26492
- kind: "appointment_resource_calendar",
26493
- resourceId: ownResourceId
26494
- },
26495
- keywords: [
26696
+ "time slots",
26496
26697
  "calendar sync",
26497
26698
  "google calendar",
26498
26699
  "external calendar",
@@ -0,0 +1,108 @@
1
+ #!/usr/bin/env node
2
+ import { En as sdkEntrySlotBlocksInputSchema, a as classifySdkEventSchedule, i as sdkEventUpsertOptionalFieldSchemas, n as sdkCourseBookingSettingsSchema, o as classifySdkEventBookingOffer } from "./sdk-event-upsert-BMYgDeSe.mjs";
3
+ import { g as EVENT_PRESET_VALUES } from "./src-BXMUcFYN.mjs";
4
+ import { z } from "zod";
5
+
6
+ //#region src/commands/eventUpsertInputSchema.ts
7
+ const eventScheduleInputSchema = z.object({
8
+ recurrenceRule: z.string().nullable().optional(),
9
+ startDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).nullable().optional(),
10
+ defaultStartTime: z.string().min(1).optional(),
11
+ durationMinutes: z.number().int().positive().optional(),
12
+ startsAt: z.string().min(1).optional(),
13
+ endsAt: z.string().min(1).optional()
14
+ }).transform((schedule, ctx) => {
15
+ const result = classifySdkEventSchedule(schedule, { requireCanonicalFields: true });
16
+ if (!result.ok) {
17
+ result.issues.forEach((issue) => ctx.addIssue({
18
+ code: "custom",
19
+ path: [...issue.path],
20
+ message: issue.message
21
+ }));
22
+ return z.NEVER;
23
+ }
24
+ if (result.kind === "start-end") {
25
+ return {
26
+ startsAt: result.startsAtIso,
27
+ endsAt: result.endsAtIso
28
+ };
29
+ }
30
+ if (result.kind === "start-duration") {
31
+ return {
32
+ startsAt: result.startsAtIso,
33
+ durationMinutes: (Date.parse(result.endsAtIso) - Date.parse(result.startsAtIso)) / 6e4
34
+ };
35
+ }
36
+ return result.canonical;
37
+ });
38
+ function classifiedSchema(classify) {
39
+ return z.unknown().transform((input, ctx) => {
40
+ const result = classify(input);
41
+ if (result.ok) return result.value;
42
+ result.issues.forEach((issue) => ctx.addIssue({
43
+ code: "custom",
44
+ path: issue.path.map(String),
45
+ message: issue.message
46
+ }));
47
+ return z.NEVER;
48
+ });
49
+ }
50
+ const eventBookingOfferInputSchema = classifiedSchema((input) => {
51
+ const result = classifySdkEventBookingOffer(input);
52
+ return result.ok && result.bookingOffer ? {
53
+ ok: true,
54
+ value: result.bookingOffer
55
+ } : result.ok ? {
56
+ ok: false,
57
+ issues: [{
58
+ path: [],
59
+ message: "Event bookingOffer is required"
60
+ }]
61
+ } : result;
62
+ });
63
+ const eventRunCommonInputSchema = z.object({
64
+ identifier: z.string().min(1),
65
+ eventRef: z.string().min(1),
66
+ status: sdkEventUpsertOptionalFieldSchemas.status,
67
+ visibility: sdkEventUpsertOptionalFieldSchemas.visibility,
68
+ waitlistMode: sdkEventUpsertOptionalFieldSchemas.waitlistMode,
69
+ occurrences: sdkEventUpsertOptionalFieldSchemas.occurrences.unwrap(),
70
+ schedule: eventScheduleInputSchema.optional(),
71
+ bookings: sdkEventUpsertOptionalFieldSchemas.bookings,
72
+ attendeeMigration: sdkEventUpsertOptionalFieldSchemas.attendeeMigration,
73
+ bookingOffer: eventBookingOfferInputSchema.optional(),
74
+ capacity: sdkEventUpsertOptionalFieldSchemas.capacity,
75
+ venueRef: z.string().nullable().optional(),
76
+ settings: z.record(z.string(), z.unknown()).optional(),
77
+ tags: z.array(z.string()).optional()
78
+ }).strict();
79
+ const eventRunInputSchema = z.discriminatedUnion("bookingScope", [eventRunCommonInputSchema.extend({ bookingScope: z.literal("single_occurrence") }).strict(), eventRunCommonInputSchema.extend({
80
+ bookingScope: z.literal("whole_series"),
81
+ name: z.string().nullable().optional()
82
+ }).strict()]);
83
+ const eventUpsertInputSchema = z.object({
84
+ identifier: z.string().min(1).optional(),
85
+ courseBooking: sdkCourseBookingSettingsSchema.optional(),
86
+ title: z.string().min(1, "title is required"),
87
+ categoryRef: z.string().nullable().optional(),
88
+ slug: z.string().min(1).optional(),
89
+ content: z.record(z.string(), z.unknown()).optional(),
90
+ blocks: sdkEntrySlotBlocksInputSchema.optional(),
91
+ preset: z.enum(EVENT_PRESET_VALUES),
92
+ runRefs: z.tuple([z.string().min(1)], z.string().min(1)),
93
+ runs: z.tuple([eventRunInputSchema], eventRunInputSchema)
94
+ }).strict().superRefine((input, ctx) => input.runs.forEach((run, index) => {
95
+ if (new Set(run.occurrences.map((item) => item.timeZone)).size <= 1) return;
96
+ ctx.addIssue({
97
+ code: "custom",
98
+ path: [
99
+ "runs",
100
+ index,
101
+ "occurrences"
102
+ ],
103
+ message: "all occurrences must use the same timeZone"
104
+ });
105
+ }));
106
+
107
+ //#endregion
108
+ export { eventUpsertInputSchema as t };
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { t as loadConfigFile } from "./load-config-CMeJVHDQ.mjs";
3
+
4
+ export { loadConfigFile };
@@ -7,7 +7,7 @@ import { existsSync as existsSync$1 } from "fs";
7
7
  import { fileURLToPath } from "url";
8
8
 
9
9
  //#region package.json
10
- var version = "0.31.1";
10
+ var version = "0.31.2";
11
11
  var peerDependencies = { "@riverbankcms/sdk": ">=0.157.0 <1.0.0" };
12
12
  var package_default = {
13
13
  name: "riverbankcms",
@@ -93,7 +93,7 @@ var package_default = {
93
93
  //#endregion
94
94
  //#region src/version.ts
95
95
  /** The package manifest is the source-run fallback; builds inject this value. */
96
- const CLI_VERSION = typeof "0.31.1" === "string" ? "0.31.1" : version;
96
+ const CLI_VERSION = typeof "0.31.2" === "string" ? "0.31.2" : version;
97
97
  /**
98
98
  * The CLI's SDK peer range is bundled from the CLI manifest alongside its
99
99
  * version. Runtime config loading uses this value as the single compatibility
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { _r as err, ar as parseSiteId, vr as ok } from "./src-exrglXYU.mjs";
2
+ import { or as parseSiteId, vr as err, yr as ok } from "./src-BXMUcFYN.mjs";
3
3
  import { existsSync, readFileSync } from "node:fs";
4
4
  import { dirname, isAbsolute, join, parse, relative, resolve, sep } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import "../src-exrglXYU.mjs";
3
- import { a as prepareScaffoldExecution, d as loadGeneratedPackageRanges, i as preflightScaffoldTargets, l as deriveGeneratedPackageRanges, o as writeScaffoldFiles, r as preflightScaffoldPlan, s as deriveScaffoldLocalManifest, t as deriveScaffoldPlan, u as findPackageManifestPath } from "../plan-D5NfiRLe.mjs";
2
+ import "../src-BXMUcFYN.mjs";
3
+ import { a as prepareScaffoldExecution, d as loadGeneratedPackageRanges, i as preflightScaffoldTargets, l as deriveGeneratedPackageRanges, o as writeScaffoldFiles, r as preflightScaffoldPlan, s as deriveScaffoldLocalManifest, t as deriveScaffoldPlan, u as findPackageManifestPath } from "../plan-CiwCwXPF.mjs";
4
4
 
5
5
  export { deriveGeneratedPackageRanges, deriveScaffoldLocalManifest, deriveScaffoldPlan, findPackageManifestPath, loadGeneratedPackageRanges, preflightScaffoldPlan, preflightScaffoldTargets, prepareScaffoldExecution, writeScaffoldFiles };