@riverbankcms/sdk 0.91.0 → 0.93.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/{PreviewEditorSidebar-3TT47WCF.mjs → PreviewEditorSidebar-D3PAF7NW.mjs} +3 -3
- package/dist/{PreviewEditorUI-ORCLLUNZ.mjs → PreviewEditorUI-G5JVJEIJ.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-NHTLRNQD.mjs +8 -0
- package/dist/_dts/api/src/bookingConfig.d.ts +13 -1
- package/dist/_dts/api/src/bookingOperations.d.ts +1 -0
- package/dist/_dts/api/src/bookingRefundOutcomes.d.ts +6 -6
- package/dist/_dts/api/src/common/envelope.d.ts +10 -0
- package/dist/_dts/api/src/customerMembershipOutcomes.d.ts +4 -4
- package/dist/_dts/api/src/index.d.ts +2 -2
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +6 -0
- package/dist/_dts/api/src/request.d.ts +1 -1
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +32 -0
- package/dist/_dts/blocks/src/system/blocks/courses/shared/pricing.d.ts +12 -1
- package/dist/_dts/blocks/src/system/blocks/courses/shared/schemas.d.ts +12 -0
- package/dist/_dts/blocks/src/system/blocks/courses/shared/types.d.ts +4 -1
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +44 -0
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/api/types.d.ts +8 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.d.ts +8 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.state.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.interactive.d.ts +40 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.reserved-fields.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +29 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-runtime-sources.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/components.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/useCourseRegistrationWizard.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/TicketSelectionStep.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/hooks.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +9 -0
- package/dist/_dts/content-editor/src/controller/EntryControllerProvider.d.ts +14 -14
- package/dist/_dts/content-editor/src/controller/useEntrySyncHelpers.d.ts +1 -1
- package/dist/_dts/content-editor/src/hooks/useEntryActions.d.ts +5 -15
- package/dist/_dts/content-editor/src/ui/editorSnapshot.d.ts +46 -0
- package/dist/_dts/content-editor/src/ui/editorUiStore.d.ts +43 -36
- package/dist/_dts/content-model/src/entry-slots/types.d.ts +110 -2
- package/dist/_dts/core/src/branded.d.ts +3 -0
- package/dist/_dts/core/src/event-pricing.d.ts +18 -1
- package/dist/_dts/core/src/money-input.d.ts +34 -4
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +70 -0
- package/dist/_dts/media-core/src/fileAssetCompatibility.d.ts +1 -1
- package/dist/_dts/media-core/src/filePersistence.d.ts +5 -1
- package/dist/_dts/media-core/src/fileStorage.d.ts +1 -0
- package/dist/_dts/media-core/src/fileUploadFinalization.d.ts +29 -1
- package/dist/_dts/media-core/src/index.d.ts +1 -0
- package/dist/_dts/media-core/src/legacyMediaValue.d.ts +11 -0
- package/dist/_dts/media-core/src/videoPrep.d.ts +15 -6
- package/dist/_dts/media-core/src/videoSlotPolicy.d.ts +5 -5
- package/dist/_dts/media-react/src/hooks/useApiMediaUploader.d.ts +2 -1
- package/dist/_dts/sdk/src/cli/commands/push/execute/diff.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/commands/push/execute/localMediaReporting.d.ts +23 -0
- package/dist/_dts/sdk/src/cli/commands/push/scopes/commandBackedDatedOfferingScope.d.ts +54 -0
- package/dist/_dts/sdk/src/cli/commands/push/scopes/mediaPrep.d.ts +7 -2
- package/dist/_dts/sdk/src/cli/commands/push/scopes/types.d.ts +6 -0
- package/dist/_dts/sdk/src/cli/media/local-sync.d.ts +35 -0
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +23 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/{chunk-GDT2QGIL.mjs → chunk-A63UXN3P.mjs} +21 -19
- package/dist/{chunk-U5YM4AWE.mjs → chunk-AJZGT6YG.mjs} +1 -1
- package/dist/{chunk-AFPMCLS7.mjs → chunk-AQ6RT6LZ.mjs} +2 -2
- package/dist/{chunk-ZA2S7H34.mjs → chunk-NT76QGIJ.mjs} +98 -1
- package/dist/{chunk-RQUZYSES.mjs → chunk-PCNCETBI.mjs} +1196 -426
- package/dist/{chunk-S3YHJWEU.mjs → chunk-XIK2HYI3.mjs} +7 -7
- package/dist/cli/index.mjs +749 -166
- package/dist/client/{accordion-AFX37652.mjs → accordion-RNQIPG55.mjs} +2 -2
- package/dist/client/{bookingForm-32V5QCOW.mjs → bookingForm-HYEEVRLP.mjs} +89 -14
- package/dist/client/bookings.mjs +243 -17
- package/dist/client/{carousel-TJGQJ7ER.mjs → carousel-W7DQ3YPU.mjs} +3 -3
- package/dist/client/{cart-JUU2JEW4.mjs → cart-PXJ3SXXO.mjs} +7 -7
- package/dist/client/{checkout-RD6BTFX4.mjs → checkout-X3JYSOXI.mjs} +7 -7
- package/dist/client/{chunk-MLBNVN4H.mjs → chunk-6SYGVVWA.mjs} +67 -4
- package/dist/client/{chunk-E6VIWZUG.mjs → chunk-DUOHLWLF.mjs} +3 -3
- package/dist/client/{chunk-6QZIBNGV.mjs → chunk-IXDSXF2D.mjs} +154 -16
- package/dist/client/{chunk-CKXEUWWA.mjs → chunk-J6TMMMXW.mjs} +3 -3
- package/dist/client/{chunk-PMNAV6LO.mjs → chunk-JNE6UI6U.mjs} +7 -6
- package/dist/client/{chunk-ISAUXU5R.mjs → chunk-OLAOAZEO.mjs} +1 -1
- package/dist/client/{chunk-RWYFG625.mjs → chunk-PCHACQEB.mjs} +30 -2
- package/dist/client/{chunk-FMZZHAIR.mjs → chunk-PICR3NTQ.mjs} +52 -5
- package/dist/client/{chunk-6RN62XBV.mjs → chunk-Q47XGAGS.mjs} +1 -1
- package/dist/client/{chunk-WHZQDPBZ.mjs → chunk-TNGL2WJF.mjs} +1 -0
- package/dist/client/{chunk-C4LP6BPG.mjs → chunk-WERRJXNJ.mjs} +1 -1
- package/dist/client/{chunk-RMOFBBNA.mjs → chunk-YYVGSYBO.mjs} +6 -6
- package/dist/client/client.mjs +641 -54
- package/dist/client/{courseRegistration-X63QAIVV.mjs → courseRegistration-QZ67PVHO.mjs} +111 -11
- package/dist/client/{eventCalendar-5T24GCZL.mjs → eventCalendar-V3BDHQNT.mjs} +9 -9
- package/dist/client/{eventCombined-AZVTF22X.mjs → eventCombined-XYFRN2RG.mjs} +9 -9
- package/dist/client/{eventDetails-7GPFNLGF.mjs → eventDetails-TFE5TWKV.mjs} +9 -9
- package/dist/client/{eventListing-QEUMTMUM.mjs → eventListing-IQ6AGWZ6.mjs} +9 -9
- package/dist/client/{eventRegistration-P2EDKCQZ.mjs → eventRegistration-WGJVFKQJ.mjs} +9 -9
- package/dist/client/{form-NUJ7H4IN.mjs → form-6UZY6RUA.mjs} +3 -3
- package/dist/client/{headerSection-JB7LECPL.mjs → headerSection-RSFXY6V3.mjs} +3 -3
- package/dist/client/hooks.mjs +57 -5
- package/dist/client/{locationMap-UEYWUCSW.mjs → locationMap-24FH67I4.mjs} +3 -3
- package/dist/client/{newsletterForm-S2YZQ2X7.mjs → newsletterForm-QVL3MLTN.mjs} +3 -3
- package/dist/client/{productDetail-H5MADGG7.mjs → productDetail-ZDYN3G4T.mjs} +7 -7
- package/dist/client/{productList-DK7YON7H.mjs → productList-4BMJLQHZ.mjs} +7 -7
- package/dist/client/rendering/client.mjs +503 -36
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +583 -39
- package/dist/client/{shop-6PA7RDRJ.mjs → shop-U5C634FF.mjs} +7 -7
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/{sdk-runtime-JP5347OB.mjs → sdk-runtime-VGV46WVB.mjs} +6 -6
- package/dist/server/components.mjs +287 -68
- package/dist/server/config-validation.mjs +58 -5
- package/dist/server/config.mjs +58 -5
- package/dist/server/data.mjs +57 -5
- package/dist/server/index.mjs +104 -29
- package/dist/server/next.mjs +347 -85
- package/dist/server/page-converter.mjs +22 -5
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +287 -68
- package/dist/server/rendering.mjs +287 -68
- package/dist/server/routing.mjs +131 -67
- package/dist/server/server.mjs +189 -94
- package/package.json +1 -1
- package/dist/SdkPreviewModeRuntime-GMCDQPZZ.mjs +0 -8
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { type EditorUnpublishedState } from
|
|
2
|
-
import { type AutosaveState } from
|
|
3
|
-
import { type ArrayKeysState } from
|
|
4
|
-
import { type ViewportState } from
|
|
5
|
-
import { type AiOverlaysState } from
|
|
6
|
-
import { type EditorValueSnapshot, type EditorBlockItem, type EditorBlockId, type NormalizedEditorBlockItem, type DraftBlockBaselineInput, type DraftBlockBaselineUpdateMetaInput, type DraftBlockInitMetaInput, type EditorCommand, type EditorContentValues, type EditorDraftSnapshot, type EditorEffect, type EditorHistorySnapshot, type EditorLinkedEntrySnapshot, type EditorMetadataValues, type BlockPublishedBaselineInput } from
|
|
7
|
-
import { type HistoryState } from
|
|
8
|
-
import type { FocusRequest } from
|
|
9
|
-
import { type LinkedContentEntryId } from
|
|
10
|
-
import { type BlockDraftSaveability, type BlockDraftValidationIssue, type ResolveBlockManifest } from
|
|
11
|
-
export type { AutosaveStatusValue, AutosaveStatus, AutosaveHandle, AutosaveType, AutosaveType as AutosaveSchedulerKey, FocusRequest, ViewportMode, ViewportWidth, ZoomLevel, } from
|
|
12
|
-
export type { AutosaveState } from
|
|
13
|
-
export type { ArrayKeysState } from
|
|
14
|
-
export type { ViewportState } from
|
|
15
|
-
export type { EditorCommand, EditorBlockItem, EditorDraftSnapshot, EditorHistorySnapshot, EditorEffect, EditorLinkedEntrySnapshot, } from
|
|
1
|
+
import { type EditorUnpublishedState } from '../controller/deriveEditorUnpublishedState';
|
|
2
|
+
import { type AutosaveState } from './stores/autosaveStore';
|
|
3
|
+
import { type ArrayKeysState } from './stores/arrayKeysStore';
|
|
4
|
+
import { type ViewportState } from './stores/viewportStore';
|
|
5
|
+
import { type AiOverlaysState } from './stores/aiOverlaysSlice';
|
|
6
|
+
import { type EditorValueSnapshot, type EditorBlockItem, type EditorBlockId, type NormalizedEditorBlockItem, type DraftBlockBaselineInput, type DraftBlockBaselineUpdateMetaInput, type DraftBlockInitMetaInput, type EditorCommand, type EditorContentValues, type EditorDraftSnapshot, type EditorDraftUnpublishedBlockChange, type EditorEffect, type EditorHistorySnapshot, type EditorLinkedEntrySnapshot, type EditorMetadataValues, type BlockPublishedBaselineInput } from './editorHistory';
|
|
7
|
+
import { type HistoryState } from './editorHistory';
|
|
8
|
+
import type { FocusRequest } from './stores/types';
|
|
9
|
+
import { type LinkedContentEntryId } from '../linkedEntries/domain';
|
|
10
|
+
import { type BlockDraftSaveability, type BlockDraftValidationIssue, type ResolveBlockManifest } from './blockValidationView';
|
|
11
|
+
export type { AutosaveStatusValue, AutosaveStatus, AutosaveHandle, AutosaveType, AutosaveType as AutosaveSchedulerKey, FocusRequest, ViewportMode, ViewportWidth, ZoomLevel, } from './stores/types';
|
|
12
|
+
export type { AutosaveState } from './stores/autosaveStore';
|
|
13
|
+
export type { ArrayKeysState } from './stores/arrayKeysStore';
|
|
14
|
+
export type { ViewportState } from './stores/viewportStore';
|
|
15
|
+
export type { EditorCommand, EditorBlockItem, EditorDraftSnapshot, EditorHistorySnapshot, EditorEffect, EditorLinkedEntrySnapshot, } from './editorHistory';
|
|
16
16
|
export type MetadataSnapshot = EditorValueSnapshot<EditorMetadataValues | null>;
|
|
17
17
|
export type ContentSnapshot = EditorValueSnapshot<EditorContentValues | null>;
|
|
18
|
-
export type PreviewSidebarTab =
|
|
18
|
+
export type PreviewSidebarTab = 'editor' | 'assistant';
|
|
19
19
|
export type ActivePreviewField = (Readonly<{
|
|
20
|
-
kind:
|
|
20
|
+
kind: 'block';
|
|
21
21
|
blockId: EditorBlockId;
|
|
22
22
|
fieldPath: string;
|
|
23
23
|
}> | Readonly<{
|
|
24
|
-
kind:
|
|
24
|
+
kind: 'linked-entry';
|
|
25
25
|
entryId: LinkedContentEntryId;
|
|
26
26
|
fieldPath: string;
|
|
27
27
|
}>) | null;
|
|
@@ -51,17 +51,17 @@ export type MetadataState = {
|
|
|
51
51
|
autosaveFailed: (message?: string) => void;
|
|
52
52
|
clearError: () => void;
|
|
53
53
|
};
|
|
54
|
-
export type ContentState = Omit<MetadataState,
|
|
54
|
+
export type ContentState = Omit<MetadataState, 'getSnapshot'> & {
|
|
55
55
|
getSnapshot: () => ContentSnapshot;
|
|
56
56
|
};
|
|
57
57
|
export type PreviewInspection = Readonly<{
|
|
58
|
-
kind:
|
|
58
|
+
kind: 'none';
|
|
59
59
|
}> | Readonly<{
|
|
60
|
-
kind:
|
|
60
|
+
kind: 'block-customize';
|
|
61
61
|
blockId: EditorBlockId;
|
|
62
62
|
requestId: number;
|
|
63
63
|
}> | Readonly<{
|
|
64
|
-
kind:
|
|
64
|
+
kind: 'linked-entry';
|
|
65
65
|
entryId: LinkedContentEntryId;
|
|
66
66
|
requestId: number;
|
|
67
67
|
}>;
|
|
@@ -96,13 +96,13 @@ export type LinkedEntryState = {
|
|
|
96
96
|
};
|
|
97
97
|
export type EditorPreviewInspectorStore = {
|
|
98
98
|
getState: () => {
|
|
99
|
-
drafts: Pick<DraftsState,
|
|
99
|
+
drafts: Pick<DraftsState, 'inspect'>;
|
|
100
100
|
aiOverlays?: Readonly<{
|
|
101
|
-
viewMode: AiOverlaysState[
|
|
102
|
-
overrides: AiOverlaysState[
|
|
103
|
-
structure?: AiOverlaysState[
|
|
101
|
+
viewMode: AiOverlaysState['viewMode'];
|
|
102
|
+
overrides: AiOverlaysState['overrides'];
|
|
103
|
+
structure?: AiOverlaysState['structure'];
|
|
104
104
|
}>;
|
|
105
|
-
linkedEntries: Pick<LinkedEntryState,
|
|
105
|
+
linkedEntries: Pick<LinkedEntryState, 'inspect'>;
|
|
106
106
|
};
|
|
107
107
|
};
|
|
108
108
|
export type EditorHistoryState = HistoryState<EditorHistorySnapshot>;
|
|
@@ -148,13 +148,7 @@ export type DraftsState = {
|
|
|
148
148
|
getAtPath: <T = unknown>(blockId: EditorBlockId, path: string) => T | undefined;
|
|
149
149
|
updateBlockOrder: (blockIds: EditorBlockId[]) => void;
|
|
150
150
|
hasUnpublishedBlockChanges: () => boolean;
|
|
151
|
-
getFirstUnpublishedBlockChange: () =>
|
|
152
|
-
blockId: EditorBlockId;
|
|
153
|
-
kind: string;
|
|
154
|
-
reason: "missing_published" | "missing_current" | "different";
|
|
155
|
-
currentContent: Record<string, unknown> | null;
|
|
156
|
-
publishedContent: Record<string, unknown> | null;
|
|
157
|
-
} | null;
|
|
151
|
+
getFirstUnpublishedBlockChange: () => EditorDraftUnpublishedBlockChange | null;
|
|
158
152
|
markAllBlocksAsPublished: () => void;
|
|
159
153
|
onChange: (listener: (blockId: EditorBlockId) => void) => () => void;
|
|
160
154
|
};
|
|
@@ -166,6 +160,18 @@ type RestoreListener = (transition: {
|
|
|
166
160
|
next: EditorHistorySnapshot;
|
|
167
161
|
effects: readonly EditorEffect[];
|
|
168
162
|
}) => void;
|
|
163
|
+
export type ApplyPublishSuccessTransitionInput = Readonly<{
|
|
164
|
+
metadata: Readonly<{
|
|
165
|
+
baseline: Record<string, unknown> | null;
|
|
166
|
+
current: Record<string, unknown> | null;
|
|
167
|
+
published: Record<string, unknown> | null;
|
|
168
|
+
}>;
|
|
169
|
+
content: Readonly<{
|
|
170
|
+
published: Record<string, unknown> | null;
|
|
171
|
+
versionAtPublishStart: number;
|
|
172
|
+
}>;
|
|
173
|
+
blockPublishedBaselines: readonly BlockPublishedBaselineInput[] | null;
|
|
174
|
+
}>;
|
|
169
175
|
export type EditorUiState = {
|
|
170
176
|
drawerOpen: boolean;
|
|
171
177
|
previewSidebarTab: PreviewSidebarTab;
|
|
@@ -179,12 +185,13 @@ export type EditorUiState = {
|
|
|
179
185
|
inspectLinkedEntry: (entryId: string) => void;
|
|
180
186
|
clearPreviewInspection: () => void;
|
|
181
187
|
setActivePreviewField: (field: ActivePreviewField) => void;
|
|
182
|
-
requestFocus: (payload: Omit<NonNullable<FocusRequest>,
|
|
188
|
+
requestFocus: (payload: Omit<NonNullable<FocusRequest>, 'requestId'>) => void;
|
|
183
189
|
clearFocus: () => void;
|
|
184
190
|
setActiveBlockId: (id: EditorBlockId | null) => void;
|
|
185
|
-
getDraftSyncState: () =>
|
|
191
|
+
getDraftSyncState: () => 'baseline' | 'pending' | 'failed';
|
|
186
192
|
getUnpublishedState: () => EditorUnpublishedState;
|
|
187
193
|
hasAnyUnpublishedChanges: () => boolean;
|
|
194
|
+
applyPublishSuccessTransition: (transition: ApplyPublishSuccessTransitionInput) => void;
|
|
188
195
|
history: {
|
|
189
196
|
getState: () => EditorHistoryState;
|
|
190
197
|
canUndo: () => boolean;
|
|
@@ -6,6 +6,8 @@ type Brand<TValue, TBrand extends string> = TValue & {
|
|
|
6
6
|
export type SlotKey = Brand<string, 'SlotKey'>;
|
|
7
7
|
export type EntryBlockSlotId = Brand<string, 'EntryBlockSlotId'>;
|
|
8
8
|
export type EntrySlotContentEntryId = Brand<string, 'EntrySlotContentEntryId'>;
|
|
9
|
+
export type EntrySlotPageSurfaceId = Brand<string, 'EntrySlotPageSurfaceId'>;
|
|
10
|
+
export type PageSurfaceSlotId = Brand<string, 'PageSurfaceSlotId'>;
|
|
9
11
|
export type EntrySlotPageId = Brand<string, 'EntrySlotPageId'>;
|
|
10
12
|
export type EntrySlotBlockId = Brand<string, 'EntrySlotBlockId'>;
|
|
11
13
|
export type EntrySlotContentVersionId = Brand<string, 'EntrySlotContentVersionId'>;
|
|
@@ -41,12 +43,16 @@ export type NonEmptyStringParseError = Readonly<{
|
|
|
41
43
|
export declare function unsafeAsSlotKey(value: string): SlotKey;
|
|
42
44
|
export declare function unsafeAsEntryBlockSlotId(value: string): EntryBlockSlotId;
|
|
43
45
|
export declare function unsafeAsEntrySlotContentEntryId(value: string): EntrySlotContentEntryId;
|
|
46
|
+
export declare function unsafeAsEntrySlotPageSurfaceId(value: string): EntrySlotPageSurfaceId;
|
|
47
|
+
export declare function unsafeAsPageSurfaceSlotId(value: string): PageSurfaceSlotId;
|
|
44
48
|
export declare function unsafeAsEntrySlotPageId(value: string): EntrySlotPageId;
|
|
45
49
|
export declare function unsafeAsEntrySlotBlockId(value: string): EntrySlotBlockId;
|
|
46
50
|
export declare function unsafeAsEntrySlotContentVersionId(value: string): EntrySlotContentVersionId;
|
|
47
51
|
export declare function unsafeAsEntrySlotBlockOrderIndex(value: number): EntrySlotBlockOrderIndex;
|
|
48
52
|
export declare function parseSlotKey(value: unknown): EntrySlotResult<SlotKey, SlotKeyParseError>;
|
|
49
53
|
export declare function parseEntryBlockSlotId(value: unknown): EntrySlotResult<EntryBlockSlotId, BrandedUuidParseError>;
|
|
54
|
+
export declare function parseEntrySlotPageSurfaceId(value: unknown): EntrySlotResult<EntrySlotPageSurfaceId, BrandedUuidParseError>;
|
|
55
|
+
export declare function parsePageSurfaceSlotId(value: unknown): EntrySlotResult<PageSurfaceSlotId, BrandedUuidParseError>;
|
|
50
56
|
export declare const SYSTEM_ENTRY_SLOT_BLOCK_KIND: "system.entry-slot";
|
|
51
57
|
export declare const DEFAULT_ENTRY_SLOT_ALLOWED_BLOCKS: readonly ["block.body-text", "block.rich-text", "block.image-gallery", "block.cta-full"];
|
|
52
58
|
export type DefaultEntrySlotBlockKind = (typeof DEFAULT_ENTRY_SLOT_ALLOWED_BLOCKS)[number];
|
|
@@ -210,6 +216,33 @@ export type PublishedEntrySlotCompositionVersionDataV1 = Readonly<{
|
|
|
210
216
|
blockSequence: readonly PublishedEntrySlotBlockSnapshot[];
|
|
211
217
|
}>;
|
|
212
218
|
export type EntrySlotCompositionVersionDataV1 = DraftEntrySlotCompositionVersionDataV1 | PublishedEntrySlotCompositionVersionDataV1;
|
|
219
|
+
export type EntrySlotCompositionOwner = Readonly<{
|
|
220
|
+
kind: 'entrySlot';
|
|
221
|
+
entrySlotId: EntryBlockSlotId;
|
|
222
|
+
contentEntryId: EntrySlotContentEntryId;
|
|
223
|
+
}>;
|
|
224
|
+
export type SurfaceSlotCompositionOwner = Readonly<{
|
|
225
|
+
kind: 'surfaceSlot';
|
|
226
|
+
surfaceSlotId: PageSurfaceSlotId;
|
|
227
|
+
pageSurfaceId: EntrySlotPageSurfaceId;
|
|
228
|
+
}>;
|
|
229
|
+
export type SlotCompositionOwner = EntrySlotCompositionOwner | SurfaceSlotCompositionOwner;
|
|
230
|
+
export type DraftSlotCompositionVersionDataV2 = Readonly<{
|
|
231
|
+
schemaVersion: 2;
|
|
232
|
+
stage: 'draft';
|
|
233
|
+
owner: SlotCompositionOwner;
|
|
234
|
+
slotKey: SlotKey;
|
|
235
|
+
blockSequence: readonly EntrySlotBlockSnapshot[];
|
|
236
|
+
}>;
|
|
237
|
+
export type PublishedSlotCompositionVersionDataV2 = Readonly<{
|
|
238
|
+
schemaVersion: 2;
|
|
239
|
+
stage: 'published';
|
|
240
|
+
owner: SlotCompositionOwner;
|
|
241
|
+
slotKey: SlotKey;
|
|
242
|
+
blockSequence: readonly PublishedEntrySlotBlockSnapshot[];
|
|
243
|
+
}>;
|
|
244
|
+
export type SlotCompositionVersionDataV2 = DraftSlotCompositionVersionDataV2 | PublishedSlotCompositionVersionDataV2;
|
|
245
|
+
export type SlotCompositionVersionData = EntrySlotCompositionVersionDataV1 | SlotCompositionVersionDataV2;
|
|
213
246
|
export type PublishedEntrySlotCompositionBuildError = Readonly<{
|
|
214
247
|
kind: 'published-composition-contains-unpublished-block';
|
|
215
248
|
blockId: EntrySlotBlockId;
|
|
@@ -221,12 +254,23 @@ export declare function buildDraftEntrySlotCompositionVersionData(input: {
|
|
|
221
254
|
slotKey: SlotKey;
|
|
222
255
|
blockSequence: readonly EntrySlotBlockSnapshot[];
|
|
223
256
|
}): DraftEntrySlotCompositionVersionDataV1;
|
|
257
|
+
export declare function entrySlotCompositionOwnerFromV1(versionData: EntrySlotCompositionVersionDataV1): EntrySlotCompositionOwner;
|
|
258
|
+
export declare function buildDraftSlotCompositionVersionData(input: {
|
|
259
|
+
owner: SlotCompositionOwner;
|
|
260
|
+
slotKey: SlotKey;
|
|
261
|
+
blockSequence: readonly EntrySlotBlockSnapshot[];
|
|
262
|
+
}): DraftSlotCompositionVersionDataV2;
|
|
224
263
|
export declare function buildPublishedEntrySlotCompositionVersionData(input: {
|
|
225
264
|
entrySlotId: EntryBlockSlotId;
|
|
226
265
|
contentEntryId: EntrySlotContentEntryId;
|
|
227
266
|
slotKey: SlotKey;
|
|
228
267
|
blockSequence: readonly EntrySlotBlockSnapshot[];
|
|
229
268
|
}): EntrySlotResult<PublishedEntrySlotCompositionVersionDataV1, PublishedEntrySlotCompositionBuildError>;
|
|
269
|
+
export declare function buildPublishedSlotCompositionVersionData(input: {
|
|
270
|
+
owner: SlotCompositionOwner;
|
|
271
|
+
slotKey: SlotKey;
|
|
272
|
+
blockSequence: readonly EntrySlotBlockSnapshot[];
|
|
273
|
+
}): EntrySlotResult<PublishedSlotCompositionVersionDataV2, PublishedEntrySlotCompositionBuildError>;
|
|
230
274
|
export type EntrySlotCompositionParseError = Readonly<{
|
|
231
275
|
kind: 'not-object';
|
|
232
276
|
}> | Readonly<{
|
|
@@ -253,8 +297,33 @@ export type EntrySlotCompositionParseError = Readonly<{
|
|
|
253
297
|
kind: 'published-composition-contains-unpublished-block';
|
|
254
298
|
index: number;
|
|
255
299
|
}>;
|
|
300
|
+
export type SlotCompositionOwnerParseError = Readonly<{
|
|
301
|
+
kind: 'not-object';
|
|
302
|
+
}> | Readonly<{
|
|
303
|
+
kind: 'unsupported-owner-kind';
|
|
304
|
+
ownerKind: unknown;
|
|
305
|
+
}> | Readonly<{
|
|
306
|
+
kind: 'invalid-entry-slot-id';
|
|
307
|
+
error: BrandedUuidParseError | NonEmptyStringParseError;
|
|
308
|
+
}> | Readonly<{
|
|
309
|
+
kind: 'invalid-content-entry-id';
|
|
310
|
+
error: NonEmptyStringParseError;
|
|
311
|
+
}> | Readonly<{
|
|
312
|
+
kind: 'invalid-surface-slot-id';
|
|
313
|
+
error: BrandedUuidParseError;
|
|
314
|
+
}> | Readonly<{
|
|
315
|
+
kind: 'invalid-page-surface-id';
|
|
316
|
+
error: BrandedUuidParseError;
|
|
317
|
+
}>;
|
|
318
|
+
export type SlotCompositionParseError = EntrySlotCompositionParseError | Readonly<{
|
|
319
|
+
kind: 'invalid-owner';
|
|
320
|
+
error: SlotCompositionOwnerParseError;
|
|
321
|
+
}>;
|
|
256
322
|
export declare function parseEntrySlotCompositionVersionData(input: unknown): EntrySlotResult<EntrySlotCompositionVersionDataV1, EntrySlotCompositionParseError>;
|
|
323
|
+
export declare function parseSlotCompositionVersionData(input: unknown): EntrySlotResult<SlotCompositionVersionData, SlotCompositionParseError>;
|
|
324
|
+
export declare function parseSlotCompositionOwner(input: unknown): EntrySlotResult<SlotCompositionOwner, SlotCompositionOwnerParseError>;
|
|
257
325
|
export declare function blockContentVersionIdsForEntrySlotCompositionVersionData(versionData: EntrySlotCompositionVersionDataV1): readonly EntrySlotContentVersionId[];
|
|
326
|
+
export declare function blockContentVersionIdsForSlotCompositionVersionData(versionData: SlotCompositionVersionData): readonly EntrySlotContentVersionId[];
|
|
258
327
|
export type SlotPublishPlan = Readonly<{
|
|
259
328
|
kind: 'publishable';
|
|
260
329
|
slotKey: SlotKey;
|
|
@@ -330,6 +399,15 @@ export declare function describeSdkEntryBlocksPatchParseError(error: SdkEntryBlo
|
|
|
330
399
|
export type SlotContainerOwner = Readonly<{
|
|
331
400
|
kind: 'contentEntry';
|
|
332
401
|
contentEntryId: EntrySlotContentEntryId;
|
|
402
|
+
}> | Readonly<{
|
|
403
|
+
kind: 'pageSurface';
|
|
404
|
+
pageSurfaceId: EntrySlotPageSurfaceId;
|
|
405
|
+
}>;
|
|
406
|
+
export type ContentEntrySlotContainerOwner = Extract<SlotContainerOwner, {
|
|
407
|
+
kind: 'contentEntry';
|
|
408
|
+
}>;
|
|
409
|
+
export type PageSurfaceSlotContainerOwner = Extract<SlotContainerOwner, {
|
|
410
|
+
kind: 'pageSurface';
|
|
333
411
|
}>;
|
|
334
412
|
export type SlotContainerOwnerParseError = Readonly<{
|
|
335
413
|
kind: 'not-object';
|
|
@@ -339,10 +417,13 @@ export type SlotContainerOwnerParseError = Readonly<{
|
|
|
339
417
|
}> | Readonly<{
|
|
340
418
|
kind: 'invalid-content-entry-id';
|
|
341
419
|
error: NonEmptyStringParseError;
|
|
420
|
+
}> | Readonly<{
|
|
421
|
+
kind: 'invalid-page-surface-id';
|
|
422
|
+
error: BrandedUuidParseError;
|
|
342
423
|
}>;
|
|
343
424
|
export declare function parseSlotContainerOwner(input: unknown): EntrySlotResult<SlotContainerOwner, SlotContainerOwnerParseError>;
|
|
344
|
-
export declare function slotContainerOwnerToContentVersionOwner(owner:
|
|
345
|
-
export declare function slotContainerOwnerToEntrySlotLookup(owner:
|
|
425
|
+
export declare function slotContainerOwnerToContentVersionOwner(owner: ContentEntrySlotContainerOwner): ContentVersionOwner;
|
|
426
|
+
export declare function slotContainerOwnerToEntrySlotLookup(owner: ContentEntrySlotContainerOwner): Readonly<{
|
|
346
427
|
contentEntryId: EntrySlotContentEntryId;
|
|
347
428
|
}>;
|
|
348
429
|
export type PlannedSlotCompositionBlockWrite = Readonly<{
|
|
@@ -401,6 +482,33 @@ export type EditableBlockOwner = Readonly<{
|
|
|
401
482
|
kind: 'entry-slot';
|
|
402
483
|
entrySlotId: EntryBlockSlotId;
|
|
403
484
|
}>;
|
|
485
|
+
export type SlotCompositionTransferReviewReason = Readonly<{
|
|
486
|
+
kind: 'target-is-not-surface-slot';
|
|
487
|
+
targetKind: SlotCompositionOwner['kind'];
|
|
488
|
+
}>;
|
|
489
|
+
export type SlotCompositionTransferPlan = Readonly<{
|
|
490
|
+
kind: 'noChange';
|
|
491
|
+
owner: SlotCompositionOwner;
|
|
492
|
+
slotKey: SlotKey;
|
|
493
|
+
}> | Readonly<{
|
|
494
|
+
kind: 'copyEntrySlotToSurfaceSlot';
|
|
495
|
+
from: EntrySlotCompositionOwner;
|
|
496
|
+
to: SurfaceSlotCompositionOwner;
|
|
497
|
+
slotKey: SlotKey;
|
|
498
|
+
}> | Readonly<{
|
|
499
|
+
kind: 'forkSurfaceSlotComposition';
|
|
500
|
+
from: SurfaceSlotCompositionOwner;
|
|
501
|
+
to: SurfaceSlotCompositionOwner;
|
|
502
|
+
slotKey: SlotKey;
|
|
503
|
+
}> | Readonly<{
|
|
504
|
+
kind: 'manualReviewRequired';
|
|
505
|
+
reason: SlotCompositionTransferReviewReason;
|
|
506
|
+
}>;
|
|
507
|
+
export declare function planSlotCompositionTransfer(input: Readonly<{
|
|
508
|
+
from: SlotCompositionOwner;
|
|
509
|
+
to: SlotCompositionOwner;
|
|
510
|
+
slotKey: SlotKey;
|
|
511
|
+
}>): SlotCompositionTransferPlan;
|
|
404
512
|
export type EntryLifecycleRecoveryCheckpoint = 'entry-fields' | 'route-metadata' | 'slot-composition' | 'block-published-refs' | 'cache-revalidation';
|
|
405
513
|
export type EntryLifecycleCommitPlan = Readonly<{
|
|
406
514
|
kind: 'transactional-commit';
|
|
@@ -28,6 +28,7 @@ export type SiteRouteId = Brand<string, 'SiteRouteId'>;
|
|
|
28
28
|
export type PageId = Brand<string, 'PageId'>;
|
|
29
29
|
export type PageSurfaceId = Brand<string, 'PageSurfaceId'>;
|
|
30
30
|
export type OccurrenceId = Brand<string, 'OccurrenceId'>;
|
|
31
|
+
export type EventOfferingId = Brand<string, 'EventOfferingId'>;
|
|
31
32
|
export type EventSeriesId = Brand<string, 'EventSeriesId'>;
|
|
32
33
|
export type TicketTypeId = Brand<string, 'TicketTypeId'>;
|
|
33
34
|
export type EventCategoryId = Brand<string, 'EventCategoryId'>;
|
|
@@ -143,6 +144,7 @@ export declare const unsafeAsSiteRouteId: (id: string) => SiteRouteId;
|
|
|
143
144
|
export declare const unsafeAsPageId: (id: string) => PageId;
|
|
144
145
|
export declare const unsafeAsPageSurfaceId: (id: string) => PageSurfaceId;
|
|
145
146
|
export declare const unsafeAsOccurrenceId: (id: string) => OccurrenceId;
|
|
147
|
+
export declare const unsafeAsEventOfferingId: (id: string) => EventOfferingId;
|
|
146
148
|
export declare const unsafeAsEventSeriesId: (id: string) => EventSeriesId;
|
|
147
149
|
export declare const unsafeAsTicketTypeId: (id: string) => TicketTypeId;
|
|
148
150
|
export declare const unsafeAsEventCategoryId: (id: string) => EventCategoryId;
|
|
@@ -232,6 +234,7 @@ export declare const parseSiteRouteId: (value: unknown) => Result<SiteRouteId, B
|
|
|
232
234
|
export declare const parsePageId: (value: unknown) => Result<PageId, BrandedIdParseError>;
|
|
233
235
|
export declare const parsePageSurfaceId: (value: unknown) => Result<PageSurfaceId, BrandedIdParseError>;
|
|
234
236
|
export declare const parseOccurrenceId: (value: unknown) => Result<OccurrenceId, BrandedIdParseError>;
|
|
237
|
+
export declare const parseEventOfferingId: (value: unknown) => Result<EventOfferingId, BrandedIdParseError>;
|
|
235
238
|
export declare const parseTicketTypeId: (value: unknown) => Result<TicketTypeId, BrandedIdParseError>;
|
|
236
239
|
export declare const parsePricingOptionId: (value: unknown) => Result<PricingOptionId, BrandedIdParseError>;
|
|
237
240
|
export declare const parseUserId: (value: unknown) => Result<UserId, BrandedIdParseError>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CurrencyDecimals } from "./currency-format";
|
|
2
|
-
export declare const EVENT_PRICING_MODES: readonly ["single", "ticket_types"];
|
|
2
|
+
export declare const EVENT_PRICING_MODES: readonly ["single", "ticket_types", "sliding_scale"];
|
|
3
3
|
export type EventPricingMode = (typeof EVENT_PRICING_MODES)[number];
|
|
4
4
|
export type PublicEventPricingType = "free" | "paid" | "external";
|
|
5
5
|
export type PublicCoursePriceDisplay = Readonly<{
|
|
@@ -13,6 +13,11 @@ export type PublicCoursePriceDisplay = Readonly<{
|
|
|
13
13
|
kind: "from";
|
|
14
14
|
amount: number;
|
|
15
15
|
currency: string;
|
|
16
|
+
}> | Readonly<{
|
|
17
|
+
kind: "range";
|
|
18
|
+
minAmount: number;
|
|
19
|
+
maxAmount: number;
|
|
20
|
+
currency: string;
|
|
16
21
|
}> | Readonly<{
|
|
17
22
|
kind: "unavailable";
|
|
18
23
|
currency: string;
|
|
@@ -70,6 +75,18 @@ export type PublicEventPricing<TTicketType = never> = Readonly<{
|
|
|
70
75
|
currency: string;
|
|
71
76
|
ticketTypes: readonly TTicketType[];
|
|
72
77
|
display: PublicEventTicketTypePriceDisplay;
|
|
78
|
+
}> | Readonly<{
|
|
79
|
+
kind: "sliding_scale";
|
|
80
|
+
minAmount: number;
|
|
81
|
+
maxAmount: number;
|
|
82
|
+
suggestedAmount: number | null;
|
|
83
|
+
currency: string;
|
|
84
|
+
display: Readonly<{
|
|
85
|
+
kind: "range";
|
|
86
|
+
minAmount: number;
|
|
87
|
+
maxAmount: number;
|
|
88
|
+
currency: string;
|
|
89
|
+
}>;
|
|
73
90
|
}> | Readonly<{
|
|
74
91
|
kind: "course";
|
|
75
92
|
display: Readonly<{
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Brand } from './branded';
|
|
2
2
|
import { type Result } from './result';
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
3
|
+
export type Cents = Brand<number, 'Cents'>;
|
|
4
|
+
export type NonNegativeCents = Brand<number, 'NonNegativeCents'>;
|
|
5
|
+
export type PositiveCents = Brand<number, 'PositiveCents'>;
|
|
5
6
|
export type MoneyInputParseError = Readonly<{
|
|
6
7
|
kind: 'empty';
|
|
7
8
|
}> | Readonly<{
|
|
@@ -11,6 +12,15 @@ export type MoneyInputParseError = Readonly<{
|
|
|
11
12
|
}> | Readonly<{
|
|
12
13
|
kind: 'zero-not-allowed';
|
|
13
14
|
}>;
|
|
15
|
+
export type CentsParseError = Readonly<{
|
|
16
|
+
kind: 'invalid-number';
|
|
17
|
+
}> | Readonly<{
|
|
18
|
+
kind: 'not-whole-cents';
|
|
19
|
+
}> | Readonly<{
|
|
20
|
+
kind: 'negative';
|
|
21
|
+
}> | Readonly<{
|
|
22
|
+
kind: 'zero-not-allowed';
|
|
23
|
+
}>;
|
|
14
24
|
export type ParseMoneyInputToCentsOptions = Readonly<{
|
|
15
25
|
allowZero?: boolean;
|
|
16
26
|
stripFormatting?: boolean;
|
|
@@ -18,7 +28,27 @@ export type ParseMoneyInputToCentsOptions = Readonly<{
|
|
|
18
28
|
export type ParseStrictMoneyInputToCentsOptions = Readonly<{
|
|
19
29
|
stripFormatting?: boolean;
|
|
20
30
|
}>;
|
|
21
|
-
export declare function
|
|
22
|
-
export declare function
|
|
31
|
+
export declare function unsafeAsCents(value: number): Cents;
|
|
32
|
+
export declare function unsafeAsNonNegativeCents(value: number): NonNegativeCents;
|
|
33
|
+
export declare function unsafeAsPositiveCents(value: number): PositiveCents;
|
|
34
|
+
export declare function unwrapCents(value: Cents): number;
|
|
35
|
+
export declare function isWholeCents(value: number): boolean;
|
|
36
|
+
export declare function isNonNegativeWholeCents(value: number): boolean;
|
|
37
|
+
export declare function isPositiveWholeCents(value: number): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Normalizes a derived amount to signed whole cents. Use parse*Cents for
|
|
40
|
+
* untrusted input that should fail instead of truncating or clamping.
|
|
41
|
+
*/
|
|
42
|
+
export declare function toCents(value: number): Cents;
|
|
43
|
+
/**
|
|
44
|
+
* Normalizes a derived amount to non-negative whole cents. This intentionally
|
|
45
|
+
* clamps negatives to zero; use parseNonNegativeCents for validation.
|
|
46
|
+
*/
|
|
47
|
+
export declare function toNonNegativeCents(value: number): NonNegativeCents;
|
|
48
|
+
export declare function parseCents(value: number): Result<Cents, CentsParseError>;
|
|
49
|
+
export declare function parseNonNegativeCents(value: number): Result<NonNegativeCents, CentsParseError>;
|
|
50
|
+
export declare function parsePositiveCents(value: number): Result<PositiveCents, CentsParseError>;
|
|
51
|
+
export declare function parsePositiveMoneyInputToCents(value: string, options?: ParseStrictMoneyInputToCentsOptions): Result<PositiveCents, MoneyInputParseError>;
|
|
52
|
+
export declare function parseNonNegativeMoneyInputToCents(value: string, options?: ParseStrictMoneyInputToCentsOptions): Result<NonNegativeCents, MoneyInputParseError>;
|
|
23
53
|
export declare function parseMoneyInputToCents(value: string, options?: ParseMoneyInputToCentsOptions): number | null;
|
|
24
54
|
export declare function formatMoneyInputFromCents(amountCents: number | null | undefined): string;
|
|
@@ -3309,6 +3309,9 @@ export type Database = {
|
|
|
3309
3309
|
pricing_strategy: string;
|
|
3310
3310
|
single_price_amount: number | null;
|
|
3311
3311
|
site_id: string;
|
|
3312
|
+
sliding_max_amount: number | null;
|
|
3313
|
+
sliding_min_amount: number | null;
|
|
3314
|
+
sliding_suggested_amount: number | null;
|
|
3312
3315
|
updated_at: string;
|
|
3313
3316
|
};
|
|
3314
3317
|
Insert: {
|
|
@@ -3323,6 +3326,9 @@ export type Database = {
|
|
|
3323
3326
|
pricing_strategy: string;
|
|
3324
3327
|
single_price_amount?: number | null;
|
|
3325
3328
|
site_id: string;
|
|
3329
|
+
sliding_max_amount?: number | null;
|
|
3330
|
+
sliding_min_amount?: number | null;
|
|
3331
|
+
sliding_suggested_amount?: number | null;
|
|
3326
3332
|
updated_at?: string;
|
|
3327
3333
|
};
|
|
3328
3334
|
Update: {
|
|
@@ -3337,6 +3343,9 @@ export type Database = {
|
|
|
3337
3343
|
pricing_strategy?: string;
|
|
3338
3344
|
single_price_amount?: number | null;
|
|
3339
3345
|
site_id?: string;
|
|
3346
|
+
sliding_max_amount?: number | null;
|
|
3347
|
+
sliding_min_amount?: number | null;
|
|
3348
|
+
sliding_suggested_amount?: number | null;
|
|
3340
3349
|
updated_at?: string;
|
|
3341
3350
|
};
|
|
3342
3351
|
Relationships: [
|
|
@@ -11529,6 +11538,67 @@ export type Database = {
|
|
|
11529
11538
|
}
|
|
11530
11539
|
];
|
|
11531
11540
|
};
|
|
11541
|
+
page_surface_slots: {
|
|
11542
|
+
Row: {
|
|
11543
|
+
created_at: string;
|
|
11544
|
+
created_by: string | null;
|
|
11545
|
+
deleted_at: string | null;
|
|
11546
|
+
deleted_by: string | null;
|
|
11547
|
+
id: string;
|
|
11548
|
+
page_surface_id: string;
|
|
11549
|
+
site_id: string;
|
|
11550
|
+
slot_key: string;
|
|
11551
|
+
updated_at: string;
|
|
11552
|
+
updated_by: string | null;
|
|
11553
|
+
};
|
|
11554
|
+
Insert: {
|
|
11555
|
+
created_at?: string;
|
|
11556
|
+
created_by?: string | null;
|
|
11557
|
+
deleted_at?: string | null;
|
|
11558
|
+
deleted_by?: string | null;
|
|
11559
|
+
id?: string;
|
|
11560
|
+
page_surface_id: string;
|
|
11561
|
+
site_id: string;
|
|
11562
|
+
slot_key: string;
|
|
11563
|
+
updated_at?: string;
|
|
11564
|
+
updated_by?: string | null;
|
|
11565
|
+
};
|
|
11566
|
+
Update: {
|
|
11567
|
+
created_at?: string;
|
|
11568
|
+
created_by?: string | null;
|
|
11569
|
+
deleted_at?: string | null;
|
|
11570
|
+
deleted_by?: string | null;
|
|
11571
|
+
id?: string;
|
|
11572
|
+
page_surface_id?: string;
|
|
11573
|
+
site_id?: string;
|
|
11574
|
+
slot_key?: string;
|
|
11575
|
+
updated_at?: string;
|
|
11576
|
+
updated_by?: string | null;
|
|
11577
|
+
};
|
|
11578
|
+
Relationships: [
|
|
11579
|
+
{
|
|
11580
|
+
foreignKeyName: "page_surface_slots_page_surface_id_fkey";
|
|
11581
|
+
columns: ["page_surface_id"];
|
|
11582
|
+
isOneToOne: false;
|
|
11583
|
+
referencedRelation: "page_surfaces";
|
|
11584
|
+
referencedColumns: ["id"];
|
|
11585
|
+
},
|
|
11586
|
+
{
|
|
11587
|
+
foreignKeyName: "page_surface_slots_site_id_fkey";
|
|
11588
|
+
columns: ["site_id"];
|
|
11589
|
+
isOneToOne: false;
|
|
11590
|
+
referencedRelation: "sites";
|
|
11591
|
+
referencedColumns: ["id"];
|
|
11592
|
+
},
|
|
11593
|
+
{
|
|
11594
|
+
foreignKeyName: "page_surface_slots_surface_site_fk";
|
|
11595
|
+
columns: ["page_surface_id", "site_id"];
|
|
11596
|
+
isOneToOne: false;
|
|
11597
|
+
referencedRelation: "page_surfaces";
|
|
11598
|
+
referencedColumns: ["id", "site_id"];
|
|
11599
|
+
}
|
|
11600
|
+
];
|
|
11601
|
+
};
|
|
11532
11602
|
page_surfaces: {
|
|
11533
11603
|
Row: {
|
|
11534
11604
|
created_at: string;
|
|
@@ -9,7 +9,7 @@ import type { MediaAsset, MediaSource } from './types';
|
|
|
9
9
|
* Until then it keeps old image/video rows readable through the new typed model without
|
|
10
10
|
* changing current storage or DB behavior.
|
|
11
11
|
*/
|
|
12
|
-
export type LegacyMediaAssetProjectionError = 'unsupported-mime-type' | 'non-renderable-legacy-media-kind' | 'empty-site-id' | 'empty-storage-bucket' | 'empty-storage-path' | 'empty-filename' | 'invalid-byte-count' | 'invalid-checksum' | 'invalid-created-at' | 'invalid-updated-at';
|
|
12
|
+
export type LegacyMediaAssetProjectionError = 'unsupported-mime-type' | 'non-renderable-legacy-media-kind' | 'empty-site-id' | 'empty-storage-bucket' | 'empty-storage-path' | 'empty-filename' | 'invalid-storage-path' | 'invalid-byte-count' | 'invalid-checksum' | 'invalid-created-at' | 'invalid-updated-at';
|
|
13
13
|
export declare function projectLegacyMediaAssetToFileAsset(asset: MediaAsset): Result<FileAsset, LegacyMediaAssetProjectionError>;
|
|
14
14
|
export declare function fileAssetSourceFromLegacyMediaSource(source: MediaSource): FileAssetSource;
|
|
15
15
|
export declare function deriveLegacyMediaAssetDerivatives(asset: MediaAsset, kind: FileKind): readonly FileDerivative[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type DeclaredMimeType, type DetectedMimeType, type FileChecksumSha256, type NonEmptyArray, type OriginalFilename, type PositiveByteCount, type Result, type SafeDownloadFilename, type SiteId, type StorageBucketName, type StoragePath, type UploadSessionId, type UserId, type UtcIsoDateTimeString } from '../../core/src/index';
|
|
2
2
|
import { type AccessPolicy, type ActiveFileAssetValidationError, type ActiveValidatedFileAsset, type FileAsset, type FileActor, type FileDerivative, type FileKind, type FileUse, type StorageClass, type UploadSessionState, type UploadSessionStateTag, type UploadIntent, type UploadPolicy, type UploadPolicyDetection } from './fileDomain';
|
|
3
|
+
import { type FileStoragePathError } from './fileStorage';
|
|
3
4
|
export type FileKindJson = FileJsonObject;
|
|
4
5
|
export type FileUseJson = FileJsonObject;
|
|
5
6
|
export type FileUsesJson = readonly FileUseJson[];
|
|
@@ -8,7 +9,7 @@ export type UploadIntentJson = FileJsonObject;
|
|
|
8
9
|
export type AccessPolicyJson = FileJsonObject;
|
|
9
10
|
export type UploadPolicyJson = FileJsonObject;
|
|
10
11
|
export type FileDomainJson = FileJsonObject | readonly FileJsonValue[];
|
|
11
|
-
export type FileDomainJsonParseError = 'expected-object' | 'expected-array' | 'expected-non-empty-array' | 'invalid-tag' | 'invalid-field' | 'invalid-string' | 'invalid-number' | 'invalid-positive-byte-count' | 'invalid-positive-seconds' | 'invalid-timestamp' | 'invalid-checksum' | 'invalid-safe-download-filename' | 'missing-state-timestamp' | 'missing-finalized-asset' | 'missing-rejection-reason';
|
|
12
|
+
export type FileDomainJsonParseError = 'expected-object' | 'expected-array' | 'expected-non-empty-array' | 'invalid-tag' | 'invalid-field' | 'invalid-string' | 'invalid-number' | 'invalid-positive-byte-count' | 'invalid-positive-seconds' | 'invalid-timestamp' | 'invalid-checksum' | 'invalid-safe-download-filename' | 'invalid-storage-path' | 'missing-state-timestamp' | 'missing-finalized-asset' | 'missing-rejection-reason';
|
|
12
13
|
export type FileUploadSessionRecordError = 'actor-site-mismatch' | 'policy-intent-mismatch';
|
|
13
14
|
export type FileJsonValue = string | number | boolean | null | FileJsonObject | readonly FileJsonValue[];
|
|
14
15
|
export type FileJsonObject = {
|
|
@@ -179,6 +180,9 @@ export type FileAssetRowParseError = {
|
|
|
179
180
|
} | {
|
|
180
181
|
readonly tag: 'invalid-derivative-kind';
|
|
181
182
|
readonly error: FileDomainJsonParseError;
|
|
183
|
+
} | {
|
|
184
|
+
readonly tag: 'invalid-storage-path';
|
|
185
|
+
readonly error: FileStoragePathError;
|
|
182
186
|
} | {
|
|
183
187
|
readonly tag: 'invalid-file-asset';
|
|
184
188
|
readonly error: ActiveFileAssetValidationError;
|
|
@@ -38,3 +38,4 @@ export declare function buildStagedUploadStoragePath(input: StagedUploadStorageP
|
|
|
38
38
|
* `sites/{siteId}/files/{fileAssetId}/{safeDownloadFilename}`.
|
|
39
39
|
*/
|
|
40
40
|
export declare function buildDurableFileStoragePath(input: DurableFileStoragePathInput): Result<SiteScopedStoragePath, FileStoragePathError>;
|
|
41
|
+
export declare function parseStoragePath(value: string): Result<StoragePath, FileStoragePathError>;
|
|
@@ -13,7 +13,35 @@ export type FinalizableFileUploadSessionRecord = Omit<FileUploadSessionRecord, '
|
|
|
13
13
|
export type FinalizedFileUploadSessionRecord = Omit<FileUploadSessionRecord, 'state'> & {
|
|
14
14
|
readonly state: FinalizedUploadSessionState;
|
|
15
15
|
};
|
|
16
|
-
export type FileUploadFinalizationError =
|
|
16
|
+
export type FileUploadFinalizationError = {
|
|
17
|
+
readonly tag: 'checksum-mismatch';
|
|
18
|
+
} | {
|
|
19
|
+
readonly tag: 'checksum-missing';
|
|
20
|
+
} | {
|
|
21
|
+
readonly tag: 'declared-detected-mime-mismatch';
|
|
22
|
+
readonly declaredMimeType: DeclaredMimeType;
|
|
23
|
+
readonly detectedMimeType: DetectedMimeType;
|
|
24
|
+
readonly declaredKind: FileKind;
|
|
25
|
+
readonly detectedKind: FileKind;
|
|
26
|
+
} | {
|
|
27
|
+
readonly tag: 'file-too-large';
|
|
28
|
+
} | {
|
|
29
|
+
readonly tag: 'kind-not-allowed';
|
|
30
|
+
} | {
|
|
31
|
+
readonly tag: 'policy-intent-mismatch';
|
|
32
|
+
} | {
|
|
33
|
+
readonly tag: 'storage-bucket-mismatch';
|
|
34
|
+
} | {
|
|
35
|
+
readonly tag: 'storage-path-mismatch';
|
|
36
|
+
} | {
|
|
37
|
+
readonly tag: 'upload-session-expired';
|
|
38
|
+
} | {
|
|
39
|
+
readonly tag: 'upload-session-not-finalizable';
|
|
40
|
+
} | {
|
|
41
|
+
readonly tag: 'unsupported-declared-mime-type';
|
|
42
|
+
} | {
|
|
43
|
+
readonly tag: 'unsupported-detected-mime-type';
|
|
44
|
+
};
|
|
17
45
|
export type FileUploadFinalizationInput = {
|
|
18
46
|
readonly uploadSession: FileUploadSessionRecord;
|
|
19
47
|
readonly requestedStorageBucket: StorageBucketName;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type LegacyStringMediaFieldConfig = Readonly<{
|
|
2
|
+
type: 'media' | 'file';
|
|
3
|
+
mediaKinds?: readonly string[] | null;
|
|
4
|
+
fileKinds?: readonly string[] | null;
|
|
5
|
+
}>;
|
|
6
|
+
export type LegacyStringMediaValue = Readonly<{
|
|
7
|
+
type: string;
|
|
8
|
+
src: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare function legacyStringMediaTypeForField(field: LegacyStringMediaFieldConfig): string;
|
|
11
|
+
export declare function normalizeLegacyStringMediaValueForField(value: unknown, field: LegacyStringMediaFieldConfig): unknown;
|