@riverbankcms/sdk 0.98.0 → 0.99.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-CG3SSJND.mjs → PreviewEditorSidebar-TPOKCCKY.mjs} +3 -3
- package/dist/{PreviewEditorUI-RHNGKAAU.mjs → PreviewEditorUI-Y347GLC2.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-OGTXRQ4M.mjs +8 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +36 -36
- package/dist/_dts/api/src/billing.d.ts +2 -0
- package/dist/_dts/api/src/commercePortalEndpoints.d.ts +5 -1
- package/dist/_dts/api/src/endpoints.d.ts +8 -0
- package/dist/_dts/api/src/index.d.ts +1 -1
- package/dist/_dts/api/src/siteOperations.d.ts +65 -1
- package/dist/_dts/billing/src/site-arrangements.d.ts +151 -0
- package/dist/_dts/billing/src/subscriptions/store.d.ts +2 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/utils/resolveThumbnail.d.ts +2 -1
- package/dist/_dts/blocks/src/PageRenderer.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/components/booking/DatePicker.d.ts +6 -2
- package/dist/_dts/blocks/src/system/runtime/components/booking/SuccessMessage.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/components/booking/TimeSlotSelector.d.ts +10 -4
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.state.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +11 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/StepIndicator.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/FeedbackMessage.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/{nodes/event-registration → shared/components}/SelectableOptionCard.d.ts +11 -2
- package/dist/_dts/blocks/src/system/runtime/shared/components/StepIndicator.d.ts +16 -5
- package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/shared/index.d.ts +2 -2
- package/dist/_dts/blocks/src/utils/date-formatting.d.ts +17 -1
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +274 -30
- package/dist/_dts/sdk/src/__mocks__/next-cache.d.ts +1 -1
- package/dist/_dts/sdk/src/cli/commands/push.d.ts +13 -0
- package/dist/_dts/sdk/src/cli/merge-remote/entryMergeReport.d.ts +6 -18
- package/dist/_dts/sdk/src/cli/merge-remote/entrySnapshots.d.ts +2 -4
- package/dist/_dts/sdk/src/cli/merge-remote/pageMergeReport.d.ts +6 -18
- package/dist/_dts/sdk/src/cli/merge-remote/pageSnapshots.d.ts +2 -4
- package/dist/_dts/sdk/src/cli/merge-remote/sharedBaseSnapshots.d.ts +32 -0
- package/dist/_dts/sdk/src/cli/merge-remote/sharedMergePlan.d.ts +27 -0
- package/dist/_dts/sdk/src/cli/merge-remote/sharedMergeReport.d.ts +63 -0
- package/dist/_dts/sdk/src/client/index.d.ts +6 -0
- package/dist/_dts/sdk/src/data/prefetchBlockData.d.ts +6 -1
- package/dist/_dts/sdk/src/next/types.d.ts +19 -0
- package/dist/_dts/sdk/src/prebuild/loader.d.ts +8 -1
- package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +2 -0
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +4 -0
- package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +6 -0
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +8 -0
- package/dist/_dts/sdk/src/rendering/index.d.ts +7 -7
- package/dist/_dts/sdk/src/rendering/overrides.d.ts +2 -0
- package/dist/_dts/sdk/src/routing/resolveRoute.d.ts +18 -0
- package/dist/_dts/sdk/src/test/apiClient.d.ts +17 -0
- package/dist/_dts/sdk/src/test/bunDom.setup.d.ts +1 -0
- package/dist/_dts/sdk/src/test/env.d.ts +4 -0
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/site-commands/src/commands.d.ts +3 -3
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/interactive/generateBaseCSS.d.ts +6 -0
- package/dist/_dts/theme-core/src/status/contextualColors.d.ts +6 -0
- package/dist/_dts/theme-core/src/status/index.d.ts +1 -0
- package/dist/{chunk-H24OU7WG.mjs → chunk-4HXF2QLH.mjs} +2 -2
- package/dist/{chunk-QPXE2OUZ.mjs → chunk-EMJIT3ZJ.mjs} +1 -1
- package/dist/{chunk-PKDPQHB5.mjs → chunk-PM7HGDHM.mjs} +2 -2
- package/dist/{chunk-DBRI3PQF.mjs → chunk-XO34WBBP.mjs} +1383 -1143
- package/dist/{chunk-6WDBXCPX.mjs → chunk-YGTTEVUM.mjs} +7 -7
- package/dist/{chunk-V2BYFSPW.mjs → chunk-YWTCCOSF.mjs} +8 -0
- package/dist/cli/index.mjs +1010 -921
- package/dist/client/{accordion-Q2BDNL53.mjs → accordion-QSUEYL4L.mjs} +2 -2
- package/dist/client/{bookingForm-ZMP4P7EK.mjs → bookingForm-QYGAHPDP.mjs} +364 -300
- package/dist/client/bookings.mjs +697 -411
- package/dist/client/{carousel-LW3UXPWO.mjs → carousel-SM2LEWAU.mjs} +3 -3
- package/dist/client/{cart-Z6D3KS6K.mjs → cart-3N3SFKNQ.mjs} +7 -7
- package/dist/client/{checkout-YMT2QJQM.mjs → checkout-YFAYPKPZ.mjs} +7 -7
- package/dist/client/{chunk-XNTHVZ25.mjs → chunk-5DLGREUB.mjs} +1 -1
- package/dist/client/{chunk-SK2BMD22.mjs → chunk-CLZ7NBSP.mjs} +147 -75
- package/dist/client/{chunk-R4XK3CKR.mjs → chunk-CYJ3MUFP.mjs} +6 -5
- package/dist/client/{chunk-JNE6UI6U.mjs → chunk-H3H3ODO7.mjs} +1 -1
- package/dist/client/{chunk-IEOECM7U.mjs → chunk-HPEQ4YWW.mjs} +28 -73
- package/dist/client/{chunk-PCHACQEB.mjs → chunk-IIUIKJ4K.mjs} +15 -7
- package/dist/client/{chunk-KDP7ZRZV.mjs → chunk-IOAHWAQG.mjs} +2 -0
- package/dist/client/{chunk-26ZBRXFR.mjs → chunk-JTKBF3W2.mjs} +3 -3
- package/dist/client/{chunk-OLAOAZEO.mjs → chunk-K7KTSACR.mjs} +1 -1
- package/dist/client/{chunk-ET2MDQQT.mjs → chunk-R32M5HFS.mjs} +6 -6
- package/dist/client/{chunk-DRRQ7QSL.mjs → chunk-WEVT46PX.mjs} +3 -3
- package/dist/client/{chunk-HBQEAOG4.mjs → chunk-ZU65LTI3.mjs} +1 -1
- package/dist/client/client.mjs +1875 -1581
- package/dist/client/{courseRegistration-DGKCMC77.mjs → courseRegistration-LYBE7VVK.mjs} +7 -7
- package/dist/client/{eventCalendar-74Z2NNFM.mjs → eventCalendar-FMTB75X6.mjs} +9 -9
- package/dist/client/{eventCombined-GK2ODOX2.mjs → eventCombined-E4LUCJXT.mjs} +9 -9
- package/dist/client/{eventDetails-MONAGT3N.mjs → eventDetails-GELSRR4Z.mjs} +9 -9
- package/dist/client/{eventListing-SKGAO6PS.mjs → eventListing-TB623B6R.mjs} +9 -9
- package/dist/client/{eventRegistration-6KISGXRD.mjs → eventRegistration-NRIKHXTI.mjs} +9 -9
- package/dist/client/{form-FXPRTXHI.mjs → form-Y4U4IAXE.mjs} +3 -3
- package/dist/client/{headerSection-7NAN5WNB.mjs → headerSection-QSOVV5P7.mjs} +3 -3
- package/dist/client/hooks.mjs +115 -21
- package/dist/client/{locationMap-UERN74U4.mjs → locationMap-QYCAHH7H.mjs} +3 -3
- package/dist/client/{newsletterForm-SGWXMJ7U.mjs → newsletterForm-NWHY5TBY.mjs} +3 -3
- package/dist/client/{productDetail-HN3HWZQZ.mjs → productDetail-FYDMU2CE.mjs} +7 -7
- package/dist/client/{productList-YT22Z5UR.mjs → productList-D76CGACQ.mjs} +7 -7
- package/dist/client/rendering/client.mjs +1209 -975
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +1952 -1638
- package/dist/client/{shop-TKEDNWUS.mjs → shop-SOUACT5N.mjs} +7 -7
- package/dist/preview-next/before-render.mjs +8 -0
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/preview-next/middleware.mjs +8 -0
- package/dist/{sdk-runtime-LWNYCQF2.mjs → sdk-runtime-XPVE3LBA.mjs} +6 -6
- package/dist/server/components.mjs +917 -765
- package/dist/server/config-validation.mjs +100 -19
- package/dist/server/config.mjs +100 -19
- package/dist/server/data.mjs +115 -21
- package/dist/server/index.mjs +59 -25
- package/dist/server/next.mjs +1017 -816
- package/dist/server/page-converter.mjs +92 -19
- package/dist/server/prebuild-loader.mjs +42 -23
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +932 -767
- package/dist/server/rendering.mjs +968 -776
- package/dist/server/routing.mjs +162 -36
- package/dist/server/server.mjs +156 -32
- package/dist/server/theme-bridge.mjs +597 -505
- package/dist/server/theme.mjs +5 -4
- package/dist/styles/index.css +499 -490
- package/package.json +6 -4
- package/dist/SdkPreviewModeRuntime-OV5PNJBB.mjs +0 -8
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type RemoteMergePlanCore<TDecision, TSummary> = Readonly<{
|
|
2
|
+
decisions: readonly TDecision[];
|
|
3
|
+
summary: TSummary;
|
|
4
|
+
}>;
|
|
5
|
+
export type RemoteMergePlanConfig<TSubject, TBaseSnapshot, TValue, TDecision, TSummary> = Readonly<{
|
|
6
|
+
subjects(): readonly TSubject[];
|
|
7
|
+
readBaseSnapshot(subject: TSubject): Promise<TBaseSnapshot | null>;
|
|
8
|
+
valueFromBaseSnapshot(snapshot: TBaseSnapshot): TValue | null;
|
|
9
|
+
localValue(subject: TSubject): TValue | null;
|
|
10
|
+
remoteValue(subject: TSubject): TValue | null;
|
|
11
|
+
planDecision(input: Readonly<{
|
|
12
|
+
subject: TSubject;
|
|
13
|
+
base: TValue | null;
|
|
14
|
+
local: TValue | null;
|
|
15
|
+
remote: TValue | null;
|
|
16
|
+
}>): TDecision;
|
|
17
|
+
summarize(decisions: readonly TDecision[]): TSummary;
|
|
18
|
+
}>;
|
|
19
|
+
export declare function buildRemoteMergePlanWithConfig<TSubject, TBaseSnapshot, TValue, TDecision, TSummary>(config: RemoteMergePlanConfig<TSubject, TBaseSnapshot, TValue, TDecision, TSummary>): Promise<RemoteMergePlanCore<TDecision, TSummary>>;
|
|
20
|
+
export type DecisionSummaryKeyMap<TDecisionKind extends string, TSummary> = Readonly<Record<TDecisionKind, NumericKeys<TSummary>>>;
|
|
21
|
+
type NumericKeys<TValue> = {
|
|
22
|
+
[TKey in keyof TValue]: TValue[TKey] extends number ? TKey : never;
|
|
23
|
+
}[keyof TValue];
|
|
24
|
+
export declare function summarizeMergeDecisions<TDecisionKind extends string, TDecision extends {
|
|
25
|
+
kind: TDecisionKind;
|
|
26
|
+
}, TSummary>(decisions: readonly TDecision[], initialSummary: TSummary, summaryKeyByDecisionKind: DecisionSummaryKeyMap<TDecisionKind, TSummary>): TSummary;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { OutputContext } from '../output';
|
|
2
|
+
type MergeDecisionSubject<TSubject> = Readonly<{
|
|
3
|
+
kind: string;
|
|
4
|
+
subject: TSubject;
|
|
5
|
+
}>;
|
|
6
|
+
type ConflictCode<TDecision> = Extract<TDecision, {
|
|
7
|
+
kind: 'conflict';
|
|
8
|
+
}> extends {
|
|
9
|
+
conflict: {
|
|
10
|
+
code: infer TCode extends string;
|
|
11
|
+
};
|
|
12
|
+
} ? TCode : string;
|
|
13
|
+
type ReportDecisionLineKind<TDecision extends {
|
|
14
|
+
kind: string;
|
|
15
|
+
}> = Exclude<TDecision['kind'], 'auto_merge' | 'conflict' | 'unchanged'>;
|
|
16
|
+
export type RemoteMergeDecisionLabels<TDecision extends {
|
|
17
|
+
kind: string;
|
|
18
|
+
}> = {
|
|
19
|
+
readonly [TKind in ReportDecisionLineKind<TDecision>]: string;
|
|
20
|
+
};
|
|
21
|
+
export type RemoteMergeDecisionReport<TDecision extends {
|
|
22
|
+
kind: string;
|
|
23
|
+
}, TSubjectJson extends object> = Readonly<{
|
|
24
|
+
kind: TDecision['kind'];
|
|
25
|
+
} & TSubjectJson & {
|
|
26
|
+
localFieldPaths?: readonly string[];
|
|
27
|
+
remoteFieldPaths?: readonly string[];
|
|
28
|
+
conflict?: Readonly<{
|
|
29
|
+
code: ConflictCode<TDecision>;
|
|
30
|
+
fieldPath?: string;
|
|
31
|
+
message: string;
|
|
32
|
+
}>;
|
|
33
|
+
}>;
|
|
34
|
+
export type RemoteMergeJsonReport<TScope extends string, TSummary, TDecision extends {
|
|
35
|
+
kind: string;
|
|
36
|
+
}, TSubjectJson extends object> = Readonly<{
|
|
37
|
+
kind: 'push';
|
|
38
|
+
scope: TScope;
|
|
39
|
+
mergeRemote: true;
|
|
40
|
+
dryRun: boolean;
|
|
41
|
+
summary: TSummary;
|
|
42
|
+
decisions: readonly RemoteMergeDecisionReport<TDecision, TSubjectJson>[];
|
|
43
|
+
}>;
|
|
44
|
+
export type RemoteMergeReportConfig<TScope extends string, TSummary, TSubject, TSubjectJson extends object, TDecision extends MergeDecisionSubject<TSubject>> = Readonly<{
|
|
45
|
+
scope: TScope;
|
|
46
|
+
title: string;
|
|
47
|
+
summaryLines(summary: TSummary): readonly string[];
|
|
48
|
+
subjectLabel(subject: TSubject): string;
|
|
49
|
+
subjectJson(subject: TSubject): TSubjectJson;
|
|
50
|
+
decisionLabels: RemoteMergeDecisionLabels<TDecision>;
|
|
51
|
+
}>;
|
|
52
|
+
export declare function remoteMergeJsonReport<TScope extends string, TSummary, TSubject, TSubjectJson extends object, TDecision extends MergeDecisionSubject<TSubject>>(input: Readonly<{
|
|
53
|
+
config: RemoteMergeReportConfig<TScope, TSummary, TSubject, TSubjectJson, TDecision>;
|
|
54
|
+
decisions: readonly TDecision[];
|
|
55
|
+
dryRun: boolean;
|
|
56
|
+
summary: TSummary;
|
|
57
|
+
}>): RemoteMergeJsonReport<TScope, TSummary, TDecision, TSubjectJson>;
|
|
58
|
+
export declare function writeRemoteMergeHumanReport<TScope extends string, TSummary, TSubject, TSubjectJson extends object, TDecision extends MergeDecisionSubject<TSubject>>(output: Pick<OutputContext, 'info'>, config: RemoteMergeReportConfig<TScope, TSummary, TSubject, TSubjectJson, TDecision>, input: Readonly<{
|
|
59
|
+
decisions: readonly TDecision[];
|
|
60
|
+
dryRun: boolean;
|
|
61
|
+
summary: TSummary;
|
|
62
|
+
}>): void;
|
|
63
|
+
export {};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import { createBearerAPIClient, createInternalAPIClient } from '../../../api/src/public/index';
|
|
1
2
|
import type { RiverbankClient, RiverbankClientConfig } from './types';
|
|
3
|
+
export type RiverbankClientDeps = Readonly<{
|
|
4
|
+
createBearerAPIClient: typeof createBearerAPIClient;
|
|
5
|
+
createInternalAPIClient: typeof createInternalAPIClient;
|
|
6
|
+
}>;
|
|
2
7
|
/**
|
|
3
8
|
* Create a Riverbank CMS client for fetching content
|
|
4
9
|
*
|
|
@@ -13,6 +18,7 @@ import type { RiverbankClient, RiverbankClientConfig } from './types';
|
|
|
13
18
|
* ```
|
|
14
19
|
*/
|
|
15
20
|
export declare function createRiverbankClient(config: RiverbankClientConfig): RiverbankClient;
|
|
21
|
+
export declare function createRiverbankClientWithDeps(deps: RiverbankClientDeps, config: RiverbankClientConfig): RiverbankClient;
|
|
16
22
|
export type { ApiKeyType, GetPageParams, GetSiteParams, ResilienceConfig, ResilienceStatus, ResilientData, RiverbankClient, RiverbankClientConfig, SdkAuthConfig, } from './types';
|
|
17
23
|
export { getResilienceStatusFromError, RiverbankApiError } from './error';
|
|
18
24
|
export { CircuitOpenError } from './resilience';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { PageOutline } from '../contracts';
|
|
6
6
|
import type { SdkCustomBlock } from '../config/types';
|
|
7
|
-
import { SUPPORTED_LOADER_ENDPOINTS, type SupportedLoaderEndpoint } from '../../../blocks/src/system/data/index';
|
|
7
|
+
import { prefetchBlockData as prefetchBlockDataCore, normalizeLoaderParams, SUPPORTED_LOADER_ENDPOINTS, type SupportedLoaderEndpoint } from '../../../blocks/src/system/data/index';
|
|
8
8
|
import type { RiverbankClient } from '../client/types';
|
|
9
9
|
export type PrefetchContext = {
|
|
10
10
|
siteId?: string;
|
|
@@ -25,6 +25,10 @@ export type SdkPrefetchOptions = {
|
|
|
25
25
|
*/
|
|
26
26
|
customBlocks?: SdkCustomBlock[];
|
|
27
27
|
};
|
|
28
|
+
export type PrefetchBlockDataDeps = Readonly<{
|
|
29
|
+
prefetchBlockDataCore: typeof prefetchBlockDataCore;
|
|
30
|
+
normalizeLoaderParams: typeof normalizeLoaderParams;
|
|
31
|
+
}>;
|
|
28
32
|
/**
|
|
29
33
|
* Prefetch block data for SDK-based applications.
|
|
30
34
|
* Maps loader endpoints to corresponding SDK client methods.
|
|
@@ -52,3 +56,4 @@ export type SdkPrefetchOptions = {
|
|
|
52
56
|
* ```
|
|
53
57
|
*/
|
|
54
58
|
export declare function prefetchBlockData(page: PageOutline, context: PrefetchContext, client: RiverbankClient, options?: SdkPrefetchOptions): Promise<ResolvedBlockData>;
|
|
59
|
+
export declare function prefetchBlockDataWithDeps(deps: PrefetchBlockDataDeps, page: PageOutline, context: PrefetchContext, client: RiverbankClient, options?: SdkPrefetchOptions): Promise<ResolvedBlockData>;
|
|
@@ -32,6 +32,14 @@ export interface CatchAllContext {
|
|
|
32
32
|
/** Search parameters from the URL (for filtering, pagination, etc.) */
|
|
33
33
|
searchParams: Record<string, string | string[] | undefined>;
|
|
34
34
|
}
|
|
35
|
+
export type CreateCatchAllContentContract = 'compat' | 'native';
|
|
36
|
+
export type CreateCatchAllContentContractResolverContext = Readonly<{
|
|
37
|
+
/** Resolved URL path being loaded, e.g. '/about'. */
|
|
38
|
+
path: string;
|
|
39
|
+
/** Whether preview mode is enabled for this catch-all instance. */
|
|
40
|
+
preview: boolean;
|
|
41
|
+
}>;
|
|
42
|
+
export type CreateCatchAllContentContractSelector = CreateCatchAllContentContract | ((context: CreateCatchAllContentContractResolverContext) => CreateCatchAllContentContract);
|
|
35
43
|
/**
|
|
36
44
|
* Configuration for runtime theme switching when `themes` is provided.
|
|
37
45
|
*
|
|
@@ -179,6 +187,17 @@ export type CreateCatchAllPageOptions = {
|
|
|
179
187
|
* ```
|
|
180
188
|
*/
|
|
181
189
|
preview?: boolean;
|
|
190
|
+
/**
|
|
191
|
+
* Selects the public content API contract used by the catch-all loader.
|
|
192
|
+
*
|
|
193
|
+
* Defaults to `compat`, preserving the long-standing page/entry response
|
|
194
|
+
* shape. Use `native` only after the target site and route are ready to
|
|
195
|
+
* receive native page-surface payloads. A resolver can opt in route-by-route
|
|
196
|
+
* during staged rollouts.
|
|
197
|
+
*
|
|
198
|
+
* @default 'compat'
|
|
199
|
+
*/
|
|
200
|
+
contentContract?: CreateCatchAllContentContractSelector;
|
|
182
201
|
/**
|
|
183
202
|
* Custom block component overrides for rendering.
|
|
184
203
|
* Keys can be full block kind ("block.hero") or short form ("hero").
|
|
@@ -10,6 +10,8 @@ export interface PrebuildLoaderConfig {
|
|
|
10
10
|
prebuildDir: string;
|
|
11
11
|
/** Maximum age in seconds for prebuild cache */
|
|
12
12
|
maxPrebuildAgeSec?: number;
|
|
13
|
+
/** Filesystem adapter for tests and non-standard runtimes. */
|
|
14
|
+
fileSystem?: PrebuildFileSystem;
|
|
13
15
|
}
|
|
14
16
|
export interface LoadResult<T> {
|
|
15
17
|
/** Loaded data */
|
|
@@ -17,11 +19,15 @@ export interface LoadResult<T> {
|
|
|
17
19
|
/** Age of prebuild in seconds */
|
|
18
20
|
prebuildAgeSec: number;
|
|
19
21
|
}
|
|
22
|
+
export interface PrebuildFileSystem {
|
|
23
|
+
existsSync(filePath: string): boolean;
|
|
24
|
+
readFileSync(filePath: string, encoding: 'utf-8'): string;
|
|
25
|
+
}
|
|
20
26
|
/**
|
|
21
27
|
* Check if we're running in a Node.js environment with filesystem access.
|
|
22
28
|
* Edge runtimes (Vercel Edge, Cloudflare Workers) don't have fs access.
|
|
23
29
|
*/
|
|
24
|
-
export declare function canUsePrebuild(): boolean;
|
|
30
|
+
export declare function canUsePrebuild(fileSystem?: PrebuildFileSystem): boolean;
|
|
25
31
|
/**
|
|
26
32
|
* Loader for reading data from the prebuild cache.
|
|
27
33
|
*
|
|
@@ -31,6 +37,7 @@ export declare function canUsePrebuild(): boolean;
|
|
|
31
37
|
export declare class PrebuildLoader {
|
|
32
38
|
private readonly prebuildDir;
|
|
33
39
|
private readonly maxPrebuildAgeSec;
|
|
40
|
+
private readonly fileSystem;
|
|
34
41
|
constructor(config: PrebuildLoaderConfig);
|
|
35
42
|
/**
|
|
36
43
|
* Check if prebuild is available and not expired.
|
|
@@ -16,6 +16,8 @@ export type PageRendererDataContext = {
|
|
|
16
16
|
occurrenceContext?: OccurrenceContextData | null;
|
|
17
17
|
entrySubrouteContext?: EntrySubrouteContextData | null;
|
|
18
18
|
contentEntry?: Record<string, unknown> | null;
|
|
19
|
+
pageSurface?: Record<string, unknown> | null;
|
|
20
|
+
subject?: unknown;
|
|
19
21
|
editableRouteMetadataFieldIds?: ReadonlyArray<string> | null;
|
|
20
22
|
supabaseUrl?: string;
|
|
21
23
|
mediaAssets?: readonly MediaAssetIndexItem[];
|
|
@@ -64,6 +64,10 @@ export type PageProps = {
|
|
|
64
64
|
entrySubrouteContext?: EntrySubrouteContextData | null;
|
|
65
65
|
/** Content entry data for template pages */
|
|
66
66
|
contentEntry?: Record<string, unknown> | null;
|
|
67
|
+
/** Native page-surface data for page-surface templates */
|
|
68
|
+
pageSurface?: Record<string, unknown> | null;
|
|
69
|
+
/** Subject descriptor for native page-surface templates */
|
|
70
|
+
subject?: unknown;
|
|
67
71
|
/** Editable route metadata keys for template-page inline editing */
|
|
68
72
|
editableRouteMetadataFieldIds?: ReadonlyArray<string> | null;
|
|
69
73
|
/** Preview stage: 'preview' for draft content, 'published' for live content */
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import type { MediaAssetIndexItem, RouteMap, Theme } from '../../contracts';
|
|
8
8
|
import type { RiverbankClient, PageResponse, SiteResponse } from '../../client/types';
|
|
9
9
|
import type { PageProps } from '../components/Page';
|
|
10
|
+
import { prefetchBlockData } from '../../data/prefetchBlockData';
|
|
10
11
|
import type { ResolvedBlockData } from '../../data/prefetchBlockData';
|
|
11
12
|
import type { SdkCustomBlock } from '../../config/types';
|
|
12
13
|
import { type RuntimeSdkConfig } from './pageRuntimeSupport';
|
|
@@ -222,6 +223,9 @@ export type PageSurfaceContentResult = {
|
|
|
222
223
|
* Discriminated union result from loadContent
|
|
223
224
|
*/
|
|
224
225
|
export type LoadContentResult = PageContentResult | EntryContentResult | PageSurfaceContentResult;
|
|
226
|
+
export type LoadContentDeps = Readonly<{
|
|
227
|
+
prefetchBlockData: typeof prefetchBlockData;
|
|
228
|
+
}>;
|
|
225
229
|
/**
|
|
226
230
|
* Type guard to check if result is a page
|
|
227
231
|
*/
|
|
@@ -291,4 +295,6 @@ export declare function isPageSurfaceContent(result: LoadContentResult): result
|
|
|
291
295
|
* ```
|
|
292
296
|
*/
|
|
293
297
|
export declare function loadContent(params: LoadContentParams): Promise<LoadContentResult>;
|
|
298
|
+
export declare function loadContentWithDeps(deps: LoadContentDeps, params: LoadContentParams): Promise<LoadContentResult>;
|
|
294
299
|
export declare function loadContentFromContentResponse(params: LoadContentFromContentResponseParams): Promise<LoadContentResult>;
|
|
300
|
+
export declare function loadContentFromContentResponseWithDeps(deps: LoadContentDeps, params: LoadContentFromContentResponseParams): Promise<LoadContentResult>;
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { RiverbankClient } from '../../client/types';
|
|
7
7
|
import type { PageProps } from '../components/Page';
|
|
8
|
+
import { prefetchBlockData } from '../../data/prefetchBlockData';
|
|
9
|
+
import { executeCodeLoaders, mergeLoaderResults } from '../../data/executeCodeLoaders';
|
|
8
10
|
import type { DataLoaderOverrides } from '../../data/types';
|
|
9
11
|
import { type RuntimeSdkConfig } from './pageRuntimeSupport';
|
|
10
12
|
/**
|
|
@@ -84,6 +86,11 @@ export type LoadPageResult = Omit<PageProps, 'registry' | 'wrapBlock' | 'usePlac
|
|
|
84
86
|
*/
|
|
85
87
|
sdkConfig: RuntimeSdkConfig | null;
|
|
86
88
|
};
|
|
89
|
+
export type LoadPageDeps = Readonly<{
|
|
90
|
+
prefetchBlockData: typeof prefetchBlockData;
|
|
91
|
+
executeCodeLoaders: typeof executeCodeLoaders;
|
|
92
|
+
mergeLoaderResults: typeof mergeLoaderResults;
|
|
93
|
+
}>;
|
|
87
94
|
/**
|
|
88
95
|
* Server-side helper to fetch all data needed for <Page> component.
|
|
89
96
|
*
|
|
@@ -142,3 +149,4 @@ export type LoadPageResult = Omit<PageProps, 'registry' | 'wrapBlock' | 'usePlac
|
|
|
142
149
|
* ```
|
|
143
150
|
*/
|
|
144
151
|
export declare function loadPage(params: LoadPageParams): Promise<LoadPageResult>;
|
|
152
|
+
export declare function loadPageWithDeps(deps: LoadPageDeps, params: LoadPageParams): Promise<LoadPageResult>;
|
|
@@ -8,22 +8,22 @@ export { Page } from './components/Page';
|
|
|
8
8
|
export type { PageProps } from './components/Page';
|
|
9
9
|
export { Layout } from './components/Layout';
|
|
10
10
|
export type { LayoutProps, HeaderData, FooterData } from './components/Layout';
|
|
11
|
-
export type { SdkThemeResponsiveMode, SdkThemeRuntime
|
|
11
|
+
export type { SdkThemeResponsiveMode, SdkThemeRuntime } from './themeRuntime';
|
|
12
12
|
export { Block } from './components/Block';
|
|
13
13
|
export type { BlockProps } from './components/Block';
|
|
14
14
|
export { loadPage } from './helpers/loadPage';
|
|
15
15
|
export type { LoadPageParams, LoadPageResult } from './helpers/loadPage';
|
|
16
|
-
export { loadContent, isPageContent, isEntryContent } from './helpers/loadContent';
|
|
17
|
-
export type { LoadContentParams, LoadContentResult, ContentEntryData, PagePreviewMetadata, SiteData } from './helpers/loadContent';
|
|
16
|
+
export { loadContent, isPageContent, isEntryContent, isPageSurfaceContent, } from './helpers/loadContent';
|
|
17
|
+
export type { LoadContentParams, LoadContentResult, ContentEntryData, PagePreviewMetadata, SiteData, } from './helpers/loadContent';
|
|
18
18
|
export type { AppointmentBookingContent, BlogListingContent, BlogPostContent, BodyTextAlignment, BodyTextContent, ButtonVariant, CalendarTabViews, CardStylesContent, CollectionContent, ColumnsContent, ColumnOption, ContainerStylesContent, CourseDetailsContent, CourseRegistrationContent, CtaFullContent, DisplayMode, EmbedContent, EventCalendarContent, EventDetailsContent, EventLayout, EventListingContent, EventRegistrationContent, EventSpotlightContent, FaqContent, FaqItem, FilterAutoShow, FormBlockContent, GiftingContent, HeroContent, HeroCta, HeroCtaInput, HeroMedia, ImageColSize, ImageGalleryContent, LayoutAlign, LayoutWidth, Media, MediaTextAlignment, MediaTextAspectRatio, MediaTextContent, MediaTextImagePosition, NewsletterSignupContent, NewsletterSignupPreset, TipTapNode, TipTapMark, LinkValue, InternalLinkValue, ExternalLinkValue, CustomLinkValue, PageLinkValue, EntryLinkValue, RichTextPrimitiveProps, RichTextVariant, PageOutline, BlockOutline, RouteMap, RouteMapEntry, OccurrenceContextData, EntrySubrouteContextData, Theme, ThemeTokens, SectionStylesContent, SemanticSpacing, ShopContent, SingleButtonContent, SiteFooterContent, SiteHeaderContent, StackContentAlignment, StackImagePosition, SystemBlockContentByFullKind, SystemBlockContentByKind, SystemBlockContentFor, SystemBlockShortKind, TeamMembersContent, TestimonialEntryContent, TestimonialsBlockContent, ThumbnailPadding, ThumbnailShape, VideoGridContent, WeekStart, MediaAssetIndexItem, ImageOptions, ResolveImageUrlContext, ResolveImageUrlContextInput, ResolveImageSourceSetOptions, ResolvedImageSourceSet, } from '../contracts';
|
|
19
19
|
export { ImagePresets } from '../contracts';
|
|
20
20
|
export { RichText } from './primitives/RichText';
|
|
21
21
|
export { resolveImageUrl, resolveImageUrlWithContext, resolveImageSourceSetWithContext, } from './image';
|
|
22
|
-
export { PageRenderer
|
|
23
|
-
export { ThemeScope
|
|
24
|
-
export { buildThemeRuntime
|
|
22
|
+
export { PageRenderer } from './blocks-page-renderer';
|
|
23
|
+
export { ThemeScope } from './blocks-theme-scope';
|
|
24
|
+
export { buildThemeRuntime } from './blocks-theme-runtime';
|
|
25
25
|
export type { ComponentRegistry, PageRendererDataContext, PageRendererProps, SdkConfigForRenderer, } from './blocks-page-renderer';
|
|
26
|
-
export type { ThemeScopeProps
|
|
26
|
+
export type { ThemeScopeProps } from './blocks-theme-scope';
|
|
27
27
|
export type { BlockOverrideProps, BlockOverrideComponent, BlockOverrideRegistration, BlockOverrideRegistrations, BlockOverrides, CustomBlockOverrideKey, KnownSystemBlockOverrides, KnownBlockOverrideKey, LazyBlockOverrideFactory, LazyBlockOverrideRegistration, StrictBlockOverrideRegistrations, StrictBlockOverrides, SystemBlockOverrideKey, } from './overrides';
|
|
28
28
|
export { defineBlockOverrideRegistrations, defineBlockOverrides, defineLazyBlockOverride, } from './overrides';
|
|
29
29
|
/**
|
|
@@ -20,6 +20,8 @@ export type BlockOverrideProps<TContent = Record<string, unknown>, TData = Recor
|
|
|
20
20
|
occurrenceContext?: OccurrenceContextData | null;
|
|
21
21
|
entrySubrouteContext?: EntrySubrouteContextData | null;
|
|
22
22
|
contentEntry?: Record<string, unknown> | null;
|
|
23
|
+
pageSurface?: Record<string, unknown> | null;
|
|
24
|
+
subject?: unknown;
|
|
23
25
|
supabaseUrl?: string;
|
|
24
26
|
imageResolveContext?: ResolveImageUrlContext;
|
|
25
27
|
blockId: string | null;
|
|
@@ -34,6 +34,14 @@ export type ResolveRouteParams = {
|
|
|
34
34
|
*/
|
|
35
35
|
preview?: boolean;
|
|
36
36
|
};
|
|
37
|
+
export type ResolveRouteDeps = Readonly<{
|
|
38
|
+
loadPage: (params: {
|
|
39
|
+
client: RiverbankClient;
|
|
40
|
+
siteId: string;
|
|
41
|
+
path: string;
|
|
42
|
+
preview: boolean;
|
|
43
|
+
}) => Promise<LoadPageResult>;
|
|
44
|
+
}>;
|
|
37
45
|
/**
|
|
38
46
|
* Resolve a URL path to page data, redirect, or 404
|
|
39
47
|
*
|
|
@@ -72,6 +80,7 @@ export type ResolveRouteParams = {
|
|
|
72
80
|
* ```
|
|
73
81
|
*/
|
|
74
82
|
export declare function resolveRoute(params: ResolveRouteParams): Promise<RouteResolution>;
|
|
83
|
+
export declare function resolveRouteWithDeps(deps: ResolveRouteDeps, params: ResolveRouteParams): Promise<RouteResolution>;
|
|
75
84
|
/**
|
|
76
85
|
* Batch resolve multiple routes in parallel
|
|
77
86
|
*
|
|
@@ -105,3 +114,12 @@ export declare function resolveRoutes(params: {
|
|
|
105
114
|
path: string;
|
|
106
115
|
resolution: RouteResolution;
|
|
107
116
|
}>>;
|
|
117
|
+
export declare function resolveRoutesWithDeps(paramsDeps: ResolveRouteDeps, params: {
|
|
118
|
+
client: RiverbankClient;
|
|
119
|
+
siteId: string;
|
|
120
|
+
paths: string[];
|
|
121
|
+
preview?: boolean;
|
|
122
|
+
}): Promise<Array<{
|
|
123
|
+
path: string;
|
|
124
|
+
resolution: RouteResolution;
|
|
125
|
+
}>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ApiRequestError, type ApiClient, type ApiResult } from '../../../api/src/public/index';
|
|
2
|
+
import { vi } from 'bun:test';
|
|
3
|
+
import type { RiverbankClientDeps } from '../client/index';
|
|
4
|
+
export type ApiClientMock = ReturnType<typeof vi.fn<ApiClient>>;
|
|
5
|
+
export type RiverbankClientTestDeps = Readonly<{
|
|
6
|
+
apiClient: ApiClientMock;
|
|
7
|
+
createBearerAPIClient: ReturnType<typeof vi.fn<RiverbankClientDeps['createBearerAPIClient']>>;
|
|
8
|
+
createInternalAPIClient: ReturnType<typeof vi.fn<RiverbankClientDeps['createInternalAPIClient']>>;
|
|
9
|
+
deps: RiverbankClientDeps;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function createApiClientMock(): ApiClientMock;
|
|
12
|
+
export declare function createRiverbankClientTestDeps(apiClient?: ApiClientMock): RiverbankClientTestDeps;
|
|
13
|
+
export declare function apiSuccess<T>(data: T): ApiResult<T>;
|
|
14
|
+
export declare function apiError(status: number, code: string, message: string): ApiResult<never>;
|
|
15
|
+
type ApiRequestErrorOptions = ConstructorParameters<typeof ApiRequestError>[1];
|
|
16
|
+
export declare function apiRequestError(message: string, options?: Partial<ApiRequestErrorOptions>): ApiRequestError;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type EnvSnapshot<T extends readonly string[]> = Record<T[number], string | undefined>;
|
|
2
|
+
export declare function snapshotEnv<T extends readonly string[]>(keys: T): EnvSnapshot<T>;
|
|
3
|
+
export declare function restoreEnv<T extends readonly string[]>(keys: T, snapshot: EnvSnapshot<T>): void;
|
|
4
|
+
export declare function clearEnv(keys: readonly string[]): void;
|
|
@@ -787,9 +787,9 @@ export declare const grantCustomerMembershipCommandSchema: z.ZodObject<{
|
|
|
787
787
|
membershipRef: z.ZodPipe<z.ZodString, z.ZodTransform<MembershipProductRef, string>>;
|
|
788
788
|
status: z.ZodDefault<z.ZodEnum<{
|
|
789
789
|
active: "active";
|
|
790
|
+
canceled: "canceled";
|
|
790
791
|
trialing: "trialing";
|
|
791
792
|
past_due: "past_due";
|
|
792
|
-
canceled: "canceled";
|
|
793
793
|
paused: "paused";
|
|
794
794
|
}>>;
|
|
795
795
|
currentPeriodStart: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -1682,9 +1682,9 @@ export declare const siteCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1682
1682
|
membershipRef: z.ZodPipe<z.ZodString, z.ZodTransform<MembershipProductRef, string>>;
|
|
1683
1683
|
status: z.ZodDefault<z.ZodEnum<{
|
|
1684
1684
|
active: "active";
|
|
1685
|
+
canceled: "canceled";
|
|
1685
1686
|
trialing: "trialing";
|
|
1686
1687
|
past_due: "past_due";
|
|
1687
|
-
canceled: "canceled";
|
|
1688
1688
|
paused: "paused";
|
|
1689
1689
|
}>>;
|
|
1690
1690
|
currentPeriodStart: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -2563,9 +2563,9 @@ export declare const siteCommandBatchSchema: z.ZodObject<{
|
|
|
2563
2563
|
membershipRef: z.ZodPipe<z.ZodString, z.ZodTransform<MembershipProductRef, string>>;
|
|
2564
2564
|
status: z.ZodDefault<z.ZodEnum<{
|
|
2565
2565
|
active: "active";
|
|
2566
|
+
canceled: "canceled";
|
|
2566
2567
|
trialing: "trialing";
|
|
2567
2568
|
past_due: "past_due";
|
|
2568
|
-
canceled: "canceled";
|
|
2569
2569
|
paused: "paused";
|
|
2570
2570
|
}>>;
|
|
2571
2571
|
currentPeriodStart: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|