@riverbankcms/sdk 0.70.0 → 0.70.3

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.
Files changed (61) hide show
  1. package/README.md +29 -0
  2. package/dist/_dts/ai/src/contracts/commandExposure.d.ts +8 -0
  3. package/dist/_dts/ai/src/contracts/feedback.d.ts +55 -0
  4. package/dist/_dts/ai/src/contracts/proposals.d.ts +34764 -0
  5. package/dist/_dts/ai/src/contracts.d.ts +5 -0
  6. package/dist/_dts/ai/src/designer/rfc6902.d.ts +16 -0
  7. package/dist/_dts/ai/src/designer/themePatch.d.ts +50 -0
  8. package/dist/_dts/api/src/aiPlayground.d.ts +1 -1
  9. package/dist/_dts/api/src/appointmentSetup.d.ts +19 -0
  10. package/dist/_dts/api/src/availability.d.ts +84 -2
  11. package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +10 -1
  12. package/dist/_dts/api/src/contentRuntime.d.ts +1 -0
  13. package/dist/_dts/api/src/endpoints.d.ts +29 -0
  14. package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +4 -0
  15. package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +29 -1
  16. package/dist/_dts/api/src/types.d.ts +1 -1
  17. package/dist/_dts/billing/src/components/index.d.ts +41 -0
  18. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +219 -0
  19. package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +2 -1
  20. package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +2 -1
  21. package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +2 -1
  22. package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +3 -1
  23. package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +3 -1
  24. package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +1 -0
  25. package/dist/_dts/preview-next/src/client/preview/styleConfiguratorApplyPayload.d.ts +8 -0
  26. package/dist/_dts/preview-next/src/client/preview/styleConfiguratorSnapshot.d.ts +1 -0
  27. package/dist/_dts/sdk/src/cli/commands/delete.d.ts +3 -0
  28. package/dist/_dts/sdk/src/cli/commands/style.d.ts +37 -0
  29. package/dist/_dts/sdk/src/cli/helpers.d.ts +8 -33
  30. package/dist/_dts/sdk/src/cli/site-commands/oneOffCommands.d.ts +81 -0
  31. package/dist/_dts/sdk/src/client/management/index.d.ts +2 -1
  32. package/dist/_dts/sdk/src/client/management/theme.d.ts +3 -1
  33. package/dist/_dts/sdk/src/client/management/types.d.ts +23 -0
  34. package/dist/_dts/sdk/src/components.d.ts +2 -1
  35. package/dist/_dts/sdk/src/next/types.d.ts +4 -2
  36. package/dist/_dts/sdk/src/public-api/contracts.d.ts +1 -0
  37. package/dist/_dts/sdk/src/rendering/index.d.ts +2 -1
  38. package/dist/_dts/sdk/src/rendering/overrideResolution.d.ts +10 -0
  39. package/dist/_dts/sdk/src/rendering/overrides.d.ts +12 -0
  40. package/dist/_dts/sdk/src/version.d.ts +1 -1
  41. package/dist/_dts/site-commands/src/commands.d.ts +25 -7
  42. package/dist/_dts/site-commands/src/metadata.d.ts +2 -2
  43. package/dist/cli/index.mjs +844 -108
  44. package/dist/client/client.mjs +256 -202
  45. package/dist/client/hooks.mjs +55 -1
  46. package/dist/client/rendering.mjs +25467 -25403
  47. package/dist/preview-next/before-render.mjs +39 -0
  48. package/dist/preview-next/client/runtime.mjs +160 -39
  49. package/dist/preview-next/middleware.mjs +39 -0
  50. package/dist/server/components.mjs +65 -1
  51. package/dist/server/config-validation.mjs +55 -1
  52. package/dist/server/config.mjs +55 -1
  53. package/dist/server/data.mjs +55 -1
  54. package/dist/server/index.mjs +40 -1
  55. package/dist/server/next.mjs +137 -4
  56. package/dist/server/prebuild.mjs +1 -1
  57. package/dist/server/rendering/server.mjs +55 -1
  58. package/dist/server/rendering.mjs +65 -1
  59. package/dist/server/routing.mjs +56 -2
  60. package/dist/server/server.mjs +56 -2
  61. package/package.json +4 -3
