@riverbankcms/sdk 0.70.0 → 0.70.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_dts/ai/src/contracts/commandExposure.d.ts +8 -0
- package/dist/_dts/ai/src/contracts/feedback.d.ts +55 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +34764 -0
- package/dist/_dts/ai/src/contracts.d.ts +5 -0
- package/dist/_dts/ai/src/designer/rfc6902.d.ts +16 -0
- package/dist/_dts/ai/src/designer/themePatch.d.ts +50 -0
- package/dist/_dts/api/src/aiPlayground.d.ts +1 -1
- package/dist/_dts/api/src/appointmentSetup.d.ts +19 -0
- package/dist/_dts/api/src/availability.d.ts +84 -2
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +10 -1
- package/dist/_dts/api/src/contentRuntime.d.ts +1 -0
- package/dist/_dts/api/src/endpoints.d.ts +29 -0
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +4 -0
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +29 -1
- package/dist/_dts/api/src/types.d.ts +1 -1
- package/dist/_dts/billing/src/components/index.d.ts +41 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +219 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +3 -1
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +3 -1
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/styleConfiguratorApplyPayload.d.ts +8 -0
- package/dist/_dts/preview-next/src/client/preview/styleConfiguratorSnapshot.d.ts +1 -0
- package/dist/_dts/sdk/src/cli/commands/style.d.ts +19 -0
- package/dist/_dts/sdk/src/client/management/index.d.ts +2 -1
- package/dist/_dts/sdk/src/client/management/theme.d.ts +3 -1
- package/dist/_dts/sdk/src/client/management/types.d.ts +23 -0
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +1 -0
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/site-commands/src/commands.d.ts +25 -7
- package/dist/_dts/site-commands/src/metadata.d.ts +2 -2
- package/dist/cli/index.mjs +168 -10
- package/dist/client/client.mjs +56 -2
- package/dist/client/hooks.mjs +55 -1
- package/dist/client/rendering.mjs +55 -1
- package/dist/preview-next/before-render.mjs +39 -0
- package/dist/preview-next/client/runtime.mjs +152 -38
- package/dist/preview-next/middleware.mjs +39 -0
- package/dist/server/components.mjs +55 -1
- package/dist/server/config-validation.mjs +55 -1
- package/dist/server/config.mjs +55 -1
- package/dist/server/data.mjs +55 -1
- package/dist/server/index.mjs +40 -1
- package/dist/server/next.mjs +56 -2
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +55 -1
- package/dist/server/rendering.mjs +55 -1
- package/dist/server/routing.mjs +56 -2
- package/dist/server/server.mjs +56 -2
- package/package.json +1 -1
|
@@ -1399,6 +1399,24 @@ var init_endpoints = __esm({
|
|
|
1399
1399
|
"server:internal_error"
|
|
1400
1400
|
]
|
|
1401
1401
|
},
|
|
1402
|
+
setServiceSpecificAvailability: {
|
|
1403
|
+
path: "/sites/{siteId}/bookings/resources/{resourceId}/service-availability",
|
|
1404
|
+
method: "PUT",
|
|
1405
|
+
auth: "user",
|
|
1406
|
+
responseKind: "json",
|
|
1407
|
+
errors: [
|
|
1408
|
+
"validation:invalid_input",
|
|
1409
|
+
"resource:not_found",
|
|
1410
|
+
"server:internal_error"
|
|
1411
|
+
]
|
|
1412
|
+
},
|
|
1413
|
+
deleteServiceSpecificAvailability: {
|
|
1414
|
+
path: "/sites/{siteId}/bookings/resources/{resourceId}/service-availability/{scheduleId}",
|
|
1415
|
+
method: "DELETE",
|
|
1416
|
+
auth: "user",
|
|
1417
|
+
responseKind: "json",
|
|
1418
|
+
errors: ["resource:not_found", "server:internal_error"]
|
|
1419
|
+
},
|
|
1402
1420
|
listBlackouts: {
|
|
1403
1421
|
path: "/sites/{siteId}/bookings/resources/{resourceId}/blackouts",
|
|
1404
1422
|
method: "GET",
|
|
@@ -3034,6 +3052,20 @@ var init_endpoints = __esm({
|
|
|
3034
3052
|
auth: "user",
|
|
3035
3053
|
responseKind: "json"
|
|
3036
3054
|
},
|
|
3055
|
+
applySiteStyleSelection: {
|
|
3056
|
+
path: "/sites/{siteId}/theme/style-selection/apply",
|
|
3057
|
+
method: "POST",
|
|
3058
|
+
tags: [TAG_TEMPLATES.siteCollection, TAG_TEMPLATES.siteTheme],
|
|
3059
|
+
auth: "user",
|
|
3060
|
+
errors: [
|
|
3061
|
+
"validation:invalid_input",
|
|
3062
|
+
"auth:forbidden",
|
|
3063
|
+
"resource:not_found",
|
|
3064
|
+
"resource:conflict",
|
|
3065
|
+
"server:internal_error"
|
|
3066
|
+
],
|
|
3067
|
+
responseKind: "json"
|
|
3068
|
+
},
|
|
3037
3069
|
saveSiteChromeLookSelection: {
|
|
3038
3070
|
path: "/sites/{siteId}/theme/site-chrome-look",
|
|
3039
3071
|
method: "POST",
|
|
@@ -5777,6 +5809,13 @@ var init_endpoints = __esm({
|
|
|
5777
5809
|
auth: "service",
|
|
5778
5810
|
responseKind: "json"
|
|
5779
5811
|
},
|
|
5812
|
+
sdkApplySiteStyleSelection: {
|
|
5813
|
+
path: "/sdk/{siteId}/theme/style-selection/apply",
|
|
5814
|
+
method: "POST",
|
|
5815
|
+
auth: "service",
|
|
5816
|
+
responseKind: "json",
|
|
5817
|
+
errors: ["validation:invalid_input", "resource:not_found", "resource:conflict", "server:internal_error"]
|
|
5818
|
+
},
|
|
5780
5819
|
sdkUpsertFooter: {
|
|
5781
5820
|
path: "/sdk/{siteId}/footer",
|
|
5782
5821
|
method: "POST",
|
|
@@ -186527,7 +186566,7 @@ var init_bookingVerticals = __esm({
|
|
|
186527
186566
|
);
|
|
186528
186567
|
}
|
|
186529
186568
|
});
|
|
186530
|
-
var APPOINTMENT_SETUP_MAX_MINUTES, appointmentSetupRefSchema, appointmentSetupVenueChoiceSchema, appointmentSetupPaymentDraftSchema, appointmentSetupServiceAssignmentDraftSchema, appointmentSetupServiceDraftSchema, appointmentSetupPractitionerDraftSchema, appointmentSetupWeeklyWindowDraftSchema, appointmentSetupAvailabilityDraftSchema, APPOINTMENT_DEFAULT_MIN_LEAD_MINUTES_MAX, APPOINTMENT_DEFAULT_MAX_BOOKING_NOTICE_MINUTES_MAX, appointmentSetupBookingNoticeSchema;
|
|
186569
|
+
var APPOINTMENT_SETUP_MAX_MINUTES, appointmentSetupRefSchema, appointmentSetupVenueChoiceSchema, appointmentSetupPaymentDraftSchema, appointmentSetupServiceAssignmentDraftSchema, appointmentSetupServiceDraftSchema, appointmentSetupPractitionerDraftSchema, appointmentSetupWeeklyWindowDraftSchema, appointmentSetupStartTimePolicyDraftSchema, appointmentSetupAvailabilityDraftSchema, APPOINTMENT_DEFAULT_MIN_LEAD_MINUTES_MAX, APPOINTMENT_DEFAULT_MAX_BOOKING_NOTICE_MINUTES_MAX, appointmentSetupBookingNoticeSchema;
|
|
186531
186570
|
var init_appointmentSetup = __esm({
|
|
186532
186571
|
"../api/src/appointmentSetup.ts"() {
|
|
186533
186572
|
init_envelope();
|
|
@@ -186606,11 +186645,26 @@ var init_appointmentSetup = __esm({
|
|
|
186606
186645
|
startTime: z.string(),
|
|
186607
186646
|
endTime: z.string()
|
|
186608
186647
|
});
|
|
186648
|
+
appointmentSetupStartTimePolicyDraftSchema = z.discriminatedUnion("kind", [
|
|
186649
|
+
z.object({ kind: z.literal("automatic_spacing") }),
|
|
186650
|
+
z.object({
|
|
186651
|
+
kind: z.literal("regular_interval"),
|
|
186652
|
+
intervalMinutes: z.union([
|
|
186653
|
+
z.literal(10),
|
|
186654
|
+
z.literal(15),
|
|
186655
|
+
z.literal(20),
|
|
186656
|
+
z.literal(30),
|
|
186657
|
+
z.literal(45),
|
|
186658
|
+
z.literal(60)
|
|
186659
|
+
])
|
|
186660
|
+
})
|
|
186661
|
+
]);
|
|
186609
186662
|
appointmentSetupAvailabilityDraftSchema = z.object({
|
|
186610
186663
|
kind: z.literal("weekly_windows"),
|
|
186611
186664
|
resourceRef: appointmentSetupRefSchema,
|
|
186612
186665
|
serviceRef: appointmentSetupRefSchema.nullable(),
|
|
186613
|
-
windows: z.array(appointmentSetupWeeklyWindowDraftSchema)
|
|
186666
|
+
windows: z.array(appointmentSetupWeeklyWindowDraftSchema),
|
|
186667
|
+
startTimePolicy: appointmentSetupStartTimePolicyDraftSchema.optional()
|
|
186614
186668
|
});
|
|
186615
186669
|
APPOINTMENT_DEFAULT_MIN_LEAD_MINUTES_MAX = 28 * 24 * 60;
|
|
186616
186670
|
APPOINTMENT_DEFAULT_MAX_BOOKING_NOTICE_MINUTES_MAX = 10 * 365 * 24 * 60;
|
|
@@ -207537,7 +207591,7 @@ function appendPaletteOverrideScopeNotice(notices, input) {
|
|
|
207537
207591
|
return [...notices, { kind }];
|
|
207538
207592
|
}
|
|
207539
207593
|
function selectionSnapshotsEqual(a2, b3) {
|
|
207540
|
-
return a2.siteStyleId === b3.siteStyleId && a2.selectionUpdatedAt === b3.selectionUpdatedAt && a2.headerLookId === b3.headerLookId && a2.footerLookId === b3.footerLookId && a2.buttonPersonalityId === b3.buttonPersonalityId && a2.paletteVariantId === b3.paletteVariantId && paletteOverridesEqual(a2.paletteOverrides, b3.paletteOverrides);
|
|
207594
|
+
return a2.siteStyleId === b3.siteStyleId && a2.selectionVersion === b3.selectionVersion && a2.selectionUpdatedAt === b3.selectionUpdatedAt && a2.headerLookId === b3.headerLookId && a2.footerLookId === b3.footerLookId && a2.buttonPersonalityId === b3.buttonPersonalityId && a2.paletteVariantId === b3.paletteVariantId && paletteOverridesEqual(a2.paletteOverrides, b3.paletteOverrides);
|
|
207541
207595
|
}
|
|
207542
207596
|
function paletteOverridesEqual(a2, b3) {
|
|
207543
207597
|
if (a2 === b3) return true;
|
|
@@ -207706,6 +207760,24 @@ var init_siteChromeLookRows = __esm({
|
|
|
207706
207760
|
}
|
|
207707
207761
|
});
|
|
207708
207762
|
|
|
207763
|
+
// ../preview-next/src/client/preview/styleConfiguratorApplyPayload.ts
|
|
207764
|
+
function buildApplySiteStyleSelectionBody(input) {
|
|
207765
|
+
return {
|
|
207766
|
+
siteStyleId: input.previewed.siteStyleId,
|
|
207767
|
+
buttonPersonalityId: input.previewed.buttonPersonalityId,
|
|
207768
|
+
paletteVariantId: input.previewed.paletteVariantId,
|
|
207769
|
+
paletteOverrides: input.previewed.paletteOverrides,
|
|
207770
|
+
headerLookId: input.previewed.headerLookId,
|
|
207771
|
+
footerLookId: input.previewed.footerLookId,
|
|
207772
|
+
baseSelectionVersion: input.base.selectionVersion,
|
|
207773
|
+
selectionId: input.selectionId ?? null
|
|
207774
|
+
};
|
|
207775
|
+
}
|
|
207776
|
+
var init_styleConfiguratorApplyPayload = __esm({
|
|
207777
|
+
"../preview-next/src/client/preview/styleConfiguratorApplyPayload.ts"() {
|
|
207778
|
+
}
|
|
207779
|
+
});
|
|
207780
|
+
|
|
207709
207781
|
// ../preview-next/src/client/preview/styleConfiguratorSnapshot.ts
|
|
207710
207782
|
function resolveStyleConfiguratorInitialSnapshot(input) {
|
|
207711
207783
|
const themeSiteStyleId = siteStyleIdFromTheme(input.theme);
|
|
@@ -207725,6 +207797,7 @@ function resolveStyleConfiguratorInitialSnapshot(input) {
|
|
|
207725
207797
|
const paletteChanged = input.initialSelections.paletteVariantId !== null && compiled.resolvedSelections.paletteVariantId !== input.initialSelections.paletteVariantId;
|
|
207726
207798
|
return {
|
|
207727
207799
|
siteStyleId: siteStyle.id,
|
|
207800
|
+
selectionVersion: input.initialSelections.selectionVersion ?? 0,
|
|
207728
207801
|
selectionUpdatedAt: input.initialSelections.selectionUpdatedAt ?? null,
|
|
207729
207802
|
headerLookId: compiled.requestedSelections.headerLookId,
|
|
207730
207803
|
footerLookId: compiled.requestedSelections.footerLookId,
|
|
@@ -207742,8 +207815,8 @@ function StyleConfigurator({
|
|
|
207742
207815
|
siteId,
|
|
207743
207816
|
apiClient,
|
|
207744
207817
|
theme,
|
|
207745
|
-
themeId,
|
|
207746
207818
|
selectionId,
|
|
207819
|
+
selectionVersion = null,
|
|
207747
207820
|
selectionUpdatedAt,
|
|
207748
207821
|
initialSelections,
|
|
207749
207822
|
headerSelectionContext,
|
|
@@ -207759,12 +207832,13 @@ function StyleConfigurator({
|
|
|
207759
207832
|
theme,
|
|
207760
207833
|
initialSelections: {
|
|
207761
207834
|
...initialSelections,
|
|
207835
|
+
selectionVersion: initialSelections.selectionVersion ?? selectionVersion ?? 0,
|
|
207762
207836
|
selectionUpdatedAt: initialSelections.selectionUpdatedAt ?? selectionUpdatedAt ?? null
|
|
207763
207837
|
},
|
|
207764
207838
|
headerSelectionContext,
|
|
207765
207839
|
footerSelectionContext
|
|
207766
207840
|
}),
|
|
207767
|
-
[footerSelectionContext, headerSelectionContext, theme, initialSelections, selectionUpdatedAt]
|
|
207841
|
+
[footerSelectionContext, headerSelectionContext, theme, initialSelections, selectionUpdatedAt, selectionVersion]
|
|
207768
207842
|
);
|
|
207769
207843
|
const [state, setState2] = useState(
|
|
207770
207844
|
() => baseSnapshot ? createStyleConfiguratorState(baseSnapshot) : null
|
|
@@ -207904,23 +207978,22 @@ function StyleConfigurator({
|
|
|
207904
207978
|
headerSelectionContext,
|
|
207905
207979
|
footerSelectionContext
|
|
207906
207980
|
});
|
|
207907
|
-
const body = {
|
|
207908
|
-
|
|
207909
|
-
|
|
207910
|
-
|
|
207911
|
-
|
|
207912
|
-
|
|
207913
|
-
|
|
207914
|
-
|
|
207915
|
-
|
|
207916
|
-
};
|
|
207981
|
+
const body = buildApplySiteStyleSelectionBody({
|
|
207982
|
+
base: live.base,
|
|
207983
|
+
previewed: {
|
|
207984
|
+
...previewed,
|
|
207985
|
+
buttonPersonalityId: compiled.resolvedSelections.buttonPersonalityId,
|
|
207986
|
+
paletteVariantId: compiled.resolvedSelections.paletteVariantId
|
|
207987
|
+
},
|
|
207988
|
+
selectionId
|
|
207989
|
+
});
|
|
207917
207990
|
await runnerRef.current.run({
|
|
207918
207991
|
optimistic: () => {
|
|
207919
207992
|
setState2((current) => current ? markApplySaving(current) : current);
|
|
207920
207993
|
},
|
|
207921
207994
|
network: async () => {
|
|
207922
207995
|
const response = await apiClient({
|
|
207923
|
-
endpoint: "
|
|
207996
|
+
endpoint: "applySiteStyleSelection",
|
|
207924
207997
|
params: { siteId },
|
|
207925
207998
|
body
|
|
207926
207999
|
});
|
|
@@ -207930,12 +208003,13 @@ function StyleConfigurator({
|
|
|
207930
208003
|
setState2(
|
|
207931
208004
|
(current) => current ? markApplySaved(current, {
|
|
207932
208005
|
siteStyleId: previewed.siteStyleId,
|
|
208006
|
+
selectionVersion: saved.selectionVersion,
|
|
207933
208007
|
selectionUpdatedAt: saved.selectionUpdatedAt ?? previewed.selectionUpdatedAt ?? null,
|
|
207934
|
-
buttonPersonalityId: saved.buttonPersonalityId
|
|
207935
|
-
paletteVariantId: saved.paletteVariantId
|
|
208008
|
+
buttonPersonalityId: saved.buttonPersonalityId,
|
|
208009
|
+
paletteVariantId: saved.paletteVariantId,
|
|
207936
208010
|
paletteOverrides: saved.paletteOverrides ?? null,
|
|
207937
|
-
headerLookId: saved.headerLookId
|
|
207938
|
-
footerLookId: saved.footerLookId
|
|
208011
|
+
headerLookId: saved.headerLookId,
|
|
208012
|
+
footerLookId: saved.footerLookId
|
|
207939
208013
|
}) : current
|
|
207940
208014
|
);
|
|
207941
208015
|
startRefreshTransition(() => {
|
|
@@ -207943,7 +208017,13 @@ function StyleConfigurator({
|
|
|
207943
208017
|
});
|
|
207944
208018
|
},
|
|
207945
208019
|
onError: (error) => {
|
|
207946
|
-
const
|
|
208020
|
+
const applyError = classifyStyleApplyError(error);
|
|
208021
|
+
if (applyError.kind === "stale") {
|
|
208022
|
+
startRefreshTransition(() => {
|
|
208023
|
+
router.refresh();
|
|
208024
|
+
});
|
|
208025
|
+
}
|
|
208026
|
+
const message2 = applyError.message;
|
|
207947
208027
|
setState2((current) => current ? markApplyFailed(current, message2) : current);
|
|
207948
208028
|
}
|
|
207949
208029
|
});
|
|
@@ -207954,8 +208034,7 @@ function StyleConfigurator({
|
|
|
207954
208034
|
router,
|
|
207955
208035
|
selectionId,
|
|
207956
208036
|
siteId,
|
|
207957
|
-
startRefreshTransition
|
|
207958
|
-
themeId
|
|
208037
|
+
startRefreshTransition
|
|
207959
208038
|
]);
|
|
207960
208039
|
if (!state || !baseSnapshot) {
|
|
207961
208040
|
return /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Loading design controls..." });
|
|
@@ -208307,6 +208386,25 @@ function PickerOption({ selected, label, description, swatch, onSelect, disabled
|
|
|
208307
208386
|
}
|
|
208308
208387
|
) });
|
|
208309
208388
|
}
|
|
208389
|
+
function classifyStyleApplyError(error) {
|
|
208390
|
+
if (isRecord16(error)) {
|
|
208391
|
+
const status = error.status;
|
|
208392
|
+
const code = error.code;
|
|
208393
|
+
if (status === 409 || code === "resource:conflict") {
|
|
208394
|
+
return {
|
|
208395
|
+
kind: "stale",
|
|
208396
|
+
message: "This design changed elsewhere. Refreshing the latest version now."
|
|
208397
|
+
};
|
|
208398
|
+
}
|
|
208399
|
+
}
|
|
208400
|
+
return {
|
|
208401
|
+
kind: "other",
|
|
208402
|
+
message: error instanceof Error ? error.message : "Unable to apply your selection."
|
|
208403
|
+
};
|
|
208404
|
+
}
|
|
208405
|
+
function isRecord16(value) {
|
|
208406
|
+
return typeof value === "object" && value !== null;
|
|
208407
|
+
}
|
|
208310
208408
|
function WarningNotice({ warnings, onDismiss }) {
|
|
208311
208409
|
return /* @__PURE__ */ jsxs("div", { role: "status", className: "rounded-md border border-warning/40 bg-warning/10 px-3 py-2 text-xs text-warning-foreground", children: [
|
|
208312
208410
|
/* @__PURE__ */ jsx("ul", { className: "space-y-1", children: warnings.map((warning, index2) => /* @__PURE__ */ jsx("li", { children: describeWarning(warning) }, `${warning.kind}-${index2}`)) }),
|
|
@@ -208355,6 +208453,7 @@ var init_StyleConfigurator = __esm({
|
|
|
208355
208453
|
init_siteStyleAccess();
|
|
208356
208454
|
init_themeOverlay();
|
|
208357
208455
|
init_siteChromeLookRows();
|
|
208456
|
+
init_styleConfiguratorApplyPayload();
|
|
208358
208457
|
init_styleConfiguratorSnapshot();
|
|
208359
208458
|
}
|
|
208360
208459
|
});
|
|
@@ -208609,6 +208708,7 @@ function PreviewEditorSidebar({
|
|
|
208609
208708
|
theme,
|
|
208610
208709
|
themeId = null,
|
|
208611
208710
|
themeSelectionId = null,
|
|
208711
|
+
themeSelectionVersion = null,
|
|
208612
208712
|
themeSelectionUpdatedAt = null,
|
|
208613
208713
|
themeSelectionButtonPersonalityId = null,
|
|
208614
208714
|
themeSelectionPaletteVariantId = null,
|
|
@@ -208764,8 +208864,10 @@ function PreviewEditorSidebar({
|
|
|
208764
208864
|
theme,
|
|
208765
208865
|
themeId,
|
|
208766
208866
|
selectionId: themeSelectionId,
|
|
208867
|
+
selectionVersion: themeSelectionVersion,
|
|
208767
208868
|
selectionUpdatedAt: themeSelectionUpdatedAt,
|
|
208768
208869
|
initialSelections: {
|
|
208870
|
+
selectionVersion: themeSelectionVersion,
|
|
208769
208871
|
selectionUpdatedAt: themeSelectionUpdatedAt,
|
|
208770
208872
|
buttonPersonalityId: themeSelectionButtonPersonalityId,
|
|
208771
208873
|
paletteVariantId: themeSelectionPaletteVariantId,
|
|
@@ -211021,25 +211123,25 @@ var INITIAL_ONBOARDING_CONFIRMATION_STATE = {
|
|
|
211021
211123
|
resendFeedback: null,
|
|
211022
211124
|
statusLoadFailed: false
|
|
211023
211125
|
};
|
|
211024
|
-
function
|
|
211126
|
+
function isRecord17(value) {
|
|
211025
211127
|
return value !== null && typeof value === "object";
|
|
211026
211128
|
}
|
|
211027
211129
|
function getErrorMessageFromEnvelope(payload, fallback2) {
|
|
211028
|
-
const error =
|
|
211029
|
-
const message2 =
|
|
211130
|
+
const error = isRecord17(payload) ? payload.error : null;
|
|
211131
|
+
const message2 = isRecord17(error) ? error.message : null;
|
|
211030
211132
|
return typeof message2 === "string" && message2.trim().length > 0 ? message2 : fallback2;
|
|
211031
211133
|
}
|
|
211032
211134
|
function isLaunchReadiness(value) {
|
|
211033
|
-
return
|
|
211135
|
+
return isRecord17(value) && Array.isArray(value.requirements) && typeof value.pendingRequiredCount === "number" && typeof value.pendingRecommendedCount === "number" && typeof value.pendingOptionalCount === "number" && isRecord17(value.goLiveDecision) && (value.goLiveDecision.kind === "allowed" || value.goLiveDecision.kind === "blocked");
|
|
211034
211136
|
}
|
|
211035
211137
|
function isOnboardingPreviewStatusResponse(value) {
|
|
211036
|
-
return
|
|
211138
|
+
return isRecord17(value) && typeof value.dashboardUnlocked === "boolean" && typeof value.requiresEmailConfirmation === "boolean" && isLaunchReadiness(value.launchReadiness);
|
|
211037
211139
|
}
|
|
211038
211140
|
function isResendOnboardingPreviewConfirmationResponse(value) {
|
|
211039
|
-
return
|
|
211141
|
+
return isRecord17(value) && (value.result === "resent" || value.result === "already_confirmed") && typeof value.dashboardUnlocked === "boolean" && typeof value.requiresEmailConfirmation === "boolean" && isLaunchReadiness(value.launchReadiness);
|
|
211040
211142
|
}
|
|
211041
211143
|
function getSuccessData(payload, isData) {
|
|
211042
|
-
if (!
|
|
211144
|
+
if (!isRecord17(payload) || payload.success !== true || !isData(payload.data)) {
|
|
211043
211145
|
return null;
|
|
211044
211146
|
}
|
|
211045
211147
|
return payload.data;
|
|
@@ -211626,6 +211728,7 @@ function SiteChromeCustomizeProvider({
|
|
|
211626
211728
|
theme,
|
|
211627
211729
|
themeId = null,
|
|
211628
211730
|
selectionId = null,
|
|
211731
|
+
selectionVersion = null,
|
|
211629
211732
|
selectionUpdatedAt = null,
|
|
211630
211733
|
initialSelections,
|
|
211631
211734
|
headerSelectionContext,
|
|
@@ -211638,17 +211741,19 @@ function SiteChromeCustomizeProvider({
|
|
|
211638
211741
|
const latestSelectionUpdatedAtRef = useRef(
|
|
211639
211742
|
initialSelections.selectionUpdatedAt ?? selectionUpdatedAt ?? null
|
|
211640
211743
|
);
|
|
211744
|
+
const initialSelectionVersion = initialSelections.selectionVersion ?? selectionVersion ?? 0;
|
|
211641
211745
|
const baseSnapshot = useMemo(
|
|
211642
211746
|
() => resolveStyleConfiguratorInitialSnapshot({
|
|
211643
211747
|
theme,
|
|
211644
211748
|
initialSelections: {
|
|
211645
211749
|
...initialSelections,
|
|
211750
|
+
selectionVersion: initialSelectionVersion,
|
|
211646
211751
|
selectionUpdatedAt: initialSelections.selectionUpdatedAt ?? selectionUpdatedAt ?? null
|
|
211647
211752
|
},
|
|
211648
211753
|
headerSelectionContext,
|
|
211649
211754
|
footerSelectionContext
|
|
211650
211755
|
}),
|
|
211651
|
-
[footerSelectionContext, headerSelectionContext, initialSelections, selectionUpdatedAt, theme]
|
|
211756
|
+
[footerSelectionContext, headerSelectionContext, initialSelectionVersion, initialSelections, selectionUpdatedAt, theme]
|
|
211652
211757
|
);
|
|
211653
211758
|
const [state, setState2] = useState(
|
|
211654
211759
|
() => baseSnapshot ? createStyleConfiguratorState(baseSnapshot) : null
|
|
@@ -211770,6 +211875,7 @@ function SiteChromeCustomizeProvider({
|
|
|
211770
211875
|
latestSelectionUpdatedAtRef.current = saved.selectionUpdatedAt ?? latestSelectionUpdatedAtRef.current;
|
|
211771
211876
|
const persisted = {
|
|
211772
211877
|
siteStyleId: nextSnapshot.siteStyleId,
|
|
211878
|
+
selectionVersion: nextSnapshot.selectionVersion,
|
|
211773
211879
|
selectionUpdatedAt: saved.selectionUpdatedAt ?? nextSnapshot.selectionUpdatedAt ?? null,
|
|
211774
211880
|
buttonPersonalityId: compiled.resolvedSelections.buttonPersonalityId,
|
|
211775
211881
|
paletteVariantId: compiled.resolvedSelections.paletteVariantId,
|
|
@@ -211862,6 +211968,7 @@ function PreviewShellLayout({
|
|
|
211862
211968
|
bearerToken,
|
|
211863
211969
|
themeId = null,
|
|
211864
211970
|
themeSelectionId = null,
|
|
211971
|
+
themeSelectionVersion = null,
|
|
211865
211972
|
themeSelectionUpdatedAt = null,
|
|
211866
211973
|
themeSelectionButtonPersonalityId = null,
|
|
211867
211974
|
themeSelectionPaletteVariantId = null,
|
|
@@ -212159,6 +212266,7 @@ function PreviewShellLayout({
|
|
|
212159
212266
|
bearerToken,
|
|
212160
212267
|
themeId,
|
|
212161
212268
|
themeSelectionId,
|
|
212269
|
+
themeSelectionVersion,
|
|
212162
212270
|
themeSelectionUpdatedAt,
|
|
212163
212271
|
themeSelectionButtonPersonalityId,
|
|
212164
212272
|
themeSelectionPaletteVariantId,
|
|
@@ -212217,8 +212325,10 @@ function PreviewShellLayout({
|
|
|
212217
212325
|
theme,
|
|
212218
212326
|
themeId,
|
|
212219
212327
|
selectionId: themeSelectionId,
|
|
212328
|
+
selectionVersion: themeSelectionVersion,
|
|
212220
212329
|
selectionUpdatedAt: themeSelectionUpdatedAt,
|
|
212221
212330
|
initialSelections: {
|
|
212331
|
+
selectionVersion: themeSelectionVersion,
|
|
212222
212332
|
selectionUpdatedAt: themeSelectionUpdatedAt,
|
|
212223
212333
|
buttonPersonalityId: themeSelectionButtonPersonalityId,
|
|
212224
212334
|
paletteVariantId: themeSelectionPaletteVariantId,
|
|
@@ -212245,8 +212355,10 @@ function PreviewShellLayout({
|
|
|
212245
212355
|
theme,
|
|
212246
212356
|
themeId,
|
|
212247
212357
|
selectionId: themeSelectionId,
|
|
212358
|
+
selectionVersion: themeSelectionVersion,
|
|
212248
212359
|
selectionUpdatedAt: themeSelectionUpdatedAt,
|
|
212249
212360
|
initialSelections: {
|
|
212361
|
+
selectionVersion: themeSelectionVersion,
|
|
212250
212362
|
selectionUpdatedAt: themeSelectionUpdatedAt,
|
|
212251
212363
|
buttonPersonalityId: themeSelectionButtonPersonalityId,
|
|
212252
212364
|
paletteVariantId: themeSelectionPaletteVariantId,
|
|
@@ -212313,6 +212425,7 @@ function PreviewShell({
|
|
|
212313
212425
|
theme,
|
|
212314
212426
|
themeId = null,
|
|
212315
212427
|
themeSelectionId = null,
|
|
212428
|
+
themeSelectionVersion = null,
|
|
212316
212429
|
themeSelectionUpdatedAt = null,
|
|
212317
212430
|
themeSelectionButtonPersonalityId = null,
|
|
212318
212431
|
themeSelectionPaletteVariantId = null,
|
|
@@ -212396,6 +212509,7 @@ function PreviewShell({
|
|
|
212396
212509
|
bearerToken: previewToken,
|
|
212397
212510
|
themeId,
|
|
212398
212511
|
themeSelectionId,
|
|
212512
|
+
themeSelectionVersion,
|
|
212399
212513
|
themeSelectionUpdatedAt,
|
|
212400
212514
|
themeSelectionButtonPersonalityId,
|
|
212401
212515
|
themeSelectionPaletteVariantId,
|
|
@@ -212448,11 +212562,11 @@ init_src3();
|
|
|
212448
212562
|
// ../preview-next/src/client/utils/path.ts
|
|
212449
212563
|
var PATH_SEPARATOR_REGEX3 = /\./g;
|
|
212450
212564
|
var BRACKET_ACCESS_REGEX3 = /\[([^\]]+)\]/g;
|
|
212451
|
-
function
|
|
212565
|
+
function isRecord18(value) {
|
|
212452
212566
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
212453
212567
|
}
|
|
212454
212568
|
function isPathContainer2(value) {
|
|
212455
|
-
return Array.isArray(value) ||
|
|
212569
|
+
return Array.isArray(value) || isRecord18(value);
|
|
212456
212570
|
}
|
|
212457
212571
|
function createPathContainer2(nextIsIndex) {
|
|
212458
212572
|
return nextIsIndex ? [] : {};
|
|
@@ -212652,14 +212766,14 @@ function applyRuntimeContentDecorationProjection(block, content, projection) {
|
|
|
212652
212766
|
const blockId = designBlockIdFromBlockItem(block);
|
|
212653
212767
|
const fields3 = blockId ? projection.fieldsByBlockId.get(blockId) : void 0;
|
|
212654
212768
|
return applyCompiledRuntimeFieldsToContent(
|
|
212655
|
-
|
|
212769
|
+
isRecord19(content) ? content : {},
|
|
212656
212770
|
fields3
|
|
212657
212771
|
);
|
|
212658
212772
|
}
|
|
212659
212773
|
function designBlockIdFromBlockItem(block) {
|
|
212660
212774
|
return typeof block.id === "string" && block.id.length > 0 ? asDesignBlockId(block.id) : null;
|
|
212661
212775
|
}
|
|
212662
|
-
function
|
|
212776
|
+
function isRecord19(value) {
|
|
212663
212777
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
212664
212778
|
}
|
|
212665
212779
|
|
|
@@ -212865,7 +212979,7 @@ init_lucide_react();
|
|
|
212865
212979
|
var previewCustomizePillButtonClassName = "rounded-full bg-black/80 px-2.5 py-1 text-xs text-white shadow hover:bg-black";
|
|
212866
212980
|
|
|
212867
212981
|
// ../preview-next/src/client/blocks/isRecord.ts
|
|
212868
|
-
function
|
|
212982
|
+
function isRecord20(value) {
|
|
212869
212983
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
212870
212984
|
}
|
|
212871
212985
|
|
|
@@ -213353,7 +213467,7 @@ function findFirstFieldPath(fields3, data, prefix) {
|
|
|
213353
213467
|
}
|
|
213354
213468
|
const nextPrefix = [...prefix, field.id];
|
|
213355
213469
|
if (field.type === "group") {
|
|
213356
|
-
const groupValue =
|
|
213470
|
+
const groupValue = isRecord20(data) ? data[field.id] : void 0;
|
|
213357
213471
|
const nested = findFirstFieldPath(
|
|
213358
213472
|
field.schema.fields,
|
|
213359
213473
|
groupValue,
|
|
@@ -213363,7 +213477,7 @@ function findFirstFieldPath(fields3, data, prefix) {
|
|
|
213363
213477
|
continue;
|
|
213364
213478
|
}
|
|
213365
213479
|
if (field.type === "repeater" && field.schema) {
|
|
213366
|
-
const collection =
|
|
213480
|
+
const collection = isRecord20(data) ? data[field.id] : void 0;
|
|
213367
213481
|
const items = Array.isArray(collection) ? collection : [];
|
|
213368
213482
|
if (items.length > 0) {
|
|
213369
213483
|
const firstItem = items[0];
|
|
@@ -1237,6 +1237,24 @@ var ENDPOINT_DEFINITIONS = {
|
|
|
1237
1237
|
"server:internal_error"
|
|
1238
1238
|
]
|
|
1239
1239
|
},
|
|
1240
|
+
setServiceSpecificAvailability: {
|
|
1241
|
+
path: "/sites/{siteId}/bookings/resources/{resourceId}/service-availability",
|
|
1242
|
+
method: "PUT",
|
|
1243
|
+
auth: "user",
|
|
1244
|
+
responseKind: "json",
|
|
1245
|
+
errors: [
|
|
1246
|
+
"validation:invalid_input",
|
|
1247
|
+
"resource:not_found",
|
|
1248
|
+
"server:internal_error"
|
|
1249
|
+
]
|
|
1250
|
+
},
|
|
1251
|
+
deleteServiceSpecificAvailability: {
|
|
1252
|
+
path: "/sites/{siteId}/bookings/resources/{resourceId}/service-availability/{scheduleId}",
|
|
1253
|
+
method: "DELETE",
|
|
1254
|
+
auth: "user",
|
|
1255
|
+
responseKind: "json",
|
|
1256
|
+
errors: ["resource:not_found", "server:internal_error"]
|
|
1257
|
+
},
|
|
1240
1258
|
listBlackouts: {
|
|
1241
1259
|
path: "/sites/{siteId}/bookings/resources/{resourceId}/blackouts",
|
|
1242
1260
|
method: "GET",
|
|
@@ -2872,6 +2890,20 @@ var ENDPOINT_DEFINITIONS = {
|
|
|
2872
2890
|
auth: "user",
|
|
2873
2891
|
responseKind: "json"
|
|
2874
2892
|
},
|
|
2893
|
+
applySiteStyleSelection: {
|
|
2894
|
+
path: "/sites/{siteId}/theme/style-selection/apply",
|
|
2895
|
+
method: "POST",
|
|
2896
|
+
tags: [TAG_TEMPLATES.siteCollection, TAG_TEMPLATES.siteTheme],
|
|
2897
|
+
auth: "user",
|
|
2898
|
+
errors: [
|
|
2899
|
+
"validation:invalid_input",
|
|
2900
|
+
"auth:forbidden",
|
|
2901
|
+
"resource:not_found",
|
|
2902
|
+
"resource:conflict",
|
|
2903
|
+
"server:internal_error"
|
|
2904
|
+
],
|
|
2905
|
+
responseKind: "json"
|
|
2906
|
+
},
|
|
2875
2907
|
saveSiteChromeLookSelection: {
|
|
2876
2908
|
path: "/sites/{siteId}/theme/site-chrome-look",
|
|
2877
2909
|
method: "POST",
|
|
@@ -5615,6 +5647,13 @@ var ENDPOINT_DEFINITIONS = {
|
|
|
5615
5647
|
auth: "service",
|
|
5616
5648
|
responseKind: "json"
|
|
5617
5649
|
},
|
|
5650
|
+
sdkApplySiteStyleSelection: {
|
|
5651
|
+
path: "/sdk/{siteId}/theme/style-selection/apply",
|
|
5652
|
+
method: "POST",
|
|
5653
|
+
auth: "service",
|
|
5654
|
+
responseKind: "json",
|
|
5655
|
+
errors: ["validation:invalid_input", "resource:not_found", "resource:conflict", "server:internal_error"]
|
|
5656
|
+
},
|
|
5618
5657
|
sdkUpsertFooter: {
|
|
5619
5658
|
path: "/sdk/{siteId}/footer",
|
|
5620
5659
|
method: "POST",
|
|
@@ -50169,6 +50169,24 @@ var ENDPOINT_DEFINITIONS = {
|
|
|
50169
50169
|
"server:internal_error"
|
|
50170
50170
|
]
|
|
50171
50171
|
},
|
|
50172
|
+
setServiceSpecificAvailability: {
|
|
50173
|
+
path: "/sites/{siteId}/bookings/resources/{resourceId}/service-availability",
|
|
50174
|
+
method: "PUT",
|
|
50175
|
+
auth: "user",
|
|
50176
|
+
responseKind: "json",
|
|
50177
|
+
errors: [
|
|
50178
|
+
"validation:invalid_input",
|
|
50179
|
+
"resource:not_found",
|
|
50180
|
+
"server:internal_error"
|
|
50181
|
+
]
|
|
50182
|
+
},
|
|
50183
|
+
deleteServiceSpecificAvailability: {
|
|
50184
|
+
path: "/sites/{siteId}/bookings/resources/{resourceId}/service-availability/{scheduleId}",
|
|
50185
|
+
method: "DELETE",
|
|
50186
|
+
auth: "user",
|
|
50187
|
+
responseKind: "json",
|
|
50188
|
+
errors: ["resource:not_found", "server:internal_error"]
|
|
50189
|
+
},
|
|
50172
50190
|
listBlackouts: {
|
|
50173
50191
|
path: "/sites/{siteId}/bookings/resources/{resourceId}/blackouts",
|
|
50174
50192
|
method: "GET",
|
|
@@ -51804,6 +51822,20 @@ var ENDPOINT_DEFINITIONS = {
|
|
|
51804
51822
|
auth: "user",
|
|
51805
51823
|
responseKind: "json"
|
|
51806
51824
|
},
|
|
51825
|
+
applySiteStyleSelection: {
|
|
51826
|
+
path: "/sites/{siteId}/theme/style-selection/apply",
|
|
51827
|
+
method: "POST",
|
|
51828
|
+
tags: [TAG_TEMPLATES.siteCollection, TAG_TEMPLATES.siteTheme],
|
|
51829
|
+
auth: "user",
|
|
51830
|
+
errors: [
|
|
51831
|
+
"validation:invalid_input",
|
|
51832
|
+
"auth:forbidden",
|
|
51833
|
+
"resource:not_found",
|
|
51834
|
+
"resource:conflict",
|
|
51835
|
+
"server:internal_error"
|
|
51836
|
+
],
|
|
51837
|
+
responseKind: "json"
|
|
51838
|
+
},
|
|
51807
51839
|
saveSiteChromeLookSelection: {
|
|
51808
51840
|
path: "/sites/{siteId}/theme/site-chrome-look",
|
|
51809
51841
|
method: "POST",
|
|
@@ -54547,6 +54579,13 @@ var ENDPOINT_DEFINITIONS = {
|
|
|
54547
54579
|
auth: "service",
|
|
54548
54580
|
responseKind: "json"
|
|
54549
54581
|
},
|
|
54582
|
+
sdkApplySiteStyleSelection: {
|
|
54583
|
+
path: "/sdk/{siteId}/theme/style-selection/apply",
|
|
54584
|
+
method: "POST",
|
|
54585
|
+
auth: "service",
|
|
54586
|
+
responseKind: "json",
|
|
54587
|
+
errors: ["validation:invalid_input", "resource:not_found", "resource:conflict", "server:internal_error"]
|
|
54588
|
+
},
|
|
54550
54589
|
sdkUpsertFooter: {
|
|
54551
54590
|
path: "/sdk/{siteId}/footer",
|
|
54552
54591
|
method: "POST",
|
|
@@ -55821,11 +55860,26 @@ var appointmentSetupWeeklyWindowDraftSchema = z69.object({
|
|
|
55821
55860
|
startTime: z69.string(),
|
|
55822
55861
|
endTime: z69.string()
|
|
55823
55862
|
});
|
|
55863
|
+
var appointmentSetupStartTimePolicyDraftSchema = z69.discriminatedUnion("kind", [
|
|
55864
|
+
z69.object({ kind: z69.literal("automatic_spacing") }),
|
|
55865
|
+
z69.object({
|
|
55866
|
+
kind: z69.literal("regular_interval"),
|
|
55867
|
+
intervalMinutes: z69.union([
|
|
55868
|
+
z69.literal(10),
|
|
55869
|
+
z69.literal(15),
|
|
55870
|
+
z69.literal(20),
|
|
55871
|
+
z69.literal(30),
|
|
55872
|
+
z69.literal(45),
|
|
55873
|
+
z69.literal(60)
|
|
55874
|
+
])
|
|
55875
|
+
})
|
|
55876
|
+
]);
|
|
55824
55877
|
var appointmentSetupAvailabilityDraftSchema = z69.object({
|
|
55825
55878
|
kind: z69.literal("weekly_windows"),
|
|
55826
55879
|
resourceRef: appointmentSetupRefSchema,
|
|
55827
55880
|
serviceRef: appointmentSetupRefSchema.nullable(),
|
|
55828
|
-
windows: z69.array(appointmentSetupWeeklyWindowDraftSchema)
|
|
55881
|
+
windows: z69.array(appointmentSetupWeeklyWindowDraftSchema),
|
|
55882
|
+
startTimePolicy: appointmentSetupStartTimePolicyDraftSchema.optional()
|
|
55829
55883
|
});
|
|
55830
55884
|
var APPOINTMENT_DEFAULT_MIN_LEAD_MINUTES_MAX = 28 * 24 * 60;
|
|
55831
55885
|
var APPOINTMENT_DEFAULT_MAX_BOOKING_NOTICE_MINUTES_MAX = 10 * 365 * 24 * 60;
|