riverbankcms 0.32.0 → 0.32.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 +12361 -11360
- package/dist/cli/init-docs/content/content-management.md +12 -0
- package/dist/{entryCommands-BJFkJn_e.mjs → entryCommands-B2kELFEc.mjs} +493 -344
- package/dist/{eventUpsertInputSchema-BD_RuhcK.mjs → eventUpsertInputSchema-B79taa8f.mjs} +2 -2
- package/dist/load-config-BXZoGsU5.mjs +4 -0
- package/dist/{load-config-CfL4ZWC8.mjs → load-config-CTuNN3xv.mjs} +2 -2
- package/dist/{plan-CbzdsZp3.mjs → plan-pGcbGyYC.mjs} +1 -1
- package/dist/scaffold/index.mjs +2 -2
- package/dist/{sdk-event-upsert-SodZay6g.mjs → sdk-event-upsert-B3Ln6jqq.mjs} +38 -6
- package/dist/{src-CVyy-M-N.mjs → src-wXdYu3yt.mjs} +138 -28
- package/dist/testing.mjs +4 -4
- package/package.json +1 -1
- package/dist/load-config-CODn5_ki.mjs +0 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { En as sdkEntrySlotBlocksInputSchema, a as classifySdkEventSchedule, i as sdkEventUpsertOptionalFieldSchemas, n as sdkCourseBookingSettingsSchema, o as classifySdkEventBookingOffer } from "./sdk-event-upsert-
|
|
3
|
-
import {
|
|
2
|
+
import { En as sdkEntrySlotBlocksInputSchema, a as classifySdkEventSchedule, i as sdkEventUpsertOptionalFieldSchemas, n as sdkCourseBookingSettingsSchema, o as classifySdkEventBookingOffer } from "./sdk-event-upsert-B3Ln6jqq.mjs";
|
|
3
|
+
import { y as EVENT_PRESET_VALUES } from "./src-wXdYu3yt.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/commands/eventUpsertInputSchema.ts
|
|
@@ -7,7 +7,7 @@ import { existsSync as existsSync$1 } from "fs";
|
|
|
7
7
|
import { fileURLToPath } from "url";
|
|
8
8
|
|
|
9
9
|
//#region package.json
|
|
10
|
-
var version = "0.32.
|
|
10
|
+
var version = "0.32.2";
|
|
11
11
|
var peerDependencies = { "@riverbankcms/sdk": ">=0.157.0 <1.0.0" };
|
|
12
12
|
var package_default = {
|
|
13
13
|
name: "riverbankcms",
|
|
@@ -94,7 +94,7 @@ var package_default = {
|
|
|
94
94
|
//#endregion
|
|
95
95
|
//#region src/version.ts
|
|
96
96
|
/** The package manifest is the source-run fallback; builds inject this value. */
|
|
97
|
-
const CLI_VERSION = typeof "0.32.
|
|
97
|
+
const CLI_VERSION = typeof "0.32.2" === "string" ? "0.32.2" : version;
|
|
98
98
|
/**
|
|
99
99
|
* The CLI's SDK peer range is bundled from the CLI manifest alongside its
|
|
100
100
|
* version. Runtime config loading uses this value as the single compatibility
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { Er as ok, Tr as err, pr as parseSiteId } from "./src-wXdYu3yt.mjs";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
import { dirname, isAbsolute, join, parse, relative, resolve, sep } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
package/dist/scaffold/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "../src-
|
|
3
|
-
import { a as prepareScaffoldExecution, d as loadGeneratedPackageRanges, i as preflightScaffoldTargets, l as deriveGeneratedPackageRanges, o as writeScaffoldFiles, r as preflightScaffoldPlan, s as deriveScaffoldLocalManifest, t as deriveScaffoldPlan, u as findPackageManifestPath } from "../plan-
|
|
2
|
+
import "../src-wXdYu3yt.mjs";
|
|
3
|
+
import { a as prepareScaffoldExecution, d as loadGeneratedPackageRanges, i as preflightScaffoldTargets, l as deriveGeneratedPackageRanges, o as writeScaffoldFiles, r as preflightScaffoldPlan, s as deriveScaffoldLocalManifest, t as deriveScaffoldPlan, u as findPackageManifestPath } from "../plan-pGcbGyYC.mjs";
|
|
4
4
|
|
|
5
5
|
export { deriveGeneratedPackageRanges, deriveScaffoldLocalManifest, deriveScaffoldPlan, findPackageManifestPath, loadGeneratedPackageRanges, preflightScaffoldPlan, preflightScaffoldTargets, prepareScaffoldExecution, writeScaffoldFiles };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $n as
|
|
2
|
+
import { $n as unsafeAsPositiveSeconds, Er as ok, G as parseMailingListGlobalForm, Gn as unsafeAsBookingSessionId, Gt as parseUtcIsoDateTimeString, Jn as unsafeAsDetectedMimeType, Jt as validateBookingPaymentOptionKinds, Kn as parseMediaAssetId, Mn as assertNever, Pn as unsafeAsBookingRequirementId, Qn as unsafeAsPositiveByteCount, Rt as localScheduleTimePattern, Sn as mapReadonlyNonEmptyArray, Tr as err, Vn as unsafeAsEntitlementId, W as parseConfiguredMailingListProvider, Wt as parseBookingTimeZone, Xn as unsafeAsMediaAssetId, Y as parseFooterCompositionV1, Yn as unsafeAsFileChecksumSha256, Zn as unsafeAsOriginalFilename, _ as resolveSiteVerticalBookingConfig, _t as isPresent, ar as unsafeAsProductId, b as ORDINARY_EVENT_PRESET_VALUES, bn as fromArray, dr as unsafeAsSiteFontId, dt as locationValueSchema, er as unsafeAsSafeDownloadFilename, et as isCanonicalRichTextDoc, f as NAVIGATION_LOCATIONS, gr as unsafeAsUserId, hr as unsafeAsSiteId, i as isRecord$6, ir as unsafeAsUploadSessionId, it as parseWeeklyOpeningHours, lt as stableJsonStringify, n as OFFLINE_PAYMENT_METHODS, nr as unsafeAsStorageBucketName, ot as SENSITIVE_COLLECTION_CONFIRMATION_VERSION, pr as parseSiteId, qn as unsafeAsDeclaredMimeType, qt as BOOKING_COURSE_INSTALMENT_DEADLINES, rr as unsafeAsStoragePath, rt as parsePublicContactDetails, st as SENSITIVE_COLLECTION_MODES, t as isEventOccurrenceRouteSegment, tr as unsafeAsSiteScopedStoragePath, xn as mapNonEmptyArray, y as EVENT_PRESET_VALUES, yr as unsafeAsEventCategoryId } from "./src-wXdYu3yt.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
@@ -96,6 +96,7 @@ const resourceKinds = [
|
|
|
96
96
|
"event",
|
|
97
97
|
"discount-code",
|
|
98
98
|
"gifting-offer",
|
|
99
|
+
"mailing-list-topic",
|
|
99
100
|
"pass",
|
|
100
101
|
"membership",
|
|
101
102
|
"customer",
|
|
@@ -811,6 +812,7 @@ const decorativeTransitionIntentValues = [
|
|
|
811
812
|
"wave-edge-drift",
|
|
812
813
|
"wave-edge-echo",
|
|
813
814
|
"arc-edge-echo",
|
|
815
|
+
"arc-edge-bulge",
|
|
814
816
|
"angle-edge",
|
|
815
817
|
"angle-edge-subtle",
|
|
816
818
|
"angle-edge-steep"
|
|
@@ -1148,7 +1150,13 @@ const linkSchema = z.union([
|
|
|
1148
1150
|
pageLinkSchema,
|
|
1149
1151
|
entryLinkSchema
|
|
1150
1152
|
]);
|
|
1153
|
+
const referenceLinkKinds = new Set([
|
|
1154
|
+
"internal",
|
|
1155
|
+
"page",
|
|
1156
|
+
"entry"
|
|
1157
|
+
]);
|
|
1151
1158
|
function visitLinkValueReferences(value, visitor) {
|
|
1159
|
+
if (!isRecord$6(value) || !referenceLinkKinds.has(value.kind)) return;
|
|
1152
1160
|
const parsed = linkSchema.safeParse(value);
|
|
1153
1161
|
if (!parsed.success) {
|
|
1154
1162
|
return;
|
|
@@ -7253,7 +7261,7 @@ const pricingOptionSchema = z.object({
|
|
|
7253
7261
|
function slidingScaleSchema(currency, portable) {
|
|
7254
7262
|
return z.object({
|
|
7255
7263
|
kind: fieldMeaning(z.literal("sliding_scale"), {
|
|
7256
|
-
...meaning$1("Sliding scale", "People
|
|
7264
|
+
...meaning$1("Sliding scale", "People pick what they pay, between a lowest and highest price you set."),
|
|
7257
7265
|
valueLabels: { sliding_scale: "Sliding scale" }
|
|
7258
7266
|
}),
|
|
7259
7267
|
currency,
|
|
@@ -7286,7 +7294,7 @@ function createEventPricingSchemas(option, currency, portable = false) {
|
|
|
7286
7294
|
}).strict();
|
|
7287
7295
|
const single = z.object({
|
|
7288
7296
|
kind: fieldMeaning(z.literal("single"), {
|
|
7289
|
-
...meaning$1("Single price", "
|
|
7297
|
+
...meaning$1("Single price", "Everyone pays the same price."),
|
|
7290
7298
|
valueLabels: { single: "Single price" }
|
|
7291
7299
|
}),
|
|
7292
7300
|
currency,
|
|
@@ -7294,7 +7302,7 @@ function createEventPricingSchemas(option, currency, portable = false) {
|
|
|
7294
7302
|
}).strict();
|
|
7295
7303
|
const tiered = z.object({
|
|
7296
7304
|
kind: fieldMeaning(z.literal("tiered"), {
|
|
7297
|
-
...meaning$1("Ticket types", "A few
|
|
7305
|
+
...meaning$1("Ticket types", "A few choices at different prices, like standard and concession."),
|
|
7298
7306
|
valueLabels: { tiered: "Ticket types" }
|
|
7299
7307
|
}),
|
|
7300
7308
|
currency,
|
|
@@ -42621,6 +42629,15 @@ const configureMailingListCommandSchema = z.object({
|
|
|
42621
42629
|
bookingOptIn: z.boolean().default(false)
|
|
42622
42630
|
}).strict()
|
|
42623
42631
|
}).strict();
|
|
42632
|
+
/** A topic people can join on the site's own list. Its name is its identity, so a rerun finds it rather than repeating it. */
|
|
42633
|
+
const upsertMailingListTopicCommandSchema = z.object({
|
|
42634
|
+
type: z.literal("upsertMailingListTopic"),
|
|
42635
|
+
ref: resourceRefSchema("mailing-list-topic"),
|
|
42636
|
+
input: z.object({
|
|
42637
|
+
name: z.string().min(1),
|
|
42638
|
+
description: z.string().min(1).nullable().optional()
|
|
42639
|
+
}).strict()
|
|
42640
|
+
}).strict();
|
|
42624
42641
|
|
|
42625
42642
|
//#endregion
|
|
42626
42643
|
//#region ../site-commands/src/packageCommandFields.ts
|
|
@@ -42736,7 +42753,7 @@ const configuredVerticalConfigSchema = z.object({
|
|
|
42736
42753
|
if (resolved.kind === "configured") return resolved.config;
|
|
42737
42754
|
context.addIssue({
|
|
42738
42755
|
code: z.ZodIssueCode.custom,
|
|
42739
|
-
message: resolved.kind === "unconfigured" ? "Booking vertical configuration must select a
|
|
42756
|
+
message: resolved.kind === "unconfigured" ? "Booking vertical configuration must select a business type" : `Invalid booking vertical configuration: ${resolved.issues.map((issue$1) => issue$1.code).join(", ")}`
|
|
42740
42757
|
});
|
|
42741
42758
|
return z.NEVER;
|
|
42742
42759
|
});
|
|
@@ -43518,6 +43535,7 @@ const siteCommandSchema = z.discriminatedUnion("type", [
|
|
|
43518
43535
|
configureSiteIdentityCommandSchema,
|
|
43519
43536
|
configureBookingSettingsCommandSchema,
|
|
43520
43537
|
configureMailingListCommandSchema,
|
|
43538
|
+
upsertMailingListTopicCommandSchema,
|
|
43521
43539
|
applySiteStyleSelectionCommandSchema,
|
|
43522
43540
|
upsertMediaAssetCommandSchema,
|
|
43523
43541
|
upsertPageCommandSchema,
|
|
@@ -43841,6 +43859,19 @@ const siteCommandMetadata = {
|
|
|
43841
43859
|
capability: "mailing_list.setup.write",
|
|
43842
43860
|
support: "supported"
|
|
43843
43861
|
},
|
|
43862
|
+
upsertMailingListTopic: {
|
|
43863
|
+
scope: "mailing_list",
|
|
43864
|
+
risk: "low",
|
|
43865
|
+
writeSemantics: "upsert",
|
|
43866
|
+
lifecycleIntent: "mutation",
|
|
43867
|
+
idempotencyStrategy: "recipe_ref",
|
|
43868
|
+
conflictPolicy: "update_existing",
|
|
43869
|
+
previewability: "dry_run_only",
|
|
43870
|
+
allowedRuntimes: allRuntimes,
|
|
43871
|
+
intendedExposure: recipeExposure,
|
|
43872
|
+
capability: "mailing_list.setup.write",
|
|
43873
|
+
support: "supported"
|
|
43874
|
+
},
|
|
43844
43875
|
applySiteStyleSelection: {
|
|
43845
43876
|
scope: "style",
|
|
43846
43877
|
risk: "low",
|
|
@@ -44744,7 +44775,8 @@ function commandRefContributions(command) {
|
|
|
44744
44775
|
if (isLifecycleRefCommand(command)) return lifecycleCommandRefContributions(command);
|
|
44745
44776
|
if (command.type === "upsertDiscountCode") return discountCodeRefContributions(command);
|
|
44746
44777
|
switch (command.type) {
|
|
44747
|
-
case "upsertGiftingOffer":
|
|
44778
|
+
case "upsertGiftingOffer":
|
|
44779
|
+
case "upsertMailingListTopic": return {
|
|
44748
44780
|
provides: [{
|
|
44749
44781
|
ref: command.ref,
|
|
44750
44782
|
field: "ref"
|
|
@@ -1404,7 +1404,7 @@ function formatBookingPriceDisplay(display, options = {}) {
|
|
|
1404
1404
|
case "exact": return formatCurrencyAmount(display.amount, display.currency, options);
|
|
1405
1405
|
case "from": return `From ${formatCurrencyAmount(display.amount, display.currency, options)}`;
|
|
1406
1406
|
case "range": return `${formatCurrencyAmount(display.minAmount, display.currency, options)}–${formatCurrencyAmount(display.maxAmount, display.currency, options)}`;
|
|
1407
|
-
case "mixed": return display.paidToAmount > display.paidFromAmount ? `Free
|
|
1407
|
+
case "mixed": return display.paidToAmount > display.paidFromAmount ? `Free or ${formatCurrencyAmount(display.paidFromAmount, display.currency, options)}–${formatCurrencyAmount(display.paidToAmount, display.currency, options)}` : `Free or ${formatCurrencyAmount(display.paidFromAmount, display.currency, options)}`;
|
|
1408
1408
|
case "unavailable": return "Pricing unavailable";
|
|
1409
1409
|
case "external": return display.label;
|
|
1410
1410
|
default: return assertNever(display);
|
|
@@ -8471,6 +8471,13 @@ function resolveWholeSeriesPaymentDates(input) {
|
|
|
8471
8471
|
//#endregion
|
|
8472
8472
|
//#region ../core/src/public-read-cache-contract.ts
|
|
8473
8473
|
const PUBLIC_AVAILABILITY_FRESHNESS_SECONDS = 60;
|
|
8474
|
+
/**
|
|
8475
|
+
* How long a rendered page may hold availability it read through the batch
|
|
8476
|
+
* transport. Writers purge those pages by tag and batch POSTs never touch the
|
|
8477
|
+
* CDN, so this is only the backstop for a purge that failed. Checkout enforces
|
|
8478
|
+
* capacity itself, whatever a page showed.
|
|
8479
|
+
*/
|
|
8480
|
+
const PUBLIC_RENDERED_AVAILABILITY_FRESHNESS_SECONDS = 1800;
|
|
8474
8481
|
const PUBLIC_CONTENT_FRESHNESS_SECONDS = 3600;
|
|
8475
8482
|
function availability(fetchTags, transport) {
|
|
8476
8483
|
return {
|
|
@@ -8503,6 +8510,7 @@ const PUBLIC_READ_CACHE_POLICIES = {
|
|
|
8503
8510
|
"public_passes",
|
|
8504
8511
|
"public_memberships"
|
|
8505
8512
|
], "batch_only"),
|
|
8513
|
+
getPublicMapLocation: availability(["public_events", "public_event_filters"], "batch_only"),
|
|
8506
8514
|
resolveEventSubroute: availability(["public_events", "public_event_filters"], "direct"),
|
|
8507
8515
|
listPublicRouteCandidates: content(["published_content"], "batch_only"),
|
|
8508
8516
|
listPublicTeamMembers: content(["public_team_members"]),
|
|
@@ -8531,6 +8539,10 @@ function getPublicReadCachePolicy(endpoint) {
|
|
|
8531
8539
|
function publicReadFreshnessSeconds(endpoint) {
|
|
8532
8540
|
return getPublicReadCachePolicy(endpoint).freshness === "availability" ? PUBLIC_AVAILABILITY_FRESHNESS_SECONDS : PUBLIC_CONTENT_FRESHNESS_SECONDS;
|
|
8533
8541
|
}
|
|
8542
|
+
/** The freshness budget of a read made through the uncached batch transport. */
|
|
8543
|
+
function publicReadBatchFreshnessSeconds(endpoint) {
|
|
8544
|
+
return getPublicReadCachePolicy(endpoint).freshness === "availability" ? PUBLIC_RENDERED_AVAILABILITY_FRESHNESS_SECONDS : PUBLIC_CONTENT_FRESHNESS_SECONDS;
|
|
8545
|
+
}
|
|
8534
8546
|
|
|
8535
8547
|
//#endregion
|
|
8536
8548
|
//#region ../core/src/event-series-behaviour.ts
|
|
@@ -8871,14 +8883,10 @@ function createConfiguredSiteVerticalBookingConfig(verticalId, selectedPresetIds
|
|
|
8871
8883
|
selectedPresetIds
|
|
8872
8884
|
};
|
|
8873
8885
|
}
|
|
8874
|
-
function toNonEmptyVerticalPresetIds(presetIds) {
|
|
8875
|
-
const firstPresetId = presetIds[0];
|
|
8876
|
-
return firstPresetId ? [firstPresetId, ...presetIds.slice(1)] : null;
|
|
8877
|
-
}
|
|
8878
8886
|
/**
|
|
8879
8887
|
* Construct a configured booking selection only when the supplied preset IDs
|
|
8880
8888
|
* form a valid selection for the vertical. Invalid, cross-vertical, future,
|
|
8881
|
-
*
|
|
8889
|
+
* or duplicate selections return null. An empty selection keeps the business type with bookings off.
|
|
8882
8890
|
*/
|
|
8883
8891
|
function createSiteVerticalBookingConfig(verticalId, selectedPresetIds) {
|
|
8884
8892
|
const resolved = resolveSiteVerticalBookingConfig({
|
|
@@ -8913,9 +8921,6 @@ function collectRawConfigIssues(rawConfig, config) {
|
|
|
8913
8921
|
rawValue: rawPresetValue
|
|
8914
8922
|
});
|
|
8915
8923
|
}
|
|
8916
|
-
if (rawConfig.verticalId != null && config.selectedPresetIds.length === 0) {
|
|
8917
|
-
issues = appendUniqueIssue(issues, { code: "empty_selected_presets" });
|
|
8918
|
-
}
|
|
8919
8924
|
return issues;
|
|
8920
8925
|
}
|
|
8921
8926
|
function collectPresetConfigIssues(config) {
|
|
@@ -8974,8 +8979,7 @@ function resolveSiteVerticalBookingConfig(rawConfig) {
|
|
|
8974
8979
|
config,
|
|
8975
8980
|
issues
|
|
8976
8981
|
};
|
|
8977
|
-
const
|
|
8978
|
-
const configuredConfig = verticalId !== null && nonEmptyPresetIds !== null ? createConfiguredSiteVerticalBookingConfig(verticalId, nonEmptyPresetIds) : null;
|
|
8982
|
+
const configuredConfig = verticalId !== null ? createConfiguredSiteVerticalBookingConfig(verticalId, selectedPresetIds) : null;
|
|
8979
8983
|
if (configuredConfig === null) {
|
|
8980
8984
|
return {
|
|
8981
8985
|
kind: "invalid",
|
|
@@ -9067,7 +9071,7 @@ function getVerticalPresetSelectionOptions(config) {
|
|
|
9067
9071
|
return [{
|
|
9068
9072
|
preset: presetDefinition,
|
|
9069
9073
|
checked,
|
|
9070
|
-
disabledReason:
|
|
9074
|
+
disabledReason: null
|
|
9071
9075
|
}];
|
|
9072
9076
|
});
|
|
9073
9077
|
}
|
|
@@ -9106,13 +9110,6 @@ function setVerticalPresetSelected(config, presetId, selected) {
|
|
|
9106
9110
|
}
|
|
9107
9111
|
const selectedIds = new Set(resolved.config.selectedPresetIds);
|
|
9108
9112
|
if (!selected) {
|
|
9109
|
-
if (selectedIds.size <= 1) {
|
|
9110
|
-
return {
|
|
9111
|
-
ok: false,
|
|
9112
|
-
error: "last_selected_preset",
|
|
9113
|
-
config: resolved.config
|
|
9114
|
-
};
|
|
9115
|
-
}
|
|
9116
9113
|
selectedIds.delete(presetId);
|
|
9117
9114
|
const nextConfig = createSiteVerticalBookingConfig(verticalId, orderPresetIdsForVertical(verticalId, selectedIds));
|
|
9118
9115
|
return {
|
|
@@ -9143,13 +9140,6 @@ function setVerticalPresetsSelected(config, presetIds) {
|
|
|
9143
9140
|
};
|
|
9144
9141
|
}
|
|
9145
9142
|
const fallbackConfig = resolved.kind === "configured" ? resolved.config : DEFAULT_SITE_VERTICAL_BOOKING_CONFIG;
|
|
9146
|
-
if (presetIds.length === 0) {
|
|
9147
|
-
return {
|
|
9148
|
-
ok: false,
|
|
9149
|
-
error: "last_selected_preset",
|
|
9150
|
-
config: fallbackConfig
|
|
9151
|
-
};
|
|
9152
|
-
}
|
|
9153
9143
|
const presetByBehaviour = new Map();
|
|
9154
9144
|
for (const presetId of presetIds) {
|
|
9155
9145
|
const presetDefinition = getVerticalPresetDefinition(presetId);
|
|
@@ -9305,6 +9295,101 @@ const PORTAL_NAV_DEFAULT_LABELS = {
|
|
|
9305
9295
|
loggedIn: "My account"
|
|
9306
9296
|
};
|
|
9307
9297
|
|
|
9298
|
+
//#endregion
|
|
9299
|
+
//#region ../core/src/booking-offerings.ts
|
|
9300
|
+
/** The selection owns availability. Stored module flags are only its write-time projection (#1773). */
|
|
9301
|
+
function deriveBookingModules(selection) {
|
|
9302
|
+
const config = selection.verticalConfig;
|
|
9303
|
+
const presets = (config?.selectedPresetIds ?? []).map(getVerticalPresetDefinition);
|
|
9304
|
+
return {
|
|
9305
|
+
appointments: presets.some(({ engine }) => engine === "appointment_service"),
|
|
9306
|
+
events: config?.verticalId != null ? presets.some(({ engine }) => engine === "event_series") : (selection.eventTypePresets ?? []).length > 0
|
|
9307
|
+
};
|
|
9308
|
+
}
|
|
9309
|
+
function withDerivedBookingModules(selection) {
|
|
9310
|
+
return {
|
|
9311
|
+
...selection,
|
|
9312
|
+
modules: deriveBookingModules(selection)
|
|
9313
|
+
};
|
|
9314
|
+
}
|
|
9315
|
+
function offeringSelectionKey(selection) {
|
|
9316
|
+
const config = selection.verticalConfig;
|
|
9317
|
+
return JSON.stringify({
|
|
9318
|
+
business: config?.verticalId ?? null,
|
|
9319
|
+
choices: [...config?.verticalId != null ? config.selectedPresetIds : selection.eventTypePresets ?? []].sort()
|
|
9320
|
+
});
|
|
9321
|
+
}
|
|
9322
|
+
function bookingOfferingSelectionChanged(current, next) {
|
|
9323
|
+
return offeringSelectionKey(current) !== offeringSelectionKey(next);
|
|
9324
|
+
}
|
|
9325
|
+
/** Unrelated saves and stale module fields cannot change availability. */
|
|
9326
|
+
function withBookingModulesForSelectionChange(current, next) {
|
|
9327
|
+
return {
|
|
9328
|
+
...next,
|
|
9329
|
+
modules: bookingOfferingSelectionChanged(current, next) ? deriveBookingModules(next) : current.modules
|
|
9330
|
+
};
|
|
9331
|
+
}
|
|
9332
|
+
function nonEmptyGenericKinds(kinds) {
|
|
9333
|
+
return kinds === undefined ? DEFAULT_EVENT_TYPE_PRESETS : kinds.length > 0 ? kinds : ["event"];
|
|
9334
|
+
}
|
|
9335
|
+
function selectionIncludesPreset(selection, preset) {
|
|
9336
|
+
if (selection.verticalConfig?.verticalId) return selection.verticalConfig.selectedPresetIds.includes(preset.id);
|
|
9337
|
+
const kinds = selection.eventTypePresets ?? DEFAULT_EVENT_TYPE_PRESETS;
|
|
9338
|
+
return kinds.some((kind) => preset.engine === "event_series" && kind === eventPresetForVerticalPreset(preset) || kind === "term" && preset.canonicalBehaviour === "course");
|
|
9339
|
+
}
|
|
9340
|
+
/** Generic event lists need no business profile until appointments are requested. */
|
|
9341
|
+
function reconcileGenericOfferings(selection, availability$1) {
|
|
9342
|
+
if (selection.verticalConfig?.verticalId != null) return null;
|
|
9343
|
+
if (!availability$1.appointments) return {
|
|
9344
|
+
kind: "ready",
|
|
9345
|
+
selection: {
|
|
9346
|
+
...selection,
|
|
9347
|
+
eventTypePresets: availability$1.events ? nonEmptyGenericKinds(selection.eventTypePresets) : []
|
|
9348
|
+
}
|
|
9349
|
+
};
|
|
9350
|
+
return selection.eventTypePresets?.includes("performance") === true ? {
|
|
9351
|
+
kind: "unmappable",
|
|
9352
|
+
module: "events"
|
|
9353
|
+
} : null;
|
|
9354
|
+
}
|
|
9355
|
+
/** One-time availability reconciliation, also used when onboarding expresses engine intent. */
|
|
9356
|
+
function reconcileBookingOfferingSelection(selection, availability$1) {
|
|
9357
|
+
const generic = reconcileGenericOfferings(selection, availability$1);
|
|
9358
|
+
if (generic !== null) return generic;
|
|
9359
|
+
const verticalId = selection.verticalConfig?.verticalId ?? "something_else";
|
|
9360
|
+
const options = getVerticalPresetsForVertical(verticalId, { availability: "selectable" });
|
|
9361
|
+
const selected = options.filter((preset) => selectionIncludesPreset(selection, preset));
|
|
9362
|
+
const enabled = selected.filter(({ engine }) => availability$1[engine === "appointment_service" ? "appointments" : "events"]);
|
|
9363
|
+
const wanted = ["events", "appointments"].filter((module) => availability$1[module]);
|
|
9364
|
+
const missing = wanted.filter((module) => !enabled.some(({ engine }) => engine === (module === "events" ? "event_series" : "appointment_service")));
|
|
9365
|
+
const additions = missing.map((module) => options.find(({ engine }) => engine === (module === "events" ? "event_series" : "appointment_service")));
|
|
9366
|
+
const unmappable = missing.find((_, index) => additions[index] === undefined);
|
|
9367
|
+
if (unmappable !== undefined) return {
|
|
9368
|
+
kind: "unmappable",
|
|
9369
|
+
module: unmappable
|
|
9370
|
+
};
|
|
9371
|
+
const ids = [...enabled, ...additions.flatMap((preset) => preset !== undefined ? [preset] : [])].map(({ id }) => id);
|
|
9372
|
+
const config = createSiteVerticalBookingConfig(verticalId, ids);
|
|
9373
|
+
if (config === null) return {
|
|
9374
|
+
kind: "unmappable",
|
|
9375
|
+
module: "events"
|
|
9376
|
+
};
|
|
9377
|
+
return {
|
|
9378
|
+
kind: "ready",
|
|
9379
|
+
selection: {
|
|
9380
|
+
...selection,
|
|
9381
|
+
verticalConfig: config,
|
|
9382
|
+
eventTypePresets: []
|
|
9383
|
+
}
|
|
9384
|
+
};
|
|
9385
|
+
}
|
|
9386
|
+
/** Permission and confirmation are about losing an engine, not removing one of several event kinds. */
|
|
9387
|
+
function planBookingAvailabilityChange(current, next, canChangeAvailability) {
|
|
9388
|
+
if (current.events === next.events && current.appointments === next.appointments) return "unchanged";
|
|
9389
|
+
if (!canChangeAvailability) return "forbidden";
|
|
9390
|
+
return current.events && !next.events || current.appointments && !next.appointments ? "confirm" : "apply";
|
|
9391
|
+
}
|
|
9392
|
+
|
|
9308
9393
|
//#endregion
|
|
9309
9394
|
//#region ../core/src/event-catalogue.ts
|
|
9310
9395
|
/** Accepts validated settings; defaults and raw configuration parsing belong to the caller. */
|
|
@@ -9316,10 +9401,14 @@ function resolveEventCatalogue(settings) {
|
|
|
9316
9401
|
pluralLabel: preset.pluralLabel,
|
|
9317
9402
|
description: preset.description
|
|
9318
9403
|
}));
|
|
9319
|
-
if (entries.length > 0
|
|
9404
|
+
if (settings.verticalConfig?.verticalId != null) return entries.length > 0 ? {
|
|
9320
9405
|
source: "business_profile",
|
|
9321
9406
|
entries,
|
|
9322
9407
|
catchAll: "implicit"
|
|
9408
|
+
} : {
|
|
9409
|
+
source: "generic",
|
|
9410
|
+
entries: [],
|
|
9411
|
+
catchAll: "unavailable"
|
|
9323
9412
|
};
|
|
9324
9413
|
return {
|
|
9325
9414
|
source: "generic",
|
|
@@ -9638,6 +9727,12 @@ function formatCreditProductUnits(useCase, count) {
|
|
|
9638
9727
|
function formatCreditProductBalance(useCase, balance) {
|
|
9639
9728
|
return `${balance.remaining} of ${balance.total} ${creditProductUnitNoun(useCase, balance.total)} left`;
|
|
9640
9729
|
}
|
|
9730
|
+
/** Confirmation copy shared by booking screens and editable email wording. */
|
|
9731
|
+
function formatCreditProductPayment(input) {
|
|
9732
|
+
const used = input.creditsUsed;
|
|
9733
|
+
const payment = used !== undefined && used !== 0 && !Number.isNaN(used) ? `${used} credit${used === 1 ? "" : "s"} from your ${input.name}` : `Paid with your ${input.name}`;
|
|
9734
|
+
return payment + (input.creditsRemaining === undefined ? "" : ` (${input.creditsRemaining} left)`);
|
|
9735
|
+
}
|
|
9641
9736
|
|
|
9642
9737
|
//#endregion
|
|
9643
9738
|
//#region ../core/src/patch/index.ts
|
|
@@ -10754,6 +10849,11 @@ const EMAIL_DEFINITIONS = {
|
|
|
10754
10849
|
perEvent: false,
|
|
10755
10850
|
templateStorage: true
|
|
10756
10851
|
},
|
|
10852
|
+
waitlist_cancelled: {
|
|
10853
|
+
wording: "editable",
|
|
10854
|
+
perEvent: false,
|
|
10855
|
+
templateStorage: true
|
|
10856
|
+
},
|
|
10757
10857
|
waitlist_claim: {
|
|
10758
10858
|
wording: "editable",
|
|
10759
10859
|
perEvent: false,
|
|
@@ -10829,6 +10929,16 @@ const EMAIL_DEFINITIONS = {
|
|
|
10829
10929
|
perEvent: false,
|
|
10830
10930
|
templateStorage: false
|
|
10831
10931
|
},
|
|
10932
|
+
class_listing_link: {
|
|
10933
|
+
wording: "fixed",
|
|
10934
|
+
perEvent: false,
|
|
10935
|
+
templateStorage: false
|
|
10936
|
+
},
|
|
10937
|
+
class_listing_removed: {
|
|
10938
|
+
wording: "fixed",
|
|
10939
|
+
perEvent: false,
|
|
10940
|
+
templateStorage: false
|
|
10941
|
+
},
|
|
10832
10942
|
venue_claim_link: {
|
|
10833
10943
|
wording: "fixed",
|
|
10834
10944
|
perEvent: false,
|
|
@@ -11248,4 +11358,4 @@ function isEventOccurrenceRouteSegment(segment) {
|
|
|
11248
11358
|
}
|
|
11249
11359
|
|
|
11250
11360
|
//#endregion
|
|
11251
|
-
export {
|
|
11361
|
+
export { planMailingListChoicePresentation as $, unsafeAsPositiveSeconds as $n, getBookingInstalmentPlanIntervalCount as $t, firstLiveRunSessionStartMs as A, formatCurrencyAmount as An, buildBookingUtcDateWindow as At, parseMailingListContentVersionId as B, parseMembershipId as Bn, parseLocalScheduleTime as Bt, PUBLIC_AVAILABILITY_FRESHNESS_SECONDS as C, isNonNegativeWholeCents as Cn, unsafeAsOccurrenceId as Cr, formatDateTime as Ct, publicReadBatchFreshnessSeconds as D, toNonNegativeCents as Dn, blockInteractionContextSchema as Dr, inferSiteDateLocale as Dt, isPublicReadEndpoint as E, toCents as En, ok as Er, formatTimeRange as Et, createSecret as F, unsafeAsDemoCapability as Fn, getBookingLocalDateKey as Ft, parseMailingListGlobalForm as G, unsafeAsBookingSessionId as Gn, parseUtcIsoDateTimeString as Gt, parseMailingListRuntimeContext as H, unsafeAsPassId as Hn, resolveBookingTimeZoneId as Ht, exposeSecret as I, unsafeAsAppointmentResourceId as In, getLocalScheduleDate as It, parseMailingListProviderScope as J, unsafeAsDetectedMimeType as Jn, validateBookingPaymentOptionKinds as Jt, DEFAULT_MAILING_LIST_PRIVACY_NOTE as K, parseMediaAssetId as Kn, toUtcIsoDateTimeString as Kt, parseManagementKey as L, unsafeAsStaffMemberId as Ln, getLocalScheduleTime as Lt, orderedLiveRunSessions as M, assertNever as Mn, compareLocalScheduleDates as Mt, resolveWholeSeriesBookingPhase as N, formatDurationUnitLabel as Nn, formatLocalScheduleDate as Nt, publicReadFreshnessSeconds as O, unsafeAsNonNegativeCents as On, resolveBookingDisplayContext as Ot, resolveWholeSeriesRunLifecycle as P, unsafeAsBookingRequirementId as Pn, formatLocalScheduleTime as Pt, DEFAULT_MAILING_LIST_TARGETING as Q, unsafeAsPositiveByteCount as Qn, getBookingInstalmentDepositRefundability as Qt, slugify as R, parseCustomerId as Rn, localScheduleTimePattern as Rt, WHOLE_SERIES_EVENT_PRESET_VALUES as S, mapReadonlyNonEmptyArray as Sn, unsafeAsEventSeriesId as Sr, formatDateRange as St, getPublicReadCachePolicy as T, parsePositiveCents as Tn, err as Tr, formatTime as Tt, assessMailingListTargeting as U, parseDatedOfferingCapacityHoldAuditRef as Un, toBookingTimeZone as Ut, parseMailingListSignedSourceToken as V, unsafeAsEntitlementId as Vn, resolveBookingBusinessTimeZone as Vt, parseConfiguredMailingListProvider as W, parseDatedOfferingCapacityHoldId as Wn, parseBookingTimeZone as Wt, footerLayoutForLookId as X, unsafeAsMediaAssetId as Xn, addIntervalPreservingMonthAnchor as Xt, parseFooterCompositionV1 as Y, unsafeAsFileChecksumSha256 as Yn, isLiveOrderInstalmentPlanStatus as Yt, parseMailingListPlacementTargeting as Z, unsafeAsOriginalFilename as Zn, clampConfiguredAmount as Zt, resolveSiteVerticalBookingConfig as _, publicEventPricingType as _n, parseEventSeriesId as _r, isPresent as _t, authoredValuesEqual as a, resolveFlexibleBalanceDueAt as an, unsafeAsProductId as ar, assertAllowedPublicUrl as at, ORDINARY_EVENT_PRESET_VALUES as b, fromArray as bn, unsafeAsEventInstanceId as br, selectCategoryView as bt, formatCreditProductUnits as c, parsePageSurfaceSubject as cn, unsafeAsOrderPaymentPlanId as cr, decideLocationSave as ct, withBookingModulesForSelectionChange as d, formatEventPricing as dn, unsafeAsSiteFontId as dr, locationValueSchema as dt, getBookingInstalmentProtectedDepositAmountCents as en, unsafeAsSafeDownloadFilename as er, isCanonicalRichTextDoc as et, NAVIGATION_LOCATIONS as f, isPublicEventPricingOptionDisplayable as fn, parseApiKeyId as fr, normalizeLocationAddressText as ft, parseVerticalPresetId as g, publicEventPricingStrategy as gn, unsafeAsUserId as gr, toLocationCoordinates as gt, parseVerticalId as h, publicEventPricingOptions as hn, unsafeAsSiteId as hr, publicLocationSchema as ht, isRecord as i, scheduleBookingReasonCodes as in, unsafeAsUploadSessionId as ir, parseWeeklyOpeningHours as it, nextLiveRunSessionStartMs as j, parseCurrencyCode as jn, addLocalScheduleDays as jt, CANCELLED_SESSION_STATUS as k, unsafeAsPositiveCents as kn, toScheduledBookingDateTime as kt, planTurningOnCourses as l, EVENT_PRESET_VOCABULARY as ln, parseEditorSessionGeneration as lr, stableJsonStringify as lt, canonicalizeConfiguredBookingVerticalConfig as m, publicEventPricingDisplay as mn, parseUserId as mr, projectPublicLocation as mt, OFFLINE_PAYMENT_METHODS as n, splitAmountWithRemainderInFirst as nn, unsafeAsStorageBucketName as nr, formatOpeningHoursRows as nt, creditProductUnitNoun as o, resolveFlexibleBalanceInitialPaymentCents as on, unsafeAsCheckoutLineId as or, SENSITIVE_COLLECTION_CONFIRMATION_VERSION as ot, areConfiguredBookingVerticalConfigsEqual as p, publicEventPricingCurrency as pn, parseSiteId as pr, parseLocationValue as pt, DEFAULT_MAILING_LIST_SUCCESS_MESSAGE as q, unsafeAsDeclaredMimeType as qn, BOOKING_COURSE_INSTALMENT_DEADLINES as qt, committedWriteProofSchema as r, businessCancellationRefusalCodes as rn, unsafeAsStoragePath as rr, parsePublicContactDetails as rt, formatCreditProductPayment as s, deriveTotalTicketQuantity as sn, unsafeAsOrderFlexibleBalanceContractId as sr, SENSITIVE_COLLECTION_MODES as st, isEventOccurrenceRouteSegment as t, omitZeroAmountFutureRows as tn, unsafeAsSiteScopedStoragePath as tr, richTextHasText as tt, resolveEventCatalogue as u, formatBookingPriceDisplay as un, parsePageId as ur, locationMapLinks as ut, DEFAULT_EVENT_TYPE_PRESETS as v, resolveExactOrFreePriceDisplay as vn, parseRetiredCourseId as vr, trimmedStringOrNull as vt, PUBLIC_CONTENT_FRESHNESS_SECONDS as w, parseNonNegativeCents as wn, unsafeAsPricingOptionId as wr, formatDateTimeRange as wt, SURFACE_EVENT_PRESET_VALUES as x, mapNonEmptyArray as xn, unsafeAsEventOfferingId as xr, formatDate as xt, EVENT_PRESET_VALUES as y, resolvePricingOptionsPriceDisplay as yn, unsafeAsEventCategoryId as yr, mapDrawingSchema as yt, parseMailingListBlockId as z, parseSiteTermsVersionId as zn, parseBookingLocalDate as zt };
|
package/dist/testing.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./sdk-event-upsert-
|
|
3
|
-
import "./src-
|
|
4
|
-
import { G as syncLocalMediaForPull, Gt as applyPushConfigPlan, Jt as preparePushConfigTarget, W as syncLocalMediaForPush, at as readEntries, ht as writeMediaManifest, kn as createOutput, o as executeEntryCommandPlanAsSyncResult, t as compileEntryPushCommands, z as calculateEntryDiffs } from "./entryCommands-
|
|
5
|
-
import "./load-config-
|
|
2
|
+
import "./sdk-event-upsert-B3Ln6jqq.mjs";
|
|
3
|
+
import "./src-wXdYu3yt.mjs";
|
|
4
|
+
import { G as syncLocalMediaForPull, Gt as applyPushConfigPlan, Jt as preparePushConfigTarget, W as syncLocalMediaForPush, at as readEntries, ht as writeMediaManifest, kn as createOutput, o as executeEntryCommandPlanAsSyncResult, t as compileEntryPushCommands, z as calculateEntryDiffs } from "./entryCommands-B2kELFEc.mjs";
|
|
5
|
+
import "./load-config-CTuNN3xv.mjs";
|
|
6
6
|
|
|
7
7
|
export { applyPushConfigPlan, calculateEntryDiffs, compileEntryPushCommands, createOutput, executeEntryCommandPlanAsSyncResult, preparePushConfigTarget, readEntries, syncLocalMediaForPull, syncLocalMediaForPush, writeMediaManifest };
|
package/package.json
CHANGED