@@ -0,0 +1,5 @@
1
+ export * from './contracts/proposals';
2
+ export * from './contracts/feedback';
3
+ export * from './contracts/commandExposure';
4
+ export { ThemePatchOpSchema, ThemePatchOpsSchema, type ThemePatchOp, DEFAULT_THEME_PATCH_FORBIDDEN_PATH_PREFIXES, DEFAULT_THEME_PATCH_MAX_OPS, DEFAULT_THEME_PATCH_MAX_SERIALIZED_BYTES, } from './designer/themePatch';
5
+ export { applyRfc6902Patch, type Rfc6902Op } from './designer/rfc6902';
@@ -0,0 +1,16 @@
1
+ export type Rfc6902AddOp = {
2
+ op: 'add';
3
+ path: string;
4
+ value: unknown;
5
+ };
6
+ export type Rfc6902RemoveOp = {
7
+ op: 'remove';
8
+ path: string;
9
+ };
10
+ export type Rfc6902ReplaceOp = {
11
+ op: 'replace';
12
+ path: string;
13
+ value: unknown;
14
+ };
15
+ export type Rfc6902Op = Rfc6902AddOp | Rfc6902RemoveOp | Rfc6902ReplaceOp;
16
+ export declare function applyRfc6902Patch<T>(base: T, ops: Rfc6902Op[]): T;
@@ -0,0 +1,50 @@
1
+ import { z } from 'zod';
2
+ import { type Theme } from '../../../theme-core/src/index';
3
+ export declare const DEFAULT_THEME_PATCH_MAX_OPS = 25;
4
+ export declare const DEFAULT_THEME_PATCH_MAX_SERIALIZED_BYTES = 20000;
5
+ export declare const DEFAULT_THEME_PATCH_FORBIDDEN_PATH_PREFIXES: readonly ["/axes"];
6
+ type JsonPrimitive = string | number | boolean | null;
7
+ type JsonValue = JsonPrimitive | JsonValue[] | {
8
+ [key: string]: JsonValue;
9
+ };
10
+ export declare const ThemePatchOpSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
11
+ op: z.ZodLiteral<"add">;
12
+ path: z.ZodString;
13
+ value: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
14
+ }, z.core.$strip>, z.ZodObject<{
15
+ op: z.ZodLiteral<"replace">;
16
+ path: z.ZodString;
17
+ value: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
18
+ }, z.core.$strip>, z.ZodObject<{
19
+ op: z.ZodLiteral<"remove">;
20
+ path: z.ZodString;
21
+ }, z.core.$strip>], "op">;
22
+ export type ThemePatchOp = z.infer<typeof ThemePatchOpSchema>;
23
+ export declare const ThemePatchOpsSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
24
+ op: z.ZodLiteral<"add">;
25
+ path: z.ZodString;
26
+ value: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
27
+ }, z.core.$strip>, z.ZodObject<{
28
+ op: z.ZodLiteral<"replace">;
29
+ path: z.ZodString;
30
+ value: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
31
+ }, z.core.$strip>, z.ZodObject<{
32
+ op: z.ZodLiteral<"remove">;
33
+ path: z.ZodString;
34
+ }, z.core.$strip>], "op">>;
35
+ export type ThemePatchValidationResult = {
36
+ valid: true;
37
+ theme: Theme;
38
+ } | {
39
+ valid: false;
40
+ error: string;
41
+ };
42
+ export declare function validateThemePatch(args: {
43
+ baseTheme: Theme;
44
+ ops: ThemePatchOp[];
45
+ forbiddenPathPrefixes?: string[];
46
+ maxOps?: number;
47
+ maxSerializedBytes?: number;
48
+ validateRuntime?: boolean;
49
+ }): ThemePatchValidationResult;
50
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import type { AddBlockPageCommandBackedSchema, DuplicateBlockPageCommandBackedSchema, MoveBlockPageCommandBackedSchema, ReorderBlocksPageCommandBackedSchema, SwapBlocksPageCommandBackedSchema } from '@riverbankcms/ai/contracts';
2
+ import type { AddBlockPageCommandBackedSchema, DuplicateBlockPageCommandBackedSchema, MoveBlockPageCommandBackedSchema, ReorderBlocksPageCommandBackedSchema, SwapBlocksPageCommandBackedSchema } from '../../ai/src/contracts';
3
3
  import type { SdkCustomBlock } from '../../blocks/src/index';
4
4
  import type { CustomCssAtRuleInput, CustomCssRuleInput } from '../../theme-core/src/index';
5
5
  import type { JsonValue } from './shared-contracts';
@@ -193,6 +193,13 @@ export declare const appointmentSetupWeeklyWindowDraftSchema: z.ZodObject<{
193
193
  endTime: z.ZodString;
194
194
  }, z.core.$strip>;
195
195
  export type AppointmentSetupWeeklyWindowDraft = z.infer<typeof appointmentSetupWeeklyWindowDraftSchema>;
