riverbankcms 0.38.1 → 0.38.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.
- package/dist/acceptance/matrix.mjs +3 -3
- package/dist/cli/index.mjs +21125 -9787
- package/dist/cli/init-docs/content/workflow-custom-block.md +47 -2
- package/dist/{entryCommands-CINe1Vw0.mjs → entryCommands-C75BmINB.mjs} +1222 -181
- package/dist/{eventUpsertInputSchema-DLz8m6J9.mjs → eventUpsertInputSchema-BJaQ0cGf.mjs} +2 -2
- package/dist/{load-config-Dl_o53yP.mjs → load-config-BQtsKco-.mjs} +2 -2
- package/dist/load-config-DiH7PZ_y.mjs +4 -0
- package/dist/{plan-D0-jU0Ye.mjs → plan-D8WICa9M.mjs} +1 -1
- package/dist/scaffold/index.mjs +2 -2
- package/dist/{sdk-event-upsert-78zikPNp.mjs → sdk-event-upsert-CdBZDquG.mjs} +566 -42
- package/dist/{src-e6JfJMDt.mjs → src-CnUjAAn9.mjs} +32 -5
- package/dist/testing.mjs +4 -4
- package/package.json +1 -1
- package/dist/load-config-DUFFruh_.mjs +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { $n as
|
|
4
|
-
import { n as CliSdkPeerError, t as loadConfigFile } from "./load-config-
|
|
2
|
+
import { Ar as asSiteStyleId, At as getMimeType, Bt as footerPreferencesSchema, Et as slugifyMediaIdentifier, Ft as MAX_MANAGEMENT_MEDIA_UPLOAD_BYTES, Gr as createSiteCommandSiteRef, I as footerModeSchema, Jr as slugPart, Lr as createCommandRef, Mr as compareEntrySlug, Mt as normalizeAmbiguousStoragePathForSite, Nr as bookingQuestionAttachmentSchema, On as require_dist, Pt as FILE_SIZE_LIMITS, Qt as buttonStyleSelectionSchema, Rr as createContentEntryRef, St as buildMediaIdentifierFromFilename, Tr as asDesignBoundaryId, Tt as resolveMediaIdentifier, V as themeSchema, Vn as RESOLVED_INTERNAL_LINK_ENTITY_TYPES, Zn as ICON_PICKER_PRESETS, ar as footerLookIdValues, at as parseAspectRatioValue, b as getSiteCommandMetadata, br as asAppearancePresetId, bt as mediaTypeDiscriminants, ct as getDirectImageUrlForSiteScopedPath, dr as SYSTEM_BLOCK_KINDS, er as SUPPORTED_LOADER_ENDPOINTS, h as parseAndPlanCommandBatchForTypes, jr as makeBoundaryId, k as headerPreferencesSchema, kn as eventBookingOfferIntentSchema, kr as asPageFlowPresetId, kt as getExtensionForMimeType, l as resolvePageUpsertSeo, m as createDryRunReport, n as sdkCourseBookingSettingsSchema, nr as asHeaderLayoutId, or as headerLayoutIdValues, p as stableStringify, r as sdkEventOccurrenceInputSchema, rr as asHeaderStyleId, s as eventVisibilitySchema, sr as headerStyleIdValues, tr as asFooterLookId, v as evaluateSiteCommandBatchExposure, vt as PUBLIC_FILE_FIELD_KINDS, w as entryIdentifierForCommand, wr as asDesignBlockId, y as evaluateSiteCommandExposure, yt as isDisplayMediaKind } from "./sdk-event-upsert-CdBZDquG.mjs";
|
|
3
|
+
import { $n as parseClientArrangementId, A as PUBLIC_RENDERED_AVAILABILITY_FRESHNESS_SECONDS, Ar as unsafeAsOrderFlexibleBalanceContractId, Bn as toNonNegativeCents, Bt as businessCancellationRefusalCodes, C as DEFAULT_EVENT_TYPE_PRESETS, Ct as publicLocationSchema, Dr as parseOrderId, E as SURFACE_EVENT_PRESET_VALUES, Et as trimmedStringOrNull, Ft as getBookingInstalmentDepositRefundability, Gn as assertNever, H as createSecret, Hn as unsafeAsPositiveCents, Hr as parseEventSeriesId, Ht as resolveFlexibleBalanceDueAt, In as isNonNegativeWholeCents$1, Ir as parseApiKeyId, Jn as unsafeAsGiftingInstrumentId, Jr as unsafeAsOccurrenceId, Kr as unsafeAsEventOfferingId, Ln as parseNonNegativeCents, Lr as parseSiteId, M as isPublicReadEndpoint, Mr as unsafeAsOrderPaymentReceiptId, Mt as isLiveOrderInstalmentPlanStatus, N as publicReadBatchFreshnessSeconds, Nn as fromArray, Nr as parseEditorSessionGeneration, Nt as addIntervalPreservingMonthAnchor, O as PUBLIC_AVAILABILITY_FRESHNESS_SECONDS, Or as parseOrderPaymentReceiptId, P as publicReadFreshnessSeconds, Pt as clampConfiguredAmount, Qn as parseAppointmentId, Rn as parsePositiveCents, Rr as parseUserId, Rt as omitZeroAmountFutureRows, S as resolveSiteVerticalBookingConfig, U as exposeSecret, Un as formatCurrencyAmount, Ur as parseEventSeriesRegistrationId, Ut as resolveFlexibleBalanceInitialPaymentCents, Vn as unsafeAsNonNegativeCents, Vr as parseAttendeeId, Vt as scheduleBookingReasonCodes, W as parseManagementKey, Wn as parseCurrencyCode, Wr as parseRetiredCourseId, Xr as err, Xt as formatDate, Yn as unsafeAsGiftingOfferId, Yr as unsafeAsPricingOptionId, Zr as ok, an as addLocalScheduleDays, ar as parseEntitlementId, b as parseVerticalId, cr as unsafeAsPassId, dr as parseWaitlistEntryId, er as unsafeAsAppointmentResourceId, ft as assertAllowedPublicUrl, g as withBookingModulesForSelectionChange, gn as toUtcIsoDateTimeString, gt as stableJsonStringify, h as resolveEventCatalogue, i as committedWriteProofSchema, ir as unsafeAsCustomerId, j as getPublicReadCachePolicy, jr as unsafeAsOrderPaymentPlanId, jt as validateBookingPaymentOptionKinds, k as PUBLIC_CONTENT_FRESHNESS_SECONDS, kr as unsafeAsCheckoutLineId, lr as parseDatedOfferingCapacityHoldAuditRef, m as planTurningOnCourses, n as OFFLINE_PAYMENT_METHODS, nr as parseCustomerId, nt as parseFooterCompositionV1, or as parseMembershipId, pn as parseBookingLocalDate, pr as parseMediaAssetId, qr as unsafeAsEventSeriesId, r as bookingContextId, rr as parseSiteTermsVersionId, s as APPOINTMENT_REQUEST_OUTCOME_VALUES, sn as formatLocalScheduleDate, tr as unsafeAsStaffMemberId, tt as parseMailingListProviderScope, u as STAFF_OPERATIONAL_CAPABILITIES, un as getLocalScheduleDate, ur as parseDatedOfferingCapacityHoldId, v as areConfiguredBookingVerticalConfigsEqual, vn as resolveBookingTimeZoneId, w as EVENT_PRESET_VALUES, x as parseVerticalPresetId, y as canonicalizeConfiguredBookingVerticalConfig, yt as locationValueSchema, zn as toCents, zt as splitAmountWithRemainderInFirst } from "./src-CnUjAAn9.mjs";
|
|
4
|
+
import { n as CliSdkPeerError, t as loadConfigFile } from "./load-config-BQtsKco-.mjs";
|
|
5
5
|
import { safeParse, z } from "zod";
|
|
6
6
|
import { Argument, Command, Option } from "commander";
|
|
7
7
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -836,7 +836,20 @@ const PREVIEW_BLOCKED_REASONS = [
|
|
|
836
836
|
"past_date",
|
|
837
837
|
"invalid_schedule",
|
|
838
838
|
"stale",
|
|
839
|
-
"invalid_state"
|
|
839
|
+
"invalid_state",
|
|
840
|
+
"not_available",
|
|
841
|
+
"closure",
|
|
842
|
+
"outside_hours",
|
|
843
|
+
"too_close",
|
|
844
|
+
"held",
|
|
845
|
+
"google_busy",
|
|
846
|
+
"minimum_notice",
|
|
847
|
+
"booking_window",
|
|
848
|
+
"clash",
|
|
849
|
+
"package_not_eligible",
|
|
850
|
+
"service_not_provided",
|
|
851
|
+
"not_upcoming",
|
|
852
|
+
"invalid_time"
|
|
840
853
|
];
|
|
841
854
|
|
|
842
855
|
//#endregion
|
|
@@ -1065,6 +1078,13 @@ const PAGE_JOURNAL_ENDPOINT_DEFINITIONS = {
|
|
|
1065
1078
|
responseKind: "json",
|
|
1066
1079
|
errors: ["validation:invalid_input", "server:internal_error"]
|
|
1067
1080
|
},
|
|
1081
|
+
getEditorSiteFacts: {
|
|
1082
|
+
path: "/sites/{siteId}/editor/site-facts",
|
|
1083
|
+
method: "GET",
|
|
1084
|
+
auth: "user",
|
|
1085
|
+
responseKind: "json",
|
|
1086
|
+
errors: ["server:internal_error"]
|
|
1087
|
+
},
|
|
1068
1088
|
replayThemeJournalChange: {
|
|
1069
1089
|
path: "/sites/{siteId}/theme/journal",
|
|
1070
1090
|
method: "POST",
|
|
@@ -1627,20 +1647,38 @@ const PAGE_READ_DEPENDENCIES_HEADER = "x-riverbank-page-dependencies";
|
|
|
1627
1647
|
* fell back to an empty value), so no cache may keep it: the next read should get the complete page.
|
|
1628
1648
|
*/
|
|
1629
1649
|
const PAGE_READ_STORAGE_HEADER = "x-riverbank-page-storage";
|
|
1630
|
-
|
|
1650
|
+
function availabilityPageReadTags(siteId) {
|
|
1651
|
+
return normalizeRevalidateTags([
|
|
1652
|
+
...buildCacheReadTags([TAG_TEMPLATES.siteRoutableContent], { siteId }),
|
|
1653
|
+
...buildPublicReadFetchTags("listPublicEvents", { siteId }),
|
|
1654
|
+
...buildPublicReadFetchTags("getPublicBookingService", { siteId })
|
|
1655
|
+
]);
|
|
1656
|
+
}
|
|
1657
|
+
/**
|
|
1658
|
+
* The tags and framework lifetime a complete page read registers. A page may depend on admission even when an
|
|
1659
|
+
* ordinary CMS page won precedence. Booking and event writes purge an availability page by its tags, so its
|
|
1660
|
+
* lifetime is only the rendered-availability backstop for a failed purge. Caches that no write reaches (the
|
|
1661
|
+
* SDK's in-process map and durable runtime rows) keep `PUBLIC_AVAILABILITY_FRESHNESS_SECONDS` instead.
|
|
1662
|
+
*/
|
|
1631
1663
|
function buildPageReadCachePolicy(siteId, dependencies) {
|
|
1632
1664
|
return dependencies === "availability" ? {
|
|
1633
|
-
tags:
|
|
1634
|
-
|
|
1635
|
-
...buildPublicReadFetchTags("listPublicEvents", { siteId }),
|
|
1636
|
-
...buildPublicReadFetchTags("getPublicBookingService", { siteId })
|
|
1637
|
-
]),
|
|
1638
|
-
revalidate: PUBLIC_AVAILABILITY_FRESHNESS_SECONDS
|
|
1665
|
+
tags: availabilityPageReadTags(siteId),
|
|
1666
|
+
revalidate: PUBLIC_RENDERED_AVAILABILITY_FRESHNESS_SECONDS
|
|
1639
1667
|
} : {
|
|
1640
1668
|
tags: buildCacheReadTags([TAG_TEMPLATES.siteRoutableContent], { siteId }),
|
|
1641
1669
|
revalidate: PUBLIC_CONTENT_FRESHNESS_SECONDS
|
|
1642
1670
|
};
|
|
1643
1671
|
}
|
|
1672
|
+
/**
|
|
1673
|
+
* What an incomplete or malformed page read registers, so the rendered route is rebuilt within a minute
|
|
1674
|
+
* instead of keeping a broken page for a backstop's length. It carries every page tag, so a write still purges it.
|
|
1675
|
+
*/
|
|
1676
|
+
function buildPageReadRetryPolicy(siteId) {
|
|
1677
|
+
return {
|
|
1678
|
+
tags: availabilityPageReadTags(siteId),
|
|
1679
|
+
revalidate: PUBLIC_AVAILABILITY_FRESHNESS_SECONDS
|
|
1680
|
+
};
|
|
1681
|
+
}
|
|
1644
1682
|
function pageReadDependencies(payload) {
|
|
1645
1683
|
return typeof payload === "object" && payload !== null && "dependencies" in payload && payload.dependencies === "content" ? "content" : "availability";
|
|
1646
1684
|
}
|
|
@@ -1727,20 +1765,68 @@ const weekday = z.union([
|
|
|
1727
1765
|
z.literal(5),
|
|
1728
1766
|
z.literal(6)
|
|
1729
1767
|
]);
|
|
1730
|
-
const
|
|
1768
|
+
const localStart = z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/);
|
|
1769
|
+
const everyWeeks = z.union([z.literal(1), z.literal(2)]);
|
|
1770
|
+
const nth = z.union([
|
|
1771
|
+
z.literal(1),
|
|
1772
|
+
z.literal(2),
|
|
1773
|
+
z.literal(3),
|
|
1774
|
+
z.literal(4),
|
|
1775
|
+
z.literal("last")
|
|
1776
|
+
]);
|
|
1777
|
+
/** A recurring day in an arrangement's week, with the id it keeps in every segment. */
|
|
1778
|
+
const arrangementSlotSchema = z.object({
|
|
1779
|
+
id: z.string().uuid(),
|
|
1780
|
+
weekday,
|
|
1781
|
+
localStart
|
|
1782
|
+
}).strict();
|
|
1783
|
+
/** A saved pattern: weekly (several days, counted in weeks from a Monday anchor) or monthly (one day). */
|
|
1784
|
+
const arrangementPatternSchema = z.discriminatedUnion("kind", [z.object({
|
|
1731
1785
|
kind: z.literal("weekly"),
|
|
1732
|
-
everyWeeks
|
|
1733
|
-
|
|
1786
|
+
everyWeeks,
|
|
1787
|
+
anchorMonday: localDate,
|
|
1788
|
+
slots: z.array(arrangementSlotSchema).min(1).max(7).readonly()
|
|
1734
1789
|
}).strict(), z.object({
|
|
1735
1790
|
kind: z.literal("monthly"),
|
|
1791
|
+
nth,
|
|
1792
|
+
slot: arrangementSlotSchema
|
|
1793
|
+
}).strict()]);
|
|
1794
|
+
const slotTime = z.object({
|
|
1736
1795
|
weekday,
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1796
|
+
localStart
|
|
1797
|
+
}).strict();
|
|
1798
|
+
const differentDays = (days) => new Set(days.map((day) => day.weekday)).size === days.length;
|
|
1799
|
+
/** What setup asks for: the days and times, with no ids or anchor. The server mints those. */
|
|
1800
|
+
const arrangementSetUpScheduleSchema = z.object({
|
|
1801
|
+
effectiveFrom: localDate,
|
|
1802
|
+
pattern: z.discriminatedUnion("kind", [z.object({
|
|
1803
|
+
kind: z.literal("weekly"),
|
|
1804
|
+
everyWeeks,
|
|
1805
|
+
days: z.array(slotTime).min(1).max(7).refine(differentDays, "Each day can only be picked once.")
|
|
1806
|
+
}).strict(), z.object({
|
|
1807
|
+
kind: z.literal("monthly"),
|
|
1808
|
+
nth,
|
|
1809
|
+
day: slotTime
|
|
1810
|
+
}).strict()])
|
|
1811
|
+
}).strict();
|
|
1812
|
+
/**
|
|
1813
|
+
* A change to the schedule from a date. `move` changes one day's weekday or time. `add` adds a
|
|
1814
|
+
* day (weekly patterns only); the server mints its id from the operation, and it books the new
|
|
1815
|
+
* day's next `bookAhead` sessions the way setup does.
|
|
1816
|
+
*/
|
|
1817
|
+
const arrangementScheduleCommandSchema = z.discriminatedUnion("kind", [z.object({
|
|
1818
|
+
kind: z.literal("move"),
|
|
1819
|
+
slotId: z.string().uuid(),
|
|
1820
|
+
weekday,
|
|
1821
|
+
localStart,
|
|
1822
|
+
effectiveFrom: localDate
|
|
1823
|
+
}).strict(), z.object({
|
|
1824
|
+
kind: z.literal("add"),
|
|
1825
|
+
weekday,
|
|
1826
|
+
localStart,
|
|
1827
|
+
effectiveFrom: localDate,
|
|
1828
|
+
bookAhead: z.number().int().min(0).max(52),
|
|
1829
|
+
bookShortfallAsOwed: z.boolean().default(false)
|
|
1744
1830
|
}).strict()]);
|
|
1745
1831
|
const arrangementEndSchema = z.discriminatedUnion("kind", [
|
|
1746
1832
|
z.object({ kind: z.literal("open") }).strict(),
|
|
@@ -1766,8 +1852,7 @@ const arrangementPaymentSchema = z.discriminatedUnion("kind", [
|
|
|
1766
1852
|
]);
|
|
1767
1853
|
const arrangementScheduleSchema = z.object({
|
|
1768
1854
|
effectiveFrom: localDate,
|
|
1769
|
-
|
|
1770
|
-
localStart: z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/)
|
|
1855
|
+
pattern: arrangementPatternSchema
|
|
1771
1856
|
}).strict();
|
|
1772
1857
|
const recordedReturn = { recordedReturn: z.literal("staff_confirmed").optional() };
|
|
1773
1858
|
const operation = {
|
|
@@ -1783,7 +1868,7 @@ const createClientArrangementSchema = z.object({
|
|
|
1783
1868
|
holdsTime: z.boolean(),
|
|
1784
1869
|
end: arrangementEndSchema,
|
|
1785
1870
|
payment: arrangementPaymentSchema,
|
|
1786
|
-
schedule:
|
|
1871
|
+
schedule: arrangementSetUpScheduleSchema,
|
|
1787
1872
|
bookAhead: z.number().int().min(0).max(52),
|
|
1788
1873
|
bookShortfallAsOwed: z.boolean().default(false)
|
|
1789
1874
|
}).strict();
|
|
@@ -1802,7 +1887,7 @@ const arrangementAwaySchema = z.object({
|
|
|
1802
1887
|
}).strict().refine((value) => value.backOn > value.from, "Choose a return date after the first day away.");
|
|
1803
1888
|
const arrangementChangeFromSchema = z.object({
|
|
1804
1889
|
...operation,
|
|
1805
|
-
|
|
1890
|
+
command: arrangementScheduleCommandSchema
|
|
1806
1891
|
}).strict();
|
|
1807
1892
|
const arrangementOneWeekSchema = z.object({
|
|
1808
1893
|
...operation,
|
|
@@ -1811,14 +1896,27 @@ const arrangementOneWeekSchema = z.object({
|
|
|
1811
1896
|
endAt: z.iso.datetime({ offset: true }),
|
|
1812
1897
|
bookShortfallAsOwed: z.boolean().default(false)
|
|
1813
1898
|
}).strict().refine((value) => Date.parse(value.endAt) > Date.parse(value.startAt), "Choose an end after the start.");
|
|
1814
|
-
|
|
1899
|
+
/**
|
|
1900
|
+
* Ending all of it, or one day: that day stops after `lastDate`, its bookings after then are
|
|
1901
|
+
* cancelled, and the other days carry on.
|
|
1902
|
+
*/
|
|
1903
|
+
const arrangementEndRequestSchema = z.discriminatedUnion("scope", [z.object({
|
|
1815
1904
|
...operation,
|
|
1816
1905
|
...recordedReturn,
|
|
1906
|
+
scope: z.literal("all"),
|
|
1817
1907
|
lastDate: localDate
|
|
1818
|
-
}).strict()
|
|
1908
|
+
}).strict(), z.object({
|
|
1909
|
+
...operation,
|
|
1910
|
+
...recordedReturn,
|
|
1911
|
+
scope: z.literal("day"),
|
|
1912
|
+
slotId: z.string().uuid(),
|
|
1913
|
+
lastDate: localDate
|
|
1914
|
+
}).strict()]);
|
|
1819
1915
|
/** `expectedUpdatedAt` is the version the dialog was showing, so a save can't overwrite a newer change. */
|
|
1916
|
+
/** `confirmation` is the preview's, when booked sessions change with the service. */
|
|
1820
1917
|
const arrangementEditSchema = z.object({
|
|
1821
1918
|
...operation,
|
|
1919
|
+
confirmation: z.string().optional(),
|
|
1822
1920
|
expectedUpdatedAt: z.string().min(1),
|
|
1823
1921
|
serviceId: z.string().uuid(),
|
|
1824
1922
|
holdsTime: z.boolean(),
|
|
@@ -1940,6 +2038,19 @@ const arrangementDateResultSchema = z.intersection(z.object({ occurrenceDate: lo
|
|
|
1940
2038
|
})
|
|
1941
2039
|
])
|
|
1942
2040
|
}),
|
|
2041
|
+
z.object({
|
|
2042
|
+
outcome: z.literal("service_changed"),
|
|
2043
|
+
appointmentId: z.string(),
|
|
2044
|
+
startAt: z.string(),
|
|
2045
|
+
endAt: z.string(),
|
|
2046
|
+
previousEndAt: z.string(),
|
|
2047
|
+
price: z.discriminatedUnion("kind", [z.object({
|
|
2048
|
+
kind: z.literal("restated"),
|
|
2049
|
+
fromCents: z.number().int(),
|
|
2050
|
+
toCents: z.number().int(),
|
|
2051
|
+
currency: z.string()
|
|
2052
|
+
}), z.object({ kind: z.literal("kept") })])
|
|
2053
|
+
}),
|
|
1943
2054
|
z.object({
|
|
1944
2055
|
outcome: z.literal("cancelled"),
|
|
1945
2056
|
appointmentId: z.string(),
|
|
@@ -4334,12 +4445,19 @@ const ORDER_ITEM_KINDS = [
|
|
|
4334
4445
|
"pass",
|
|
4335
4446
|
"event_series_registration",
|
|
4336
4447
|
"appointment",
|
|
4337
|
-
"membership"
|
|
4448
|
+
"membership",
|
|
4449
|
+
"gift"
|
|
4338
4450
|
];
|
|
4339
4451
|
const orderItemKindSet = new Set(ORDER_ITEM_KINDS);
|
|
4340
4452
|
function isOrderItemKind(value) {
|
|
4341
4453
|
return orderItemKindSet.has(value);
|
|
4342
4454
|
}
|
|
4455
|
+
function parseOrderItemKind(value) {
|
|
4456
|
+
return isOrderItemKind(value) ? ok(value) : err({
|
|
4457
|
+
kind: "invalid_order_item_kind",
|
|
4458
|
+
value
|
|
4459
|
+
});
|
|
4460
|
+
}
|
|
4343
4461
|
|
|
4344
4462
|
//#endregion
|
|
4345
4463
|
//#region ../commerce/src/utils/assertNever.ts
|
|
@@ -6472,7 +6590,7 @@ function isShopRefundablePaymentMethod(paymentMethod) {
|
|
|
6472
6590
|
//#endregion
|
|
6473
6591
|
//#region ../commerce/src/purchase/orderItemSupport.ts
|
|
6474
6592
|
function isShopRefundableOrderItem(item) {
|
|
6475
|
-
return item.kind === "product" || item.kind === "pass";
|
|
6593
|
+
return item.kind === "product" || item.kind === "pass" || item.kind === "gift";
|
|
6476
6594
|
}
|
|
6477
6595
|
function usesShopRefundFlow(paymentMethod, item) {
|
|
6478
6596
|
return isShopRefundablePaymentMethod(paymentMethod) && isShopRefundableOrderItem(item);
|
|
@@ -6505,6 +6623,7 @@ function partitionActiveUnshippedOrderItems(items, shippedQuantityByItemId) {
|
|
|
6505
6623
|
}
|
|
6506
6624
|
function fallbackOrderItemDisplayName(kind) {
|
|
6507
6625
|
switch (kind) {
|
|
6626
|
+
case "gift": return "Gift";
|
|
6508
6627
|
case "product": return "Product";
|
|
6509
6628
|
case "pass": return "Pass";
|
|
6510
6629
|
case "membership": return "Membership";
|
|
@@ -6563,6 +6682,7 @@ function bookingCancellationIdentity(item) {
|
|
|
6563
6682
|
case "appointment": return item.appointmentId ? `appointment:${item.appointmentId}` : null;
|
|
6564
6683
|
case "membership":
|
|
6565
6684
|
case "pass":
|
|
6685
|
+
case "gift":
|
|
6566
6686
|
case "product": return null;
|
|
6567
6687
|
}
|
|
6568
6688
|
}
|
|
@@ -6909,6 +7029,13 @@ function planItem(item, input) {
|
|
|
6909
7029
|
orderItemId: item.id
|
|
6910
7030
|
}]
|
|
6911
7031
|
};
|
|
7032
|
+
case "gift": return item.giftingInstrumentId ? {
|
|
7033
|
+
warnings: [],
|
|
7034
|
+
actions: [{
|
|
7035
|
+
kind: "deliver_gift",
|
|
7036
|
+
giftingInstrumentId: item.giftingInstrumentId
|
|
7037
|
+
}]
|
|
7038
|
+
} : noActions();
|
|
6912
7039
|
case "product": return noActions();
|
|
6913
7040
|
}
|
|
6914
7041
|
}
|
|
@@ -6923,7 +7050,7 @@ function buildOrderCompletionEmailPlan(input) {
|
|
|
6923
7050
|
const id$1 = bookingGroupId(item);
|
|
6924
7051
|
return id$1 === null || !input.items.slice(0, index).some((previous) => bookingGroupId(previous) === id$1);
|
|
6925
7052
|
}).map((item) => planItem(item, input));
|
|
6926
|
-
const receipt = input.items.some((item) => item.kind === "product" || item.kind === "pass") ? [{
|
|
7053
|
+
const receipt = input.items.some((item) => item.kind === "product" || item.kind === "pass" || item.kind === "gift") ? [{
|
|
6927
7054
|
kind: "send_order_confirmation",
|
|
6928
7055
|
orderId: first.orderId
|
|
6929
7056
|
}] : [];
|
|
@@ -7251,6 +7378,409 @@ function resolveRecurringInterval(planDefinition) {
|
|
|
7251
7378
|
}
|
|
7252
7379
|
}
|
|
7253
7380
|
|
|
7381
|
+
//#endregion
|
|
7382
|
+
//#region ../commerce/src/gifting/voucherScope.ts
|
|
7383
|
+
const voucherScopeSchema = z.discriminatedUnion("kind", [
|
|
7384
|
+
z.object({
|
|
7385
|
+
kind: z.literal("event_offering"),
|
|
7386
|
+
eventOfferingId: z.string().uuid()
|
|
7387
|
+
}),
|
|
7388
|
+
z.object({
|
|
7389
|
+
kind: z.literal("event_category"),
|
|
7390
|
+
eventCategoryId: z.string().uuid()
|
|
7391
|
+
}),
|
|
7392
|
+
z.object({ kind: z.literal("any_event") }),
|
|
7393
|
+
z.object({
|
|
7394
|
+
kind: z.literal("appointment_service"),
|
|
7395
|
+
serviceId: z.string().uuid()
|
|
7396
|
+
}),
|
|
7397
|
+
z.object({ kind: z.literal("any_appointment") })
|
|
7398
|
+
]);
|
|
7399
|
+
function matchesVoucherScope(scope, context) {
|
|
7400
|
+
switch (scope.kind) {
|
|
7401
|
+
case "event_offering": return context.type === "event" && context.eventOfferingId === scope.eventOfferingId;
|
|
7402
|
+
case "event_category": return context.type === "event" && context.eventCategoryId === scope.eventCategoryId;
|
|
7403
|
+
case "any_event": return context.type === "event";
|
|
7404
|
+
case "appointment_service": return context.type === "appointment" && context.serviceId === scope.serviceId;
|
|
7405
|
+
case "any_appointment": return context.type === "appointment";
|
|
7406
|
+
}
|
|
7407
|
+
}
|
|
7408
|
+
|
|
7409
|
+
//#endregion
|
|
7410
|
+
//#region ../commerce/src/gifting/domain.ts
|
|
7411
|
+
/**
|
|
7412
|
+
* Dashboard status filter for the gifts list. `all` means "no status filter";
|
|
7413
|
+
* the rest are derived buckets, not raw column values.
|
|
7414
|
+
*/
|
|
7415
|
+
const GIFTING_STATUS_FILTERS = [
|
|
7416
|
+
"all",
|
|
7417
|
+
"waiting",
|
|
7418
|
+
"sent",
|
|
7419
|
+
"done",
|
|
7420
|
+
"expiring_soon",
|
|
7421
|
+
"expired",
|
|
7422
|
+
"attention"
|
|
7423
|
+
];
|
|
7424
|
+
const unsafeAsGiftingCode = (value) => value;
|
|
7425
|
+
const unsafeAsGiftingNormalizedCode = (value) => value;
|
|
7426
|
+
const unsafeAsGiftingClaimTokenPublicId = (value) => value;
|
|
7427
|
+
const unsafeAsGiftingClaimTokenSecretHash = (value) => value;
|
|
7428
|
+
const unsafeAsGiftCardClaimLinkToken = (value) => value;
|
|
7429
|
+
function serializeGiftCardClaimLinkToken(input) {
|
|
7430
|
+
return unsafeAsGiftCardClaimLinkToken(`${input.publicId}.${input.secret}`);
|
|
7431
|
+
}
|
|
7432
|
+
const DEFAULT_GIFT_CARD_DENOMINATION_CENTS = [
|
|
7433
|
+
2e3,
|
|
7434
|
+
3e3,
|
|
7435
|
+
5e3,
|
|
7436
|
+
1e4
|
|
7437
|
+
];
|
|
7438
|
+
const DEFAULT_GIFT_CARD_CUSTOM_MIN_CENTS = 2e3;
|
|
7439
|
+
const DEFAULT_GIFT_CARD_CUSTOM_MAX_CENTS = 1e5;
|
|
7440
|
+
const giftCardAmountConfigSchema = z.object({
|
|
7441
|
+
fixedDenominations: z.array(z.number().int().positive()).min(1),
|
|
7442
|
+
customAmount: z.object({
|
|
7443
|
+
enabled: z.boolean(),
|
|
7444
|
+
minCents: z.number().int().positive(),
|
|
7445
|
+
maxCents: z.number().int().positive()
|
|
7446
|
+
})
|
|
7447
|
+
});
|
|
7448
|
+
const giftCardOfferConfigSchema = z.object({
|
|
7449
|
+
kind: z.literal("gift_card"),
|
|
7450
|
+
amountConfig: giftCardAmountConfigSchema
|
|
7451
|
+
});
|
|
7452
|
+
const voucherOfferConfigSchema = z.object({
|
|
7453
|
+
kind: z.literal("voucher"),
|
|
7454
|
+
purchaseAmountCents: z.number().int().positive(),
|
|
7455
|
+
scope: voucherScopeSchema
|
|
7456
|
+
});
|
|
7457
|
+
/** Parses a stored `config_json` payload for either offer kind. */
|
|
7458
|
+
const giftingOfferConfigSchema = z.union([giftCardOfferConfigSchema, voucherOfferConfigSchema]);
|
|
7459
|
+
const giftingOfferSnapshotSchema = z.discriminatedUnion("kind", [z.object({
|
|
7460
|
+
id: z.string().uuid(),
|
|
7461
|
+
kind: z.literal("gift_card"),
|
|
7462
|
+
title: z.string(),
|
|
7463
|
+
description: z.string().nullable(),
|
|
7464
|
+
config: giftCardOfferConfigSchema
|
|
7465
|
+
}), z.object({
|
|
7466
|
+
id: z.string().uuid(),
|
|
7467
|
+
kind: z.literal("voucher"),
|
|
7468
|
+
title: z.string(),
|
|
7469
|
+
description: z.string().nullable(),
|
|
7470
|
+
config: voucherOfferConfigSchema
|
|
7471
|
+
})]).transform(asGiftingOfferSnapshot);
|
|
7472
|
+
function createDefaultGiftCardAmountConfig() {
|
|
7473
|
+
return {
|
|
7474
|
+
fixedDenominations: DEFAULT_GIFT_CARD_DENOMINATION_CENTS,
|
|
7475
|
+
customAmount: {
|
|
7476
|
+
enabled: true,
|
|
7477
|
+
minCents: DEFAULT_GIFT_CARD_CUSTOM_MIN_CENTS,
|
|
7478
|
+
maxCents: DEFAULT_GIFT_CARD_CUSTOM_MAX_CENTS
|
|
7479
|
+
}
|
|
7480
|
+
};
|
|
7481
|
+
}
|
|
7482
|
+
function asGiftingOfferSnapshot(input) {
|
|
7483
|
+
if (input.kind === "gift_card" && input.config.kind === "gift_card") {
|
|
7484
|
+
return {
|
|
7485
|
+
id: unsafeAsGiftingOfferId(input.id),
|
|
7486
|
+
kind: "gift_card",
|
|
7487
|
+
title: input.title,
|
|
7488
|
+
description: input.description,
|
|
7489
|
+
config: input.config
|
|
7490
|
+
};
|
|
7491
|
+
}
|
|
7492
|
+
if (input.kind === "voucher" && input.config.kind === "voucher") {
|
|
7493
|
+
return {
|
|
7494
|
+
id: unsafeAsGiftingOfferId(input.id),
|
|
7495
|
+
kind: "voucher",
|
|
7496
|
+
title: input.title,
|
|
7497
|
+
description: input.description,
|
|
7498
|
+
config: input.config
|
|
7499
|
+
};
|
|
7500
|
+
}
|
|
7501
|
+
throw new Error(`Offer ${input.id} has mismatched kind/config.`);
|
|
7502
|
+
}
|
|
7503
|
+
function parseGiftingOfferSnapshot(raw) {
|
|
7504
|
+
const parsed = z.safeParse(giftingOfferSnapshotSchema, raw);
|
|
7505
|
+
if (!parsed.success) {
|
|
7506
|
+
return null;
|
|
7507
|
+
}
|
|
7508
|
+
return parsed.data;
|
|
7509
|
+
}
|
|
7510
|
+
function normalizeGiftingCode(code) {
|
|
7511
|
+
return unsafeAsGiftingNormalizedCode(code.trim().toUpperCase());
|
|
7512
|
+
}
|
|
7513
|
+
function deriveGiftingExpiryIso(input) {
|
|
7514
|
+
const issuedAtMs = Date.parse(input.issuedAtIso);
|
|
7515
|
+
const expiryMs = issuedAtMs + input.settings.expiryDays * 24 * 60 * 60 * 1e3;
|
|
7516
|
+
return new Date(expiryMs).toISOString();
|
|
7517
|
+
}
|
|
7518
|
+
function validateGiftCardAmountCents(config, amountCents) {
|
|
7519
|
+
if (!Number.isFinite(amountCents) || !Number.isInteger(amountCents) || amountCents <= 0) {
|
|
7520
|
+
return err({
|
|
7521
|
+
code: "invalid_amount",
|
|
7522
|
+
message: "Choose a valid gift card amount."
|
|
7523
|
+
});
|
|
7524
|
+
}
|
|
7525
|
+
if (config.fixedDenominations.includes(amountCents)) {
|
|
7526
|
+
return ok(amountCents);
|
|
7527
|
+
}
|
|
7528
|
+
if (!config.customAmount.enabled) {
|
|
7529
|
+
return err({
|
|
7530
|
+
code: "custom_amount_disabled",
|
|
7531
|
+
message: "Custom gift card amounts are not enabled for this offer."
|
|
7532
|
+
});
|
|
7533
|
+
}
|
|
7534
|
+
if (amountCents < config.customAmount.minCents) {
|
|
7535
|
+
return err({
|
|
7536
|
+
code: "amount_below_minimum",
|
|
7537
|
+
message: "This gift card amount is below the minimum allowed value."
|
|
7538
|
+
});
|
|
7539
|
+
}
|
|
7540
|
+
if (amountCents > config.customAmount.maxCents) {
|
|
7541
|
+
return err({
|
|
7542
|
+
code: "amount_above_maximum",
|
|
7543
|
+
message: "This gift card amount is above the maximum allowed value."
|
|
7544
|
+
});
|
|
7545
|
+
}
|
|
7546
|
+
return ok(amountCents);
|
|
7547
|
+
}
|
|
7548
|
+
function groupPublicOffersByKind(offers) {
|
|
7549
|
+
const giftCards = [];
|
|
7550
|
+
const vouchers = [];
|
|
7551
|
+
for (const offer of offers) {
|
|
7552
|
+
if (offer.kind === "gift_card") {
|
|
7553
|
+
giftCards.push(offer);
|
|
7554
|
+
continue;
|
|
7555
|
+
}
|
|
7556
|
+
vouchers.push(offer);
|
|
7557
|
+
}
|
|
7558
|
+
return {
|
|
7559
|
+
giftCards,
|
|
7560
|
+
vouchers
|
|
7561
|
+
};
|
|
7562
|
+
}
|
|
7563
|
+
function classifyDiscountCodeOrigin(input) {
|
|
7564
|
+
return typeof input.giftingInstrumentId === "string" && input.giftingInstrumentId.length > 0 ? {
|
|
7565
|
+
kind: "voucher",
|
|
7566
|
+
instrumentId: unsafeAsGiftingInstrumentId(input.giftingInstrumentId)
|
|
7567
|
+
} : { kind: "standard" };
|
|
7568
|
+
}
|
|
7569
|
+
function voucherNotApplicableMessage(origin) {
|
|
7570
|
+
return origin.kind === "voucher" ? "This voucher is valid, but not for anything you're purchasing here." : "Discount code is not valid for this booking";
|
|
7571
|
+
}
|
|
7572
|
+
function isVoucherDiscountOrigin(origin) {
|
|
7573
|
+
return origin.kind === "voucher";
|
|
7574
|
+
}
|
|
7575
|
+
function planVoucherSingleUnitDiscount(candidates) {
|
|
7576
|
+
let best = null;
|
|
7577
|
+
for (const candidate of candidates) {
|
|
7578
|
+
if (!Number.isFinite(candidate.unitPriceCents) || candidate.unitPriceCents <= 0 || candidate.quantity <= 0) {
|
|
7579
|
+
continue;
|
|
7580
|
+
}
|
|
7581
|
+
if (!best) {
|
|
7582
|
+
best = candidate;
|
|
7583
|
+
continue;
|
|
7584
|
+
}
|
|
7585
|
+
if (candidate.unitPriceCents > best.unitPriceCents) {
|
|
7586
|
+
best = candidate;
|
|
7587
|
+
continue;
|
|
7588
|
+
}
|
|
7589
|
+
if (candidate.unitPriceCents === best.unitPriceCents && candidate.lineId.localeCompare(best.lineId) < 0) {
|
|
7590
|
+
best = candidate;
|
|
7591
|
+
}
|
|
7592
|
+
}
|
|
7593
|
+
if (!best) {
|
|
7594
|
+
return null;
|
|
7595
|
+
}
|
|
7596
|
+
return {
|
|
7597
|
+
mode: "single_eligible_unit",
|
|
7598
|
+
selectedLineId: best.lineId,
|
|
7599
|
+
amountCents: best.unitPriceCents
|
|
7600
|
+
};
|
|
7601
|
+
}
|
|
7602
|
+
function toDomainGiftingInstrument(instrument, nowIso) {
|
|
7603
|
+
const offerSnapshot = parseGiftingOfferSnapshot(instrument.offerSnapshotJson);
|
|
7604
|
+
if (instrument.offerSnapshotJson != null && !offerSnapshot) {
|
|
7605
|
+
return err({
|
|
7606
|
+
code: "invalid_offer_snapshot",
|
|
7607
|
+
message: `Instrument ${instrument.id} has an invalid offer snapshot.`
|
|
7608
|
+
});
|
|
7609
|
+
}
|
|
7610
|
+
const delivery = parseGiftingDelivery(instrument);
|
|
7611
|
+
if (!delivery) {
|
|
7612
|
+
return err({
|
|
7613
|
+
code: "invalid_delivery_state",
|
|
7614
|
+
message: `Instrument ${instrument.id} has an invalid delivery state.`
|
|
7615
|
+
});
|
|
7616
|
+
}
|
|
7617
|
+
const base = {
|
|
7618
|
+
raw: instrument,
|
|
7619
|
+
id: unsafeAsGiftingInstrumentId(instrument.id),
|
|
7620
|
+
offerId: instrument.offerId ? unsafeAsGiftingOfferId(instrument.offerId) : null,
|
|
7621
|
+
issuanceKind: instrument.issuanceKind,
|
|
7622
|
+
code: unsafeAsGiftingCode(instrument.code),
|
|
7623
|
+
codeNormalized: unsafeAsGiftingNormalizedCode(instrument.codeNormalized),
|
|
7624
|
+
delivery,
|
|
7625
|
+
recipientEmail: instrument.recipientEmail,
|
|
7626
|
+
recipientName: instrument.recipientName,
|
|
7627
|
+
purchaserEmail: instrument.purchaserEmail,
|
|
7628
|
+
purchaserName: instrument.purchaserName,
|
|
7629
|
+
message: instrument.message,
|
|
7630
|
+
expiresAt: instrument.expiresAt,
|
|
7631
|
+
offerSnapshot
|
|
7632
|
+
};
|
|
7633
|
+
const lifecycle = deriveGiftingLifecycle({
|
|
7634
|
+
state: instrument.state,
|
|
7635
|
+
expiresAt: instrument.expiresAt,
|
|
7636
|
+
nowIso
|
|
7637
|
+
});
|
|
7638
|
+
if (instrument.kind === "gift_card") {
|
|
7639
|
+
return parseGiftCardInstrument(instrument, base, lifecycle);
|
|
7640
|
+
}
|
|
7641
|
+
return parseVoucherInstrument(instrument, base, lifecycle);
|
|
7642
|
+
}
|
|
7643
|
+
function parseGiftCardInstrument(instrument, base, lifecycle) {
|
|
7644
|
+
const amountCents = instrument.amountCents;
|
|
7645
|
+
const currency = instrument.currency;
|
|
7646
|
+
if (typeof amountCents !== "number" || !Number.isInteger(amountCents) || amountCents <= 0 || typeof currency !== "string" || currency.length === 0) {
|
|
7647
|
+
return err({
|
|
7648
|
+
code: "invalid_gift_card_state",
|
|
7649
|
+
message: `Gift card ${instrument.id} is missing amount or currency.`
|
|
7650
|
+
});
|
|
7651
|
+
}
|
|
7652
|
+
switch (lifecycle) {
|
|
7653
|
+
case "issued":
|
|
7654
|
+
if (!instrument.claimTokenPublicId || !instrument.claimTokenSecretHash) {
|
|
7655
|
+
return err({
|
|
7656
|
+
code: "invalid_gift_card_state",
|
|
7657
|
+
message: `Issued gift card ${instrument.id} is missing claim token fields.`
|
|
7658
|
+
});
|
|
7659
|
+
}
|
|
7660
|
+
return ok({
|
|
7661
|
+
...base,
|
|
7662
|
+
kind: "gift_card",
|
|
7663
|
+
lifecycle: "issued",
|
|
7664
|
+
amountCents,
|
|
7665
|
+
currency,
|
|
7666
|
+
claimTokenPublicId: unsafeAsGiftingClaimTokenPublicId(instrument.claimTokenPublicId),
|
|
7667
|
+
claimTokenSecretHash: unsafeAsGiftingClaimTokenSecretHash(instrument.claimTokenSecretHash)
|
|
7668
|
+
});
|
|
7669
|
+
case "claimed":
|
|
7670
|
+
if (!instrument.claimedCustomerId || !instrument.claimedByEmail || !instrument.claimedAt) {
|
|
7671
|
+
return err({
|
|
7672
|
+
code: "invalid_gift_card_state",
|
|
7673
|
+
message: `Claimed gift card ${instrument.id} is missing claim fields.`
|
|
7674
|
+
});
|
|
7675
|
+
}
|
|
7676
|
+
return ok({
|
|
7677
|
+
...base,
|
|
7678
|
+
kind: "gift_card",
|
|
7679
|
+
lifecycle: "claimed",
|
|
7680
|
+
amountCents,
|
|
7681
|
+
currency,
|
|
7682
|
+
claimedCustomerId: unsafeAsCustomerId(instrument.claimedCustomerId),
|
|
7683
|
+
claimedByEmail: instrument.claimedByEmail,
|
|
7684
|
+
claimedAt: instrument.claimedAt
|
|
7685
|
+
});
|
|
7686
|
+
case "expired": return ok({
|
|
7687
|
+
...base,
|
|
7688
|
+
kind: "gift_card",
|
|
7689
|
+
lifecycle: "expired",
|
|
7690
|
+
amountCents,
|
|
7691
|
+
currency
|
|
7692
|
+
});
|
|
7693
|
+
case "cancelled": return ok({
|
|
7694
|
+
...base,
|
|
7695
|
+
kind: "gift_card",
|
|
7696
|
+
lifecycle: "cancelled",
|
|
7697
|
+
amountCents,
|
|
7698
|
+
currency
|
|
7699
|
+
});
|
|
7700
|
+
case "redeemed": return err({
|
|
7701
|
+
code: "invalid_gift_card_state",
|
|
7702
|
+
message: `Gift card ${instrument.id} has unsupported lifecycle ${lifecycle}.`
|
|
7703
|
+
});
|
|
7704
|
+
}
|
|
7705
|
+
}
|
|
7706
|
+
function parseVoucherInstrument(instrument, base, lifecycle) {
|
|
7707
|
+
if (!instrument.discountCodeId) {
|
|
7708
|
+
return err({
|
|
7709
|
+
code: "invalid_voucher_state",
|
|
7710
|
+
message: `Voucher ${instrument.id} is missing its discount code link.`
|
|
7711
|
+
});
|
|
7712
|
+
}
|
|
7713
|
+
switch (lifecycle) {
|
|
7714
|
+
case "issued": return ok({
|
|
7715
|
+
...base,
|
|
7716
|
+
kind: "voucher",
|
|
7717
|
+
lifecycle: "issued",
|
|
7718
|
+
discountCodeId: instrument.discountCodeId
|
|
7719
|
+
});
|
|
7720
|
+
case "redeemed":
|
|
7721
|
+
if (!instrument.redeemedAt) {
|
|
7722
|
+
return err({
|
|
7723
|
+
code: "invalid_voucher_state",
|
|
7724
|
+
message: `Redeemed voucher ${instrument.id} is missing redeemedAt.`
|
|
7725
|
+
});
|
|
7726
|
+
}
|
|
7727
|
+
return ok({
|
|
7728
|
+
...base,
|
|
7729
|
+
kind: "voucher",
|
|
7730
|
+
lifecycle: "redeemed",
|
|
7731
|
+
discountCodeId: instrument.discountCodeId,
|
|
7732
|
+
redeemedAt: instrument.redeemedAt
|
|
7733
|
+
});
|
|
7734
|
+
case "expired": return ok({
|
|
7735
|
+
...base,
|
|
7736
|
+
kind: "voucher",
|
|
7737
|
+
lifecycle: "expired",
|
|
7738
|
+
discountCodeId: instrument.discountCodeId
|
|
7739
|
+
});
|
|
7740
|
+
case "cancelled": return ok({
|
|
7741
|
+
...base,
|
|
7742
|
+
kind: "voucher",
|
|
7743
|
+
lifecycle: "cancelled",
|
|
7744
|
+
discountCodeId: instrument.discountCodeId
|
|
7745
|
+
});
|
|
7746
|
+
case "claimed": return err({
|
|
7747
|
+
code: "invalid_voucher_state",
|
|
7748
|
+
message: `Voucher ${instrument.id} has unsupported lifecycle ${lifecycle}.`
|
|
7749
|
+
});
|
|
7750
|
+
}
|
|
7751
|
+
}
|
|
7752
|
+
function parseGiftingDelivery(instrument) {
|
|
7753
|
+
switch (instrument.deliveryState) {
|
|
7754
|
+
case "scheduled": return instrument.scheduledSendAt ? {
|
|
7755
|
+
kind: "scheduled",
|
|
7756
|
+
scheduledSendAt: instrument.scheduledSendAt
|
|
7757
|
+
} : null;
|
|
7758
|
+
case "ready_to_send": return { kind: "ready_to_send" };
|
|
7759
|
+
case "sent": return instrument.sentAt ? {
|
|
7760
|
+
kind: "sent",
|
|
7761
|
+
sentAt: instrument.sentAt
|
|
7762
|
+
} : null;
|
|
7763
|
+
case "failed": return { kind: "failed" };
|
|
7764
|
+
case "cancelled": return { kind: "cancelled" };
|
|
7765
|
+
}
|
|
7766
|
+
}
|
|
7767
|
+
function deriveGiftingLifecycle(input) {
|
|
7768
|
+
if (input.state === "cancelled") {
|
|
7769
|
+
return "cancelled";
|
|
7770
|
+
}
|
|
7771
|
+
if (input.state === "claimed") {
|
|
7772
|
+
return "claimed";
|
|
7773
|
+
}
|
|
7774
|
+
if (input.state === "redeemed") {
|
|
7775
|
+
return "redeemed";
|
|
7776
|
+
}
|
|
7777
|
+
if (input.state === "expired") {
|
|
7778
|
+
return "expired";
|
|
7779
|
+
}
|
|
7780
|
+
if (input.expiresAt && input.expiresAt < input.nowIso) return "expired";
|
|
7781
|
+
return "issued";
|
|
7782
|
+
}
|
|
7783
|
+
|
|
7254
7784
|
//#endregion
|
|
7255
7785
|
//#region ../commerce/src/purchase/stripeCommissionMetadata.ts
|
|
7256
7786
|
/** Reasons are payment evidence, not an independent pricing policy. */
|
|
@@ -7429,6 +7959,33 @@ function parseOptionalDatedOfferingOrderItemEngineMetadata(raw) {
|
|
|
7429
7959
|
const checkout = parseDatedOfferingOrderItemEngineMetadata(raw);
|
|
7430
7960
|
return checkout.ok ? checkout : err("Invalid dated offering order item metadata");
|
|
7431
7961
|
}
|
|
7962
|
+
const giftSummarySchema = z.object({
|
|
7963
|
+
offerId: z.string().min(1),
|
|
7964
|
+
displayName: z.string().min(1),
|
|
7965
|
+
giftKind: z.enum(["gift_card", "voucher"]),
|
|
7966
|
+
amountCents: z.number().int().nonnegative()
|
|
7967
|
+
});
|
|
7968
|
+
const giftMetadataSchema = z.discriminatedUnion("stage", [giftSummarySchema.extend({ stage: z.literal("summary") }), giftSummarySchema.extend({
|
|
7969
|
+
stage: z.literal("request"),
|
|
7970
|
+
recipientName: z.string().nullable(),
|
|
7971
|
+
recipientEmail: z.string().min(1),
|
|
7972
|
+
message: z.string().nullable(),
|
|
7973
|
+
sendAt: z.string().refine((value) => Number.isFinite(Date.parse(value))).nullable(),
|
|
7974
|
+
issuance: z.object({
|
|
7975
|
+
offer: giftingOfferSnapshotSchema,
|
|
7976
|
+
expiryDays: z.number().int().positive(),
|
|
7977
|
+
currency: z.string().length(3)
|
|
7978
|
+
})
|
|
7979
|
+
})]);
|
|
7980
|
+
function parseGiftOrderItemMetadata(raw) {
|
|
7981
|
+
const parsed = giftMetadataSchema.safeParse(raw);
|
|
7982
|
+
if (!parsed.success) return err("Invalid gift order item metadata");
|
|
7983
|
+
const commission = parseStripeBookingCommissionMetadata(raw);
|
|
7984
|
+
return commission.ok ? ok({
|
|
7985
|
+
...parsed.data,
|
|
7986
|
+
...commission.value
|
|
7987
|
+
}) : err(commission.error);
|
|
7988
|
+
}
|
|
7432
7989
|
function isObjectRecord(raw) {
|
|
7433
7990
|
return raw != null && typeof raw === "object" && !Array.isArray(raw);
|
|
7434
7991
|
}
|
|
@@ -7477,6 +8034,7 @@ function parseOrderItemMetadata(kind, raw) {
|
|
|
7477
8034
|
const commissionMetadata = parseStripeBookingCommissionMetadata(raw);
|
|
7478
8035
|
if (!commissionMetadata.ok) return err(commissionMetadata.error);
|
|
7479
8036
|
switch (kind) {
|
|
8037
|
+
case "gift": return parseGiftOrderItemMetadata(raw);
|
|
7480
8038
|
case "event_ticket": {
|
|
7481
8039
|
const checkoutLineMetadata = parseCheckoutLineMetadata(raw);
|
|
7482
8040
|
const pricingMetadata = parseBookableOrderItemPricingMetadata(raw);
|
|
@@ -8675,8 +9233,8 @@ function planShopRefund(order, shopItems) {
|
|
|
8675
9233
|
const refundableItems = shopItems.map((item) => ({
|
|
8676
9234
|
item,
|
|
8677
9235
|
displayName: getOrderItemDisplayName(item),
|
|
8678
|
-
refundMode: "refund_and_revoke",
|
|
8679
|
-
sourceType: item.kind === "pass" ? "pass_order_refund" : "product_order_refund"
|
|
9236
|
+
refundMode: item.kind === "gift" ? "refund_only" : "refund_and_revoke",
|
|
9237
|
+
sourceType: item.kind === "pass" ? "pass_order_refund" : item.kind === "gift" ? "gift_order_refund" : "product_order_refund"
|
|
8680
9238
|
}));
|
|
8681
9239
|
return {
|
|
8682
9240
|
ok: true,
|
|
@@ -9183,11 +9741,12 @@ function discountCodeAppliesTo(code, scopes, context, now) {
|
|
|
9183
9741
|
}
|
|
9184
9742
|
/**
|
|
9185
9743
|
* Public refusal wording also owns the lifecycle check used by applicability. A gift voucher's code is
|
|
9186
|
-
* switched off once it's redeemed,
|
|
9744
|
+
* switched off once it's redeemed or cancelled, with the gift state distinguishing those outcomes. Any other inactive code
|
|
9187
9745
|
* reads as unknown, so turning a code off doesn't advertise that it existed.
|
|
9188
9746
|
*/
|
|
9189
9747
|
function discountCodeAvailabilityMessage(code, now) {
|
|
9190
9748
|
const voucher = Boolean(code.giftingInstrumentId);
|
|
9749
|
+
if (voucher && code.giftingInstrumentState === "cancelled") return "This gift voucher has been cancelled.";
|
|
9191
9750
|
if (!code.isActive) return voucher ? "This gift voucher has already been used." : "We don't recognise that code.";
|
|
9192
9751
|
if (code.startsAt !== null && code.startsAt > now) return "This code isn't active yet.";
|
|
9193
9752
|
if (code.endsAt !== null && code.endsAt < now) return voucher ? "This gift voucher has expired." : "This code has ended.";
|
|
@@ -11649,7 +12208,8 @@ const orderItemSchema = exactSchema()(z.object({
|
|
|
11649
12208
|
"event_series_registration",
|
|
11650
12209
|
"pass",
|
|
11651
12210
|
"membership",
|
|
11652
|
-
"appointment"
|
|
12211
|
+
"appointment",
|
|
12212
|
+
"gift"
|
|
11653
12213
|
]),
|
|
11654
12214
|
displayName: z.string(),
|
|
11655
12215
|
quantity: z.number(),
|
|
@@ -11937,6 +12497,25 @@ const portalRegularSessionCadenceSchema = exactSchema()(z.discriminatedUnion("ki
|
|
|
11937
12497
|
"last"
|
|
11938
12498
|
])
|
|
11939
12499
|
})]));
|
|
12500
|
+
const patternSchema = exactSchema()(z.object({
|
|
12501
|
+
cadence: z.discriminatedUnion("kind", [z.object({
|
|
12502
|
+
kind: z.literal("weekly"),
|
|
12503
|
+
everyWeeks: z.literal([1, 2])
|
|
12504
|
+
}), z.object({
|
|
12505
|
+
kind: z.literal("monthly"),
|
|
12506
|
+
nth: z.literal([
|
|
12507
|
+
1,
|
|
12508
|
+
2,
|
|
12509
|
+
3,
|
|
12510
|
+
4,
|
|
12511
|
+
"last"
|
|
12512
|
+
])
|
|
12513
|
+
})]),
|
|
12514
|
+
days: z.array(z.object({
|
|
12515
|
+
weekday: weekdaySchema,
|
|
12516
|
+
localStart: z.string()
|
|
12517
|
+
})).min(1).readonly()
|
|
12518
|
+
}));
|
|
11940
12519
|
const dateSchema = exactSchema()(z.union([
|
|
11941
12520
|
z.object({
|
|
11942
12521
|
state: z.literal("booked"),
|
|
@@ -11963,11 +12542,7 @@ const dateSchema = exactSchema()(z.union([
|
|
|
11963
12542
|
const portalRegularSessionSchema = exactSchema()(z.object({
|
|
11964
12543
|
arrangementId: brandedId(parseClientArrangementId, "regular sessions id"),
|
|
11965
12544
|
timezone: z.string(),
|
|
11966
|
-
|
|
11967
|
-
effectiveFrom: z.string(),
|
|
11968
|
-
cadence: portalRegularSessionCadenceSchema,
|
|
11969
|
-
localStart: z.string()
|
|
11970
|
-
}),
|
|
12545
|
+
pattern: patternSchema,
|
|
11971
12546
|
trainerName: z.string().nullable(),
|
|
11972
12547
|
serviceName: z.string().nullable(),
|
|
11973
12548
|
holdsTime: z.boolean(),
|
|
@@ -14155,6 +14730,44 @@ const GIFTING_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
|
|
|
14155
14730
|
"server:internal_error"
|
|
14156
14731
|
]
|
|
14157
14732
|
},
|
|
14733
|
+
getGiftRefund: {
|
|
14734
|
+
path: "/sites/{siteId}/gifting/refunds/{orderItemId}",
|
|
14735
|
+
method: "GET",
|
|
14736
|
+
auth: "user",
|
|
14737
|
+
responseKind: "json",
|
|
14738
|
+
errors: [
|
|
14739
|
+
"auth:forbidden",
|
|
14740
|
+
"resource:conflict",
|
|
14741
|
+
"server:internal_error"
|
|
14742
|
+
]
|
|
14743
|
+
},
|
|
14744
|
+
refundGift: {
|
|
14745
|
+
path: "/sites/{siteId}/gifting/refunds/{orderItemId}",
|
|
14746
|
+
method: "POST",
|
|
14747
|
+
auth: "user",
|
|
14748
|
+
responseKind: "json",
|
|
14749
|
+
tags: ["site-{siteId}", "gifting-gifts-{siteId}"],
|
|
14750
|
+
demoMutation: DEMO_MUTATION_BLOCKED_HIDDEN,
|
|
14751
|
+
errors: [
|
|
14752
|
+
"auth:forbidden",
|
|
14753
|
+
"resource:conflict",
|
|
14754
|
+
"server:internal_error"
|
|
14755
|
+
]
|
|
14756
|
+
},
|
|
14757
|
+
cancelGift: {
|
|
14758
|
+
path: "/sites/{siteId}/gifting/gifts/{giftId}/cancel",
|
|
14759
|
+
method: "POST",
|
|
14760
|
+
tags: ["site-{siteId}", "gifting-gifts-{siteId}"],
|
|
14761
|
+
demoMutation: DEMO_MUTATION_BLOCKED_HIDDEN,
|
|
14762
|
+
auth: "user",
|
|
14763
|
+
responseKind: "json",
|
|
14764
|
+
errors: [
|
|
14765
|
+
"auth:forbidden",
|
|
14766
|
+
"resource:not_found",
|
|
14767
|
+
"resource:conflict",
|
|
14768
|
+
"server:internal_error"
|
|
14769
|
+
]
|
|
14770
|
+
},
|
|
14158
14771
|
changeGiftExpiry: {
|
|
14159
14772
|
path: "/sites/{siteId}/gifting/gifts/{giftId}/expiry",
|
|
14160
14773
|
method: "POST",
|
|
@@ -16727,6 +17340,22 @@ const ENDPOINT_DEFINITIONS = {
|
|
|
16727
17340
|
auth: "user",
|
|
16728
17341
|
responseKind: "json"
|
|
16729
17342
|
},
|
|
17343
|
+
getRegisteredDomainContact: {
|
|
17344
|
+
errors: [
|
|
17345
|
+
"resource:not_found",
|
|
17346
|
+
"auth:forbidden",
|
|
17347
|
+
"validation:invalid_input"
|
|
17348
|
+
],
|
|
17349
|
+
path: "/domains/{domainId}/registrar/contact",
|
|
17350
|
+
method: "GET",
|
|
17351
|
+
auth: "user",
|
|
17352
|
+
tags: [
|
|
17353
|
+
"domains",
|
|
17354
|
+
"domain-{domainId}",
|
|
17355
|
+
"domain-registrar"
|
|
17356
|
+
],
|
|
17357
|
+
responseKind: "json"
|
|
17358
|
+
},
|
|
16730
17359
|
updateRegisteredDomainContact: {
|
|
16731
17360
|
path: "/domains/{domainId}/registrar/contact",
|
|
16732
17361
|
method: "POST",
|
|
@@ -16811,6 +17440,18 @@ const ENDPOINT_DEFINITIONS = {
|
|
|
16811
17440
|
auth: "user",
|
|
16812
17441
|
responseKind: "json"
|
|
16813
17442
|
},
|
|
17443
|
+
retryDomainEmailSending: {
|
|
17444
|
+
errors: [],
|
|
17445
|
+
path: "/sites/{siteId}/domains/{domainId}/email/retry",
|
|
17446
|
+
method: "POST",
|
|
17447
|
+
tags: [
|
|
17448
|
+
"domains",
|
|
17449
|
+
"domain-{domainId}",
|
|
17450
|
+
"domain-dns"
|
|
17451
|
+
],
|
|
17452
|
+
auth: "user",
|
|
17453
|
+
responseKind: "json"
|
|
17454
|
+
},
|
|
16814
17455
|
retryDomainResend: {
|
|
16815
17456
|
path: "/domains/{domainId}/resend",
|
|
16816
17457
|
method: "POST",
|
|
@@ -21054,6 +21695,25 @@ function parseBillingReturn(raw) {
|
|
|
21054
21695
|
return parsed.success ? parsed.data : null;
|
|
21055
21696
|
}
|
|
21056
21697
|
|
|
21698
|
+
//#endregion
|
|
21699
|
+
//#region ../api/src/common/releaseOperationPause.ts
|
|
21700
|
+
const RELEASE_PAUSE_KINDS = [
|
|
21701
|
+
"bookings_money",
|
|
21702
|
+
"site_editing",
|
|
21703
|
+
"background_jobs"
|
|
21704
|
+
];
|
|
21705
|
+
const RELEASE_PAUSE_MAX_DURATION_MS = 30 * 60 * 1e3;
|
|
21706
|
+
const releaseOperationPauseSchema = z.object({
|
|
21707
|
+
kinds: z.array(z.enum(RELEASE_PAUSE_KINDS)),
|
|
21708
|
+
expiresAt: z.string().datetime({ offset: true }).nullable()
|
|
21709
|
+
});
|
|
21710
|
+
const RELEASE_BOOKINGS_PAUSED_MESSAGE = "Bookings are briefly unavailable while we make an update. Please try again in a few minutes.";
|
|
21711
|
+
const RELEASE_STAFF_PAUSED_MESSAGE = "Changes are paused briefly while we make an update. You can still view your site.";
|
|
21712
|
+
/** Expiry belongs to the decision, including a read retained while work was queued. */
|
|
21713
|
+
function releaseOperationIsPaused(pause, kind, now) {
|
|
21714
|
+
return pause.expiresAt !== null && Date.parse(pause.expiresAt) > now && pause.kinds.includes(kind);
|
|
21715
|
+
}
|
|
21716
|
+
|
|
21057
21717
|
//#endregion
|
|
21058
21718
|
//#region ../api/src/bookingVerticals.ts
|
|
21059
21719
|
/**
|
|
@@ -21460,9 +22120,15 @@ const pageDesignBoundaryTreatmentSchema = z.discriminatedUnion("kind", [
|
|
|
21460
22120
|
slope: z.enum([
|
|
21461
22121
|
"subtle",
|
|
21462
22122
|
"balanced",
|
|
21463
|
-
"steep"
|
|
22123
|
+
"steep",
|
|
22124
|
+
"steady"
|
|
21464
22125
|
]),
|
|
21465
22126
|
direction: z.enum(["forward", "reverse"])
|
|
22127
|
+
}).strict(),
|
|
22128
|
+
z.object({
|
|
22129
|
+
kind: z.literal("torn-edge"),
|
|
22130
|
+
height: z.enum(["compact"]),
|
|
22131
|
+
cut: z.enum(["holes"])
|
|
21466
22132
|
}).strict()
|
|
21467
22133
|
]);
|
|
21468
22134
|
const pageDesignUserPinnedBoundaryTreatmentChoiceSchema = z.object({
|
|
@@ -23798,6 +24464,127 @@ function createPageOperations(http) {
|
|
|
23798
24464
|
};
|
|
23799
24465
|
}
|
|
23800
24466
|
|
|
24467
|
+
//#endregion
|
|
24468
|
+
//#region ../site-contracts/src/blocks/editorData.ts
|
|
24469
|
+
const unavailableSiteFacts = { catalogue: { kind: "Unavailable" } };
|
|
24470
|
+
/** The values each fact can take, as data: the manifest schema and the condition check both read it. */
|
|
24471
|
+
const CONDITION_FACT_VALUES = {
|
|
24472
|
+
"catalogue.passes": ["none", "some"],
|
|
24473
|
+
"catalogue.memberships": ["none", "some"]
|
|
24474
|
+
};
|
|
24475
|
+
const noneOrSome = (count) => count > 0 ? "some" : "none";
|
|
24476
|
+
const conditionFactReaders = {
|
|
24477
|
+
"catalogue.passes": (facts) => mapReadinessFact(facts.catalogue, (catalogue) => noneOrSome(catalogue.passes)),
|
|
24478
|
+
"catalogue.memberships": (facts) => mapReadinessFact(facts.catalogue, (catalogue) => noneOrSome(catalogue.memberships))
|
|
24479
|
+
};
|
|
24480
|
+
/** A named fact's value for a condition, or `Unavailable` when the site fact behind it couldn't be read. */
|
|
24481
|
+
function readConditionFact(facts, name) {
|
|
24482
|
+
return conditionFactReaders[name](facts);
|
|
24483
|
+
}
|
|
24484
|
+
function mapReadinessFact(fact, project) {
|
|
24485
|
+
return fact.kind === "Loaded" ? {
|
|
24486
|
+
kind: "Loaded",
|
|
24487
|
+
value: project(fact.value)
|
|
24488
|
+
} : fact;
|
|
24489
|
+
}
|
|
24490
|
+
|
|
24491
|
+
//#endregion
|
|
24492
|
+
//#region ../site-contracts/src/blocks/knobs.ts
|
|
24493
|
+
/** Knob ownership is shared by facets and style-offer validation. */
|
|
24494
|
+
const cardListItemParts = [
|
|
24495
|
+
"media",
|
|
24496
|
+
"title",
|
|
24497
|
+
"text",
|
|
24498
|
+
"facts",
|
|
24499
|
+
"chips",
|
|
24500
|
+
"numeral",
|
|
24501
|
+
"schedule",
|
|
24502
|
+
"dates",
|
|
24503
|
+
"availability",
|
|
24504
|
+
"action",
|
|
24505
|
+
"price",
|
|
24506
|
+
"date-stamp"
|
|
24507
|
+
];
|
|
24508
|
+
/** Block supply is capability, never a second Look catalogue. */
|
|
24509
|
+
const cardListBlockParts = {
|
|
24510
|
+
"block.feature-cards": [
|
|
24511
|
+
"media",
|
|
24512
|
+
"title",
|
|
24513
|
+
"text",
|
|
24514
|
+
"action"
|
|
24515
|
+
],
|
|
24516
|
+
"block.offerings-preview": [
|
|
24517
|
+
"media",
|
|
24518
|
+
"title",
|
|
24519
|
+
"text",
|
|
24520
|
+
"facts",
|
|
24521
|
+
"chips",
|
|
24522
|
+
"numeral",
|
|
24523
|
+
"schedule",
|
|
24524
|
+
"dates",
|
|
24525
|
+
"availability",
|
|
24526
|
+
"action",
|
|
24527
|
+
"date-stamp"
|
|
24528
|
+
],
|
|
24529
|
+
"block.appointment-services": [
|
|
24530
|
+
"media",
|
|
24531
|
+
"title",
|
|
24532
|
+
"text",
|
|
24533
|
+
"facts",
|
|
24534
|
+
"action"
|
|
24535
|
+
],
|
|
24536
|
+
"block.team-members": [
|
|
24537
|
+
"media",
|
|
24538
|
+
"title",
|
|
24539
|
+
"text",
|
|
24540
|
+
"facts",
|
|
24541
|
+
"chips",
|
|
24542
|
+
"action"
|
|
24543
|
+
],
|
|
24544
|
+
"block.shop": [
|
|
24545
|
+
"title",
|
|
24546
|
+
"text",
|
|
24547
|
+
"facts",
|
|
24548
|
+
"price",
|
|
24549
|
+
"action"
|
|
24550
|
+
]
|
|
24551
|
+
};
|
|
24552
|
+
const cardListFamilyBlocks = Object.keys(cardListBlockParts);
|
|
24553
|
+
const cardListKnobBlocks = [...cardListFamilyBlocks, "block.event-calendar"];
|
|
24554
|
+
const lookKnobBlocks = {
|
|
24555
|
+
actionStyle: cardListKnobBlocks,
|
|
24556
|
+
titleSize: "block.hero",
|
|
24557
|
+
imagePosition: [
|
|
24558
|
+
"block.hero",
|
|
24559
|
+
"block.intro",
|
|
24560
|
+
"block.media-text"
|
|
24561
|
+
],
|
|
24562
|
+
imageShape: ["block.intro", "block.media-text"],
|
|
24563
|
+
aspectRatio: "block.media-text",
|
|
24564
|
+
stickerLine: "block.hero",
|
|
24565
|
+
smallCaption: "block.hero",
|
|
24566
|
+
photoTint: "block.hero",
|
|
24567
|
+
candleGlow: "block.hero",
|
|
24568
|
+
columnGuides: "block.hero",
|
|
24569
|
+
showPhotos: cardListKnobBlocks,
|
|
24570
|
+
cardMarker: cardListFamilyBlocks,
|
|
24571
|
+
dates: "block.offerings-preview",
|
|
24572
|
+
grouping: "block.offerings-preview",
|
|
24573
|
+
columns: "block.feature-cards",
|
|
24574
|
+
listColumns: "block.event-calendar",
|
|
24575
|
+
blackAndWhite: "block.image-gallery",
|
|
24576
|
+
showCapacity: "block.event-calendar",
|
|
24577
|
+
alignment: "block.body-text",
|
|
24578
|
+
autoAdvance: "block.testimonials",
|
|
24579
|
+
quoteCount: "block.testimonials",
|
|
24580
|
+
archFrame: [
|
|
24581
|
+
"block.testimonials",
|
|
24582
|
+
"block.newsletter-signup",
|
|
24583
|
+
"block.form"
|
|
24584
|
+
],
|
|
24585
|
+
tilt: "block.testimonials"
|
|
24586
|
+
};
|
|
24587
|
+
|
|
23801
24588
|
//#endregion
|
|
23802
24589
|
//#region ../site-contracts/src/blocks/fieldUi.ts
|
|
23803
24590
|
const visibilityLevels = [
|
|
@@ -23824,6 +24611,46 @@ const mediaDeliverySchema = z.object({
|
|
|
23824
24611
|
]).optional(),
|
|
23825
24612
|
strategyOptions: z.record(z.string(), z.unknown()).optional()
|
|
23826
24613
|
});
|
|
24614
|
+
/**
|
|
24615
|
+
* The key each kind of condition is told apart by. A condition is exactly one
|
|
24616
|
+
* kind, so it carries exactly one of these: two tests together are written as
|
|
24617
|
+
* `allOf`, never as one object with two kinds' keys.
|
|
24618
|
+
*/
|
|
24619
|
+
const CONDITION_KIND_KEYS = [
|
|
24620
|
+
"field",
|
|
24621
|
+
"fact",
|
|
24622
|
+
"look",
|
|
24623
|
+
"knob",
|
|
24624
|
+
"template",
|
|
24625
|
+
"observation",
|
|
24626
|
+
"allOf",
|
|
24627
|
+
"anyOf"
|
|
24628
|
+
];
|
|
24629
|
+
const BLOCK_LOOK_STATES = ["applies", "none"];
|
|
24630
|
+
/** The values each observation can include, as data: the manifest schema reads it. */
|
|
24631
|
+
const BLOCK_OBSERVATION_VALUES = { "classPrices.items": [
|
|
24632
|
+
"session",
|
|
24633
|
+
"discount",
|
|
24634
|
+
"passes"
|
|
24635
|
+
] };
|
|
24636
|
+
const unknownBlockObservations = { "classPrices.items": { kind: "Unavailable" } };
|
|
24637
|
+
/** Nothing known about the block's place: every condition on it is unknown, so its fields show. */
|
|
24638
|
+
const unknownBlockFacts = {
|
|
24639
|
+
look: { kind: "Unavailable" },
|
|
24640
|
+
template: { kind: "Unavailable" },
|
|
24641
|
+
observations: unknownBlockObservations
|
|
24642
|
+
};
|
|
24643
|
+
/** One case per kind of condition, so a new kind fails to compile wherever conditions are read. */
|
|
24644
|
+
function matchVisibleWhen(condition, cases) {
|
|
24645
|
+
if (condition.allOf !== undefined) return cases.allOf(condition.allOf);
|
|
24646
|
+
if (condition.anyOf !== undefined) return cases.anyOf(condition.anyOf);
|
|
24647
|
+
if (condition.fact !== undefined) return cases.fact(condition);
|
|
24648
|
+
if (condition.look !== undefined) return cases.look(condition);
|
|
24649
|
+
if (condition.knob !== undefined) return cases.knob(condition);
|
|
24650
|
+
if (condition.template !== undefined) return cases.template(condition);
|
|
24651
|
+
if (condition.observation !== undefined) return cases.observation(condition);
|
|
24652
|
+
return cases.field(condition);
|
|
24653
|
+
}
|
|
23827
24654
|
const visibleWhenPredicateSchema = z.object({
|
|
23828
24655
|
field: z.string().min(1),
|
|
23829
24656
|
equals: z.any().optional(),
|
|
@@ -23831,13 +24658,51 @@ const visibleWhenPredicateSchema = z.object({
|
|
|
23831
24658
|
oneOf: z.array(z.any()).optional(),
|
|
23832
24659
|
notIn: z.array(z.any()).optional(),
|
|
23833
24660
|
minItems: z.number().int().nonnegative().optional(),
|
|
23834
|
-
maxItems: z.number().int().nonnegative().optional()
|
|
24661
|
+
maxItems: z.number().int().nonnegative().optional(),
|
|
24662
|
+
hasValue: z.boolean().optional()
|
|
23835
24663
|
});
|
|
23836
|
-
const
|
|
24664
|
+
const visibleWhenFactSchema = z.union([factPredicateSchema("catalogue.passes"), factPredicateSchema("catalogue.memberships")]);
|
|
24665
|
+
function factPredicateSchema(fact) {
|
|
24666
|
+
return z.strictObject({
|
|
24667
|
+
fact: z.literal(fact),
|
|
24668
|
+
is: z.enum(CONDITION_FACT_VALUES[fact])
|
|
24669
|
+
});
|
|
24670
|
+
}
|
|
24671
|
+
const visibleWhenLookSchema = z.strictObject({ look: z.enum(BLOCK_LOOK_STATES) });
|
|
24672
|
+
const lookKnobIds = Object.keys(lookKnobBlocks);
|
|
24673
|
+
const visibleWhenKnobSchema = z.strictObject({
|
|
24674
|
+
knob: z.enum(lookKnobIds),
|
|
24675
|
+
oneOf: z.array(z.string()).min(1)
|
|
24676
|
+
});
|
|
24677
|
+
const visibleWhenTemplateSchema = z.strictObject({ template: z.enum(["product", "page"]) });
|
|
24678
|
+
const visibleWhenObservationSchema = z.strictObject({
|
|
24679
|
+
observation: z.literal("classPrices.items"),
|
|
24680
|
+
includes: z.enum(BLOCK_OBSERVATION_VALUES["classPrices.items"])
|
|
24681
|
+
});
|
|
24682
|
+
/**
|
|
24683
|
+
* A condition carries exactly one kind's key. Checked on the input, before any
|
|
24684
|
+
* arm can strip the keys it doesn't know, so `{ field, equals, look }` is a
|
|
24685
|
+
* declaration error rather than a field test that quietly lost its Look test.
|
|
24686
|
+
*/
|
|
24687
|
+
function checkOneConditionKind(value, ctx) {
|
|
24688
|
+
if (typeof value !== "object" || value === null) return;
|
|
24689
|
+
const kinds = CONDITION_KIND_KEYS.filter((key) => key in value);
|
|
24690
|
+
if (kinds.length <= 1) return;
|
|
24691
|
+
ctx.addIssue({
|
|
24692
|
+
code: "custom",
|
|
24693
|
+
message: `A condition tests one thing, but this one has ${kinds.join(", ")}. Put each test in its own condition inside allOf.`
|
|
24694
|
+
});
|
|
24695
|
+
}
|
|
24696
|
+
const visibleWhenSchema = z.lazy(() => z.unknown().superRefine(checkOneConditionKind).pipe(z.union([
|
|
24697
|
+
visibleWhenFactSchema,
|
|
24698
|
+
visibleWhenObservationSchema,
|
|
24699
|
+
visibleWhenLookSchema,
|
|
24700
|
+
visibleWhenKnobSchema,
|
|
24701
|
+
visibleWhenTemplateSchema,
|
|
23837
24702
|
visibleWhenPredicateSchema,
|
|
23838
24703
|
z.object({ allOf: z.array(visibleWhenSchema).min(1) }),
|
|
23839
24704
|
z.object({ anyOf: z.array(visibleWhenSchema).min(1) })
|
|
23840
|
-
]));
|
|
24705
|
+
])));
|
|
23841
24706
|
const uiSchema = z.object({
|
|
23842
24707
|
widget: z.string().optional(),
|
|
23843
24708
|
preset: z.enum(["disclosure"]).optional(),
|
|
@@ -24449,10 +25314,144 @@ function validateManifestLookField(data, ctx) {
|
|
|
24449
25314
|
message: "lookField must name an existing single select field"
|
|
24450
25315
|
});
|
|
24451
25316
|
}
|
|
24452
|
-
const
|
|
24453
|
-
|
|
24454
|
-
|
|
24455
|
-
|
|
25317
|
+
const blockLookFieldShape = { lookField: z.string().min(1).optional() };
|
|
25318
|
+
|
|
25319
|
+
//#endregion
|
|
25320
|
+
//#region ../site-contracts/src/blocks/editing.ts
|
|
25321
|
+
const fieldPathSchema = z.string().min(1);
|
|
25322
|
+
const phraseSchema = z.string().min(1);
|
|
25323
|
+
const summaryPartSchema = z.union([
|
|
25324
|
+
z.strictObject({
|
|
25325
|
+
field: fieldPathSchema,
|
|
25326
|
+
on: phraseSchema
|
|
25327
|
+
}),
|
|
25328
|
+
z.strictObject({
|
|
25329
|
+
field: fieldPathSchema,
|
|
25330
|
+
options: z.record(z.string(), phraseSchema.nullable())
|
|
25331
|
+
}),
|
|
25332
|
+
z.strictObject({
|
|
25333
|
+
field: fieldPathSchema,
|
|
25334
|
+
text: z.strictObject({
|
|
25335
|
+
before: z.string().optional(),
|
|
25336
|
+
after: z.string().optional(),
|
|
25337
|
+
empty: phraseSchema.optional()
|
|
25338
|
+
})
|
|
25339
|
+
}),
|
|
25340
|
+
z.strictObject({
|
|
25341
|
+
field: fieldPathSchema,
|
|
25342
|
+
set: phraseSchema,
|
|
25343
|
+
unset: phraseSchema.optional()
|
|
25344
|
+
}),
|
|
25345
|
+
z.strictObject({
|
|
25346
|
+
field: fieldPathSchema,
|
|
25347
|
+
count: z.strictObject({
|
|
25348
|
+
one: phraseSchema,
|
|
25349
|
+
many: phraseSchema
|
|
25350
|
+
})
|
|
25351
|
+
}),
|
|
25352
|
+
z.strictObject({
|
|
25353
|
+
field: fieldPathSchema,
|
|
25354
|
+
chosen: z.strictObject({
|
|
25355
|
+
fallback: phraseSchema,
|
|
25356
|
+
before: z.string().optional(),
|
|
25357
|
+
after: z.string().optional()
|
|
25358
|
+
})
|
|
25359
|
+
})
|
|
25360
|
+
]);
|
|
25361
|
+
const editingGroupSchema = z.strictObject({
|
|
25362
|
+
id: z.string().regex(/^[a-z][a-z0-9-]*$/u, "A group id is lower-case letters, numbers and hyphens"),
|
|
25363
|
+
title: z.string().min(1),
|
|
25364
|
+
fields: z.array(fieldPathSchema).min(1),
|
|
25365
|
+
summary: z.strictObject({
|
|
25366
|
+
parts: z.array(summaryPartSchema),
|
|
25367
|
+
none: phraseSchema
|
|
25368
|
+
})
|
|
25369
|
+
});
|
|
25370
|
+
const settingsSchema = z.array(z.union([fieldPathSchema, editingGroupSchema]));
|
|
25371
|
+
const blockEditingSchema = z.strictObject({
|
|
25372
|
+
content: z.array(fieldPathSchema),
|
|
25373
|
+
settings: settingsSchema,
|
|
25374
|
+
setup: z.array(fieldPathSchema).optional()
|
|
25375
|
+
});
|
|
25376
|
+
const blockEditingExtensionSchema = z.strictObject({
|
|
25377
|
+
content: z.array(fieldPathSchema).optional(),
|
|
25378
|
+
settings: settingsSchema.optional(),
|
|
25379
|
+
join: z.array(z.strictObject({
|
|
25380
|
+
group: z.string().min(1),
|
|
25381
|
+
fields: z.array(fieldPathSchema).min(1),
|
|
25382
|
+
summary: z.array(summaryPartSchema).optional()
|
|
25383
|
+
})).optional(),
|
|
25384
|
+
setup: z.array(fieldPathSchema).optional()
|
|
25385
|
+
});
|
|
25386
|
+
/** For a block's own declaration: a system manifest or an SDK custom block. */
|
|
25387
|
+
const blockEditingDeclarationShape = { editing: blockEditingSchema.optional() };
|
|
25388
|
+
/** For an SDK field extension on a built-in block. */
|
|
25389
|
+
const blockEditingExtensionShape = { editing: blockEditingExtensionSchema.optional() };
|
|
25390
|
+
/** The most questions setup asks before a block is added. */
|
|
25391
|
+
const MAX_SETUP_FIELDS = 3;
|
|
25392
|
+
/**
|
|
25393
|
+
* A block's declaration with an extension's additions. A `join` naming a
|
|
25394
|
+
* group the block doesn't have is left out here; the layout check reports it,
|
|
25395
|
+
* and its fields go where undeclared fields go.
|
|
25396
|
+
*/
|
|
25397
|
+
function mergeBlockEditing(base, extension) {
|
|
25398
|
+
if (!extension) return base;
|
|
25399
|
+
const added = {
|
|
25400
|
+
content: extension.content ?? [],
|
|
25401
|
+
settings: extension.settings ?? [],
|
|
25402
|
+
setup: extension.setup ?? []
|
|
25403
|
+
};
|
|
25404
|
+
if (!base) return placesSomething(extension) ? withSetup({
|
|
25405
|
+
content: added.content,
|
|
25406
|
+
settings: added.settings
|
|
25407
|
+
}, added.setup) : undefined;
|
|
25408
|
+
const joins = extension.join ?? [];
|
|
25409
|
+
return withSetup({
|
|
25410
|
+
content: [...base.content, ...added.content],
|
|
25411
|
+
settings: [...base.settings.map((entry) => typeof entry === "string" ? entry : joined(entry, joins)), ...added.settings]
|
|
25412
|
+
}, [...base.setup ?? [], ...added.setup]);
|
|
25413
|
+
}
|
|
25414
|
+
function placesSomething(extension) {
|
|
25415
|
+
return [
|
|
25416
|
+
extension.content,
|
|
25417
|
+
extension.settings,
|
|
25418
|
+
extension.setup
|
|
25419
|
+
].some((part) => part !== undefined);
|
|
25420
|
+
}
|
|
25421
|
+
function withSetup(editing, setup) {
|
|
25422
|
+
return setup.length > 0 ? {
|
|
25423
|
+
...editing,
|
|
25424
|
+
setup
|
|
25425
|
+
} : editing;
|
|
25426
|
+
}
|
|
25427
|
+
function joined(group, joins) {
|
|
25428
|
+
const mine = joins.filter((join$1) => join$1.group === group.id);
|
|
25429
|
+
if (mine.length === 0) return group;
|
|
25430
|
+
return {
|
|
25431
|
+
...group,
|
|
25432
|
+
fields: [...group.fields, ...mine.flatMap((join$1) => join$1.fields)],
|
|
25433
|
+
summary: {
|
|
25434
|
+
...group.summary,
|
|
25435
|
+
parts: [...group.summary.parts, ...mine.flatMap((join$1) => join$1.summary ?? [])]
|
|
25436
|
+
}
|
|
25437
|
+
};
|
|
25438
|
+
}
|
|
25439
|
+
/** One case per kind of part, so a new kind fails to compile wherever parts are read. */
|
|
25440
|
+
function matchSummaryPart(part, cases) {
|
|
25441
|
+
if ("on" in part) return cases.on(part);
|
|
25442
|
+
if ("options" in part) return cases.options(part);
|
|
25443
|
+
if ("text" in part) return cases.text(part);
|
|
25444
|
+
if ("set" in part) return cases.set(part);
|
|
25445
|
+
if ("count" in part) return cases.count(part);
|
|
25446
|
+
return cases.chosen(part);
|
|
25447
|
+
}
|
|
25448
|
+
/** Every path a declaration places, in order: content, then settings with each group's fields. */
|
|
25449
|
+
function placedEditingPaths(editing) {
|
|
25450
|
+
return [...editing.content, ...editing.settings.flatMap((entry) => typeof entry === "string" ? [entry] : entry.fields)];
|
|
25451
|
+
}
|
|
25452
|
+
function editingGroups(editing) {
|
|
25453
|
+
return editing.settings.filter((entry) => typeof entry !== "string");
|
|
25454
|
+
}
|
|
24456
25455
|
|
|
24457
25456
|
//#endregion
|
|
24458
25457
|
//#region ../site-contracts/src/blocks/nodes.ts
|
|
@@ -24653,103 +25652,6 @@ const blockSchema = z.object({
|
|
|
24653
25652
|
bindings: z.record(z.string(), z.unknown()).optional()
|
|
24654
25653
|
}).passthrough();
|
|
24655
25654
|
|
|
24656
|
-
//#endregion
|
|
24657
|
-
//#region ../site-contracts/src/blocks/knobs.ts
|
|
24658
|
-
/** Knob ownership is shared by facets and style-offer validation. */
|
|
24659
|
-
const cardListItemParts = [
|
|
24660
|
-
"media",
|
|
24661
|
-
"title",
|
|
24662
|
-
"text",
|
|
24663
|
-
"facts",
|
|
24664
|
-
"chips",
|
|
24665
|
-
"numeral",
|
|
24666
|
-
"schedule",
|
|
24667
|
-
"dates",
|
|
24668
|
-
"availability",
|
|
24669
|
-
"action",
|
|
24670
|
-
"price",
|
|
24671
|
-
"date-stamp"
|
|
24672
|
-
];
|
|
24673
|
-
/** Block supply is capability, never a second Look catalogue. */
|
|
24674
|
-
const cardListBlockParts = {
|
|
24675
|
-
"block.feature-cards": [
|
|
24676
|
-
"media",
|
|
24677
|
-
"title",
|
|
24678
|
-
"text",
|
|
24679
|
-
"action"
|
|
24680
|
-
],
|
|
24681
|
-
"block.offerings-preview": [
|
|
24682
|
-
"media",
|
|
24683
|
-
"title",
|
|
24684
|
-
"text",
|
|
24685
|
-
"facts",
|
|
24686
|
-
"chips",
|
|
24687
|
-
"numeral",
|
|
24688
|
-
"schedule",
|
|
24689
|
-
"dates",
|
|
24690
|
-
"availability",
|
|
24691
|
-
"action",
|
|
24692
|
-
"date-stamp"
|
|
24693
|
-
],
|
|
24694
|
-
"block.appointment-services": [
|
|
24695
|
-
"media",
|
|
24696
|
-
"title",
|
|
24697
|
-
"text",
|
|
24698
|
-
"facts",
|
|
24699
|
-
"action"
|
|
24700
|
-
],
|
|
24701
|
-
"block.team-members": [
|
|
24702
|
-
"media",
|
|
24703
|
-
"title",
|
|
24704
|
-
"text",
|
|
24705
|
-
"facts",
|
|
24706
|
-
"chips",
|
|
24707
|
-
"action"
|
|
24708
|
-
],
|
|
24709
|
-
"block.shop": [
|
|
24710
|
-
"title",
|
|
24711
|
-
"text",
|
|
24712
|
-
"facts",
|
|
24713
|
-
"price",
|
|
24714
|
-
"action"
|
|
24715
|
-
]
|
|
24716
|
-
};
|
|
24717
|
-
const cardListFamilyBlocks = Object.keys(cardListBlockParts);
|
|
24718
|
-
const cardListKnobBlocks = [...cardListFamilyBlocks, "block.event-calendar"];
|
|
24719
|
-
const lookKnobBlocks = {
|
|
24720
|
-
actionStyle: cardListKnobBlocks,
|
|
24721
|
-
titleSize: "block.hero",
|
|
24722
|
-
imagePosition: [
|
|
24723
|
-
"block.hero",
|
|
24724
|
-
"block.intro",
|
|
24725
|
-
"block.media-text"
|
|
24726
|
-
],
|
|
24727
|
-
imageShape: ["block.intro", "block.media-text"],
|
|
24728
|
-
aspectRatio: "block.media-text",
|
|
24729
|
-
stickerLine: "block.hero",
|
|
24730
|
-
smallCaption: "block.hero",
|
|
24731
|
-
photoTint: "block.hero",
|
|
24732
|
-
candleGlow: "block.hero",
|
|
24733
|
-
columnGuides: "block.hero",
|
|
24734
|
-
showPhotos: cardListKnobBlocks,
|
|
24735
|
-
cardMarker: cardListFamilyBlocks,
|
|
24736
|
-
dates: "block.offerings-preview",
|
|
24737
|
-
grouping: "block.offerings-preview",
|
|
24738
|
-
columns: "block.feature-cards",
|
|
24739
|
-
listColumns: "block.event-calendar",
|
|
24740
|
-
blackAndWhite: "block.image-gallery",
|
|
24741
|
-
showCapacity: "block.event-calendar",
|
|
24742
|
-
alignment: "block.body-text",
|
|
24743
|
-
autoAdvance: "block.testimonials",
|
|
24744
|
-
quoteCount: "block.testimonials",
|
|
24745
|
-
archFrame: [
|
|
24746
|
-
"block.testimonials",
|
|
24747
|
-
"block.newsletter-signup",
|
|
24748
|
-
"block.form"
|
|
24749
|
-
],
|
|
24750
|
-
tilt: "block.testimonials"
|
|
24751
|
-
};
|
|
24752
|
-
|
|
24753
25655
|
//#endregion
|
|
24754
25656
|
//#region ../api/src/sdkConfig/contracts.ts
|
|
24755
25657
|
/**
|
|
@@ -24846,11 +25748,13 @@ const sdkCustomBlockInputSchema = z.object({
|
|
|
24846
25748
|
dataLoaders: sdkDataLoadersSchema,
|
|
24847
25749
|
layout: z.optional(customBlockLayoutSchema),
|
|
24848
25750
|
...sdkBlockPresentationShape,
|
|
24849
|
-
...
|
|
25751
|
+
...blockLookFieldShape,
|
|
25752
|
+
...blockEditingDeclarationShape
|
|
24850
25753
|
}).superRefine(validateManifestLookField).superRefine(validateSdkBlockDeclaration);
|
|
24851
25754
|
const sdkBlockFieldExtensionInputSchema = z.object({
|
|
24852
25755
|
fields: z.array(fieldDefinitionInputSchema).min(1),
|
|
24853
|
-
...
|
|
25756
|
+
...blockLookFieldShape,
|
|
25757
|
+
...blockEditingExtensionShape
|
|
24854
25758
|
}).superRefine(validateManifestLookField);
|
|
24855
25759
|
const sdkBlockFieldExtensionsInputSchema = z.record(z.string().min(1), sdkBlockFieldExtensionInputSchema);
|
|
24856
25760
|
const sdkThemePaletteSchema = z.record(z.string(), z.string());
|
|
@@ -27581,6 +28485,9 @@ function parsePublicProductCategorySelector(value) {
|
|
|
27581
28485
|
|
|
27582
28486
|
//#endregion
|
|
27583
28487
|
//#region ../api/src/pageReadResponseCache.ts
|
|
28488
|
+
function pageReadPolicy(siteId, policy) {
|
|
28489
|
+
return policy === "retry" ? buildPageReadRetryPolicy(siteId) : buildPageReadCachePolicy(siteId, policy);
|
|
28490
|
+
}
|
|
27584
28491
|
function isRecord$7(value) {
|
|
27585
28492
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
27586
28493
|
}
|
|
@@ -27591,8 +28498,20 @@ function isResolvedPage(page) {
|
|
|
27591
28498
|
"system_service"
|
|
27592
28499
|
].includes(String(page.result.kind));
|
|
27593
28500
|
}
|
|
28501
|
+
/**
|
|
28502
|
+
* The key `serializeSurfaceTree` (theme-core) wraps a response in when it carries surface revisions. This package
|
|
28503
|
+
* can't depend on theme-core, so the SDK's tests check the two stay equal.
|
|
28504
|
+
*/
|
|
28505
|
+
const SURFACE_TRANSPORT_ENVELOPE_KEY = "$surfaceTransport";
|
|
28506
|
+
/** A revision-transport body keeps the page's own fields under the envelope's `value`. */
|
|
28507
|
+
function withoutSurfaceTransport(data) {
|
|
28508
|
+
const envelope = data[SURFACE_TRANSPORT_ENVELOPE_KEY];
|
|
28509
|
+
if (envelope === undefined) return data;
|
|
28510
|
+
return isRecord$7(envelope) && Array.isArray(envelope.revisions) && envelope.revisions.length > 0 && isRecord$7(envelope.value) ? envelope.value : null;
|
|
28511
|
+
}
|
|
27594
28512
|
function envelopePage(body) {
|
|
27595
|
-
const
|
|
28513
|
+
const raw = isRecord$7(body) && body.success === true && isRecord$7(body.data) ? body.data : null;
|
|
28514
|
+
const data = raw ? withoutSurfaceTransport(raw) : null;
|
|
27596
28515
|
return data?.type === "content" && isRecord$7(data.content) ? data.content : data;
|
|
27597
28516
|
}
|
|
27598
28517
|
function parseBody(body) {
|
|
@@ -27609,40 +28528,44 @@ function admit(snapshot) {
|
|
|
27609
28528
|
if (snapshot.status === 200 && isResolvedPage(page)) {
|
|
27610
28529
|
if (header(snapshot, PAGE_READ_STORAGE_HEADER) === "no-store") return {
|
|
27611
28530
|
kind: "pass-through",
|
|
27612
|
-
|
|
28531
|
+
policy: "retry"
|
|
27613
28532
|
};
|
|
27614
28533
|
return {
|
|
27615
28534
|
kind: "store",
|
|
27616
|
-
|
|
28535
|
+
policy: page.dependencies
|
|
27617
28536
|
};
|
|
27618
28537
|
}
|
|
28538
|
+
if (snapshot.status === 200) return {
|
|
28539
|
+
kind: "pass-through",
|
|
28540
|
+
policy: "retry"
|
|
28541
|
+
};
|
|
27619
28542
|
return {
|
|
27620
28543
|
kind: "pass-through",
|
|
27621
|
-
|
|
28544
|
+
policy: header(snapshot, PAGE_READ_DEPENDENCIES_HEADER) === "availability" ? "availability" : "content"
|
|
27622
28545
|
};
|
|
27623
28546
|
}
|
|
27624
28547
|
/**
|
|
27625
28548
|
* One cache entry per request, judged by the policy it is looked up with. Content is looked up first, so a
|
|
27626
28549
|
* plain page costs one lookup and never registers the availability policy. A page whose snapshot depends on
|
|
27627
|
-
* availability is looked up again under that policy, which checks its tags and
|
|
28550
|
+
* availability (or must be retried soon) is looked up again under that policy, which checks its tags and budget. A snapshot
|
|
27628
28551
|
* past its own budget is never served: the live read replaces it.
|
|
27629
28552
|
*/
|
|
27630
28553
|
function planPageRead(state, now, budgetSeconds) {
|
|
27631
28554
|
const subject = state.live ?? state.cached;
|
|
27632
28555
|
if (!subject) return {
|
|
27633
28556
|
kind: "lookup",
|
|
27634
|
-
|
|
28557
|
+
policy: "content"
|
|
27635
28558
|
};
|
|
27636
|
-
const {
|
|
27637
|
-
if (!state.lookedUp.includes(
|
|
28559
|
+
const { policy } = admit(subject);
|
|
28560
|
+
if (!state.lookedUp.includes(policy)) return {
|
|
27638
28561
|
kind: "lookup",
|
|
27639
|
-
|
|
28562
|
+
policy
|
|
27640
28563
|
};
|
|
27641
28564
|
if (state.live) return {
|
|
27642
28565
|
kind: "serve",
|
|
27643
28566
|
snapshot: state.live
|
|
27644
28567
|
};
|
|
27645
|
-
return now - subject.cachedAt < budgetSeconds(
|
|
28568
|
+
return now - subject.cachedAt < budgetSeconds(policy) * 1e3 ? {
|
|
27646
28569
|
kind: "serve",
|
|
27647
28570
|
snapshot: subject
|
|
27648
28571
|
} : { kind: "read-live" };
|
|
@@ -27653,12 +28576,21 @@ function planPageRead(state, now, budgetSeconds) {
|
|
|
27653
28576
|
*/
|
|
27654
28577
|
var PassThroughResponse = class extends Error {
|
|
27655
28578
|
constructor(snapshot) {
|
|
27656
|
-
super("
|
|
28579
|
+
super("Read must not be stored");
|
|
27657
28580
|
this.snapshot = snapshot;
|
|
27658
28581
|
}
|
|
27659
28582
|
};
|
|
27660
|
-
|
|
27661
|
-
|
|
28583
|
+
/**
|
|
28584
|
+
* Names this cache's entries. Next keys an entry by these parts plus the callback's source text, and neither
|
|
28585
|
+
* changes when the response contract does, so a contract change bumps this name: otherwise a deploy keeps
|
|
28586
|
+
* serving responses the previous release cached, in the old shape, for up to their whole budget.
|
|
28587
|
+
*
|
|
28588
|
+
* - v4: a resolved page carries its own mailing-list support (`mailingList`); the hosted frontend no longer
|
|
28589
|
+
* asks the site read for it, so a v3 response would leave the page's newsletter forms without their lists.
|
|
28590
|
+
*/
|
|
28591
|
+
const PAGE_READ_RESPONSE_CACHE_NAME = "page-read-envelope-v4";
|
|
28592
|
+
async function lookup(input, policy) {
|
|
28593
|
+
const { tags: tags$1 } = pageReadPolicy(input.siteId, policy);
|
|
27662
28594
|
const load = async () => {
|
|
27663
28595
|
const snapshot = await input.live();
|
|
27664
28596
|
if (admit(snapshot).kind === "pass-through") throw new PassThroughResponse(snapshot);
|
|
@@ -27666,8 +28598,8 @@ async function lookup(input, dependencies) {
|
|
|
27666
28598
|
};
|
|
27667
28599
|
try {
|
|
27668
28600
|
return {
|
|
27669
|
-
cached: await input.cache(load, [
|
|
27670
|
-
revalidate: input.budgetSeconds(
|
|
28601
|
+
cached: await input.cache(load, [PAGE_READ_RESPONSE_CACHE_NAME, input.key], {
|
|
28602
|
+
revalidate: input.budgetSeconds(policy),
|
|
27671
28603
|
tags: tags$1
|
|
27672
28604
|
})(),
|
|
27673
28605
|
live: null
|
|
@@ -27689,9 +28621,9 @@ async function runPlan(input, state) {
|
|
|
27689
28621
|
live: await input.live()
|
|
27690
28622
|
});
|
|
27691
28623
|
case "lookup": {
|
|
27692
|
-
const found = await lookup(input, step.
|
|
28624
|
+
const found = await lookup(input, step.policy);
|
|
27693
28625
|
return runPlan(input, {
|
|
27694
|
-
lookedUp: [...state.lookedUp, step.
|
|
28626
|
+
lookedUp: [...state.lookedUp, step.policy],
|
|
27695
28627
|
cached: found.cached ?? state.cached,
|
|
27696
28628
|
live: state.live ?? found.live
|
|
27697
28629
|
});
|
|
@@ -27723,9 +28655,9 @@ async function frameworkCacheKey(request) {
|
|
|
27723
28655
|
async function cachePageReadResponse(input) {
|
|
27724
28656
|
if (!input.cache || input.maxAge !== undefined && input.maxAge <= 0) return input.read();
|
|
27725
28657
|
const maxAge = input.maxAge;
|
|
27726
|
-
const budgetSeconds = (
|
|
27727
|
-
const
|
|
27728
|
-
return maxAge === undefined ?
|
|
28658
|
+
const budgetSeconds = (policy) => {
|
|
28659
|
+
const revalidate = pageReadPolicy(input.siteId, policy).revalidate;
|
|
28660
|
+
return maxAge === undefined ? revalidate : Math.min(revalidate, maxAge);
|
|
27729
28661
|
};
|
|
27730
28662
|
const key = await frameworkCacheKey(input.key);
|
|
27731
28663
|
const result = await runPlan({
|
|
@@ -27744,15 +28676,53 @@ async function cachePageReadResponse(input) {
|
|
|
27744
28676
|
headers: result.headers
|
|
27745
28677
|
});
|
|
27746
28678
|
}
|
|
28679
|
+
/**
|
|
28680
|
+
* Names the site read's entries, for the same reason as `PAGE_READ_RESPONSE_CACHE_NAME`. A site read only
|
|
28681
|
+
* enters this cache when the host can answer it from its durable copy; otherwise it stays in Next's fetch cache.
|
|
28682
|
+
*/
|
|
28683
|
+
const SITE_READ_RESPONSE_CACHE_NAME = "site-read-envelope-v1";
|
|
28684
|
+
/**
|
|
28685
|
+
* A site read through the framework cache, with the fetch cache's lifetime and tags, so its fill can come from
|
|
28686
|
+
* the host's durable copy. As in Next's fetch cache, only a 200 is kept: an incomplete site (207) or a failure
|
|
28687
|
+
* passes through and the next read asks again.
|
|
28688
|
+
*/
|
|
28689
|
+
async function cacheSiteReadResponse(input) {
|
|
28690
|
+
const live = sharedRead(input.read);
|
|
28691
|
+
const load = async () => {
|
|
28692
|
+
const snapshot$1 = await live();
|
|
28693
|
+
if (snapshot$1.status !== 200) throw new PassThroughResponse(snapshot$1);
|
|
28694
|
+
return snapshot$1;
|
|
28695
|
+
};
|
|
28696
|
+
const key = await frameworkCacheKey(input.key);
|
|
28697
|
+
const found = await input.cache(load, [SITE_READ_RESPONSE_CACHE_NAME, key], {
|
|
28698
|
+
revalidate: input.policy.revalidate,
|
|
28699
|
+
tags: input.policy.tags
|
|
28700
|
+
})().catch((error) => {
|
|
28701
|
+
if (error instanceof PassThroughResponse) return error.snapshot;
|
|
28702
|
+
throw error;
|
|
28703
|
+
});
|
|
28704
|
+
const snapshot = Date.now() - found.cachedAt < input.policy.revalidate * 1e3 ? found : await live();
|
|
28705
|
+
return new Response(snapshot.body, {
|
|
28706
|
+
status: snapshot.status,
|
|
28707
|
+
headers: snapshot.headers
|
|
28708
|
+
});
|
|
28709
|
+
}
|
|
27747
28710
|
/** Result adapters use this when the SDK served a page without the HTTP transport (memory, durable or prebuild fallback). */
|
|
27748
28711
|
async function observePageReadPolicy(cache, siteId, payload) {
|
|
27749
28712
|
if (!cache) return;
|
|
27750
|
-
const
|
|
28713
|
+
const policy = observedPageReadPolicy(pageReadDependencies(payload));
|
|
27751
28714
|
await cache(async () => true, [
|
|
27752
|
-
"page-read-policy-
|
|
28715
|
+
"page-read-policy-v3",
|
|
27753
28716
|
siteId,
|
|
27754
|
-
|
|
27755
|
-
],
|
|
28717
|
+
policy
|
|
28718
|
+
], pageReadPolicy(siteId, policy))();
|
|
28719
|
+
}
|
|
28720
|
+
/**
|
|
28721
|
+
* A page served without the tagged transport (memory, durable or prebuild) may predate a write's purge, so an
|
|
28722
|
+
* availability page only earns the retry window, not the rendered-availability backstop a purge would end.
|
|
28723
|
+
*/
|
|
28724
|
+
function observedPageReadPolicy(dependency) {
|
|
28725
|
+
return dependency === "availability" ? "retry" : "content";
|
|
27756
28726
|
}
|
|
27757
28727
|
|
|
27758
28728
|
//#endregion
|
|
@@ -28505,20 +29475,90 @@ function createApiResponseTransport(getHeaders = () => ({}), baseUrl, { sdkVersi
|
|
|
28505
29475
|
function isPublishedPageRead(endpoint, params, options) {
|
|
28506
29476
|
return (endpoint === "getContentByPath" || endpoint === "resolveRouteOutcome") && params?.preview !== true && params?.preview !== "true" && options.cache !== "no-store";
|
|
28507
29477
|
}
|
|
29478
|
+
/** The dashboard's reading of a boolean query flag, so a host never treats `force=1` as unforced. */
|
|
29479
|
+
const isTruthyRequestParam = (value) => value === true || value === "true" || value === 1 || value === "1";
|
|
29480
|
+
/** Forced reads skip every cache, and an id-only lookup is a different response the durable cache never holds. */
|
|
29481
|
+
function isFullSiteRead(params) {
|
|
29482
|
+
return !isTruthyRequestParam(params.force) && (params.scope === undefined || params.scope === "full");
|
|
29483
|
+
}
|
|
29484
|
+
/** A published, full site read with a lifetime: the host's durable copy may answer it, under the fetch's policy. */
|
|
29485
|
+
function publishedSiteReadPolicy(endpoint, params, plan) {
|
|
29486
|
+
const next = plan.init.cache === "no-store" ? undefined : plan.init.next;
|
|
29487
|
+
const revalidate = typeof next?.revalidate === "number" && next.revalidate > 0 ? next.revalidate : null;
|
|
29488
|
+
return endpoint === "getSite" && revalidate !== null && isFullSiteRead(params) ? {
|
|
29489
|
+
revalidate,
|
|
29490
|
+
tags: next?.tags ?? []
|
|
29491
|
+
} : null;
|
|
29492
|
+
}
|
|
29493
|
+
/** The dashboard's success envelope around a durable copy, so admission and parsing treat it like a live response. */
|
|
29494
|
+
function freshPublishedResponse(data) {
|
|
29495
|
+
return new Response(JSON.stringify(buildSuccessEnvelope(data, undefined)), {
|
|
29496
|
+
status: 200,
|
|
29497
|
+
headers: {
|
|
29498
|
+
"content-type": "application/json",
|
|
29499
|
+
"x-riverbank-cache": "frontend-hit"
|
|
29500
|
+
}
|
|
29501
|
+
});
|
|
29502
|
+
}
|
|
29503
|
+
/** The cache fill's read: the host's fresh durable copy when it has one, otherwise the dashboard. */
|
|
29504
|
+
function freshPublishedFirst(read, request, live) {
|
|
29505
|
+
if (!read) return live;
|
|
29506
|
+
return async () => {
|
|
29507
|
+
const found = await read(request).catch(() => null);
|
|
29508
|
+
return found ? freshPublishedResponse(found.data) : live();
|
|
29509
|
+
};
|
|
29510
|
+
}
|
|
29511
|
+
function publishedPageResponse(read) {
|
|
29512
|
+
const revalidate = read.plan.init.next?.revalidate;
|
|
29513
|
+
return cachePageReadResponse({
|
|
29514
|
+
cache: read.frameworkCache?.cache ?? null,
|
|
29515
|
+
key: read.key,
|
|
29516
|
+
siteId: typeof read.params.siteId === "string" ? read.params.siteId : "",
|
|
29517
|
+
maxAge: typeof revalidate === "number" ? revalidate : undefined,
|
|
29518
|
+
read: read.endpoint === "getContentByPath" ? freshPublishedFirst(read.frameworkCache?.readFreshPublished, {
|
|
29519
|
+
endpoint: "getContentByPath",
|
|
29520
|
+
params: read.params
|
|
29521
|
+
}, read.uncachedFetch) : read.uncachedFetch
|
|
29522
|
+
});
|
|
29523
|
+
}
|
|
29524
|
+
/** Without a durable reader, a site read stays in Next's fetch cache exactly as before. */
|
|
29525
|
+
function siteOrFetchResponse(read) {
|
|
29526
|
+
const durable = read.frameworkCache?.readFreshPublished;
|
|
29527
|
+
const policy = durable ? publishedSiteReadPolicy(read.endpoint, read.params, read.plan) : null;
|
|
29528
|
+
return read.frameworkCache && policy ? cacheSiteReadResponse({
|
|
29529
|
+
cache: read.frameworkCache.cache,
|
|
29530
|
+
key: read.key,
|
|
29531
|
+
policy,
|
|
29532
|
+
read: freshPublishedFirst(durable, {
|
|
29533
|
+
endpoint: "getSite",
|
|
29534
|
+
params: read.params
|
|
29535
|
+
}, read.uncachedFetch)
|
|
29536
|
+
}) : observedFetch(read.plan, read.endpoint, read.frameworkCache);
|
|
29537
|
+
}
|
|
28508
29538
|
function executeApiRequest(plan, endpoint, params, options, frameworkCache) {
|
|
28509
|
-
const
|
|
28510
|
-
const
|
|
28511
|
-
|
|
28512
|
-
|
|
28513
|
-
|
|
29539
|
+
const { next: _fetchPolicy, ...uncachedInit } = plan.init;
|
|
29540
|
+
const read = {
|
|
29541
|
+
plan,
|
|
29542
|
+
endpoint,
|
|
29543
|
+
params: params ?? {},
|
|
29544
|
+
frameworkCache,
|
|
28514
29545
|
key: JSON.stringify([plan.url, [...new Headers(plan.init.headers).entries()]]),
|
|
28515
|
-
|
|
28516
|
-
maxAge: typeof fetchPolicy?.revalidate === "number" ? fetchPolicy.revalidate : undefined,
|
|
28517
|
-
read: () => fetch(plan.url, {
|
|
29546
|
+
uncachedFetch: () => fetch(plan.url, {
|
|
28518
29547
|
...uncachedInit,
|
|
28519
29548
|
cache: "no-store"
|
|
28520
29549
|
})
|
|
28521
|
-
}
|
|
29550
|
+
};
|
|
29551
|
+
return isPublishedPageRead(endpoint, params, options) ? publishedPageResponse(read) : siteOrFetchResponse(read);
|
|
29552
|
+
}
|
|
29553
|
+
function observedFetch(plan, endpoint, frameworkCache) {
|
|
29554
|
+
const revalidate = plan.init.next?.revalidate;
|
|
29555
|
+
if (typeof revalidate === "number" && plan.init.cache !== "no-store") {
|
|
29556
|
+
frameworkCache?.observeFetchLifetime?.({
|
|
29557
|
+
endpoint: String(endpoint),
|
|
29558
|
+
revalidate
|
|
29559
|
+
});
|
|
29560
|
+
}
|
|
29561
|
+
return fetch(plan.url, plan.init);
|
|
28522
29562
|
}
|
|
28523
29563
|
const batchReadPolicyBodySchema = z.object({ requests: z.array(z.object({
|
|
28524
29564
|
endpoint: z.string(),
|
|
@@ -28874,7 +29914,8 @@ const PERSON_REMOVAL_CLEANUP_KINDS = [
|
|
|
28874
29914
|
"storage",
|
|
28875
29915
|
"stripe",
|
|
28876
29916
|
"google_calendar",
|
|
28877
|
-
"newsletter"
|
|
29917
|
+
"newsletter",
|
|
29918
|
+
"gift_delivery"
|
|
28878
29919
|
];
|
|
28879
29920
|
|
|
28880
29921
|
//#endregion
|
|
@@ -38973,4 +40014,4 @@ function optionalTitle(data) {
|
|
|
38973
40014
|
}
|
|
38974
40015
|
|
|
38975
40016
|
//#endregion
|
|
38976
|
-
export { walkLocalContentMedia as $,
|
|
40017
|
+
export { walkLocalContentMedia as $, resolveRepeaterGridSpanFieldId as $n, repriceBookingCollectionOptions as $r, commandContexts as $t, formatDiffSummary as A, isLocalConfigured as An, roomsOfferSharing as Ar, navigationIdentityMap as At, formatFieldChange as B, matchSummaryPart as Bn, nextCombinationHint as Br, ACCOUNT_SITE_SEARCH_MAX_LENGTH as Bt, reportFromOutcomes as C, monthNumber as Ci, ErrorCodes as Cn, resolveSelectionAttendanceMode as Cr, listFiles as Ct, calculateDiff as D, unwrapResponse as Di, createOutput as Dn, checkoutStatusArms as Dr, isMediaValue as Dt, createEmptySyncResult as E, ApiEnvelopeError as Ei, CliExit as En, bookingQuestionsSectionSchema as Er, writeJsonFileAtomic as Et, buildJsonDiff as F, bindingSchema as Fn, reviewedRoomsSchema as Fr, createBearerAccountApi as Ft, applyLocalMediaPush as G, blockContentSourceSchema as Gn, stayNoteText as Gr, createPushConfigCommand as Gt, revalidateLocalMediaPushPlan as H, placedEditingPaths as Hn, eventRegistrationErrors as Hr, navigationCommandItemToManagementInput as Ht, hasPageOperations as I, customLayoutSizeProblem as In, roomChoicesSchema as Ir, ACCOUNT_SITE_CURSOR_MAX_LENGTH as It, readStableBinaryFile as J, MAX_REPEATER_GRID_COLUMNS as Jn, planCheckoutPaymentFlow as Jr, revalidatePushConfigPlan as Jt, prepareLocalMediaForPush as K, blockRequiredFeatureSchema as Kn, checkoutCopy as Kr, loadPushConfigTarget as Kt, pageMetadataForUpsert as L, MAX_SETUP_FIELDS as Ln, roomOccupancySchema as Lr, ACCOUNT_SITE_LIST_LIMIT_DEFAULT as Lt, findChangedFieldsWithValues as M, loadSdkEnvironment as Mn, countSoFar as Mr, convertPulledNavigationToLocal as Mt, formatHumanDiff as N, NodeSchema as Nn, placeBooking as Nr, convertPulledPagesToLocal as Nt, calculateFooterDiff as O, getEnvPrefix as On, placesLeftText as Or, duplicateNavigationIdentityMessage as Ot, calculatePullDiff as P, NodeTreeSchema as Pn, reviewedStay as Pr, AccountApiMalformedResponseError as Pt, normalizeMediaValueToIdentifierOnly as Q, resolveRepeaterGridRowFieldId as Qn, isBookingCollectionEquivalentToUpfront as Qr, CommandFailure as Qt, calculateEntryDiffs as R, blockEditingSchema as Rn, roomSetupSchema as Rr, ACCOUNT_SITE_LIST_LIMIT_MAX as Rt, planCliCommandBatchForBindings as S, eventSurfaceScopeValues as Si, withRiverbankEnv as Sn, decideSelectionAttendance as Sr, fileExists$1 as St, executeResidualSettingsSyncPlan as T, publicEventLoaderQuerySchemaShape as Ti, transportSuggestion as Tn, bookingQuestionsAnswersSchema as Tr, writeJsonFile$1 as Tt, syncLocalMediaForPush as U, DEFAULT_MEDIA_FIELD_KINDS as Un, placementProblemText as Ur, normalizeNavigationConfigItemForCommand as Ut, formatFieldPath as V, mergeBlockEditing as Vn, planSelectionCombinationPrices as Vr, ACCOUNT_SITE_TITLE_MAX_LENGTH as Vt, syncLocalMediaForPull as W, blockCategoryEnum as Wn, stayLineText as Wr, applyPushConfigPlan as Wt, sha256 as X, parseRepeaterGridInteger as Xn, bookingCollectionDatesOpen as Xr, deriveCmsApiUrlFromDashboardUrl as Xt, writeBinaryFileAtomic as Y, isAcceptedRepeaterGridSpan as Yn, planFlexibleBalanceCreditFirst as Yr, createBearerAPIClient as Yt, normalizeMediaIdentifierInput as Z, resolveRepeaterGridColumnFieldId as Zn, flexibleBalanceDueDay as Zr, mapEnvironmentExecutionOutcomesJson as Zt, commandExecutionToReport as _, calendarMonthDate as _i, executeEnvironmentPlan as _n, sdkConfiguredBookingVerticalConfigSchema as _r, metadataTargetFromEnvironment as _t, executeEntryCommandPlanAsReport as a, eventCalendarDefaultViewValues as ai, confirmAction as an, mapReadinessFact as ar, readAllMeta as at, executeCompiledCliCommandPlanAsReport as b, eventScheduleScopeValues as bi, planEnvironmentWriteAuthorization as bn, eventBookingConsentContentKey as br, writeMetadataRecordMap as bt, titleFromEntryData as c, eventCalendarListLayoutValues as ci, formatDateShort as cn, normalizeApiError as cr, readFooterMeta as ct, unsafeAsCliEntryIdentifier as d, publicMembershipProductSchema as di, managementClientFor as dn, sdkEventScheduleSchema as dr, readPagesMeta as dt, resolveAvailableBookingCollectionOptions as ei, defineCommand as en, visibilityLevels as er, buildStorageUrl as et, unsafeAsCliFormSlug as f, publicPassProductSchema as fi, mapEntryForOutput as fn, sdkSettingsUpdateSchema as fr, readSettingsMeta as ft, commandCompileFailureToReport as g, CALENDAR_SSR_PAGE_SIZE as gi, runWithInvocation as gn, pageDesignIntentSchemaVersion as gr, metadataFilePath as gt, mutationCounterForEffect as h, purchasablePublicPassProductSchema as hi, resolveCommandPath as hn, pageDesignDecisionsV2Schema as hr, ensureMetadataDir as ht, entrySiteCommandTypes as i, MAX_EVENT_BOOKING_SELECTION_ITEMS as ii, bindRequestTimeout as in, lookKnobBlocks as ir, readEntries as it, hasPendingChanges as j, isRemoteConfigured as jn, sameRoomOption as jr, convertPulledFooterToLocal as jt, formatDiffDetail as k, getEnvironmentDebugInfo as kn, roomKindOptions as kr, navigationIdentity as kt, unsafeAsCliBlockIdentifier as l, publicMapLocationResultSchema as li, handleCommandError as ln, isRecord$5 as lr, readFormsMeta as lt, commandReportToSyncResult as m, purchasablePublicMembershipProductSchema as mi, parseJsonData as mn, portablePageDesignSchema as mr, writeMediaManifest as mt, entryCommandCompileErrorToReport as n, getStripeMinimumChargeRequirement as ni, registerCommand as nn, cardListFamilyBlocks as nr, extractMediaIdentifiers as nt, executeEntryCommandPlanAsSyncResult as o, eventCalendarDisplayModeValues as oi, createOutputForCommand as on, ManagementApiError as or, readEventCategoriesMeta as ot, unsafeAsCliPageIdentifier as p, publicProductSchema as pi, parseJsonArray as pn, linkPayloadSchema as pr, readVenuesMeta as pt, admitBinaryWriteDestination as q, fieldSchema as qn, unsafeAsPositiveCheckoutQuantity as qr, preparePushConfigTarget as qt, entryCommandReportToSyncResult as r, getBookingLaterInstalments as ri, renderedByOwner as rn, cardListKnobBlocks as rr, findLegacyEntryFiles as rt, syncResultForEntryCommandCompileError as s, eventCalendarListLayoutCompatibleDisplayModeValues as si, currentInvocationEnvelope as sn, extractApiErrorMessage as sr, readEventsMeta as st, compileEntryPushCommands as t, resolveBookingCollectionOptionFacts as ti, defineCommandGroup as tn, cardListBlockParts as tr, downloadMedia as tt, unsafeAsCliContentTypeKey as u, publicVenueMapLocationSchema as ui, loadManagementTarget as un, ApiRequestError as ur, readNavigationMeta as ut, commandReportHasFailures as v, calendarMonthWindowSchema as vi, parseEnvironmentSelection as vn, API_ENDPOINTS as vr, readMetadataFile as vt, mergeManySyncResults as w, normalizeCalendarFilterId as wi, formatError as wn, bookingQuestionsAnswerValueSchema as wr, readJsonFile as wt, formatManagementError as x, eventSurfacePresetValues as xi, requireEnvironmentWriteAuthorization as xn, INCOMPATIBLE_ATTENDANCE_MESSAGE as xr, ensureDir$1 as xt, executeCliCommandPlan as y, calendarSourceCursorSchema as yi, planEnvironmentExecution as yn, areEventBookingRequirementsIdentical as yr, writeMetadataFile as yt, buildFieldChanges as z, editingGroups as zn, sharedRoomArrangementSchema as zr, ACCOUNT_SITE_LIST_LIMIT_MIN as zt };
|