riverbankcms 0.32.1 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acceptance/matrix.mjs +3 -3
- package/dist/cli/index.mjs +14798 -12641
- package/dist/cli/init-docs/content/cli-reference.md +14 -1
- package/dist/cli/init-docs/content/content-management.md +17 -4
- package/dist/{entryCommands-KmqgJ44o.mjs → entryCommands-wcOr-fKy.mjs} +948 -560
- package/dist/{eventUpsertInputSchema-DQd8P8BZ.mjs → eventUpsertInputSchema-Df67rs3n.mjs} +2 -2
- package/dist/load-config-CKgy6Yct.mjs +4 -0
- package/dist/{load-config-C_QmGbxS.mjs → load-config-CexajivS.mjs} +2 -2
- package/dist/{plan-BKUvYkD2.mjs → plan-Bhv4iKa3.mjs} +1 -1
- package/dist/scaffold/index.mjs +2 -2
- package/dist/{sdk-event-upsert-D6oZBDR5.mjs → sdk-event-upsert-Y4Iyx0N4.mjs} +34 -11
- package/dist/{src-gbODrFjm.mjs → src-90EK8rKq.mjs} +144 -29
- package/dist/testing.mjs +4 -4
- package/package.json +1 -1
- package/dist/load-config-CTqBfOO9.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-Y4Iyx0N4.mjs";
|
|
3
|
+
import { b as EVENT_PRESET_VALUES } from "./src-90EK8rKq.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.
|
|
10
|
+
var version = "0.33.0";
|
|
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.
|
|
97
|
+
const CLI_VERSION = typeof "0.33.0" === "string" ? "0.33.0" : 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 { Dr as err, Or as ok, hr as parseSiteId } from "./src-90EK8rKq.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-90EK8rKq.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-Bhv4iKa3.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 unsafeAsOriginalFilename, Bt as localScheduleTimePattern, Cn as mapNonEmptyArray, Dr as err, G as parseConfiguredMailingListProvider, In as unsafeAsBookingRequirementId, Jn as parseMediaAssetId, K as parseMailingListGlobalForm, Kt as parseBookingTimeZone, Or as ok, Pn as assertNever, Qn as unsafeAsMediaAssetId, Sn as fromArray, Un as unsafeAsEntitlementId, X as parseFooterCompositionV1, Xn as unsafeAsDetectedMimeType, Xt as validateBookingPaymentOptionKinds, Yn as unsafeAsDeclaredMimeType, Yt as BOOKING_COURSE_INSTALMENT_DEADLINES, Zn as unsafeAsFileChecksumSha256, _r as unsafeAsSiteId, ar as unsafeAsStoragePath, at as parseWeeklyOpeningHours, b as EVENT_PRESET_VALUES, ct as SENSITIVE_COLLECTION_MODES, er as unsafeAsPositiveByteCount, hr as parseSiteId, i as isRecord$6, ir as unsafeAsStorageBucketName, it as parsePublicContactDetails, n as OFFLINE_PAYMENT_METHODS, nr as unsafeAsSafeDownloadFilename, o as STAFF_OPERATIONAL_CAPABILITIES, or as unsafeAsUploadSessionId, p as NAVIGATION_LOCATIONS, pr as unsafeAsSiteFontId, pt as locationValueSchema, qn as unsafeAsBookingSessionId, qt as parseUtcIsoDateTimeString, rr as unsafeAsSiteScopedStoragePath, sr as unsafeAsProductId, st as SENSITIVE_COLLECTION_CONFIRMATION_VERSION, t as isEventOccurrenceRouteSegment, tr as unsafeAsPositiveSeconds, tt as isCanonicalRichTextDoc, ut as stableJsonStringify, v as resolveSiteVerticalBookingConfig, vr as unsafeAsUserId, wn as mapReadonlyNonEmptyArray, x as ORDINARY_EVENT_PRESET_VALUES, xr as unsafeAsEventCategoryId, yt as isPresent } from "./src-90EK8rKq.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"
|
|
@@ -1032,6 +1034,7 @@ const SUPPORTED_LOADER_ENDPOINTS = [
|
|
|
1032
1034
|
"listPublicEventCalendarWindow",
|
|
1033
1035
|
"listPublicRecurringSchedule",
|
|
1034
1036
|
"getPublicEventDetails",
|
|
1037
|
+
"getPublicMapLocation",
|
|
1035
1038
|
"listPublicRouteCandidates",
|
|
1036
1039
|
"listPublicTeamMembers",
|
|
1037
1040
|
"listPublicProducts",
|
|
@@ -7259,7 +7262,7 @@ const pricingOptionSchema = z.object({
|
|
|
7259
7262
|
function slidingScaleSchema(currency, portable) {
|
|
7260
7263
|
return z.object({
|
|
7261
7264
|
kind: fieldMeaning(z.literal("sliding_scale"), {
|
|
7262
|
-
...meaning$1("Sliding scale", "People
|
|
7265
|
+
...meaning$1("Sliding scale", "People pick what they pay, between a lowest and highest price you set."),
|
|
7263
7266
|
valueLabels: { sliding_scale: "Sliding scale" }
|
|
7264
7267
|
}),
|
|
7265
7268
|
currency,
|
|
@@ -7292,7 +7295,7 @@ function createEventPricingSchemas(option, currency, portable = false) {
|
|
|
7292
7295
|
}).strict();
|
|
7293
7296
|
const single = z.object({
|
|
7294
7297
|
kind: fieldMeaning(z.literal("single"), {
|
|
7295
|
-
...meaning$1("Single price", "
|
|
7298
|
+
...meaning$1("Single price", "Everyone pays the same price."),
|
|
7296
7299
|
valueLabels: { single: "Single price" }
|
|
7297
7300
|
}),
|
|
7298
7301
|
currency,
|
|
@@ -7300,7 +7303,7 @@ function createEventPricingSchemas(option, currency, portable = false) {
|
|
|
7300
7303
|
}).strict();
|
|
7301
7304
|
const tiered = z.object({
|
|
7302
7305
|
kind: fieldMeaning(z.literal("tiered"), {
|
|
7303
|
-
...meaning$1("Ticket types", "A few
|
|
7306
|
+
...meaning$1("Ticket types", "A few choices at different prices, like standard and concession."),
|
|
7304
7307
|
valueLabels: { tiered: "Ticket types" }
|
|
7305
7308
|
}),
|
|
7306
7309
|
currency,
|
|
@@ -42627,6 +42630,15 @@ const configureMailingListCommandSchema = z.object({
|
|
|
42627
42630
|
bookingOptIn: z.boolean().default(false)
|
|
42628
42631
|
}).strict()
|
|
42629
42632
|
}).strict();
|
|
42633
|
+
/** 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. */
|
|
42634
|
+
const upsertMailingListTopicCommandSchema = z.object({
|
|
42635
|
+
type: z.literal("upsertMailingListTopic"),
|
|
42636
|
+
ref: resourceRefSchema("mailing-list-topic"),
|
|
42637
|
+
input: z.object({
|
|
42638
|
+
name: z.string().min(1),
|
|
42639
|
+
description: z.string().min(1).nullable().optional()
|
|
42640
|
+
}).strict()
|
|
42641
|
+
}).strict();
|
|
42630
42642
|
|
|
42631
42643
|
//#endregion
|
|
42632
42644
|
//#region ../site-commands/src/packageCommandFields.ts
|
|
@@ -42742,7 +42754,7 @@ const configuredVerticalConfigSchema = z.object({
|
|
|
42742
42754
|
if (resolved.kind === "configured") return resolved.config;
|
|
42743
42755
|
context.addIssue({
|
|
42744
42756
|
code: z.ZodIssueCode.custom,
|
|
42745
|
-
message: resolved.kind === "unconfigured" ? "Booking vertical configuration must select a
|
|
42757
|
+
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(", ")}`
|
|
42746
42758
|
});
|
|
42747
42759
|
return z.NEVER;
|
|
42748
42760
|
});
|
|
@@ -43398,11 +43410,7 @@ const upsertStaffMemberCommandSchema = z.object({
|
|
|
43398
43410
|
identity: staffMemberIdentitySchema,
|
|
43399
43411
|
access: z.object({
|
|
43400
43412
|
memberId: z.string().uuid(),
|
|
43401
|
-
capabilities: z.array(z.enum(
|
|
43402
|
-
"appointments",
|
|
43403
|
-
"event_ops",
|
|
43404
|
-
"packages"
|
|
43405
|
-
])).min(1)
|
|
43413
|
+
capabilities: z.array(z.enum(STAFF_OPERATIONAL_CAPABILITIES)).min(1)
|
|
43406
43414
|
}).strict().optional(),
|
|
43407
43415
|
displayName: z.string().min(1),
|
|
43408
43416
|
roleLabel: z.string().optional(),
|
|
@@ -43524,6 +43532,7 @@ const siteCommandSchema = z.discriminatedUnion("type", [
|
|
|
43524
43532
|
configureSiteIdentityCommandSchema,
|
|
43525
43533
|
configureBookingSettingsCommandSchema,
|
|
43526
43534
|
configureMailingListCommandSchema,
|
|
43535
|
+
upsertMailingListTopicCommandSchema,
|
|
43527
43536
|
applySiteStyleSelectionCommandSchema,
|
|
43528
43537
|
upsertMediaAssetCommandSchema,
|
|
43529
43538
|
upsertPageCommandSchema,
|
|
@@ -43847,6 +43856,19 @@ const siteCommandMetadata = {
|
|
|
43847
43856
|
capability: "mailing_list.setup.write",
|
|
43848
43857
|
support: "supported"
|
|
43849
43858
|
},
|
|
43859
|
+
upsertMailingListTopic: {
|
|
43860
|
+
scope: "mailing_list",
|
|
43861
|
+
risk: "low",
|
|
43862
|
+
writeSemantics: "upsert",
|
|
43863
|
+
lifecycleIntent: "mutation",
|
|
43864
|
+
idempotencyStrategy: "recipe_ref",
|
|
43865
|
+
conflictPolicy: "update_existing",
|
|
43866
|
+
previewability: "dry_run_only",
|
|
43867
|
+
allowedRuntimes: allRuntimes,
|
|
43868
|
+
intendedExposure: recipeExposure,
|
|
43869
|
+
capability: "mailing_list.setup.write",
|
|
43870
|
+
support: "supported"
|
|
43871
|
+
},
|
|
43850
43872
|
applySiteStyleSelection: {
|
|
43851
43873
|
scope: "style",
|
|
43852
43874
|
risk: "low",
|
|
@@ -44750,7 +44772,8 @@ function commandRefContributions(command) {
|
|
|
44750
44772
|
if (isLifecycleRefCommand(command)) return lifecycleCommandRefContributions(command);
|
|
44751
44773
|
if (command.type === "upsertDiscountCode") return discountCodeRefContributions(command);
|
|
44752
44774
|
switch (command.type) {
|
|
44753
|
-
case "upsertGiftingOffer":
|
|
44775
|
+
case "upsertGiftingOffer":
|
|
44776
|
+
case "upsertMailingListTopic": return {
|
|
44754
44777
|
provides: [{
|
|
44755
44778
|
ref: command.ref,
|
|
44756
44779
|
field: "ref"
|
|
@@ -3698,6 +3698,8 @@ function resolvePermittedLocation(permission, location, siteCountry) {
|
|
|
3698
3698
|
|
|
3699
3699
|
//#endregion
|
|
3700
3700
|
//#region ../core/src/venue-location.ts
|
|
3701
|
+
/** The owner's option and what visitors read are the same words, so the option says what you'll see. */
|
|
3702
|
+
const EVENT_ADDRESS_AFTER_BOOKING_LABEL = "Address shared after booking";
|
|
3701
3703
|
/** Eligibility to read the venue is decided by the resource owner before disclosure. */
|
|
3702
3704
|
function decidePublicVenueLocation(venue, siteCountry) {
|
|
3703
3705
|
if (venue.location === null) return {
|
|
@@ -8471,6 +8473,13 @@ function resolveWholeSeriesPaymentDates(input) {
|
|
|
8471
8473
|
//#endregion
|
|
8472
8474
|
//#region ../core/src/public-read-cache-contract.ts
|
|
8473
8475
|
const PUBLIC_AVAILABILITY_FRESHNESS_SECONDS = 60;
|
|
8476
|
+
/**
|
|
8477
|
+
* How long a rendered page may hold availability it read through the batch
|
|
8478
|
+
* transport. Writers purge those pages by tag and batch POSTs never touch the
|
|
8479
|
+
* CDN, so this is only the backstop for a purge that failed. Checkout enforces
|
|
8480
|
+
* capacity itself, whatever a page showed.
|
|
8481
|
+
*/
|
|
8482
|
+
const PUBLIC_RENDERED_AVAILABILITY_FRESHNESS_SECONDS = 1800;
|
|
8474
8483
|
const PUBLIC_CONTENT_FRESHNESS_SECONDS = 3600;
|
|
8475
8484
|
function availability(fetchTags, transport) {
|
|
8476
8485
|
return {
|
|
@@ -8532,6 +8541,10 @@ function getPublicReadCachePolicy(endpoint) {
|
|
|
8532
8541
|
function publicReadFreshnessSeconds(endpoint) {
|
|
8533
8542
|
return getPublicReadCachePolicy(endpoint).freshness === "availability" ? PUBLIC_AVAILABILITY_FRESHNESS_SECONDS : PUBLIC_CONTENT_FRESHNESS_SECONDS;
|
|
8534
8543
|
}
|
|
8544
|
+
/** The freshness budget of a read made through the uncached batch transport. */
|
|
8545
|
+
function publicReadBatchFreshnessSeconds(endpoint) {
|
|
8546
|
+
return getPublicReadCachePolicy(endpoint).freshness === "availability" ? PUBLIC_RENDERED_AVAILABILITY_FRESHNESS_SECONDS : PUBLIC_CONTENT_FRESHNESS_SECONDS;
|
|
8547
|
+
}
|
|
8535
8548
|
|
|
8536
8549
|
//#endregion
|
|
8537
8550
|
//#region ../core/src/event-series-behaviour.ts
|
|
@@ -8872,14 +8885,10 @@ function createConfiguredSiteVerticalBookingConfig(verticalId, selectedPresetIds
|
|
|
8872
8885
|
selectedPresetIds
|
|
8873
8886
|
};
|
|
8874
8887
|
}
|
|
8875
|
-
function toNonEmptyVerticalPresetIds(presetIds) {
|
|
8876
|
-
const firstPresetId = presetIds[0];
|
|
8877
|
-
return firstPresetId ? [firstPresetId, ...presetIds.slice(1)] : null;
|
|
8878
|
-
}
|
|
8879
8888
|
/**
|
|
8880
8889
|
* Construct a configured booking selection only when the supplied preset IDs
|
|
8881
8890
|
* form a valid selection for the vertical. Invalid, cross-vertical, future,
|
|
8882
|
-
*
|
|
8891
|
+
* or duplicate selections return null. An empty selection keeps the business type with bookings off.
|
|
8883
8892
|
*/
|
|
8884
8893
|
function createSiteVerticalBookingConfig(verticalId, selectedPresetIds) {
|
|
8885
8894
|
const resolved = resolveSiteVerticalBookingConfig({
|
|
@@ -8914,9 +8923,6 @@ function collectRawConfigIssues(rawConfig, config) {
|
|
|
8914
8923
|
rawValue: rawPresetValue
|
|
8915
8924
|
});
|
|
8916
8925
|
}
|
|
8917
|
-
if (rawConfig.verticalId != null && config.selectedPresetIds.length === 0) {
|
|
8918
|
-
issues = appendUniqueIssue(issues, { code: "empty_selected_presets" });
|
|
8919
|
-
}
|
|
8920
8926
|
return issues;
|
|
8921
8927
|
}
|
|
8922
8928
|
function collectPresetConfigIssues(config) {
|
|
@@ -8975,8 +8981,7 @@ function resolveSiteVerticalBookingConfig(rawConfig) {
|
|
|
8975
8981
|
config,
|
|
8976
8982
|
issues
|
|
8977
8983
|
};
|
|
8978
|
-
const
|
|
8979
|
-
const configuredConfig = verticalId !== null && nonEmptyPresetIds !== null ? createConfiguredSiteVerticalBookingConfig(verticalId, nonEmptyPresetIds) : null;
|
|
8984
|
+
const configuredConfig = verticalId !== null ? createConfiguredSiteVerticalBookingConfig(verticalId, selectedPresetIds) : null;
|
|
8980
8985
|
if (configuredConfig === null) {
|
|
8981
8986
|
return {
|
|
8982
8987
|
kind: "invalid",
|
|
@@ -9068,7 +9073,7 @@ function getVerticalPresetSelectionOptions(config) {
|
|
|
9068
9073
|
return [{
|
|
9069
9074
|
preset: presetDefinition,
|
|
9070
9075
|
checked,
|
|
9071
|
-
disabledReason:
|
|
9076
|
+
disabledReason: null
|
|
9072
9077
|
}];
|
|
9073
9078
|
});
|
|
9074
9079
|
}
|
|
@@ -9107,13 +9112,6 @@ function setVerticalPresetSelected(config, presetId, selected) {
|
|
|
9107
9112
|
}
|
|
9108
9113
|
const selectedIds = new Set(resolved.config.selectedPresetIds);
|
|
9109
9114
|
if (!selected) {
|
|
9110
|
-
if (selectedIds.size <= 1) {
|
|
9111
|
-
return {
|
|
9112
|
-
ok: false,
|
|
9113
|
-
error: "last_selected_preset",
|
|
9114
|
-
config: resolved.config
|
|
9115
|
-
};
|
|
9116
|
-
}
|
|
9117
9115
|
selectedIds.delete(presetId);
|
|
9118
9116
|
const nextConfig = createSiteVerticalBookingConfig(verticalId, orderPresetIdsForVertical(verticalId, selectedIds));
|
|
9119
9117
|
return {
|
|
@@ -9144,13 +9142,6 @@ function setVerticalPresetsSelected(config, presetIds) {
|
|
|
9144
9142
|
};
|
|
9145
9143
|
}
|
|
9146
9144
|
const fallbackConfig = resolved.kind === "configured" ? resolved.config : DEFAULT_SITE_VERTICAL_BOOKING_CONFIG;
|
|
9147
|
-
if (presetIds.length === 0) {
|
|
9148
|
-
return {
|
|
9149
|
-
ok: false,
|
|
9150
|
-
error: "last_selected_preset",
|
|
9151
|
-
config: fallbackConfig
|
|
9152
|
-
};
|
|
9153
|
-
}
|
|
9154
9145
|
const presetByBehaviour = new Map();
|
|
9155
9146
|
for (const presetId of presetIds) {
|
|
9156
9147
|
const presetDefinition = getVerticalPresetDefinition(presetId);
|
|
@@ -9306,6 +9297,101 @@ const PORTAL_NAV_DEFAULT_LABELS = {
|
|
|
9306
9297
|
loggedIn: "My account"
|
|
9307
9298
|
};
|
|
9308
9299
|
|
|
9300
|
+
//#endregion
|
|
9301
|
+
//#region ../core/src/booking-offerings.ts
|
|
9302
|
+
/** The selection owns availability. Stored module flags are only its write-time projection (#1773). */
|
|
9303
|
+
function deriveBookingModules(selection) {
|
|
9304
|
+
const config = selection.verticalConfig;
|
|
9305
|
+
const presets = (config?.selectedPresetIds ?? []).map(getVerticalPresetDefinition);
|
|
9306
|
+
return {
|
|
9307
|
+
appointments: presets.some(({ engine }) => engine === "appointment_service"),
|
|
9308
|
+
events: config?.verticalId != null ? presets.some(({ engine }) => engine === "event_series") : (selection.eventTypePresets ?? []).length > 0
|
|
9309
|
+
};
|
|
9310
|
+
}
|
|
9311
|
+
function withDerivedBookingModules(selection) {
|
|
9312
|
+
return {
|
|
9313
|
+
...selection,
|
|
9314
|
+
modules: deriveBookingModules(selection)
|
|
9315
|
+
};
|
|
9316
|
+
}
|
|
9317
|
+
function offeringSelectionKey(selection) {
|
|
9318
|
+
const config = selection.verticalConfig;
|
|
9319
|
+
return JSON.stringify({
|
|
9320
|
+
business: config?.verticalId ?? null,
|
|
9321
|
+
choices: [...config?.verticalId != null ? config.selectedPresetIds : selection.eventTypePresets ?? []].sort()
|
|
9322
|
+
});
|
|
9323
|
+
}
|
|
9324
|
+
function bookingOfferingSelectionChanged(current, next) {
|
|
9325
|
+
return offeringSelectionKey(current) !== offeringSelectionKey(next);
|
|
9326
|
+
}
|
|
9327
|
+
/** Unrelated saves and stale module fields cannot change availability. */
|
|
9328
|
+
function withBookingModulesForSelectionChange(current, next) {
|
|
9329
|
+
return {
|
|
9330
|
+
...next,
|
|
9331
|
+
modules: bookingOfferingSelectionChanged(current, next) ? deriveBookingModules(next) : current.modules
|
|
9332
|
+
};
|
|
9333
|
+
}
|
|
9334
|
+
function nonEmptyGenericKinds(kinds) {
|
|
9335
|
+
return kinds === undefined ? DEFAULT_EVENT_TYPE_PRESETS : kinds.length > 0 ? kinds : ["event"];
|
|
9336
|
+
}
|
|
9337
|
+
function selectionIncludesPreset(selection, preset) {
|
|
9338
|
+
if (selection.verticalConfig?.verticalId) return selection.verticalConfig.selectedPresetIds.includes(preset.id);
|
|
9339
|
+
const kinds = selection.eventTypePresets ?? DEFAULT_EVENT_TYPE_PRESETS;
|
|
9340
|
+
return kinds.some((kind) => preset.engine === "event_series" && kind === eventPresetForVerticalPreset(preset) || kind === "term" && preset.canonicalBehaviour === "course");
|
|
9341
|
+
}
|
|
9342
|
+
/** Generic event lists need no business profile until appointments are requested. */
|
|
9343
|
+
function reconcileGenericOfferings(selection, availability$1) {
|
|
9344
|
+
if (selection.verticalConfig?.verticalId != null) return null;
|
|
9345
|
+
if (!availability$1.appointments) return {
|
|
9346
|
+
kind: "ready",
|
|
9347
|
+
selection: {
|
|
9348
|
+
...selection,
|
|
9349
|
+
eventTypePresets: availability$1.events ? nonEmptyGenericKinds(selection.eventTypePresets) : []
|
|
9350
|
+
}
|
|
9351
|
+
};
|
|
9352
|
+
return selection.eventTypePresets?.includes("performance") === true ? {
|
|
9353
|
+
kind: "unmappable",
|
|
9354
|
+
module: "events"
|
|
9355
|
+
} : null;
|
|
9356
|
+
}
|
|
9357
|
+
/** One-time availability reconciliation, also used when onboarding expresses engine intent. */
|
|
9358
|
+
function reconcileBookingOfferingSelection(selection, availability$1) {
|
|
9359
|
+
const generic = reconcileGenericOfferings(selection, availability$1);
|
|
9360
|
+
if (generic !== null) return generic;
|
|
9361
|
+
const verticalId = selection.verticalConfig?.verticalId ?? "something_else";
|
|
9362
|
+
const options = getVerticalPresetsForVertical(verticalId, { availability: "selectable" });
|
|
9363
|
+
const selected = options.filter((preset) => selectionIncludesPreset(selection, preset));
|
|
9364
|
+
const enabled = selected.filter(({ engine }) => availability$1[engine === "appointment_service" ? "appointments" : "events"]);
|
|
9365
|
+
const wanted = ["events", "appointments"].filter((module) => availability$1[module]);
|
|
9366
|
+
const missing = wanted.filter((module) => !enabled.some(({ engine }) => engine === (module === "events" ? "event_series" : "appointment_service")));
|
|
9367
|
+
const additions = missing.map((module) => options.find(({ engine }) => engine === (module === "events" ? "event_series" : "appointment_service")));
|
|
9368
|
+
const unmappable = missing.find((_, index) => additions[index] === undefined);
|
|
9369
|
+
if (unmappable !== undefined) return {
|
|
9370
|
+
kind: "unmappable",
|
|
9371
|
+
module: unmappable
|
|
9372
|
+
};
|
|
9373
|
+
const ids = [...enabled, ...additions.flatMap((preset) => preset !== undefined ? [preset] : [])].map(({ id }) => id);
|
|
9374
|
+
const config = createSiteVerticalBookingConfig(verticalId, ids);
|
|
9375
|
+
if (config === null) return {
|
|
9376
|
+
kind: "unmappable",
|
|
9377
|
+
module: "events"
|
|
9378
|
+
};
|
|
9379
|
+
return {
|
|
9380
|
+
kind: "ready",
|
|
9381
|
+
selection: {
|
|
9382
|
+
...selection,
|
|
9383
|
+
verticalConfig: config,
|
|
9384
|
+
eventTypePresets: []
|
|
9385
|
+
}
|
|
9386
|
+
};
|
|
9387
|
+
}
|
|
9388
|
+
/** Permission and confirmation are about losing an engine, not removing one of several event kinds. */
|
|
9389
|
+
function planBookingAvailabilityChange(current, next, canChangeAvailability) {
|
|
9390
|
+
if (current.events === next.events && current.appointments === next.appointments) return "unchanged";
|
|
9391
|
+
if (!canChangeAvailability) return "forbidden";
|
|
9392
|
+
return current.events && !next.events || current.appointments && !next.appointments ? "confirm" : "apply";
|
|
9393
|
+
}
|
|
9394
|
+
|
|
9309
9395
|
//#endregion
|
|
9310
9396
|
//#region ../core/src/event-catalogue.ts
|
|
9311
9397
|
/** Accepts validated settings; defaults and raw configuration parsing belong to the caller. */
|
|
@@ -9317,10 +9403,14 @@ function resolveEventCatalogue(settings) {
|
|
|
9317
9403
|
pluralLabel: preset.pluralLabel,
|
|
9318
9404
|
description: preset.description
|
|
9319
9405
|
}));
|
|
9320
|
-
if (entries.length > 0
|
|
9406
|
+
if (settings.verticalConfig?.verticalId != null) return entries.length > 0 ? {
|
|
9321
9407
|
source: "business_profile",
|
|
9322
9408
|
entries,
|
|
9323
9409
|
catchAll: "implicit"
|
|
9410
|
+
} : {
|
|
9411
|
+
source: "generic",
|
|
9412
|
+
entries: [],
|
|
9413
|
+
catchAll: "unavailable"
|
|
9324
9414
|
};
|
|
9325
9415
|
return {
|
|
9326
9416
|
source: "generic",
|
|
@@ -9639,6 +9729,26 @@ function formatCreditProductUnits(useCase, count) {
|
|
|
9639
9729
|
function formatCreditProductBalance(useCase, balance) {
|
|
9640
9730
|
return `${balance.remaining} of ${balance.total} ${creditProductUnitNoun(useCase, balance.total)} left`;
|
|
9641
9731
|
}
|
|
9732
|
+
/** Confirmation copy shared by booking screens and editable email wording. */
|
|
9733
|
+
function formatCreditProductPayment(input) {
|
|
9734
|
+
const used = input.creditsUsed;
|
|
9735
|
+
const payment = used !== undefined && used !== 0 && !Number.isNaN(used) ? `${used} credit${used === 1 ? "" : "s"} from your ${input.name}` : `Paid with your ${input.name}`;
|
|
9736
|
+
return payment + (input.creditsRemaining === undefined ? "" : ` (${input.creditsRemaining} left)`);
|
|
9737
|
+
}
|
|
9738
|
+
|
|
9739
|
+
//#endregion
|
|
9740
|
+
//#region ../core/src/staff-capabilities.ts
|
|
9741
|
+
/**
|
|
9742
|
+
* What a team member's login can be given, as stored on their membership.
|
|
9743
|
+
* `own_offerings` is creating what only they offer, which needs `appointments`
|
|
9744
|
+
* and `packages` beside it.
|
|
9745
|
+
*/
|
|
9746
|
+
const STAFF_OPERATIONAL_CAPABILITIES = [
|
|
9747
|
+
"appointments",
|
|
9748
|
+
"event_ops",
|
|
9749
|
+
"packages",
|
|
9750
|
+
"own_offerings"
|
|
9751
|
+
];
|
|
9642
9752
|
|
|
9643
9753
|
//#endregion
|
|
9644
9754
|
//#region ../core/src/patch/index.ts
|
|
@@ -10755,6 +10865,11 @@ const EMAIL_DEFINITIONS = {
|
|
|
10755
10865
|
perEvent: false,
|
|
10756
10866
|
templateStorage: true
|
|
10757
10867
|
},
|
|
10868
|
+
waitlist_cancelled: {
|
|
10869
|
+
wording: "editable",
|
|
10870
|
+
perEvent: false,
|
|
10871
|
+
templateStorage: true
|
|
10872
|
+
},
|
|
10758
10873
|
waitlist_claim: {
|
|
10759
10874
|
wording: "editable",
|
|
10760
10875
|
perEvent: false,
|
|
@@ -10860,12 +10975,12 @@ const EMAIL_DEFINITIONS = {
|
|
|
10860
10975
|
perEvent: false,
|
|
10861
10976
|
templateStorage: false
|
|
10862
10977
|
},
|
|
10863
|
-
|
|
10978
|
+
admin_attention_summary: {
|
|
10864
10979
|
wording: "fixed",
|
|
10865
10980
|
perEvent: false,
|
|
10866
10981
|
templateStorage: false
|
|
10867
10982
|
},
|
|
10868
|
-
|
|
10983
|
+
support_email_acknowledgement: {
|
|
10869
10984
|
wording: "fixed",
|
|
10870
10985
|
perEvent: false,
|
|
10871
10986
|
templateStorage: false
|
|
@@ -11259,4 +11374,4 @@ function isEventOccurrenceRouteSegment(segment) {
|
|
|
11259
11374
|
}
|
|
11260
11375
|
|
|
11261
11376
|
//#endregion
|
|
11262
|
-
export {
|
|
11377
|
+
export { DEFAULT_MAILING_LIST_TARGETING as $, unsafeAsOriginalFilename as $n, clampConfiguredAmount as $t, CANCELLED_SESSION_STATUS as A, unsafeAsNonNegativeCents as An, resolveBookingDisplayContext as At, parseMailingListBlockId as B, parseCustomerId as Bn, localScheduleTimePattern as Bt, WHOLE_SERIES_EVENT_PRESET_VALUES as C, mapNonEmptyArray as Cn, unsafeAsEventOfferingId as Cr, formatDate as Ct, isPublicReadEndpoint as D, parsePositiveCents as Dn, err as Dr, formatTime as Dt, getPublicReadCachePolicy as E, parseNonNegativeCents as En, unsafeAsPricingOptionId as Er, formatDateTimeRange as Et, resolveWholeSeriesRunLifecycle as F, formatDurationUnitLabel as Fn, formatLocalScheduleDate as Ft, parseConfiguredMailingListProvider as G, parseDatedOfferingCapacityHoldAuditRef as Gn, toBookingTimeZone as Gt, parseMailingListSignedSourceToken as H, parseMembershipId as Hn, parseLocalScheduleTime as Ht, createSecret as I, unsafeAsBookingRequirementId as In, formatLocalScheduleTime as It, DEFAULT_MAILING_LIST_SUCCESS_MESSAGE as J, parseMediaAssetId as Jn, toUtcIsoDateTimeString as Jt, parseMailingListGlobalForm as K, parseDatedOfferingCapacityHoldId as Kn, parseBookingTimeZone as Kt, exposeSecret as L, unsafeAsDemoCapability as Ln, getBookingLocalDateKey as Lt, nextLiveRunSessionStartMs as M, formatCurrencyAmount as Mn, buildBookingUtcDateWindow as Mt, orderedLiveRunSessions as N, parseCurrencyCode as Nn, addLocalScheduleDays as Nt, publicReadBatchFreshnessSeconds as O, toCents as On, ok as Or, formatTimeRange as Ot, resolveWholeSeriesBookingPhase as P, assertNever as Pn, compareLocalScheduleDates as Pt, parseMailingListPlacementTargeting as Q, unsafeAsMediaAssetId as Qn, addIntervalPreservingMonthAnchor as Qt, parseManagementKey as R, unsafeAsAppointmentResourceId as Rn, getLocalScheduleDate as Rt, SURFACE_EVENT_PRESET_VALUES as S, fromArray as Sn, unsafeAsEventInstanceId as Sr, selectCategoryView as St, PUBLIC_CONTENT_FRESHNESS_SECONDS as T, isNonNegativeWholeCents as Tn, unsafeAsOccurrenceId as Tr, formatDateTime as Tt, parseMailingListRuntimeContext as U, unsafeAsEntitlementId as Un, resolveBookingBusinessTimeZone as Ut, parseMailingListContentVersionId as V, parseSiteTermsVersionId as Vn, parseBookingLocalDate as Vt, assessMailingListTargeting as W, unsafeAsPassId as Wn, resolveBookingTimeZoneId as Wt, parseFooterCompositionV1 as X, unsafeAsDetectedMimeType as Xn, validateBookingPaymentOptionKinds as Xt, parseMailingListProviderScope as Y, unsafeAsDeclaredMimeType as Yn, BOOKING_COURSE_INSTALMENT_DEADLINES as Yt, footerLayoutForLookId as Z, unsafeAsFileChecksumSha256 as Zn, isLiveOrderInstalmentPlanStatus as Zt, parseVerticalPresetId as _, publicEventPricingOptions as _n, unsafeAsSiteId as _r, publicLocationSchema as _t, authoredValuesEqual as a, businessCancellationRefusalCodes as an, unsafeAsStoragePath as ar, parseWeeklyOpeningHours as at, EVENT_PRESET_VALUES as b, resolveExactOrFreePriceDisplay as bn, parseRetiredCourseId as br, trimmedStringOrNull as bt, formatCreditProductPayment as c, resolveFlexibleBalanceInitialPaymentCents as cn, unsafeAsCheckoutLineId as cr, SENSITIVE_COLLECTION_MODES as ct, resolveEventCatalogue as d, EVENT_PRESET_VOCABULARY as dn, parseEditorSessionGeneration as dr, locationMapLinks as dt, getBookingInstalmentDepositRefundability as en, unsafeAsPositiveByteCount as er, planMailingListChoicePresentation as et, withBookingModulesForSelectionChange as f, formatBookingPriceDisplay as fn, parsePageId as fr, EVENT_ADDRESS_AFTER_BOOKING_LABEL as ft, parseVerticalId as g, publicEventPricingDisplay as gn, parseUserId as gr, projectPublicLocation as gt, canonicalizeConfiguredBookingVerticalConfig as h, publicEventPricingCurrency as hn, parseSiteId as hr, parseLocationValue as ht, isRecord as i, splitAmountWithRemainderInFirst as in, unsafeAsStorageBucketName as ir, parsePublicContactDetails as it, firstLiveRunSessionStartMs as j, unsafeAsPositiveCents as jn, toScheduledBookingDateTime as jt, publicReadFreshnessSeconds as k, toNonNegativeCents as kn, blockInteractionContextSchema as kr, inferSiteDateLocale as kt, formatCreditProductUnits as l, deriveTotalTicketQuantity as ln, unsafeAsOrderFlexibleBalanceContractId as lr, decideLocationSave as lt, areConfiguredBookingVerticalConfigsEqual as m, isPublicEventPricingOptionDisplayable as mn, parseApiKeyId as mr, normalizeLocationAddressText as mt, OFFLINE_PAYMENT_METHODS as n, getBookingInstalmentProtectedDepositAmountCents as nn, unsafeAsSafeDownloadFilename as nr, richTextHasText as nt, STAFF_OPERATIONAL_CAPABILITIES as o, scheduleBookingReasonCodes as on, unsafeAsUploadSessionId as or, assertAllowedPublicUrl as ot, NAVIGATION_LOCATIONS as p, formatEventPricing as pn, unsafeAsSiteFontId as pr, locationValueSchema as pt, DEFAULT_MAILING_LIST_PRIVACY_NOTE as q, unsafeAsBookingSessionId as qn, parseUtcIsoDateTimeString as qt, committedWriteProofSchema as r, omitZeroAmountFutureRows as rn, unsafeAsSiteScopedStoragePath as rr, formatOpeningHoursRows as rt, creditProductUnitNoun as s, resolveFlexibleBalanceDueAt as sn, unsafeAsProductId as sr, SENSITIVE_COLLECTION_CONFIRMATION_VERSION as st, isEventOccurrenceRouteSegment as t, getBookingInstalmentPlanIntervalCount as tn, unsafeAsPositiveSeconds as tr, isCanonicalRichTextDoc as tt, planTurningOnCourses as u, parsePageSurfaceSubject as un, unsafeAsOrderPaymentPlanId as ur, stableJsonStringify as ut, resolveSiteVerticalBookingConfig as v, publicEventPricingStrategy as vn, unsafeAsUserId as vr, toLocationCoordinates as vt, PUBLIC_AVAILABILITY_FRESHNESS_SECONDS as w, mapReadonlyNonEmptyArray as wn, unsafeAsEventSeriesId as wr, formatDateRange as wt, ORDINARY_EVENT_PRESET_VALUES as x, resolvePricingOptionsPriceDisplay as xn, unsafeAsEventCategoryId as xr, mapDrawingSchema as xt, DEFAULT_EVENT_TYPE_PRESETS as y, publicEventPricingType as yn, parseEventSeriesId as yr, isPresent as yt, slugify as z, unsafeAsStaffMemberId as zn, getLocalScheduleTime 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,
|
|
5
|
-
import "./load-config-
|
|
2
|
+
import "./sdk-event-upsert-Y4Iyx0N4.mjs";
|
|
3
|
+
import "./src-90EK8rKq.mjs";
|
|
4
|
+
import { G as syncLocalMediaForPull, Gt as applyPushConfigPlan, Jt as preparePushConfigTarget, On as createOutput, W as syncLocalMediaForPush, at as readEntries, ht as writeMediaManifest, o as executeEntryCommandPlanAsSyncResult, t as compileEntryPushCommands, z as calculateEntryDiffs } from "./entryCommands-wcOr-fKy.mjs";
|
|
5
|
+
import "./load-config-CexajivS.mjs";
|
|
6
6
|
|
|
7
7
|
export { applyPushConfigPlan, calculateEntryDiffs, compileEntryPushCommands, createOutput, executeEntryCommandPlanAsSyncResult, preparePushConfigTarget, readEntries, syncLocalMediaForPull, syncLocalMediaForPush, writeMediaManifest };
|
package/package.json
CHANGED