@riverbankcms/sdk 0.77.0 → 0.78.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/README.md +69 -0
- package/dist/{PreviewEditorSidebar-XSX7QKHQ.mjs → PreviewEditorSidebar-RIKFQ72L.mjs} +4916 -4847
- package/dist/{PreviewEditorUI-YZNEZ3QD.mjs → PreviewEditorUI-XO7TUWKK.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-LAGYMPNF.mjs +8 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +194 -184
- package/dist/_dts/api/src/accessAdmin.d.ts +5 -0
- package/dist/_dts/api/src/billing.d.ts +3 -26
- package/dist/_dts/api/src/bookingVerticals.d.ts +4 -0
- package/dist/_dts/api/src/content-editor.d.ts +1 -0
- package/dist/_dts/api/src/demoDashboardMutationSurfaces.d.ts +46 -0
- package/dist/_dts/api/src/endpoints.d.ts +8 -0
- package/dist/_dts/api/src/index.d.ts +14 -2
- package/dist/_dts/api/src/navigation/dashboardBookingsNav.d.ts +87 -0
- package/dist/_dts/api/src/navigation/dashboardDemoNav.d.ts +5 -0
- package/dist/_dts/api/src/navigation/dashboardSettingsNav.d.ts +45 -0
- package/dist/_dts/api/src/navigation/dashboardSiteNav.d.ts +42 -0
- package/dist/_dts/api/src/navigation/dashboardTeamMemberNav.d.ts +24 -0
- package/dist/_dts/api/src/navigation/linkUrlType.d.ts +3 -0
- package/dist/_dts/api/src/navigation.d.ts +12 -0
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +55 -26
- package/dist/_dts/api/src/staffAccess.d.ts +79 -0
- package/dist/_dts/api/src/types.d.ts +3 -1
- package/dist/_dts/api/src/workflows/automaticWorkflowTriggers.d.ts +21 -0
- package/dist/_dts/blocks/src/client/site-chrome.d.ts +4 -1
- package/dist/_dts/blocks/src/customBlockRegistry.d.ts +20 -1
- package/dist/_dts/blocks/src/index.d.ts +3 -2
- package/dist/_dts/blocks/src/system/blocks/appointment-booking.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/blog-listing.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/cart.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/checkout.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/collection.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/courses/shared/schemas.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/faq.d.ts +294 -289
- package/dist/_dts/blocks/src/system/blocks/gifting.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +21 -21
- package/dist/_dts/blocks/src/system/blocks/product-detail.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/product-list.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/shop.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/site-header.d.ts +2 -2
- package/dist/_dts/blocks/src/system/data/index.d.ts +5 -3
- package/dist/_dts/blocks/src/system/data/previewResolvedDataState.d.ts +45 -0
- package/dist/_dts/blocks/src/system/fields/boxStyles.d.ts +2 -1
- package/dist/_dts/blocks/src/system/fragments/library/faqAccordion.d.ts +5 -0
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +5 -0
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +29 -29
- package/dist/_dts/blocks/src/system/node/fragments/headingDecoration.d.ts +10 -0
- package/dist/_dts/blocks/src/system/node/fragments/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/node/fragments/styledSection.d.ts +9 -0
- package/dist/_dts/blocks/src/system/runtime/api/client.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/api/endpoints.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/api/types.d.ts +43 -8
- package/dist/_dts/blocks/src/system/runtime/components/multi-step/runtimeFormValidation.d.ts +28 -0
- package/dist/_dts/blocks/src/system/runtime/header/shared.d.ts +8 -7
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventCompactRow.d.ts +1 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +7 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/header-section.client.d.ts +2 -8
- package/dist/_dts/blocks/src/system/runtime/nodes/header-section.server.d.ts +2 -9
- package/dist/_dts/blocks/src/system/runtime/nodes/shop-cart-discount-ui.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/shop-checkout-form.d.ts +76 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/shop-checkout.state.d.ts +1 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/shop-commerce-store.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/shop-commerce.shared.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/shop-discount-apply.state.d.ts +52 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/shop.state.d.ts +2 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/useDiscountApply.d.ts +21 -0
- package/dist/_dts/blocks/src/system/runtime/shared/components/DiscountCodeDisclosure.d.ts +54 -0
- 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/system/transforms/registry/layout.d.ts +4 -4
- package/dist/_dts/blocks/src/system/transforms/registry/ui.d.ts +1 -1
- package/dist/_dts/blocks/src/system/transforms/typed.d.ts +1 -1
- package/dist/_dts/content-editor/src/contentTypeEditorContentState.d.ts +26 -0
- package/dist/_dts/content-editor/src/definitions/factory.d.ts +75 -0
- package/dist/_dts/content-editor/src/entryWorkflows.d.ts +2 -0
- package/dist/_dts/content-editor/src/footerBlocksEditorState.d.ts +76 -0
- package/dist/_dts/content-editor/src/index.d.ts +5 -0
- package/dist/_dts/content-editor/src/pageWorkflowContent.d.ts +29 -0
- package/dist/_dts/content-model/src/content-types/schema.d.ts +3 -3
- package/dist/_dts/content-model/src/index.d.ts +1 -0
- package/dist/_dts/content-model/src/routeTemplate.d.ts +4 -0
- package/dist/_dts/content-model/src/templates/editorState.d.ts +25 -0
- package/dist/_dts/core/src/csv-cells.d.ts +10 -0
- package/dist/_dts/core/src/csv-date-filter.d.ts +27 -0
- package/dist/_dts/core/src/csv-escape.d.ts +1 -0
- package/dist/_dts/core/src/csv-filename.d.ts +18 -0
- package/dist/_dts/core/src/csv-render.d.ts +4 -0
- package/dist/_dts/core/src/csv-types.d.ts +116 -0
- package/dist/_dts/core/src/currency-format.d.ts +4 -0
- package/dist/_dts/core/src/demo-capability-policy.d.ts +29 -0
- package/dist/_dts/core/src/demo-claim-access.d.ts +14 -0
- package/dist/_dts/core/src/demo-lifecycle-status.d.ts +11 -0
- package/dist/_dts/core/src/demo-runtime.d.ts +47 -0
- package/dist/_dts/core/src/duration.d.ts +14 -0
- package/dist/_dts/core/src/email-format.d.ts +10 -0
- package/dist/_dts/core/src/field-errors.d.ts +1 -0
- package/dist/_dts/core/src/form-submission-preview.d.ts +24 -0
- package/dist/_dts/core/src/index.d.ts +20 -0
- package/dist/_dts/core/src/number-input.d.ts +22 -0
- package/dist/_dts/core/src/public-url-validation.d.ts +12 -0
- package/dist/_dts/core/src/slug.d.ts +39 -0
- package/dist/_dts/core/src/string.d.ts +19 -0
- package/dist/_dts/core/src/uuid.d.ts +6 -0
- package/dist/_dts/db/src/schemas/forms.d.ts +50 -50
- package/dist/_dts/media-core/src/assetsInUseSummary.d.ts +34 -0
- package/dist/_dts/media-core/src/bulkDeletePlanning.d.ts +24 -0
- package/dist/_dts/media-core/src/canonicalCropReview.d.ts +66 -0
- package/dist/_dts/media-core/src/classifyAllPlanning.d.ts +48 -0
- package/dist/_dts/media-core/src/filename.d.ts +1 -0
- package/dist/_dts/media-core/src/index.d.ts +10 -0
- package/dist/_dts/media-core/src/mediaAssetUsageStatus.d.ts +47 -0
- package/dist/_dts/media-core/src/mediaSettingsState.d.ts +3 -0
- package/dist/_dts/media-core/src/portableMediaReferences.d.ts +38 -0
- package/dist/_dts/media-core/src/uploadVerificationContract.d.ts +28 -0
- package/dist/_dts/media-core/src/videoAssetRepair.d.ts +38 -0
- package/dist/_dts/media-editor/src/mediaEditorDebug.d.ts +1 -0
- package/dist/_dts/path-utils/src/index.d.ts +8 -0
- package/dist/_dts/path-utils/src/redirectPaths.d.ts +26 -0
- package/dist/_dts/path-utils/src/safeAppPath.d.ts +26 -0
- package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeButton.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +4 -0
- package/dist/_dts/preview-next/src/client/preview/previewDocumentFrame.d.ts +31 -0
- package/dist/_dts/sdk/src/client/error.d.ts +3 -0
- package/dist/_dts/sdk/src/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +37 -19
- package/dist/_dts/sdk/src/contracts/theme.d.ts +1 -1
- package/dist/_dts/sdk/src/index.d.ts +2 -2
- package/dist/_dts/sdk/src/manifest/passes/pass1-fields.d.ts +16 -16
- package/dist/_dts/sdk/src/next/content-load-failure.d.ts +51 -0
- package/dist/_dts/sdk/src/next/index.d.ts +2 -1
- package/dist/_dts/sdk/src/next/types.d.ts +19 -0
- package/dist/_dts/sdk/src/portal/redirects.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/components/Layout.d.ts +2 -2
- package/dist/_dts/sdk/src/routing/index.d.ts +3 -2
- package/dist/_dts/sdk/src/routing/resolvePageContent.d.ts +71 -6
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/site-commands/src/commands.d.ts +12 -12
- package/dist/_dts/site-commands/src/index.d.ts +1 -0
- package/dist/_dts/site-commands/src/pagePaths.d.ts +6 -0
- package/dist/_dts/theme-core/src/accordions/siteStyleDefaults.d.ts +26 -0
- package/dist/_dts/theme-core/src/accordions/types.d.ts +1 -0
- package/dist/_dts/theme-core/src/blocks/vars/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/fonts/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/fonts/uploadFormat.d.ts +44 -0
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/index.d.ts +3 -1
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +63 -51
- package/dist/_dts/theme-core/src/navigation/generateNavLinkCSS.d.ts +6 -1
- package/dist/_dts/theme-core/src/navigation/types.d.ts +12 -0
- package/dist/_dts/theme-core/src/palette/variants/types.d.ts +3 -3
- package/dist/_dts/theme-core/src/runtime/themeCssVarNames.d.ts +7 -0
- package/dist/_dts/theme-core/src/schema.d.ts +90 -48
- package/dist/_dts/theme-core/src/site-styles/appearancePresetCatalog.d.ts +214 -34
- package/dist/_dts/theme-core/src/site-styles/appearancePresetTypes.d.ts +5 -2
- package/dist/_dts/theme-core/src/site-styles/blockAppearancePresets.d.ts +214 -34
- package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +25 -1
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +35 -7
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +4 -4
- package/dist/_dts/theme-core/src/site-styles/headerLooks.d.ts +96 -34
- package/dist/_dts/theme-core/src/site-styles/rawStyleFields.d.ts +4 -2
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +9 -1
- package/dist/_dts/theme-core/src/site-styles/types.d.ts +27 -2
- package/dist/_dts/theme-core/src/siteChrome.d.ts +17 -34
- package/dist/_dts/theme-core/src/siteChromeOverlayClearance.d.ts +22 -0
- package/dist/_dts/theme-core/src/siteChromePlacement.d.ts +22 -0
- package/dist/_dts/theme-core/src/siteChromePlanning.d.ts +32 -0
- package/dist/_dts/theme-core/src/tokens/themeColorTokens.d.ts +2 -2
- package/dist/{chunk-EAWHBECW.mjs → chunk-F7RTCZYN.mjs} +229 -50
- package/dist/{chunk-GSQX43EZ.mjs → chunk-NIDXI46P.mjs} +22 -41
- package/dist/{chunk-WLQBJN2Z.mjs → chunk-OECWLDHN.mjs} +4538 -1911
- package/dist/{chunk-VX7B5VAC.mjs → chunk-SVMMM2NA.mjs} +8 -0
- package/dist/{chunk-6SMUFTXD.mjs → chunk-SXOLGNMX.mjs} +1 -1
- package/dist/{chunk-ANKDYZ2E.mjs → chunk-TXDES5P2.mjs} +2 -2
- package/dist/cli/index.mjs +2036 -594
- package/dist/client/{accordion-RZMQSYLR.mjs → accordion-EVDEOUPR.mjs} +2 -2
- package/dist/client/{bookingForm-NF4ASVNV.mjs → bookingForm-DIHBLC64.mjs} +27 -30
- package/dist/client/bookings.mjs +3707 -259
- package/dist/client/{carousel-LDX47ZIK.mjs → carousel-FEBQHIWI.mjs} +3 -4
- package/dist/client/{cart-RGXDS5F4.mjs → cart-7CKSXAE4.mjs} +8 -8
- package/dist/client/{checkout-P7WWSNNY.mjs → checkout-WKYCANLV.mjs} +8 -8
- package/dist/client/{chunk-JNC7CGHX.mjs → chunk-2SAVKN2M.mjs} +2 -2
- package/dist/client/{chunk-TQ5MSPDX.mjs → chunk-36WJCERQ.mjs} +1 -1
- package/dist/client/{chunk-R56FQ3RR.mjs → chunk-65F47D7Y.mjs} +280 -71
- package/dist/client/{chunk-L3DNHIJX.mjs → chunk-GUK2FPXQ.mjs} +23 -45
- package/dist/client/{chunk-PMAIXMAB.mjs → chunk-IVNCUVAV.mjs} +26 -21
- package/dist/client/{chunk-II7O4XN3.mjs → chunk-OFMSCGNY.mjs} +2 -2
- package/dist/client/chunk-PD6NBCEY.mjs +66 -0
- package/dist/client/{chunk-GMVTOKYG.mjs → chunk-RV6FX7UH.mjs} +510 -64
- package/dist/client/{chunk-E2TDNXCL.mjs → chunk-RZDWX7QW.mjs} +2 -1
- package/dist/client/{chunk-M3L3KYYR.mjs → chunk-UDNSI5PY.mjs} +12 -0
- package/dist/client/{chunk-JEZECJ3W.mjs → chunk-VPPMNXCF.mjs} +129 -3
- package/dist/client/{chunk-UFSWADAO.mjs → chunk-YDSEG6GZ.mjs} +5 -66
- package/dist/client/client.mjs +8983 -6152
- package/dist/client/{courseRegistration-7F65K5ZR.mjs → courseRegistration-5QF2PHKM.mjs} +14 -11
- package/dist/client/{eventCalendar-GLSC5KTL.mjs → eventCalendar-4ZOSETDU.mjs} +9 -9
- package/dist/client/{eventCombined-ZHK4WKUR.mjs → eventCombined-WQGU7JUX.mjs} +9 -9
- package/dist/client/{eventDetails-E3PJYBIN.mjs → eventDetails-AYWVUJ5Y.mjs} +9 -9
- package/dist/client/{eventListing-EMS3WC3E.mjs → eventListing-NT7C6UT5.mjs} +9 -9
- package/dist/client/{eventRegistration-NZOTVNPI.mjs → eventRegistration-OH24F4ZJ.mjs} +9 -9
- package/dist/client/{form-ETFZFATW.mjs → form-7L42SRBB.mjs} +6 -6
- package/dist/client/{headerSection-4LBP7ULT.mjs → headerSection-OZRZNZ52.mjs} +3 -3
- package/dist/client/hooks.mjs +1388 -427
- package/dist/client/{locationMap-5M655YSJ.mjs → locationMap-ZBXRPQ7C.mjs} +2 -2
- package/dist/client/{newsletterForm-QOUYW44O.mjs → newsletterForm-SNAGFF2I.mjs} +3 -3
- package/dist/client/{productDetail-O4DOCWQG.mjs → productDetail-I46BOFGV.mjs} +8 -8
- package/dist/client/{productList-A5RO5WIS.mjs → productList-BOYHTYI6.mjs} +8 -8
- package/dist/client/rendering/client.mjs +7090 -2645
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +7395 -4767
- package/dist/client/{shop-L4MZH4I2.mjs → shop-XTXPZTKR.mjs} +8 -8
- package/dist/preview-next/before-render.mjs +8 -0
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/preview-next/editor-chrome.css +10 -0
- package/dist/preview-next/middleware.mjs +8 -0
- package/dist/{sdk-runtime-Q6MTR4KL.mjs → sdk-runtime-ZJLKC6DR.mjs} +6 -6
- package/dist/server/components.mjs +4175 -2480
- package/dist/server/config-validation.mjs +1619 -658
- package/dist/server/config.mjs +1619 -658
- package/dist/server/data.mjs +1388 -427
- package/dist/server/index.mjs +488 -246
- package/dist/server/next.mjs +5607 -3354
- package/dist/server/page-converter.mjs +912 -259
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +4176 -2481
- package/dist/server/rendering.mjs +4194 -2486
- package/dist/server/routing.mjs +2078 -639
- package/dist/server/server.mjs +1886 -685
- package/dist/server/theme-bridge.mjs +4441 -1300
- package/dist/server/theme.mjs +89 -12
- package/dist/styles/index.css +1576 -1083
- package/package.json +2 -1
- package/dist/SdkPreviewModeRuntime-5FS5E6BI.mjs +0 -8
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/DiscountCodeSection.d.ts +0 -7
- package/dist/_dts/preview-next/src/client/widgets/PreviewMediaField.d.ts +0 -4
- package/dist/client/chunk-OJPZEZU2.mjs +0 -31
- package/dist/client/chunk-RTZ3JKKX.mjs +0 -178
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
import type { ViewportMode, ViewportWidth } from "./PreviewViewportControls";
|
|
3
|
+
type ZoomableStyle = CSSProperties & Readonly<{
|
|
4
|
+
zoom?: number;
|
|
5
|
+
}>;
|
|
6
|
+
export type PreviewDocumentFramePlan = Readonly<{
|
|
7
|
+
kind: "squeeze";
|
|
8
|
+
frameClassName: string;
|
|
9
|
+
frameDataProps: PreviewDocumentFrameDataProps;
|
|
10
|
+
}> | Readonly<{
|
|
11
|
+
kind: "fixed";
|
|
12
|
+
targetWidthPx: number;
|
|
13
|
+
wrapperStyle: CSSProperties;
|
|
14
|
+
contentStyle: ZoomableStyle;
|
|
15
|
+
siteDocumentStyle: CSSProperties;
|
|
16
|
+
frameClassName: string;
|
|
17
|
+
frameDataProps: PreviewDocumentFrameDataProps;
|
|
18
|
+
}>;
|
|
19
|
+
export type PreviewDocumentFrameDataProps = Readonly<{
|
|
20
|
+
"data-builder-preview-document-frame": "squeeze" | "fixed";
|
|
21
|
+
"data-builder-preview-document-scale": "none" | "scaled";
|
|
22
|
+
"data-builder-preview-fixed-header-behavior"?: "fixed-as-sticky";
|
|
23
|
+
}>;
|
|
24
|
+
export type PreviewDocumentFrameInput = Readonly<{
|
|
25
|
+
viewportMode: ViewportMode;
|
|
26
|
+
viewportWidth: ViewportWidth;
|
|
27
|
+
scale: number;
|
|
28
|
+
contentHeight: number;
|
|
29
|
+
}>;
|
|
30
|
+
export declare function planPreviewDocumentFrame(input: PreviewDocumentFrameInput): PreviewDocumentFramePlan;
|
|
31
|
+
export {};
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Provides typed access to error details including code, message, request ID, and field errors.
|
|
6
6
|
*/
|
|
7
7
|
import type { ApiError, ApiErrorCode, FieldError } from '../public-api/contracts';
|
|
8
|
+
import type { ResilienceStatus } from './types';
|
|
8
9
|
/**
|
|
9
10
|
* Error options for creating RiverbankApiError
|
|
10
11
|
*/
|
|
@@ -147,3 +148,5 @@ export declare class RiverbankApiError extends Error {
|
|
|
147
148
|
*/
|
|
148
149
|
toDetailedString(): string;
|
|
149
150
|
}
|
|
151
|
+
export declare function attachResilienceStatusToError(error: unknown, resilienceStatus: ResilienceStatus): unknown;
|
|
152
|
+
export declare function getResilienceStatusFromError(error: unknown): ResilienceStatus | undefined;
|
|
@@ -13,6 +13,6 @@ import type { RiverbankClient, RiverbankClientConfig } from './types';
|
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
15
|
export declare function createRiverbankClient(config: RiverbankClientConfig): RiverbankClient;
|
|
16
|
-
export type {
|
|
17
|
-
export { RiverbankApiError } from './error';
|
|
16
|
+
export type { ApiKeyType, GetPageParams, GetSiteParams, ResilienceConfig, ResilienceStatus, ResilientData, RiverbankClient, RiverbankClientConfig, SdkAuthConfig, } from './types';
|
|
17
|
+
export { getResilienceStatusFromError, RiverbankApiError } from './error';
|
|
18
18
|
export { CircuitOpenError } from './resilience';
|
|
@@ -30,6 +30,24 @@ export interface SdkMethodOptions {
|
|
|
30
30
|
/** AbortSignal for cancelling the request */
|
|
31
31
|
signal?: AbortSignal;
|
|
32
32
|
}
|
|
33
|
+
export type GetSiteParams = {
|
|
34
|
+
slug?: string;
|
|
35
|
+
domain?: string;
|
|
36
|
+
id?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Bypass SDK in-memory cache and Next.js fetch caching (uses `cache: 'no-store'`).
|
|
39
|
+
*
|
|
40
|
+
* Useful right after `riverbankcms push-config` in development to avoid waiting
|
|
41
|
+
* for cache revalidation.
|
|
42
|
+
*/
|
|
43
|
+
force?: boolean;
|
|
44
|
+
currentPath?: string;
|
|
45
|
+
} & SdkMethodOptions;
|
|
46
|
+
export type GetPageParams = {
|
|
47
|
+
siteId: string;
|
|
48
|
+
path: string;
|
|
49
|
+
preview?: boolean;
|
|
50
|
+
} & SdkMethodOptions;
|
|
33
51
|
/**
|
|
34
52
|
* Base parameters for getEntries - shared across all overloads
|
|
35
53
|
*/
|
|
@@ -69,6 +87,7 @@ export interface ResilienceStatus {
|
|
|
69
87
|
error?: {
|
|
70
88
|
code?: string;
|
|
71
89
|
message: string;
|
|
90
|
+
status?: number;
|
|
72
91
|
};
|
|
73
92
|
/** Seconds since cache TTL expired (when source='stale') */
|
|
74
93
|
staleAgeSec?: number;
|
|
@@ -81,6 +100,13 @@ export interface ResilienceStatus {
|
|
|
81
100
|
/** Total request duration including retries (ms) */
|
|
82
101
|
durationMs?: number;
|
|
83
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Data returned with the resilience status for the exact request that produced it.
|
|
105
|
+
*/
|
|
106
|
+
export type ResilientData<T> = Readonly<{
|
|
107
|
+
data: T;
|
|
108
|
+
resilience: ResilienceStatus;
|
|
109
|
+
}>;
|
|
84
110
|
/**
|
|
85
111
|
* Circuit breaker state information
|
|
86
112
|
*/
|
|
@@ -201,7 +227,7 @@ export type SdkAuthConfig = {
|
|
|
201
227
|
token: string;
|
|
202
228
|
};
|
|
203
229
|
export declare const SDK_CORRELATION_HEADER_NAMES: readonly ["x-request-id", "x-correlation-id", "x-riverbank-monitor-run-id"];
|
|
204
|
-
export type SdkCorrelationHeaderName = typeof SDK_CORRELATION_HEADER_NAMES[number];
|
|
230
|
+
export type SdkCorrelationHeaderName = (typeof SDK_CORRELATION_HEADER_NAMES)[number];
|
|
205
231
|
export type SdkCorrelationHeaders = Readonly<Partial<Record<SdkCorrelationHeaderName, string>>>;
|
|
206
232
|
/**
|
|
207
233
|
* Configuration for creating a Riverbank CMS client
|
|
@@ -276,29 +302,21 @@ export interface RiverbankClient {
|
|
|
276
302
|
/**
|
|
277
303
|
* Fetch site data by slug, domain, or ID
|
|
278
304
|
*/
|
|
279
|
-
getSite(params:
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
* Bypass SDK in-memory cache and Next.js fetch caching (uses `cache: 'no-store'`).
|
|
285
|
-
*
|
|
286
|
-
* Useful right after `riverbankcms push-config` in development to avoid waiting
|
|
287
|
-
* for cache revalidation.
|
|
288
|
-
*/
|
|
289
|
-
force?: boolean;
|
|
290
|
-
currentPath?: string;
|
|
291
|
-
} & SdkMethodOptions): Promise<SiteResponse>;
|
|
305
|
+
getSite(params: GetSiteParams): Promise<SiteResponse>;
|
|
306
|
+
/**
|
|
307
|
+
* Fetch site data and return the resilience status for this exact request.
|
|
308
|
+
*/
|
|
309
|
+
getSiteWithResilience(params: GetSiteParams): Promise<ResilientData<SiteResponse>>;
|
|
292
310
|
/**
|
|
293
311
|
* Fetch a specific page by path
|
|
294
312
|
*
|
|
295
313
|
* @param params.preview - If true, returns draft content instead of published content (requires API key with site access)
|
|
296
314
|
*/
|
|
297
|
-
getPage(params:
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
315
|
+
getPage(params: GetPageParams): Promise<PageResponse>;
|
|
316
|
+
/**
|
|
317
|
+
* Fetch page content and return the resilience status for this exact request.
|
|
318
|
+
*/
|
|
319
|
+
getPageWithResilience(params: GetPageParams): Promise<ResilientData<PageResponse>>;
|
|
302
320
|
/**
|
|
303
321
|
* Fetch published content entries with optional pagination, sorting, and preview mode
|
|
304
322
|
*
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
*
|
|
18
18
|
* @packageDocumentation
|
|
19
19
|
*/
|
|
20
|
-
export { createRiverbankClient, RiverbankApiError } from './client/index';
|
|
20
|
+
export { createRiverbankClient, getResilienceStatusFromError, RiverbankApiError, } from './client/index';
|
|
21
21
|
export { SDK_CORRELATION_HEADER_NAMES } from './client/types';
|
|
22
|
-
export type { RiverbankClient, RiverbankClientConfig, SdkCorrelationHeaderName, SdkCorrelationHeaders, SdkAuthConfig, SiteResponse, PageResponse, EntriesResponse, EntriesResponseWithMeta, PaginationMeta, EntryResponse, ResilienceConfig, ResilienceStatus, ResilienceSource, CircuitState, RetryConfig, CircuitBreakerConfig, } from './client/types';
|
|
22
|
+
export type { RiverbankClient, RiverbankClientConfig, SdkCorrelationHeaderName, SdkCorrelationHeaders, SdkAuthConfig, SiteResponse, PageResponse, EntriesResponse, EntriesResponseWithMeta, GetPageParams, GetSiteParams, PaginationMeta, EntryResponse, ResilienceConfig, ResilienceStatus, ResilientData, ResilienceSource, CircuitState, RetryConfig, CircuitBreakerConfig, } from './client/types';
|
|
23
23
|
export { prebuildCache } from './prebuild/index';
|
|
24
24
|
export type { PrebuildOptions, PrebuildResult, PrebuildProgress, PrebuildManifest, PrebuildContentType, } from './prebuild/types';
|
|
25
25
|
export { PrebuildLoader, createPrebuildLoader, canUsePrebuild, } from './prebuild/loader';
|
|
@@ -8,19 +8,19 @@ import { z } from 'zod';
|
|
|
8
8
|
export declare const simpleFieldTypeEnum: z.ZodEnum<{
|
|
9
9
|
number: "number";
|
|
10
10
|
boolean: "boolean";
|
|
11
|
+
text: "text";
|
|
12
|
+
select: "select";
|
|
11
13
|
media: "media";
|
|
12
14
|
link: "link";
|
|
13
|
-
select: "select";
|
|
14
|
-
text: "text";
|
|
15
15
|
richText: "richText";
|
|
16
16
|
}>;
|
|
17
17
|
export declare const fieldTypeEnum: z.ZodEnum<{
|
|
18
18
|
number: "number";
|
|
19
19
|
boolean: "boolean";
|
|
20
|
+
text: "text";
|
|
21
|
+
select: "select";
|
|
20
22
|
media: "media";
|
|
21
23
|
link: "link";
|
|
22
|
-
select: "select";
|
|
23
|
-
text: "text";
|
|
24
24
|
richText: "richText";
|
|
25
25
|
repeater: "repeater";
|
|
26
26
|
group: "group";
|
|
@@ -34,10 +34,10 @@ export declare const extractedFieldSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
34
34
|
type: z.ZodEnum<{
|
|
35
35
|
number: "number";
|
|
36
36
|
boolean: "boolean";
|
|
37
|
+
text: "text";
|
|
38
|
+
select: "select";
|
|
37
39
|
media: "media";
|
|
38
40
|
link: "link";
|
|
39
|
-
select: "select";
|
|
40
|
-
text: "text";
|
|
41
41
|
richText: "richText";
|
|
42
42
|
}>;
|
|
43
43
|
label: z.ZodString;
|
|
@@ -61,10 +61,10 @@ export declare const extractedFieldSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
61
61
|
type: z.ZodEnum<{
|
|
62
62
|
number: "number";
|
|
63
63
|
boolean: "boolean";
|
|
64
|
+
text: "text";
|
|
65
|
+
select: "select";
|
|
64
66
|
media: "media";
|
|
65
67
|
link: "link";
|
|
66
|
-
select: "select";
|
|
67
|
-
text: "text";
|
|
68
68
|
richText: "richText";
|
|
69
69
|
}>;
|
|
70
70
|
label: z.ZodString;
|
|
@@ -81,10 +81,10 @@ export declare const extractedFieldSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
81
81
|
type: z.ZodEnum<{
|
|
82
82
|
number: "number";
|
|
83
83
|
boolean: "boolean";
|
|
84
|
+
text: "text";
|
|
85
|
+
select: "select";
|
|
84
86
|
media: "media";
|
|
85
87
|
link: "link";
|
|
86
|
-
select: "select";
|
|
87
|
-
text: "text";
|
|
88
88
|
richText: "richText";
|
|
89
89
|
}>;
|
|
90
90
|
label: z.ZodString;
|
|
@@ -178,10 +178,10 @@ export declare const pass1OutputSchema: z.ZodObject<{
|
|
|
178
178
|
type: z.ZodEnum<{
|
|
179
179
|
number: "number";
|
|
180
180
|
boolean: "boolean";
|
|
181
|
+
text: "text";
|
|
182
|
+
select: "select";
|
|
181
183
|
media: "media";
|
|
182
184
|
link: "link";
|
|
183
|
-
select: "select";
|
|
184
|
-
text: "text";
|
|
185
185
|
richText: "richText";
|
|
186
186
|
}>;
|
|
187
187
|
label: z.ZodString;
|
|
@@ -205,10 +205,10 @@ export declare const pass1OutputSchema: z.ZodObject<{
|
|
|
205
205
|
type: z.ZodEnum<{
|
|
206
206
|
number: "number";
|
|
207
207
|
boolean: "boolean";
|
|
208
|
+
text: "text";
|
|
209
|
+
select: "select";
|
|
208
210
|
media: "media";
|
|
209
211
|
link: "link";
|
|
210
|
-
select: "select";
|
|
211
|
-
text: "text";
|
|
212
212
|
richText: "richText";
|
|
213
213
|
}>;
|
|
214
214
|
label: z.ZodString;
|
|
@@ -225,10 +225,10 @@ export declare const pass1OutputSchema: z.ZodObject<{
|
|
|
225
225
|
type: z.ZodEnum<{
|
|
226
226
|
number: "number";
|
|
227
227
|
boolean: "boolean";
|
|
228
|
+
text: "text";
|
|
229
|
+
select: "select";
|
|
228
230
|
media: "media";
|
|
229
231
|
link: "link";
|
|
230
|
-
select: "select";
|
|
231
|
-
text: "text";
|
|
232
232
|
richText: "richText";
|
|
233
233
|
}>;
|
|
234
234
|
label: z.ZodString;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export { RiverbankContentLoadError } from '../routing/resolvePageContent';
|
|
2
|
+
import { RiverbankContentLoadError } from '../routing/resolvePageContent';
|
|
3
|
+
export type SdkContentLoadFailureKind = 'timeout' | 'network' | 'http_5xx' | 'http_non_404' | 'circuit_open' | 'aborted' | 'unknown';
|
|
4
|
+
export type SdkContentLoadNotFound = Readonly<{
|
|
5
|
+
kind: 'not_found';
|
|
6
|
+
status: 404;
|
|
7
|
+
message: string;
|
|
8
|
+
upstreamCode?: string;
|
|
9
|
+
requestId?: string;
|
|
10
|
+
}>;
|
|
11
|
+
export type SdkContentLoadFailure = Readonly<{
|
|
12
|
+
kind: SdkContentLoadFailureKind;
|
|
13
|
+
message: string;
|
|
14
|
+
status?: number;
|
|
15
|
+
upstreamCode?: string;
|
|
16
|
+
requestId?: string;
|
|
17
|
+
retryAfterMs?: number;
|
|
18
|
+
}>;
|
|
19
|
+
export type ClassifiedContentLoadError = SdkContentLoadNotFound | Readonly<{
|
|
20
|
+
kind: 'upstream_failed';
|
|
21
|
+
failure: SdkContentLoadFailure;
|
|
22
|
+
}>;
|
|
23
|
+
export type CatchAllRequestContext = Readonly<{
|
|
24
|
+
host?: string;
|
|
25
|
+
requestId?: string;
|
|
26
|
+
correlationId?: string;
|
|
27
|
+
monitorRunId?: string;
|
|
28
|
+
}>;
|
|
29
|
+
export type CatchAllContentLoadFailureContext = Readonly<{
|
|
30
|
+
siteId: string;
|
|
31
|
+
path: string;
|
|
32
|
+
preview: boolean;
|
|
33
|
+
sdkVersion: string;
|
|
34
|
+
failure: SdkContentLoadFailure;
|
|
35
|
+
requestContext?: CatchAllRequestContext;
|
|
36
|
+
}>;
|
|
37
|
+
export type SdkContentLoadError = RiverbankContentLoadError & {
|
|
38
|
+
readonly context: CatchAllContentLoadFailureContext;
|
|
39
|
+
};
|
|
40
|
+
export declare const SdkContentLoadError: typeof RiverbankContentLoadError;
|
|
41
|
+
export declare function isSdkContentLoadError(error: unknown): error is SdkContentLoadError;
|
|
42
|
+
export declare function classifyContentLoadError(error: unknown): ClassifiedContentLoadError;
|
|
43
|
+
export declare function createSdkContentLoadError(input: {
|
|
44
|
+
siteId: string;
|
|
45
|
+
path: string;
|
|
46
|
+
preview: boolean;
|
|
47
|
+
failure: SdkContentLoadFailure;
|
|
48
|
+
requestContext?: CatchAllRequestContext;
|
|
49
|
+
cause?: unknown;
|
|
50
|
+
}): SdkContentLoadError;
|
|
51
|
+
export declare function toContentLoadFailureLogFields(error: SdkContentLoadError): Record<string, string | number | boolean | undefined>;
|
|
@@ -38,9 +38,10 @@
|
|
|
38
38
|
* @packageDocumentation
|
|
39
39
|
*/
|
|
40
40
|
export { createCatchAllPage } from './catch-all';
|
|
41
|
+
export { RiverbankContentLoadError, SdkContentLoadError, classifyContentLoadError, isSdkContentLoadError, toContentLoadFailureLogFields, type CatchAllContentLoadFailureContext, type CatchAllRequestContext, type ClassifiedContentLoadError, type SdkContentLoadFailure, type SdkContentLoadFailureKind, type SdkContentLoadNotFound, } from './content-load-failure';
|
|
41
42
|
export type { CreateCatchAllPageOptions, CreateCatchAllPageResult, CatchAllPageProps, CatchAllContext, ThemeSwitchConfigV1, ThemeResolverContext, } from './types';
|
|
42
43
|
export { generateAllStaticParams, validateStaticParamsEnv, pathToSlugArray, type StaticParamsEnvResult, } from './static-params';
|
|
43
|
-
export { createSitemap, type CreateSitemapOptions, type SitemapGenerator } from './sitemap';
|
|
44
|
+
export { createSitemap, type CreateSitemapOptions, type SitemapGenerator, } from './sitemap';
|
|
44
45
|
export { createRobots, type CreateRobotsOptions } from './robots';
|
|
45
46
|
/**
|
|
46
47
|
* ISR revalidation duration in seconds for production mode.
|
|
@@ -11,6 +11,7 @@ import type { Theme } from '../contracts';
|
|
|
11
11
|
import type { BlockOverrideRegistrations } from '../rendering/overrides';
|
|
12
12
|
import type { Metadata } from '../metadata/generatePageMetadata';
|
|
13
13
|
import type { LoadContentResult } from '../rendering/helpers/loadContent';
|
|
14
|
+
import type { CatchAllContentLoadFailureContext, CatchAllRequestContext } from './content-load-failure';
|
|
14
15
|
/**
|
|
15
16
|
* Context passed to escape hatch callbacks.
|
|
16
17
|
*/
|
|
@@ -219,6 +220,24 @@ export type CreateCatchAllPageOptions = {
|
|
|
219
220
|
* ```
|
|
220
221
|
*/
|
|
221
222
|
beforeRender?: (context: CatchAllContext) => ReactNode | null | Promise<ReactNode | null>;
|
|
223
|
+
/**
|
|
224
|
+
* Optional per-request context used for SDK content-load failure logs.
|
|
225
|
+
*
|
|
226
|
+
* The SDK does not call Next's `headers()` automatically because that would
|
|
227
|
+
* change caching/dynamic behavior for all consumers. If you need host,
|
|
228
|
+
* request ID, correlation ID, or monitor run ID in failure logs, pass them
|
|
229
|
+
* through this hook from your app router page.
|
|
230
|
+
*/
|
|
231
|
+
getRequestContext?: () => CatchAllRequestContext | Promise<CatchAllRequestContext>;
|
|
232
|
+
/**
|
|
233
|
+
* Optional escape hatch for upstream CMS/API failures while loading content.
|
|
234
|
+
*
|
|
235
|
+
* By default, `createCatchAllPage()` throws `RiverbankContentLoadError`
|
|
236
|
+
* for timeout/network/5xx/circuit-open failures so they cannot be mistaken
|
|
237
|
+
* for content 404s. Return a React node here only if your site deliberately
|
|
238
|
+
* wants to render a custom temporary-unavailable UI for those failures.
|
|
239
|
+
*/
|
|
240
|
+
onContentLoadFailure?: (context: CatchAllContentLoadFailureContext) => ReactNode | undefined | Promise<ReactNode | undefined>;
|
|
222
241
|
/**
|
|
223
242
|
* Custom metadata generator. If provided, replaces default metadata generation.
|
|
224
243
|
*
|
|
@@ -29,7 +29,7 @@ export type LayoutProps = {
|
|
|
29
29
|
children: React.ReactNode;
|
|
30
30
|
header?: boolean | ((data: HeaderData) => React.ReactNode);
|
|
31
31
|
footer?: boolean | ((data: FooterData) => React.ReactNode);
|
|
32
|
-
headerVariant?: 'classic' | 'centered' | 'transparent' | 'floating'
|
|
32
|
+
headerVariant?: 'classic' | 'centered' | 'transparent' | 'floating';
|
|
33
33
|
/**
|
|
34
34
|
* Whether the current request has an active portal session.
|
|
35
35
|
* Used to resolve portal navigation labels (e.g. "Login" vs "My account").
|
|
@@ -58,7 +58,7 @@ export type LayoutProps = {
|
|
|
58
58
|
* the strict `@riverbankcms/sdk/rendering/server` surface stays bootstrap-free.
|
|
59
59
|
* If a custom host renders hydratable CMS islands through the strict server
|
|
60
60
|
* surface, mount `BlocksIslandsHydrator` from
|
|
61
|
-
|
|
61
|
+
* `@riverbankcms/sdk/rendering/islands` explicitly.
|
|
62
62
|
*
|
|
63
63
|
* @example With pre-fetched site data (recommended)
|
|
64
64
|
* ```tsx
|
|
@@ -9,11 +9,12 @@ export { getContentEntryPrefixes, getContentEntryPrefixesFromContentTypes, isCon
|
|
|
9
9
|
export type { ContentEntryMatch } from './contentRoutes';
|
|
10
10
|
export { toRoutingInfo } from './contentTypeResolver';
|
|
11
11
|
export type { ContentTypeRoutingInfo } from './contentTypeResolver';
|
|
12
|
-
export { isISODateString, isUUID, isValidSegment
|
|
12
|
+
export { isISODateString, isUUID, isValidSegment } from './segmentValidators';
|
|
13
13
|
export { detectEntrySubrouteFromTypes, extractPotentialEntrySubroute, defaultShouldAttemptEntrySubroute, inferKnownEntrySubrouteKind, } from './entrySubroutes';
|
|
14
14
|
export type { EntrySubrouteCandidate, ShouldAttemptEntrySubrouteArgs, KnownEntrySubrouteKind, } from './entrySubroutes';
|
|
15
15
|
export { resolvePageContent } from './resolvePageContent';
|
|
16
|
-
export
|
|
16
|
+
export { contentFound, contentLoadFailed, contentNotFound, RiverbankContentLoadError, } from './resolvePageContent';
|
|
17
|
+
export type { OccurrenceData, EntrySubrouteData, LoadContentResult, PublicContentLoadError, PublicLoadStage, ResolvePageContentOptions, PageResolutionResult, RiverbankContentLoadErrorOptions, } from './resolvePageContent';
|
|
17
18
|
export { resolveEntrySubrouteFromSegment } from './resolveEntrySubroute';
|
|
18
19
|
export type { ResolveEntrySubrouteParams } from './resolveEntrySubroute';
|
|
19
20
|
export { checkRedirectForPath } from './checkRedirect';
|
|
@@ -22,6 +22,61 @@ export type EntrySubrouteData = {
|
|
|
22
22
|
kind: 'course-run';
|
|
23
23
|
run: CourseRunData;
|
|
24
24
|
};
|
|
25
|
+
export type PublicLoadStage = 'site_lookup' | 'content_lookup' | 'entry_subroute_lookup' | 'redirect_lookup' | 'content_normalization';
|
|
26
|
+
export type PublicContentLoadError = {
|
|
27
|
+
kind: 'timeout';
|
|
28
|
+
stage: PublicLoadStage;
|
|
29
|
+
message: string;
|
|
30
|
+
requestId?: string | null;
|
|
31
|
+
} | {
|
|
32
|
+
kind: 'network';
|
|
33
|
+
stage: PublicLoadStage;
|
|
34
|
+
message: string;
|
|
35
|
+
code?: string | null;
|
|
36
|
+
requestId?: string | null;
|
|
37
|
+
} | {
|
|
38
|
+
kind: 'api_error';
|
|
39
|
+
stage: PublicLoadStage;
|
|
40
|
+
status: number;
|
|
41
|
+
message: string;
|
|
42
|
+
code?: string | null;
|
|
43
|
+
requestId?: string | null;
|
|
44
|
+
} | {
|
|
45
|
+
kind: 'invalid_payload';
|
|
46
|
+
stage: PublicLoadStage;
|
|
47
|
+
message: string;
|
|
48
|
+
requestId?: string | null;
|
|
49
|
+
} | {
|
|
50
|
+
kind: 'unknown';
|
|
51
|
+
stage: PublicLoadStage;
|
|
52
|
+
message: string;
|
|
53
|
+
requestId?: string | null;
|
|
54
|
+
};
|
|
55
|
+
export type RiverbankContentLoadErrorOptions = Readonly<{
|
|
56
|
+
surface: string;
|
|
57
|
+
reason?: string | null;
|
|
58
|
+
path?: string | null;
|
|
59
|
+
cause?: unknown;
|
|
60
|
+
}>;
|
|
61
|
+
export declare class RiverbankContentLoadError extends Error {
|
|
62
|
+
readonly surface: string;
|
|
63
|
+
readonly reason: string | null;
|
|
64
|
+
readonly path: string | null;
|
|
65
|
+
readonly cause?: unknown;
|
|
66
|
+
constructor(message: string, options: RiverbankContentLoadErrorOptions);
|
|
67
|
+
}
|
|
68
|
+
export type LoadContentResult<TContent> = {
|
|
69
|
+
kind: 'found';
|
|
70
|
+
content: TContent;
|
|
71
|
+
} | {
|
|
72
|
+
kind: 'not_found';
|
|
73
|
+
} | {
|
|
74
|
+
kind: 'failed';
|
|
75
|
+
error: PublicContentLoadError;
|
|
76
|
+
};
|
|
77
|
+
export declare function contentFound<TContent>(content: TContent): LoadContentResult<TContent>;
|
|
78
|
+
export declare function contentNotFound<TContent>(): LoadContentResult<TContent>;
|
|
79
|
+
export declare function contentLoadFailed<TContent>(error: PublicContentLoadError): LoadContentResult<TContent>;
|
|
25
80
|
/**
|
|
26
81
|
* Options for resolving page content.
|
|
27
82
|
*
|
|
@@ -35,13 +90,14 @@ export interface ResolvePageContentOptions<TContent> {
|
|
|
35
90
|
/**
|
|
36
91
|
* Load content by path.
|
|
37
92
|
*
|
|
38
|
-
* **Contract:** MUST return
|
|
39
|
-
* Callers should wrap their client to normalize
|
|
93
|
+
* **Contract:** MUST return a closed result that distinguishes not-found
|
|
94
|
+
* from upstream failure. Callers should wrap their client to normalize
|
|
95
|
+
* exceptions before they reach this routing helper.
|
|
40
96
|
*
|
|
41
97
|
* @param path - The path to load
|
|
42
|
-
* @returns Content
|
|
98
|
+
* @returns Content load result
|
|
43
99
|
*/
|
|
44
|
-
loadContent: (path: string) => Promise<TContent
|
|
100
|
+
loadContent: (path: string) => Promise<LoadContentResult<TContent>>;
|
|
45
101
|
/**
|
|
46
102
|
* Resolve occurrence by entry ID and segment.
|
|
47
103
|
*
|
|
@@ -99,6 +155,14 @@ export type PageResolutionResult<TContent> = {
|
|
|
99
155
|
found: false;
|
|
100
156
|
/** Reason for not finding content */
|
|
101
157
|
reason: 'not-found' | 'invalid-subroute';
|
|
158
|
+
} | {
|
|
159
|
+
/** Content could not be loaded due to an upstream failure */
|
|
160
|
+
found: false;
|
|
161
|
+
reason: 'load-failed';
|
|
162
|
+
/** The path whose content load failed */
|
|
163
|
+
failedPath: string;
|
|
164
|
+
/** Normalized load failure */
|
|
165
|
+
error: PublicContentLoadError;
|
|
102
166
|
};
|
|
103
167
|
/**
|
|
104
168
|
* Resolve page content for a given path.
|
|
@@ -112,8 +176,9 @@ export type PageResolutionResult<TContent> = {
|
|
|
112
176
|
*
|
|
113
177
|
* ## Error Handling
|
|
114
178
|
*
|
|
115
|
-
* The `loadContent` function MUST return `
|
|
116
|
-
* SDK callers should wrap their client to catch and
|
|
179
|
+
* The `loadContent` function MUST return `not_found` for absence and `failed`
|
|
180
|
+
* for upstream errors. SDK callers should wrap their client to catch and
|
|
181
|
+
* normalize exceptions.
|
|
117
182
|
*
|
|
118
183
|
* @template TContent - The content type
|
|
119
184
|
* @param options - Resolution options with injected loaders
|
|
@@ -190,8 +190,8 @@ export declare const upsertNavigationMenuCommandSchema: z.ZodObject<{
|
|
|
190
190
|
input: z.ZodObject<{
|
|
191
191
|
name: z.ZodOptional<z.ZodString>;
|
|
192
192
|
location: z.ZodOptional<z.ZodEnum<{
|
|
193
|
-
footer: "footer";
|
|
194
193
|
header: "header";
|
|
194
|
+
footer: "footer";
|
|
195
195
|
main: "main";
|
|
196
196
|
}>>;
|
|
197
197
|
role: z.ZodOptional<z.ZodEnum<{
|
|
@@ -409,9 +409,9 @@ export declare const upsertEventSeriesCommandSchema: z.ZodObject<{
|
|
|
409
409
|
}>;
|
|
410
410
|
status: z.ZodOptional<z.ZodEnum<{
|
|
411
411
|
active: "active";
|
|
412
|
-
cancelled: "cancelled";
|
|
413
412
|
draft: "draft";
|
|
414
413
|
archived: "archived";
|
|
414
|
+
cancelled: "cancelled";
|
|
415
415
|
}>>;
|
|
416
416
|
visibility: z.ZodEnum<{
|
|
417
417
|
draft: "draft";
|
|
@@ -533,8 +533,8 @@ export declare const upsertCourseCommandSchema: z.ZodObject<{
|
|
|
533
533
|
title: z.ZodString;
|
|
534
534
|
status: z.ZodOptional<z.ZodEnum<{
|
|
535
535
|
active: "active";
|
|
536
|
-
cancelled: "cancelled";
|
|
537
536
|
draft: "draft";
|
|
537
|
+
cancelled: "cancelled";
|
|
538
538
|
}>>;
|
|
539
539
|
visibility: z.ZodEnum<{
|
|
540
540
|
draft: "draft";
|
|
@@ -723,8 +723,8 @@ export declare const grantCustomerPassCommandSchema: z.ZodObject<{
|
|
|
723
723
|
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
724
724
|
status: z.ZodDefault<z.ZodEnum<{
|
|
725
725
|
active: "active";
|
|
726
|
-
refunded: "refunded";
|
|
727
726
|
expired: "expired";
|
|
727
|
+
refunded: "refunded";
|
|
728
728
|
exhausted: "exhausted";
|
|
729
729
|
}>>;
|
|
730
730
|
note: z.ZodOptional<z.ZodString>;
|
|
@@ -1091,8 +1091,8 @@ export declare const siteCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1091
1091
|
input: z.ZodObject<{
|
|
1092
1092
|
name: z.ZodOptional<z.ZodString>;
|
|
1093
1093
|
location: z.ZodOptional<z.ZodEnum<{
|
|
1094
|
-
footer: "footer";
|
|
1095
1094
|
header: "header";
|
|
1095
|
+
footer: "footer";
|
|
1096
1096
|
main: "main";
|
|
1097
1097
|
}>>;
|
|
1098
1098
|
role: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1311,9 +1311,9 @@ export declare const siteCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1311
1311
|
}>;
|
|
1312
1312
|
status: z.ZodOptional<z.ZodEnum<{
|
|
1313
1313
|
active: "active";
|
|
1314
|
-
cancelled: "cancelled";
|
|
1315
1314
|
draft: "draft";
|
|
1316
1315
|
archived: "archived";
|
|
1316
|
+
cancelled: "cancelled";
|
|
1317
1317
|
}>>;
|
|
1318
1318
|
visibility: z.ZodEnum<{
|
|
1319
1319
|
draft: "draft";
|
|
@@ -1432,8 +1432,8 @@ export declare const siteCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1432
1432
|
title: z.ZodString;
|
|
1433
1433
|
status: z.ZodOptional<z.ZodEnum<{
|
|
1434
1434
|
active: "active";
|
|
1435
|
-
cancelled: "cancelled";
|
|
1436
1435
|
draft: "draft";
|
|
1436
|
+
cancelled: "cancelled";
|
|
1437
1437
|
}>>;
|
|
1438
1438
|
visibility: z.ZodEnum<{
|
|
1439
1439
|
draft: "draft";
|
|
@@ -1572,8 +1572,8 @@ export declare const siteCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1572
1572
|
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1573
1573
|
status: z.ZodDefault<z.ZodEnum<{
|
|
1574
1574
|
active: "active";
|
|
1575
|
-
refunded: "refunded";
|
|
1576
1575
|
expired: "expired";
|
|
1576
|
+
refunded: "refunded";
|
|
1577
1577
|
exhausted: "exhausted";
|
|
1578
1578
|
}>>;
|
|
1579
1579
|
note: z.ZodOptional<z.ZodString>;
|
|
@@ -1924,8 +1924,8 @@ export declare const siteCommandBatchSchema: z.ZodObject<{
|
|
|
1924
1924
|
input: z.ZodObject<{
|
|
1925
1925
|
name: z.ZodOptional<z.ZodString>;
|
|
1926
1926
|
location: z.ZodOptional<z.ZodEnum<{
|
|
1927
|
-
footer: "footer";
|
|
1928
1927
|
header: "header";
|
|
1928
|
+
footer: "footer";
|
|
1929
1929
|
main: "main";
|
|
1930
1930
|
}>>;
|
|
1931
1931
|
role: z.ZodOptional<z.ZodEnum<{
|
|
@@ -2144,9 +2144,9 @@ export declare const siteCommandBatchSchema: z.ZodObject<{
|
|
|
2144
2144
|
}>;
|
|
2145
2145
|
status: z.ZodOptional<z.ZodEnum<{
|
|
2146
2146
|
active: "active";
|
|
2147
|
-
cancelled: "cancelled";
|
|
2148
2147
|
draft: "draft";
|
|
2149
2148
|
archived: "archived";
|
|
2149
|
+
cancelled: "cancelled";
|
|
2150
2150
|
}>>;
|
|
2151
2151
|
visibility: z.ZodEnum<{
|
|
2152
2152
|
draft: "draft";
|
|
@@ -2265,8 +2265,8 @@ export declare const siteCommandBatchSchema: z.ZodObject<{
|
|
|
2265
2265
|
title: z.ZodString;
|
|
2266
2266
|
status: z.ZodOptional<z.ZodEnum<{
|
|
2267
2267
|
active: "active";
|
|
2268
|
-
cancelled: "cancelled";
|
|
2269
2268
|
draft: "draft";
|
|
2269
|
+
cancelled: "cancelled";
|
|
2270
2270
|
}>>;
|
|
2271
2271
|
visibility: z.ZodEnum<{
|
|
2272
2272
|
draft: "draft";
|
|
@@ -2405,8 +2405,8 @@ export declare const siteCommandBatchSchema: z.ZodObject<{
|
|
|
2405
2405
|
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2406
2406
|
status: z.ZodDefault<z.ZodEnum<{
|
|
2407
2407
|
active: "active";
|
|
2408
|
-
refunded: "refunded";
|
|
2409
2408
|
expired: "expired";
|
|
2409
|
+
refunded: "refunded";
|
|
2410
2410
|
exhausted: "exhausted";
|
|
2411
2411
|
}>>;
|
|
2412
2412
|
note: z.ZodOptional<z.ZodString>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const HOME_PAGE_COMMAND_SLUG = "home";
|
|
2
|
+
export declare const ROOT_PAGE_PATH = "/";
|
|
3
|
+
export declare function commandPageSlug(slug: string): string;
|
|
4
|
+
export declare function normalizedPagePath(slug: string): string;
|
|
5
|
+
export declare function normalizedNavigationHref(href: string): string;
|
|
6
|
+
export declare function isInternalPageHref(href: string): boolean;
|