@riverbankcms/sdk 0.3.0 → 0.4.1
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 +255 -1
- package/dist/cli/index.js +249 -40
- package/dist/cli/index.js.map +1 -1
- package/dist/client/bookings.js +15 -1
- package/dist/client/bookings.js.map +1 -1
- package/dist/client/bookings.mjs +15 -1
- package/dist/client/bookings.mjs.map +1 -1
- package/dist/client/client.d.mts +2 -2
- package/dist/client/client.d.ts +2 -2
- package/dist/client/client.js +33 -5
- package/dist/client/client.js.map +1 -1
- package/dist/client/client.mjs +33 -5
- package/dist/client/client.mjs.map +1 -1
- package/dist/client/hooks.d.mts +2 -2
- package/dist/client/hooks.d.ts +2 -2
- package/dist/client/rendering/client.js +31 -33
- package/dist/client/rendering/client.js.map +1 -1
- package/dist/client/rendering/client.mjs +31 -33
- package/dist/client/rendering/client.mjs.map +1 -1
- package/dist/client/usePage-BcjWPXvh.d.mts +6388 -0
- package/dist/client/usePage-C3ZKNwY7.d.mts +6393 -0
- package/dist/client/usePage-CyYpOJud.d.ts +6388 -0
- package/dist/client/usePage-gpVaeWDy.d.ts +6393 -0
- package/dist/server/{Layout-CsAQ-0Fv.d.mts → Layout-B_zUr9ci.d.mts} +1 -1
- package/dist/server/{Layout-BM_KmCxO.d.ts → Layout-CHG77dhK.d.ts} +1 -1
- package/dist/server/blockKinds-B6MWzNWp.d.mts +16 -0
- package/dist/server/blockKinds-B6MWzNWp.d.ts +16 -0
- package/dist/server/{chunk-GWBMJPLH.mjs → chunk-A2FZMRDW.mjs} +3 -2
- package/dist/server/chunk-A2FZMRDW.mjs.map +1 -0
- package/dist/server/chunk-BOHTTHY5.mjs +406 -0
- package/dist/server/chunk-BOHTTHY5.mjs.map +1 -0
- package/dist/server/{chunk-5R4NMVXA.js → chunk-BUCJWG6G.js} +5 -5
- package/dist/server/chunk-BUCJWG6G.js.map +1 -0
- package/dist/server/chunk-D2QLTPUJ.mjs +33 -0
- package/dist/server/chunk-D2QLTPUJ.mjs.map +1 -0
- package/dist/server/chunk-GERCMTPQ.js +33 -0
- package/dist/server/chunk-GERCMTPQ.js.map +1 -0
- package/dist/server/{chunk-SF63XAX7.js → chunk-IT5ICP43.js} +24 -4
- package/dist/server/chunk-IT5ICP43.js.map +1 -0
- package/dist/server/{chunk-QFFQTOY3.mjs → chunk-N3PX76AP.mjs} +11 -3
- package/dist/server/{chunk-QFFQTOY3.mjs.map → chunk-N3PX76AP.mjs.map} +1 -1
- package/dist/server/{chunk-O5DC7MYW.mjs → chunk-NKXS4TBK.mjs} +24 -4
- package/dist/server/chunk-NKXS4TBK.mjs.map +1 -0
- package/dist/server/{chunk-INWKF3IC.js → chunk-P6CDRJN3.js} +8 -8
- package/dist/server/{chunk-INWKF3IC.js.map → chunk-P6CDRJN3.js.map} +1 -1
- package/dist/server/{chunk-UFVCBGBY.js → chunk-R5B6IOFQ.js} +11 -3
- package/dist/server/chunk-R5B6IOFQ.js.map +1 -0
- package/dist/server/{chunk-FK64TZBT.mjs → chunk-SFQ7VF3G.mjs} +2 -2
- package/dist/server/{chunk-62ZJI564.js → chunk-SWPHIUVE.js} +7 -6
- package/dist/server/chunk-SWPHIUVE.js.map +1 -0
- package/dist/server/{chunk-PN3CHDVX.mjs → chunk-XK2YIISA.mjs} +2 -2
- package/dist/server/chunk-XK2YIISA.mjs.map +1 -0
- package/dist/server/{chunk-YXDDFG3N.js → chunk-Y7347JMZ.js} +3 -2
- package/dist/server/chunk-Y7347JMZ.js.map +1 -0
- package/dist/server/{chunk-JTAERCX2.mjs → chunk-ZEAJW6T3.mjs} +5 -4
- package/dist/server/chunk-ZEAJW6T3.mjs.map +1 -0
- package/dist/server/chunk-ZIM53VP6.js +406 -0
- package/dist/server/chunk-ZIM53VP6.js.map +1 -0
- package/dist/server/{components-CI3JiOYA.d.mts → components-Bo3LPpVb.d.mts} +3 -3
- package/dist/server/{components-DJBLu_yc.d.ts → components-ClFs4PUa.d.ts} +3 -3
- package/dist/server/components.d.mts +7 -6
- package/dist/server/components.d.ts +7 -6
- package/dist/server/components.js +3 -3
- package/dist/server/components.mjs +2 -2
- package/dist/server/config-validation.d.mts +5 -300
- package/dist/server/config-validation.d.ts +5 -300
- package/dist/server/config-validation.js +6 -3
- package/dist/server/config-validation.js.map +1 -1
- package/dist/server/config-validation.mjs +5 -2
- package/dist/server/config.d.mts +43 -4
- package/dist/server/config.d.ts +43 -4
- package/dist/server/config.js +27 -3
- package/dist/server/config.js.map +1 -1
- package/dist/server/config.mjs +26 -2
- package/dist/server/config.mjs.map +1 -1
- package/dist/server/data.d.mts +8 -5
- package/dist/server/data.d.ts +8 -5
- package/dist/server/data.js +2 -2
- package/dist/server/data.mjs +1 -1
- package/dist/server/{index-Dus2gkY6.d.ts → index-DbSfrRA0.d.ts} +1 -1
- package/dist/server/{index-DoX3ELQn.d.mts → index-Dj7VKH34.d.mts} +1 -1
- package/dist/server/index.d.mts +5 -4
- package/dist/server/index.d.ts +5 -4
- package/dist/server/index.js +6 -2
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +5 -1
- package/dist/server/{loadContent-CdXDGsJM.d.ts → loadContent-C2SwqmXy.d.ts} +4 -4
- package/dist/server/{loadContent-v2n6pOlO.d.mts → loadContent-C_FipaAC.d.mts} +4 -4
- package/dist/server/loadPage-DUHBXDEW.js +11 -0
- package/dist/server/{loadPage-3ECPF426.js.map → loadPage-DUHBXDEW.js.map} +1 -1
- package/dist/server/{loadPage-LW273NYO.mjs → loadPage-LYVKY3WZ.mjs} +3 -3
- package/dist/server/{loadPage-en10WQrt.d.mts → loadPage-mavT3Jae.d.mts} +22 -3
- package/dist/server/{loadPage-bejlajm9.d.ts → loadPage-naVvoua8.d.ts} +22 -3
- package/dist/server/metadata.d.mts +5 -4
- package/dist/server/metadata.d.ts +5 -4
- package/dist/server/navigation.d.mts +2 -2
- package/dist/server/navigation.d.ts +2 -2
- package/dist/server/rendering/server.d.mts +8 -7
- package/dist/server/rendering/server.d.ts +8 -7
- package/dist/server/rendering/server.js +4 -4
- package/dist/server/rendering/server.mjs +3 -3
- package/dist/server/rendering.d.mts +9 -8
- package/dist/server/rendering.d.ts +9 -8
- package/dist/server/rendering.js +6 -6
- package/dist/server/rendering.mjs +5 -5
- package/dist/server/routing.d.mts +5 -4
- package/dist/server/routing.d.ts +5 -4
- package/dist/server/routing.js +1 -1
- package/dist/server/routing.mjs +1 -1
- package/dist/server/server.d.mts +7 -6
- package/dist/server/server.d.ts +7 -6
- package/dist/server/server.js +4 -4
- package/dist/server/server.mjs +3 -3
- package/dist/server/theme-bridge.js +7 -7
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/{types-Cc7lyPkN.d.ts → types-5XdVD2J1.d.ts} +2 -0
- package/dist/server/{types-nVerjjdv.d.mts → types-BA-J9K8r.d.mts} +2 -0
- package/dist/server/{types-CLusapsM.d.mts → types-BC9eB2KH.d.mts} +65 -17
- package/dist/server/{types-Ls6BkLKg.d.ts → types-CAnC529E.d.ts} +65 -17
- package/dist/server/{types-D-rqOU5I.d.ts → types-CMqVHYLG.d.ts} +264 -2
- package/dist/server/{types-Bq3520hK.d.mts → types-CYfHxUhe.d.mts} +264 -2
- package/dist/server/{types-_nDnPHpv.d.mts → types-CbagRQ_7.d.mts} +19 -1
- package/dist/server/{types-_nDnPHpv.d.ts → types-DuQCNVV0.d.ts} +19 -1
- package/dist/server/validation-C7W2Fe0i.d.ts +459 -0
- package/dist/server/validation-hg1sqhrt.d.mts +459 -0
- package/package.json +2 -1
- package/dist/server/chunk-5R4NMVXA.js.map +0 -1
- package/dist/server/chunk-62ZJI564.js.map +0 -1
- package/dist/server/chunk-BPKYRPCQ.mjs +0 -215
- package/dist/server/chunk-BPKYRPCQ.mjs.map +0 -1
- package/dist/server/chunk-GWBMJPLH.mjs.map +0 -1
- package/dist/server/chunk-JTAERCX2.mjs.map +0 -1
- package/dist/server/chunk-O5DC7MYW.mjs.map +0 -1
- package/dist/server/chunk-PN3CHDVX.mjs.map +0 -1
- package/dist/server/chunk-SF63XAX7.js.map +0 -1
- package/dist/server/chunk-UFVCBGBY.js.map +0 -1
- package/dist/server/chunk-XLVL5WPH.js +0 -215
- package/dist/server/chunk-XLVL5WPH.js.map +0 -1
- package/dist/server/chunk-YXDDFG3N.js.map +0 -1
- package/dist/server/loadPage-3ECPF426.js +0 -11
- /package/dist/server/{chunk-FK64TZBT.mjs.map → chunk-SFQ7VF3G.mjs.map} +0 -0
- /package/dist/server/{loadPage-LW273NYO.mjs.map → loadPage-LYVKY3WZ.mjs.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as APIEndpoints } from './types-
|
|
1
|
+
import { A as APIEndpoints } from './types-5XdVD2J1.js';
|
|
2
2
|
|
|
3
3
|
type SiteResponse = NonNullable<APIEndpoints['getSite']['response']>;
|
|
4
4
|
type PageResponse = NonNullable<APIEndpoints['getContentByPath']['response']>;
|
|
@@ -7,6 +7,50 @@ type EntryResponse = NonNullable<APIEndpoints['getPublishedEntryPreview']['respo
|
|
|
7
7
|
type PublicFormResponse = NonNullable<APIEndpoints['getPublicFormById']['response']>;
|
|
8
8
|
type PublicBookingServicesResponse = NonNullable<APIEndpoints['getPublicBookingServices']['response']>;
|
|
9
9
|
type PublicEventsResponse = NonNullable<APIEndpoints['listPublicEvents']['response']>;
|
|
10
|
+
/**
|
|
11
|
+
* Pagination metadata returned when `includeMeta: true`
|
|
12
|
+
*/
|
|
13
|
+
interface PaginationMeta {
|
|
14
|
+
/** Total number of entries matching the query (estimated if hasMore is true) */
|
|
15
|
+
total: number;
|
|
16
|
+
/** Whether there are more entries after this page */
|
|
17
|
+
hasMore: boolean;
|
|
18
|
+
/** Number of entries per page */
|
|
19
|
+
limit: number;
|
|
20
|
+
/** Number of entries skipped (offset) */
|
|
21
|
+
offset: number;
|
|
22
|
+
/** Total number of pages (estimated if hasMore is true) */
|
|
23
|
+
totalPages: number;
|
|
24
|
+
/** Current page number (1-indexed) */
|
|
25
|
+
currentPage: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Response type when includeMeta is true - includes pagination metadata
|
|
29
|
+
*/
|
|
30
|
+
type EntriesResponseWithMeta = {
|
|
31
|
+
entries: EntriesResponse['entries'];
|
|
32
|
+
} & PaginationMeta;
|
|
33
|
+
/**
|
|
34
|
+
* Base parameters for getEntries - shared across all overloads
|
|
35
|
+
*/
|
|
36
|
+
interface GetEntriesBaseParams {
|
|
37
|
+
/** The site ID */
|
|
38
|
+
siteId: string;
|
|
39
|
+
/** The content type key (e.g., 'blog-post', 'product') */
|
|
40
|
+
contentType: string;
|
|
41
|
+
/** Maximum number of entries to return (default: 10, max: 50) */
|
|
42
|
+
limit?: number;
|
|
43
|
+
/** Number of entries to skip for pagination */
|
|
44
|
+
offset?: number;
|
|
45
|
+
/** Sort order for entries. 'order' uses custom ordering (default behavior). */
|
|
46
|
+
order?: 'newest' | 'oldest' | 'title' | 'order';
|
|
47
|
+
/** If true, includes draft entries (requires API key with site access) */
|
|
48
|
+
preview?: boolean;
|
|
49
|
+
/** Selection mode: 'query' for automatic, 'manual' for specific entry IDs */
|
|
50
|
+
mode?: 'query' | 'manual';
|
|
51
|
+
/** Entry IDs to fetch when mode is 'manual' */
|
|
52
|
+
entryIds?: string[];
|
|
53
|
+
}
|
|
10
54
|
/**
|
|
11
55
|
* Configuration for creating a Riverbank CMS client
|
|
12
56
|
*/
|
|
@@ -66,11 +110,13 @@ interface RiverbankClient {
|
|
|
66
110
|
*
|
|
67
111
|
* @param params.siteId - The site ID
|
|
68
112
|
* @param params.contentType - The content type key (e.g., 'blog-post', 'product')
|
|
69
|
-
* @param params.limit - Maximum number of entries to return
|
|
113
|
+
* @param params.limit - Maximum number of entries to return (default: 10, max: 50)
|
|
114
|
+
* @param params.offset - Number of entries to skip for pagination (default: 0)
|
|
70
115
|
* @param params.order - Sort order: 'newest' (published_at desc) or 'oldest' (published_at asc)
|
|
71
116
|
* @param params.preview - If true, includes draft entries (requires API key with site access)
|
|
72
117
|
* @param params.mode - 'query' for automatic fetching, 'manual' for specific entry IDs
|
|
73
118
|
* @param params.entryIds - Array of entry IDs to fetch (only used when mode is 'manual')
|
|
119
|
+
* @param params.includeMeta - If true, returns pagination metadata with the response
|
|
74
120
|
*
|
|
75
121
|
* @example
|
|
76
122
|
* ```ts
|
|
@@ -82,12 +128,15 @@ interface RiverbankClient {
|
|
|
82
128
|
* order: 'newest',
|
|
83
129
|
* });
|
|
84
130
|
*
|
|
85
|
-
* // Fetch
|
|
86
|
-
* const
|
|
131
|
+
* // Fetch page 3 with pagination metadata
|
|
132
|
+
* const page3 = await client.getEntries({
|
|
87
133
|
* siteId: 'site-id',
|
|
88
134
|
* contentType: 'blog-post',
|
|
89
|
-
*
|
|
135
|
+
* limit: 10,
|
|
136
|
+
* offset: 20,
|
|
137
|
+
* includeMeta: true,
|
|
90
138
|
* });
|
|
139
|
+
* // page3.entries, page3.total, page3.hasMore, page3.currentPage
|
|
91
140
|
*
|
|
92
141
|
* // Fetch specific entries by ID (manual mode)
|
|
93
142
|
* const specific = await client.getEntries({
|
|
@@ -98,18 +147,17 @@ interface RiverbankClient {
|
|
|
98
147
|
* });
|
|
99
148
|
* ```
|
|
100
149
|
*/
|
|
101
|
-
getEntries(params: {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
limit?: number;
|
|
105
|
-
/** Sort order for entries. 'order' uses custom ordering (default behavior). */
|
|
106
|
-
order?: 'newest' | 'oldest' | 'title' | 'order';
|
|
107
|
-
preview?: boolean;
|
|
108
|
-
/** Selection mode: 'query' for automatic, 'manual' for specific entry IDs */
|
|
109
|
-
mode?: 'query' | 'manual';
|
|
110
|
-
/** Entry IDs to fetch when mode is 'manual' */
|
|
111
|
-
entryIds?: string[];
|
|
150
|
+
getEntries(params: GetEntriesBaseParams & {
|
|
151
|
+
/** If true, returns pagination metadata with the response */
|
|
152
|
+
includeMeta?: false;
|
|
112
153
|
}): Promise<EntriesResponse>;
|
|
154
|
+
getEntries(params: GetEntriesBaseParams & {
|
|
155
|
+
/** If true, returns pagination metadata with the response */
|
|
156
|
+
includeMeta: true;
|
|
157
|
+
}): Promise<EntriesResponseWithMeta>;
|
|
158
|
+
getEntries(params: GetEntriesBaseParams & {
|
|
159
|
+
includeMeta?: boolean;
|
|
160
|
+
}): Promise<EntriesResponse | EntriesResponseWithMeta>;
|
|
113
161
|
/**
|
|
114
162
|
* Fetch a specific content entry by slug
|
|
115
163
|
*/
|
|
@@ -147,4 +195,4 @@ interface RiverbankClient {
|
|
|
147
195
|
clearCache(): void;
|
|
148
196
|
}
|
|
149
197
|
|
|
150
|
-
export type { EntriesResponse as E, PageResponse as P, RiverbankClient as R, SiteResponse as S, RiverbankClientConfig as a, EntryResponse as b };
|
|
198
|
+
export type { EntriesResponse as E, PageResponse as P, RiverbankClient as R, SiteResponse as S, RiverbankClientConfig as a, EntryResponse as b, EntriesResponseWithMeta as c, PaginationMeta as d };
|
|
@@ -1,4 +1,247 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as FieldDefinition, S as SdkCustomBlock } from './schema-Bpy9N5ZI.js';
|
|
2
|
+
import { B as BlockKind } from './blockKinds-B6MWzNWp.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* SDK Content Scaffolding Types
|
|
6
|
+
*
|
|
7
|
+
* These types define the schema for SDK content configuration that allows
|
|
8
|
+
* SDK sites to define content types, pages, entries, and navigation in code.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Content type definition for SDK config.
|
|
13
|
+
*
|
|
14
|
+
* Defines the structure of a content type that SDK sites can declare.
|
|
15
|
+
* When pushed, the dashboard will ensure this content type exists.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* {
|
|
20
|
+
* key: 'testimonial',
|
|
21
|
+
* name: 'Testimonial',
|
|
22
|
+
* hasPages: false,
|
|
23
|
+
* fields: [
|
|
24
|
+
* { id: 'quote', type: 'richText', label: 'Quote', required: true },
|
|
25
|
+
* { id: 'author', type: 'text', label: 'Author', required: true },
|
|
26
|
+
* ],
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
interface ContentTypeConfig {
|
|
31
|
+
/** Unique key for this content type (e.g., 'post', 'event'). Must be lowercase with hyphens. */
|
|
32
|
+
key: string;
|
|
33
|
+
/** Display name shown in dashboard UI */
|
|
34
|
+
name: string;
|
|
35
|
+
/** Optional description */
|
|
36
|
+
description?: string;
|
|
37
|
+
/** Whether entries of this type have routable pages */
|
|
38
|
+
hasPages: boolean;
|
|
39
|
+
/** Route pattern with {slug} placeholder. Required if hasPages=true. */
|
|
40
|
+
routePattern?: string;
|
|
41
|
+
/** Field definitions for this content type */
|
|
42
|
+
fields: FieldDefinition[];
|
|
43
|
+
/** Field ID to use as the entry title source */
|
|
44
|
+
titleField?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Block content for page scaffolding.
|
|
48
|
+
*
|
|
49
|
+
* Represents initial block content that can be added to SDK-defined pages.
|
|
50
|
+
*/
|
|
51
|
+
interface BlockConfig {
|
|
52
|
+
/** Block kind (e.g., 'block.hero', 'block.bodyText', 'custom.myBlock') */
|
|
53
|
+
kind: BlockKind;
|
|
54
|
+
/** Block content data matching the block's field definitions */
|
|
55
|
+
content: Record<string, unknown>;
|
|
56
|
+
/** Order index (optional, defaults to array position) */
|
|
57
|
+
orderIndex?: number;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Page definition for SDK config.
|
|
61
|
+
*
|
|
62
|
+
* Defines a page that should exist on the site.
|
|
63
|
+
* When pushed, the dashboard will ensure this page exists.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* {
|
|
68
|
+
* identifier: 'home',
|
|
69
|
+
* title: 'Home',
|
|
70
|
+
* path: '/',
|
|
71
|
+
* status: 'published',
|
|
72
|
+
* blocks: [
|
|
73
|
+
* { kind: 'block.hero', content: { heading: 'Welcome' } },
|
|
74
|
+
* ],
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
interface PageConfig {
|
|
79
|
+
/** Unique identifier for this page. Required for SDK sync. */
|
|
80
|
+
identifier: string;
|
|
81
|
+
/** Page title */
|
|
82
|
+
title: string;
|
|
83
|
+
/** URL path (e.g., '/', '/about', '/contact'). Must start with /. */
|
|
84
|
+
path: string;
|
|
85
|
+
/** Page purpose (default: 'content') */
|
|
86
|
+
purpose?: string;
|
|
87
|
+
/** Initial block content (optional) */
|
|
88
|
+
blocks?: BlockConfig[];
|
|
89
|
+
/** Status: 'draft' or 'published' (default: 'draft') */
|
|
90
|
+
status?: 'draft' | 'published';
|
|
91
|
+
/** SEO meta title */
|
|
92
|
+
metaTitle?: string;
|
|
93
|
+
/** SEO meta description */
|
|
94
|
+
metaDescription?: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Content entry definition for SDK config.
|
|
98
|
+
*
|
|
99
|
+
* Defines a content entry that should exist.
|
|
100
|
+
* When pushed, the dashboard will ensure this entry exists.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```typescript
|
|
104
|
+
* {
|
|
105
|
+
* identifier: 'testimonial-1',
|
|
106
|
+
* contentType: 'testimonial',
|
|
107
|
+
* title: 'First Testimonial',
|
|
108
|
+
* status: 'published',
|
|
109
|
+
* data: {
|
|
110
|
+
* quote: '<p>Great product!</p>',
|
|
111
|
+
* author: 'Jane Doe',
|
|
112
|
+
* },
|
|
113
|
+
* }
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
interface EntryConfig {
|
|
117
|
+
/** Unique identifier for this entry. Required for SDK sync. */
|
|
118
|
+
identifier: string;
|
|
119
|
+
/** Content type key this entry belongs to */
|
|
120
|
+
contentType: string;
|
|
121
|
+
/** Entry data matching the content type's field definitions */
|
|
122
|
+
data: Record<string, unknown>;
|
|
123
|
+
/** Status: 'draft' or 'published' (default: 'draft') */
|
|
124
|
+
status?: 'draft' | 'published';
|
|
125
|
+
/** Slug for routable entries. Defaults to identifier if content type hasPages. */
|
|
126
|
+
slug?: string;
|
|
127
|
+
/** Title for the entry (used in route metadata if routable) */
|
|
128
|
+
title?: string;
|
|
129
|
+
/** Summary/description */
|
|
130
|
+
summary?: string;
|
|
131
|
+
/** SEO meta title */
|
|
132
|
+
metaTitle?: string;
|
|
133
|
+
/** SEO meta description */
|
|
134
|
+
metaDescription?: string;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Navigation link types for menu items.
|
|
138
|
+
*/
|
|
139
|
+
type NavigationLinkType = {
|
|
140
|
+
kind: 'page';
|
|
141
|
+
identifier: string;
|
|
142
|
+
} | {
|
|
143
|
+
kind: 'entry';
|
|
144
|
+
identifier: string;
|
|
145
|
+
} | {
|
|
146
|
+
kind: 'external';
|
|
147
|
+
href: string;
|
|
148
|
+
} | {
|
|
149
|
+
kind: 'dropdown';
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Navigation item definition.
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```typescript
|
|
156
|
+
* {
|
|
157
|
+
* label: 'Products',
|
|
158
|
+
* link: { kind: 'dropdown' },
|
|
159
|
+
* children: [
|
|
160
|
+
* { label: 'Product 1', link: { kind: 'page', identifier: 'product-1' } },
|
|
161
|
+
* ],
|
|
162
|
+
* }
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
interface NavigationItemConfig {
|
|
166
|
+
/** Display label */
|
|
167
|
+
label: string;
|
|
168
|
+
/** Link configuration */
|
|
169
|
+
link: NavigationLinkType;
|
|
170
|
+
/** Is this a CTA button? */
|
|
171
|
+
isCta?: boolean;
|
|
172
|
+
/** Child items (for dropdown menus, max 1 level) */
|
|
173
|
+
children?: NavigationItemConfig[];
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Navigation menu definition.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```typescript
|
|
180
|
+
* {
|
|
181
|
+
* identifier: 'main',
|
|
182
|
+
* name: 'Main Navigation',
|
|
183
|
+
* isPrimary: true,
|
|
184
|
+
* items: [
|
|
185
|
+
* { label: 'Home', link: { kind: 'page', identifier: 'home' } },
|
|
186
|
+
* { label: 'About', link: { kind: 'page', identifier: 'about' } },
|
|
187
|
+
* ],
|
|
188
|
+
* }
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
interface NavigationMenuConfig {
|
|
192
|
+
/** Unique identifier for this menu */
|
|
193
|
+
identifier: string;
|
|
194
|
+
/** Menu display name */
|
|
195
|
+
name: string;
|
|
196
|
+
/** Is this the primary/main menu? */
|
|
197
|
+
isPrimary?: boolean;
|
|
198
|
+
/** Menu items */
|
|
199
|
+
items: NavigationItemConfig[];
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Site settings for SDK config.
|
|
203
|
+
*/
|
|
204
|
+
interface SiteSettingsConfig {
|
|
205
|
+
/** Homepage path (default: '/') */
|
|
206
|
+
homepagePath?: string;
|
|
207
|
+
/** Site title (for SEO/metadata) */
|
|
208
|
+
siteTitle?: string;
|
|
209
|
+
/** Site description (for SEO/metadata) */
|
|
210
|
+
siteDescription?: string;
|
|
211
|
+
/** Default template ID per content type key */
|
|
212
|
+
defaultTemplates?: Record<string, string>;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Complete content configuration for SDK sites.
|
|
216
|
+
*
|
|
217
|
+
* This is imported into riverbank.config.ts via the `content` field.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```typescript
|
|
221
|
+
* // content.config.ts
|
|
222
|
+
* import { defineContentConfig } from '@riverbankcms/sdk/config';
|
|
223
|
+
*
|
|
224
|
+
* export const contentConfig = defineContentConfig({
|
|
225
|
+
* contentTypes: [...],
|
|
226
|
+
* pages: [...],
|
|
227
|
+
* entries: [...],
|
|
228
|
+
* navigationMenus: [...],
|
|
229
|
+
* settings: {...},
|
|
230
|
+
* });
|
|
231
|
+
* ```
|
|
232
|
+
*/
|
|
233
|
+
interface ContentConfig {
|
|
234
|
+
/** Content type definitions */
|
|
235
|
+
contentTypes?: ContentTypeConfig[];
|
|
236
|
+
/** Content entries */
|
|
237
|
+
entries?: EntryConfig[];
|
|
238
|
+
/** Page definitions */
|
|
239
|
+
pages?: PageConfig[];
|
|
240
|
+
/** Navigation menus */
|
|
241
|
+
navigationMenus?: NavigationMenuConfig[];
|
|
242
|
+
/** Site settings */
|
|
243
|
+
settings?: SiteSettingsConfig;
|
|
244
|
+
}
|
|
2
245
|
|
|
3
246
|
/**
|
|
4
247
|
* SDK Site Configuration Types
|
|
@@ -328,6 +571,25 @@ interface RiverbankSiteConfig {
|
|
|
328
571
|
* ```
|
|
329
572
|
*/
|
|
330
573
|
blockFieldExtensions?: BlockFieldExtensionsMap;
|
|
574
|
+
/**
|
|
575
|
+
* Content scaffolding configuration.
|
|
576
|
+
*
|
|
577
|
+
* Defines content types, pages, entries, and navigation menus that
|
|
578
|
+
* should exist on the site. When SDK config is pushed, the dashboard
|
|
579
|
+
* will ensure these items exist.
|
|
580
|
+
*
|
|
581
|
+
* @example
|
|
582
|
+
* ```typescript
|
|
583
|
+
* content: {
|
|
584
|
+
* contentTypes: [...],
|
|
585
|
+
* pages: [...],
|
|
586
|
+
* entries: [...],
|
|
587
|
+
* navigationMenus: [...],
|
|
588
|
+
* settings: { homepagePath: '/' },
|
|
589
|
+
* }
|
|
590
|
+
* ```
|
|
591
|
+
*/
|
|
592
|
+
content?: ContentConfig;
|
|
331
593
|
}
|
|
332
594
|
|
|
333
|
-
export type { BlockFieldConfig as B,
|
|
595
|
+
export type { BlockFieldConfig as B, ContentConfig as C, EntryConfig as E, FieldSelectOption as F, NavigationMenuConfig as N, PageConfig as P, RiverbankSiteConfig as R, SiteStyleConfig as S, SectionBackground as a, SectionOptionsConfig as b, ContainerOptionsConfig as c, SectionSpacing as d, ContainerMaxWidth as e, ContainerAlignment as f, SdkThemeConfig as g, SdkThemePalette as h, BlockFieldOptionsMap as i, BlockFieldExtension as j, BlockFieldExtensionsMap as k, ContentTypeConfig as l, BlockConfig as m, NavigationItemConfig as n, NavigationLinkType as o, SiteSettingsConfig as p };
|
|
@@ -1,4 +1,247 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as FieldDefinition, S as SdkCustomBlock } from './schema-Bpy9N5ZI.mjs';
|
|
2
|
+
import { B as BlockKind } from './blockKinds-B6MWzNWp.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* SDK Content Scaffolding Types
|
|
6
|
+
*
|
|
7
|
+
* These types define the schema for SDK content configuration that allows
|
|
8
|
+
* SDK sites to define content types, pages, entries, and navigation in code.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Content type definition for SDK config.
|
|
13
|
+
*
|
|
14
|
+
* Defines the structure of a content type that SDK sites can declare.
|
|
15
|
+
* When pushed, the dashboard will ensure this content type exists.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* {
|
|
20
|
+
* key: 'testimonial',
|
|
21
|
+
* name: 'Testimonial',
|
|
22
|
+
* hasPages: false,
|
|
23
|
+
* fields: [
|
|
24
|
+
* { id: 'quote', type: 'richText', label: 'Quote', required: true },
|
|
25
|
+
* { id: 'author', type: 'text', label: 'Author', required: true },
|
|
26
|
+
* ],
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
interface ContentTypeConfig {
|
|
31
|
+
/** Unique key for this content type (e.g., 'post', 'event'). Must be lowercase with hyphens. */
|
|
32
|
+
key: string;
|
|
33
|
+
/** Display name shown in dashboard UI */
|
|
34
|
+
name: string;
|
|
35
|
+
/** Optional description */
|
|
36
|
+
description?: string;
|
|
37
|
+
/** Whether entries of this type have routable pages */
|
|
38
|
+
hasPages: boolean;
|
|
39
|
+
/** Route pattern with {slug} placeholder. Required if hasPages=true. */
|
|
40
|
+
routePattern?: string;
|
|
41
|
+
/** Field definitions for this content type */
|
|
42
|
+
fields: FieldDefinition[];
|
|
43
|
+
/** Field ID to use as the entry title source */
|
|
44
|
+
titleField?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Block content for page scaffolding.
|
|
48
|
+
*
|
|
49
|
+
* Represents initial block content that can be added to SDK-defined pages.
|
|
50
|
+
*/
|
|
51
|
+
interface BlockConfig {
|
|
52
|
+
/** Block kind (e.g., 'block.hero', 'block.bodyText', 'custom.myBlock') */
|
|
53
|
+
kind: BlockKind;
|
|
54
|
+
/** Block content data matching the block's field definitions */
|
|
55
|
+
content: Record<string, unknown>;
|
|
56
|
+
/** Order index (optional, defaults to array position) */
|
|
57
|
+
orderIndex?: number;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Page definition for SDK config.
|
|
61
|
+
*
|
|
62
|
+
* Defines a page that should exist on the site.
|
|
63
|
+
* When pushed, the dashboard will ensure this page exists.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* {
|
|
68
|
+
* identifier: 'home',
|
|
69
|
+
* title: 'Home',
|
|
70
|
+
* path: '/',
|
|
71
|
+
* status: 'published',
|
|
72
|
+
* blocks: [
|
|
73
|
+
* { kind: 'block.hero', content: { heading: 'Welcome' } },
|
|
74
|
+
* ],
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
interface PageConfig {
|
|
79
|
+
/** Unique identifier for this page. Required for SDK sync. */
|
|
80
|
+
identifier: string;
|
|
81
|
+
/** Page title */
|
|
82
|
+
title: string;
|
|
83
|
+
/** URL path (e.g., '/', '/about', '/contact'). Must start with /. */
|
|
84
|
+
path: string;
|
|
85
|
+
/** Page purpose (default: 'content') */
|
|
86
|
+
purpose?: string;
|
|
87
|
+
/** Initial block content (optional) */
|
|
88
|
+
blocks?: BlockConfig[];
|
|
89
|
+
/** Status: 'draft' or 'published' (default: 'draft') */
|
|
90
|
+
status?: 'draft' | 'published';
|
|
91
|
+
/** SEO meta title */
|
|
92
|
+
metaTitle?: string;
|
|
93
|
+
/** SEO meta description */
|
|
94
|
+
metaDescription?: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Content entry definition for SDK config.
|
|
98
|
+
*
|
|
99
|
+
* Defines a content entry that should exist.
|
|
100
|
+
* When pushed, the dashboard will ensure this entry exists.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```typescript
|
|
104
|
+
* {
|
|
105
|
+
* identifier: 'testimonial-1',
|
|
106
|
+
* contentType: 'testimonial',
|
|
107
|
+
* title: 'First Testimonial',
|
|
108
|
+
* status: 'published',
|
|
109
|
+
* data: {
|
|
110
|
+
* quote: '<p>Great product!</p>',
|
|
111
|
+
* author: 'Jane Doe',
|
|
112
|
+
* },
|
|
113
|
+
* }
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
interface EntryConfig {
|
|
117
|
+
/** Unique identifier for this entry. Required for SDK sync. */
|
|
118
|
+
identifier: string;
|
|
119
|
+
/** Content type key this entry belongs to */
|
|
120
|
+
contentType: string;
|
|
121
|
+
/** Entry data matching the content type's field definitions */
|
|
122
|
+
data: Record<string, unknown>;
|
|
123
|
+
/** Status: 'draft' or 'published' (default: 'draft') */
|
|
124
|
+
status?: 'draft' | 'published';
|
|
125
|
+
/** Slug for routable entries. Defaults to identifier if content type hasPages. */
|
|
126
|
+
slug?: string;
|
|
127
|
+
/** Title for the entry (used in route metadata if routable) */
|
|
128
|
+
title?: string;
|
|
129
|
+
/** Summary/description */
|
|
130
|
+
summary?: string;
|
|
131
|
+
/** SEO meta title */
|
|
132
|
+
metaTitle?: string;
|
|
133
|
+
/** SEO meta description */
|
|
134
|
+
metaDescription?: string;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Navigation link types for menu items.
|
|
138
|
+
*/
|
|
139
|
+
type NavigationLinkType = {
|
|
140
|
+
kind: 'page';
|
|
141
|
+
identifier: string;
|
|
142
|
+
} | {
|
|
143
|
+
kind: 'entry';
|
|
144
|
+
identifier: string;
|
|
145
|
+
} | {
|
|
146
|
+
kind: 'external';
|
|
147
|
+
href: string;
|
|
148
|
+
} | {
|
|
149
|
+
kind: 'dropdown';
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Navigation item definition.
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```typescript
|
|
156
|
+
* {
|
|
157
|
+
* label: 'Products',
|
|
158
|
+
* link: { kind: 'dropdown' },
|
|
159
|
+
* children: [
|
|
160
|
+
* { label: 'Product 1', link: { kind: 'page', identifier: 'product-1' } },
|
|
161
|
+
* ],
|
|
162
|
+
* }
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
interface NavigationItemConfig {
|
|
166
|
+
/** Display label */
|
|
167
|
+
label: string;
|
|
168
|
+
/** Link configuration */
|
|
169
|
+
link: NavigationLinkType;
|
|
170
|
+
/** Is this a CTA button? */
|
|
171
|
+
isCta?: boolean;
|
|
172
|
+
/** Child items (for dropdown menus, max 1 level) */
|
|
173
|
+
children?: NavigationItemConfig[];
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Navigation menu definition.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```typescript
|
|
180
|
+
* {
|
|
181
|
+
* identifier: 'main',
|
|
182
|
+
* name: 'Main Navigation',
|
|
183
|
+
* isPrimary: true,
|
|
184
|
+
* items: [
|
|
185
|
+
* { label: 'Home', link: { kind: 'page', identifier: 'home' } },
|
|
186
|
+
* { label: 'About', link: { kind: 'page', identifier: 'about' } },
|
|
187
|
+
* ],
|
|
188
|
+
* }
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
interface NavigationMenuConfig {
|
|
192
|
+
/** Unique identifier for this menu */
|
|
193
|
+
identifier: string;
|
|
194
|
+
/** Menu display name */
|
|
195
|
+
name: string;
|
|
196
|
+
/** Is this the primary/main menu? */
|
|
197
|
+
isPrimary?: boolean;
|
|
198
|
+
/** Menu items */
|
|
199
|
+
items: NavigationItemConfig[];
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Site settings for SDK config.
|
|
203
|
+
*/
|
|
204
|
+
interface SiteSettingsConfig {
|
|
205
|
+
/** Homepage path (default: '/') */
|
|
206
|
+
homepagePath?: string;
|
|
207
|
+
/** Site title (for SEO/metadata) */
|
|
208
|
+
siteTitle?: string;
|
|
209
|
+
/** Site description (for SEO/metadata) */
|
|
210
|
+
siteDescription?: string;
|
|
211
|
+
/** Default template ID per content type key */
|
|
212
|
+
defaultTemplates?: Record<string, string>;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Complete content configuration for SDK sites.
|
|
216
|
+
*
|
|
217
|
+
* This is imported into riverbank.config.ts via the `content` field.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```typescript
|
|
221
|
+
* // content.config.ts
|
|
222
|
+
* import { defineContentConfig } from '@riverbankcms/sdk/config';
|
|
223
|
+
*
|
|
224
|
+
* export const contentConfig = defineContentConfig({
|
|
225
|
+
* contentTypes: [...],
|
|
226
|
+
* pages: [...],
|
|
227
|
+
* entries: [...],
|
|
228
|
+
* navigationMenus: [...],
|
|
229
|
+
* settings: {...},
|
|
230
|
+
* });
|
|
231
|
+
* ```
|
|
232
|
+
*/
|
|
233
|
+
interface ContentConfig {
|
|
234
|
+
/** Content type definitions */
|
|
235
|
+
contentTypes?: ContentTypeConfig[];
|
|
236
|
+
/** Content entries */
|
|
237
|
+
entries?: EntryConfig[];
|
|
238
|
+
/** Page definitions */
|
|
239
|
+
pages?: PageConfig[];
|
|
240
|
+
/** Navigation menus */
|
|
241
|
+
navigationMenus?: NavigationMenuConfig[];
|
|
242
|
+
/** Site settings */
|
|
243
|
+
settings?: SiteSettingsConfig;
|
|
244
|
+
}
|
|
2
245
|
|
|
3
246
|
/**
|
|
4
247
|
* SDK Site Configuration Types
|
|
@@ -328,6 +571,25 @@ interface RiverbankSiteConfig {
|
|
|
328
571
|
* ```
|
|
329
572
|
*/
|
|
330
573
|
blockFieldExtensions?: BlockFieldExtensionsMap;
|
|
574
|
+
/**
|
|
575
|
+
* Content scaffolding configuration.
|
|
576
|
+
*
|
|
577
|
+
* Defines content types, pages, entries, and navigation menus that
|
|
578
|
+
* should exist on the site. When SDK config is pushed, the dashboard
|
|
579
|
+
* will ensure these items exist.
|
|
580
|
+
*
|
|
581
|
+
* @example
|
|
582
|
+
* ```typescript
|
|
583
|
+
* content: {
|
|
584
|
+
* contentTypes: [...],
|
|
585
|
+
* pages: [...],
|
|
586
|
+
* entries: [...],
|
|
587
|
+
* navigationMenus: [...],
|
|
588
|
+
* settings: { homepagePath: '/' },
|
|
589
|
+
* }
|
|
590
|
+
* ```
|
|
591
|
+
*/
|
|
592
|
+
content?: ContentConfig;
|
|
331
593
|
}
|
|
332
594
|
|
|
333
|
-
export type { BlockFieldConfig as B,
|
|
595
|
+
export type { BlockFieldConfig as B, ContentConfig as C, EntryConfig as E, FieldSelectOption as F, NavigationMenuConfig as N, PageConfig as P, RiverbankSiteConfig as R, SiteStyleConfig as S, SectionBackground as a, SectionOptionsConfig as b, ContainerOptionsConfig as c, SectionSpacing as d, ContainerMaxWidth as e, ContainerAlignment as f, SdkThemeConfig as g, SdkThemePalette as h, BlockFieldOptionsMap as i, BlockFieldExtension as j, BlockFieldExtensionsMap as k, ContentTypeConfig as l, BlockConfig as m, NavigationItemConfig as n, NavigationLinkType as o, SiteSettingsConfig as p };
|