196
+ export declare const appointmentSetupStartTimePolicyDraftSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
197
+ kind: z.ZodLiteral<"automatic_spacing">;
198
+ }, z.core.$strip>, z.ZodObject<{
199
+ kind: z.ZodLiteral<"regular_interval">;
200
+ intervalMinutes: z.ZodUnion<readonly [z.ZodLiteral<10>, z.ZodLiteral<15>, z.ZodLiteral<20>, z.ZodLiteral<30>, z.ZodLiteral<45>, z.ZodLiteral<60>]>;
201
+ }, z.core.$strip>], "kind">;
202
+ export type AppointmentSetupStartTimePolicyDraft = z.infer<typeof appointmentSetupStartTimePolicyDraftSchema>;
196
203
  export declare const appointmentSetupAvailabilityDraftSchema: z.ZodObject<{
197
204
  kind: z.ZodLiteral<"weekly_windows">;
198
205
  resourceRef: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -214,6 +221,12 @@ export declare const appointmentSetupAvailabilityDraftSchema: z.ZodObject<{
214
221
  startTime: z.ZodString;
215
222
  endTime: z.ZodString;
216
223
  }, z.core.$strip>>;
224
+ startTimePolicy: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
225
+ kind: z.ZodLiteral<"automatic_spacing">;
226
+ }, z.core.$strip>, z.ZodObject<{
227
+ kind: z.ZodLiteral<"regular_interval">;
228
+ intervalMinutes: z.ZodUnion<readonly [z.ZodLiteral<10>, z.ZodLiteral<15>, z.ZodLiteral<20>, z.ZodLiteral<30>, z.ZodLiteral<45>, z.ZodLiteral<60>]>;
229
+ }, z.core.$strip>], "kind">>;
217
230
  }, z.core.$strip>;
218
231
  export type AppointmentSetupAvailabilityDraft = z.infer<typeof appointmentSetupAvailabilityDraftSchema>;
219
232
  /**
@@ -320,6 +333,12 @@ export declare const applyAppointmentSetupRequestSchema: z.ZodObject<{
320
333
  startTime: z.ZodString;
321
334
  endTime: z.ZodString;
322
335
  }, z.core.$strip>>;
336
+ startTimePolicy: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
337
+ kind: z.ZodLiteral<"automatic_spacing">;
338
+ }, z.core.$strip>, z.ZodObject<{
339
+ kind: z.ZodLiteral<"regular_interval">;
340
+ intervalMinutes: z.ZodUnion<readonly [z.ZodLiteral<10>, z.ZodLiteral<15>, z.ZodLiteral<20>, z.ZodLiteral<30>, z.ZodLiteral<45>, z.ZodLiteral<60>]>;
341
+ }, z.core.$strip>], "kind">>;
323
342
  }, z.core.$strip>>;
324
343
  bookingNotice: z.ZodObject<{
325
344
  minLeadMinutes: z.ZodNumber;
@@ -17,6 +17,8 @@ export type AvailabilityRule = {
17
17
  };
18
18
  export type ListAvailabilityRulesResponse = {
19
19
  rules: AvailabilityRule[];
20
+ schedule?: AvailabilityScheduleSettings;
21
+ serviceSchedules?: ServiceSpecificAvailabilityScheduleSettings[];
20
22
  };
21
23
  export type WeeklyAvailabilityWindowInput = {
22
24
  /** 0-6 (Sunday-Saturday). */
@@ -28,12 +30,46 @@ export type WeeklyAvailabilityWindowInput = {
28
30
  };
29
31
  export type SetWeeklyAvailabilityRequest = {
30
32
  windows: WeeklyAvailabilityWindowInput[];
33
+ startTimePolicy?: AvailabilityStartTimePolicyInput;
34
+ };
35
+ export type AvailabilityStartIntervalMinutes = 10 | 15 | 20 | 30 | 45 | 60;
36
+ export type SpecificAvailabilityStartInput = {
37
+ /** 0-6 (Sunday-Saturday). */
38
+ weekday: number;
39
+ /** HH:MM. */
40
+ startTime: string;
41
+ };
42
+ export type AvailabilityStartTimePolicyInput = {
43
+ kind: 'automatic_spacing';
44
+ } | {
45
+ kind: 'regular_interval';
46
+ intervalMinutes: AvailabilityStartIntervalMinutes;
47
+ } | {
48
+ kind: 'specific_start_times';
49
+ starts: SpecificAvailabilityStartInput[];
50
+ };
51
+ export type AvailabilityScheduleSettings = {
52
+ id: string;
53
+ role: {
54
+ kind: 'default';
55
+ } | {
56
+ kind: 'service_specific';
57
+ serviceIds: string[];
58
+ };
59
+ startTimePolicy: AvailabilityStartTimePolicyInput;
60
+ windows: WeeklyAvailabilityWindowInput[];
61
+ };
62
+ export type ServiceSpecificAvailabilityScheduleSettings = AvailabilityScheduleSettings & {
63
+ role: {
64
+ kind: 'service_specific';
65
+ serviceIds: string[];
66
+ };
31
67
  };
