@riverbankcms/sdk 0.2.1 → 0.3.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/client/client.d.mts +2 -2
- package/dist/client/client.d.ts +2 -2
- package/dist/client/client.js +18 -1
- package/dist/client/client.js.map +1 -1
- package/dist/client/client.mjs +18 -1
- 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 +83 -83
- package/dist/client/rendering/client.js.map +1 -1
- package/dist/client/rendering/client.mjs +83 -83
- package/dist/client/rendering/client.mjs.map +1 -1
- package/dist/client/usePage-CrKw1H6Y.d.ts +6338 -0
- package/dist/client/usePage-DMI8ImsU.d.mts +6338 -0
- package/dist/server/{Layout-CLg8oH_S.d.ts → Layout-BM_KmCxO.d.ts} +1 -1
- package/dist/server/{Layout-DK_9OOgb.d.mts → Layout-CsAQ-0Fv.d.mts} +1 -1
- package/dist/server/{chunk-3J46ILMJ.mjs → chunk-QFFQTOY3.mjs} +19 -2
- package/dist/server/chunk-QFFQTOY3.mjs.map +1 -0
- package/dist/server/{chunk-GKYNDDJS.js → chunk-UFVCBGBY.js} +19 -2
- package/dist/server/chunk-UFVCBGBY.js.map +1 -0
- package/dist/server/{components-BzdA6NAc.d.mts → components-CI3JiOYA.d.mts} +3 -3
- package/dist/server/{components-DhIcstww.d.ts → components-DJBLu_yc.d.ts} +3 -3
- package/dist/server/components.d.mts +5 -4
- package/dist/server/components.d.ts +5 -4
- package/dist/server/config-validation.d.mts +1 -1
- package/dist/server/config-validation.d.ts +1 -1
- package/dist/server/config.d.mts +2 -2
- package/dist/server/config.d.ts +2 -2
- package/dist/server/data.d.mts +2 -1
- package/dist/server/data.d.ts +2 -1
- package/dist/server/{index-C_FVup_o.d.mts → index-DoX3ELQn.d.mts} +1 -1
- package/dist/server/{index-BB28KAui.d.ts → index-Dus2gkY6.d.ts} +1 -1
- package/dist/server/index.d.mts +18 -4
- package/dist/server/index.d.ts +18 -4
- package/dist/server/index.js +2 -2
- package/dist/server/index.mjs +1 -1
- package/dist/server/{loadContent-AQOBf_gP.d.ts → loadContent-CdXDGsJM.d.ts} +3 -2
- package/dist/server/{loadContent-DBmprsB4.d.mts → loadContent-v2n6pOlO.d.mts} +3 -2
- package/dist/server/{loadPage-BMg8PJxJ.d.ts → loadPage-bejlajm9.d.ts} +2 -1
- package/dist/server/{loadPage-pg4HimlK.d.mts → loadPage-en10WQrt.d.mts} +2 -1
- package/dist/server/metadata.d.mts +4 -3
- package/dist/server/metadata.d.ts +4 -3
- package/dist/server/navigation.d.mts +100 -0
- package/dist/server/navigation.d.ts +100 -0
- package/dist/server/navigation.js +44 -0
- package/dist/server/navigation.js.map +1 -0
- package/dist/server/navigation.mjs +44 -0
- package/dist/server/navigation.mjs.map +1 -0
- package/dist/server/rendering/server.d.mts +4 -3
- package/dist/server/rendering/server.d.ts +4 -3
- package/dist/server/rendering.d.mts +7 -6
- package/dist/server/rendering.d.ts +7 -6
- package/dist/server/routing.d.mts +3 -2
- package/dist/server/routing.d.ts +3 -2
- package/dist/server/server.d.mts +5 -4
- package/dist/server/server.d.ts +5 -4
- package/dist/server/server.js +2 -2
- package/dist/server/server.mjs +1 -1
- package/dist/server/types-CLusapsM.d.mts +150 -0
- package/dist/server/{types-BprgZt-t.d.ts → types-Cc7lyPkN.d.ts} +41 -147
- package/dist/server/types-Ls6BkLKg.d.ts +150 -0
- package/dist/server/{types-C0G9IxWO.d.mts → types-nVerjjdv.d.mts} +41 -147
- package/package.json +22 -17
- package/dist/server/chunk-3J46ILMJ.mjs.map +0 -1
- package/dist/server/chunk-GKYNDDJS.js.map +0 -1
- package/dist/server/{types-_zWJTgv0.d.mts → types-Bq3520hK.d.mts} +2 -2
- package/dist/server/{types--u4GLCAY.d.ts → types-D-rqOU5I.d.ts} +2 -2
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { A as APIEndpoints } from './types-nVerjjdv.mjs';
|
|
2
|
+
|
|
3
|
+
type SiteResponse = NonNullable<APIEndpoints['getSite']['response']>;
|
|
4
|
+
type PageResponse = NonNullable<APIEndpoints['getContentByPath']['response']>;
|
|
5
|
+
type EntriesResponse = NonNullable<APIEndpoints['listPublishedEntries']['response']>;
|
|
6
|
+
type EntryResponse = NonNullable<APIEndpoints['getPublishedEntryPreview']['response']>;
|
|
7
|
+
type PublicFormResponse = NonNullable<APIEndpoints['getPublicFormById']['response']>;
|
|
8
|
+
type PublicBookingServicesResponse = NonNullable<APIEndpoints['getPublicBookingServices']['response']>;
|
|
9
|
+
type PublicEventsResponse = NonNullable<APIEndpoints['listPublicEvents']['response']>;
|
|
10
|
+
/**
|
|
11
|
+
* Configuration for creating a Riverbank CMS client
|
|
12
|
+
*/
|
|
13
|
+
interface RiverbankClientConfig {
|
|
14
|
+
/**
|
|
15
|
+
* API key for authentication (format: bld_live_... or bld_test_...)
|
|
16
|
+
*/
|
|
17
|
+
apiKey: string;
|
|
18
|
+
/**
|
|
19
|
+
* Base URL for the Riverbank CMS API (required; e.g. https://dashboard.example.com/api)
|
|
20
|
+
*/
|
|
21
|
+
baseUrl: string;
|
|
22
|
+
/**
|
|
23
|
+
* Cache configuration
|
|
24
|
+
*/
|
|
25
|
+
cache?: {
|
|
26
|
+
/**
|
|
27
|
+
* Enable caching (default: true)
|
|
28
|
+
*/
|
|
29
|
+
enabled?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Time-to-live for cached responses in seconds
|
|
32
|
+
* @default 300 (5 minutes)
|
|
33
|
+
*/
|
|
34
|
+
ttl?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Maximum number of cached responses
|
|
37
|
+
* @default 100
|
|
38
|
+
*/
|
|
39
|
+
maxSize?: number;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Riverbank CMS client interface
|
|
44
|
+
*/
|
|
45
|
+
interface RiverbankClient {
|
|
46
|
+
/**
|
|
47
|
+
* Fetch site data by slug, domain, or ID
|
|
48
|
+
*/
|
|
49
|
+
getSite(params: {
|
|
50
|
+
slug?: string;
|
|
51
|
+
domain?: string;
|
|
52
|
+
id?: string;
|
|
53
|
+
}): Promise<SiteResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* Fetch a specific page by path
|
|
56
|
+
*
|
|
57
|
+
* @param params.preview - If true, returns draft content instead of published content (requires API key with site access)
|
|
58
|
+
*/
|
|
59
|
+
getPage(params: {
|
|
60
|
+
siteId: string;
|
|
61
|
+
path: string;
|
|
62
|
+
preview?: boolean;
|
|
63
|
+
}): Promise<PageResponse>;
|
|
64
|
+
/**
|
|
65
|
+
* Fetch published content entries with optional pagination, sorting, and preview mode
|
|
66
|
+
*
|
|
67
|
+
* @param params.siteId - The site ID
|
|
68
|
+
* @param params.contentType - The content type key (e.g., 'blog-post', 'product')
|
|
69
|
+
* @param params.limit - Maximum number of entries to return
|
|
70
|
+
* @param params.order - Sort order: 'newest' (published_at desc) or 'oldest' (published_at asc)
|
|
71
|
+
* @param params.preview - If true, includes draft entries (requires API key with site access)
|
|
72
|
+
* @param params.mode - 'query' for automatic fetching, 'manual' for specific entry IDs
|
|
73
|
+
* @param params.entryIds - Array of entry IDs to fetch (only used when mode is 'manual')
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* // Fetch latest 10 blog posts
|
|
78
|
+
* const entries = await client.getEntries({
|
|
79
|
+
* siteId: 'site-id',
|
|
80
|
+
* contentType: 'blog-post',
|
|
81
|
+
* limit: 10,
|
|
82
|
+
* order: 'newest',
|
|
83
|
+
* });
|
|
84
|
+
*
|
|
85
|
+
* // Fetch draft entries for preview
|
|
86
|
+
* const drafts = await client.getEntries({
|
|
87
|
+
* siteId: 'site-id',
|
|
88
|
+
* contentType: 'blog-post',
|
|
89
|
+
* preview: true,
|
|
90
|
+
* });
|
|
91
|
+
*
|
|
92
|
+
* // Fetch specific entries by ID (manual mode)
|
|
93
|
+
* const specific = await client.getEntries({
|
|
94
|
+
* siteId: 'site-id',
|
|
95
|
+
* contentType: 'blog-post',
|
|
96
|
+
* mode: 'manual',
|
|
97
|
+
* entryIds: ['uuid-1', 'uuid-2'],
|
|
98
|
+
* });
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
getEntries(params: {
|
|
102
|
+
siteId: string;
|
|
103
|
+
contentType: string;
|
|
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[];
|
|
112
|
+
}): Promise<EntriesResponse>;
|
|
113
|
+
/**
|
|
114
|
+
* Fetch a specific content entry by slug
|
|
115
|
+
*/
|
|
116
|
+
getEntry(params: {
|
|
117
|
+
siteId: string;
|
|
118
|
+
contentType: string;
|
|
119
|
+
slug: string;
|
|
120
|
+
}): Promise<EntryResponse>;
|
|
121
|
+
/**
|
|
122
|
+
* Fetch a public form definition by ID
|
|
123
|
+
*/
|
|
124
|
+
getPublicFormById(params: {
|
|
125
|
+
formId: string;
|
|
126
|
+
}): Promise<PublicFormResponse>;
|
|
127
|
+
/**
|
|
128
|
+
* Fetch public booking services for a site
|
|
129
|
+
*/
|
|
130
|
+
getPublicBookingServices(params: {
|
|
131
|
+
siteId: string;
|
|
132
|
+
ids?: string;
|
|
133
|
+
}): Promise<PublicBookingServicesResponse>;
|
|
134
|
+
/**
|
|
135
|
+
* List public events for a site (optionally time-filtered)
|
|
136
|
+
*/
|
|
137
|
+
listPublicEvents(params: {
|
|
138
|
+
siteId: string;
|
|
139
|
+
limit?: number;
|
|
140
|
+
from?: string;
|
|
141
|
+
to?: string;
|
|
142
|
+
stage?: string;
|
|
143
|
+
}): Promise<PublicEventsResponse>;
|
|
144
|
+
/**
|
|
145
|
+
* Force clear the cache
|
|
146
|
+
*/
|
|
147
|
+
clearCache(): void;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export type { EntriesResponse as E, PageResponse as P, RiverbankClient as R, SiteResponse as S, RiverbankClientConfig as a, EntryResponse as b };
|
|
@@ -3491,6 +3491,8 @@ type APIEndpoints = {
|
|
|
3491
3491
|
importSiteBackup: APIEndpoint<FormData, {
|
|
3492
3492
|
siteId: string;
|
|
3493
3493
|
}, BackupImportResponse>;
|
|
3494
|
+
previewBackup: APIEndpoint<FormData, never, BackupPreviewResponse>;
|
|
3495
|
+
importBackupAsNewSite: APIEndpoint<FormData, never, ImportBackupAsNewSiteResponse>;
|
|
3494
3496
|
};
|
|
3495
3497
|
type APICallParams<E extends keyof APIEndpoints> = APIEndpoints[E] extends {
|
|
3496
3498
|
method: 'GET';
|
|
@@ -3998,152 +4000,44 @@ type BackupImportResponse = {
|
|
|
3998
4000
|
code?: string;
|
|
3999
4001
|
details?: unknown;
|
|
4000
4002
|
};
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
type EntriesResponse = NonNullable<APIEndpoints['listPublishedEntries']['response']>;
|
|
4005
|
-
type EntryResponse = NonNullable<APIEndpoints['getPublishedEntryPreview']['response']>;
|
|
4006
|
-
type PublicFormResponse = NonNullable<APIEndpoints['getPublicFormById']['response']>;
|
|
4007
|
-
type PublicBookingServicesResponse = NonNullable<APIEndpoints['getPublicBookingServices']['response']>;
|
|
4008
|
-
type PublicEventsResponse = NonNullable<APIEndpoints['listPublicEvents']['response']>;
|
|
4009
|
-
/**
|
|
4010
|
-
* Configuration for creating a Riverbank CMS client
|
|
4011
|
-
*/
|
|
4012
|
-
interface RiverbankClientConfig {
|
|
4013
|
-
/**
|
|
4014
|
-
* API key for authentication (format: bld_live_... or bld_test_...)
|
|
4015
|
-
*/
|
|
4016
|
-
apiKey: string;
|
|
4017
|
-
/**
|
|
4018
|
-
* Base URL for the Riverbank CMS API (required; e.g. https://dashboard.example.com/api)
|
|
4019
|
-
*/
|
|
4020
|
-
baseUrl: string;
|
|
4021
|
-
/**
|
|
4022
|
-
* Cache configuration
|
|
4023
|
-
*/
|
|
4024
|
-
cache?: {
|
|
4025
|
-
/**
|
|
4026
|
-
* Enable caching (default: true)
|
|
4027
|
-
*/
|
|
4028
|
-
enabled?: boolean;
|
|
4029
|
-
/**
|
|
4030
|
-
* Time-to-live for cached responses in seconds
|
|
4031
|
-
* @default 300 (5 minutes)
|
|
4032
|
-
*/
|
|
4033
|
-
ttl?: number;
|
|
4034
|
-
/**
|
|
4035
|
-
* Maximum number of cached responses
|
|
4036
|
-
* @default 100
|
|
4037
|
-
*/
|
|
4038
|
-
maxSize?: number;
|
|
4039
|
-
};
|
|
4040
|
-
}
|
|
4041
|
-
/**
|
|
4042
|
-
* Riverbank CMS client interface
|
|
4043
|
-
*/
|
|
4044
|
-
interface RiverbankClient {
|
|
4045
|
-
/**
|
|
4046
|
-
* Fetch site data by slug, domain, or ID
|
|
4047
|
-
*/
|
|
4048
|
-
getSite(params: {
|
|
4049
|
-
slug?: string;
|
|
4050
|
-
domain?: string;
|
|
4051
|
-
id?: string;
|
|
4052
|
-
}): Promise<SiteResponse>;
|
|
4053
|
-
/**
|
|
4054
|
-
* Fetch a specific page by path
|
|
4055
|
-
*
|
|
4056
|
-
* @param params.preview - If true, returns draft content instead of published content (requires API key with site access)
|
|
4057
|
-
*/
|
|
4058
|
-
getPage(params: {
|
|
4059
|
-
siteId: string;
|
|
4060
|
-
path: string;
|
|
4061
|
-
preview?: boolean;
|
|
4062
|
-
}): Promise<PageResponse>;
|
|
4063
|
-
/**
|
|
4064
|
-
* Fetch published content entries with optional pagination, sorting, and preview mode
|
|
4065
|
-
*
|
|
4066
|
-
* @param params.siteId - The site ID
|
|
4067
|
-
* @param params.contentType - The content type key (e.g., 'blog-post', 'product')
|
|
4068
|
-
* @param params.limit - Maximum number of entries to return
|
|
4069
|
-
* @param params.order - Sort order: 'newest' (published_at desc) or 'oldest' (published_at asc)
|
|
4070
|
-
* @param params.preview - If true, includes draft entries (requires API key with site access)
|
|
4071
|
-
* @param params.mode - 'query' for automatic fetching, 'manual' for specific entry IDs
|
|
4072
|
-
* @param params.entryIds - Array of entry IDs to fetch (only used when mode is 'manual')
|
|
4073
|
-
*
|
|
4074
|
-
* @example
|
|
4075
|
-
* ```ts
|
|
4076
|
-
* // Fetch latest 10 blog posts
|
|
4077
|
-
* const entries = await client.getEntries({
|
|
4078
|
-
* siteId: 'site-id',
|
|
4079
|
-
* contentType: 'blog-post',
|
|
4080
|
-
* limit: 10,
|
|
4081
|
-
* order: 'newest',
|
|
4082
|
-
* });
|
|
4083
|
-
*
|
|
4084
|
-
* // Fetch draft entries for preview
|
|
4085
|
-
* const drafts = await client.getEntries({
|
|
4086
|
-
* siteId: 'site-id',
|
|
4087
|
-
* contentType: 'blog-post',
|
|
4088
|
-
* preview: true,
|
|
4089
|
-
* });
|
|
4090
|
-
*
|
|
4091
|
-
* // Fetch specific entries by ID (manual mode)
|
|
4092
|
-
* const specific = await client.getEntries({
|
|
4093
|
-
* siteId: 'site-id',
|
|
4094
|
-
* contentType: 'blog-post',
|
|
4095
|
-
* mode: 'manual',
|
|
4096
|
-
* entryIds: ['uuid-1', 'uuid-2'],
|
|
4097
|
-
* });
|
|
4098
|
-
* ```
|
|
4099
|
-
*/
|
|
4100
|
-
getEntries(params: {
|
|
4101
|
-
siteId: string;
|
|
4102
|
-
contentType: string;
|
|
4103
|
-
limit?: number;
|
|
4104
|
-
/** Sort order for entries. 'order' uses custom ordering (default behavior). */
|
|
4105
|
-
order?: 'newest' | 'oldest' | 'title' | 'order';
|
|
4106
|
-
preview?: boolean;
|
|
4107
|
-
/** Selection mode: 'query' for automatic, 'manual' for specific entry IDs */
|
|
4108
|
-
mode?: 'query' | 'manual';
|
|
4109
|
-
/** Entry IDs to fetch when mode is 'manual' */
|
|
4110
|
-
entryIds?: string[];
|
|
4111
|
-
}): Promise<EntriesResponse>;
|
|
4112
|
-
/**
|
|
4113
|
-
* Fetch a specific content entry by slug
|
|
4114
|
-
*/
|
|
4115
|
-
getEntry(params: {
|
|
4116
|
-
siteId: string;
|
|
4117
|
-
contentType: string;
|
|
4118
|
-
slug: string;
|
|
4119
|
-
}): Promise<EntryResponse>;
|
|
4120
|
-
/**
|
|
4121
|
-
* Fetch a public form definition by ID
|
|
4122
|
-
*/
|
|
4123
|
-
getPublicFormById(params: {
|
|
4124
|
-
formId: string;
|
|
4125
|
-
}): Promise<PublicFormResponse>;
|
|
4126
|
-
/**
|
|
4127
|
-
* Fetch public booking services for a site
|
|
4128
|
-
*/
|
|
4129
|
-
getPublicBookingServices(params: {
|
|
4130
|
-
siteId: string;
|
|
4131
|
-
ids?: string;
|
|
4132
|
-
}): Promise<PublicBookingServicesResponse>;
|
|
4133
|
-
/**
|
|
4134
|
-
* List public events for a site (optionally time-filtered)
|
|
4135
|
-
*/
|
|
4136
|
-
listPublicEvents(params: {
|
|
4003
|
+
type BackupPreviewResponse = {
|
|
4004
|
+
ok: boolean;
|
|
4005
|
+
manifest?: {
|
|
4137
4006
|
siteId: string;
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4007
|
+
siteSlug: string;
|
|
4008
|
+
siteTitle: string;
|
|
4009
|
+
exportedAt: string;
|
|
4010
|
+
tableCount: number;
|
|
4011
|
+
totalRecords: number;
|
|
4012
|
+
pageCount: number;
|
|
4013
|
+
blockCount: number;
|
|
4014
|
+
contentEntryCount: number;
|
|
4015
|
+
formCount: number;
|
|
4016
|
+
navigationMenuCount: number;
|
|
4017
|
+
mediaCount: number;
|
|
4018
|
+
mediaBytes: number;
|
|
4019
|
+
};
|
|
4020
|
+
error?: string;
|
|
4021
|
+
code?: string;
|
|
4022
|
+
};
|
|
4023
|
+
type ImportBackupAsNewSiteResponse = {
|
|
4024
|
+
ok: boolean;
|
|
4025
|
+
siteId?: string;
|
|
4026
|
+
slug?: string;
|
|
4027
|
+
title?: string;
|
|
4028
|
+
counts?: Record<string, {
|
|
4029
|
+
created: number;
|
|
4030
|
+
updated: number;
|
|
4031
|
+
failed: number;
|
|
4032
|
+
}>;
|
|
4033
|
+
warnings?: string[];
|
|
4034
|
+
errors?: Array<{
|
|
4035
|
+
table: string;
|
|
4036
|
+
id: string;
|
|
4037
|
+
error: string;
|
|
4038
|
+
}>;
|
|
4039
|
+
error?: string;
|
|
4040
|
+
code?: string;
|
|
4041
|
+
};
|
|
4148
4042
|
|
|
4149
|
-
export type { APIEndpoints as A, CustomLinkValue as C,
|
|
4043
|
+
export type { APIEndpoints as A, CustomLinkValue as C, ExternalLinkValue as E, HydratedTheme as H, InternalLinkValue as I, LinkPayload as L, NavigationMenuWithItems as N, SiteHeaderContent as S, Theme as T, NavigationItemRecord as a, APICallParams as b, SiteFooterContent as c, LinkValue as d, ExpandedPalette as e };
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { A as APIEndpoints } from './types-Cc7lyPkN.js';
|
|
2
|
+
|
|
3
|
+
type SiteResponse = NonNullable<APIEndpoints['getSite']['response']>;
|
|
4
|
+
type PageResponse = NonNullable<APIEndpoints['getContentByPath']['response']>;
|
|
5
|
+
type EntriesResponse = NonNullable<APIEndpoints['listPublishedEntries']['response']>;
|
|
6
|
+
type EntryResponse = NonNullable<APIEndpoints['getPublishedEntryPreview']['response']>;
|
|
7
|
+
type PublicFormResponse = NonNullable<APIEndpoints['getPublicFormById']['response']>;
|
|
8
|
+
type PublicBookingServicesResponse = NonNullable<APIEndpoints['getPublicBookingServices']['response']>;
|
|
9
|
+
type PublicEventsResponse = NonNullable<APIEndpoints['listPublicEvents']['response']>;
|
|
10
|
+
/**
|
|
11
|
+
* Configuration for creating a Riverbank CMS client
|
|
12
|
+
*/
|
|
13
|
+
interface RiverbankClientConfig {
|
|
14
|
+
/**
|
|
15
|
+
* API key for authentication (format: bld_live_... or bld_test_...)
|
|
16
|
+
*/
|
|
17
|
+
apiKey: string;
|
|
18
|
+
/**
|
|
19
|
+
* Base URL for the Riverbank CMS API (required; e.g. https://dashboard.example.com/api)
|
|
20
|
+
*/
|
|
21
|
+
baseUrl: string;
|
|
22
|
+
/**
|
|
23
|
+
* Cache configuration
|
|
24
|
+
*/
|
|
25
|
+
cache?: {
|
|
26
|
+
/**
|
|
27
|
+
* Enable caching (default: true)
|
|
28
|
+
*/
|
|
29
|
+
enabled?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Time-to-live for cached responses in seconds
|
|
32
|
+
* @default 300 (5 minutes)
|
|
33
|
+
*/
|
|
34
|
+
ttl?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Maximum number of cached responses
|
|
37
|
+
* @default 100
|
|
38
|
+
*/
|
|
39
|
+
maxSize?: number;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Riverbank CMS client interface
|
|
44
|
+
*/
|
|
45
|
+
interface RiverbankClient {
|
|
46
|
+
/**
|
|
47
|
+
* Fetch site data by slug, domain, or ID
|
|
48
|
+
*/
|
|
49
|
+
getSite(params: {
|
|
50
|
+
slug?: string;
|
|
51
|
+
domain?: string;
|
|
52
|
+
id?: string;
|
|
53
|
+
}): Promise<SiteResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* Fetch a specific page by path
|
|
56
|
+
*
|
|
57
|
+
* @param params.preview - If true, returns draft content instead of published content (requires API key with site access)
|
|
58
|
+
*/
|
|
59
|
+
getPage(params: {
|
|
60
|
+
siteId: string;
|
|
61
|
+
path: string;
|
|
62
|
+
preview?: boolean;
|
|
63
|
+
}): Promise<PageResponse>;
|
|
64
|
+
/**
|
|
65
|
+
* Fetch published content entries with optional pagination, sorting, and preview mode
|
|
66
|
+
*
|
|
67
|
+
* @param params.siteId - The site ID
|
|
68
|
+
* @param params.contentType - The content type key (e.g., 'blog-post', 'product')
|
|
69
|
+
* @param params.limit - Maximum number of entries to return
|
|
70
|
+
* @param params.order - Sort order: 'newest' (published_at desc) or 'oldest' (published_at asc)
|
|
71
|
+
* @param params.preview - If true, includes draft entries (requires API key with site access)
|
|
72
|
+
* @param params.mode - 'query' for automatic fetching, 'manual' for specific entry IDs
|
|
73
|
+
* @param params.entryIds - Array of entry IDs to fetch (only used when mode is 'manual')
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* // Fetch latest 10 blog posts
|
|
78
|
+
* const entries = await client.getEntries({
|
|
79
|
+
* siteId: 'site-id',
|
|
80
|
+
* contentType: 'blog-post',
|
|
81
|
+
* limit: 10,
|
|
82
|
+
* order: 'newest',
|
|
83
|
+
* });
|
|
84
|
+
*
|
|
85
|
+
* // Fetch draft entries for preview
|
|
86
|
+
* const drafts = await client.getEntries({
|
|
87
|
+
* siteId: 'site-id',
|
|
88
|
+
* contentType: 'blog-post',
|
|
89
|
+
* preview: true,
|
|
90
|
+
* });
|
|
91
|
+
*
|
|
92
|
+
* // Fetch specific entries by ID (manual mode)
|
|
93
|
+
* const specific = await client.getEntries({
|
|
94
|
+
* siteId: 'site-id',
|
|
95
|
+
* contentType: 'blog-post',
|
|
96
|
+
* mode: 'manual',
|
|
97
|
+
* entryIds: ['uuid-1', 'uuid-2'],
|
|
98
|
+
* });
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
getEntries(params: {
|
|
102
|
+
siteId: string;
|
|
103
|
+
contentType: string;
|
|
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[];
|
|
112
|
+
}): Promise<EntriesResponse>;
|
|
113
|
+
/**
|
|
114
|
+
* Fetch a specific content entry by slug
|
|
115
|
+
*/
|
|
116
|
+
getEntry(params: {
|
|
117
|
+
siteId: string;
|
|
118
|
+
contentType: string;
|
|
119
|
+
slug: string;
|
|
120
|
+
}): Promise<EntryResponse>;
|
|
121
|
+
/**
|
|
122
|
+
* Fetch a public form definition by ID
|
|
123
|
+
*/
|
|
124
|
+
getPublicFormById(params: {
|
|
125
|
+
formId: string;
|
|
126
|
+
}): Promise<PublicFormResponse>;
|
|
127
|
+
/**
|
|
128
|
+
* Fetch public booking services for a site
|
|
129
|
+
*/
|
|
130
|
+
getPublicBookingServices(params: {
|
|
131
|
+
siteId: string;
|
|
132
|
+
ids?: string;
|
|
133
|
+
}): Promise<PublicBookingServicesResponse>;
|
|
134
|
+
/**
|
|
135
|
+
* List public events for a site (optionally time-filtered)
|
|
136
|
+
*/
|
|
137
|
+
listPublicEvents(params: {
|
|
138
|
+
siteId: string;
|
|
139
|
+
limit?: number;
|
|
140
|
+
from?: string;
|
|
141
|
+
to?: string;
|
|
142
|
+
stage?: string;
|
|
143
|
+
}): Promise<PublicEventsResponse>;
|
|
144
|
+
/**
|
|
145
|
+
* Force clear the cache
|
|
146
|
+
*/
|
|
147
|
+
clearCache(): void;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export type { EntriesResponse as E, PageResponse as P, RiverbankClient as R, SiteResponse as S, RiverbankClientConfig as a, EntryResponse as b };
|