riverbankcms 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/acceptance/matrix.mjs +3 -3
- package/dist/cli/index.mjs +104 -192
- package/dist/cli/init-docs/content/content-management.md +2 -2
- package/dist/{eventUpsertInputSchema-XM4oaNoq.mjs → eventUpsertInputSchema-IPfgjpZN.mjs} +3 -3
- package/dist/{load-config-DidU5HfW.mjs → load-config-4qWCVvBe.mjs} +2 -2
- package/dist/load-config-BmrIcDxY.mjs +4 -0
- package/dist/{local-sync-DQcLxBg3.mjs → local-sync-But5fsta.mjs} +3 -3
- package/dist/{plan-mb_YslEh.mjs → plan-tejzSw1n.mjs} +1 -1
- package/dist/scaffold/index.mjs +2 -2
- package/dist/{sdk-event-upsert-D48eLVOi.mjs → sdk-event-upsert-TGjuLLJp.mjs} +114 -105
- package/dist/{src-CxEAuQpf.mjs → src-DQ0xnGOE.mjs} +135 -13
- package/dist/testing.mjs +3 -3
- package/package.json +1 -1
- package/dist/load-config-CoGYSr5z.mjs +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "../sdk-event-upsert-
|
|
3
|
-
import "../src-
|
|
4
|
-
import { t as eventUpsertInputSchema } from "../eventUpsertInputSchema-
|
|
2
|
+
import "../sdk-event-upsert-TGjuLLJp.mjs";
|
|
3
|
+
import "../src-DQ0xnGOE.mjs";
|
|
4
|
+
import { t as eventUpsertInputSchema } from "../eventUpsertInputSchema-IPfgjpZN.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/acceptance/matrix-builders.ts
|
|
7
7
|
const workflow = (scenario, stepId) => ({
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as
|
|
3
|
-
import { $ as
|
|
4
|
-
import { $ as sdkListEventsResponseSchema, A as resolveMediaTransformForAspect, B as asRecord$1, C as walkAndCollectImageAttrs, D as normalizeWidthCandidates, E as rotateNormalizedPoint, F as buildMediaIdentifierFromFilename, G as parseSafeDownloadFilename, H as FILE_SIZE_LIMITS, I as parseMediaIdentifier, J as createHttpClient, K as ManagementApiError, L as deriveVideoSlotPolicy, M as getDirectImageUrlForSiteScopedPath, N as getImageUrl, O as isExplicitRectCrop, P as isSiteScopedDirectImageStoragePath, Q as sdkGetEventResponseSchema, R as resolveVideoSelectionIntentForMediaField, S as buildRenderableMediaAssetIndex, St as sdkConfiguredBookingVerticalConfigSchema, T as looksLikeUuid$1, U as classifyKnownMimeType, V as parseRelativeStoragePath, W as managementMediaLibraryUploadLimitForMimeType, X as managementTransportError, Y as is404Error, Z as sdkConfigureBookingVerticalResponseSchema, _ as buildSettingsUpdateInput, _t as sdkSavePageDesignResponseSchema, a as prepareLocalMediaForPush, at as customLinkSchema$1, b as isMediaValue, bt as sdkListEventOccurrencesResponseSchema, c as writeBinaryFileAtomic, ct as internalLinkSchema, d as normalizeMediaValueToIdentifierOnly, dt as isInternalResolvedLinkValue, et as sdkTakeEventOfflineResponseSchema, f as walkLocalContentMedia, ft as isResolvedInternalLinkEntityType, g as SETTINGS_FILE_FIELDS, gt as sdkGetPageDesignResponseSchema, h as extractMediaIdentifiers, ht as portablePageDesignSchema, i as applyLocalMediaPush, it as RESOLVED_INTERNAL_LINK_ENTITY_TYPES, j as getDirectImageUrlForRelativePath, k as parseAspectRatioValue, l as sha256, lt as internalResolvedLinkSchema, m as downloadMedia, mt as pageLinkSchema$1, nt as sdkSettingsUpdateSchema, o as admitBinaryWriteDestination, ot as entryLinkSchema$1, p as buildStorageUrl, pt as linkSchema, q as buildRequestInfo, r as syncLocalMediaForPull, rt as linkPayloadSchema, s as readStableBinaryFile, st as externalLinkSchema$1, t as revalidateLocalMediaPushPlan, tt as sdkUpsertEventResponseSchema, u as normalizeMediaIdentifierInput, ut as internalRouteOnlyLinkSchema, v as hasOwnSettingsField, vt as sdkDeleteEventOccurrenceResponseSchema, w as deleteEnvSpecificKeys, x as attachRenderableMediaAssetFields, xt as sdkReorderResponseSchema, y as writeMediaManifest, yt as sdkEventOccurrenceResponseSchema, z as getMimeType } from "../local-sync-
|
|
5
|
-
import { n as CliSdkPeerError, r as CLI_VERSION, t as loadConfigFile } from "../load-config-
|
|
6
|
-
import { a as RichTextDocSchema, c as isRecord$16, i as findUnfilledSentinels, n as buildEntryScaffold, o as isRichTextDoc, r as validateEntryInstance, s as isObjectRecord, t as eventUpsertInputSchema } from "../eventUpsertInputSchema-
|
|
7
|
-
import { a as prepareScaffoldExecution, c as LOCAL_PACKAGE_VENDOR_DIR, d as loadGeneratedPackageRanges, i as preflightScaffoldTargets, n as createScaffoldCompletion, s as deriveScaffoldLocalManifest, t as deriveScaffoldPlan } from "../plan-
|
|
2
|
+
import { $ as readHeaderNavFontSizePreference, $n as cssVarValue, $t as themeButtonExtraClassesWithTrailingIcon, A as pickShadeTowardBackground, An as pageDesignEditorBackgroundOverrideOwner, Ar as introCompositionTreatmentValues, At as FONT_WEIGHT_MAP, B as createNavigationRef, Bn as renderCssDeclarations, Br as featuresFromHex, Bt as generateButtonCss, C as pagePathForCommand, Cn as transitionCatalogueEntries, Cr as defineBlockDesignCapability, Ct as NAV_LINK_PADDING_MAP, D as bookingPaymentTermsSchema, Dn as resolveOnColorForThemeToken, Dr as eyebrowTreatmentValues, Dt as navLinkOwnsHoverForeground, E as bookingPaymentCollectionOptionSchema, En as isCssColorLiteral, Er as eventListTreatmentValues, Et as navLinkHoverColorCandidate, F as createContentEntryRef, Fn as mediaTypeDiscriminants, Fr as visibleHeadingDecorationFamilyValues, Ft as ACCORDION_SPACING_MAP, G as slugPart, Gn as cardVariantRoleValues, Gt as contextualButtonSurfaceStyles, H as createSiteCommandSiteRef, Hn as getTextColorForBackground, Hr as oklchToHexGamut, Ht as resolvedButtonColourDeclarations, I as createEventCategoryRef, In as persistableMediaSchema, Ir as isOnColorBackgroundCandidateToken, It as ACCORDION_TRIGGER_FONT_SCALE, J as headerLeafTextColor, Jn as backgroundAppearanceQuickColorTokenNames, Jt as generateDefaultButtonSystem, K as effectiveHeaderNavLinkStyle, Kn as normalizeCardRole, Kt as deriveButtonSurfaceContext, L as createEventSeriesRef, Ln as generateCardCoreCss, Lr as onColorTokenName, Lt as ACCORDION_TRIGGER_LETTER_SPACING, M as createBlockRef, Mn as stripStaleTransitionStyleGroup, Mr as offeringsPreviewCompositionTreatmentValues, Mt as INPUT_SPACING_MAP, N as createBlocksRef, Nn as mediaIdentifierSchema, Nr as testimonialsCompositionTreatmentValues, Nt as LABEL_FONT_SIZE_MAP, O as require_jsx_runtime, On as resolveThemeColorReferenceValue, Or as featureCardCompositionTreatmentValues, Ot as navLinkOwnsUnderline, P as createCommandRef, Pn as mediaSchema, Pr as tileTreatmentValues, Pt as ACCORDION_OPEN_ACCENT_THICKNESS, Q as mergeHeaderNavTypographyPreference, Qn as borderColorStyle, Qt as parseThemeButtonVariantId, R as createFooterRef, Rn as getDefaultCardVariants, Rr as ORDINARY_TEXT_MIN_CONTRAST_RATIO, Rt as ICON_CONFIG, S as pageIdentifierForCommand, Sn as anglePolygonCss, Sr as assertNever$4, St as NAV_LINK_LETTER_SPACING_MAP, Tn as boxBackgroundSchema, Tr as defineNoBlockDesignCapability, Tt as NAV_LINK_TEXT_SIZE_MAP, U as createVenueRef, Un as generateShadowValue$1, Ur as __toESM, Ut as resolvedButtonFocusDeclarations, V as createPageRef, Vn as expandPalette, Vr as hexToRgb, Vt as RESOLVED_BUTTON_DISABLED_DECLARATIONS, W as refSlug, Wn as cardRoleSchema, Wt as contextualButtonSurfaceResetStyles, X as readOpeningForegroundProjection, Xn as TokenResolver, Xt as generateBaseInteractiveCSS, Y as transparentHeaderForegroundInput, Yn as parseBackgroundAppearanceColorToken, Yt as generateEffectsCSS, Z as getNavLinkPreset, Zn as backgroundColorStyle, Zt as generateInteractiveChildInheritanceCSS, _ as getSiteCommandMetadata, _r as defineBlockDesignMetadata, _t as getComponentBorderWidthPx, an as generateShadowValue, ar as surfaceToneFromForegroundToken, at as getHeaderPaintTargets, b as entryIdentifierForCommand, bn as sectionFactsForContent, bt as parseCustomCssRules, c as isEventVisibility, cn as GRADIENT_PRESET_IDS, cr as surfaceForegroundDeclarations, ct as BREAKPOINT_MD, d as stableStringify, dr as surfaceForegroundValue, dt as MQ_LG_UP, en as themeButtonSizeClassName, er as mergeStyles, et as headerRootPaint, f as createDryRunReport, fn as PUBLIC_BUTTON_ROLES, fr as parseThemeColorToken, ft as MQ_MD_DOWN, g as evaluateSiteCommandExposure, gr as defaultThemeTokens, gt as headerVariantValues, h as evaluateSiteCommandBatchExposure, hn as unsafeAsOpaqueButtonColourToken, hr as buildThemeTokens, ht as MQ_TABLET_ONLY, in as formatButtonColourContractError, ir as selectLogoVariant, it as generateMobileOverlayBackdropFilterFix, j as generateCssVars, jn as siteChromeBackgroundOverrideOwner, jr as makeBoundaryId, jt as INPUT_FONT_SIZE_MAP, k as require_react, kn as resolveTokenOrCssColorValue, kr as headingDecorationColorTokenValues, kt as navEffectPolicy, l as venueManagementFields, ln as getGradientPreset, lr as surfaceForegroundInputFromResolved, lt as BREAKPOINT_SM, m as mapEventCommandContent, mn as buttonVariantIdSchema, mr as parseColorTokenParts, mt as MQ_SM_UP, nn as parseThemeForPersistence, nr as textColorStyle, nt as themeSchema, o as classifySdkEventBookingOffer, on as footerModeSchema, or as resolveSurfaceForeground, ot as renderHeaderPaintTargetRules, p as parseAndPlanCommandBatchForTypes, pn as VARIANT_ROLES, pr as parseBlockColorToken, pt as MQ_SM_DOWN, q as headerForegroundCandidates, qn as backgroundAppearanceColorTokenNames, qt as resolveContextualButtonRole, rn as compileButtonColourStates, rr as textColorValue, rt as generateHeaderScrollTreatmentStyles, sn as gradientToCss, sr as DEFAULT_SURFACE_TEXT_COLOR, st as BREAKPOINT_LG, t as classifySdkEventTiming, tn as themeButtonVariantClassNames, tr as rgbColorValue, tt as getCuratedSiteStyle, u as sortRecord, un as parseGradientPresetId, ur as surfaceForegroundStyle, ut as BREAKPOINT_XL, v as blockIdentifierForCommand, vn as boundaryLayout, vt as getComponentShadowVar, w as hasConfiguredBookingVertical, wn as boxBackgroundOverlaySchema, wr as defineFrameCapability, wt as NAV_LINK_PADDING_X_MAP, x as pageIdentifierForBlockCommand, xn as boundaryRuntimeMetricsForDecorativeTransition, xt as NAV_LINK_BORDER_RADIUS_MAP, y as blockOrderIdentifiersForCommand, yn as composeBoundary, yr as asDesignBlockId, yt as parseBlockCustomCssRules, z as createFormRef, zn as generateCardCss, zr as contrastRatio, zt as ICON_SIZE_PX } from "../sdk-event-upsert-TGjuLLJp.mjs";
|
|
3
|
+
import { $ as validateBookingPaymentOptionKinds, B as formatBookingDate, C as parseMailingListContentVersionId, Ct as unsafeAsDemoCapability, D as sameMailingListPlacementTargeting, E as planMailingListChoicePresentation, G as getBookingLocalDateKey, Gt as ok, H as formatBookingTime, I as normalizeLocationAddressText, K as getLocalScheduleDate, L as toLocationCoordinates, M as parseMailingListPlacementTargeting, Mt as unsafeAsPositiveByteCount, O as DEFAULT_MAILING_LIST_SUCCESS_MESSAGE, P as assertAllowedPublicUrl, R as selectCategoryView, S as parseMailingListBlockId, T as parseMailingListRuntimeContext, U as formatLocalScheduleDate, V as formatBookingDateParts, W as formatLocalScheduleTime, Wt as err, X as toScheduledBookingDateRange, Y as toBookingTimeZone, Z as toScheduledBookingDateTime, _ as createSecret, _t as parseSiteId, at as publicEventPricingDisplay, c as DEFAULT_EVENT_TYPE_PRESETS, ct as resolvePricingOptionsPriceDisplay, d as SURFACE_EVENT_PRESET_VALUES, dt as formatCurrencyAmount, et as parseEventPageSurfaceSubject, f as WHOLE_SERIES_EVENT_PRESET_VALUES, ft as assertNever, g as resolveWholeSeriesBookingPhase, gt as parsePageId, h as orderedLiveRunSessions, ht as parseMediaAssetId, it as publicEventPricingCurrency, j as parseFooterCompositionV1, k as parseMailingListProviderScope, kt as unsafeAsMediaAssetId, l as EVENT_PRESET_VALUES, m as CANCELLED_SESSION_STATUS, mt as parseEventSeriesId, n as NAVIGATION_LOCATIONS, nt as formatEventPricing, ot as publicEventPricingType, p as publicReadFreshnessSeconds, pt as parseApiKeyId, q as getLocalScheduleTime, r as areConfiguredBookingVerticalConfigsEqual, rt as isPublicEventPricingOptionDisplayable, s as resolveSiteVerticalBookingConfig, st as resolveExactOrFreePriceDisplay, t as resolveEventCatalogue, tt as formatBookingPriceDisplay, v as exposeSecret, vt as parseUserId, w as parseMailingListSignedSourceToken, x as buildMailingListSignupBlockSourceRef, y as parseManagementKey, yt as unsafeAsAppointmentResourceId, z as buildBookingUtcDateWindow, zt as unsafeAsStaffMemberId } from "../src-DQ0xnGOE.mjs";
|
|
4
|
+
import { $ as sdkListEventsResponseSchema, A as resolveMediaTransformForAspect, B as asRecord$1, C as walkAndCollectImageAttrs, D as normalizeWidthCandidates, E as rotateNormalizedPoint, F as buildMediaIdentifierFromFilename, G as parseSafeDownloadFilename, H as FILE_SIZE_LIMITS, I as parseMediaIdentifier, J as createHttpClient, K as ManagementApiError, L as deriveVideoSlotPolicy, M as getDirectImageUrlForSiteScopedPath, N as getImageUrl, O as isExplicitRectCrop, P as isSiteScopedDirectImageStoragePath, Q as sdkGetEventResponseSchema, R as resolveVideoSelectionIntentForMediaField, S as buildRenderableMediaAssetIndex, St as sdkConfiguredBookingVerticalConfigSchema, T as looksLikeUuid$1, U as classifyKnownMimeType, V as parseRelativeStoragePath, W as managementMediaLibraryUploadLimitForMimeType, X as managementTransportError, Y as is404Error, Z as sdkConfigureBookingVerticalResponseSchema, _ as buildSettingsUpdateInput, _t as sdkSavePageDesignResponseSchema, a as prepareLocalMediaForPush, at as customLinkSchema$1, b as isMediaValue, bt as sdkListEventOccurrencesResponseSchema, c as writeBinaryFileAtomic, ct as internalLinkSchema, d as normalizeMediaValueToIdentifierOnly, dt as isInternalResolvedLinkValue, et as sdkTakeEventOfflineResponseSchema, f as walkLocalContentMedia, ft as isResolvedInternalLinkEntityType, g as SETTINGS_FILE_FIELDS, gt as sdkGetPageDesignResponseSchema, h as extractMediaIdentifiers, ht as portablePageDesignSchema, i as applyLocalMediaPush, it as RESOLVED_INTERNAL_LINK_ENTITY_TYPES, j as getDirectImageUrlForRelativePath, k as parseAspectRatioValue, l as sha256, lt as internalResolvedLinkSchema, m as downloadMedia, mt as pageLinkSchema$1, nt as sdkSettingsUpdateSchema, o as admitBinaryWriteDestination, ot as entryLinkSchema$1, p as buildStorageUrl, pt as linkSchema, q as buildRequestInfo, r as syncLocalMediaForPull, rt as linkPayloadSchema, s as readStableBinaryFile, st as externalLinkSchema$1, t as revalidateLocalMediaPushPlan, tt as sdkUpsertEventResponseSchema, u as normalizeMediaIdentifierInput, ut as internalRouteOnlyLinkSchema, v as hasOwnSettingsField, vt as sdkDeleteEventOccurrenceResponseSchema, w as deleteEnvSpecificKeys, x as attachRenderableMediaAssetFields, xt as sdkReorderResponseSchema, y as writeMediaManifest, yt as sdkEventOccurrenceResponseSchema, z as getMimeType } from "../local-sync-But5fsta.mjs";
|
|
5
|
+
import { n as CliSdkPeerError, r as CLI_VERSION, t as loadConfigFile } from "../load-config-4qWCVvBe.mjs";
|
|
6
|
+
import { a as RichTextDocSchema, c as isRecord$16, i as findUnfilledSentinels, n as buildEntryScaffold, o as isRichTextDoc, r as validateEntryInstance, s as isObjectRecord, t as eventUpsertInputSchema } from "../eventUpsertInputSchema-IPfgjpZN.mjs";
|
|
7
|
+
import { a as prepareScaffoldExecution, c as LOCAL_PACKAGE_VENDOR_DIR, d as loadGeneratedPackageRanges, i as preflightScaffoldTargets, n as createScaffoldCompletion, s as deriveScaffoldLocalManifest, t as deriveScaffoldPlan } from "../plan-tejzSw1n.mjs";
|
|
8
8
|
import { config } from "dotenv";
|
|
9
9
|
import { Command, CommanderError } from "commander";
|
|
10
10
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -5569,7 +5569,8 @@ const CLIENT_ERROR_REPORT_LIMITS = {
|
|
|
5569
5569
|
stack: 8e3,
|
|
5570
5570
|
digest: 128,
|
|
5571
5571
|
componentStack: 8e3,
|
|
5572
|
-
sourceLocation: 1024
|
|
5572
|
+
sourceLocation: 1024,
|
|
5573
|
+
navigationAgeMs: 6e4
|
|
5573
5574
|
};
|
|
5574
5575
|
const clientErrorEventSchema = z.enum([
|
|
5575
5576
|
"dashboard:route-error",
|
|
@@ -5586,7 +5587,17 @@ const clientErrorReportSchema = z.object({
|
|
|
5586
5587
|
stack: z.string().max(CLIENT_ERROR_REPORT_LIMITS.stack).nullable(),
|
|
5587
5588
|
digest: z.string().max(CLIENT_ERROR_REPORT_LIMITS.digest).nullable(),
|
|
5588
5589
|
componentStack: z.string().max(CLIENT_ERROR_REPORT_LIMITS.componentStack).nullable(),
|
|
5589
|
-
sourceLocation: z.string().max(CLIENT_ERROR_REPORT_LIMITS.sourceLocation).nullable()
|
|
5590
|
+
sourceLocation: z.string().max(CLIENT_ERROR_REPORT_LIMITS.sourceLocation).nullable(),
|
|
5591
|
+
navigation: z.object({
|
|
5592
|
+
fromPathname: z.string().regex(/^\/[^?#]*$/).max(CLIENT_ERROR_REPORT_LIMITS.pathname),
|
|
5593
|
+
toPathname: z.string().regex(/^\/[^?#]*$/).max(CLIENT_ERROR_REPORT_LIMITS.pathname),
|
|
5594
|
+
type: z.enum([
|
|
5595
|
+
"push",
|
|
5596
|
+
"replace",
|
|
5597
|
+
"traverse"
|
|
5598
|
+
]),
|
|
5599
|
+
ageMs: z.number().int().min(0).max(CLIENT_ERROR_REPORT_LIMITS.navigationAgeMs)
|
|
5600
|
+
}).strict().nullable().optional()
|
|
5590
5601
|
}).strict();
|
|
5591
5602
|
|
|
5592
5603
|
//#endregion
|
|
@@ -9346,24 +9357,6 @@ const ENDPOINT_DEFINITIONS = {
|
|
|
9346
9357
|
"server:internal_error"
|
|
9347
9358
|
]
|
|
9348
9359
|
},
|
|
9349
|
-
syncBookingPassWithStripe: {
|
|
9350
|
-
path: "/sites/{siteId}/bookings/passes/{passId}/sync-stripe",
|
|
9351
|
-
method: "POST",
|
|
9352
|
-
tags: [
|
|
9353
|
-
"site-{siteId}",
|
|
9354
|
-
"passes-{siteId}",
|
|
9355
|
-
"pass-{passId}"
|
|
9356
|
-
],
|
|
9357
|
-
auth: "user",
|
|
9358
|
-
responseKind: "json",
|
|
9359
|
-
errors: [
|
|
9360
|
-
"validation:invalid_input",
|
|
9361
|
-
"auth:forbidden",
|
|
9362
|
-
"resource:not_found",
|
|
9363
|
-
"resource:conflict",
|
|
9364
|
-
"server:internal_error"
|
|
9365
|
-
]
|
|
9366
|
-
},
|
|
9367
9360
|
refundCustomerPass: {
|
|
9368
9361
|
path: "/sites/{siteId}/bookings/customer-passes/{customerPassId}/refund",
|
|
9369
9362
|
method: "POST",
|
|
@@ -10827,7 +10820,7 @@ const ENDPOINT_DEFINITIONS = {
|
|
|
10827
10820
|
]
|
|
10828
10821
|
},
|
|
10829
10822
|
cancelFlexibleBalanceBookingDueToNonPayment: {
|
|
10830
|
-
path: "/sites/{siteId}/shop/orders/{orderId}/
|
|
10823
|
+
path: "/sites/{siteId}/shop/orders/{orderId}/flexible-balance/cancel-due-to-non-payment",
|
|
10831
10824
|
method: "POST",
|
|
10832
10825
|
auth: "user",
|
|
10833
10826
|
responseKind: "json",
|
|
@@ -10838,7 +10831,7 @@ const ENDPOINT_DEFINITIONS = {
|
|
|
10838
10831
|
]
|
|
10839
10832
|
},
|
|
10840
10833
|
reopenFlexibleBalanceBookingAfterNonPaymentCancellation: {
|
|
10841
|
-
path: "/sites/{siteId}/shop/orders/{orderId}/
|
|
10834
|
+
path: "/sites/{siteId}/shop/orders/{orderId}/flexible-balance/reopen",
|
|
10842
10835
|
method: "POST",
|
|
10843
10836
|
auth: "user",
|
|
10844
10837
|
responseKind: "json",
|
|
@@ -11704,14 +11697,14 @@ async function createAuthenticatedApiClient(supabase) {
|
|
|
11704
11697
|
}
|
|
11705
11698
|
return createCMSClient(authHeaders$1);
|
|
11706
11699
|
}
|
|
11707
|
-
function createRawCMSClient(
|
|
11700
|
+
function createRawCMSClient(getHeaders = () => ({}), baseUrl) {
|
|
11708
11701
|
return ({ endpoint: endpoint$1, body, params, options = {} }) => {
|
|
11709
11702
|
const plan = buildApiRequestPlan({
|
|
11710
11703
|
endpoint: endpoint$1,
|
|
11711
11704
|
body,
|
|
11712
11705
|
params,
|
|
11713
11706
|
options,
|
|
11714
|
-
headers,
|
|
11707
|
+
headers: getHeaders(),
|
|
11715
11708
|
baseUrl: normalizeCmsApiBaseUrl(baseUrl ?? resolveApiBaseUrl()),
|
|
11716
11709
|
sdkVersion
|
|
11717
11710
|
});
|
|
@@ -11838,7 +11831,7 @@ function createParsedClient(rawClient) {
|
|
|
11838
11831
|
};
|
|
11839
11832
|
}
|
|
11840
11833
|
function createCMSClient(headers = {}, baseUrl) {
|
|
11841
|
-
return createParsedClient(createRawCMSClient(headers, baseUrl));
|
|
11834
|
+
return createParsedClient(createRawCMSClient(() => headers, baseUrl));
|
|
11842
11835
|
}
|
|
11843
11836
|
const createServerAPIClient = (apiKey, baseUrl) => {
|
|
11844
11837
|
const normalizedApiKey = normalizeCmsApiKey(apiKey);
|
|
@@ -11852,8 +11845,7 @@ function createInternalAPIClient(baseUrl) {
|
|
|
11852
11845
|
return createCMSClient({}, baseUrl);
|
|
11853
11846
|
}
|
|
11854
11847
|
function createBearerAPIClient(token, baseUrl) {
|
|
11855
|
-
|
|
11856
|
-
return createCMSClient(authHeaders$1, baseUrl);
|
|
11848
|
+
return createParsedClient(createRawCMSClient(() => ({ Authorization: `Bearer ${typeof token === "function" ? token() : token}` }), baseUrl));
|
|
11857
11849
|
}
|
|
11858
11850
|
|
|
11859
11851
|
//#endregion
|
|
@@ -26795,67 +26787,8 @@ function groupItemsByDate(items, accessors) {
|
|
|
26795
26787
|
|
|
26796
26788
|
//#endregion
|
|
26797
26789
|
//#region ../blocks/src/system/blocks/shared/bookingPaymentTerms.ts
|
|
26798
|
-
const
|
|
26799
|
-
const
|
|
26800
|
-
z.object({
|
|
26801
|
-
kind: z.literal("deposit_plus_one_remainder"),
|
|
26802
|
-
depositAmountCents: z.number().int().min(0),
|
|
26803
|
-
depositRefundability: bookingDepositRefundPolicySchema$1,
|
|
26804
|
-
remainderDueCount: z.number().int().positive(),
|
|
26805
|
-
intervalUnit: z.enum([
|
|
26806
|
-
"day",
|
|
26807
|
-
"week",
|
|
26808
|
-
"month"
|
|
26809
|
-
])
|
|
26810
|
-
}),
|
|
26811
|
-
z.object({
|
|
26812
|
-
kind: z.literal("deposit_plus_scheduled_instalments"),
|
|
26813
|
-
depositAmountCents: z.number().int().min(0),
|
|
26814
|
-
depositRefundability: bookingDepositRefundPolicySchema$1,
|
|
26815
|
-
instalmentCount: z.number().int().positive(),
|
|
26816
|
-
intervalCount: z.number().int().positive(),
|
|
26817
|
-
intervalUnit: z.enum([
|
|
26818
|
-
"day",
|
|
26819
|
-
"week",
|
|
26820
|
-
"month"
|
|
26821
|
-
])
|
|
26822
|
-
}),
|
|
26823
|
-
z.object({
|
|
26824
|
-
kind: z.literal("equal_scheduled_instalments"),
|
|
26825
|
-
instalmentCount: z.number().int().positive(),
|
|
26826
|
-
intervalCount: z.number().int().positive(),
|
|
26827
|
-
intervalUnit: z.enum([
|
|
26828
|
-
"day",
|
|
26829
|
-
"week",
|
|
26830
|
-
"month"
|
|
26831
|
-
])
|
|
26832
|
-
})
|
|
26833
|
-
]);
|
|
26834
|
-
const bookingFlexibleBalanceDueDateRuleSchema$1 = z.union([z.object({
|
|
26835
|
-
kind: z.literal("relative_to_start_date"),
|
|
26836
|
-
daysBeforeStart: z.number().int().positive()
|
|
26837
|
-
}), z.object({
|
|
26838
|
-
kind: z.literal("fixed_calendar_date"),
|
|
26839
|
-
dueAt: z.string().datetime()
|
|
26840
|
-
})]);
|
|
26841
|
-
const bookingFlexibleBalanceConfigSchema$1 = z.object({
|
|
26842
|
-
upfrontAmountCents: z.number().int().min(0),
|
|
26843
|
-
dueDateRule: bookingFlexibleBalanceDueDateRuleSchema$1,
|
|
26844
|
-
depositRefundability: bookingDepositRefundPolicySchema$1
|
|
26845
|
-
});
|
|
26846
|
-
const blockBookingPaymentCollectionOptionSchema = z.union([
|
|
26847
|
-
z.object({ kind: z.literal("upfront") }),
|
|
26848
|
-
z.object({ kind: z.literal("deferred_manual") }),
|
|
26849
|
-
z.object({
|
|
26850
|
-
kind: z.literal("instalment_plan"),
|
|
26851
|
-
plan: bookingInstalmentPlanSchema$1
|
|
26852
|
-
}),
|
|
26853
|
-
z.object({
|
|
26854
|
-
kind: z.literal("flexible_balance"),
|
|
26855
|
-
config: bookingFlexibleBalanceConfigSchema$1
|
|
26856
|
-
})
|
|
26857
|
-
]);
|
|
26858
|
-
const blockBookingPaymentTermsSchema = z.object({ allowedOptions: z.array(blockBookingPaymentCollectionOptionSchema).min(1) });
|
|
26790
|
+
const blockBookingPaymentCollectionOptionSchema = bookingPaymentCollectionOptionSchema;
|
|
26791
|
+
const blockBookingPaymentTermsSchema = bookingPaymentTermsSchema;
|
|
26859
26792
|
|
|
26860
26793
|
//#endregion
|
|
26861
26794
|
//#region ../blocks/src/system/blocks/shared/bookingConsent.ts
|
|
@@ -34103,23 +34036,17 @@ function getBookingServicePaymentSelectionMode(service) {
|
|
|
34103
34036
|
if (allowedKinds.length === 0) {
|
|
34104
34037
|
return "implicit_upfront";
|
|
34105
34038
|
}
|
|
34106
|
-
if (allowedKinds.
|
|
34107
|
-
|
|
34108
|
-
|
|
34109
|
-
|
|
34110
|
-
|
|
34111
|
-
|
|
34112
|
-
|
|
34113
|
-
|
|
34114
|
-
|
|
34115
|
-
|
|
34116
|
-
default: return assertNever$7(onlyKind);
|
|
34117
|
-
}
|
|
34039
|
+
if (!validateBookingPaymentOptionKinds(allowedKinds).ok) return "unsupported";
|
|
34040
|
+
if (allowedKinds.length > 1) return "choice_required";
|
|
34041
|
+
const onlyKind = allowedKinds[0];
|
|
34042
|
+
switch (onlyKind) {
|
|
34043
|
+
case "upfront": return "implicit_upfront";
|
|
34044
|
+
case "deferred_manual": return "implicit_deferred_manual";
|
|
34045
|
+
case "instalment_plan": return "implicit_instalment_plan";
|
|
34046
|
+
case "flexible_balance": return "implicit_flexible_balance";
|
|
34047
|
+
case undefined: return "unsupported";
|
|
34048
|
+
default: return assertNever$7(onlyKind);
|
|
34118
34049
|
}
|
|
34119
|
-
if (allowedKinds.length === 2 && allowedKinds.includes("upfront") && (allowedKinds.includes("deferred_manual") || allowedKinds.includes("instalment_plan") || allowedKinds.includes("flexible_balance"))) {
|
|
34120
|
-
return "choice_required";
|
|
34121
|
-
}
|
|
34122
|
-
return "unsupported";
|
|
34123
34050
|
}
|
|
34124
34051
|
function resolveDefaultBookingServiceId(formConfig, services) {
|
|
34125
34052
|
const configuredServiceId = toTrimmedString(formConfig?.settings?.serviceId);
|
|
@@ -40094,7 +40021,7 @@ const publicPassProductCollectionSchema = z.object({ passes: z.array(publicPassP
|
|
|
40094
40021
|
/**
|
|
40095
40022
|
* Public membership product for shop display
|
|
40096
40023
|
*/
|
|
40097
|
-
const
|
|
40024
|
+
const publicMembershipProductFields = {
|
|
40098
40025
|
id: z.string(),
|
|
40099
40026
|
name: z.string(),
|
|
40100
40027
|
description: z.string().nullable(),
|
|
@@ -40103,7 +40030,16 @@ const publicMembershipProductSchema = z.object({
|
|
|
40103
40030
|
billingInterval: z.enum(["month", "year"]),
|
|
40104
40031
|
eligibleCategoryIds: z.array(z.string()),
|
|
40105
40032
|
eligibleCategoryNames: z.array(z.string())
|
|
40033
|
+
};
|
|
40034
|
+
const purchasablePublicMembershipProductSchema = z.object({
|
|
40035
|
+
...publicMembershipProductFields,
|
|
40036
|
+
purchaseAvailability: z.literal("purchasable")
|
|
40106
40037
|
});
|
|
40038
|
+
const publicMembershipProductSchema = z.discriminatedUnion("purchaseAvailability", [purchasablePublicMembershipProductSchema, z.object({
|
|
40039
|
+
...publicMembershipProductFields,
|
|
40040
|
+
purchaseAvailability: z.literal("display_only"),
|
|
40041
|
+
unavailabilityReason: z.literal("online_payments_unavailable")
|
|
40042
|
+
})]);
|
|
40107
40043
|
const publicMembershipProductCollectionSchema = z.object({ memberships: z.array(publicMembershipProductSchema) });
|
|
40108
40044
|
|
|
40109
40045
|
//#endregion
|
|
@@ -40491,7 +40427,7 @@ function buildPassesMembershipsDisplay(options) {
|
|
|
40491
40427
|
product: pass
|
|
40492
40428
|
} : {
|
|
40493
40429
|
kind: "unavailable",
|
|
40494
|
-
label: "Online purchasing
|
|
40430
|
+
label: "Online purchasing is unavailable."
|
|
40495
40431
|
}
|
|
40496
40432
|
};
|
|
40497
40433
|
});
|
|
@@ -40501,7 +40437,14 @@ function buildPassesMembershipsDisplay(options) {
|
|
|
40501
40437
|
description: options.showDescriptions ? membership.description : null,
|
|
40502
40438
|
priceLabel: formatCommercePrice(membership.price, membership.currency),
|
|
40503
40439
|
intervalLabel: formatInterval(membership.billingInterval),
|
|
40504
|
-
|
|
40440
|
+
action: membership.purchaseAvailability === "purchasable" ? {
|
|
40441
|
+
kind: "purchase",
|
|
40442
|
+
label: options.membershipActionLabel,
|
|
40443
|
+
product: membership
|
|
40444
|
+
} : {
|
|
40445
|
+
kind: "unavailable",
|
|
40446
|
+
label: "Online purchasing is unavailable."
|
|
40447
|
+
}
|
|
40505
40448
|
}));
|
|
40506
40449
|
return {
|
|
40507
40450
|
kind: "passes-memberships",
|
|
@@ -40729,7 +40672,14 @@ const membershipCardDisplaySchema = z.object({
|
|
|
40729
40672
|
description: z.string().nullable(),
|
|
40730
40673
|
priceLabel: z.string(),
|
|
40731
40674
|
intervalLabel: z.string(),
|
|
40732
|
-
|
|
40675
|
+
action: z.discriminatedUnion("kind", [z.object({
|
|
40676
|
+
kind: z.literal("purchase"),
|
|
40677
|
+
label: z.string(),
|
|
40678
|
+
product: purchasablePublicMembershipProductSchema
|
|
40679
|
+
}), z.object({
|
|
40680
|
+
kind: z.literal("unavailable"),
|
|
40681
|
+
label: z.string()
|
|
40682
|
+
})])
|
|
40733
40683
|
});
|
|
40734
40684
|
const passesMembershipsDisplaySchema = z.object({
|
|
40735
40685
|
kind: z.literal("passes-memberships"),
|
|
@@ -47769,11 +47719,11 @@ function ShopSSR({ blockId, siteId, apiBaseUrl, stage, children, checkoutEndpoin
|
|
|
47769
47719
|
}, pass.id)),
|
|
47770
47720
|
membershipCards: render.display.memberships.map((membership) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MembershipCardView, {
|
|
47771
47721
|
display: membership,
|
|
47772
|
-
action: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThemedButton, {
|
|
47722
|
+
action: membership.action.kind === "unavailable" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PassPurchaseUnavailable, { label: membership.action.label }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThemedButton, {
|
|
47773
47723
|
type: "button",
|
|
47774
47724
|
variant: render.hydration.buttonVariant,
|
|
47775
47725
|
size: "md",
|
|
47776
|
-
label: membership.
|
|
47726
|
+
label: membership.action.label,
|
|
47777
47727
|
disabled: true,
|
|
47778
47728
|
"aria-disabled": "true"
|
|
47779
47729
|
})
|
|
@@ -84988,6 +84938,7 @@ function toWritableLocalEvent(event) {
|
|
|
84988
84938
|
...event.courseBooking ? { courseBooking: event.courseBooking } : {},
|
|
84989
84939
|
administrativeStatus: event.administrativeStatus,
|
|
84990
84940
|
title: event.title,
|
|
84941
|
+
categoryRef: event.categoryRef,
|
|
84991
84942
|
slug: event.slug,
|
|
84992
84943
|
path: event.path,
|
|
84993
84944
|
preset: event.preset,
|
|
@@ -86390,6 +86341,9 @@ function parseLocalEventRun(raw, filePath) {
|
|
|
86390
86341
|
const fields$2 = raw;
|
|
86391
86342
|
assertLocalEventRunRefs(fields$2, filePath);
|
|
86392
86343
|
assertLocalEventRunVisibility(fields$2, filePath);
|
|
86344
|
+
if ("categoryRef" in fields$2) {
|
|
86345
|
+
throw new InvalidLocalEventScheduleIdentityError(filePath, "Move categoryRef to the parent Event file");
|
|
86346
|
+
}
|
|
86393
86347
|
const { presentation: _retiredPresentation, ...run } = raw;
|
|
86394
86348
|
return {
|
|
86395
86349
|
...run,
|
|
@@ -89417,6 +89371,7 @@ function mapEventToComparable(e) {
|
|
|
89417
89371
|
slug: e.slug,
|
|
89418
89372
|
path: e.path,
|
|
89419
89373
|
preset: e.preset,
|
|
89374
|
+
categoryRef: e.categoryRef,
|
|
89420
89375
|
runRefs: e.runRefs,
|
|
89421
89376
|
content: e.content,
|
|
89422
89377
|
blocks: e.blocks
|
|
@@ -89434,7 +89389,6 @@ function mapEventRunToComparable(run) {
|
|
|
89434
89389
|
capacity: run.capacity,
|
|
89435
89390
|
bookingOffer: run.bookingOffer,
|
|
89436
89391
|
venueRef: run.venueRef,
|
|
89437
|
-
categoryRef: run.categoryRef,
|
|
89438
89392
|
formRef: run.formRef,
|
|
89439
89393
|
settings: run.settings,
|
|
89440
89394
|
tags: run.tags
|
|
@@ -91331,7 +91285,6 @@ function normalizeRemoteRun(run) {
|
|
|
91331
91285
|
capacity: run.capacity,
|
|
91332
91286
|
bookingOffer: normalizeCanonicalBookingOffer(run.bookingOffer),
|
|
91333
91287
|
venueRef: run.venueRef,
|
|
91334
|
-
categoryRef: run.categoryRef,
|
|
91335
91288
|
formRef: run.formRef,
|
|
91336
91289
|
settings: run.settings,
|
|
91337
91290
|
tags: [...run.tags]
|
|
@@ -91351,7 +91304,6 @@ function normalizeLocalRun(local, remote) {
|
|
|
91351
91304
|
capacity: overrideWhenDefined(local.capacity, base.capacity, (value) => typeof value === "number" ? value : null),
|
|
91352
91305
|
bookingOffer: overrideWhenDefined(local.bookingOffer, base.bookingOffer, normalizeCanonicalBookingOffer),
|
|
91353
91306
|
venueRef: overrideWhenDefined(local.venueRef, base.venueRef, normalizeNullableString),
|
|
91354
|
-
categoryRef: overrideWhenDefined(local.categoryRef, base.categoryRef, normalizeNullableString),
|
|
91355
91307
|
formRef: overrideWhenDefined(local.formRef, base.formRef, normalizeNullableString),
|
|
91356
91308
|
settings: overrideWhenDefined(local.settings, base.settings, (value) => isRecord$11(value) ? value : {}),
|
|
91357
91309
|
tags: overrideWhenDefined(local.tags, base.tags, (value) => Array.isArray(value) ? value : [])
|
|
@@ -91367,6 +91319,7 @@ function normalizeRemoteEventGraph(graph) {
|
|
|
91367
91319
|
slug: graph.event.slug,
|
|
91368
91320
|
path: graph.event.path,
|
|
91369
91321
|
preset: graph.event.preset,
|
|
91322
|
+
categoryRef: graph.event.categoryRef,
|
|
91370
91323
|
runRefs: [...graph.event.runRefs],
|
|
91371
91324
|
content: graph.event.content,
|
|
91372
91325
|
blocks: graph.event.blocks ?? {}
|
|
@@ -91385,6 +91338,7 @@ function normalizeLocalEventGraph(graph, remote) {
|
|
|
91385
91338
|
slug: graph.event.slug,
|
|
91386
91339
|
path: graph.event.path ?? remote.event.path,
|
|
91387
91340
|
preset: graph.event.preset,
|
|
91341
|
+
categoryRef: overrideWhenDefined(graph.event.categoryRef, remote.event.categoryRef, normalizeNullableString),
|
|
91388
91342
|
runRefs: [...graph.event.runRefs],
|
|
91389
91343
|
content: { ...graph.event.content ?? remote.event.content },
|
|
91390
91344
|
blocks: graph.event.blocks ?? remote.event.blocks ?? {}
|
|
@@ -91399,7 +91353,6 @@ function normalizeLocalEventGraph(graph, remote) {
|
|
|
91399
91353
|
capacity: run.capacity ?? null,
|
|
91400
91354
|
bookingOffer: normalizeCanonicalBookingOffer(run.bookingOffer),
|
|
91401
91355
|
venueRef: run.venueRef ?? null,
|
|
91402
|
-
categoryRef: run.categoryRef ?? null,
|
|
91403
91356
|
formRef: run.formRef ?? null,
|
|
91404
91357
|
settings: run.settings ?? {},
|
|
91405
91358
|
tags: run.tags ?? [],
|
|
@@ -92440,7 +92393,7 @@ function buildEventSeriesCommand(event, run, schedule, offer) {
|
|
|
92440
92393
|
...event.courseBooking ? { courseBooking: event.courseBooking } : {},
|
|
92441
92394
|
timezone: schedule.timeZone,
|
|
92442
92395
|
venueIdentifier: run.venueRef ?? undefined,
|
|
92443
|
-
categoryIdentifier:
|
|
92396
|
+
categoryIdentifier: event.categoryRef ?? undefined,
|
|
92444
92397
|
formIdentifier: run.formRef ?? undefined,
|
|
92445
92398
|
capacity: eventCapacity(run.capacity),
|
|
92446
92399
|
bookingOffer: offer.bookingOffer,
|
|
@@ -92692,7 +92645,6 @@ function eventRunUpsertInput(command, eventIdentifier) {
|
|
|
92692
92645
|
capacity: capacityLimit(input.capacity),
|
|
92693
92646
|
bookingOffer: input.bookingOffer,
|
|
92694
92647
|
venueRef: preferredRef(input.venueIdentifier, input.venueRef),
|
|
92695
|
-
categoryRef: preferredRef(input.categoryIdentifier, input.categoryRef),
|
|
92696
92648
|
formRef: preferredRef(input.formIdentifier, input.formRef),
|
|
92697
92649
|
settings: input.settings,
|
|
92698
92650
|
tags: input.tags ? [...input.tags] : undefined
|
|
@@ -92705,6 +92657,7 @@ function eventSeriesUpsertInput(command) {
|
|
|
92705
92657
|
identifier: eventIdentifier,
|
|
92706
92658
|
...input.courseBooking ? { courseBooking: input.courseBooking } : {},
|
|
92707
92659
|
title: input.title,
|
|
92660
|
+
categoryRef: preferredRef(input.categoryIdentifier, input.categoryRef),
|
|
92708
92661
|
slug: eventIdentifier,
|
|
92709
92662
|
path: input.path,
|
|
92710
92663
|
preset: input.preset,
|
|
@@ -95601,6 +95554,18 @@ async function findCommonStaleItems(localSource, remote, force) {
|
|
|
95601
95554
|
}
|
|
95602
95555
|
async function prepareCommonPushOperations(input, source) {
|
|
95603
95556
|
const preparedLocal = applyStaleContentSnapshot(source.filteredLocal, source.remote, source.staleItems);
|
|
95557
|
+
const kindChange = findPageBlockKindChange(input.scope, preparedLocal.pages, source.remote.pages);
|
|
95558
|
+
if (kindChange) return preparationError("preflight-failed", kindChange);
|
|
95559
|
+
const content = await prepareCommonPushContent(input, source, preparedLocal);
|
|
95560
|
+
if (!("media" in content)) return content;
|
|
95561
|
+
const bookingPlan = findCompiledBookingSettingsPlan(content.compiled);
|
|
95562
|
+
const bookingPreview = bookingPlan ? await executeBookingSettingsPreview(input.client, bookingPlan, source.remote.meta.settingsUpdatedAt) : undefined;
|
|
95563
|
+
return {
|
|
95564
|
+
...content,
|
|
95565
|
+
...bookingPreview ? { bookingPreview } : {}
|
|
95566
|
+
};
|
|
95567
|
+
}
|
|
95568
|
+
async function prepareCommonPushContent(input, source, preparedLocal) {
|
|
95604
95569
|
const media$1 = await prepareLocalMediaForPush({
|
|
95605
95570
|
contentDir: source.contentDir,
|
|
95606
95571
|
content: preparedLocal,
|
|
@@ -95625,17 +95590,25 @@ async function prepareCommonPushOperations(input, source) {
|
|
|
95625
95590
|
if (!preflight.ok || contentPushExecutionReportHasFailures(preflight.report)) {
|
|
95626
95591
|
return preparationError("preflight-failed", "Content push command preflight failed.", preflight.report);
|
|
95627
95592
|
}
|
|
95628
|
-
const bookingPlan = findCompiledBookingSettingsPlan(preflight.compiled);
|
|
95629
|
-
const bookingPreview = bookingPlan ? await executeBookingSettingsPreview(input.client, bookingPlan, source.remote.meta.settingsUpdatedAt) : undefined;
|
|
95630
95593
|
return {
|
|
95631
95594
|
media: media$1,
|
|
95632
95595
|
filteredLocal: media$1.content,
|
|
95633
95596
|
diff,
|
|
95634
95597
|
preflight: preflight.report,
|
|
95635
|
-
compiled: preflight.compiled
|
|
95636
|
-
...bookingPreview ? { bookingPreview } : {}
|
|
95598
|
+
compiled: preflight.compiled
|
|
95637
95599
|
};
|
|
95638
95600
|
}
|
|
95601
|
+
function findPageBlockKindChange(scope, localPages, remotePages) {
|
|
95602
|
+
if (scope !== "all" && scope !== "pages") return undefined;
|
|
95603
|
+
const remoteByPage = new Map(remotePages.map((page) => [page.identifier, page]));
|
|
95604
|
+
return localPages.flatMap((page) => {
|
|
95605
|
+
const remoteBlocks = new Map(remoteByPage.get(page.identifier)?.blocks.map((block) => [block.identifier, block.kind]) ?? []);
|
|
95606
|
+
return (page.blocks ?? []).flatMap((block) => {
|
|
95607
|
+
const currentKind = remoteBlocks.get(block.identifier);
|
|
95608
|
+
return currentKind && currentKind !== block.kind ? [`${page.identifier}/${block.identifier}: This block already uses ${currentKind}. To use ${block.kind}, create a block with a new identifier, then remove this one.`] : [];
|
|
95609
|
+
});
|
|
95610
|
+
})[0];
|
|
95611
|
+
}
|
|
95639
95612
|
async function executeBookingSettingsPreview(client, compiled, expectedRevision) {
|
|
95640
95613
|
const command = requireSingleBookingCommand(compiled);
|
|
95641
95614
|
if (!command.ok) throw command.error;
|
|
@@ -103679,7 +103652,7 @@ async function loadConfig(configPath, output) {
|
|
|
103679
103652
|
return { errorMessage: "No config path provided." };
|
|
103680
103653
|
}
|
|
103681
103654
|
try {
|
|
103682
|
-
const { loadConfigFile: loadConfigFile$1 } = await import("../load-config-
|
|
103655
|
+
const { loadConfigFile: loadConfigFile$1 } = await import("../load-config-BmrIcDxY.mjs");
|
|
103683
103656
|
const rawConfig = await loadConfigFile$1(configPath);
|
|
103684
103657
|
const parsed = riverbankSiteConfigSchema.safeParse(rawConfig);
|
|
103685
103658
|
if (!parsed.success) {
|
|
@@ -115123,8 +115096,7 @@ const blockedDisabledPathFragments = [
|
|
|
115123
115096
|
"/customer-passes",
|
|
115124
115097
|
"/customer-memberships",
|
|
115125
115098
|
"/credit/",
|
|
115126
|
-
"/refund"
|
|
115127
|
-
"/sync-stripe"
|
|
115099
|
+
"/refund"
|
|
115128
115100
|
];
|
|
115129
115101
|
const allowedPathPrefixes = [
|
|
115130
115102
|
"/sites/{siteId}/ai/assistant",
|
|
@@ -116359,6 +116331,7 @@ const CANONICAL_REFUND_PLANNER_ERROR_CODES = [
|
|
|
116359
116331
|
"refund_failed"
|
|
116360
116332
|
];
|
|
116361
116333
|
const CANONICAL_ADMIN_REFUND_FAILURE_CODES = [
|
|
116334
|
+
"refund_blocked_by_live_payment_terms",
|
|
116362
116335
|
...CANONICAL_REFUND_PLANNER_ERROR_CODES,
|
|
116363
116336
|
"payment_intent_not_found",
|
|
116364
116337
|
"stripe_error",
|
|
@@ -116409,6 +116382,7 @@ function classifyCustomerMembershipPaymentRefundCode(code) {
|
|
|
116409
116382
|
//#endregion
|
|
116410
116383
|
//#region ../api/src/bookingRefundOutcomes.ts
|
|
116411
116384
|
const STANDARD_LINE_ITEM_REFUND_INVALID_CODES = [
|
|
116385
|
+
"refund_blocked_by_live_payment_terms",
|
|
116412
116386
|
"missing_amount",
|
|
116413
116387
|
"invalid_amount",
|
|
116414
116388
|
"amount_exceeds_remaining",
|
|
@@ -118202,6 +118176,7 @@ const BOOKING_SETTINGS_SECTION_KEYS = {
|
|
|
118202
118176
|
|
|
118203
118177
|
//#endregion
|
|
118204
118178
|
//#region ../api/src/bookingConfig.ts
|
|
118179
|
+
/** Every option kind; the checkout routes validate the requested kind against it. */
|
|
118205
118180
|
const DIRECT_CHECKOUT_COLLECTION_OPTION_KINDS = [
|
|
118206
118181
|
"upfront",
|
|
118207
118182
|
"deferred_manual",
|
|
@@ -118294,69 +118269,6 @@ function resolveBookingSettingsEventCatalogue(settings) {
|
|
|
118294
118269
|
});
|
|
118295
118270
|
}
|
|
118296
118271
|
|
|
118297
|
-
//#endregion
|
|
118298
|
-
//#region ../api/src/bookingPaymentTermSchemas.ts
|
|
118299
|
-
const bookingDepositRefundPolicySchema = z.enum(["refundable", "non_refundable"]);
|
|
118300
|
-
const bookingInstalmentPlanSchema = z.discriminatedUnion("kind", [
|
|
118301
|
-
z.object({
|
|
118302
|
-
kind: z.literal("deposit_plus_one_remainder"),
|
|
118303
|
-
depositAmountCents: z.number().int().nonnegative(),
|
|
118304
|
-
depositRefundability: bookingDepositRefundPolicySchema,
|
|
118305
|
-
remainderDueCount: z.number().int().positive(),
|
|
118306
|
-
intervalUnit: z.enum([
|
|
118307
|
-
"day",
|
|
118308
|
-
"week",
|
|
118309
|
-
"month"
|
|
118310
|
-
])
|
|
118311
|
-
}),
|
|
118312
|
-
z.object({
|
|
118313
|
-
kind: z.literal("deposit_plus_scheduled_instalments"),
|
|
118314
|
-
depositAmountCents: z.number().int().nonnegative(),
|
|
118315
|
-
depositRefundability: bookingDepositRefundPolicySchema,
|
|
118316
|
-
instalmentCount: z.number().int().positive(),
|
|
118317
|
-
intervalCount: z.number().int().positive(),
|
|
118318
|
-
intervalUnit: z.enum([
|
|
118319
|
-
"day",
|
|
118320
|
-
"week",
|
|
118321
|
-
"month"
|
|
118322
|
-
])
|
|
118323
|
-
}),
|
|
118324
|
-
z.object({
|
|
118325
|
-
kind: z.literal("equal_scheduled_instalments"),
|
|
118326
|
-
instalmentCount: z.number().int().positive(),
|
|
118327
|
-
intervalCount: z.number().int().positive(),
|
|
118328
|
-
intervalUnit: z.enum([
|
|
118329
|
-
"day",
|
|
118330
|
-
"week",
|
|
118331
|
-
"month"
|
|
118332
|
-
])
|
|
118333
|
-
})
|
|
118334
|
-
]);
|
|
118335
|
-
const bookingFlexibleBalanceDueDateRuleSchema = z.discriminatedUnion("kind", [z.object({
|
|
118336
|
-
kind: z.literal("relative_to_start_date"),
|
|
118337
|
-
daysBeforeStart: z.number().int().positive()
|
|
118338
|
-
}), z.object({
|
|
118339
|
-
kind: z.literal("fixed_calendar_date"),
|
|
118340
|
-
dueAt: z.string().datetime()
|
|
118341
|
-
})]);
|
|
118342
|
-
const bookingFlexibleBalanceConfigSchema = z.object({
|
|
118343
|
-
upfrontAmountCents: z.number().int().nonnegative(),
|
|
118344
|
-
dueDateRule: bookingFlexibleBalanceDueDateRuleSchema,
|
|
118345
|
-
depositRefundability: bookingDepositRefundPolicySchema
|
|
118346
|
-
});
|
|
118347
|
-
const bookingPaymentCollectionOptionSchema = z.discriminatedUnion("kind", [
|
|
118348
|
-
z.object({ kind: z.literal("upfront") }),
|
|
118349
|
-
z.object({ kind: z.literal("deferred_manual") }),
|
|
118350
|
-
z.object({
|
|
118351
|
-
kind: z.literal("instalment_plan"),
|
|
118352
|
-
plan: bookingInstalmentPlanSchema
|
|
118353
|
-
}),
|
|
118354
|
-
z.object({
|
|
118355
|
-
kind: z.literal("flexible_balance"),
|
|
118356
|
-
config: bookingFlexibleBalanceConfigSchema
|
|
118357
|
-
})
|
|
118358
|
-
]);
|
|
118359
|
-
|
|
118360
118272
|
//#endregion
|
|
118361
118273
|
//#region ../api/src/emailSettings.ts
|
|
118362
118274
|
/**
|
|
@@ -671,6 +671,7 @@ Footer links are managed via the site's footer navigation menu (see `content/nav
|
|
|
671
671
|
"identifier": "yoga-class",
|
|
672
672
|
"title": "Morning Yoga Class",
|
|
673
673
|
"preset": "class",
|
|
674
|
+
"categoryRef": "workshop",
|
|
674
675
|
"runRefs": ["yoga-class"],
|
|
675
676
|
"runs": [
|
|
676
677
|
{
|
|
@@ -692,7 +693,6 @@ Footer links are managed via the site's footer navigation menu (see `content/nav
|
|
|
692
693
|
}
|
|
693
694
|
],
|
|
694
695
|
"venueRef": "main-hall",
|
|
695
|
-
"categoryRef": "workshop",
|
|
696
696
|
"capacity": 30,
|
|
697
697
|
"bookingOffer": {
|
|
698
698
|
"bookingRequirement": "required",
|
|
@@ -741,7 +741,7 @@ Footer links are managed via the site's footer navigation menu (see `content/nav
|
|
|
741
741
|
whether a registration selects one occurrence or the complete series.
|
|
742
742
|
- Each run's `occurrences` is its complete authored schedule. Instants use canonical UTC
|
|
743
743
|
ISO datetimes and every item carries the event's IANA timezone.
|
|
744
|
-
-
|
|
744
|
+
- The Event's `categoryRef` references an event-category identifier and is shared by every run. A run's `venueRef` references a venue identifier.
|
|
745
745
|
- `status`: "draft", "active", "completed", "cancelled", or "archived"
|
|
746
746
|
- `visibility`: "public" (listed on the site and findable in search) or
|
|
747
747
|
"unlisted" (the link works and people can book, but it is left out of
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as classifySdkEventSchedule, i as sdkEventUpsertOptionalFieldSchemas, n as sdkCourseBookingSettingsSchema, o as classifySdkEventBookingOffer } from "./sdk-event-upsert-
|
|
3
|
-
import { l as EVENT_PRESET_VALUES } from "./src-
|
|
2
|
+
import { a as classifySdkEventSchedule, i as sdkEventUpsertOptionalFieldSchemas, n as sdkCourseBookingSettingsSchema, o as classifySdkEventBookingOffer } from "./sdk-event-upsert-TGjuLLJp.mjs";
|
|
3
|
+
import { l as EVENT_PRESET_VALUES } from "./src-DQ0xnGOE.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region ../blocks/src/lib/typeGuards.ts
|
|
@@ -4749,7 +4749,6 @@ const eventRunInputSchema = z.object({
|
|
|
4749
4749
|
bookingOffer: eventBookingOfferInputSchema.optional(),
|
|
4750
4750
|
capacity: sdkEventUpsertOptionalFieldSchemas.capacity,
|
|
4751
4751
|
venueRef: z.string().nullable().optional(),
|
|
4752
|
-
categoryRef: z.string().nullable().optional(),
|
|
4753
4752
|
formRef: z.string().nullable().optional(),
|
|
4754
4753
|
settings: z.record(z.string(), z.unknown()).optional(),
|
|
4755
4754
|
tags: z.array(z.string()).optional()
|
|
@@ -4758,6 +4757,7 @@ const eventUpsertInputSchema = z.object({
|
|
|
4758
4757
|
identifier: z.string().min(1).optional(),
|
|
4759
4758
|
courseBooking: sdkCourseBookingSettingsSchema.optional(),
|
|
4760
4759
|
title: z.string().min(1, "title is required"),
|
|
4760
|
+
categoryRef: z.string().nullable().optional(),
|
|
4761
4761
|
slug: z.string().min(1).optional(),
|
|
4762
4762
|
content: z.record(z.string(), z.unknown()).optional(),
|
|
4763
4763
|
blocks: sdkEntrySlotBlocksInputSchema.optional(),
|
|
@@ -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.
|
|
10
|
+
var version = "0.15.0";
|
|
11
11
|
var peerDependencies = { "@riverbankcms/sdk": ">=0.139.0 <1.0.0" };
|
|
12
12
|
var package_default = {
|
|
13
13
|
name: "riverbankcms",
|
|
@@ -83,7 +83,7 @@ var package_default = {
|
|
|
83
83
|
//#endregion
|
|
84
84
|
//#region src/version.ts
|
|
85
85
|
/** The package manifest is the source-run fallback; builds inject this value. */
|
|
86
|
-
const CLI_VERSION = typeof "0.
|
|
86
|
+
const CLI_VERSION = typeof "0.15.0" === "string" ? "0.15.0" : version;
|
|
87
87
|
/**
|
|
88
88
|
* The CLI's SDK peer range is bundled from the CLI manifest alongside its
|
|
89
89
|
* version. Runtime config loading uses this value as the single compatibility
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { T as eventBookingOfferIntentSchema,
|
|
3
|
-
import { At as
|
|
2
|
+
import { T as eventBookingOfferIntentSchema, _n as pageDesignIntentSchemaVersion, br as asPageFlowPresetId, d as stableStringify, dn as buttonStyleSelectionSchema, gn as pageDesignBoundaryTreatmentSchema, n as sdkCourseBookingSettingsSchema, nt as themeSchema, r as sdkEventOccurrenceInputSchema, s as eventVisibilitySchema, vr as asAppearancePresetId, xr as asSiteStyleId } from "./sdk-event-upsert-TGjuLLJp.mjs";
|
|
3
|
+
import { At as unsafeAsOccurrenceId, Bt as unsafeAsStorageBucketName, Dt as unsafeAsEventSeriesId, Et as unsafeAsEventOfferingId, Ft as unsafeAsSafeDownloadFilename, Gt as ok, Ht as unsafeAsUploadSessionId, It as unsafeAsSiteFontId, J as parseUtcIsoDateTimeString, Lt as unsafeAsSiteId, Mt as unsafeAsPositiveByteCount, Nt as unsafeAsPositiveSeconds, Ot as unsafeAsFileChecksumSha256, Pt as unsafeAsProductId, Rt as unsafeAsSiteScopedStoragePath, St as unsafeAsDeclaredMimeType, Tt as unsafeAsEntitlementId, Ut as unsafeAsUserId, Vt as unsafeAsStoragePath, Wt as err, _t as parseSiteId, a as parseVerticalId, bt as unsafeAsBookingRequirementId, ft as assertNever, i as canonicalizeConfiguredBookingVerticalConfig, j as parseFooterCompositionV1, jt as unsafeAsOriginalFilename, kt as unsafeAsMediaAssetId, l as EVENT_PRESET_VALUES, lt as fromArray, o as parseVerticalPresetId, s as resolveSiteVerticalBookingConfig, ut as mapNonEmptyArray, v as exposeSecret, wt as unsafeAsDetectedMimeType, xt as unsafeAsBookingSessionId } from "./src-DQ0xnGOE.mjs";
|
|
4
4
|
import * as fs$1 from "fs/promises";
|
|
5
5
|
import * as path$1 from "path";
|
|
6
6
|
import { z } from "zod";
|
|
@@ -823,6 +823,7 @@ const sdkPullEventSchema = z.object({
|
|
|
823
823
|
slug: sdkIdentifierSchema$1,
|
|
824
824
|
path: z.string().nullable(),
|
|
825
825
|
preset: z.enum(EVENT_PRESET_VALUES),
|
|
826
|
+
categoryRef: z.string().nullable(),
|
|
826
827
|
runRefs: z.tuple([sdkIdentifierSchema$1], sdkIdentifierSchema$1),
|
|
827
828
|
content: sdkJsonObjectSchema$1,
|
|
828
829
|
updatedAt: sdkTimestampSchema$2,
|
|
@@ -847,7 +848,6 @@ const sdkPullEventRunSchema = z.object({
|
|
|
847
848
|
capacity: z.number().int().nonnegative().nullable(),
|
|
848
849
|
bookingOffer: eventBookingOfferIntentSchema,
|
|
849
850
|
venueRef: z.string().nullable(),
|
|
850
|
-
categoryRef: z.string().nullable(),
|
|
851
851
|
formRef: z.string().nullable(),
|
|
852
852
|
settings: sdkJsonObjectSchema$1,
|
|
853
853
|
presentation: z.unknown().optional(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { Gt as ok, Wt as err, _t as parseSiteId } from "./src-DQ0xnGOE.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";
|
package/dist/scaffold/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "../src-
|
|
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-
|
|
2
|
+
import "../src-DQ0xnGOE.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-tejzSw1n.mjs";
|
|
4
4
|
|
|
5
5
|
export { deriveGeneratedPackageRanges, deriveScaffoldLocalManifest, deriveScaffoldPlan, findPackageManifestPath, loadGeneratedPackageRanges, preflightScaffoldPlan, preflightScaffoldTargets, prepareScaffoldExecution, writeScaffoldFiles };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { A as footerNavigationLayouts, F as isPresent, J as parseUtcIsoDateTimeString, N as isCanonicalRichTextDoc, Q as parseBookingTimeZone,
|
|
2
|
+
import { $ as validateBookingPaymentOptionKinds, A as footerNavigationLayouts, F as isPresent, Gt as ok, J as parseUtcIsoDateTimeString, N as isCanonicalRichTextDoc, Q as parseBookingTimeZone, Wt as err, b as stableJsonStringify, ft as assertNever, j as parseFooterCompositionV1, l as EVENT_PRESET_VALUES, n as NAVIGATION_LOCATIONS, s as resolveSiteVerticalBookingConfig, u as ORDINARY_EVENT_PRESET_VALUES } from "./src-DQ0xnGOE.mjs";
|
|
3
3
|
import "node:module";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
@@ -5741,7 +5741,6 @@ function reducePageDesignIntentForStructureEvent(intent, event) {
|
|
|
5741
5741
|
};
|
|
5742
5742
|
case "block-removed": return removeBlockFromPageDesignIntent(intent, event.blockId);
|
|
5743
5743
|
case "blocks-reordered": return pruneBoundaryPinsForOrder(intent, event.orderedBlockIds);
|
|
5744
|
-
case "block-kind-changed": return changeBlockKindInPageDesignIntent(intent, event);
|
|
5745
5744
|
case "block-duplicated": return duplicateBlockInPageDesignIntent(intent, event);
|
|
5746
5745
|
default: return assertNever$1(event, "Unhandled page design structure event");
|
|
5747
5746
|
}
|
|
@@ -5864,33 +5863,6 @@ function pruneBoundaryPinsForOrder(intent, orderedBlockIds) {
|
|
|
5864
5863
|
issues: removedBoundaryIssues
|
|
5865
5864
|
};
|
|
5866
5865
|
}
|
|
5867
|
-
/**
|
|
5868
|
-
* A block-kind change updates the pin's current block kind so future resolution sees
|
|
5869
|
-
* the current tree. If the pinned Look is incompatible, the pin remains stored and
|
|
5870
|
-
* the resolver must render a safe auto fallback while the user-facing issue is open.
|
|
5871
|
-
*/
|
|
5872
|
-
function changeBlockKindInPageDesignIntent(intent, event) {
|
|
5873
|
-
const blockLookPins = intent.blockLookPins.map((pin) => pin.blockId === event.blockId ? {
|
|
5874
|
-
...pin,
|
|
5875
|
-
blockKind: event.nextBlockKind
|
|
5876
|
-
} : pin);
|
|
5877
|
-
const changed = intent.blockLookPins.find((pin) => pin.blockId === event.blockId);
|
|
5878
|
-
const incompatiblePinnedLook = changed && !event.compatiblePinnedLookPresetIds.includes(changed.choice.value) ? changed : null;
|
|
5879
|
-
return {
|
|
5880
|
-
intent: {
|
|
5881
|
-
...intent,
|
|
5882
|
-
blockLookPins
|
|
5883
|
-
},
|
|
5884
|
-
issues: incompatiblePinnedLook ? [{
|
|
5885
|
-
kind: "pinned-look-incompatible-with-block-kind",
|
|
5886
|
-
blockId: event.blockId,
|
|
5887
|
-
presetId: incompatiblePinnedLook.choice.value,
|
|
5888
|
-
previousBlockKind: incompatiblePinnedLook.blockKind,
|
|
5889
|
-
nextBlockKind: event.nextBlockKind,
|
|
5890
|
-
feedback: "user-facing"
|
|
5891
|
-
}] : []
|
|
5892
|
-
};
|
|
5893
|
-
}
|
|
5894
5866
|
function boundaryIssuePresetId(treatment) {
|
|
5895
5867
|
if (typeof treatment === "string") return treatment;
|
|
5896
5868
|
return boundaryOptionIdForTreatment(treatment) ?? unknownBoundaryOptionId;
|
|
@@ -30140,6 +30112,117 @@ const courseBookingSettingsSchema = z.object({
|
|
|
30140
30112
|
}).strict()
|
|
30141
30113
|
}).strict();
|
|
30142
30114
|
|
|
30115
|
+
//#endregion
|
|
30116
|
+
//#region ../core/src/booking-payment-schemas.ts
|
|
30117
|
+
const stripObject = (shape) => z.object(shape);
|
|
30118
|
+
const strictObject = (shape) => z.strictObject(shape);
|
|
30119
|
+
const depositRefundPolicySchema = z.enum(["refundable", "non_refundable"]);
|
|
30120
|
+
const intervalUnitSchema = z.enum([
|
|
30121
|
+
"day",
|
|
30122
|
+
"week",
|
|
30123
|
+
"month"
|
|
30124
|
+
]);
|
|
30125
|
+
const nonNegativeIntegerSchema$1 = z.number().int().nonnegative();
|
|
30126
|
+
const positiveIntegerSchema$1 = z.number().int().positive();
|
|
30127
|
+
function createInstalmentPlanSchema(object) {
|
|
30128
|
+
return z.discriminatedUnion("kind", [
|
|
30129
|
+
object({
|
|
30130
|
+
kind: z.literal("deposit_plus_one_remainder"),
|
|
30131
|
+
depositAmountCents: nonNegativeIntegerSchema$1,
|
|
30132
|
+
depositRefundability: depositRefundPolicySchema,
|
|
30133
|
+
remainderDueCount: positiveIntegerSchema$1,
|
|
30134
|
+
intervalUnit: intervalUnitSchema
|
|
30135
|
+
}),
|
|
30136
|
+
object({
|
|
30137
|
+
kind: z.literal("deposit_plus_scheduled_instalments"),
|
|
30138
|
+
depositAmountCents: nonNegativeIntegerSchema$1,
|
|
30139
|
+
depositRefundability: depositRefundPolicySchema,
|
|
30140
|
+
instalmentCount: positiveIntegerSchema$1,
|
|
30141
|
+
intervalCount: positiveIntegerSchema$1,
|
|
30142
|
+
intervalUnit: intervalUnitSchema
|
|
30143
|
+
}),
|
|
30144
|
+
object({
|
|
30145
|
+
kind: z.literal("equal_scheduled_instalments"),
|
|
30146
|
+
instalmentCount: positiveIntegerSchema$1,
|
|
30147
|
+
intervalCount: positiveIntegerSchema$1,
|
|
30148
|
+
intervalUnit: intervalUnitSchema
|
|
30149
|
+
})
|
|
30150
|
+
]);
|
|
30151
|
+
}
|
|
30152
|
+
function createFlexibleBalanceSchemas(object) {
|
|
30153
|
+
const dueDateRule = z.discriminatedUnion("kind", [object({
|
|
30154
|
+
kind: z.literal("relative_to_start_date"),
|
|
30155
|
+
daysBeforeStart: positiveIntegerSchema$1
|
|
30156
|
+
}), object({
|
|
30157
|
+
kind: z.literal("fixed_calendar_date"),
|
|
30158
|
+
dueAt: z.string().datetime()
|
|
30159
|
+
})]);
|
|
30160
|
+
const config = object({
|
|
30161
|
+
upfrontAmountCents: nonNegativeIntegerSchema$1,
|
|
30162
|
+
dueDateRule,
|
|
30163
|
+
depositRefundability: depositRefundPolicySchema
|
|
30164
|
+
});
|
|
30165
|
+
return {
|
|
30166
|
+
dueDateRule,
|
|
30167
|
+
config
|
|
30168
|
+
};
|
|
30169
|
+
}
|
|
30170
|
+
const paymentOptionKindsMessages = {
|
|
30171
|
+
no_options: "Choose at least one way for customers to pay.",
|
|
30172
|
+
duplicate_kind: "Choose each payment option only once.",
|
|
30173
|
+
incompatible_collection_options: "Offer instalments or a deposit with the rest paid later, but not both."
|
|
30174
|
+
};
|
|
30175
|
+
function buildBookingPaymentOptionSchemas(object) {
|
|
30176
|
+
const instalmentPlan = createInstalmentPlanSchema(object);
|
|
30177
|
+
const flexibleBalance = createFlexibleBalanceSchemas(object);
|
|
30178
|
+
const paymentCollectionOption = z.discriminatedUnion("kind", [
|
|
30179
|
+
object({ kind: z.literal("upfront") }),
|
|
30180
|
+
object({ kind: z.literal("deferred_manual") }),
|
|
30181
|
+
object({
|
|
30182
|
+
kind: z.literal("instalment_plan"),
|
|
30183
|
+
plan: instalmentPlan
|
|
30184
|
+
}),
|
|
30185
|
+
object({
|
|
30186
|
+
kind: z.literal("flexible_balance"),
|
|
30187
|
+
config: flexibleBalance.config
|
|
30188
|
+
})
|
|
30189
|
+
]);
|
|
30190
|
+
const paymentTerms = object({ allowedOptions: z.array(paymentCollectionOption) }).superRefine(({ allowedOptions }, ctx) => {
|
|
30191
|
+
const result = validateBookingPaymentOptionKinds(allowedOptions.map(({ kind }) => kind));
|
|
30192
|
+
if (!result.ok) {
|
|
30193
|
+
ctx.addIssue({
|
|
30194
|
+
code: "custom",
|
|
30195
|
+
path: ["allowedOptions"],
|
|
30196
|
+
message: paymentOptionKindsMessages[result.error]
|
|
30197
|
+
});
|
|
30198
|
+
}
|
|
30199
|
+
});
|
|
30200
|
+
const paymentOptionsChoice = z.discriminatedUnion("source", [z.strictObject({ source: z.literal("default") }), z.strictObject({
|
|
30201
|
+
source: z.literal("custom"),
|
|
30202
|
+
paymentTerms
|
|
30203
|
+
})]);
|
|
30204
|
+
return {
|
|
30205
|
+
depositRefundPolicy: depositRefundPolicySchema,
|
|
30206
|
+
instalmentPlan,
|
|
30207
|
+
flexibleBalanceDueDateRule: flexibleBalance.dueDateRule,
|
|
30208
|
+
flexibleBalanceConfig: flexibleBalance.config,
|
|
30209
|
+
paymentCollectionOption,
|
|
30210
|
+
paymentTerms,
|
|
30211
|
+
paymentOptionsChoice
|
|
30212
|
+
};
|
|
30213
|
+
}
|
|
30214
|
+
function createBookingPaymentOptionSchemas(mode) {
|
|
30215
|
+
return mode === "strict" ? buildBookingPaymentOptionSchemas(strictObject) : buildBookingPaymentOptionSchemas(stripObject);
|
|
30216
|
+
}
|
|
30217
|
+
const bookingPaymentOptionSchemas = createBookingPaymentOptionSchemas("strip");
|
|
30218
|
+
const bookingDepositRefundPolicySchema = bookingPaymentOptionSchemas.depositRefundPolicy;
|
|
30219
|
+
const bookingInstalmentPlanSchema = bookingPaymentOptionSchemas.instalmentPlan;
|
|
30220
|
+
const bookingFlexibleBalanceDueDateRuleSchema = bookingPaymentOptionSchemas.flexibleBalanceDueDateRule;
|
|
30221
|
+
const bookingFlexibleBalanceConfigSchema = bookingPaymentOptionSchemas.flexibleBalanceConfig;
|
|
30222
|
+
const bookingPaymentCollectionOptionSchema = bookingPaymentOptionSchemas.paymentCollectionOption;
|
|
30223
|
+
const bookingPaymentTermsSchema = bookingPaymentOptionSchemas.paymentTerms;
|
|
30224
|
+
const bookingPaymentOptionsChoiceSchema = bookingPaymentOptionSchemas.paymentOptionsChoice;
|
|
30225
|
+
|
|
30143
30226
|
//#endregion
|
|
30144
30227
|
//#region ../site-commands/src/eventBookingOffer.ts
|
|
30145
30228
|
const pricingMetadataFields = {
|
|
@@ -30235,81 +30318,7 @@ const eventPricingIntentSchema = z.discriminatedUnion("kind", [
|
|
|
30235
30318
|
tieredPricingSchema,
|
|
30236
30319
|
slidingScalePricingSchema
|
|
30237
30320
|
]);
|
|
30238
|
-
const
|
|
30239
|
-
z.object({
|
|
30240
|
-
kind: z.literal("deposit_plus_one_remainder"),
|
|
30241
|
-
depositAmountCents: nonNegativeIntegerSchema,
|
|
30242
|
-
depositRefundability: z.enum(["refundable", "non_refundable"]),
|
|
30243
|
-
remainderDueCount: positiveIntegerSchema,
|
|
30244
|
-
intervalUnit: z.enum([
|
|
30245
|
-
"day",
|
|
30246
|
-
"week",
|
|
30247
|
-
"month"
|
|
30248
|
-
])
|
|
30249
|
-
}).strict(),
|
|
30250
|
-
z.object({
|
|
30251
|
-
kind: z.literal("deposit_plus_scheduled_instalments"),
|
|
30252
|
-
depositAmountCents: nonNegativeIntegerSchema,
|
|
30253
|
-
depositRefundability: z.enum(["refundable", "non_refundable"]),
|
|
30254
|
-
instalmentCount: positiveIntegerSchema,
|
|
30255
|
-
intervalCount: positiveIntegerSchema,
|
|
30256
|
-
intervalUnit: z.enum([
|
|
30257
|
-
"day",
|
|
30258
|
-
"week",
|
|
30259
|
-
"month"
|
|
30260
|
-
])
|
|
30261
|
-
}).strict(),
|
|
30262
|
-
z.object({
|
|
30263
|
-
kind: z.literal("equal_scheduled_instalments"),
|
|
30264
|
-
instalmentCount: positiveIntegerSchema,
|
|
30265
|
-
intervalCount: positiveIntegerSchema,
|
|
30266
|
-
intervalUnit: z.enum([
|
|
30267
|
-
"day",
|
|
30268
|
-
"week",
|
|
30269
|
-
"month"
|
|
30270
|
-
])
|
|
30271
|
-
}).strict()
|
|
30272
|
-
]);
|
|
30273
|
-
const flexibleBalanceDueDateRuleSchema = z.discriminatedUnion("kind", [z.object({
|
|
30274
|
-
kind: z.literal("relative_to_start_date"),
|
|
30275
|
-
daysBeforeStart: positiveIntegerSchema
|
|
30276
|
-
}).strict(), z.object({
|
|
30277
|
-
kind: z.literal("fixed_calendar_date"),
|
|
30278
|
-
dueAt: isoDateTimeSchema
|
|
30279
|
-
}).strict()]);
|
|
30280
|
-
const paymentCollectionOptionSchema = z.discriminatedUnion("kind", [
|
|
30281
|
-
z.object({ kind: z.literal("upfront") }).strict(),
|
|
30282
|
-
z.object({ kind: z.literal("deferred_manual") }).strict(),
|
|
30283
|
-
z.object({
|
|
30284
|
-
kind: z.literal("instalment_plan"),
|
|
30285
|
-
plan: instalmentPlanSchema
|
|
30286
|
-
}).strict(),
|
|
30287
|
-
z.object({
|
|
30288
|
-
kind: z.literal("flexible_balance"),
|
|
30289
|
-
config: z.object({
|
|
30290
|
-
upfrontAmountCents: nonNegativeIntegerSchema,
|
|
30291
|
-
dueDateRule: flexibleBalanceDueDateRuleSchema,
|
|
30292
|
-
depositRefundability: z.enum(["refundable", "non_refundable"])
|
|
30293
|
-
}).strict()
|
|
30294
|
-
}).strict()
|
|
30295
|
-
]);
|
|
30296
|
-
const eventPaymentTermsIntentSchema = z.object({ allowedOptions: z.array(paymentCollectionOptionSchema).min(1).max(2) }).strict().superRefine(({ allowedOptions }, ctx) => {
|
|
30297
|
-
const kinds = allowedOptions.map(({ kind }) => kind);
|
|
30298
|
-
if (new Set(kinds).size !== kinds.length) {
|
|
30299
|
-
ctx.addIssue({
|
|
30300
|
-
code: "custom",
|
|
30301
|
-
path: ["allowedOptions"],
|
|
30302
|
-
message: "Payment option kinds must be unique"
|
|
30303
|
-
});
|
|
30304
|
-
}
|
|
30305
|
-
if (kinds.length === 2 && !kinds.includes("upfront")) {
|
|
30306
|
-
ctx.addIssue({
|
|
30307
|
-
code: "custom",
|
|
30308
|
-
path: ["allowedOptions"],
|
|
30309
|
-
message: "Two payment options must include upfront"
|
|
30310
|
-
});
|
|
30311
|
-
}
|
|
30312
|
-
});
|
|
30321
|
+
const eventPaymentTermsIntentSchema = createBookingPaymentOptionSchemas("strict").paymentTerms;
|
|
30313
30322
|
const eventBookingOfferIntentSchema = z.discriminatedUnion("bookingRequirement", [z.object({
|
|
30314
30323
|
bookingRequirement: z.literal("none"),
|
|
30315
30324
|
pricing: freePricingSchema,
|
|
@@ -33711,4 +33720,4 @@ function parseSdkEventRunUpsertInput(input, runIndex, options) {
|
|
|
33711
33720
|
}
|
|
33712
33721
|
|
|
33713
33722
|
//#endregion
|
|
33714
|
-
export {
|
|
33723
|
+
export { readHeaderNavFontSizePreference as $, cssVarValue as $n, themeButtonExtraClassesWithTrailingIcon as $t, pickShadeTowardBackground as A, pageDesignEditorBackgroundOverrideOwner as An, introCompositionTreatmentValues as Ar, FONT_WEIGHT_MAP as At, createNavigationRef as B, renderCssDeclarations as Bn, featuresFromHex as Br, generateButtonCss as Bt, pagePathForCommand as C, transitionCatalogueEntries as Cn, defineBlockDesignCapability as Cr, NAV_LINK_PADDING_MAP as Ct, bookingPaymentTermsSchema as D, resolveOnColorForThemeToken as Dn, eyebrowTreatmentValues as Dr, navLinkOwnsHoverForeground as Dt, bookingPaymentCollectionOptionSchema as E, isCssColorLiteral as En, eventListTreatmentValues as Er, navLinkHoverColorCandidate as Et, createContentEntryRef as F, mediaTypeDiscriminants as Fn, visibleHeadingDecorationFamilyValues as Fr, ACCORDION_SPACING_MAP as Ft, slugPart as G, cardVariantRoleValues as Gn, contextualButtonSurfaceStyles as Gt, createSiteCommandSiteRef as H, getTextColorForBackground as Hn, oklchToHexGamut as Hr, resolvedButtonColourDeclarations as Ht, createEventCategoryRef as I, persistableMediaSchema as In, isOnColorBackgroundCandidateToken as Ir, ACCORDION_TRIGGER_FONT_SCALE as It, headerLeafTextColor as J, backgroundAppearanceQuickColorTokenNames as Jn, generateDefaultButtonSystem as Jt, effectiveHeaderNavLinkStyle as K, normalizeCardRole as Kn, deriveButtonSurfaceContext as Kt, createEventSeriesRef as L, generateCardCoreCss as Ln, onColorTokenName as Lr, ACCORDION_TRIGGER_LETTER_SPACING as Lt, createBlockRef as M, stripStaleTransitionStyleGroup as Mn, offeringsPreviewCompositionTreatmentValues as Mr, INPUT_SPACING_MAP as Mt, createBlocksRef as N, mediaIdentifierSchema as Nn, testimonialsCompositionTreatmentValues as Nr, LABEL_FONT_SIZE_MAP as Nt, require_jsx_runtime as O, resolveThemeColorReferenceValue as On, featureCardCompositionTreatmentValues as Or, navLinkOwnsUnderline as Ot, createCommandRef as P, mediaSchema as Pn, tileTreatmentValues as Pr, ACCORDION_OPEN_ACCENT_THICKNESS as Pt, mergeHeaderNavTypographyPreference as Q, borderColorStyle as Qn, parseThemeButtonVariantId as Qt, createFooterRef as R, getDefaultCardVariants as Rn, ORDINARY_TEXT_MIN_CONTRAST_RATIO as Rr, ICON_CONFIG as Rt, pageIdentifierForCommand as S, anglePolygonCss as Sn, assertNever$1 as Sr, NAV_LINK_LETTER_SPACING_MAP as St, eventBookingOfferIntentSchema as T, boxBackgroundSchema as Tn, defineNoBlockDesignCapability as Tr, NAV_LINK_TEXT_SIZE_MAP as Tt, createVenueRef as U, generateShadowValue$1 as Un, __toESM as Ur, resolvedButtonFocusDeclarations as Ut, createPageRef as V, expandPalette as Vn, hexToRgb as Vr, RESOLVED_BUTTON_DISABLED_DECLARATIONS as Vt, refSlug as W, cardRoleSchema as Wn, contextualButtonSurfaceResetStyles as Wt, readOpeningForegroundProjection as X, TokenResolver as Xn, generateBaseInteractiveCSS as Xt, transparentHeaderForegroundInput as Y, parseBackgroundAppearanceColorToken as Yn, generateEffectsCSS as Yt, getNavLinkPreset as Z, backgroundColorStyle as Zn, generateInteractiveChildInheritanceCSS as Zt, getSiteCommandMetadata as _, pageDesignIntentSchemaVersion as _n, defineBlockDesignMetadata as _r, getComponentBorderWidthPx as _t, classifySdkEventSchedule as a, generateShadowValue as an, surfaceToneFromForegroundToken as ar, getHeaderPaintTargets as at, entryIdentifierForCommand as b, sectionFactsForContent as bn, asPageFlowPresetId as br, parseCustomCssRules as bt, isEventVisibility as c, GRADIENT_PRESET_IDS as cn, surfaceForegroundDeclarations as cr, BREAKPOINT_MD as ct, stableStringify as d, buttonStyleSelectionSchema as dn, surfaceForegroundValue as dr, MQ_LG_UP as dt, themeButtonSizeClassName as en, mergeStyles as er, headerRootPaint as et, createDryRunReport as f, PUBLIC_BUTTON_ROLES as fn, parseThemeColorToken as fr, MQ_MD_DOWN as ft, evaluateSiteCommandExposure as g, pageDesignBoundaryTreatmentSchema as gn, defaultThemeTokens as gr, headerVariantValues as gt, evaluateSiteCommandBatchExposure as h, unsafeAsOpaqueButtonColourToken as hn, buildThemeTokens as hr, MQ_TABLET_ONLY as ht, sdkEventUpsertOptionalFieldSchemas as i, formatButtonColourContractError as in, selectLogoVariant as ir, generateMobileOverlayBackdropFilterFix as it, generateCssVars as j, siteChromeBackgroundOverrideOwner as jn, makeBoundaryId as jr, INPUT_FONT_SIZE_MAP as jt, require_react as k, resolveTokenOrCssColorValue as kn, headingDecorationColorTokenValues as kr, navEffectPolicy as kt, venueManagementFields as l, getGradientPreset as ln, surfaceForegroundInputFromResolved as lr, BREAKPOINT_SM as lt, mapEventCommandContent as m, buttonVariantIdSchema as mn, parseColorTokenParts as mr, MQ_SM_UP as mt, sdkCourseBookingSettingsSchema as n, parseThemeForPersistence as nn, textColorStyle as nr, themeSchema as nt, classifySdkEventBookingOffer as o, footerModeSchema as on, resolveSurfaceForeground as or, renderHeaderPaintTargetRules as ot, parseAndPlanCommandBatchForTypes as p, VARIANT_ROLES as pn, parseBlockColorToken as pr, MQ_SM_DOWN as pt, headerForegroundCandidates as q, backgroundAppearanceColorTokenNames as qn, resolveContextualButtonRole as qt, sdkEventOccurrenceInputSchema as r, compileButtonColourStates as rn, textColorValue as rr, generateHeaderScrollTreatmentStyles as rt, eventVisibilitySchema as s, gradientToCss as sn, DEFAULT_SURFACE_TEXT_COLOR as sr, BREAKPOINT_LG as st, classifySdkEventTiming as t, themeButtonVariantClassNames as tn, rgbColorValue as tr, getCuratedSiteStyle as tt, sortRecord as u, parseGradientPresetId as un, surfaceForegroundStyle as ur, BREAKPOINT_XL as ut, blockIdentifierForCommand as v, boundaryLayout as vn, asAppearancePresetId as vr, getComponentShadowVar as vt, hasConfiguredBookingVertical as w, boxBackgroundOverlaySchema as wn, defineFrameCapability as wr, NAV_LINK_PADDING_X_MAP as wt, pageIdentifierForBlockCommand as x, boundaryRuntimeMetricsForDecorativeTransition as xn, asSiteStyleId as xr, NAV_LINK_BORDER_RADIUS_MAP as xt, blockOrderIdentifiersForCommand as y, composeBoundary as yn, asDesignBlockId as yr, parseBlockCustomCssRules as yt, createFormRef as z, generateCardCss as zn, contrastRatio as zr, ICON_SIZE_PX as zt };
|
|
@@ -92,6 +92,7 @@ const unsafeAsFormSubmissionId = (id) => id;
|
|
|
92
92
|
const unsafeAsPassId = (id) => id;
|
|
93
93
|
const unsafeAsMembershipId = (id) => id;
|
|
94
94
|
const unsafeAsCustomerId = (id) => id;
|
|
95
|
+
const unsafeAsOrderRetirementOperationId = (id) => id;
|
|
95
96
|
const unsafeAsOrderId = (id) => id;
|
|
96
97
|
const unsafeAsOrderItemId = (id) => id;
|
|
97
98
|
const unsafeAsOrderRefundId = (id) => id;
|
|
@@ -203,6 +204,7 @@ const parseEventSeriesRegistrationId = (value) => parseUuidBrand(value, unsafeAs
|
|
|
203
204
|
const parseParticipantId = (value) => parseUuidBrand(value, unsafeAsParticipantId);
|
|
204
205
|
const parseParticipantParticipationId = (value) => parseUuidBrand(value, unsafeAsParticipantParticipationId);
|
|
205
206
|
const parseOrderItemId = (value) => parseUuidBrand(value, unsafeAsOrderItemId);
|
|
207
|
+
const parseOrderRetirementOperationId = (value) => parseUuidBrand(value, unsafeAsOrderRetirementOperationId);
|
|
206
208
|
const parseOrderId = (value) => parseUuidBrand(value, unsafeAsOrderId);
|
|
207
209
|
const parseOrderRefundId = (value) => parseUuidBrand(value, unsafeAsOrderRefundId);
|
|
208
210
|
const parseOrderPaymentReceiptId = (value) => parseUuidBrand(value, unsafeAsOrderPaymentReceiptId);
|
|
@@ -1474,21 +1476,16 @@ function resolveFlexibleBalancePaymentEligibility(input) {
|
|
|
1474
1476
|
};
|
|
1475
1477
|
}
|
|
1476
1478
|
switch (input.status) {
|
|
1477
|
-
case "payment_pending":
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
case "cancelled_due_to_non_payment": return {
|
|
1482
|
-
kind: "unavailable",
|
|
1483
|
-
reason: "cancelled_due_to_non_payment"
|
|
1484
|
-
};
|
|
1485
|
-
case "refunded": return {
|
|
1479
|
+
case "payment_pending":
|
|
1480
|
+
case "cancelled_due_to_non_payment":
|
|
1481
|
+
case "refunded":
|
|
1482
|
+
case "waived": return {
|
|
1486
1483
|
kind: "unavailable",
|
|
1487
|
-
reason:
|
|
1484
|
+
reason: input.status
|
|
1488
1485
|
};
|
|
1489
|
-
case "
|
|
1486
|
+
case "closed_order_failed": return {
|
|
1490
1487
|
kind: "unavailable",
|
|
1491
|
-
reason: "
|
|
1488
|
+
reason: "order_failed"
|
|
1492
1489
|
};
|
|
1493
1490
|
case "overdue": return {
|
|
1494
1491
|
kind: "full_balance_only",
|
|
@@ -1681,6 +1678,126 @@ function assertNever$3(value) {
|
|
|
1681
1678
|
throw new Error(`Unexpected value: ${String(value)}`);
|
|
1682
1679
|
}
|
|
1683
1680
|
|
|
1681
|
+
//#endregion
|
|
1682
|
+
//#region ../core/src/booking-instalment-deposit.ts
|
|
1683
|
+
/**
|
|
1684
|
+
* A plan that starts with a deposit takes it by card when the customer books
|
|
1685
|
+
* and saves the card for the later payments, so the deposit must be at least
|
|
1686
|
+
* the card minimum for the site's currency. Plans without a deposit step
|
|
1687
|
+
* (equal instalments) charge their first instalment instead and are not
|
|
1688
|
+
* checked here.
|
|
1689
|
+
*/
|
|
1690
|
+
function checkInstalmentPlanDeposit(plan, minimumCents) {
|
|
1691
|
+
if (!isDepositBearingBookingInstalmentPlan(plan)) return ok(undefined);
|
|
1692
|
+
return plan.depositAmountCents >= minimumCents ? ok(undefined) : err({
|
|
1693
|
+
kind: "instalment_deposit_below_minimum",
|
|
1694
|
+
minimumCents
|
|
1695
|
+
});
|
|
1696
|
+
}
|
|
1697
|
+
/** The deposit check for whichever instalment option a set of payment options offers. */
|
|
1698
|
+
function checkPaymentOptionsInstalmentDeposit(allowedOptions, minimumCents) {
|
|
1699
|
+
const failure = allowedOptions.map((option) => option.kind === "instalment_plan" ? checkInstalmentPlanDeposit(option.plan, minimumCents) : ok(undefined)).find((checked) => !checked.ok);
|
|
1700
|
+
return failure ?? ok(undefined);
|
|
1701
|
+
}
|
|
1702
|
+
/** The one message for a deposit below the minimum, shown in the editor and returned by the server. */
|
|
1703
|
+
function describeInstalmentDepositBelowMinimum(failure, currency) {
|
|
1704
|
+
const minimum = formatCurrencyAmount(failure.minimumCents, currency);
|
|
1705
|
+
return `Enter a deposit of at least ${minimum}. We take it when the customer books and save their card for the later payments.`;
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
//#endregion
|
|
1709
|
+
//#region ../core/src/booking-live-payment-terms.ts
|
|
1710
|
+
/**
|
|
1711
|
+
* Whether an order still has payment terms being collected: an instalment plan
|
|
1712
|
+
* or a flexible-balance contract that hasn't been settled, closed or cancelled.
|
|
1713
|
+
*
|
|
1714
|
+
* Both tables are total over their status unions, so a new status is a compile
|
|
1715
|
+
* error here until someone decides whether it counts as live.
|
|
1716
|
+
*/
|
|
1717
|
+
const LIVE_PLAN_STATUSES = {
|
|
1718
|
+
pending_initial_payment: true,
|
|
1719
|
+
active: true,
|
|
1720
|
+
payment_failed: true,
|
|
1721
|
+
reconciliation_required: true,
|
|
1722
|
+
completed: false,
|
|
1723
|
+
cancelled: false,
|
|
1724
|
+
cancelled_as_paid_early: false,
|
|
1725
|
+
refunded: false
|
|
1726
|
+
};
|
|
1727
|
+
const LIVE_CONTRACT_STATUSES = {
|
|
1728
|
+
active: true,
|
|
1729
|
+
payment_pending: true,
|
|
1730
|
+
overdue: true,
|
|
1731
|
+
completed: false,
|
|
1732
|
+
waived: false,
|
|
1733
|
+
refunded: false,
|
|
1734
|
+
cancelled_due_to_non_payment: false,
|
|
1735
|
+
closed_order_failed: false
|
|
1736
|
+
};
|
|
1737
|
+
function isLiveOrderInstalmentPlanStatus(status) {
|
|
1738
|
+
return LIVE_PLAN_STATUSES[status];
|
|
1739
|
+
}
|
|
1740
|
+
function isLiveFlexibleBalanceContractStatus(status) {
|
|
1741
|
+
return LIVE_CONTRACT_STATUSES[status];
|
|
1742
|
+
}
|
|
1743
|
+
function hasLivePaymentTerms(input) {
|
|
1744
|
+
return input.plan !== null && isLiveOrderInstalmentPlanStatus(input.plan.status) || input.contract !== null && isLiveFlexibleBalanceContractStatus(input.contract.status);
|
|
1745
|
+
}
|
|
1746
|
+
/** Partial refunds must also protect a cancelled contract that staff can reopen. */
|
|
1747
|
+
function paymentTermsBlockPartialRefund(input) {
|
|
1748
|
+
return hasLivePaymentTerms(input) || input.contract?.status === "cancelled_due_to_non_payment";
|
|
1749
|
+
}
|
|
1750
|
+
/**
|
|
1751
|
+
* Live statuses where a collection is already in flight: the first payment,
|
|
1752
|
+
* a card charge, or a Stripe reconciliation hasn't resolved yet. Nobody may
|
|
1753
|
+
* settle the balance by hand while one of these is running. Both tables are
|
|
1754
|
+
* total over the live statuses, so a new live status must be classified here.
|
|
1755
|
+
*/
|
|
1756
|
+
const PLAN_COLLECTION_IN_FLIGHT = {
|
|
1757
|
+
pending_initial_payment: true,
|
|
1758
|
+
reconciliation_required: true,
|
|
1759
|
+
active: false,
|
|
1760
|
+
payment_failed: false
|
|
1761
|
+
};
|
|
1762
|
+
const CONTRACT_COLLECTION_IN_FLIGHT = {
|
|
1763
|
+
payment_pending: true,
|
|
1764
|
+
active: false,
|
|
1765
|
+
overdue: false
|
|
1766
|
+
};
|
|
1767
|
+
/**
|
|
1768
|
+
* Whether an instalment plan's remaining balance can take a payment now, by
|
|
1769
|
+
* hand or online: it's live and no collection is in flight.
|
|
1770
|
+
*/
|
|
1771
|
+
function isSettleableOrderInstalmentPlanStatus(status) {
|
|
1772
|
+
return isLiveOrderInstalmentPlanStatus(status) && !PLAN_COLLECTION_IN_FLIGHT[status];
|
|
1773
|
+
}
|
|
1774
|
+
/**
|
|
1775
|
+
* Whether a flexible-balance contract's remaining balance can take a payment
|
|
1776
|
+
* now, by hand or online: it's live and no collection is in flight.
|
|
1777
|
+
*/
|
|
1778
|
+
function isSettleableFlexibleBalanceContractStatus(status) {
|
|
1779
|
+
return isLiveFlexibleBalanceContractStatus(status) && !CONTRACT_COLLECTION_IN_FLIGHT[status];
|
|
1780
|
+
}
|
|
1781
|
+
function decideContractClosureForFailedOrder(status) {
|
|
1782
|
+
return isLiveFlexibleBalanceContractStatus(status) ? {
|
|
1783
|
+
kind: "close",
|
|
1784
|
+
from: status
|
|
1785
|
+
} : { kind: "keep" };
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
//#endregion
|
|
1789
|
+
//#region ../core/src/booking-payment-options.ts
|
|
1790
|
+
/** Automatic instalments and a flexible balance cannot share one booking offer. */
|
|
1791
|
+
function validateBookingPaymentOptionKinds(kinds) {
|
|
1792
|
+
if (kinds.length === 0) return err("no_options");
|
|
1793
|
+
const uniqueKinds = new Set(kinds);
|
|
1794
|
+
if (uniqueKinds.size !== kinds.length) return err("duplicate_kind");
|
|
1795
|
+
if (uniqueKinds.has("instalment_plan") && uniqueKinds.has("flexible_balance")) {
|
|
1796
|
+
return err("incompatible_collection_options");
|
|
1797
|
+
}
|
|
1798
|
+
return ok(undefined);
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1684
1801
|
//#endregion
|
|
1685
1802
|
//#region ../core/src/booking-time-zone.ts
|
|
1686
1803
|
const TIME_ZONE_VALIDITY_CACHE_LIMIT = 100;
|
|
@@ -2600,6 +2717,11 @@ function syncStateOf(sync) {
|
|
|
2600
2717
|
|
|
2601
2718
|
//#endregion
|
|
2602
2719
|
//#region ../core/src/edit-lease.ts
|
|
2720
|
+
/**
|
|
2721
|
+
* How long a lease lasts without a heartbeat. The server grants for this long, and a
|
|
2722
|
+
* reload handover is only worth presenting within it (issue 1570).
|
|
2723
|
+
*/
|
|
2724
|
+
const EDIT_LEASE_TTL_SECONDS = 60;
|
|
2603
2725
|
function parseEditLeaseScope(input) {
|
|
2604
2726
|
switch (input.nodeType) {
|
|
2605
2727
|
case "page": {
|
|
@@ -7246,4 +7368,4 @@ function eventCatalogueChoices(catalogue) {
|
|
|
7246
7368
|
}
|
|
7247
7369
|
|
|
7248
7370
|
//#endregion
|
|
7249
|
-
export {
|
|
7371
|
+
export { validateBookingPaymentOptionKinds as $, footerNavigationLayouts as A, unsafeAsOccurrenceId as At, formatBookingDate as B, unsafeAsStorageBucketName as Bt, parseMailingListContentVersionId as C, unsafeAsDemoCapability as Ct, sameMailingListPlacementTargeting as D, unsafeAsEventSeriesId as Dt, planMailingListChoicePresentation as E, unsafeAsEventOfferingId as Et, isPresent as F, unsafeAsSafeDownloadFilename as Ft, getBookingLocalDateKey as G, ok as Gt, formatBookingTime as H, unsafeAsUploadSessionId as Ht, normalizeLocationAddressText as I, unsafeAsSiteFontId as It, parseUtcIsoDateTimeString as J, getLocalScheduleDate as K, toLocationCoordinates as L, unsafeAsSiteId as Lt, parseMailingListPlacementTargeting as M, unsafeAsPositiveByteCount as Mt, isCanonicalRichTextDoc as N, unsafeAsPositiveSeconds as Nt, DEFAULT_MAILING_LIST_SUCCESS_MESSAGE as O, unsafeAsFileChecksumSha256 as Ot, assertAllowedPublicUrl as P, unsafeAsProductId as Pt, parseBookingTimeZone as Q, selectCategoryView as R, unsafeAsSiteScopedStoragePath as Rt, parseMailingListBlockId as S, unsafeAsDeclaredMimeType as St, parseMailingListRuntimeContext as T, unsafeAsEntitlementId as Tt, formatLocalScheduleDate as U, unsafeAsUserId as Ut, formatBookingDateParts as V, unsafeAsStoragePath as Vt, formatLocalScheduleTime as W, err as Wt, toScheduledBookingDateRange as X, toBookingTimeZone as Y, toScheduledBookingDateTime as Z, createSecret as _, parseSiteId as _t, parseVerticalId as a, publicEventPricingDisplay as at, stableJsonStringify as b, unsafeAsBookingRequirementId as bt, DEFAULT_EVENT_TYPE_PRESETS as c, resolvePricingOptionsPriceDisplay as ct, SURFACE_EVENT_PRESET_VALUES as d, formatCurrencyAmount as dt, parseEventPageSurfaceSubject as et, WHOLE_SERIES_EVENT_PRESET_VALUES as f, assertNever as ft, resolveWholeSeriesBookingPhase as g, parsePageId as gt, orderedLiveRunSessions as h, parseMediaAssetId as ht, canonicalizeConfiguredBookingVerticalConfig as i, publicEventPricingCurrency as it, parseFooterCompositionV1 as j, unsafeAsOriginalFilename as jt, parseMailingListProviderScope as k, unsafeAsMediaAssetId as kt, EVENT_PRESET_VALUES as l, fromArray as lt, CANCELLED_SESSION_STATUS as m, parseEventSeriesId as mt, NAVIGATION_LOCATIONS as n, formatEventPricing as nt, parseVerticalPresetId as o, publicEventPricingType as ot, publicReadFreshnessSeconds as p, parseApiKeyId as pt, getLocalScheduleTime as q, areConfiguredBookingVerticalConfigsEqual as r, isPublicEventPricingOptionDisplayable as rt, resolveSiteVerticalBookingConfig as s, resolveExactOrFreePriceDisplay as st, resolveEventCatalogue as t, formatBookingPriceDisplay as tt, ORDINARY_EVENT_PRESET_VALUES as u, mapNonEmptyArray as ut, exposeSecret as v, parseUserId as vt, parseMailingListSignedSourceToken as w, unsafeAsDetectedMimeType as wt, buildMailingListSignupBlockSourceRef as x, unsafeAsBookingSessionId as xt, parseManagementKey as y, unsafeAsAppointmentResourceId as yt, buildBookingUtcDateWindow as z, unsafeAsStaffMemberId as zt };
|
package/dist/testing.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./sdk-event-upsert-
|
|
3
|
-
import "./src-
|
|
4
|
-
import { n as syncLocalMediaForPush, r as syncLocalMediaForPull, y as writeMediaManifest } from "./local-sync-
|
|
2
|
+
import "./sdk-event-upsert-TGjuLLJp.mjs";
|
|
3
|
+
import "./src-DQ0xnGOE.mjs";
|
|
4
|
+
import { n as syncLocalMediaForPush, r as syncLocalMediaForPull, y as writeMediaManifest } from "./local-sync-But5fsta.mjs";
|
|
5
5
|
|
|
6
6
|
export { syncLocalMediaForPull, syncLocalMediaForPush, writeMediaManifest };
|
package/package.json
CHANGED