32
68
  /**
33
69
  * Canonical code-set for the `fieldErrors[]` surfaced through a 400 from
34
70
  * `PUT setWeeklyAvailability` when the supplied schedule fails validation.
35
- * Each issue maps to a path on the `windows[]` body the editor consumes
36
- * these to render per-window inline messages.
71
+ * Window issues map to `windows[]` paths, and start-policy issues map to
72
+ * `startTimePolicy.*` paths so the editor can render inline messages.
37
73
  *
38
74
  * NOT a response variant: success returns `SetWeeklyAvailabilityResponse`
39
75
  * directly; failure rides on the dashboard error envelope's `fieldErrors`
@@ -53,6 +89,39 @@ export type SetWeeklyAvailabilityIssue = {
53
89
  weekday: number;
54
90
  firstIndex: number;
55
91
  secondIndex: number;
92
+ } | {
93
+ kind: 'invalid_regular_interval';
94
+ intervalMinutes: number;
95
+ allowedIntervals: AvailabilityStartIntervalMinutes[];
96
+ } | {
97
+ kind: 'invalid_specific_start_time';
98
+ weekday: number;
99
+ index: number;
100
+ value: string;
101
+ } | {
102
+ kind: 'invalid_specific_start_weekday';
103
+ weekday: number;
104
+ index: number;
105
+ } | {
106
+ kind: 'duplicate_specific_start_time';
107
+ weekday: number;
108
+ firstIndex: number;
109
+ secondIndex: number;
110
+ startTime: string;
111
+ } | {
112
+ kind: 'fixed_start_gap_too_short';
113
+ serviceName: string;
114
+ weekday: number;
115
+ firstStart: string;
116
+ secondStart: string;
117
+ requiredGapMinutes: number;
118
+ actualGapMinutes: number;
119
+ } | {
120
+ kind: 'invalid_service_assignment';
121
+ serviceId: string;
122
+ } | {
123
+ kind: 'duplicate_service_assignment';
124
+ serviceId: string;
56
125
  };
57
126
  /**
58
127
  * Success response from `PUT setWeeklyAvailability`. Returns the
@@ -63,6 +132,19 @@ export type SetWeeklyAvailabilityIssue = {
63
132
  */
64
133
  export type SetWeeklyAvailabilityResponse = {
65
134
  rules: AvailabilityRule[];
135
+ schedule?: AvailabilityScheduleSettings;
136
+ };
137
+ export type SetServiceSpecificAvailabilityRequest = {
138
+ scheduleId?: string;
139
+ serviceIds: string[];
140
+ windows: WeeklyAvailabilityWindowInput[];
141
+ startTimePolicy?: AvailabilityStartTimePolicyInput;
142
+ };
143
+ export type SetServiceSpecificAvailabilityResponse = {
144
+ schedule: ServiceSpecificAvailabilityScheduleSettings;
145
+ };
146
+ export type DeleteServiceSpecificAvailabilityResponse = {
147
+ success: boolean;
66
148
  };
