@riverbankcms/sdk 0.7.5 → 0.8.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 +88 -1
- package/dist/cli/index.js +3693 -39
- package/dist/cli/index.js.map +1 -1
- package/dist/client/client.d.mts +2 -2
- package/dist/client/client.d.ts +2 -2
- package/dist/client/client.js +105 -2
- package/dist/client/client.js.map +1 -1
- package/dist/client/client.mjs +105 -2
- 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/usePage-CdnO2CP5.d.mts +6875 -0
- package/dist/client/usePage-_ksKXlUF.d.ts +6875 -0
- package/dist/server/{Layout-qWLdVm5-.d.mts → Layout-D4J009eS.d.mts} +1 -1
- package/dist/server/{Layout-Yluyb6sK.d.ts → Layout-l2v4Qa6E.d.ts} +1 -1
- package/dist/server/{chunk-2NBNOY3C.mjs → chunk-65A5HAUZ.mjs} +106 -3
- package/dist/server/chunk-65A5HAUZ.mjs.map +1 -0
- package/dist/server/{chunk-KH3EXBJM.js → chunk-WM646WI3.js} +106 -3
- package/dist/server/chunk-WM646WI3.js.map +1 -0
- package/dist/server/{components-Di5ME6He.d.ts → components-D2uCKCj7.d.ts} +3 -3
- package/dist/server/{components-DNHfSCML.d.mts → components-vtYEmmPF.d.mts} +3 -3
- package/dist/server/components.d.mts +5 -5
- package/dist/server/components.d.ts +5 -5
- package/dist/server/config-validation.d.mts +2 -2
- package/dist/server/config-validation.d.ts +2 -2
- package/dist/server/config.d.mts +3 -3
- package/dist/server/config.d.ts +3 -3
- package/dist/server/data.d.mts +2 -2
- package/dist/server/data.d.ts +2 -2
- package/dist/server/{index-Clm3skz_.d.mts → index-2qnY7VH_.d.mts} +1 -1
- package/dist/server/{index-DLvNddi-.d.ts → index-BxrAuL9K.d.ts} +1 -1
- package/dist/server/{index-C9Ra8dza.d.ts → index-CH_dvF6n.d.ts} +2 -2
- package/dist/server/{index--Oyunk_B.d.mts → index-DfWg1Qle.d.mts} +2 -2
- package/dist/server/index.d.mts +13 -5
- package/dist/server/index.d.ts +13 -5
- package/dist/server/index.js +10 -10
- package/dist/server/index.mjs +1 -1
- package/dist/server/{loadContent-D7LQwI0o.d.ts → loadContent-DECnsp4k.d.ts} +3 -3
- package/dist/server/{loadContent-DVfuBLiZ.d.mts → loadContent-Du5kS8UM.d.mts} +3 -3
- package/dist/server/{loadPage-BmYJCe_V.d.ts → loadPage-BZohBxxf.d.ts} +2 -2
- package/dist/server/{loadPage-BucnLHmE.d.mts → loadPage-VBorKlWv.d.mts} +2 -2
- package/dist/server/metadata.d.mts +4 -4
- package/dist/server/metadata.d.ts +4 -4
- package/dist/server/navigation.d.mts +2 -2
- package/dist/server/navigation.d.ts +2 -2
- package/dist/server/next.d.mts +38 -7
- package/dist/server/next.d.ts +38 -7
- package/dist/server/next.js +29 -11
- package/dist/server/next.js.map +1 -1
- package/dist/server/next.mjs +29 -11
- package/dist/server/next.mjs.map +1 -1
- package/dist/server/rendering/server.d.mts +4 -4
- package/dist/server/rendering/server.d.ts +4 -4
- package/dist/server/rendering.d.mts +7 -7
- package/dist/server/rendering.d.ts +7 -7
- package/dist/server/routing.d.mts +4 -4
- package/dist/server/routing.d.ts +4 -4
- package/dist/server/server.d.mts +5 -5
- package/dist/server/server.d.ts +5 -5
- package/dist/server/server.js +2 -2
- package/dist/server/server.mjs +1 -1
- package/dist/server/{types-C-LShyIg.d.mts → types-BRQ_6yOc.d.mts} +43 -1
- package/dist/server/{types-BjgZt8xJ.d.mts → types-CJfJwcuL.d.mts} +37 -0
- package/dist/server/{types-Dt98DeYa.d.ts → types-CgSO0yxg.d.ts} +8 -0
- package/dist/server/{types-BRQyLrQU.d.ts → types-D0rPF8l5.d.ts} +43 -1
- package/dist/server/{types-DLBhEPSt.d.ts → types-D8XqwoVd.d.ts} +37 -0
- package/dist/server/{types-BSV6Vc-P.d.mts → types-DT30Qy7x.d.mts} +8 -0
- package/dist/server/{validation-DU2YE7u5.d.ts → validation-D1LaY1kQ.d.ts} +1 -1
- package/dist/server/{validation-BGuRo8P1.d.mts → validation-Pv3Zs6dP.d.mts} +1 -1
- package/package.json +2 -1
- package/dist/server/chunk-2NBNOY3C.mjs.map +0 -1
- package/dist/server/chunk-KH3EXBJM.js.map +0 -1
package/dist/server/data.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { P as PageOutline, S as SdkCustomBlock } from './schema-Z6-afHJG.js';
|
|
2
2
|
import { P as PrefetchContext, R as ResolvedBlockData, D as DataLoaderOverrides } from './types-DuQCNVV0.js';
|
|
3
3
|
export { B as BlockLoaderMap, a as DataLoaderContext, b as DataLoaderFn } from './types-DuQCNVV0.js';
|
|
4
|
-
import { R as RiverbankClient } from './types-
|
|
4
|
+
import { R as RiverbankClient } from './types-D0rPF8l5.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import './blockKinds-B6MWzNWp.js';
|
|
7
|
-
import './types-
|
|
7
|
+
import './types-CgSO0yxg.js';
|
|
8
8
|
import '@riverbankcms/ai';
|
|
9
9
|
import './link-DjxLyC82.js';
|
|
10
10
|
import '@riverbankcms/media-storage-supabase';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as LoadPageResult } from './loadPage-
|
|
2
|
-
import { S as SiteResponse } from './types-
|
|
1
|
+
import { a as LoadPageResult } from './loadPage-BZohBxxf.js';
|
|
2
|
+
import { S as SiteResponse } from './types-D0rPF8l5.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Metadata generation helper for Next.js pages
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as LoadPageResult } from './loadPage-
|
|
2
|
-
import { S as SiteResponse } from './types-
|
|
1
|
+
import { a as LoadPageResult } from './loadPage-VBorKlWv.mjs';
|
|
2
|
+
import { S as SiteResponse } from './types-BRQ_6yOc.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Metadata generation helper for Next.js pages
|
package/dist/server/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { c as createRiverbankClient } from './index-
|
|
2
|
-
import { R as RiverbankClient, S as SiteResponse, P as PageResponse, G as GetEntriesBaseParams, E as EntriesResponse, d as EntriesResponseWithMeta } from './types-
|
|
3
|
-
export { j as CircuitBreakerConfig, C as CircuitState, b as EntryResponse, e as PaginationMeta, f as ResilienceConfig, h as ResilienceSource, g as ResilienceStatus, i as RetryConfig, a as RiverbankClientConfig } from './types-
|
|
4
|
-
import { A as APIEndpoints, b as APICallParams, a as NavigationItemRecord } from './types-
|
|
1
|
+
export { c as createRiverbankClient } from './index-2qnY7VH_.mjs';
|
|
2
|
+
import { R as RiverbankClient, S as SiteResponse, P as PageResponse, G as GetEntriesBaseParams, E as EntriesResponse, d as EntriesResponseWithMeta } from './types-BRQ_6yOc.mjs';
|
|
3
|
+
export { j as CircuitBreakerConfig, C as CircuitState, b as EntryResponse, e as PaginationMeta, f as ResilienceConfig, h as ResilienceSource, g as ResilienceStatus, i as RetryConfig, a as RiverbankClientConfig } from './types-BRQ_6yOc.mjs';
|
|
4
|
+
import { A as APIEndpoints, b as APICallParams, a as NavigationItemRecord } from './types-DT30Qy7x.mjs';
|
|
5
5
|
import './schema-Z6-afHJG.mjs';
|
|
6
|
-
export { g as ContainerAlignment, f as ContainerMaxWidth, d as ContainerOptionsConfig, R as RiverbankSiteConfig, b as SectionBackground, c as SectionOptionsConfig, e as SectionSpacing, S as SiteStyleConfig } from './types-
|
|
6
|
+
export { g as ContainerAlignment, f as ContainerMaxWidth, d as ContainerOptionsConfig, R as RiverbankSiteConfig, b as SectionBackground, c as SectionOptionsConfig, e as SectionSpacing, S as SiteStyleConfig } from './types-CJfJwcuL.mjs';
|
|
7
7
|
export { B as BlockKind, C as CustomBlockKind, S as SYSTEM_BLOCK_KINDS, a as SystemBlockKind } from './blockKinds-B6MWzNWp.mjs';
|
|
8
8
|
import '@riverbankcms/ai';
|
|
9
9
|
import 'zod';
|
|
@@ -1068,6 +1068,14 @@ declare const API_ENDPOINTS: {
|
|
|
1068
1068
|
readonly auth: "user";
|
|
1069
1069
|
readonly responseKind: "json";
|
|
1070
1070
|
};
|
|
1071
|
+
readonly getPublicRoutableContent: {
|
|
1072
|
+
readonly path: "/public/sites/{siteId}/routable-content";
|
|
1073
|
+
readonly method: "GET";
|
|
1074
|
+
readonly revalidate: 60;
|
|
1075
|
+
readonly tags: ["site-{siteId}", "routable-content-{siteId}"];
|
|
1076
|
+
readonly auth: "public";
|
|
1077
|
+
readonly responseKind: "json";
|
|
1078
|
+
};
|
|
1071
1079
|
readonly getPublishedEntryPreview: {
|
|
1072
1080
|
readonly path: "/public/content/{siteId}/{type}/{slug}/preview";
|
|
1073
1081
|
readonly method: "GET";
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { c as createRiverbankClient } from './index-
|
|
2
|
-
import { R as RiverbankClient, S as SiteResponse, P as PageResponse, G as GetEntriesBaseParams, E as EntriesResponse, d as EntriesResponseWithMeta } from './types-
|
|
3
|
-
export { j as CircuitBreakerConfig, C as CircuitState, b as EntryResponse, e as PaginationMeta, f as ResilienceConfig, h as ResilienceSource, g as ResilienceStatus, i as RetryConfig, a as RiverbankClientConfig } from './types-
|
|
4
|
-
import { A as APIEndpoints, b as APICallParams, a as NavigationItemRecord } from './types-
|
|
1
|
+
export { c as createRiverbankClient } from './index-BxrAuL9K.js';
|
|
2
|
+
import { R as RiverbankClient, S as SiteResponse, P as PageResponse, G as GetEntriesBaseParams, E as EntriesResponse, d as EntriesResponseWithMeta } from './types-D0rPF8l5.js';
|
|
3
|
+
export { j as CircuitBreakerConfig, C as CircuitState, b as EntryResponse, e as PaginationMeta, f as ResilienceConfig, h as ResilienceSource, g as ResilienceStatus, i as RetryConfig, a as RiverbankClientConfig } from './types-D0rPF8l5.js';
|
|
4
|
+
import { A as APIEndpoints, b as APICallParams, a as NavigationItemRecord } from './types-CgSO0yxg.js';
|
|
5
5
|
import './schema-Z6-afHJG.js';
|
|
6
|
-
export { g as ContainerAlignment, f as ContainerMaxWidth, d as ContainerOptionsConfig, R as RiverbankSiteConfig, b as SectionBackground, c as SectionOptionsConfig, e as SectionSpacing, S as SiteStyleConfig } from './types-
|
|
6
|
+
export { g as ContainerAlignment, f as ContainerMaxWidth, d as ContainerOptionsConfig, R as RiverbankSiteConfig, b as SectionBackground, c as SectionOptionsConfig, e as SectionSpacing, S as SiteStyleConfig } from './types-D8XqwoVd.js';
|
|
7
7
|
export { B as BlockKind, C as CustomBlockKind, S as SYSTEM_BLOCK_KINDS, a as SystemBlockKind } from './blockKinds-B6MWzNWp.js';
|
|
8
8
|
import '@riverbankcms/ai';
|
|
9
9
|
import 'zod';
|
|
@@ -1068,6 +1068,14 @@ declare const API_ENDPOINTS: {
|
|
|
1068
1068
|
readonly auth: "user";
|
|
1069
1069
|
readonly responseKind: "json";
|
|
1070
1070
|
};
|
|
1071
|
+
readonly getPublicRoutableContent: {
|
|
1072
|
+
readonly path: "/public/sites/{siteId}/routable-content";
|
|
1073
|
+
readonly method: "GET";
|
|
1074
|
+
readonly revalidate: 60;
|
|
1075
|
+
readonly tags: ["site-{siteId}", "routable-content-{siteId}"];
|
|
1076
|
+
readonly auth: "public";
|
|
1077
|
+
readonly responseKind: "json";
|
|
1078
|
+
};
|
|
1071
1079
|
readonly getPublishedEntryPreview: {
|
|
1072
1080
|
readonly path: "/public/content/{siteId}/{type}/{slug}/preview";
|
|
1073
1081
|
readonly method: "GET";
|
package/dist/server/index.js
CHANGED
|
@@ -13,14 +13,14 @@ var _chunkGERCMTPQjs = require('./chunk-GERCMTPQ.js');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkWM646WI3js = require('./chunk-WM646WI3.js');
|
|
17
17
|
require('./chunk-4CV4JOE5.js');
|
|
18
18
|
|
|
19
19
|
// src/prebuild/index.ts
|
|
20
20
|
var _fs = require('fs'); var fs = _interopRequireWildcard(_fs);
|
|
21
21
|
var _path = require('path'); var path = _interopRequireWildcard(_path);
|
|
22
22
|
var _crypto = require('crypto'); var crypto = _interopRequireWildcard(_crypto);
|
|
23
|
-
|
|
23
|
+
_chunkWM646WI3js.init_constants.call(void 0, );
|
|
24
24
|
var MANIFEST_VERSION = "1.0.0";
|
|
25
25
|
var MANIFEST_FILENAME = "manifest.json";
|
|
26
26
|
function pathToFilename(routePath) {
|
|
@@ -47,18 +47,18 @@ async function fetchAllEntries(client, siteId, contentType, onProgress) {
|
|
|
47
47
|
let offset = 0;
|
|
48
48
|
let hasMore = true;
|
|
49
49
|
while (hasMore) {
|
|
50
|
-
_optionalChain([onProgress, 'optionalCall', _2 => _2(`${contentType} (batch ${Math.floor(offset /
|
|
50
|
+
_optionalChain([onProgress, 'optionalCall', _2 => _2(`${contentType} (batch ${Math.floor(offset / _chunkWM646WI3js.PREBUILD_PAGE_SIZE) + 1})`)]);
|
|
51
51
|
const response = await client.getEntries({
|
|
52
52
|
siteId,
|
|
53
53
|
contentType,
|
|
54
|
-
limit:
|
|
54
|
+
limit: _chunkWM646WI3js.PREBUILD_PAGE_SIZE,
|
|
55
55
|
offset,
|
|
56
56
|
preview: false
|
|
57
57
|
// Published content only
|
|
58
58
|
});
|
|
59
59
|
allEntries.push(...response.entries);
|
|
60
|
-
offset +=
|
|
61
|
-
hasMore = response.entries.length ===
|
|
60
|
+
offset += _chunkWM646WI3js.PREBUILD_PAGE_SIZE;
|
|
61
|
+
hasMore = response.entries.length === _chunkWM646WI3js.PREBUILD_PAGE_SIZE;
|
|
62
62
|
}
|
|
63
63
|
return allEntries;
|
|
64
64
|
}
|
|
@@ -190,7 +190,7 @@ async function prebuildCache(options) {
|
|
|
190
190
|
const {
|
|
191
191
|
client,
|
|
192
192
|
siteId,
|
|
193
|
-
outputDir =
|
|
193
|
+
outputDir = _chunkWM646WI3js.DEFAULT_PREBUILD_DIR,
|
|
194
194
|
include = ["site", "pages", "entries", "navigation"],
|
|
195
195
|
contentTypes,
|
|
196
196
|
onProgress
|
|
@@ -277,7 +277,7 @@ async function prebuildCache(options) {
|
|
|
277
277
|
version: MANIFEST_VERSION,
|
|
278
278
|
generatedAt,
|
|
279
279
|
siteId,
|
|
280
|
-
sdkVersion:
|
|
280
|
+
sdkVersion: _chunkWM646WI3js.SDK_VERSION,
|
|
281
281
|
keyToFile,
|
|
282
282
|
includedTypes: include,
|
|
283
283
|
fileCount: files.length,
|
|
@@ -299,7 +299,7 @@ async function prebuildCache(options) {
|
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
// src/index.ts
|
|
302
|
-
|
|
302
|
+
_chunkWM646WI3js.init_loader.call(void 0, );
|
|
303
303
|
|
|
304
304
|
// ../api/src/aiPlayground.ts
|
|
305
305
|
var _zod = require('zod');
|
|
@@ -398,5 +398,5 @@ var MultiPageUpdateResponse = _zod.z.object({
|
|
|
398
398
|
|
|
399
399
|
|
|
400
400
|
|
|
401
|
-
exports.API_ENDPOINTS =
|
|
401
|
+
exports.API_ENDPOINTS = _chunkWM646WI3js.API_ENDPOINTS; exports.PrebuildLoader = _chunkWM646WI3js.PrebuildLoader; exports.SYSTEM_BLOCK_KINDS = _chunkGERCMTPQjs.SYSTEM_BLOCK_KINDS; exports.buildEndpointURL = _chunkWM646WI3js.buildEndpointURL; exports.canUsePrebuild = _chunkWM646WI3js.canUsePrebuild; exports.createPrebuildLoader = _chunkWM646WI3js.createPrebuildLoader; exports.createRiverbankClient = _chunkWM646WI3js.createRiverbankClient; exports.prebuildCache = prebuildCache;
|
|
402
402
|
//# sourceMappingURL=index.js.map
|
package/dist/server/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as Theme } from './types-
|
|
1
|
+
import { T as Theme } from './types-CgSO0yxg.js';
|
|
2
2
|
import './schema-Z6-afHJG.js';
|
|
3
|
-
import { R as RiverbankClient, S as SiteResponse } from './types-
|
|
4
|
-
import { P as PageProps } from './loadPage-
|
|
3
|
+
import { R as RiverbankClient, S as SiteResponse } from './types-D0rPF8l5.js';
|
|
4
|
+
import { P as PageProps } from './loadPage-BZohBxxf.js';
|
|
5
5
|
import { R as ResolvedBlockData } from './types-DuQCNVV0.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as Theme } from './types-
|
|
1
|
+
import { T as Theme } from './types-DT30Qy7x.mjs';
|
|
2
2
|
import './schema-Z6-afHJG.mjs';
|
|
3
|
-
import { R as RiverbankClient, S as SiteResponse } from './types-
|
|
4
|
-
import { P as PageProps } from './loadPage-
|
|
3
|
+
import { R as RiverbankClient, S as SiteResponse } from './types-BRQ_6yOc.mjs';
|
|
4
|
+
import { P as PageProps } from './loadPage-VBorKlWv.mjs';
|
|
5
5
|
import { R as ResolvedBlockData } from './types-CbagRQ_7.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { R as RiverbankClient, S as SiteResponse } from './types-
|
|
1
|
+
import { R as RiverbankClient, S as SiteResponse } from './types-D0rPF8l5.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import React__default from 'react';
|
|
5
5
|
import { P as PageOutline, S as SdkCustomBlock } from './schema-Z6-afHJG.js';
|
|
6
6
|
import { T as TransformRegistry, a as ThemeTokens, R as RouteMap } from './core-DsNWrl3o.js';
|
|
7
|
-
import { T as Theme } from './types-
|
|
7
|
+
import { T as Theme } from './types-CgSO0yxg.js';
|
|
8
8
|
import { R as ResolvedBlockData, D as DataLoaderOverrides } from './types-DuQCNVV0.js';
|
|
9
9
|
|
|
10
10
|
type ViewModel = Record<string, unknown>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { R as RiverbankClient, S as SiteResponse } from './types-
|
|
1
|
+
import { R as RiverbankClient, S as SiteResponse } from './types-BRQ_6yOc.mjs';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import React__default from 'react';
|
|
5
5
|
import { P as PageOutline, S as SdkCustomBlock } from './schema-Z6-afHJG.mjs';
|
|
6
6
|
import { T as TransformRegistry, a as ThemeTokens, R as RouteMap } from './core-DsNWrl3o.mjs';
|
|
7
|
-
import { T as Theme } from './types-
|
|
7
|
+
import { T as Theme } from './types-DT30Qy7x.mjs';
|
|
8
8
|
import { R as ResolvedBlockData, D as DataLoaderOverrides } from './types-CbagRQ_7.mjs';
|
|
9
9
|
|
|
10
10
|
type ViewModel = Record<string, unknown>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { P as PageMetadataInput, g as generatePageMetadata, a as generatePreviewMetadata } from './index
|
|
2
|
-
import './loadPage-
|
|
3
|
-
import './types-
|
|
4
|
-
import './types-
|
|
1
|
+
export { P as PageMetadataInput, g as generatePageMetadata, a as generatePreviewMetadata } from './index-DfWg1Qle.mjs';
|
|
2
|
+
import './loadPage-VBorKlWv.mjs';
|
|
3
|
+
import './types-BRQ_6yOc.mjs';
|
|
4
|
+
import './types-DT30Qy7x.mjs';
|
|
5
5
|
import '@riverbankcms/ai';
|
|
6
6
|
import './schema-Z6-afHJG.mjs';
|
|
7
7
|
import 'zod';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { P as PageMetadataInput, g as generatePageMetadata, a as generatePreviewMetadata } from './index-
|
|
2
|
-
import './loadPage-
|
|
3
|
-
import './types-
|
|
4
|
-
import './types-
|
|
1
|
+
export { P as PageMetadataInput, g as generatePageMetadata, a as generatePreviewMetadata } from './index-CH_dvF6n.js';
|
|
2
|
+
import './loadPage-BZohBxxf.js';
|
|
3
|
+
import './types-D0rPF8l5.js';
|
|
4
|
+
import './types-CgSO0yxg.js';
|
|
5
5
|
import '@riverbankcms/ai';
|
|
6
6
|
import './schema-Z6-afHJG.js';
|
|
7
7
|
import 'zod';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NavigationMenuWithItems } from './types-
|
|
2
|
-
export { L as LinkPayload, a as NavigationItemRecord } from './types-
|
|
1
|
+
import { N as NavigationMenuWithItems } from './types-DT30Qy7x.mjs';
|
|
2
|
+
export { L as LinkPayload, a as NavigationItemRecord } from './types-DT30Qy7x.mjs';
|
|
3
3
|
import { R as RouteMap } from './core-DsNWrl3o.mjs';
|
|
4
4
|
import './schema-Z6-afHJG.mjs';
|
|
5
5
|
import '@riverbankcms/ai';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NavigationMenuWithItems } from './types-
|
|
2
|
-
export { L as LinkPayload, a as NavigationItemRecord } from './types-
|
|
1
|
+
import { N as NavigationMenuWithItems } from './types-CgSO0yxg.js';
|
|
2
|
+
export { L as LinkPayload, a as NavigationItemRecord } from './types-CgSO0yxg.js';
|
|
3
3
|
import { R as RouteMap } from './core-DsNWrl3o.js';
|
|
4
4
|
import './schema-Z6-afHJG.js';
|
|
5
5
|
import '@riverbankcms/ai';
|
package/dist/server/next.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ReactNode, ComponentType } from 'react';
|
|
2
|
-
import { R as RiverbankClient } from './types-
|
|
3
|
-
import { R as RiverbankSiteConfig } from './types-
|
|
4
|
-
import { B as BlockOverrides } from './loadPage-
|
|
2
|
+
import { R as RiverbankClient } from './types-BRQ_6yOc.mjs';
|
|
3
|
+
import { R as RiverbankSiteConfig } from './types-CJfJwcuL.mjs';
|
|
4
|
+
import { B as BlockOverrides } from './loadPage-VBorKlWv.mjs';
|
|
5
5
|
import './schema-Z6-afHJG.mjs';
|
|
6
|
-
import { M as Metadata } from './index
|
|
7
|
-
import { b as LoadContentResult } from './loadContent-
|
|
8
|
-
import './types-
|
|
6
|
+
import { M as Metadata } from './index-DfWg1Qle.mjs';
|
|
7
|
+
import { b as LoadContentResult } from './loadContent-Du5kS8UM.mjs';
|
|
8
|
+
import './types-DT30Qy7x.mjs';
|
|
9
9
|
import '@riverbankcms/ai';
|
|
10
10
|
import 'zod';
|
|
11
11
|
import './link-DjxLyC82.mjs';
|
|
@@ -73,6 +73,37 @@ interface CreateCatchAllPageOptions {
|
|
|
73
73
|
* Provides siteId and content type routing information.
|
|
74
74
|
*/
|
|
75
75
|
config: RiverbankSiteConfig;
|
|
76
|
+
/**
|
|
77
|
+
* Override preview mode detection.
|
|
78
|
+
*
|
|
79
|
+
* By default, preview mode is automatically detected from the client's API key:
|
|
80
|
+
* - `bld_live_sk_*` or `bld_test_sk_*` → published content (preview: false)
|
|
81
|
+
* - `bld_preview_sk_*` → draft content (preview: true)
|
|
82
|
+
*
|
|
83
|
+
* This automatic detection eliminates the need for manual coordination
|
|
84
|
+
* between API key selection and preview mode configuration.
|
|
85
|
+
*
|
|
86
|
+
* Only set this option if you need to override the automatic detection
|
|
87
|
+
* (e.g., for testing or advanced use cases).
|
|
88
|
+
*
|
|
89
|
+
* @example Automatic detection (recommended)
|
|
90
|
+
* ```tsx
|
|
91
|
+
* // builder-client.ts - use preview key for staging
|
|
92
|
+
* const apiKey = process.env.NODE_ENV === 'staging'
|
|
93
|
+
* ? 'bld_preview_sk_...'
|
|
94
|
+
* : 'bld_live_sk_...';
|
|
95
|
+
*
|
|
96
|
+
* export const getRiverbankClient = () => createRiverbankClient({ apiKey, ... });
|
|
97
|
+
*
|
|
98
|
+
* // page.tsx - preview mode is auto-detected from key type
|
|
99
|
+
* const { Page } = createCatchAllPage({
|
|
100
|
+
* getClient: getRiverbankClient,
|
|
101
|
+
* config,
|
|
102
|
+
* // No preview option needed - it's inferred from the API key!
|
|
103
|
+
* });
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
preview?: boolean;
|
|
76
107
|
/**
|
|
77
108
|
* Custom block component overrides for rendering.
|
|
78
109
|
* Keys can be full block kind ("block.hero") or short form ("hero").
|
|
@@ -223,7 +254,7 @@ interface CreateCatchAllPageResult {
|
|
|
223
254
|
* in external SDK sites. It handles:
|
|
224
255
|
*
|
|
225
256
|
* - Page and content entry routing
|
|
226
|
-
* - Preview mode detection (
|
|
257
|
+
* - Preview mode detection (automatically from API key type)
|
|
227
258
|
* - SEO metadata generation
|
|
228
259
|
* - Block overrides for custom components
|
|
229
260
|
* - 404 handling for missing content
|
package/dist/server/next.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ReactNode, ComponentType } from 'react';
|
|
2
|
-
import { R as RiverbankClient } from './types-
|
|
3
|
-
import { R as RiverbankSiteConfig } from './types-
|
|
4
|
-
import { B as BlockOverrides } from './loadPage-
|
|
2
|
+
import { R as RiverbankClient } from './types-D0rPF8l5.js';
|
|
3
|
+
import { R as RiverbankSiteConfig } from './types-D8XqwoVd.js';
|
|
4
|
+
import { B as BlockOverrides } from './loadPage-BZohBxxf.js';
|
|
5
5
|
import './schema-Z6-afHJG.js';
|
|
6
|
-
import { M as Metadata } from './index-
|
|
7
|
-
import { b as LoadContentResult } from './loadContent-
|
|
8
|
-
import './types-
|
|
6
|
+
import { M as Metadata } from './index-CH_dvF6n.js';
|
|
7
|
+
import { b as LoadContentResult } from './loadContent-DECnsp4k.js';
|
|
8
|
+
import './types-CgSO0yxg.js';
|
|
9
9
|
import '@riverbankcms/ai';
|
|
10
10
|
import 'zod';
|
|
11
11
|
import './link-DjxLyC82.js';
|
|
@@ -73,6 +73,37 @@ interface CreateCatchAllPageOptions {
|
|
|
73
73
|
* Provides siteId and content type routing information.
|
|
74
74
|
*/
|
|
75
75
|
config: RiverbankSiteConfig;
|
|
76
|
+
/**
|
|
77
|
+
* Override preview mode detection.
|
|
78
|
+
*
|
|
79
|
+
* By default, preview mode is automatically detected from the client's API key:
|
|
80
|
+
* - `bld_live_sk_*` or `bld_test_sk_*` → published content (preview: false)
|
|
81
|
+
* - `bld_preview_sk_*` → draft content (preview: true)
|
|
82
|
+
*
|
|
83
|
+
* This automatic detection eliminates the need for manual coordination
|
|
84
|
+
* between API key selection and preview mode configuration.
|
|
85
|
+
*
|
|
86
|
+
* Only set this option if you need to override the automatic detection
|
|
87
|
+
* (e.g., for testing or advanced use cases).
|
|
88
|
+
*
|
|
89
|
+
* @example Automatic detection (recommended)
|
|
90
|
+
* ```tsx
|
|
91
|
+
* // builder-client.ts - use preview key for staging
|
|
92
|
+
* const apiKey = process.env.NODE_ENV === 'staging'
|
|
93
|
+
* ? 'bld_preview_sk_...'
|
|
94
|
+
* : 'bld_live_sk_...';
|
|
95
|
+
*
|
|
96
|
+
* export const getRiverbankClient = () => createRiverbankClient({ apiKey, ... });
|
|
97
|
+
*
|
|
98
|
+
* // page.tsx - preview mode is auto-detected from key type
|
|
99
|
+
* const { Page } = createCatchAllPage({
|
|
100
|
+
* getClient: getRiverbankClient,
|
|
101
|
+
* config,
|
|
102
|
+
* // No preview option needed - it's inferred from the API key!
|
|
103
|
+
* });
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
preview?: boolean;
|
|
76
107
|
/**
|
|
77
108
|
* Custom block component overrides for rendering.
|
|
78
109
|
* Keys can be full block kind ("block.hero") or short form ("hero").
|
|
@@ -223,7 +254,7 @@ interface CreateCatchAllPageResult {
|
|
|
223
254
|
* in external SDK sites. It handles:
|
|
224
255
|
*
|
|
225
256
|
* - Page and content entry routing
|
|
226
|
-
* - Preview mode detection (
|
|
257
|
+
* - Preview mode detection (automatically from API key type)
|
|
227
258
|
* - SEO metadata generation
|
|
228
259
|
* - Block overrides for custom components
|
|
229
260
|
* - 404 handling for missing content
|
package/dist/server/next.js
CHANGED
|
@@ -7,7 +7,7 @@ var _chunkBNQV3PXPjs = require('./chunk-BNQV3PXP.js');
|
|
|
7
7
|
var _chunk2IZ6S225js = require('./chunk-2IZ6S225.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkWM646WI3js = require('./chunk-WM646WI3.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -24,8 +24,18 @@ require('./chunk-4CV4JOE5.js');
|
|
|
24
24
|
// src/next/catch-all.tsx
|
|
25
25
|
var _navigation = require('next/navigation');
|
|
26
26
|
var _jsxruntime = require('react/jsx-runtime');
|
|
27
|
-
function
|
|
28
|
-
|
|
27
|
+
function detectPreviewFromClient(getClient) {
|
|
28
|
+
const client = getClient();
|
|
29
|
+
const keyType = client.getKeyType();
|
|
30
|
+
if (keyType === "preview") {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
if (keyType === "unknown") {
|
|
34
|
+
console.warn(
|
|
35
|
+
"[createCatchAllPage] Could not detect API key type from prefix. Expected bld_live_sk_*, bld_test_sk_*, or bld_preview_sk_*. Defaulting to published content (preview: false)."
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
29
39
|
}
|
|
30
40
|
function slugToPath(slug) {
|
|
31
41
|
if (!slug || slug.length === 0) return "/";
|
|
@@ -35,19 +45,20 @@ function createCatchAllPage(options) {
|
|
|
35
45
|
const {
|
|
36
46
|
getClient,
|
|
37
47
|
config,
|
|
48
|
+
preview: previewOption,
|
|
38
49
|
blockOverrides,
|
|
39
50
|
siteUrl,
|
|
40
51
|
beforeRender,
|
|
41
52
|
customMetadata,
|
|
42
53
|
wrapper: Wrapper
|
|
43
54
|
} = options;
|
|
55
|
+
const preview = _nullishCoalesce(previewOption, () => ( detectPreviewFromClient(getClient)));
|
|
44
56
|
async function Page2({ params, searchParams: searchParamsPromise }) {
|
|
45
57
|
const [{ slug }, searchParams] = await Promise.all([
|
|
46
58
|
params,
|
|
47
59
|
_nullishCoalesce(searchParamsPromise, () => ( Promise.resolve({})))
|
|
48
60
|
]);
|
|
49
61
|
const path = slugToPath(slug);
|
|
50
|
-
const preview = isPreviewMode2();
|
|
51
62
|
const client = getClient();
|
|
52
63
|
let content;
|
|
53
64
|
try {
|
|
@@ -107,7 +118,6 @@ function createCatchAllPage(options) {
|
|
|
107
118
|
_nullishCoalesce(searchParamsPromise, () => ( Promise.resolve({})))
|
|
108
119
|
]);
|
|
109
120
|
const path = slugToPath(slug);
|
|
110
|
-
const preview = isPreviewMode2();
|
|
111
121
|
try {
|
|
112
122
|
const content = await _chunkEIJ27EZQjs.loadContent.call(void 0, {
|
|
113
123
|
client: getClient(),
|
|
@@ -183,8 +193,8 @@ async function generateAllStaticParams() {
|
|
|
183
193
|
`[Riverbank] generateAllStaticParams requires env vars: ${envResult.missingVars.join(", ")}. This error prevents accidentally deploying with zero static pages.`
|
|
184
194
|
);
|
|
185
195
|
}
|
|
186
|
-
const { apiKey, siteId
|
|
187
|
-
const
|
|
196
|
+
const { apiKey, siteId, baseUrl } = envResult.config;
|
|
197
|
+
const client = _chunkWM646WI3js.createRiverbankClient.call(void 0, {
|
|
188
198
|
apiKey,
|
|
189
199
|
baseUrl,
|
|
190
200
|
// Disable caching for build-time fetches
|
|
@@ -192,10 +202,18 @@ async function generateAllStaticParams() {
|
|
|
192
202
|
// Disable resilience for build-time fetches (want fast failure)
|
|
193
203
|
resilience: { enabled: false }
|
|
194
204
|
});
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
205
|
+
try {
|
|
206
|
+
const routes = await client.getAllPublishedRoutes({ siteId });
|
|
207
|
+
return routes.items.map((route) => ({
|
|
208
|
+
slug: pathToSlugArray(route.path)
|
|
209
|
+
}));
|
|
210
|
+
} catch (error) {
|
|
211
|
+
console.error(
|
|
212
|
+
"[Riverbank] generateAllStaticParams failed to fetch routes:",
|
|
213
|
+
error instanceof Error ? error.message : error
|
|
214
|
+
);
|
|
215
|
+
return [{ slug: [] }];
|
|
216
|
+
}
|
|
199
217
|
}
|
|
200
218
|
|
|
201
219
|
// src/next/index.ts
|