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,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $n as headerStyleIdValues, At as getMimeType, Bt as footerPreferencesSchema, Cr as makeBoundaryId, Et as slugifyMediaIdentifier, Ft as MAX_MANAGEMENT_MEDIA_UPLOAD_BYTES, I as footerModeSchema, Ir as createSiteCommandSiteRef, Jn as asHeaderLayoutId, Kn as SUPPORTED_LOADER_ENDPOINTS, Mt as normalizeAmbiguousStoragePathForSite, Nn as RESOLVED_INTERNAL_LINK_ENTITY_TYPES, Or as createCommandRef, Pt as FILE_SIZE_LIMITS, Qn as headerLayoutIdValues, Sn as eventBookingOfferIntentSchema, Sr as asSiteStyleId, St as buildMediaIdentifierFromFilename, Tt as resolveMediaIdentifier, Un as ICON_PICKER_PRESETS, V as themeSchema, Xt as buttonStyleSelectionSchema, Yn as asHeaderStyleId, Zn as footerLookIdValues, _r as asDesignBoundaryId, at as parseAspectRatioValue, b as getSiteCommandMetadata, bt as mediaTypeDiscriminants, ct as getDirectImageUrlForSiteScopedPath, fr as asAppearancePresetId, gr as asDesignBlockId, h as parseAndPlanCommandBatchForTypes, k as headerPreferencesSchema, kr as createContentEntryRef, kt as getExtensionForMimeType, l as resolvePageUpsertSeo, m as createDryRunReport, n as sdkCourseBookingSettingsSchema, p as stableStringify, qn as asFooterLookId, r as sdkEventOccurrenceInputSchema, rr as SYSTEM_BLOCK_KINDS, s as eventVisibilitySchema, v as evaluateSiteCommandBatchExposure, vt as PUBLIC_FILE_FIELD_KINDS, w as entryIdentifierForCommand, wr as bookingQuestionAttachmentSchema, xn as require_dist, xr as asPageFlowPresetId, y as evaluateSiteCommandExposure, yt as isDisplayMediaKind, zr as slugPart } from "./sdk-event-upsert-
|
|
3
|
-
import { $t as
|
|
4
|
-
import { n as CliSdkPeerError, t as loadConfigFile } from "./load-config-
|
|
5
|
-
import { Command } from "commander";
|
|
2
|
+
import { $n as headerStyleIdValues, At as getMimeType, Bt as footerPreferencesSchema, Cr as makeBoundaryId, Et as slugifyMediaIdentifier, Ft as MAX_MANAGEMENT_MEDIA_UPLOAD_BYTES, I as footerModeSchema, Ir as createSiteCommandSiteRef, Jn as asHeaderLayoutId, Kn as SUPPORTED_LOADER_ENDPOINTS, Mt as normalizeAmbiguousStoragePathForSite, Nn as RESOLVED_INTERNAL_LINK_ENTITY_TYPES, Or as createCommandRef, Pt as FILE_SIZE_LIMITS, Qn as headerLayoutIdValues, Sn as eventBookingOfferIntentSchema, Sr as asSiteStyleId, St as buildMediaIdentifierFromFilename, Tt as resolveMediaIdentifier, Un as ICON_PICKER_PRESETS, V as themeSchema, Xt as buttonStyleSelectionSchema, Yn as asHeaderStyleId, Zn as footerLookIdValues, _r as asDesignBoundaryId, at as parseAspectRatioValue, b as getSiteCommandMetadata, bt as mediaTypeDiscriminants, ct as getDirectImageUrlForSiteScopedPath, fr as asAppearancePresetId, gr as asDesignBlockId, h as parseAndPlanCommandBatchForTypes, k as headerPreferencesSchema, kr as createContentEntryRef, kt as getExtensionForMimeType, l as resolvePageUpsertSeo, m as createDryRunReport, n as sdkCourseBookingSettingsSchema, p as stableStringify, qn as asFooterLookId, r as sdkEventOccurrenceInputSchema, rr as SYSTEM_BLOCK_KINDS, s as eventVisibilitySchema, v as evaluateSiteCommandBatchExposure, vt as PUBLIC_FILE_FIELD_KINDS, w as entryIdentifierForCommand, wr as bookingQuestionAttachmentSchema, xn as require_dist, xr as asPageFlowPresetId, y as evaluateSiteCommandExposure, yt as isDisplayMediaKind, zr as slugPart } from "./sdk-event-upsert-Y4Iyx0N4.mjs";
|
|
3
|
+
import { $t as clampConfiguredAmount, An as unsafeAsNonNegativeCents, Bn as parseCustomerId, Cr as unsafeAsEventOfferingId, Ct as formatDate, D as isPublicReadEndpoint, Dn as parsePositiveCents, Dr as err, E as getPublicReadCachePolicy, En as parseNonNegativeCents, Er as unsafeAsPricingOptionId, Ft as formatLocalScheduleDate, Gn as parseDatedOfferingCapacityHoldAuditRef, Hn as parseMembershipId, I as createSecret, Jt as toUtcIsoDateTimeString, Kn as parseDatedOfferingCapacityHoldId, L as exposeSecret, Mn as formatCurrencyAmount, Nn as parseCurrencyCode, Nt as addLocalScheduleDays, O as publicReadBatchFreshnessSeconds, On as toCents, Or as ok, Pn as assertNever, Qt as addIntervalPreservingMonthAnchor, R as parseManagementKey, Rn as unsafeAsAppointmentResourceId, Rt as getLocalScheduleDate, S as SURFACE_EVENT_PRESET_VALUES, Sn as fromArray, Sr as unsafeAsEventInstanceId, T as PUBLIC_CONTENT_FRESHNESS_SECONDS, Tn as isNonNegativeWholeCents$1, Tr as unsafeAsOccurrenceId, Vt as parseBookingLocalDate, Wn as unsafeAsPassId, Wt as resolveBookingTimeZoneId, X as parseFooterCompositionV1, Xt as validateBookingPaymentOptionKinds, Y as parseMailingListProviderScope, Zt as isLiveOrderInstalmentPlanStatus, _ as parseVerticalPresetId, _t as publicLocationSchema, an as businessCancellationRefusalCodes, b as EVENT_PRESET_VALUES, br as parseRetiredCourseId, bt as trimmedStringOrNull, cn as resolveFlexibleBalanceInitialPaymentCents, cr as unsafeAsCheckoutLineId, d as resolveEventCatalogue, dr as parseEditorSessionGeneration, en as getBookingInstalmentDepositRefundability, f as withBookingModulesForSelectionChange, fr as parsePageId, g as parseVerticalId, gr as parseUserId, h as canonicalizeConfiguredBookingVerticalConfig, hr as parseSiteId, in as splitAmountWithRemainderInFirst, jn as unsafeAsPositiveCents, k as publicReadFreshnessSeconds, kn as toNonNegativeCents, lr as unsafeAsOrderFlexibleBalanceContractId, m as areConfiguredBookingVerticalConfigsEqual, mr as parseApiKeyId, n as OFFLINE_PAYMENT_METHODS, o as STAFF_OPERATIONAL_CAPABILITIES, on as scheduleBookingReasonCodes, ot as assertAllowedPublicUrl, pt as locationValueSchema, r as committedWriteProofSchema, rn as omitZeroAmountFutureRows, sn as resolveFlexibleBalanceDueAt, u as planTurningOnCourses, ur as unsafeAsOrderPaymentPlanId, ut as stableJsonStringify, v as resolveSiteVerticalBookingConfig, w as PUBLIC_AVAILABILITY_FRESHNESS_SECONDS, wr as unsafeAsEventSeriesId, y as DEFAULT_EVENT_TYPE_PRESETS, yr as parseEventSeriesId, zn as unsafeAsStaffMemberId } from "./src-90EK8rKq.mjs";
|
|
4
|
+
import { n as CliSdkPeerError, t as loadConfigFile } from "./load-config-CexajivS.mjs";
|
|
6
5
|
import { safeParse, z } from "zod";
|
|
6
|
+
import { Argument, Command, Option } from "commander";
|
|
7
7
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
8
8
|
import * as fs$1 from "fs/promises";
|
|
9
9
|
import * as path$1 from "path";
|
|
@@ -470,7 +470,7 @@ const retentionPolicyRegistry = {
|
|
|
470
470
|
kind: "documented_manual",
|
|
471
471
|
deferredReason: "depends_on_controller_specific_review"
|
|
472
472
|
},
|
|
473
|
-
rationale: "Ticket summaries and replies are retained for ongoing support and accountability; deleting the account removes the ticket thread."
|
|
473
|
+
rationale: "Ticket summaries and replies are retained for ongoing support and accountability; deleting the account removes the ticket thread. A ticket that came by email has no account, so it stays until removed through a data request."
|
|
474
474
|
},
|
|
475
475
|
email_audit_body: {
|
|
476
476
|
dataClass: "email_audit_body",
|
|
@@ -1603,16 +1603,23 @@ function buildPublicReadFetchTags(endpoint, params) {
|
|
|
1603
1603
|
function buildPublicReadMemoryCacheTags(endpoint, params) {
|
|
1604
1604
|
return getPublicReadCachePolicy(endpoint).kind === "live" ? [] : buildPublicReadFetchTags(endpoint, params);
|
|
1605
1605
|
}
|
|
1606
|
-
|
|
1607
|
-
function buildPublicReadFetchPolicy(siteId, reads) {
|
|
1606
|
+
function buildFetchPolicy(siteId, reads, freshnessSeconds) {
|
|
1608
1607
|
return {
|
|
1609
1608
|
tags: normalizeRevalidateTags(reads.flatMap(({ endpoint, params }) => isPublicReadEndpoint(endpoint) ? buildPublicReadFetchTags(endpoint, {
|
|
1610
1609
|
...params,
|
|
1611
1610
|
siteId
|
|
1612
1611
|
}) : buildCacheReadTags([], { siteId }))),
|
|
1613
|
-
revalidate: Math.min(PUBLIC_CONTENT_FRESHNESS_SECONDS, ...reads.map(({ endpoint }) => isPublicReadEndpoint(endpoint) ?
|
|
1612
|
+
revalidate: Math.min(PUBLIC_CONTENT_FRESHNESS_SECONDS, ...reads.map(({ endpoint }) => isPublicReadEndpoint(endpoint) ? freshnessSeconds(endpoint) : PUBLIC_AVAILABILITY_FRESHNESS_SECONDS))
|
|
1614
1613
|
};
|
|
1615
1614
|
}
|
|
1615
|
+
/** A direct GET passes through the CDN, so what it stores keeps the short budget. */
|
|
1616
|
+
function buildPublicReadFetchPolicy(siteId, reads) {
|
|
1617
|
+
return buildFetchPolicy(siteId, reads, publicReadFreshnessSeconds);
|
|
1618
|
+
}
|
|
1619
|
+
/** A transport batch inherits every dependency and its shortest freshness budget. */
|
|
1620
|
+
function buildPublicReadBatchFetchPolicy(siteId, reads) {
|
|
1621
|
+
return buildFetchPolicy(siteId, reads, publicReadBatchFreshnessSeconds);
|
|
1622
|
+
}
|
|
1616
1623
|
|
|
1617
1624
|
//#endregion
|
|
1618
1625
|
//#region ../api/src/sdkEntryReadEndpoints.ts
|
|
@@ -2222,6 +2229,42 @@ const APPOINTMENT_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
|
|
|
2222
2229
|
"server:internal_error"
|
|
2223
2230
|
]
|
|
2224
2231
|
},
|
|
2232
|
+
updateOwnTrainerProfile: {
|
|
2233
|
+
path: "/sites/{siteId}/bookings/my-trainer-profile",
|
|
2234
|
+
method: "PUT",
|
|
2235
|
+
auth: "user",
|
|
2236
|
+
responseKind: "json",
|
|
2237
|
+
errors: [
|
|
2238
|
+
"validation:invalid_input",
|
|
2239
|
+
"auth:forbidden",
|
|
2240
|
+
"resource:not_found",
|
|
2241
|
+
"server:internal_error"
|
|
2242
|
+
]
|
|
2243
|
+
},
|
|
2244
|
+
createOwnTrainerPhotoUploadUrl: {
|
|
2245
|
+
path: "/sites/{siteId}/bookings/my-trainer-profile/photo/upload-url",
|
|
2246
|
+
method: "POST",
|
|
2247
|
+
tags: ["media"],
|
|
2248
|
+
auth: "user",
|
|
2249
|
+
responseKind: "json",
|
|
2250
|
+
errors: [
|
|
2251
|
+
"validation:invalid_input",
|
|
2252
|
+
"auth:forbidden",
|
|
2253
|
+
"server:internal_error"
|
|
2254
|
+
]
|
|
2255
|
+
},
|
|
2256
|
+
finalizeOwnTrainerPhotoUpload: {
|
|
2257
|
+
path: "/sites/{siteId}/bookings/my-trainer-profile/photo/finalize",
|
|
2258
|
+
method: "POST",
|
|
2259
|
+
tags: ["media"],
|
|
2260
|
+
auth: "user",
|
|
2261
|
+
responseKind: "json",
|
|
2262
|
+
errors: [
|
|
2263
|
+
"validation:invalid_input",
|
|
2264
|
+
"auth:forbidden",
|
|
2265
|
+
"server:internal_error"
|
|
2266
|
+
]
|
|
2267
|
+
},
|
|
2225
2268
|
createTeamMemberProfile: {
|
|
2226
2269
|
path: "/sites/{siteId}/bookings/resources/{resourceId}/profile",
|
|
2227
2270
|
method: "POST",
|
|
@@ -2503,6 +2546,13 @@ const APPOINTMENT_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
|
|
|
2503
2546
|
auth: "user",
|
|
2504
2547
|
responseKind: "json"
|
|
2505
2548
|
},
|
|
2549
|
+
makeAppointmentServiceStudio: {
|
|
2550
|
+
path: "/sites/{siteId}/bookings/services/{serviceId}/make-studio",
|
|
2551
|
+
method: "POST",
|
|
2552
|
+
auth: "user",
|
|
2553
|
+
responseKind: "json",
|
|
2554
|
+
errors: []
|
|
2555
|
+
},
|
|
2506
2556
|
listAvailabilityRules: {
|
|
2507
2557
|
path: "/sites/{siteId}/bookings/resources/{resourceId}/availability",
|
|
2508
2558
|
method: "GET",
|
|
@@ -2858,6 +2908,18 @@ const EVENT_SERIES_REGISTRATION_ENDPOINT_DEFINITIONS = defineEndpointDefinitions
|
|
|
2858
2908
|
"server:internal_error"
|
|
2859
2909
|
]
|
|
2860
2910
|
},
|
|
2911
|
+
findTransferRecipient: {
|
|
2912
|
+
path: "/sites/{siteId}/bookings/transfer-recipient",
|
|
2913
|
+
method: "POST",
|
|
2914
|
+
auth: "user",
|
|
2915
|
+
responseKind: "json",
|
|
2916
|
+
demoMutation: DEMO_MUTATION_ALLOWED,
|
|
2917
|
+
errors: [
|
|
2918
|
+
"validation:invalid_input",
|
|
2919
|
+
"auth:forbidden",
|
|
2920
|
+
"server:internal_error"
|
|
2921
|
+
]
|
|
2922
|
+
},
|
|
2861
2923
|
correctBookingCheckIn: {
|
|
2862
2924
|
path: "/sites/{siteId}/bookings/attendees/{attendeeId}/check-in",
|
|
2863
2925
|
method: "PATCH",
|
|
@@ -5707,8 +5769,8 @@ function refundAmountOutcome(input, requestedAmountCents) {
|
|
|
5707
5769
|
|
|
5708
5770
|
//#endregion
|
|
5709
5771
|
//#region ../commerce/src/purchase/confirmationPaymentSchema.ts
|
|
5710
|
-
const settledBalanceSchema = z.
|
|
5711
|
-
const dueBalanceSchema = z.
|
|
5772
|
+
const settledBalanceSchema = z.object({ kind: z.literal("settled") });
|
|
5773
|
+
const dueBalanceSchema = z.object({
|
|
5712
5774
|
kind: z.literal("due"),
|
|
5713
5775
|
amountCents: z.number().int().positive().transform((value, ctx) => {
|
|
5714
5776
|
const cents$2 = parsePositiveCents(value);
|
|
@@ -5727,37 +5789,50 @@ const moneyFields = {
|
|
|
5727
5789
|
amountPaidCents: z.number().int().nonnegative().transform(toNonNegativeCents),
|
|
5728
5790
|
currency: currencySchema
|
|
5729
5791
|
};
|
|
5792
|
+
const discountFields = { discount: z.object({
|
|
5793
|
+
code: z.string().min(1),
|
|
5794
|
+
savingCents: z.number().int().positive(),
|
|
5795
|
+
currency: currencySchema
|
|
5796
|
+
}).optional() };
|
|
5730
5797
|
const confirmationPaymentSchema = z.discriminatedUnion("kind", [
|
|
5731
|
-
z.
|
|
5798
|
+
z.object({
|
|
5799
|
+
...discountFields,
|
|
5732
5800
|
kind: z.literal("free"),
|
|
5733
5801
|
balance: settledBalanceSchema
|
|
5734
5802
|
}),
|
|
5735
|
-
z.
|
|
5803
|
+
z.object({
|
|
5804
|
+
...discountFields,
|
|
5736
5805
|
kind: z.literal("waived"),
|
|
5737
5806
|
balance: settledBalanceSchema
|
|
5738
5807
|
}),
|
|
5739
|
-
z.
|
|
5808
|
+
z.object({
|
|
5809
|
+
...discountFields,
|
|
5740
5810
|
kind: z.literal("pass"),
|
|
5741
5811
|
passName: z.string().nullable(),
|
|
5742
5812
|
passCreditsUsed: z.number().int().positive().nullable(),
|
|
5813
|
+
passCreditsRemaining: z.number().int().nonnegative().optional(),
|
|
5743
5814
|
balance: settledBalanceSchema
|
|
5744
5815
|
}),
|
|
5745
|
-
z.
|
|
5816
|
+
z.object({
|
|
5817
|
+
...discountFields,
|
|
5746
5818
|
kind: z.literal("membership"),
|
|
5747
5819
|
membershipName: z.string().nullable(),
|
|
5748
5820
|
balance: settledBalanceSchema
|
|
5749
5821
|
}),
|
|
5750
|
-
z.
|
|
5822
|
+
z.object({
|
|
5823
|
+
...discountFields,
|
|
5751
5824
|
kind: z.literal("manual_due"),
|
|
5752
5825
|
currency: currencySchema,
|
|
5753
5826
|
balance: dueBalanceSchema
|
|
5754
5827
|
}),
|
|
5755
|
-
z.
|
|
5828
|
+
z.object({
|
|
5829
|
+
...discountFields,
|
|
5756
5830
|
kind: z.literal("managed_balance_due"),
|
|
5757
5831
|
...moneyFields,
|
|
5758
5832
|
balance: dueBalanceSchema
|
|
5759
5833
|
}),
|
|
5760
|
-
z.
|
|
5834
|
+
z.object({
|
|
5835
|
+
...discountFields,
|
|
5761
5836
|
kind: z.literal("monetary"),
|
|
5762
5837
|
...moneyFields,
|
|
5763
5838
|
paymentMethod: z.enum([
|
|
@@ -5953,6 +6028,7 @@ function buildConfirmationPaymentCandidate(input) {
|
|
|
5953
6028
|
kind: "pass",
|
|
5954
6029
|
passName: input.passName ?? null,
|
|
5955
6030
|
passCreditsUsed: input.passCreditsUsed ?? null,
|
|
6031
|
+
...input.passCreditsRemaining !== undefined ? { passCreditsRemaining: input.passCreditsRemaining } : {},
|
|
5956
6032
|
balance: { kind: "settled" }
|
|
5957
6033
|
});
|
|
5958
6034
|
case "membership": return ok({
|
|
@@ -5984,7 +6060,8 @@ function buildNonMonetaryConfirmationEmailPaymentSummary(options) {
|
|
|
5984
6060
|
case "pass": return {
|
|
5985
6061
|
kind: "pass",
|
|
5986
6062
|
passName: options.passName,
|
|
5987
|
-
passCreditsUsed: options.passCreditsUsed
|
|
6063
|
+
passCreditsUsed: options.passCreditsUsed,
|
|
6064
|
+
...options.passCreditsRemaining !== undefined ? { passCreditsRemaining: options.passCreditsRemaining } : {}
|
|
5988
6065
|
};
|
|
5989
6066
|
case "membership": return {
|
|
5990
6067
|
kind: "membership",
|
|
@@ -6006,13 +6083,20 @@ function buildMonetaryConfirmationEmailPaymentSummary(options) {
|
|
|
6006
6083
|
}
|
|
6007
6084
|
/** Email copy projection; this function never decides settlement. */
|
|
6008
6085
|
function toConfirmationEmailPaymentSummary(payment) {
|
|
6086
|
+
return {
|
|
6087
|
+
...projectConfirmationEmailPaymentSummary(payment),
|
|
6088
|
+
...payment.discount ? { discount: payment.discount } : {}
|
|
6089
|
+
};
|
|
6090
|
+
}
|
|
6091
|
+
function projectConfirmationEmailPaymentSummary(payment) {
|
|
6009
6092
|
switch (payment.kind) {
|
|
6010
6093
|
case "free": return { kind: "free" };
|
|
6011
6094
|
case "waived": return { kind: "waived" };
|
|
6012
6095
|
case "pass": return {
|
|
6013
6096
|
kind: "pass",
|
|
6014
6097
|
passName: payment.passName ?? undefined,
|
|
6015
|
-
passCreditsUsed: payment.passCreditsUsed ?? undefined
|
|
6098
|
+
passCreditsUsed: payment.passCreditsUsed ?? undefined,
|
|
6099
|
+
...payment.passCreditsRemaining !== undefined ? { passCreditsRemaining: payment.passCreditsRemaining } : {}
|
|
6016
6100
|
};
|
|
6017
6101
|
case "membership": return {
|
|
6018
6102
|
kind: "membership",
|
|
@@ -6657,26 +6741,14 @@ function planPassItem(item, input) {
|
|
|
6657
6741
|
} : noActions();
|
|
6658
6742
|
}
|
|
6659
6743
|
function planMembershipItem(item, input) {
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
};
|
|
6669
|
-
const facts = input.bookingFacts.get(item.eventAttendeeId);
|
|
6670
|
-
return facts ? {
|
|
6671
|
-
warnings: [],
|
|
6672
|
-
actions: [{
|
|
6673
|
-
kind: "send_membership_bundle_confirmation",
|
|
6674
|
-
facts,
|
|
6675
|
-
metadata: item.metadata
|
|
6676
|
-
}]
|
|
6677
|
-
} : noActions();
|
|
6678
|
-
}
|
|
6679
|
-
if (!item.customerMembershipId) return {
|
|
6744
|
+
const activation = item.customerMembershipId ? {
|
|
6745
|
+
warnings: [],
|
|
6746
|
+
actions: [{
|
|
6747
|
+
kind: "send_membership_activation",
|
|
6748
|
+
customerMembershipId: item.customerMembershipId,
|
|
6749
|
+
amountPaidCents: settledOrderItemTotalCents(item)
|
|
6750
|
+
}]
|
|
6751
|
+
} : {
|
|
6680
6752
|
actions: [],
|
|
6681
6753
|
warnings: [{
|
|
6682
6754
|
kind: "missing_customer_membership_id",
|
|
@@ -6684,14 +6756,24 @@ function planMembershipItem(item, input) {
|
|
|
6684
6756
|
orderItemId: item.id
|
|
6685
6757
|
}]
|
|
6686
6758
|
};
|
|
6687
|
-
return
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6759
|
+
if (!hasMembershipBundleFulfillment(item.metadata)) return activation;
|
|
6760
|
+
if (!item.eventAttendeeId) return {
|
|
6761
|
+
...activation,
|
|
6762
|
+
warnings: [...activation.warnings, {
|
|
6763
|
+
kind: "missing_event_attendee_id",
|
|
6764
|
+
orderId: item.orderId,
|
|
6765
|
+
orderItemId: item.id
|
|
6693
6766
|
}]
|
|
6694
6767
|
};
|
|
6768
|
+
const facts = input.bookingFacts.get(item.eventAttendeeId);
|
|
6769
|
+
return facts ? {
|
|
6770
|
+
...activation,
|
|
6771
|
+
actions: [...activation.actions, {
|
|
6772
|
+
kind: "send_membership_bundle_confirmation",
|
|
6773
|
+
facts,
|
|
6774
|
+
metadata: item.metadata
|
|
6775
|
+
}]
|
|
6776
|
+
} : activation;
|
|
6695
6777
|
}
|
|
6696
6778
|
function planItem(item, input) {
|
|
6697
6779
|
switch (item.kind) {
|
|
@@ -8625,10 +8707,14 @@ function discountCodeAppliesTo(code, scopes, context, now) {
|
|
|
8625
8707
|
membership: code.appliesToMemberships,
|
|
8626
8708
|
product: code.appliesToProducts
|
|
8627
8709
|
}[context.type];
|
|
8628
|
-
return enabled &&
|
|
8710
|
+
return enabled && discountCodeAvailabilityMessage(code, now) === null && matchesDiscountContext(code, scopes, context);
|
|
8629
8711
|
}
|
|
8630
|
-
|
|
8631
|
-
|
|
8712
|
+
/** Public refusal wording also owns the lifecycle check used by applicability. */
|
|
8713
|
+
function discountCodeAvailabilityMessage(code, now) {
|
|
8714
|
+
if (!code.isActive) return "We don't recognise that code.";
|
|
8715
|
+
if (code.startsAt !== null && code.startsAt > now) return "This code isn't active yet.";
|
|
8716
|
+
if (code.endsAt !== null && code.endsAt < now) return "This code has ended.";
|
|
8717
|
+
return null;
|
|
8632
8718
|
}
|
|
8633
8719
|
function matchesDiscountContext(code, scopes, context) {
|
|
8634
8720
|
switch (context.type) {
|
|
@@ -9517,22 +9603,27 @@ function describeOrderPayment(position, audience, format) {
|
|
|
9517
9603
|
|
|
9518
9604
|
//#endregion
|
|
9519
9605
|
//#region ../site-contracts/src/siteData/eventCheckout.ts
|
|
9606
|
+
/**
|
|
9607
|
+
* What a browser or SDK decodes. Unknown fields are ignored, so the server can add a
|
|
9608
|
+
* field without breaking bundles already deployed. Bundles up to sdk-v0.169.1 were
|
|
9609
|
+
* strict: eventBookingResponseForClient keeps their responses to the shape they know.
|
|
9610
|
+
*/
|
|
9520
9611
|
const uuid = z.string().uuid();
|
|
9521
9612
|
const eventRegistrationStatusReferenceSchema = z.discriminatedUnion("scope", [z.object({
|
|
9522
9613
|
scope: z.literal("occurrence"),
|
|
9523
9614
|
attendeeId: uuid
|
|
9524
|
-
})
|
|
9615
|
+
}), z.object({
|
|
9525
9616
|
scope: z.literal("wholeSeries"),
|
|
9526
9617
|
registrationId: uuid
|
|
9527
|
-
})
|
|
9618
|
+
})]);
|
|
9528
9619
|
const eventRegistrationPaymentSubjectSchema = z.discriminatedUnion("scope", [z.object({
|
|
9529
9620
|
scope: z.literal("occurrence"),
|
|
9530
9621
|
submissionId: uuid,
|
|
9531
9622
|
attendeeId: uuid
|
|
9532
|
-
})
|
|
9623
|
+
}), z.object({
|
|
9533
9624
|
scope: z.literal("wholeSeries"),
|
|
9534
9625
|
submissionId: uuid
|
|
9535
|
-
})
|
|
9626
|
+
})]);
|
|
9536
9627
|
const identityFields = {
|
|
9537
9628
|
submissionId: uuid,
|
|
9538
9629
|
seriesId: uuid,
|
|
@@ -9543,15 +9634,15 @@ const confirmedBookingIdentitySchema = z.discriminatedUnion("scope", [z.object({
|
|
|
9543
9634
|
attendeeId: uuid,
|
|
9544
9635
|
occurrenceId: uuid,
|
|
9545
9636
|
...identityFields
|
|
9546
|
-
})
|
|
9637
|
+
}), z.object({
|
|
9547
9638
|
scope: z.literal("wholeSeries"),
|
|
9548
9639
|
registrationId: uuid,
|
|
9549
9640
|
...identityFields
|
|
9550
|
-
})
|
|
9641
|
+
})]);
|
|
9551
9642
|
const bookedTicketLineSchema = z.object({
|
|
9552
9643
|
label: z.string().min(1),
|
|
9553
9644
|
quantity: z.number().int().positive()
|
|
9554
|
-
})
|
|
9645
|
+
});
|
|
9555
9646
|
const arrivalFields = { arrivalVenues: z.record(uuid, z.string()).optional() };
|
|
9556
9647
|
const eventBookingOutcomeSchema = z.discriminatedUnion("kind", [z.object({
|
|
9557
9648
|
kind: z.literal("detailsAvailable"),
|
|
@@ -9559,16 +9650,16 @@ const eventBookingOutcomeSchema = z.discriminatedUnion("kind", [z.object({
|
|
|
9559
9650
|
ticketLines: z.tuple([bookedTicketLineSchema]).rest(bookedTicketLineSchema).readonly(),
|
|
9560
9651
|
payment: confirmationPaymentSchema,
|
|
9561
9652
|
...arrivalFields
|
|
9562
|
-
})
|
|
9653
|
+
}), z.object({
|
|
9563
9654
|
kind: z.literal("detailsUnavailable"),
|
|
9564
9655
|
identity: confirmedBookingIdentitySchema,
|
|
9565
9656
|
...arrivalFields
|
|
9566
|
-
})
|
|
9657
|
+
})]);
|
|
9567
9658
|
const priceReductionSummarySchema = z.object({
|
|
9568
9659
|
kind: z.enum(["discount_code", "combination_price"]),
|
|
9569
9660
|
label: z.string(),
|
|
9570
9661
|
amountCents: z.number().int().nonnegative()
|
|
9571
|
-
})
|
|
9662
|
+
});
|
|
9572
9663
|
const eventEmbeddedCheckoutSchema = z.object({
|
|
9573
9664
|
priceReductions: z.tuple([priceReductionSummarySchema]).rest(priceReductionSummarySchema).readonly().optional(),
|
|
9574
9665
|
kind: z.literal("embedded"),
|
|
@@ -9580,11 +9671,11 @@ const eventEmbeddedCheckoutSchema = z.object({
|
|
|
9580
9671
|
kind: z.literal("connect"),
|
|
9581
9672
|
publishableKey: z.string().min(1),
|
|
9582
9673
|
accountId: z.string().min(1)
|
|
9583
|
-
})
|
|
9674
|
+
}), z.object({
|
|
9584
9675
|
kind: z.literal("direct"),
|
|
9585
9676
|
publishableKey: z.string().min(1)
|
|
9586
|
-
})
|
|
9587
|
-
})
|
|
9677
|
+
})])
|
|
9678
|
+
});
|
|
9588
9679
|
const decorations = {
|
|
9589
9680
|
mailingListSignupNote: z.enum(["confirmation_required", "not_confirmed"]).optional(),
|
|
9590
9681
|
demoBookingPass: z.string().optional()
|
|
@@ -9592,7 +9683,7 @@ const decorations = {
|
|
|
9592
9683
|
const eventRegistrationSummarySchema = z.object({
|
|
9593
9684
|
message: z.string(),
|
|
9594
9685
|
passCreditsRemaining: z.number().int().nonnegative().optional()
|
|
9595
|
-
})
|
|
9686
|
+
});
|
|
9596
9687
|
const bookingOutcomesSchema = z.tuple([eventBookingOutcomeSchema]).rest(eventBookingOutcomeSchema).readonly().refine((outcomes) => outcomes.length <= MAX_EVENT_BOOKING_SELECTION_ITEMS, "Too many booking outcomes");
|
|
9597
9688
|
const bookingReferencesSchema = z.tuple([eventRegistrationStatusReferenceSchema]).rest(eventRegistrationStatusReferenceSchema).readonly().refine((references) => references.length <= MAX_EVENT_BOOKING_SELECTION_ITEMS, "Too many booking references");
|
|
9598
9689
|
const registrationIdsSchema = z.tuple([uuid]).rest(uuid).readonly().refine((ids) => ids.length <= MAX_EVENT_BOOKING_SELECTION_ITEMS, "Too many registrations");
|
|
@@ -9603,7 +9694,7 @@ const eventRegisterResponseSchema = z.discriminatedUnion("kind", [
|
|
|
9603
9694
|
outcomes: bookingOutcomesSchema.optional(),
|
|
9604
9695
|
summary: eventRegistrationSummarySchema,
|
|
9605
9696
|
...decorations
|
|
9606
|
-
})
|
|
9697
|
+
}),
|
|
9607
9698
|
z.object({
|
|
9608
9699
|
kind: z.literal("checkoutRequired"),
|
|
9609
9700
|
reference: eventRegistrationStatusReferenceSchema,
|
|
@@ -9611,28 +9702,28 @@ const eventRegisterResponseSchema = z.discriminatedUnion("kind", [
|
|
|
9611
9702
|
checkout: eventEmbeddedCheckoutSchema,
|
|
9612
9703
|
submissionId: uuid,
|
|
9613
9704
|
...decorations
|
|
9614
|
-
})
|
|
9705
|
+
}),
|
|
9615
9706
|
z.object({
|
|
9616
9707
|
kind: z.literal("paymentStatusRequired"),
|
|
9617
9708
|
subject: eventRegistrationPaymentSubjectSchema,
|
|
9618
9709
|
...decorations
|
|
9619
|
-
})
|
|
9710
|
+
}),
|
|
9620
9711
|
z.object({
|
|
9621
9712
|
kind: z.literal("waitlisted"),
|
|
9622
9713
|
waitlist: z.object({
|
|
9623
9714
|
reference: z.union([z.object({
|
|
9624
9715
|
scope: z.literal("occurrence"),
|
|
9625
9716
|
attendeeId: uuid
|
|
9626
|
-
})
|
|
9717
|
+
}), z.object({
|
|
9627
9718
|
scope: z.enum(["occurrence", "wholeSeries"]),
|
|
9628
9719
|
waitlistEntryId: uuid
|
|
9629
|
-
})
|
|
9720
|
+
})]),
|
|
9630
9721
|
position: z.number().int().nonnegative().nullable(),
|
|
9631
9722
|
message: z.string(),
|
|
9632
9723
|
emailFollowupMessage: z.string().optional()
|
|
9633
|
-
})
|
|
9724
|
+
}),
|
|
9634
9725
|
...decorations
|
|
9635
|
-
})
|
|
9726
|
+
})
|
|
9636
9727
|
]).superRefine((response, ctx) => {
|
|
9637
9728
|
if (response.kind === "bookingComplete") validateOutcomeList(response, ctx);
|
|
9638
9729
|
if (response.kind === "checkoutRequired") validateReferenceList(response, ctx);
|
|
@@ -9642,37 +9733,37 @@ const checkoutStatusArms = [
|
|
|
9642
9733
|
kind: z.literal("resolved"),
|
|
9643
9734
|
outcome: eventBookingOutcomeSchema,
|
|
9644
9735
|
outcomes: bookingOutcomesSchema.optional()
|
|
9645
|
-
}).
|
|
9646
|
-
z.object({ kind: z.literal("abandoned") })
|
|
9647
|
-
z.object({ kind: z.literal("reconciliationRequired") })
|
|
9736
|
+
}).superRefine(validateOutcomeList),
|
|
9737
|
+
z.object({ kind: z.literal("abandoned") }),
|
|
9738
|
+
z.object({ kind: z.literal("reconciliationRequired") }),
|
|
9648
9739
|
z.object({
|
|
9649
9740
|
kind: z.literal("paymentProcessing"),
|
|
9650
9741
|
recoverableUntil: z.string().optional()
|
|
9651
|
-
})
|
|
9742
|
+
}),
|
|
9652
9743
|
z.object({
|
|
9653
9744
|
kind: z.literal("paymentAvailable"),
|
|
9654
9745
|
references: bookingReferencesSchema.optional(),
|
|
9655
9746
|
checkout: eventEmbeddedCheckoutSchema,
|
|
9656
9747
|
recoverableUntil: z.string().optional()
|
|
9657
|
-
})
|
|
9748
|
+
}),
|
|
9658
9749
|
z.object({
|
|
9659
9750
|
kind: z.literal("paymentRetryAvailable"),
|
|
9660
9751
|
place: z.enum(["held", "released"])
|
|
9661
|
-
})
|
|
9752
|
+
}),
|
|
9662
9753
|
z.object({
|
|
9663
9754
|
kind: z.literal("paymentCheckUnavailable"),
|
|
9664
9755
|
recoverableUntil: z.string().optional()
|
|
9665
|
-
})
|
|
9666
|
-
z.object({ kind: z.literal("paymentAssistanceRequired") })
|
|
9756
|
+
}),
|
|
9757
|
+
z.object({ kind: z.literal("paymentAssistanceRequired") })
|
|
9667
9758
|
];
|
|
9668
9759
|
const eventCheckoutReturnResponseSchema = z.discriminatedUnion("kind", [
|
|
9669
9760
|
z.object({
|
|
9670
9761
|
kind: z.literal("checkout"),
|
|
9671
9762
|
subject: eventRegistrationPaymentSubjectSchema,
|
|
9672
9763
|
outcome: z.discriminatedUnion("kind", checkoutStatusArms)
|
|
9673
|
-
})
|
|
9674
|
-
z.object({ kind: z.literal("notFound") })
|
|
9675
|
-
z.object({ kind: z.literal("reconciliationRequired") })
|
|
9764
|
+
}),
|
|
9765
|
+
z.object({ kind: z.literal("notFound") }),
|
|
9766
|
+
z.object({ kind: z.literal("reconciliationRequired") })
|
|
9676
9767
|
]).superRefine((response, ctx) => {
|
|
9677
9768
|
if (response.kind !== "checkout" || response.outcome.kind !== "resolved") return;
|
|
9678
9769
|
if (!identityMatchesSubject(response.outcome.outcome.identity, response.subject)) {
|
|
@@ -9690,21 +9781,21 @@ const eventCheckoutResponseSchema = z.union([
|
|
|
9690
9781
|
scope: z.literal("occurrence"),
|
|
9691
9782
|
outcome: eventBookingOutcomeSchema,
|
|
9692
9783
|
...checkoutDecorations
|
|
9693
|
-
})
|
|
9784
|
+
}),
|
|
9694
9785
|
z.object({
|
|
9695
9786
|
kind: z.literal("completed"),
|
|
9696
9787
|
scope: z.literal("wholeSeries"),
|
|
9697
9788
|
outcome: eventBookingOutcomeSchema,
|
|
9698
9789
|
outcomes: bookingOutcomesSchema.optional(),
|
|
9699
9790
|
...checkoutDecorations
|
|
9700
|
-
})
|
|
9791
|
+
}),
|
|
9701
9792
|
z.object({
|
|
9702
9793
|
kind: z.literal("checkoutRequired"),
|
|
9703
9794
|
scope: z.literal("occurrence"),
|
|
9704
9795
|
attendeeId: uuid,
|
|
9705
9796
|
checkout: eventEmbeddedCheckoutSchema,
|
|
9706
9797
|
...checkoutDecorations
|
|
9707
|
-
})
|
|
9798
|
+
}),
|
|
9708
9799
|
z.object({
|
|
9709
9800
|
kind: z.literal("checkoutRequired"),
|
|
9710
9801
|
scope: z.literal("wholeSeries"),
|
|
@@ -9714,14 +9805,14 @@ const eventCheckoutResponseSchema = z.union([
|
|
|
9714
9805
|
checkout: eventEmbeddedCheckoutSchema,
|
|
9715
9806
|
recoverableUntil: z.string().optional(),
|
|
9716
9807
|
...checkoutDecorations
|
|
9717
|
-
})
|
|
9808
|
+
}),
|
|
9718
9809
|
z.object({
|
|
9719
9810
|
scope: z.literal("wholeSeries"),
|
|
9720
9811
|
status: z.literal("paymentStatusRequired"),
|
|
9721
9812
|
checkoutAttemptId: uuid,
|
|
9722
9813
|
recoverableUntil: z.string().optional(),
|
|
9723
9814
|
...checkoutDecorations
|
|
9724
|
-
})
|
|
9815
|
+
}),
|
|
9725
9816
|
z.object({
|
|
9726
9817
|
scope: z.literal("wholeSeries"),
|
|
9727
9818
|
status: z.literal("waitlist"),
|
|
@@ -9729,7 +9820,7 @@ const eventCheckoutResponseSchema = z.union([
|
|
|
9729
9820
|
waitlistPosition: z.number().int().nonnegative().nullable(),
|
|
9730
9821
|
alreadyRegistered: z.boolean().optional(),
|
|
9731
9822
|
...checkoutDecorations
|
|
9732
|
-
})
|
|
9823
|
+
})
|
|
9733
9824
|
]).superRefine((response, ctx) => {
|
|
9734
9825
|
if (!("kind" in response)) return;
|
|
9735
9826
|
if (response.kind === "completed") {
|
|
@@ -11297,12 +11388,37 @@ const BOOKING_PEOPLE_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
|
|
|
11297
11388
|
"server:internal_error"
|
|
11298
11389
|
]
|
|
11299
11390
|
},
|
|
11391
|
+
exportPersonDataReadable: {
|
|
11392
|
+
path: "/sites/{siteId}/bookings/people/{personId}/export.html",
|
|
11393
|
+
method: "GET",
|
|
11394
|
+
auth: "user",
|
|
11395
|
+
responseKind: "blob",
|
|
11396
|
+
tags: ["site-{siteId}", "customers-{siteId}"],
|
|
11397
|
+
errors: [
|
|
11398
|
+
"auth:forbidden",
|
|
11399
|
+
"resource:not_found",
|
|
11400
|
+
"server:internal_error"
|
|
11401
|
+
]
|
|
11402
|
+
},
|
|
11300
11403
|
lookupBookingPersonByEmail: {
|
|
11301
11404
|
path: "/sites/{siteId}/bookings/people/lookup-email",
|
|
11302
11405
|
method: "POST",
|
|
11303
11406
|
tags: ["site-{siteId}"],
|
|
11304
11407
|
auth: "user",
|
|
11305
11408
|
responseKind: "json",
|
|
11409
|
+
errors: [
|
|
11410
|
+
"auth:forbidden",
|
|
11411
|
+
"validation:invalid_input",
|
|
11412
|
+
"rate_limit:exceeded",
|
|
11413
|
+
"server:internal_error"
|
|
11414
|
+
]
|
|
11415
|
+
},
|
|
11416
|
+
addStaffClient: {
|
|
11417
|
+
path: "/sites/{siteId}/bookings/people/add-client",
|
|
11418
|
+
method: "POST",
|
|
11419
|
+
tags: ["site-{siteId}", "customers-{siteId}"],
|
|
11420
|
+
auth: "user",
|
|
11421
|
+
responseKind: "json",
|
|
11306
11422
|
errors: [
|
|
11307
11423
|
"auth:forbidden",
|
|
11308
11424
|
"validation:invalid_input",
|
|
@@ -11815,18 +11931,6 @@ const ENDPOINT_DEFINITIONS = {
|
|
|
11815
11931
|
"server:internal_error"
|
|
11816
11932
|
]
|
|
11817
11933
|
},
|
|
11818
|
-
turnOnCourses: {
|
|
11819
|
-
path: "/sites/{siteId}/bookings/settings/courses",
|
|
11820
|
-
method: "POST",
|
|
11821
|
-
tags: [TAG_TEMPLATES.site, TAG_TEMPLATES.siteBookingSettings],
|
|
11822
|
-
auth: "user",
|
|
11823
|
-
responseKind: "json",
|
|
11824
|
-
errors: [
|
|
11825
|
-
"auth:forbidden",
|
|
11826
|
-
"resource:conflict",
|
|
11827
|
-
"server:internal_error"
|
|
11828
|
-
]
|
|
11829
|
-
},
|
|
11830
11934
|
sendTestEmail: {
|
|
11831
11935
|
path: "/sites/{siteId}/settings/emails/test",
|
|
11832
11936
|
method: "POST",
|
|
@@ -13224,6 +13328,19 @@ const ENDPOINT_DEFINITIONS = {
|
|
|
13224
13328
|
],
|
|
13225
13329
|
responseKind: "json"
|
|
13226
13330
|
},
|
|
13331
|
+
accountUpdateName: {
|
|
13332
|
+
path: "/account/name",
|
|
13333
|
+
method: "POST",
|
|
13334
|
+
tags: ["account"],
|
|
13335
|
+
auth: "user",
|
|
13336
|
+
errors: [
|
|
13337
|
+
"auth:unauthenticated",
|
|
13338
|
+
"auth:forbidden",
|
|
13339
|
+
"validation:invalid_input",
|
|
13340
|
+
"server:internal_error"
|
|
13341
|
+
],
|
|
13342
|
+
responseKind: "json"
|
|
13343
|
+
},
|
|
13227
13344
|
accountDismissTwoStepPrompt: {
|
|
13228
13345
|
path: "/account/two-step-prompt/dismiss",
|
|
13229
13346
|
method: "POST",
|
|
@@ -15603,6 +15720,7 @@ const ENDPOINT_DEFINITIONS = {
|
|
|
15603
15720
|
responseKind: "json",
|
|
15604
15721
|
errors: [
|
|
15605
15722
|
"validation:invalid_input",
|
|
15723
|
+
"auth:forbidden",
|
|
15606
15724
|
"resource:already_exists",
|
|
15607
15725
|
"server:internal_error"
|
|
15608
15726
|
]
|
|
@@ -17207,7 +17325,7 @@ const BookingVerticalConfigSchema = z.object({
|
|
|
17207
17325
|
//#region ../api/src/sdkBookingVerticalSchemas.ts
|
|
17208
17326
|
const sdkConfiguredBookingVerticalConfigSchema = z.object({
|
|
17209
17327
|
verticalId: VerticalIdSchema,
|
|
17210
|
-
selectedPresetIds: z.
|
|
17328
|
+
selectedPresetIds: z.array(VerticalPresetIdSchema)
|
|
17211
17329
|
}).transform((config, context) => {
|
|
17212
17330
|
const canonical = canonicalizeConfiguredBookingVerticalConfig(config);
|
|
17213
17331
|
if (canonical.ok) return canonical.config;
|
|
@@ -17246,9 +17364,6 @@ const sdkVerticalConfigIssueSchema = z.discriminatedUnion("code", [
|
|
|
17246
17364
|
z.object({ code: z.literal("future_preset_selected") })
|
|
17247
17365
|
]);
|
|
17248
17366
|
const sdkBookingSettingsWarningSchema = z.discriminatedUnion("code", [z.object({
|
|
17249
|
-
code: z.literal("booking_module_disabled"),
|
|
17250
|
-
module: z.enum(["appointments", "events"])
|
|
17251
|
-
}), z.object({
|
|
17252
17367
|
code: z.literal("replaced_invalid_current_config"),
|
|
17253
17368
|
issues: z.array(sdkVerticalConfigIssueSchema)
|
|
17254
17369
|
})]);
|
|
@@ -17448,8 +17563,22 @@ const businessCancellationResultSchema = z.object({
|
|
|
17448
17563
|
]).optional()
|
|
17449
17564
|
})
|
|
17450
17565
|
});
|
|
17566
|
+
/** Whether attendees were told about a saved date change, as the dashboard reports it. */
|
|
17567
|
+
const dateNotificationKinds = [
|
|
17568
|
+
z.object({ kind: z.literal("not_applicable") }),
|
|
17569
|
+
z.object({ kind: z.literal("suppressed") }),
|
|
17570
|
+
z.object({ kind: z.literal("no_recipients") }),
|
|
17571
|
+
z.object({ kind: z.literal("submission_failed") }),
|
|
17572
|
+
z.object({
|
|
17573
|
+
kind: z.literal("submitted"),
|
|
17574
|
+
sent: z.number().int().nonnegative(),
|
|
17575
|
+
queued: z.number().int().nonnegative(),
|
|
17576
|
+
failed: z.number().int().nonnegative()
|
|
17577
|
+
})
|
|
17578
|
+
];
|
|
17451
17579
|
const sdkEventOccurrenceResponseSchema = z.object({
|
|
17452
17580
|
occurrence: sdkManagementEventOccurrenceSchema,
|
|
17581
|
+
notification: z.discriminatedUnion("kind", [...dateNotificationKinds]).optional(),
|
|
17453
17582
|
cancellationResult: businessCancellationResultSchema.optional(),
|
|
17454
17583
|
cancellationResults: z.array(businessCancellationResultSchema).optional()
|
|
17455
17584
|
});
|
|
@@ -17459,19 +17588,7 @@ const addedDateReceiptSchema = z.object({
|
|
|
17459
17588
|
details: z.enum(["completed", "failed"]),
|
|
17460
17589
|
cache: z.enum(["completed", "failed"]),
|
|
17461
17590
|
projection: z.enum(["available", "unavailable"]),
|
|
17462
|
-
notification: z.discriminatedUnion("kind", [
|
|
17463
|
-
z.object({ kind: z.literal("not_applicable") }),
|
|
17464
|
-
z.object({ kind: z.literal("suppressed") }),
|
|
17465
|
-
z.object({ kind: z.literal("not_attempted") }),
|
|
17466
|
-
z.object({ kind: z.literal("no_recipients") }),
|
|
17467
|
-
z.object({ kind: z.literal("submission_failed") }),
|
|
17468
|
-
z.object({
|
|
17469
|
-
kind: z.literal("submitted"),
|
|
17470
|
-
sent: z.number().int().nonnegative(),
|
|
17471
|
-
queued: z.number().int().nonnegative(),
|
|
17472
|
-
failed: z.number().int().nonnegative()
|
|
17473
|
-
})
|
|
17474
|
-
])
|
|
17591
|
+
notification: z.discriminatedUnion("kind", [...dateNotificationKinds, z.object({ kind: z.literal("not_attempted") })])
|
|
17475
17592
|
});
|
|
17476
17593
|
const sdkAddEventOccurrenceResponseSchema = z.union([sdkEventOccurrenceResponseSchema.extend({ commit: addedDateReceiptSchema.optional() }), z.object({
|
|
17477
17594
|
kind: z.literal("accepted_unavailable"),
|
|
@@ -17535,7 +17652,8 @@ const pageDesignBoundaryTreatmentSchema = z.discriminatedUnion("kind", [
|
|
|
17535
17652
|
"medium",
|
|
17536
17653
|
"large"
|
|
17537
17654
|
]),
|
|
17538
|
-
echo: z.literal(true).optional()
|
|
17655
|
+
echo: z.literal(true).optional(),
|
|
17656
|
+
bulge: z.literal(true).optional()
|
|
17539
17657
|
}).strict(),
|
|
17540
17658
|
z.object({
|
|
17541
17659
|
kind: z.literal("angle-edge"),
|
|
@@ -18313,6 +18431,19 @@ const BOOKING_SETTINGS_SECTION_LABELS = {
|
|
|
18313
18431
|
appointments: "Appointments",
|
|
18314
18432
|
messages: "Messages"
|
|
18315
18433
|
};
|
|
18434
|
+
/**
|
|
18435
|
+
* The settings tabs a site sees, in order. Events and Appointments only appear
|
|
18436
|
+
* while that module is on; the sidebar and the tab bar both read this.
|
|
18437
|
+
*/
|
|
18438
|
+
function visibleBookingSettingsSections(modules) {
|
|
18439
|
+
return [
|
|
18440
|
+
"basics",
|
|
18441
|
+
"payments",
|
|
18442
|
+
...modules.events ? ["events"] : [],
|
|
18443
|
+
...modules.appointments ? ["appointments"] : [],
|
|
18444
|
+
"messages"
|
|
18445
|
+
];
|
|
18446
|
+
}
|
|
18316
18447
|
const BOOKING_SETTINGS_SECTION_KEYS = {
|
|
18317
18448
|
basics: [
|
|
18318
18449
|
"modules",
|
|
@@ -18858,7 +18989,7 @@ function applyBookingSettingsSectionUpdate(settings, update) {
|
|
|
18858
18989
|
};
|
|
18859
18990
|
}
|
|
18860
18991
|
function applyBookingSettingsSectionUpdates(settings, updates) {
|
|
18861
|
-
return updates.reduce(applyBookingSettingsSectionUpdate, settings);
|
|
18992
|
+
return withBookingModulesForSelectionChange(settings, updates.reduce(applyBookingSettingsSectionUpdate, settings));
|
|
18862
18993
|
}
|
|
18863
18994
|
/** Normalize optional wire defaults once before projecting operational Event policy. */
|
|
18864
18995
|
function resolveBookingSettingsEventCatalogue(settings) {
|
|
@@ -21201,6 +21332,14 @@ function occurrenceListParams(options = {}) {
|
|
|
21201
21332
|
limit: options.limit === undefined ? undefined : String(options.limit)
|
|
21202
21333
|
}).filter((entry) => entry[1] !== undefined));
|
|
21203
21334
|
}
|
|
21335
|
+
function savedOccurrence(result) {
|
|
21336
|
+
return {
|
|
21337
|
+
...result.occurrence,
|
|
21338
|
+
...result.notification ? { notification: result.notification } : {},
|
|
21339
|
+
...result.cancellationResult ? { cancellationResult: result.cancellationResult } : {},
|
|
21340
|
+
...result.cancellationResults ? { cancellationResults: result.cancellationResults } : {}
|
|
21341
|
+
};
|
|
21342
|
+
}
|
|
21204
21343
|
function createEventOccurrenceOperations(http) {
|
|
21205
21344
|
return {
|
|
21206
21345
|
async list(eventIdentifier, runIdentifier, options) {
|
|
@@ -21215,11 +21354,11 @@ function createEventOccurrenceOperations(http) {
|
|
|
21215
21354
|
},
|
|
21216
21355
|
async update(eventIdentifier, runIdentifier, occurrenceId, input) {
|
|
21217
21356
|
const result = await http.patchValidated(occurrencePath(eventIdentifier, runIdentifier, occurrenceId), sdkEventOccurrenceResponseSchema, input);
|
|
21218
|
-
return result
|
|
21357
|
+
return savedOccurrence(result);
|
|
21219
21358
|
},
|
|
21220
21359
|
async cancel(eventIdentifier, runIdentifier, occurrenceId, options) {
|
|
21221
21360
|
const result = await http.postValidated(`${occurrencePath(eventIdentifier, runIdentifier, occurrenceId)}/cancel`, sdkEventOccurrenceResponseSchema, options?.notifyAttendees === undefined ? undefined : { notifyAttendees: options.notifyAttendees }, "write");
|
|
21222
|
-
return result
|
|
21361
|
+
return savedOccurrence(result);
|
|
21223
21362
|
},
|
|
21224
21363
|
async delete(eventIdentifier, runIdentifier, occurrenceId) {
|
|
21225
21364
|
await http.deleteValidated(occurrencePath(eventIdentifier, runIdentifier, occurrenceId), sdkDeleteEventOccurrenceResponseSchema);
|
|
@@ -22119,11 +22258,8 @@ function suggestionForManagementError(error) {
|
|
|
22119
22258
|
*/
|
|
22120
22259
|
function getSuggestionForHttpError(error) {
|
|
22121
22260
|
const { statusCode, code, details } = error;
|
|
22122
|
-
if (statusCode === 400
|
|
22123
|
-
return "Config validation failed. Review the field errors above.";
|
|
22124
|
-
}
|
|
22125
|
-
if (statusCode === 400) {
|
|
22126
|
-
return "Request validation failed. Check the error details above.";
|
|
22261
|
+
if (statusCode === 400 || statusCode === 422) {
|
|
22262
|
+
return hasFieldErrors$1(details) ? "Config validation failed. Review the field errors above." : "Request validation failed. Check the error details above.";
|
|
22127
22263
|
}
|
|
22128
22264
|
if (statusCode === 401) {
|
|
22129
22265
|
return errorSuggestions["sdk:unauthorized"];
|
|
@@ -22734,6 +22870,10 @@ function managementClientConfigFor(env) {
|
|
|
22734
22870
|
...timeout === undefined ? {} : { timeout }
|
|
22735
22871
|
};
|
|
22736
22872
|
}
|
|
22873
|
+
/** The one place a CLI management client is built; command modules get it from here or their context. */
|
|
22874
|
+
function managementClientFor(env) {
|
|
22875
|
+
return createManagementClient(managementClientConfigFor(env));
|
|
22876
|
+
}
|
|
22737
22877
|
/**
|
|
22738
22878
|
* Build the space-separated command path for the envelope's `command` field,
|
|
22739
22879
|
* excluding the root program name (e.g. `entry upsert`, `drafts`).
|
|
@@ -22960,7 +23100,7 @@ function createCommandContext(command) {
|
|
|
22960
23100
|
if (!planned.ok) throw new Error(`${planned.error.message}. ${planned.error.suggestion}`);
|
|
22961
23101
|
const targetEnv = selection.kind === "single" ? selection.target : "local";
|
|
22962
23102
|
const env = loadSdkEnvironment(targetEnv);
|
|
22963
|
-
const client =
|
|
23103
|
+
const client = managementClientFor(env);
|
|
22964
23104
|
return {
|
|
22965
23105
|
output,
|
|
22966
23106
|
client,
|
|
@@ -22970,6 +23110,14 @@ function createCommandContext(command) {
|
|
|
22970
23110
|
selection
|
|
22971
23111
|
};
|
|
22972
23112
|
}
|
|
23113
|
+
/** One environment target's settings and management client, for commands that span targets. */
|
|
23114
|
+
function loadManagementTarget(target) {
|
|
23115
|
+
const env = loadSdkEnvironment(target);
|
|
23116
|
+
return {
|
|
23117
|
+
env,
|
|
23118
|
+
client: managementClientFor(env)
|
|
23119
|
+
};
|
|
23120
|
+
}
|
|
22973
23121
|
/**
|
|
22974
23122
|
* Get global options and output context without creating a client.
|
|
22975
23123
|
* Useful when you need to check conditions before creating the client.
|
|
@@ -22999,6 +23147,19 @@ function getOutputOnlyContext(command) {
|
|
|
22999
23147
|
globalOpts
|
|
23000
23148
|
};
|
|
23001
23149
|
}
|
|
23150
|
+
/** What an error message may say about where it happened; env problems just leave the URLs out. */
|
|
23151
|
+
function commandErrorContext(target) {
|
|
23152
|
+
try {
|
|
23153
|
+
const env = loadSdkEnvironment(target);
|
|
23154
|
+
return {
|
|
23155
|
+
target,
|
|
23156
|
+
dashboardUrl: env.dashboardUrl,
|
|
23157
|
+
siteId: env.siteId
|
|
23158
|
+
};
|
|
23159
|
+
} catch {
|
|
23160
|
+
return { target };
|
|
23161
|
+
}
|
|
23162
|
+
}
|
|
23002
23163
|
/**
|
|
23003
23164
|
* Handle errors in a consistent way across all commands.
|
|
23004
23165
|
*
|
|
@@ -23024,120 +23185,256 @@ function handleCommandError(error, output, ctx) {
|
|
|
23024
23185
|
suggestion: formatted.suggestion
|
|
23025
23186
|
});
|
|
23026
23187
|
}
|
|
23027
|
-
|
|
23028
|
-
|
|
23029
|
-
|
|
23030
|
-
|
|
23031
|
-
|
|
23032
|
-
|
|
23033
|
-
|
|
23034
|
-
|
|
23035
|
-
|
|
23036
|
-
|
|
23037
|
-
|
|
23038
|
-
|
|
23039
|
-
|
|
23040
|
-
|
|
23041
|
-
|
|
23042
|
-
|
|
23043
|
-
|
|
23044
|
-
|
|
23045
|
-
|
|
23046
|
-
|
|
23047
|
-
|
|
23048
|
-
|
|
23049
|
-
|
|
23050
|
-
|
|
23051
|
-
|
|
23052
|
-
|
|
23053
|
-
|
|
23054
|
-
|
|
23055
|
-
|
|
23056
|
-
|
|
23057
|
-
|
|
23058
|
-
|
|
23059
|
-
|
|
23060
|
-
|
|
23061
|
-
|
|
23188
|
+
|
|
23189
|
+
//#endregion
|
|
23190
|
+
//#region src/define-command.ts
|
|
23191
|
+
const loadContext = Symbol("load-command-context");
|
|
23192
|
+
const errorTarget = Symbol("command-error-target");
|
|
23193
|
+
const installCommand = Symbol("install-command");
|
|
23194
|
+
function commandHandle(command) {
|
|
23195
|
+
return Object.freeze({ [installCommand]: (parent) => {
|
|
23196
|
+
parent.addCommand(command);
|
|
23197
|
+
} });
|
|
23198
|
+
}
|
|
23199
|
+
function registerCommand(parent, handle) {
|
|
23200
|
+
handle[installCommand](parent);
|
|
23201
|
+
}
|
|
23202
|
+
function resolveContext(policy, command) {
|
|
23203
|
+
return typeof policy === "function" ? policy({ isJsonOutput: command.optsWithGlobals().json === true }) : policy[loadContext](command);
|
|
23204
|
+
}
|
|
23205
|
+
/** The target a setup failure should name, for context loading that failed before returning one. */
|
|
23206
|
+
function setupErrorTarget(policy, command) {
|
|
23207
|
+
return typeof policy === "function" ? undefined : policy[errorTarget]?.(command);
|
|
23208
|
+
}
|
|
23209
|
+
function selectedTarget(command) {
|
|
23210
|
+
const { selection } = getOutputContext(command);
|
|
23211
|
+
return selection.kind === "single" ? selection.target : "local";
|
|
23212
|
+
}
|
|
23213
|
+
const commandContexts = {
|
|
23214
|
+
management: {
|
|
23215
|
+
[loadContext]: (command) => {
|
|
23216
|
+
const { output: _output, ...context } = createCommandContext(command);
|
|
23217
|
+
return context;
|
|
23218
|
+
},
|
|
23219
|
+
[errorTarget]: selectedTarget
|
|
23220
|
+
},
|
|
23221
|
+
outputOwner: { [loadContext]: (command) => {
|
|
23222
|
+
const { output, isJsonOutput } = getOutputOnlyContext(command);
|
|
23223
|
+
return {
|
|
23224
|
+
output,
|
|
23225
|
+
isJsonOutput,
|
|
23226
|
+
json: isJsonOutput,
|
|
23227
|
+
targetEnv: "local",
|
|
23228
|
+
invocation: command
|
|
23229
|
+
};
|
|
23230
|
+
} },
|
|
23231
|
+
environments: {
|
|
23232
|
+
[loadContext]: (command) => {
|
|
23233
|
+
const { output, selection, globalOpts } = getOutputContext(command);
|
|
23234
|
+
const json = globalOpts.json === true;
|
|
23235
|
+
return {
|
|
23236
|
+
output,
|
|
23237
|
+
selection,
|
|
23238
|
+
json,
|
|
23239
|
+
isJsonOutput: json,
|
|
23240
|
+
targetEnv: selectedTarget(command),
|
|
23241
|
+
invocation: command,
|
|
23242
|
+
loadTarget: loadManagementTarget
|
|
23243
|
+
};
|
|
23244
|
+
},
|
|
23245
|
+
[errorTarget]: selectedTarget
|
|
23246
|
+
},
|
|
23247
|
+
localFiles: { [loadContext]: (command) => {
|
|
23248
|
+
const { selection, globalOpts } = getOutputContext(command);
|
|
23249
|
+
const planned = planEnvironmentExecution({
|
|
23250
|
+
command: resolveCommandPath(command),
|
|
23251
|
+
selection: "single"
|
|
23252
|
+
}, selection);
|
|
23253
|
+
if (!planned.ok) throw new Error("Local file commands do not support --env=both. Use --env=local (default)");
|
|
23254
|
+
return {
|
|
23255
|
+
targetEnv: "local",
|
|
23256
|
+
isJsonOutput: globalOpts.json === true
|
|
23257
|
+
};
|
|
23258
|
+
} }
|
|
23259
|
+
};
|
|
23260
|
+
/** Returned by a command whose runner already wrote its output, through `ctx.output`. */
|
|
23261
|
+
const renderedByOwner = Symbol("rendered-by-owner");
|
|
23262
|
+
/** Handlers throw this to stop with a structured error; `details` and `suggestion` reach the envelope. */
|
|
23263
|
+
var CommandFailure = class extends Error {
|
|
23264
|
+
constructor(message, info = {}) {
|
|
23265
|
+
super(message);
|
|
23266
|
+
this.info = info;
|
|
23267
|
+
this.name = "CommandFailure";
|
|
23268
|
+
}
|
|
23269
|
+
};
|
|
23270
|
+
function inputSchemas(args, options) {
|
|
23271
|
+
const tuple = new z.ZodTuple({
|
|
23272
|
+
type: "tuple",
|
|
23273
|
+
items: args.map(({ value }) => value),
|
|
23274
|
+
rest: null
|
|
23275
|
+
});
|
|
23276
|
+
const shape = Object.fromEntries(Object.entries(options).map(([name, { value }]) => [name, value]));
|
|
23277
|
+
return {
|
|
23278
|
+
args: tuple,
|
|
23279
|
+
options: z.object(shape)
|
|
23280
|
+
};
|
|
23281
|
+
}
|
|
23282
|
+
function registerOption(command, name, descriptor) {
|
|
23283
|
+
const description = descriptor.required ? `${descriptor.description} (required)` : descriptor.description;
|
|
23284
|
+
const option = new Option(descriptor.flags, description);
|
|
23285
|
+
if (option.attributeName() !== name) throw new Error(`Option ${descriptor.flags} must be declared as ${option.attributeName()}`);
|
|
23286
|
+
if (descriptor.required) option.makeOptionMandatory();
|
|
23287
|
+
if ("default" in descriptor) option.default(descriptor.default);
|
|
23288
|
+
if (descriptor.choices) option.choices([...descriptor.choices]);
|
|
23289
|
+
command.addOption(option);
|
|
23290
|
+
if (descriptor.negation) command.addOption(new Option(`--no-${option.long?.replace(/^--/u, "") ?? name}`, descriptor.negation));
|
|
23291
|
+
}
|
|
23292
|
+
function registerInputs(command, args, options, dryRun) {
|
|
23293
|
+
args.forEach(({ flags, description }) => command.addArgument(new Argument(flags, description)));
|
|
23294
|
+
Object.entries(options).forEach(([name, descriptor]) => {
|
|
23295
|
+
if (dryRun?.before === name) command.option("--dry-run", dryRun.description);
|
|
23296
|
+
registerOption(command, name, descriptor);
|
|
23297
|
+
});
|
|
23298
|
+
if (dryRun && dryRun.before === undefined) command.option("--dry-run", dryRun.description);
|
|
23062
23299
|
}
|
|
23063
23300
|
/**
|
|
23064
|
-
*
|
|
23065
|
-
*
|
|
23301
|
+
* One policy for destructive and explicitly confirmed commands, before any effects.
|
|
23302
|
+
* `remoteOnly` commands need --yes on a remote target and never prompt locally.
|
|
23066
23303
|
*/
|
|
23067
|
-
function
|
|
23068
|
-
|
|
23069
|
-
|
|
23070
|
-
|
|
23071
|
-
|
|
23072
|
-
|
|
23073
|
-
|
|
23074
|
-
|
|
23075
|
-
|
|
23076
|
-
|
|
23304
|
+
function decideCommandConfirmation(input) {
|
|
23305
|
+
if (input.dryRun || input.yes) return { kind: "proceed" };
|
|
23306
|
+
if ((input.destructive || input.remoteOnly) && input.remote) return {
|
|
23307
|
+
kind: "refuse",
|
|
23308
|
+
message: "Remote operations require --yes flag for safety"
|
|
23309
|
+
};
|
|
23310
|
+
if (input.remoteOnly) return { kind: "proceed" };
|
|
23311
|
+
if (input.json) return {
|
|
23312
|
+
kind: "refuse",
|
|
23313
|
+
message: "Confirmation required. Re-run with --yes in --json mode."
|
|
23077
23314
|
};
|
|
23315
|
+
return { kind: "prompt" };
|
|
23078
23316
|
}
|
|
23079
|
-
/**
|
|
23080
|
-
|
|
23081
|
-
|
|
23082
|
-
|
|
23083
|
-
function
|
|
23084
|
-
return
|
|
23085
|
-
|
|
23086
|
-
|
|
23087
|
-
|
|
23088
|
-
|
|
23317
|
+
/** A rule on the input waits for preparation; `none` and `owner` have nothing to decide here. */
|
|
23318
|
+
function decidedBeforePreparation(confirmation) {
|
|
23319
|
+
return confirmation !== "none" && confirmation !== "owner" && typeof confirmation !== "object";
|
|
23320
|
+
}
|
|
23321
|
+
function remoteYesApplies(confirmation, input) {
|
|
23322
|
+
return typeof confirmation === "object" && confirmation.remoteYesWhen(input);
|
|
23323
|
+
}
|
|
23324
|
+
function yesFlagDescription(confirmation) {
|
|
23325
|
+
return confirmation === "remote-yes" || typeof confirmation === "object" ? "Confirm remote changes" : "Skip confirmation prompt (required for remote destructive runs and JSON writes)";
|
|
23326
|
+
}
|
|
23327
|
+
async function confirmCommand(decision, message, runtime) {
|
|
23328
|
+
switch (decision.kind) {
|
|
23329
|
+
case "proceed": return true;
|
|
23330
|
+
case "prompt": return runtime.confirm(message(), {}, false);
|
|
23331
|
+
}
|
|
23332
|
+
}
|
|
23333
|
+
function renderCommandResult(output, result, json) {
|
|
23334
|
+
if (result === renderedByOwner) return;
|
|
23335
|
+
if (json) output.result(result.ok, result.message, result.data);
|
|
23336
|
+
else if (result.presentation === "document") output.json(result.details);
|
|
23337
|
+
else if (result.presentation === "info") {
|
|
23338
|
+
if (result.table) output.table(result.table.headers, result.table.rows);
|
|
23339
|
+
output.info(result.message);
|
|
23340
|
+
} else {
|
|
23341
|
+
output.result(result.ok, result.message, result.details);
|
|
23342
|
+
if (result.table) output.table(result.table.headers, result.table.rows);
|
|
23343
|
+
}
|
|
23344
|
+
if (!json) result.notes?.forEach((note) => output.info(note));
|
|
23345
|
+
}
|
|
23346
|
+
async function executeCommand(definition, command, output, runtime, ctx) {
|
|
23347
|
+
const schemas = inputSchemas(definition.args, definition.options);
|
|
23348
|
+
const args = schemas.args.parse(command.processedArgs);
|
|
23349
|
+
const options = schemas.options.parse(command.opts());
|
|
23350
|
+
const controls = z.object({
|
|
23351
|
+
yes: z.boolean().default(false),
|
|
23352
|
+
dryRun: z.boolean().default(false)
|
|
23353
|
+
}).parse(command.opts());
|
|
23354
|
+
const decide = (remoteOnly) => decideCommandConfirmation({
|
|
23355
|
+
destructive: definition.destructive === true,
|
|
23356
|
+
remote: ctx.targetEnv === "remote",
|
|
23357
|
+
json: ctx.isJsonOutput,
|
|
23358
|
+
remoteOnly,
|
|
23359
|
+
...controls
|
|
23089
23360
|
});
|
|
23361
|
+
const confirmation = definition.confirmation;
|
|
23362
|
+
const decision = decidedBeforePreparation(confirmation) ? decide(confirmation === "remote-yes") : { kind: "proceed" };
|
|
23363
|
+
if (decision.kind === "refuse") return output.error(decision.message);
|
|
23364
|
+
const report = output;
|
|
23365
|
+
const input = {
|
|
23366
|
+
args,
|
|
23367
|
+
options,
|
|
23368
|
+
ctx,
|
|
23369
|
+
report,
|
|
23370
|
+
controls,
|
|
23371
|
+
prepared: await definition.prepare({
|
|
23372
|
+
args,
|
|
23373
|
+
options,
|
|
23374
|
+
ctx,
|
|
23375
|
+
report
|
|
23376
|
+
})
|
|
23377
|
+
};
|
|
23378
|
+
const inputDecision = remoteYesApplies(confirmation, input) ? decide(true) : decision;
|
|
23379
|
+
if (inputDecision.kind === "refuse") return output.error(inputDecision.message);
|
|
23380
|
+
if (!await confirmCommand(decision, () => typeof confirmation === "function" ? confirmation(input) : "", runtime)) {
|
|
23381
|
+
renderCommandResult(output, {
|
|
23382
|
+
ok: true,
|
|
23383
|
+
message: "Operation cancelled",
|
|
23384
|
+
data: { cancelled: true }
|
|
23385
|
+
}, ctx.isJsonOutput);
|
|
23386
|
+
return;
|
|
23387
|
+
}
|
|
23388
|
+
const run = controls.dryRun && definition.dryRun ? definition.dryRun.run : definition.run;
|
|
23389
|
+
renderCommandResult(output, await run(input), ctx.isJsonOutput);
|
|
23090
23390
|
}
|
|
23091
|
-
|
|
23092
|
-
|
|
23093
|
-
|
|
23094
|
-
|
|
23095
|
-
|
|
23096
|
-
|
|
23097
|
-
|
|
23098
|
-
|
|
23099
|
-
|
|
23100
|
-
|
|
23101
|
-
|
|
23102
|
-
|
|
23103
|
-
|
|
23104
|
-
|
|
23105
|
-
|
|
23106
|
-
|
|
23107
|
-
|
|
23108
|
-
|
|
23109
|
-
|
|
23110
|
-
|
|
23111
|
-
|
|
23112
|
-
|
|
23113
|
-
|
|
23114
|
-
|
|
23115
|
-
|
|
23116
|
-
|
|
23117
|
-
|
|
23118
|
-
const confirmed = await confirmAction(getMessage(...args), options, ctx.targetEnv === "remote");
|
|
23119
|
-
if (!confirmed) {
|
|
23120
|
-
output.info("Operation cancelled");
|
|
23121
|
-
return;
|
|
23122
|
-
}
|
|
23391
|
+
function mapCommandError(error, output, target) {
|
|
23392
|
+
if (error instanceof CliExit) throw error;
|
|
23393
|
+
if (error instanceof CommandFailure) output.error(error.message, error.info);
|
|
23394
|
+
if (error instanceof z.ZodError) output.error("Invalid command input", { details: z.prettifyError(error) });
|
|
23395
|
+
handleCommandError(error, output, target ? commandErrorContext(target) : undefined);
|
|
23396
|
+
}
|
|
23397
|
+
async function executeWithContext(definition, command, output, runtime) {
|
|
23398
|
+
const ctx = resolveContext(definition.context, command);
|
|
23399
|
+
try {
|
|
23400
|
+
await executeCommand(definition, command, output, runtime, ctx);
|
|
23401
|
+
} catch (error) {
|
|
23402
|
+
mapCommandError(error, output, typeof definition.context === "function" ? ctx.targetEnv : setupErrorTarget(definition.context, command));
|
|
23403
|
+
}
|
|
23404
|
+
}
|
|
23405
|
+
/** Commander is an untyped boundary: schemas parse it once; run receives inferred values. */
|
|
23406
|
+
function definePreparedCommand(definition, runtime = { confirm: confirmAction }) {
|
|
23407
|
+
const command = new Command(definition.name).description(definition.description);
|
|
23408
|
+
if (definition.help) command.addHelpText("after", definition.help);
|
|
23409
|
+
registerInputs(command, definition.args, definition.options, definition.dryRun);
|
|
23410
|
+
if (definition.confirmation === "owner") {
|
|
23411
|
+
if (definition.ownedFlags?.dryRun) command.option("--dry-run", definition.ownedFlags.dryRun);
|
|
23412
|
+
if (definition.ownedFlags?.yes) command.option("--yes", definition.ownedFlags.yes);
|
|
23413
|
+
} else if (definition.confirmation !== "none") {
|
|
23414
|
+
command.option("--yes", yesFlagDescription(definition.confirmation));
|
|
23415
|
+
}
|
|
23416
|
+
return command.action(async () => {
|
|
23417
|
+
const output = createOutputForCommand(command);
|
|
23123
23418
|
try {
|
|
23124
|
-
await
|
|
23419
|
+
await executeWithContext(definition, command, output, runtime);
|
|
23125
23420
|
} catch (error) {
|
|
23126
|
-
|
|
23127
|
-
let dashboardUrl;
|
|
23128
|
-
let siteId;
|
|
23129
|
-
try {
|
|
23130
|
-
const env = loadSdkEnvironment(ctx.targetEnv);
|
|
23131
|
-
dashboardUrl = env.dashboardUrl;
|
|
23132
|
-
siteId = env.siteId;
|
|
23133
|
-
} catch {}
|
|
23134
|
-
handleCommandError(error, output, {
|
|
23135
|
-
target: ctx.targetEnv,
|
|
23136
|
-
dashboardUrl,
|
|
23137
|
-
siteId
|
|
23138
|
-
});
|
|
23421
|
+
mapCommandError(error, output, setupErrorTarget(definition.context, command));
|
|
23139
23422
|
}
|
|
23140
|
-
};
|
|
23423
|
+
});
|
|
23424
|
+
}
|
|
23425
|
+
function defineCommand(definition, runtime = { confirm: confirmAction }) {
|
|
23426
|
+
if (!definition.prepare) return commandHandle(definePreparedCommand({
|
|
23427
|
+
...definition,
|
|
23428
|
+
prepare: async () => undefined
|
|
23429
|
+
}, runtime));
|
|
23430
|
+
return commandHandle(definePreparedCommand(definition, runtime));
|
|
23431
|
+
}
|
|
23432
|
+
/** A group composes handles without giving command modules access to Commander. */
|
|
23433
|
+
function defineCommandGroup(definition) {
|
|
23434
|
+
const group = new Command(definition.name).description(definition.description);
|
|
23435
|
+
if (definition.help) group.addHelpText("after", definition.help);
|
|
23436
|
+
definition.commands.forEach((child) => registerCommand(group, child));
|
|
23437
|
+
return commandHandle(group);
|
|
23141
23438
|
}
|
|
23142
23439
|
|
|
23143
23440
|
//#endregion
|
|
@@ -24044,7 +24341,7 @@ function resolveBatchReadFetchPolicy(params, body) {
|
|
|
24044
24341
|
if (params?.stage === "preview" || typeof params?.siteId !== "string") return null;
|
|
24045
24342
|
const parsed = batchReadPolicyBodySchema.safeParse(body);
|
|
24046
24343
|
if (!parsed.success) return null;
|
|
24047
|
-
return
|
|
24344
|
+
return buildPublicReadBatchFetchPolicy(params.siteId, parsed.data.requests);
|
|
24048
24345
|
}
|
|
24049
24346
|
function batchReadRequestOptions(params, body, options) {
|
|
24050
24347
|
if (options.cache === "no-store") return options;
|
|
@@ -24623,7 +24920,7 @@ function buildPreviewSummary(sync) {
|
|
|
24623
24920
|
}
|
|
24624
24921
|
|
|
24625
24922
|
//#endregion
|
|
24626
|
-
//#region src/
|
|
24923
|
+
//#region src/push-config.ts
|
|
24627
24924
|
/**
|
|
24628
24925
|
* push-config CLI command
|
|
24629
24926
|
*
|
|
@@ -24980,7 +25277,7 @@ function renderPushConfigJsonResult(output, execution, dryRun) {
|
|
|
24980
25277
|
}
|
|
24981
25278
|
function getProductionPushConfigCommandDeps() {
|
|
24982
25279
|
return {
|
|
24983
|
-
|
|
25280
|
+
context: commandContexts.environments,
|
|
24984
25281
|
planEnvironmentExecution,
|
|
24985
25282
|
executeEnvironmentPlan,
|
|
24986
25283
|
confirmAction,
|
|
@@ -24993,7 +25290,10 @@ function getProductionPushConfigCommandDeps() {
|
|
|
24993
25290
|
/**
|
|
24994
25291
|
* push-config command definition
|
|
24995
25292
|
*/
|
|
24996
|
-
const createPushConfigCommand = (deps = getProductionPushConfigCommandDeps()) =>
|
|
25293
|
+
const createPushConfigCommand = (deps = getProductionPushConfigCommandDeps()) => defineCommand({
|
|
25294
|
+
name: "push-config",
|
|
25295
|
+
description: "Push SDK config to dashboard",
|
|
25296
|
+
help: `
|
|
24997
25297
|
Description:
|
|
24998
25298
|
Syncs your local riverbank.config.ts schema/config to the CMS dashboard, including:
|
|
24999
25299
|
- Custom blocks
|
|
@@ -25012,49 +25312,83 @@ Examples:
|
|
|
25012
25312
|
$ pnpm exec riverbankcms push-config --env=remote
|
|
25013
25313
|
$ pnpm exec riverbankcms push-config --api-key bld_mgmt_sk_... --dashboard https://www.riverbankcms.com
|
|
25014
25314
|
$ pnpm exec riverbankcms push-config --config ./src/riverbank.config.ts
|
|
25015
|
-
|
|
25016
|
-
|
|
25017
|
-
|
|
25018
|
-
|
|
25019
|
-
|
|
25020
|
-
|
|
25021
|
-
|
|
25022
|
-
|
|
25023
|
-
|
|
25024
|
-
|
|
25025
|
-
|
|
25026
|
-
|
|
25027
|
-
failure: "abort",
|
|
25028
|
-
confirmation: "command",
|
|
25029
|
-
revalidation: "required"
|
|
25030
|
-
}, selection);
|
|
25031
|
-
if (!planned.ok) return output.error(planned.error.message, { suggestion: planned.error.suggestion });
|
|
25032
|
-
const execution = await deps.executeEnvironmentPlan(planned.value, {
|
|
25033
|
-
loadTarget: (target) => deps.loadTarget(target, options),
|
|
25034
|
-
preflight: async (_target, loaded) => deps.prepareTarget(loaded.context, {
|
|
25035
|
-
...options,
|
|
25036
|
-
dashboard: loaded.context.dashboard
|
|
25037
|
-
}),
|
|
25038
|
-
confirm: async ({ ready }) => {
|
|
25039
|
-
if (authorization.kind === "preauthorized") return true;
|
|
25040
|
-
for (const { target, context } of ready) {
|
|
25041
|
-
const sync = getPushConfigSync(context.preview);
|
|
25042
|
-
output.info(`${target} config preview`, sync ? buildPreviewSummary(sync) : { changes: "No sync summary returned" });
|
|
25043
|
-
}
|
|
25044
|
-
return deps.confirmAction(`Apply SDK config to ${ready.length} environment${ready.length === 1 ? "" : "s"} (${ready.map(({ target }) => target).join(" then ")})?`, { yes: options.yes }, false);
|
|
25315
|
+
`,
|
|
25316
|
+
args: [],
|
|
25317
|
+
options: {
|
|
25318
|
+
apiKey: {
|
|
25319
|
+
flags: "--api-key <key>",
|
|
25320
|
+
description: "Management API key (or set RIVERBANK_*_MGMT_API_KEY)",
|
|
25321
|
+
value: z.string().optional()
|
|
25322
|
+
},
|
|
25323
|
+
dashboard: {
|
|
25324
|
+
flags: "--dashboard <url>",
|
|
25325
|
+
description: "Dashboard URL (or set RIVERBANK_*_DASHBOARD_URL env var)",
|
|
25326
|
+
value: z.string().optional()
|
|
25045
25327
|
},
|
|
25046
|
-
|
|
25047
|
-
|
|
25048
|
-
|
|
25049
|
-
|
|
25328
|
+
config: {
|
|
25329
|
+
flags: "--config <path>",
|
|
25330
|
+
description: `Path to config file (default: ${DEFAULT_CONFIG_PATH})`,
|
|
25331
|
+
value: z.string().optional()
|
|
25332
|
+
},
|
|
25333
|
+
forceContentTypes: {
|
|
25334
|
+
flags: "--force-content-types",
|
|
25335
|
+
description: "Force overwrite content type schema even if modified in dashboard after last SDK sync",
|
|
25336
|
+
value: z.boolean().optional()
|
|
25337
|
+
}
|
|
25338
|
+
},
|
|
25339
|
+
context: deps.context,
|
|
25340
|
+
confirmation: "owner",
|
|
25341
|
+
ownedFlags: {
|
|
25342
|
+
dryRun: "Preview SDK config changes without updating the dashboard",
|
|
25343
|
+
yes: "Confirm applying config changes across all selected environments"
|
|
25344
|
+
},
|
|
25345
|
+
run: async ({ options: flags, controls, ctx: { output, selection, json: isJsonOutput } }) => {
|
|
25346
|
+
const options = {
|
|
25347
|
+
...flags,
|
|
25348
|
+
...controls
|
|
25349
|
+
};
|
|
25350
|
+
const authorization = requireEnvironmentWriteAuthorization({
|
|
25351
|
+
...options,
|
|
25352
|
+
json: isJsonOutput,
|
|
25353
|
+
interactive: process.stdin.isTTY === true
|
|
25354
|
+
}, output);
|
|
25355
|
+
if (!authorization) return renderedByOwner;
|
|
25356
|
+
const planned = deps.planEnvironmentExecution({
|
|
25357
|
+
command: "push-config",
|
|
25358
|
+
selection: "both",
|
|
25359
|
+
failure: "abort",
|
|
25360
|
+
confirmation: "command",
|
|
25361
|
+
revalidation: "required"
|
|
25362
|
+
}, selection);
|
|
25363
|
+
if (!planned.ok) throw new CommandFailure(planned.error.message, { suggestion: planned.error.suggestion });
|
|
25364
|
+
const execution = await deps.executeEnvironmentPlan(planned.value, {
|
|
25365
|
+
loadTarget: (target) => deps.loadTarget(target, options),
|
|
25366
|
+
preflight: async (_target, loaded) => deps.prepareTarget(loaded.context, {
|
|
25050
25367
|
...options,
|
|
25051
25368
|
dashboard: loaded.context.dashboard
|
|
25052
|
-
},
|
|
25053
|
-
|
|
25054
|
-
|
|
25055
|
-
|
|
25056
|
-
|
|
25057
|
-
|
|
25369
|
+
}),
|
|
25370
|
+
confirm: async ({ ready }) => {
|
|
25371
|
+
if (authorization.kind === "preauthorized") return true;
|
|
25372
|
+
for (const { target, context } of ready) {
|
|
25373
|
+
const sync = getPushConfigSync(context.preview);
|
|
25374
|
+
output.info(`${target} config preview`, sync ? buildPreviewSummary(sync) : { changes: "No sync summary returned" });
|
|
25375
|
+
}
|
|
25376
|
+
return deps.confirmAction(`Apply SDK config to ${ready.length} environment${ready.length === 1 ? "" : "s"} (${ready.map(({ target }) => target).join(" then ")})?`, { yes: options.yes }, false);
|
|
25377
|
+
},
|
|
25378
|
+
revalidate: async (_target, loaded, prepared) => options.dryRun ? { ok: true } : deps.revalidatePlan(loaded.context, prepared.context),
|
|
25379
|
+
apply: async (target, loaded, prepared) => {
|
|
25380
|
+
if (planned.value.targets.length > 1) output.info(`\n--- Pushing to ${target} environment ---`);
|
|
25381
|
+
return deps.applyPlan(output, loaded.context, prepared.context, {
|
|
25382
|
+
...options,
|
|
25383
|
+
dashboard: loaded.context.dashboard
|
|
25384
|
+
}, isJsonOutput);
|
|
25385
|
+
},
|
|
25386
|
+
isSuccess: isPushConfigApplySuccess,
|
|
25387
|
+
formatFailure: formatPushConfigActionFailure
|
|
25388
|
+
}, output);
|
|
25389
|
+
if (isJsonOutput) renderPushConfigJsonResult(output, execution, options.dryRun ?? false);
|
|
25390
|
+
return renderedByOwner;
|
|
25391
|
+
}
|
|
25058
25392
|
});
|
|
25059
25393
|
|
|
25060
25394
|
//#endregion
|
|
@@ -25946,11 +26280,6 @@ async function acceptSiteInvitation(apiClient, { body, options }) {
|
|
|
25946
26280
|
|
|
25947
26281
|
//#endregion
|
|
25948
26282
|
//#region ../api/src/staffAccess.ts
|
|
25949
|
-
const STAFF_OPERATIONAL_CAPABILITIES = [
|
|
25950
|
-
"appointments",
|
|
25951
|
-
"event_ops",
|
|
25952
|
-
"packages"
|
|
25953
|
-
];
|
|
25954
26283
|
function roleAtLeast$1(role, minimum) {
|
|
25955
26284
|
return SITE_ROLE_PERMISSION_LEVEL[role] >= SITE_ROLE_PERMISSION_LEVEL[minimum];
|
|
25956
26285
|
}
|
|
@@ -25986,40 +26315,49 @@ function deriveStaffScope(input) {
|
|
|
25986
26315
|
staffMemberId
|
|
25987
26316
|
};
|
|
25988
26317
|
}
|
|
25989
|
-
|
|
25990
|
-
|
|
25991
|
-
|
|
25992
|
-
|
|
25993
|
-
|
|
25994
|
-
|
|
25995
|
-
|
|
25996
|
-
|
|
25997
|
-
|
|
25998
|
-
|
|
25999
|
-
|
|
26000
|
-
|
|
26001
|
-
|
|
26002
|
-
|
|
26003
|
-
|
|
26004
|
-
|
|
26005
|
-
|
|
26006
|
-
|
|
26007
|
-
|
|
26008
|
-
|
|
26009
|
-
|
|
26010
|
-
|
|
26011
|
-
|
|
26012
|
-
|
|
26013
|
-
staffMemberId,
|
|
26014
|
-
...packages
|
|
26015
|
-
};
|
|
26016
|
-
}
|
|
26017
|
-
return {
|
|
26018
|
-
kind: "appointments",
|
|
26019
|
-
staffMemberId,
|
|
26020
|
-
...packages
|
|
26021
|
-
};
|
|
26318
|
+
return deriveCapabilityScope(staffMemberId, persistedCapabilities);
|
|
26319
|
+
}
|
|
26320
|
+
}
|
|
26321
|
+
/**
|
|
26322
|
+
* What a linked team member's stored access adds up to. `own_offerings` only
|
|
26323
|
+
* counts beside Appointments and Packages, so "can create but can't book or
|
|
26324
|
+
* sell" can't arise, and alone it isn't access to anything.
|
|
26325
|
+
*/
|
|
26326
|
+
function deriveCapabilityScope(staffMemberId, capabilities) {
|
|
26327
|
+
const appointments = capabilities.includes("appointments");
|
|
26328
|
+
const eventOps = capabilities.includes("event_ops");
|
|
26329
|
+
const hasPackages = capabilities.includes("packages");
|
|
26330
|
+
if (!appointments && !eventOps && !hasPackages) {
|
|
26331
|
+
return {
|
|
26332
|
+
kind: "staff_setup_required",
|
|
26333
|
+
reason: "missing_capabilities"
|
|
26334
|
+
};
|
|
26335
|
+
}
|
|
26336
|
+
if (!appointments && !eventOps) {
|
|
26337
|
+
return {
|
|
26338
|
+
kind: "packages_only",
|
|
26339
|
+
staffMemberId,
|
|
26340
|
+
packages: true
|
|
26341
|
+
};
|
|
26022
26342
|
}
|
|
26343
|
+
const packages = hasPackages ? { packages: true } : {};
|
|
26344
|
+
if (!appointments) return {
|
|
26345
|
+
kind: "event_ops_only",
|
|
26346
|
+
staffMemberId,
|
|
26347
|
+
...packages
|
|
26348
|
+
};
|
|
26349
|
+
const extras = {
|
|
26350
|
+
...packages,
|
|
26351
|
+
...ownOfferingsGrant(capabilities)
|
|
26352
|
+
};
|
|
26353
|
+
return {
|
|
26354
|
+
kind: eventOps ? "hybrid" : "appointments",
|
|
26355
|
+
staffMemberId,
|
|
26356
|
+
...extras
|
|
26357
|
+
};
|
|
26358
|
+
}
|
|
26359
|
+
function ownOfferingsGrant(capabilities) {
|
|
26360
|
+
return capabilities.includes("packages") && capabilities.includes("own_offerings") ? { ownOfferings: true } : {};
|
|
26023
26361
|
}
|
|
26024
26362
|
function isStaffScoped(scope) {
|
|
26025
26363
|
return scope.kind !== "none";
|
|
@@ -26033,6 +26371,16 @@ function hasAppointmentStaffAccess(scope) {
|
|
|
26033
26371
|
function hasPackageStaffAccess(scope) {
|
|
26034
26372
|
return "packages" in scope && scope.packages === true;
|
|
26035
26373
|
}
|
|
26374
|
+
function hasOwnOfferingsAccess(scope) {
|
|
26375
|
+
return "ownOfferings" in scope && scope.ownOfferings === true;
|
|
26376
|
+
}
|
|
26377
|
+
/**
|
|
26378
|
+
* Own offerings needs Appointments and Packages beside it. Null when the
|
|
26379
|
+
* combination is fine, and otherwise the words to show whoever chose it.
|
|
26380
|
+
*/
|
|
26381
|
+
function staffCapabilityCombinationProblem(capabilities) {
|
|
26382
|
+
return capabilities.includes("own_offerings") && !(capabilities.includes("appointments") && capabilities.includes("packages")) ? "Give them Appointments and Packages too, so they can offer what they create." : null;
|
|
26383
|
+
}
|
|
26036
26384
|
function hasEventOpsAccess(scope) {
|
|
26037
26385
|
return scope.kind === "event_ops_only" || scope.kind === "hybrid";
|
|
26038
26386
|
}
|
|
@@ -26498,7 +26846,7 @@ const SETTINGS_SURFACE_POLICIES = {
|
|
|
26498
26846
|
surfaceId: "settings.bookings",
|
|
26499
26847
|
navVisibilityPolicy: administratorPolicy,
|
|
26500
26848
|
pageAccessPolicy: administratorPolicy,
|
|
26501
|
-
actionIds: ["bookings.updateSettings"
|
|
26849
|
+
actionIds: ["bookings.updateSettings"]
|
|
26502
26850
|
},
|
|
26503
26851
|
"settings.redirects": {
|
|
26504
26852
|
surfaceId: "settings.redirects",
|
|
@@ -26586,7 +26934,6 @@ const SETTINGS_SURFACE_POLICIES = {
|
|
|
26586
26934
|
const SETTINGS_ACTION_POLICIES = {
|
|
26587
26935
|
"privacy.update": administratorPolicy,
|
|
26588
26936
|
"bookings.updateSettings": editorPolicy,
|
|
26589
|
-
"bookings.turnOnCourses": editorPolicy,
|
|
26590
26937
|
"emails.read": editorPolicy,
|
|
26591
26938
|
"emails.update": administratorPolicy,
|
|
26592
26939
|
"emails.updateSendSetting": editorPolicy,
|
|
@@ -26642,7 +26989,8 @@ const DASHBOARD_SETTINGS_NAV_GROUPS = [
|
|
|
26642
26989
|
"newsletter",
|
|
26643
26990
|
"analytics"
|
|
26644
26991
|
],
|
|
26645
|
-
stage: "ga"
|
|
26992
|
+
stage: "ga",
|
|
26993
|
+
sidebar: "websites_only"
|
|
26646
26994
|
},
|
|
26647
26995
|
{
|
|
26648
26996
|
id: "settings.general",
|
|
@@ -26725,20 +27073,8 @@ const DASHBOARD_SETTINGS_NAV_GROUPS = [
|
|
|
26725
27073
|
"otf",
|
|
26726
27074
|
"upload"
|
|
26727
27075
|
],
|
|
26728
|
-
stage: "ga"
|
|
26729
|
-
|
|
26730
|
-
{
|
|
26731
|
-
id: "settings.bookings",
|
|
26732
|
-
label: "Bookings",
|
|
26733
|
-
keywords: [
|
|
26734
|
-
"bookings",
|
|
26735
|
-
"appointments",
|
|
26736
|
-
"events",
|
|
26737
|
-
"classes",
|
|
26738
|
-
"enable",
|
|
26739
|
-
"disable"
|
|
26740
|
-
],
|
|
26741
|
-
stage: "ga"
|
|
27076
|
+
stage: "ga",
|
|
27077
|
+
sidebar: "websites_only"
|
|
26742
27078
|
},
|
|
26743
27079
|
{
|
|
26744
27080
|
id: "settings.redirects",
|
|
@@ -26750,7 +27086,8 @@ const DASHBOARD_SETTINGS_NAV_GROUPS = [
|
|
|
26750
27086
|
"301",
|
|
26751
27087
|
"302"
|
|
26752
27088
|
],
|
|
26753
|
-
stage: "ga"
|
|
27089
|
+
stage: "ga",
|
|
27090
|
+
sidebar: "websites_only"
|
|
26754
27091
|
},
|
|
26755
27092
|
{
|
|
26756
27093
|
id: "settings.emails",
|
|
@@ -26785,7 +27122,8 @@ const DASHBOARD_SETTINGS_NAV_GROUPS = [
|
|
|
26785
27122
|
"industry",
|
|
26786
27123
|
"goals"
|
|
26787
27124
|
],
|
|
26788
|
-
stage: "internal"
|
|
27125
|
+
stage: "internal",
|
|
27126
|
+
sidebar: "never"
|
|
26789
27127
|
},
|
|
26790
27128
|
{
|
|
26791
27129
|
id: "settings.ai.brandGuidelines",
|
|
@@ -26799,7 +27137,8 @@ const DASHBOARD_SETTINGS_NAV_GROUPS = [
|
|
|
26799
27137
|
"guidelines",
|
|
26800
27138
|
"writing"
|
|
26801
27139
|
],
|
|
26802
|
-
stage: "internal"
|
|
27140
|
+
stage: "internal",
|
|
27141
|
+
sidebar: "never"
|
|
26803
27142
|
},
|
|
26804
27143
|
{
|
|
26805
27144
|
id: "settings.ai.iconStyleGuide",
|
|
@@ -26812,7 +27151,8 @@ const DASHBOARD_SETTINGS_NAV_GROUPS = [
|
|
|
26812
27151
|
"generation",
|
|
26813
27152
|
"visual"
|
|
26814
27153
|
],
|
|
26815
|
-
stage: "internal"
|
|
27154
|
+
stage: "internal",
|
|
27155
|
+
sidebar: "never"
|
|
26816
27156
|
}
|
|
26817
27157
|
]
|
|
26818
27158
|
},
|
|
@@ -26820,7 +27160,7 @@ const DASHBOARD_SETTINGS_NAV_GROUPS = [
|
|
|
26820
27160
|
label: "Team & Billing",
|
|
26821
27161
|
items: [{
|
|
26822
27162
|
id: "settings.team",
|
|
26823
|
-
label: "
|
|
27163
|
+
label: "Team",
|
|
26824
27164
|
keywords: [
|
|
26825
27165
|
"team",
|
|
26826
27166
|
"roles",
|
|
@@ -26854,7 +27194,8 @@ const DASHBOARD_SETTINGS_NAV_GROUPS = [
|
|
|
26854
27194
|
"headless",
|
|
26855
27195
|
"developer"
|
|
26856
27196
|
],
|
|
26857
|
-
stage: "ga"
|
|
27197
|
+
stage: "ga",
|
|
27198
|
+
sidebar: "websites_only"
|
|
26858
27199
|
},
|
|
26859
27200
|
{
|
|
26860
27201
|
id: "settings.logs",
|
|
@@ -26865,7 +27206,8 @@ const DASHBOARD_SETTINGS_NAV_GROUPS = [
|
|
|
26865
27206
|
"errors",
|
|
26866
27207
|
"diagnostics"
|
|
26867
27208
|
],
|
|
26868
|
-
stage: "ga"
|
|
27209
|
+
stage: "ga",
|
|
27210
|
+
sidebar: "websites_only"
|
|
26869
27211
|
},
|
|
26870
27212
|
{
|
|
26871
27213
|
id: "settings.apiKeys",
|
|
@@ -26878,7 +27220,8 @@ const DASHBOARD_SETTINGS_NAV_GROUPS = [
|
|
|
26878
27220
|
"content",
|
|
26879
27221
|
"sdk"
|
|
26880
27222
|
],
|
|
26881
|
-
stage: "ga"
|
|
27223
|
+
stage: "ga",
|
|
27224
|
+
sidebar: "websites_only"
|
|
26882
27225
|
},
|
|
26883
27226
|
{
|
|
26884
27227
|
id: "settings.backup",
|
|
@@ -26891,7 +27234,8 @@ const DASHBOARD_SETTINGS_NAV_GROUPS = [
|
|
|
26891
27234
|
"download",
|
|
26892
27235
|
"zip"
|
|
26893
27236
|
],
|
|
26894
|
-
stage: "ga"
|
|
27237
|
+
stage: "ga",
|
|
27238
|
+
sidebar: "websites_only"
|
|
26895
27239
|
}
|
|
26896
27240
|
]
|
|
26897
27241
|
}
|
|
@@ -26899,7 +27243,6 @@ const DASHBOARD_SETTINGS_NAV_GROUPS = [
|
|
|
26899
27243
|
const hiddenDemoSettingsNavSurfaceIds = [
|
|
26900
27244
|
"settings.features",
|
|
26901
27245
|
"settings.domains",
|
|
26902
|
-
"settings.bookings",
|
|
26903
27246
|
"settings.emails",
|
|
26904
27247
|
"settings.team",
|
|
26905
27248
|
"settings.billing",
|
|
@@ -26914,38 +27257,37 @@ function isFeatureEnabled(ctx, flag) {
|
|
|
26914
27257
|
function isDemoSettingsNavSurfaceVisible(mode, surfaceId) {
|
|
26915
27258
|
return !isDemoDashboardUiRestricted(mode) || !hiddenDemoSettingsNavIds.has(surfaceId);
|
|
26916
27259
|
}
|
|
26917
|
-
|
|
26918
|
-
|
|
26919
|
-
|
|
26920
|
-
|
|
26921
|
-
|
|
26922
|
-
|
|
26923
|
-
|
|
26924
|
-
|
|
26925
|
-
};
|
|
27260
|
+
function isListedInSidebar(ctx, sidebar) {
|
|
27261
|
+
if (sidebar === "never") return false;
|
|
27262
|
+
return sidebar !== "websites_only" || ctx.isHostedBookingPage !== true;
|
|
27263
|
+
}
|
|
27264
|
+
/** Who can delete a site: its owner, and not on a demo. The one owner of this rule. */
|
|
27265
|
+
function canDeleteSite(ctx) {
|
|
27266
|
+
return ctx.role === "owner" && !isDemoDashboardUiRestricted(ctx.demoUiMode ?? "standard");
|
|
27267
|
+
}
|
|
26926
27268
|
function buildDashboardSettingsNavPlan(ctx) {
|
|
26927
27269
|
const visibility = extractSdkDashboardNavVisibilityConfigForRole(ctx.sdkConfig, "settingsNav", ctx.role);
|
|
26928
|
-
const
|
|
26929
|
-
|
|
26930
|
-
|
|
26931
|
-
|
|
26932
|
-
|
|
26933
|
-
|
|
26934
|
-
|
|
26935
|
-
|
|
26936
|
-
|
|
26937
|
-
|
|
26938
|
-
|
|
26939
|
-
|
|
26940
|
-
|
|
26941
|
-
|
|
26942
|
-
|
|
26943
|
-
|
|
26944
|
-
|
|
26945
|
-
const dangerItem = ctx.role === "owner" && !isDemoDashboardUiRestricted(ctx.demoUiMode ?? "standard") ? DASHBOARD_SETTINGS_DANGER_ITEM : undefined;
|
|
27270
|
+
const visibleItems = (items) => items.filter((item) => isFeatureEnabled(ctx, item.featureFlag)).filter((item) => isDemoSettingsNavSurfaceVisible(ctx.demoUiMode ?? "standard", item.id)).filter((item) => isNavItemVisible({
|
|
27271
|
+
id: item.id,
|
|
27272
|
+
role: ctx.role ?? null,
|
|
27273
|
+
stage: item.stage,
|
|
27274
|
+
minRole: getRolePolicyMinimumRole(getSettingsSurfaceNavPolicy(item.id)),
|
|
27275
|
+
config: visibility
|
|
27276
|
+
}));
|
|
27277
|
+
const toPlan = (item) => ({
|
|
27278
|
+
id: item.id,
|
|
27279
|
+
label: item.label,
|
|
27280
|
+
keywords: item.keywords
|
|
27281
|
+
});
|
|
27282
|
+
const groups = DASHBOARD_SETTINGS_NAV_GROUPS.map((group) => ({
|
|
27283
|
+
label: group.label,
|
|
27284
|
+
items: visibleItems(group.items).filter((item) => isListedInSidebar(ctx, item.sidebar)).map(toPlan)
|
|
27285
|
+
})).filter((group) => group.items.length > 0);
|
|
27286
|
+
const unlisted = DASHBOARD_SETTINGS_NAV_GROUPS.flatMap((group) => visibleItems(group.items)).filter((item) => !isListedInSidebar(ctx, item.sidebar)).map(toPlan);
|
|
26946
27287
|
return {
|
|
26947
27288
|
groups,
|
|
26948
|
-
|
|
27289
|
+
unlisted,
|
|
27290
|
+
canDeleteSite: canDeleteSite(ctx)
|
|
26949
27291
|
};
|
|
26950
27292
|
}
|
|
26951
27293
|
|
|
@@ -26956,13 +27298,27 @@ function buildDashboardTeamMemberNavPlan(ctx) {
|
|
|
26956
27298
|
return [
|
|
26957
27299
|
...hasAppointmentStaffAccess(ctx.staffScope) ? buildAppointmentStaffNavPlan(ownResourceId) : ownResourceId ? [{
|
|
26958
27300
|
id: "team.availability",
|
|
26959
|
-
label: "
|
|
27301
|
+
label: "Your hours and details",
|
|
26960
27302
|
destination: {
|
|
26961
27303
|
kind: "appointment_resource_calendar",
|
|
26962
27304
|
resourceId: ownResourceId
|
|
26963
27305
|
}
|
|
26964
27306
|
}] : [],
|
|
26965
|
-
...
|
|
27307
|
+
...hasOwnOfferingsAccess(ctx.staffScope) ? [{
|
|
27308
|
+
id: "team.services",
|
|
27309
|
+
label: "Services",
|
|
27310
|
+
destination: { kind: "appointment_services" }
|
|
27311
|
+
}] : [],
|
|
27312
|
+
...hasPackageStaffAccess(ctx.staffScope) ? [{
|
|
27313
|
+
id: "team.packages",
|
|
27314
|
+
label: "Packages",
|
|
27315
|
+
destination: { kind: "booking_products" }
|
|
27316
|
+
}] : [],
|
|
27317
|
+
...hasPackageStaffAccess(ctx.staffScope) || hasAppointmentStaffAccess(ctx.staffScope) ? [{
|
|
27318
|
+
id: "team.clients",
|
|
27319
|
+
label: "My Clients",
|
|
27320
|
+
destination: { kind: "booking_people" }
|
|
27321
|
+
}] : [],
|
|
26966
27322
|
...hasEventOpsAccess(ctx.staffScope) ? [{
|
|
26967
27323
|
id: "team.eventOps",
|
|
26968
27324
|
label: "Event Ops",
|
|
@@ -26970,16 +27326,6 @@ function buildDashboardTeamMemberNavPlan(ctx) {
|
|
|
26970
27326
|
}] : []
|
|
26971
27327
|
];
|
|
26972
27328
|
}
|
|
26973
|
-
/** Packages access opens the trainer's packages and their own clients. */
|
|
26974
|
-
const packageStaffNavPlan = [{
|
|
26975
|
-
id: "team.packages",
|
|
26976
|
-
label: "Packages",
|
|
26977
|
-
destination: { kind: "booking_products" }
|
|
26978
|
-
}, {
|
|
26979
|
-
id: "team.clients",
|
|
26980
|
-
label: "My Clients",
|
|
26981
|
-
destination: { kind: "booking_people" }
|
|
26982
|
-
}];
|
|
26983
27329
|
function buildAppointmentStaffNavPlan(resourceId) {
|
|
26984
27330
|
return [{
|
|
26985
27331
|
id: "team.calendar",
|
|
@@ -26987,7 +27333,7 @@ function buildAppointmentStaffNavPlan(resourceId) {
|
|
|
26987
27333
|
destination: { kind: "appointments_calendar" }
|
|
26988
27334
|
}, {
|
|
26989
27335
|
id: "team.availability",
|
|
26990
|
-
label: "
|
|
27336
|
+
label: "Your hours and details",
|
|
26991
27337
|
destination: resourceId ? {
|
|
26992
27338
|
kind: "appointment_resource_availability",
|
|
26993
27339
|
resourceId
|
|
@@ -27417,20 +27763,21 @@ function isDemoShopNavSurfaceVisible(mode, surfaceId) {
|
|
|
27417
27763
|
|
|
27418
27764
|
//#endregion
|
|
27419
27765
|
//#region ../api/src/navigation/dashboardBookingsNav.ts
|
|
27766
|
+
function staffScopedBookingsNavPolicy(modules, staffScope) {
|
|
27767
|
+
return {
|
|
27768
|
+
kind: "staff_scoped",
|
|
27769
|
+
appointments: modules.appointments && hasAppointmentStaffAccess(staffScope) ? {
|
|
27770
|
+
kind: "calendar",
|
|
27771
|
+
ownResourceId: getOwnAppointmentResourceId(staffScope)
|
|
27772
|
+
} : { kind: "hidden" },
|
|
27773
|
+
packages: modules.appointments && hasPackageStaffAccess(staffScope),
|
|
27774
|
+
services: modules.appointments && hasOwnOfferingsAccess(staffScope)
|
|
27775
|
+
};
|
|
27776
|
+
}
|
|
27420
27777
|
function resolveDashboardBookingsNavPolicy(modules, ctx) {
|
|
27421
27778
|
const { role } = ctx;
|
|
27422
27779
|
const { showStaffScopedNavigation, staffScope } = ctx.teamMember;
|
|
27423
|
-
|
|
27424
|
-
if (showStaffScopedNavigation && isStaffScoped(staffScope)) {
|
|
27425
|
-
return {
|
|
27426
|
-
kind: "staff_scoped",
|
|
27427
|
-
appointments: modules.appointments && hasAppointmentStaffAccess(staffScope) ? {
|
|
27428
|
-
kind: "calendar",
|
|
27429
|
-
ownResourceId
|
|
27430
|
-
} : { kind: "hidden" },
|
|
27431
|
-
packages: modules.appointments && hasPackageStaffAccess(staffScope)
|
|
27432
|
-
};
|
|
27433
|
-
}
|
|
27780
|
+
if (showStaffScopedNavigation && isStaffScoped(staffScope)) return staffScopedBookingsNavPolicy(modules, staffScope);
|
|
27434
27781
|
if (modules.appointments) {
|
|
27435
27782
|
return {
|
|
27436
27783
|
kind: "full",
|
|
@@ -27452,7 +27799,7 @@ function buildDashboardBookingsNavPlan(modules, ctx, catalogue) {
|
|
|
27452
27799
|
return buildStaffScopedBookingsNavPlan(policy);
|
|
27453
27800
|
}
|
|
27454
27801
|
const hasEnabledModules = modules.appointments || modules.events;
|
|
27455
|
-
const groups =
|
|
27802
|
+
const groups = glanceGroups(hasEnabledModules, ctx.publicExperience);
|
|
27456
27803
|
groups.push({
|
|
27457
27804
|
label: "Events",
|
|
27458
27805
|
items: modules.events ? [
|
|
@@ -27476,11 +27823,15 @@ function buildDashboardBookingsNavPlan(modules, ctx, catalogue) {
|
|
|
27476
27823
|
"check in",
|
|
27477
27824
|
"tickets",
|
|
27478
27825
|
"attendees"
|
|
27479
|
-
]
|
|
27826
|
+
],
|
|
27827
|
+
...ctx.publicExperience === "hosted_booking" ? { unlisted: true } : {}
|
|
27480
27828
|
}
|
|
27481
27829
|
] : [{
|
|
27482
27830
|
label: "Enable events",
|
|
27483
|
-
destination: {
|
|
27831
|
+
destination: {
|
|
27832
|
+
kind: "booking_settings",
|
|
27833
|
+
section: "basics"
|
|
27834
|
+
},
|
|
27484
27835
|
keywords: [
|
|
27485
27836
|
"enable",
|
|
27486
27837
|
"setup",
|
|
@@ -27490,68 +27841,113 @@ function buildDashboardBookingsNavPlan(modules, ctx, catalogue) {
|
|
|
27490
27841
|
]
|
|
27491
27842
|
}]
|
|
27492
27843
|
});
|
|
27493
|
-
|
|
27844
|
+
const appointmentsGroup = buildAppointmentsNavGroup(policy.appointments, ctx.soloSite === true);
|
|
27845
|
+
if (appointmentsGroup) groups.push(appointmentsGroup);
|
|
27846
|
+
if (hasEnabledModules) {
|
|
27494
27847
|
groups.push({
|
|
27495
|
-
label: "
|
|
27496
|
-
items: [
|
|
27497
|
-
|
|
27498
|
-
|
|
27499
|
-
|
|
27500
|
-
|
|
27501
|
-
|
|
27502
|
-
|
|
27503
|
-
|
|
27504
|
-
|
|
27505
|
-
|
|
27506
|
-
|
|
27507
|
-
|
|
27508
|
-
|
|
27509
|
-
|
|
27510
|
-
|
|
27511
|
-
|
|
27512
|
-
|
|
27513
|
-
|
|
27514
|
-
},
|
|
27515
|
-
{
|
|
27516
|
-
label: policy.appointments.resourceLabel,
|
|
27517
|
-
destination: { kind: "appointment_resources" },
|
|
27518
|
-
keywords: [
|
|
27519
|
-
"staff",
|
|
27520
|
-
"practitioners",
|
|
27521
|
-
"coaches",
|
|
27522
|
-
"providers",
|
|
27523
|
-
"resources"
|
|
27524
|
-
]
|
|
27525
|
-
},
|
|
27526
|
-
...policy.appointments.soloAvailabilityResourceId ? [{
|
|
27527
|
-
label: "My availability",
|
|
27528
|
-
destination: {
|
|
27529
|
-
kind: "appointment_resource_availability",
|
|
27530
|
-
resourceId: policy.appointments.soloAvailabilityResourceId
|
|
27531
|
-
},
|
|
27532
|
-
keywords: [
|
|
27533
|
-
"hours",
|
|
27534
|
-
"unavailable",
|
|
27535
|
-
"scheduling"
|
|
27536
|
-
]
|
|
27537
|
-
}] : [],
|
|
27538
|
-
{
|
|
27539
|
-
label: "Forms",
|
|
27540
|
-
destination: { kind: "booking_forms" },
|
|
27541
|
-
keywords: [
|
|
27542
|
-
"intake",
|
|
27543
|
-
"custom fields",
|
|
27544
|
-
"questionnaire"
|
|
27545
|
-
]
|
|
27546
|
-
}
|
|
27547
|
-
]
|
|
27848
|
+
label: "Products",
|
|
27849
|
+
items: [bookingProductsItem(modules), ...buildSellingProductsNavItems(ctx)]
|
|
27850
|
+
}, {
|
|
27851
|
+
label: "People",
|
|
27852
|
+
items: [{
|
|
27853
|
+
label: "People",
|
|
27854
|
+
destination: { kind: "booking_people" },
|
|
27855
|
+
keywords: [
|
|
27856
|
+
"customers",
|
|
27857
|
+
"clients",
|
|
27858
|
+
"members",
|
|
27859
|
+
"attendees",
|
|
27860
|
+
"contacts",
|
|
27861
|
+
"guests"
|
|
27862
|
+
]
|
|
27863
|
+
}]
|
|
27864
|
+
}, {
|
|
27865
|
+
label: "Settings",
|
|
27866
|
+
items: [buildBookingSettingsNavItem(modules)]
|
|
27548
27867
|
});
|
|
27549
|
-
|
|
27550
|
-
|
|
27868
|
+
if (!(ctx.soloSite && policy.appointments.kind === "active")) {
|
|
27869
|
+
groups.push({
|
|
27870
|
+
label: "Availability",
|
|
27871
|
+
items: [closuresNavItem(ctx.soloSite === true)]
|
|
27872
|
+
});
|
|
27873
|
+
}
|
|
27874
|
+
}
|
|
27875
|
+
return groups;
|
|
27876
|
+
}
|
|
27877
|
+
/** What the sidebar lists: the plan without its unlisted items. */
|
|
27878
|
+
function listedBookingsNavGroups(groups) {
|
|
27879
|
+
return groups.map((group) => ({
|
|
27880
|
+
...group,
|
|
27881
|
+
items: group.items.filter((item) => !item.unlisted)
|
|
27882
|
+
})).filter((group) => group.items.length > 0);
|
|
27883
|
+
}
|
|
27884
|
+
const BOOKING_SETTINGS_SECTION_KEYWORDS = {
|
|
27885
|
+
basics: [
|
|
27886
|
+
"defaults",
|
|
27887
|
+
"timezone",
|
|
27888
|
+
"profile",
|
|
27889
|
+
"calendar",
|
|
27890
|
+
"waitlists"
|
|
27891
|
+
],
|
|
27892
|
+
payments: [
|
|
27893
|
+
"currency",
|
|
27894
|
+
"payments",
|
|
27895
|
+
"refunds",
|
|
27896
|
+
"money",
|
|
27897
|
+
"payment options"
|
|
27898
|
+
],
|
|
27899
|
+
events: [
|
|
27900
|
+
"event defaults",
|
|
27901
|
+
"ticketing",
|
|
27902
|
+
"registration",
|
|
27903
|
+
"categories",
|
|
27904
|
+
"event policies"
|
|
27905
|
+
],
|
|
27906
|
+
appointments: [
|
|
27907
|
+
"appointment defaults",
|
|
27908
|
+
"notice",
|
|
27909
|
+
"rescheduling",
|
|
27910
|
+
"policies"
|
|
27911
|
+
],
|
|
27912
|
+
messages: [
|
|
27913
|
+
"emails",
|
|
27914
|
+
"notifications",
|
|
27915
|
+
"reminders",
|
|
27916
|
+
"feedback",
|
|
27917
|
+
"follow-up"
|
|
27918
|
+
]
|
|
27919
|
+
};
|
|
27920
|
+
/** One sidebar link to the settings area; search still finds each section inside it. */
|
|
27921
|
+
function buildBookingSettingsNavItem(modules) {
|
|
27922
|
+
const sections = visibleBookingSettingsSections(modules);
|
|
27923
|
+
return {
|
|
27924
|
+
label: "Settings",
|
|
27925
|
+
icon: "settings",
|
|
27926
|
+
destination: {
|
|
27927
|
+
kind: "booking_settings",
|
|
27928
|
+
section: "basics"
|
|
27929
|
+
},
|
|
27930
|
+
keywords: sections.flatMap((section) => [BOOKING_SETTINGS_SECTION_LABELS[section], ...BOOKING_SETTINGS_SECTION_KEYWORDS[section]]),
|
|
27931
|
+
tabs: sections.map((section) => ({
|
|
27932
|
+
label: BOOKING_SETTINGS_SECTION_LABELS[section],
|
|
27933
|
+
destination: {
|
|
27934
|
+
kind: "booking_settings",
|
|
27935
|
+
section
|
|
27936
|
+
}
|
|
27937
|
+
}))
|
|
27938
|
+
};
|
|
27939
|
+
}
|
|
27940
|
+
function buildAppointmentsNavGroup(policy, soloSite) {
|
|
27941
|
+
if (policy.kind === "hidden") return null;
|
|
27942
|
+
if (policy.kind === "owner_setup") {
|
|
27943
|
+
return {
|
|
27551
27944
|
label: "Appointments",
|
|
27552
27945
|
items: [{
|
|
27553
27946
|
label: "Enable appointments",
|
|
27554
|
-
destination: {
|
|
27947
|
+
destination: {
|
|
27948
|
+
kind: "booking_settings",
|
|
27949
|
+
section: "basics"
|
|
27950
|
+
},
|
|
27555
27951
|
keywords: [
|
|
27556
27952
|
"enable",
|
|
27557
27953
|
"setup",
|
|
@@ -27560,121 +27956,93 @@ function buildDashboardBookingsNavPlan(modules, ctx, catalogue) {
|
|
|
27560
27956
|
"get started"
|
|
27561
27957
|
]
|
|
27562
27958
|
}]
|
|
27563
|
-
}
|
|
27959
|
+
};
|
|
27564
27960
|
}
|
|
27565
|
-
|
|
27566
|
-
|
|
27961
|
+
return {
|
|
27962
|
+
label: "Appointments",
|
|
27963
|
+
items: [
|
|
27567
27964
|
{
|
|
27568
|
-
label: "
|
|
27569
|
-
destination: {
|
|
27570
|
-
kind: "booking_settings",
|
|
27571
|
-
section: "basics"
|
|
27572
|
-
},
|
|
27965
|
+
label: "Appointments",
|
|
27966
|
+
destination: { kind: "appointments_calendar" },
|
|
27573
27967
|
keywords: [
|
|
27574
|
-
"
|
|
27575
|
-
"
|
|
27576
|
-
"
|
|
27577
|
-
"calendar",
|
|
27578
|
-
"waitlists"
|
|
27968
|
+
"appointments",
|
|
27969
|
+
"schedule",
|
|
27970
|
+
"bookings"
|
|
27579
27971
|
]
|
|
27580
27972
|
},
|
|
27581
27973
|
{
|
|
27582
|
-
label: "
|
|
27583
|
-
destination: {
|
|
27584
|
-
kind: "booking_settings",
|
|
27585
|
-
section: "payments"
|
|
27586
|
-
},
|
|
27974
|
+
label: "Services",
|
|
27975
|
+
destination: { kind: "appointment_services" },
|
|
27587
27976
|
keywords: [
|
|
27588
|
-
"
|
|
27589
|
-
"
|
|
27590
|
-
"
|
|
27591
|
-
"money",
|
|
27592
|
-
"payment options"
|
|
27977
|
+
"offerings",
|
|
27978
|
+
"packages",
|
|
27979
|
+
"types"
|
|
27593
27980
|
]
|
|
27594
27981
|
},
|
|
27595
|
-
|
|
27596
|
-
label:
|
|
27597
|
-
destination: {
|
|
27598
|
-
kind: "booking_settings",
|
|
27599
|
-
section: "events"
|
|
27600
|
-
},
|
|
27982
|
+
{
|
|
27983
|
+
label: policy.resourceLabel,
|
|
27984
|
+
destination: { kind: "appointment_resources" },
|
|
27601
27985
|
keywords: [
|
|
27602
|
-
"
|
|
27603
|
-
"
|
|
27604
|
-
"
|
|
27605
|
-
"
|
|
27606
|
-
"
|
|
27986
|
+
"staff",
|
|
27987
|
+
"practitioners",
|
|
27988
|
+
"coaches",
|
|
27989
|
+
"providers",
|
|
27990
|
+
"resources"
|
|
27607
27991
|
]
|
|
27608
|
-
}
|
|
27609
|
-
...
|
|
27610
|
-
label: "
|
|
27992
|
+
},
|
|
27993
|
+
...policy.soloAvailabilityResourceId ? [{
|
|
27994
|
+
label: "My availability",
|
|
27611
27995
|
destination: {
|
|
27612
|
-
kind: "
|
|
27613
|
-
|
|
27996
|
+
kind: "appointment_resource_availability",
|
|
27997
|
+
resourceId: policy.soloAvailabilityResourceId
|
|
27614
27998
|
},
|
|
27615
27999
|
keywords: [
|
|
27616
|
-
"
|
|
27617
|
-
"
|
|
27618
|
-
"
|
|
27619
|
-
"policies"
|
|
28000
|
+
"hours",
|
|
28001
|
+
"unavailable",
|
|
28002
|
+
"scheduling"
|
|
27620
28003
|
]
|
|
27621
28004
|
}] : [],
|
|
28005
|
+
...soloSite ? [closuresNavItem(true)] : [],
|
|
27622
28006
|
{
|
|
27623
|
-
label: "
|
|
27624
|
-
destination: {
|
|
27625
|
-
kind: "booking_settings",
|
|
27626
|
-
section: "messages"
|
|
27627
|
-
},
|
|
28007
|
+
label: "Forms",
|
|
28008
|
+
destination: { kind: "booking_forms" },
|
|
27628
28009
|
keywords: [
|
|
27629
|
-
"
|
|
27630
|
-
"
|
|
27631
|
-
"
|
|
27632
|
-
|
|
27633
|
-
|
|
27634
|
-
]
|
|
28010
|
+
"intake",
|
|
28011
|
+
"custom fields",
|
|
28012
|
+
"questionnaire"
|
|
28013
|
+
],
|
|
28014
|
+
unlisted: true
|
|
27635
28015
|
}
|
|
27636
|
-
]
|
|
27637
|
-
|
|
27638
|
-
|
|
27639
|
-
|
|
27640
|
-
|
|
27641
|
-
|
|
27642
|
-
|
|
27643
|
-
|
|
27644
|
-
|
|
27645
|
-
|
|
27646
|
-
|
|
27647
|
-
|
|
27648
|
-
|
|
27649
|
-
|
|
27650
|
-
|
|
27651
|
-
|
|
27652
|
-
|
|
27653
|
-
|
|
27654
|
-
|
|
27655
|
-
label: "Settings",
|
|
27656
|
-
items: settingsItems
|
|
27657
|
-
}, {
|
|
27658
|
-
label: "Availability",
|
|
27659
|
-
items: [{
|
|
27660
|
-
label: "Closures",
|
|
27661
|
-
destination: { kind: "booking_closures" },
|
|
27662
|
-
keywords: [
|
|
27663
|
-
"holidays",
|
|
27664
|
-
"blackouts",
|
|
27665
|
-
"days off",
|
|
27666
|
-
"pause bookings"
|
|
27667
|
-
]
|
|
27668
|
-
}]
|
|
27669
|
-
});
|
|
27670
|
-
}
|
|
27671
|
-
return groups;
|
|
28016
|
+
]
|
|
28017
|
+
};
|
|
28018
|
+
}
|
|
28019
|
+
/** "Time off" for one person, "Closures" for a business with a team; search finds either. */
|
|
28020
|
+
function closuresNavItem(solo) {
|
|
28021
|
+
return {
|
|
28022
|
+
label: solo ? "Time off" : "Closures",
|
|
28023
|
+
destination: { kind: "booking_closures" },
|
|
28024
|
+
keywords: [
|
|
28025
|
+
"closures",
|
|
28026
|
+
"time off",
|
|
28027
|
+
"holiday",
|
|
28028
|
+
"holidays",
|
|
28029
|
+
"away",
|
|
28030
|
+
"blackouts",
|
|
28031
|
+
"days off",
|
|
28032
|
+
"pause bookings"
|
|
28033
|
+
]
|
|
28034
|
+
};
|
|
27672
28035
|
}
|
|
27673
28036
|
/** At a glance: the bookings Overview, and the Timetable once anything can be booked. */
|
|
27674
|
-
|
|
28037
|
+
/** A booking page with no modules has nothing here, so the group goes rather than sitting empty. */
|
|
28038
|
+
function glanceGroups(hasEnabledModules, publicExperience) {
|
|
28039
|
+
const group = buildOverviewNavGroup(hasEnabledModules, publicExperience);
|
|
28040
|
+
return group.items.length > 0 ? [group] : [];
|
|
28041
|
+
}
|
|
28042
|
+
function buildOverviewNavGroup(hasEnabledModules, publicExperience) {
|
|
27675
28043
|
return {
|
|
27676
28044
|
label: "At a glance",
|
|
27677
|
-
items: [{
|
|
28045
|
+
items: [...publicExperience === "hosted_booking" ? [] : [{
|
|
27678
28046
|
label: "Overview",
|
|
27679
28047
|
destination: { kind: "bookings_dashboard" },
|
|
27680
28048
|
keywords: [
|
|
@@ -27682,7 +28050,7 @@ function buildOverviewNavGroup(hasEnabledModules) {
|
|
|
27682
28050
|
"summary",
|
|
27683
28051
|
"activity"
|
|
27684
28052
|
]
|
|
27685
|
-
}, ...hasEnabledModules ? [{
|
|
28053
|
+
}], ...hasEnabledModules ? [{
|
|
27686
28054
|
label: "Timetable",
|
|
27687
28055
|
destination: { kind: "timetable" },
|
|
27688
28056
|
keywords: [
|
|
@@ -27697,8 +28065,18 @@ function buildOverviewNavGroup(hasEnabledModules) {
|
|
|
27697
28065
|
};
|
|
27698
28066
|
}
|
|
27699
28067
|
function buildStaffScopedBookingsNavPlan(policy) {
|
|
27700
|
-
return [...policy.appointments.kind === "calendar" ? [buildStaffAppointmentsNavGroup(policy.appointments.ownResourceId)] : [], ...policy.packages ? [staffPackagesNavGroup] : []];
|
|
28068
|
+
return [...policy.appointments.kind === "calendar" ? [buildStaffAppointmentsNavGroup(policy.appointments.ownResourceId, !policy.packages)] : [], ...policy.packages ? [policy.services ? staffServicesAndPackagesNavGroup : staffPackagesNavGroup] : []];
|
|
27701
28069
|
}
|
|
28070
|
+
const staffClientsNavItem = {
|
|
28071
|
+
label: "My Clients",
|
|
28072
|
+
destination: { kind: "booking_people" },
|
|
28073
|
+
keywords: [
|
|
28074
|
+
"clients",
|
|
28075
|
+
"customers",
|
|
28076
|
+
"people",
|
|
28077
|
+
"sessions left"
|
|
28078
|
+
]
|
|
28079
|
+
};
|
|
27702
28080
|
const staffPackagesNavGroup = {
|
|
27703
28081
|
label: "Packages",
|
|
27704
28082
|
items: [{
|
|
@@ -27710,18 +28088,22 @@ const staffPackagesNavGroup = {
|
|
|
27710
28088
|
"bundles",
|
|
27711
28089
|
"sell"
|
|
27712
28090
|
]
|
|
27713
|
-
},
|
|
27714
|
-
|
|
27715
|
-
|
|
28091
|
+
}, staffClientsNavItem]
|
|
28092
|
+
};
|
|
28093
|
+
const staffServicesAndPackagesNavGroup = {
|
|
28094
|
+
label: "Services and packages",
|
|
28095
|
+
items: [{
|
|
28096
|
+
label: "Services",
|
|
28097
|
+
destination: { kind: "appointment_services" },
|
|
27716
28098
|
keywords: [
|
|
27717
|
-
"
|
|
27718
|
-
"
|
|
27719
|
-
"
|
|
27720
|
-
"
|
|
28099
|
+
"services",
|
|
28100
|
+
"sessions",
|
|
28101
|
+
"prices",
|
|
28102
|
+
"offer"
|
|
27721
28103
|
]
|
|
27722
|
-
}]
|
|
28104
|
+
}, ...staffPackagesNavGroup.items]
|
|
27723
28105
|
};
|
|
27724
|
-
function buildStaffAppointmentsNavGroup(ownResourceId) {
|
|
28106
|
+
function buildStaffAppointmentsNavGroup(ownResourceId, includeClients) {
|
|
27725
28107
|
const appointmentItems = [{
|
|
27726
28108
|
label: "Appointments",
|
|
27727
28109
|
destination: { kind: "appointments_calendar" },
|
|
@@ -27733,7 +28115,7 @@ function buildStaffAppointmentsNavGroup(ownResourceId) {
|
|
|
27733
28115
|
}];
|
|
27734
28116
|
if (ownResourceId) {
|
|
27735
28117
|
appointmentItems.push({
|
|
27736
|
-
label: "
|
|
28118
|
+
label: "Your hours and details",
|
|
27737
28119
|
destination: {
|
|
27738
28120
|
kind: "appointment_resource_availability",
|
|
27739
28121
|
resourceId: ownResourceId
|
|
@@ -27752,11 +28134,16 @@ function buildStaffAppointmentsNavGroup(ownResourceId) {
|
|
|
27752
28134
|
}
|
|
27753
28135
|
return {
|
|
27754
28136
|
label: "Appointments",
|
|
27755
|
-
items: appointmentItems
|
|
28137
|
+
items: includeClients ? [...appointmentItems, staffClientsNavItem] : appointmentItems
|
|
27756
28138
|
};
|
|
27757
28139
|
}
|
|
27758
|
-
|
|
27759
|
-
|
|
28140
|
+
/** The same name the page itself uses, for the kinds this site can sell. */
|
|
28141
|
+
function bookingProductsLabel(modules) {
|
|
28142
|
+
if (modules.events && modules.appointments) return "Passes, packages & memberships";
|
|
28143
|
+
return modules.appointments ? "Packages" : "Passes & memberships";
|
|
28144
|
+
}
|
|
28145
|
+
const bookingProductsItem = (modules) => ({
|
|
28146
|
+
label: bookingProductsLabel(modules),
|
|
27760
28147
|
destination: { kind: "booking_products" },
|
|
27761
28148
|
keywords: [
|
|
27762
28149
|
"passes",
|
|
@@ -27769,7 +28156,7 @@ const bookingProductsItem = {
|
|
|
27769
28156
|
"recurring",
|
|
27770
28157
|
"unlimited"
|
|
27771
28158
|
]
|
|
27772
|
-
};
|
|
28159
|
+
});
|
|
27773
28160
|
function buildEventNavItems(catalogue) {
|
|
27774
28161
|
const entries = catalogue.source === "generic" ? catalogue.entries.filter(({ preset }) => preset === "course") : catalogue.entries;
|
|
27775
28162
|
return [
|
|
@@ -27815,7 +28202,8 @@ function buildPageSectionsNavItems(ctx) {
|
|
|
27815
28202
|
"sections",
|
|
27816
28203
|
"event template",
|
|
27817
28204
|
"faq"
|
|
27818
|
-
]
|
|
28205
|
+
],
|
|
28206
|
+
...ctx.publicExperience === "hosted_booking" ? { unlisted: true } : {}
|
|
27819
28207
|
}];
|
|
27820
28208
|
}
|
|
27821
28209
|
function buildEventSeriesPresetNavItem(entry) {
|
|
@@ -34276,4 +34664,4 @@ function optionalTitle(data) {
|
|
|
34276
34664
|
}
|
|
34277
34665
|
|
|
34278
34666
|
//#endregion
|
|
34279
|
-
export { normalizeMediaValueToIdentifierOnly as $,
|
|
34667
|
+
export { normalizeMediaValueToIdentifierOnly as $, ManagementApiError as $n, publicEventLoaderQuerySchemaShape as $r, CommandFailure as $t, formatDiffDetail as A, getEnvironmentDebugInfo as An, getStripeMinimumChargeRequirement as Ar, navigationIdentity as At, buildFieldChanges as B, bindingSchema as Bn, publicPassProductSchema as Br, ACCOUNT_SITE_LIST_LIMIT_MIN as Bt, reportFromOutcomes as C, withRiverbankEnv as Cn, planCheckoutPaymentFlow as Cr, fileExists$1 as Ct, normalizeRemoteHomepageReference as D, CliExit as Dn, repriceBookingCollectionOptions as Dr, writeJsonFileAtomic as Dt, createEmptySyncResult as E, transportSuggestion as En, isBookingCollectionEquivalentToUpfront as Er, writeJsonFile$1 as Et, calculatePullDiff as F, cardListFamilyBlocks as Fn, eventCalendarListLayoutCompatibleDisplayModeValues as Fr, AccountApiMalformedResponseError as Ft, syncLocalMediaForPull as G, fieldSchema as Gn, calendarMonthDate as Gr, applyPushConfigPlan as Gt, formatFieldPath as H, blockCategoryEnum as Hn, purchasablePublicMembershipProductSchema as Hr, ACCOUNT_SITE_TITLE_MAX_LENGTH as Ht, buildJsonDiff as I, cardListKnobBlocks as In, eventCalendarListLayoutValues as Ir, createBearerAccountApi as It, admitBinaryWriteDestination as J, parseRepeaterGridInteger as Jn, eventScheduleScopeValues as Jr, preparePushConfigTarget as Jt, applyLocalMediaPush as K, MAX_REPEATER_GRID_COLUMNS as Kn, calendarMonthWindowSchema as Kr, createPushConfigCommand as Kt, hasPageOperations as L, lookKnobBlocks as Ln, publicMapLocationResultSchema as Lr, ACCOUNT_SITE_CURSOR_MAX_LENGTH as Lt, hasPendingChanges as M, isRemoteConfigured as Mn, MAX_EVENT_BOOKING_SELECTION_ITEMS as Mr, convertPulledFooterToLocal as Mt, findChangedFieldsWithValues as N, loadSdkEnvironment as Nn, eventCalendarDefaultViewValues as Nr, convertPulledNavigationToLocal as Nt, calculateDiff as O, createOutput as On, resolveAvailableBookingCollectionOptions as Or, isMediaValue as Ot, formatHumanDiff as P, cardListBlockParts as Pn, eventCalendarDisplayModeValues as Pr, convertPulledPagesToLocal as Pt, normalizeMediaIdentifierInput as Q, visibilityLevels as Qn, normalizeCalendarFilterId as Qr, mapEnvironmentExecutionOutcomesJson as Qt, pageMetadataForUpsert as R, NodeSchema as Rn, publicVenueMapLocationSchema as Rr, ACCOUNT_SITE_LIST_LIMIT_DEFAULT as Rt, planCliCommandBatchForBindings as S, requireEnvironmentWriteAuthorization as Sn, unsafeAsPositiveCheckoutQuantity as Sr, ensureDir$1 as St, executeResidualSettingsSyncPlan as T, formatError as Tn, flexibleBalanceDueDay as Tr, readJsonFile as Tt, revalidateLocalMediaPushPlan as U, blockContentSourceSchema as Un, purchasablePublicPassProductSchema as Ur, navigationCommandItemToManagementInput as Ut, formatFieldChange as V, DEFAULT_MEDIA_FIELD_KINDS as Vn, publicProductSchema as Vr, ACCOUNT_SITE_SEARCH_MAX_LENGTH as Vt, syncLocalMediaForPush as W, blockRequiredFeatureSchema as Wn, CALENDAR_SSR_PAGE_SIZE as Wr, normalizeNavigationConfigItemForCommand as Wt, writeBinaryFileAtomic as X, resolveRepeaterGridRowFieldId as Xn, eventSurfaceScopeValues as Xr, createBearerAPIClient as Xt, readStableBinaryFile as Y, resolveRepeaterGridColumnFieldId as Yn, eventSurfacePresetValues as Yr, revalidatePushConfigPlan as Yt, sha256 as Z, resolveRepeaterGridSpanFieldId as Zn, monthNumber as Zr, deriveCmsApiUrlFromDashboardUrl as Zt, commandExecutionToReport as _, runWithInvocation as _n, checkoutStatusArms as _r, metadataFilePath as _t, executeEntryCommandPlanAsReport as a, bindRequestTimeout as an, sdkSettingsUpdateSchema as ar, readEntries as at, executeCompiledCliCommandPlanAsReport as b, planEnvironmentExecution as bn, eventRegistrationErrors as br, writeMetadataFile as bt, titleFromEntryData as c, currentInvocationEnvelope as cn, pageDesignDecisionsV2Schema as cr, readEventsMeta as ct, unsafeAsCliEntryIdentifier as d, loadManagementTarget as dn, API_ENDPOINTS as dr, readNavigationMeta as dt, ApiEnvelopeError as ei, commandContexts as en, extractApiErrorMessage as er, walkLocalContentMedia as et, unsafeAsCliFormSlug as f, managementClientFor as fn, areEventBookingRequirementsIdentical as fr, readPagesMeta as ft, commandCompileFailureToReport as g, resolveCommandPath as gn, resolveSelectionAttendanceMode as gr, ensureMetadataDir as gt, mutationCounterForEffect as h, parseJsonData as hn, decideSelectionAttendance as hr, writeMediaManifest as ht, entrySiteCommandTypes as i, renderedByOwner as in, sdkEventScheduleSchema as ir, findLegacyEntryFiles as it, formatDiffSummary as j, isLocalConfigured as jn, getBookingLaterInstalments as jr, navigationIdentityMap as jt, calculateFooterDiff as k, getEnvPrefix as kn, resolveBookingCollectionOptionFacts as kr, duplicateNavigationIdentityMessage as kt, unsafeAsCliBlockIdentifier as l, formatDateShort as ln, pageDesignIntentSchemaVersion as lr, readFooterMeta as lt, commandReportToSyncResult as m, parseJsonArray as mn, INCOMPATIBLE_ATTENDANCE_MESSAGE as mr, readVenuesMeta as mt, entryCommandCompileErrorToReport as n, defineCommandGroup as nn, isRecord$5 as nr, downloadMedia as nt, executeEntryCommandPlanAsSyncResult as o, confirmAction as on, linkPayloadSchema as or, readAllMeta as ot, unsafeAsCliPageIdentifier as p, mapEntryForOutput as pn, eventBookingConsentContentKey as pr, readSettingsMeta as pt, prepareLocalMediaForPush as q, isAcceptedRepeaterGridSpan as qn, calendarSourceCursorSchema as qr, loadPushConfigTarget as qt, entryCommandReportToSyncResult as r, registerCommand as rn, ApiRequestError as rr, extractMediaIdentifiers as rt, syncResultForEntryCommandCompileError as s, createOutputForCommand as sn, portablePageDesignSchema as sr, readEventCategoriesMeta as st, compileEntryPushCommands as t, unwrapResponse as ti, defineCommand as tn, normalizeApiError as tr, buildStorageUrl as tt, unsafeAsCliContentTypeKey as u, handleCommandError as un, sdkConfiguredBookingVerticalConfigSchema as ur, readFormsMeta as ut, commandReportHasFailures as v, executeEnvironmentPlan as vn, nextCombinationHint as vr, metadataTargetFromEnvironment as vt, mergeManySyncResults as w, ErrorCodes as wn, planFlexibleBalanceCreditFirst as wr, listFiles as wt, formatManagementError as x, planEnvironmentWriteAuthorization as xn, checkoutCopy as xr, writeMetadataRecordMap as xt, executeCliCommandPlan as y, parseEnvironmentSelection as yn, planSelectionCombinationPrices as yr, readMetadataFile as yt, calculateEntryDiffs as z, NodeTreeSchema as zn, publicMembershipProductSchema as zr, ACCOUNT_SITE_LIST_LIMIT_MAX as zt };
|