67
149
  export type AppointmentBlackout = {
68
150
  id: string;
@@ -1,5 +1,5 @@
1
1
  import type { APIEndpoint } from "./apiEndpointTypes";
2
- import type { CreateBlackoutRequest, CreateBlackoutResponse, DeleteBlackoutResponse, GetAvailableSlotsQuery, GetAvailableSlotsResponse, ListAvailabilityRulesResponse, ListBlackoutsResponse, SetWeeklyAvailabilityRequest, SetWeeklyAvailabilityResponse } from "./availability";
2
+ import type { CreateBlackoutRequest, CreateBlackoutResponse, DeleteBlackoutResponse, DeleteServiceSpecificAvailabilityResponse, GetAvailableSlotsQuery, GetAvailableSlotsResponse, ListAvailabilityRulesResponse, ListBlackoutsResponse, SetServiceSpecificAvailabilityRequest, SetServiceSpecificAvailabilityResponse, SetWeeklyAvailabilityRequest, SetWeeklyAvailabilityResponse } from "./availability";
3
3
  import type { CalendarStatusResponse, BookingCalendarFeedMutationResponse, BookingCalendarFeedStatusResponse, DisconnectCalendarResponse, UpdateCalendarPreferencesRequest, UpdateCalendarPreferencesResponse } from "./calendar";
4
4
  import type { BookingRequirementConfigRequest, BookingRequirementConfigResponse, CreateAppointmentRequest, CreateAppointmentResponse } from "./bookings";
5
5
  import type { BookingClosureConflictResponse, CreateBookingClosureRequest, CreateBookingClosureResponse, DeleteBookingClosureResponse, GetBookingClosureResponse, ListBookingClosuresResponse, PreviewBookingClosureResponse, BookingClosureRequest } from "./bookingClosures";
@@ -353,6 +353,15 @@ export type BookingManagementAPIEndpoints = {
353
353
  siteId: string;
354
354
  resourceId: string;
355
355
  }, SetWeeklyAvailabilityResponse>;
356
+ setServiceSpecificAvailability: APIEndpoint<SetServiceSpecificAvailabilityRequest, {
357
+ siteId: string;
358
+ resourceId: string;
359
+ }, SetServiceSpecificAvailabilityResponse>;
360
+ deleteServiceSpecificAvailability: APIEndpoint<never, {
361
+ siteId: string;
362
+ resourceId: string;
363
+ scheduleId: string;
364
+ }, DeleteServiceSpecificAvailabilityResponse>;
356
365
  listBlackouts: APIEndpoint<never, {
357
366
  siteId: string;
358
367
  resourceId: string;
@@ -341,6 +341,7 @@ export type SiteBySlugResponse = {
341
341
  theme: Theme;
342
342
  themeId?: string | null;
343
343
  selectionId?: string | null;
344
+ selectionVersion?: number | null;
344
345
  selectionUpdatedAt?: string | null;
345
346
  /**
346
347
  * Persisted Style configurator selections (Phase C). Optional so legacy
@@ -1002,6 +1002,20 @@ export declare const API_ENDPOINTS: {
1002
1002
  readonly responseKind: "json";
1003
1003
  readonly errors: readonly ["validation:invalid_input", "resource:not_found", "server:internal_error"];
1004
1004
  };
1005
+ readonly setServiceSpecificAvailability: {
1006
+ readonly path: "/sites/{siteId}/bookings/resources/{resourceId}/service-availability";
1007
+ readonly method: "PUT";
1008
+ readonly auth: "user";
1009
+ readonly responseKind: "json";
1010
+ readonly errors: readonly ["validation:invalid_input", "resource:not_found", "server:internal_error"];
1011
+ };
1012
+ readonly deleteServiceSpecificAvailability: {
1013
+ readonly path: "/sites/{siteId}/bookings/resources/{resourceId}/service-availability/{scheduleId}";
1014
+ readonly method: "DELETE";
1015
+ readonly auth: "user";
1016
+ readonly responseKind: "json";
1017
+ readonly errors: readonly ["resource:not_found", "server:internal_error"];
1018
+ };
1005
1019
  readonly listBlackouts: {
1006
1020
  readonly path: "/sites/{siteId}/bookings/resources/{resourceId}/blackouts";
1007
1021
  readonly method: "GET";
@@ -2365,6 +2379,14 @@ export declare const API_ENDPOINTS: {
2365
2379
  readonly auth: "user";
2366
2380
  readonly responseKind: "json";
2367
2381
  };
2382
+ readonly applySiteStyleSelection: {
2383
+ readonly path: "/sites/{siteId}/theme/style-selection/apply";
2384
+ readonly method: "POST";
2385
+ readonly tags: ["riverbank:site", "riverbank:site:{siteId}:theme"];
2386
+ readonly auth: "user";
2387
+ readonly errors: readonly ["validation:invalid_input", "auth:forbidden", "resource:not_found", "resource:conflict", "server:internal_error"];
2388
+ readonly responseKind: "json";
2389
+ };
2368
2390
  readonly saveSiteChromeLookSelection: {
2369
2391
  readonly path: "/sites/{siteId}/theme/site-chrome-look";
2370
2392
  readonly method: "POST";
@@ -4734,6 +4756,13 @@ export declare const API_ENDPOINTS: {
4734
4756
  readonly auth: "service";
4735
4757
  readonly responseKind: "json";
4736
4758
  };
4759
+ readonly sdkApplySiteStyleSelection: {
4760
+ readonly path: "/sdk/{siteId}/theme/style-selection/apply";
4761
+ readonly method: "POST";
4762
+ readonly auth: "service";
4763
+ readonly responseKind: "json";
4764
+ readonly errors: readonly ["validation:invalid_input", "resource:not_found", "resource:conflict", "server:internal_error"];
4765
+ };
4737
4766
  readonly sdkUpsertFooter: {
4738
4767
  readonly path: "/sdk/{siteId}/footer";
4739
4768
  readonly method: "POST";
@@ -8,6 +8,7 @@ import type { CheckRedirectQuery, CheckRedirectResponse, CreateRedirectRuleReque
8
8
  import type { CreateManagementKeyRequest, CreateManagementKeyResponse, CreateSiteApiKeyRequest, CreateSiteApiKeyResponse, CreateSitePreviewKeyResponse, CreateWebhookRequest, CreateWebhookResponse, DeleteBackupUploadRequest, DeleteBackupUploadResponse, DeleteWebhookResponse, GetSiteApiKeyAccessLogsResponse, GetSitePreviewKeyResponse, GetWebhookResponse, ImportBackupAsNewSiteRequest, ImportBackupAsNewSiteResponse, ImportSiteBackupRequest, ListManagementKeysResponse, ListSiteApiKeysResponse, ListWebhooksResponse, RevokeManagementKeyRequest, RevokeManagementKeyResponse, RevokeSiteApiKeyResponse, UpdateWebhookRequest, UpdateWebhookResponse, BackupImportResponse, BackupPreviewRequest, BackupPreviewResponse, CreateBackupUploadUrlRequest, CreateBackupUploadUrlResponse } from "./siteInfrastructure";
9
9
  import type { GetSiteInspirationAnalysisResponse, ListSiteInspirationAnalysesResponse } from "./siteGeneration";
10
10
  import type { ListGscPropertiesAdminResponse, AuthStatusResponse, CronAppointmentRemindersResponse, CronBillingStatusResponse, CronEventFeedbackEmailsResponse, CronEventOccurrencesResponse, CronEventRemindersResponse, CronMediaJobsQuery, CronMediaJobsResponse, CronNewsletterSendResponse, CronPaymentReconciliationResponse, CronSeoIngestResponse, CronWaitlistExpiryResponse } from "./siteOperations";
11
+ import type { ApplySiteStyleSelectionBody, ApplySiteStyleSelectionResponse } from "./siteRuntimeEndpoints";
11
12
  import type { ManagementMediaAsset, MediaResolveResponse, PushSdkConfigRequest, PushSdkConfigResponse, SdkBackfillIdentifiersResult, SdkGetCourseResponse, SdkGetEntryResponse, SdkGetEventCategoryResponse, SdkGetEventResponse, SdkGetFormResponse, SdkGetVenueResponse, SdkListCoursesResponse, SdkListEntriesResponse, SdkListEventCategoriesResponse, SdkListEventsResponse, SdkListFormsResponse, SdkListVenuesResponse, SdkMediaFinalizeUploadResponse, SdkMediaUploadUrlResponse, SdkPageResponse, SdkPublishOrUnpublishEntryResponse, SdkPullContentTypesResponse, SdkPullCourseProgram, SdkPullCourseSession, SdkPullCoursesResponse, SdkPullEntriesAllResponse, SdkPullEntriesByTypeResponse, SdkPullEntriesResponse, SdkPullEventCategoriesResponse, SdkPullEventsResponse, SdkPullEventSeries, SdkPullFooterResponse, SdkPullFormSchema, SdkPullFormsResponse, SdkPullFormSettings, SdkPullNavigationResponse, SdkPullPagesResponse, SdkPullSettings, SdkPullSettingsResponse, SdkPullSiteInfoResponse, SdkPullThemeResponse, SdkPullVenue, SdkPullVenuesResponse, SdkUpdateSettingsResponse, SdkUpsertBlockResponse, SdkUpsertCourseResponse, SdkUpsertEntryResponse, SdkUpsertEventCategoryResponse, SdkUpsertEventResponse, SdkUpsertFooterResponse, SdkUpsertFormResponse, SdkUpsertNavigationMenuResponse, SdkUpsertThemeResponse, SdkUpsertVenueResponse } from "./sdkContracts";
12
13
  import type { StripeConnectDisconnectResponse, StripeConnectStartResponse, StripeConnectStatusResponse, UpdateStripeAutomaticTaxRequest } from "./billing";
13
14
  import type { NavigationLinkInput } from "./navigation/types";
@@ -276,6 +277,9 @@ export type SitePlatformAPIEndpoints = {
276
277
  }, {
277
278
  siteId: string;
278
279
  }, SdkUpsertThemeResponse>;
280
+ sdkApplySiteStyleSelection: APIEndpoint<ApplySiteStyleSelectionBody, {
281
+ siteId: string;
282
+ }, ApplySiteStyleSelectionResponse>;
279
283
  sdkUpsertFooter: APIEndpoint<{
280
284
  bottomText?: Record<string, JsonValue> | null;
281
285
  }, {
@@ -1,7 +1,7 @@
1
1
  import type { SystemCustomizeFacetSelection, Theme } from '../../blocks/src/index';
2
2
  import type { ListMediaAssetsResult, MediaAssetWithLabels } from '@riverbankcms/media-storage-supabase';
3
3
  import type { DbJson } from '../../db/src/index';
4
- import type { PageDesignEditorReadModel, PageDesignIntent, AppearancePresetId, BoundaryOptionId, DesignBlockId, FooterLookId, HeaderLookId, LayoutVariantKey } from '../../theme-core/src/site-styles/index';
4
+ import type { PageDesignEditorReadModel, PageDesignIntent, AppearancePresetId, BoundaryOptionId, DesignBlockId, FooterLookId, HeaderLookId, LayoutVariantKey, SiteStyleId } from '../../theme-core/src/site-styles/index';
5
5
  import type { ButtonPersonalityId } from '../../theme-core/src/buttons/index';
6
6
  import type { PaletteOverrides, PaletteVariantId } from '../../theme-core/src/palette/index';
7
7
  import type { APIEndpoint } from './apiEndpointTypes';
@@ -26,6 +26,31 @@ export type SiteThemeSelectionsPayload = {
26
26
  headerLookId?: HeaderLookId | null;
27
27
  footerLookId?: FooterLookId | null;
28
28
  };
29
+ export type ApplySiteStyleSelectionBody = Readonly<{
30
+ siteStyleId: SiteStyleId;
31
+ buttonPersonalityId: ButtonPersonalityId | null;
32
+ paletteVariantId: PaletteVariantId | null;
33
+ paletteOverrides: PaletteOverrides | null;
34
+ headerLookId: HeaderLookId | null;
35
+ footerLookId: FooterLookId | null;
36
+ baseSelectionVersion: number;
37
+ selectionId?: string | null;
38
+ }>;
39
+ export type ApplySiteStyleSelectionResponse = Readonly<{
40
+ success: boolean;
41
+ themeId: string;
42
+ selectionId: string;
43
+ selectionVersion: number;
44
+ selectionUpdatedAt: string | null;
45
+ savedAt: string;
46
+ theme: Theme;
47
+ siteStyleId: SiteStyleId;
48
+ buttonPersonalityId: ButtonPersonalityId;
49
+ paletteVariantId: PaletteVariantId;
50
+ paletteOverrides: PaletteOverrides | null;
51
+ headerLookId: HeaderLookId;
52
+ footerLookId: FooterLookId;
53
+ }>;
29
54
  export type SaveSiteChromeLookSelectionBody = Readonly<{
30
55
  surface: 'header';
31
56
  lookId: HeaderLookId | null;
@@ -197,6 +222,9 @@ export type SiteRuntimeAPIEndpoints = {
197
222
  headerLookId: HeaderLookId | null;
198
223
  footerLookId: FooterLookId | null;
199
224
  }>;
225
+ applySiteStyleSelection: APIEndpoint<ApplySiteStyleSelectionBody, {
226
+ siteId: string;
227
+ }, ApplySiteStyleSelectionResponse>;
200
228
  saveSiteChromeLookSelection: APIEndpoint<SaveSiteChromeLookSelectionBody, {
201
229
  siteId: string;
202
230
  }, SaveSiteChromeLookSelectionResponse>;
@@ -69,7 +69,7 @@ type ComposeEndpointMaps<Maps extends readonly object[], Acc extends object = {}
69
69
  type SiteMembersAPIEndpointName = "listSiteMembers" | "inviteSiteMember" | "updateSiteMemberRole" | "linkCurrentUserPractitioner" | "unlinkCurrentUserPractitioner" | "removeSiteMember" | "revokeSiteInvitation" | "transferSiteOwnership" | "acceptSiteInvitation";
70
70
  type SeoAPIEndpointName = "getSeoOverview" | "getSeoPages" | "exportSeoPagesCsv" | "getSeoQueries" | "exportSeoQueriesCsv" | "getPerformanceOverview" | "applySeoChanges";
71
71
  type RedirectsAPIEndpointName = "checkRedirect" | "listRedirectRules" | "createRedirectRule" | "deleteRedirectRule";
72
- type AvailabilityAPIEndpointName = "listAvailabilityRules" | "setWeeklyAvailability" | "listBlackouts" | "createBlackout" | "deleteBlackout" | "getAvailableSlots";
72
+ type AvailabilityAPIEndpointName = "listAvailabilityRules" | "setWeeklyAvailability" | "setServiceSpecificAvailability" | "deleteServiceSpecificAvailability" | "listBlackouts" | "createBlackout" | "deleteBlackout" | "getAvailableSlots";
73
73
  type CalendarAPIEndpointName = "getCalendarStatus" | "updateCalendarPreferences" | "disconnectCalendar";
74
74
  type ContentTypesAPIEndpointName = "listContentTypes" | "createContentType" | "updateContentType" | "deleteContentType" | "duplicateContentType";
75
75
  type MediaAPIEndpointName = "createMediaAsset" | "mediaList" | "mediaProductFileList" | "mediaGet" | "mediaUpdate" | "mediaCanonicalCrop" | "mediaAssignIdentifier" | "mediaDelete" | "mediaBulkDelete" | "mediaUsageCheck" | "mediaGetSignedUrl" | "createMediaUploadUrl" | "mediaUpload" | "getMediaLabels" | "getMediaSettings" | "updateMediaSettings" | "mediaSearch" | "classifyMediaAsset" | "classifyMediaBatch" | "enqueueMediaClassifyJob" | "runMediaClassifyJob" | "runAllMediaClassifyJobs" | "mediaJobsStatus";
@@ -326,6 +326,29 @@ export type BillingComponentTimestampEndPlan = Readonly<{
326
326
  tag: 'invalid_end_at';
327
327
  endsAt: string | null;
328
328
  }>;
329
+ export type BillingComponentRegistrarAttemptStatus = 'in_flight' | 'provider_unknown' | 'provider_succeeded' | 'provider_succeeded_persist_failed' | 'provider_failed';
330
+ export type BillingComponentRegistrarAttemptBlockReason = 'provider_call_in_flight' | 'provider_outcome_unknown' | 'provider_already_succeeded' | 'provider_succeeded_persist_failed' | 'provider_failed';
331
+ export type BillingComponentRegistrarAttemptDecision<TAttempt = unknown> = Readonly<{
332
+ tag: 'can_start';
333
+ }> | Readonly<{
334
+ tag: 'blocked';
335
+ reason: BillingComponentRegistrarAttemptBlockReason;
336
+ attempt: TAttempt;
337
+ }>;
338
+ export type ExtraSiteLaunchAcceptedStatus = Extract<BillingComponentPersistenceStatus, 'accepted' | 'sync_failed' | 'active'>;
339
+ export type ExtraSiteLaunchComponentContinuation<TComponent> = Readonly<{
340
+ tag: 'accept';
341
+ component: TComponent;
342
+ }> | Readonly<{
343
+ tag: 'sync';
344
+ component: TComponent;
345
+ }> | Readonly<{
346
+ tag: 'already_active';
347
+ component: TComponent;
348
+ }> | Readonly<{
349
+ tag: 'terminal';
350
+ component: TComponent;
351
+ }>;
329
352
  export declare function isEndableBillingComponentStatus(status: BillingComponentPersistenceStatus): status is EndableBillingComponentStatus;
330
353
  export declare function isEndableBillingAddOnComponent(component: Readonly<{
331
354
  kind: BillingComponentKind;
@@ -356,6 +379,24 @@ export declare function planBillingComponentEndAtTimestamp(input: Readonly<{
356
379
  }>): BillingComponentTimestampEndPlan;
357
380
  export declare function gbpPenceToAmountCents(amountPence: number, currency: BillingComponentCurrencyCode): number;
358
381
  export declare function buildMacadamiaExtraSitePricingPolicy(allowance: MacadamiaSiteAllowancePricingInput): ExtraSitePricingPolicy;
382
+ export declare function buildManagedDomainRegistrarAttemptIdempotencyKey(input: Readonly<{
383
+ componentId: string;
384
+ domain: string;
385
+ provider: string;
386
+ }>): string;
387
+ export declare function evaluateBillingComponentRegistrarAttemptDecision<TAttempt extends Readonly<{
388
+ status: BillingComponentRegistrarAttemptStatus;
389
+ }>>(attempt: TAttempt | null): BillingComponentRegistrarAttemptDecision<TAttempt>;
390
+ export declare function isAcceptedExtraSiteComponentForLaunch(component: Readonly<{
391
+ kind: BillingComponentKind;
392
+ status: BillingComponentPersistenceStatus;
393
+ }>): component is Readonly<{
394
+ kind: 'extra_site';
395
+ status: ExtraSiteLaunchAcceptedStatus;
396
+ }>;
397
+ export declare function classifyExtraSiteLaunchComponentContinuation<TComponent extends Readonly<{
398
+ status: BillingComponentPersistenceStatus;
399
+ }>>(component: TComponent): ExtraSiteLaunchComponentContinuation<TComponent>;
359
400
  export declare function resolveBillableSiteState(input: Readonly<{
360
401
  launchedAt: string | null;
361
402
  archivedAt?: string | null;