@blinkk/root-cms 2.0.0-rc.1 → 2.0.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/dist/app.js +226 -20
- package/dist/cli.js +217 -164
- package/dist/{client-AKOLkEwt.d.ts → client-fqtWzfpQ.d.ts} +359 -107
- package/dist/client.d.ts +1 -1
- package/dist/client.js +730 -314
- package/dist/core.d.ts +5 -80
- package/dist/core.js +732 -509
- package/dist/functions.js +721 -299
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.js +988 -518
- package/dist/project.d.ts +1 -1
- package/dist/project.js +2 -2
- package/dist/richtext.js +0 -1
- package/dist/{schema-ix967Ud0.d.ts → schema-KpQGOA1Z.d.ts} +65 -8
- package/dist/ui/signin.css +0 -1
- package/dist/ui/signin.js +0 -1
- package/dist/ui/ui.css +1 -2
- package/dist/ui/ui.js +142 -103
- package/package.json +20 -16
package/dist/core.d.ts
CHANGED
|
@@ -1,86 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as Action,
|
|
3
|
-
import {
|
|
1
|
+
import { L as LoadTranslationsOptions, T as TranslationsMap, a as LocaleTranslations } from './client-fqtWzfpQ.js';
|
|
2
|
+
export { A as Action, p as ArrayObject, z as BatchRequest, B as BatchRequestOptions, w as BatchRequestQuery, x as BatchRequestQueryOptions, C as BatchResponse, c as DataSource, d as DataSourceData, e as DataSourceMode, D as Doc, b as DocMode, h as GetCountOptions, G as GetDocOptions, H as HttpMethod, j as ListActionsOptions, g as ListDocsOptions, E as Locale, N as MultiLocaleTranslationsMap, R as Release, k as RootCMSClient, f as SaveDraftOptions, S as SetDocOptions, O as SingleLocaleTranslationsMap, F as SourceString, I as TranslatedString, i as Translation, y as TranslationsDoc, J as TranslationsDocMode, M as TranslationsLocaleDocEntry, K as TranslationsLocaleDocHashMap, P as TranslationsManager, U as UserRole, Q as buildTranslationsDbPath, V as buildTranslationsLocaleDocDbPath, m as getCmsPlugin, l as isRichTextData, q as marshalArray, n as marshalData, o as normalizeData, v as parseDocId, t as toArrayObject, s as translationsForLocale, r as unmarshalArray, u as unmarshalData } from './client-fqtWzfpQ.js';
|
|
3
|
+
import { RootConfig } from '@blinkk/root';
|
|
4
4
|
import { Query } from 'firebase-admin/firestore';
|
|
5
|
-
export { s as schema } from './schema-
|
|
5
|
+
export { s as schema } from './schema-KpQGOA1Z.js';
|
|
6
6
|
import 'firebase-admin/app';
|
|
7
7
|
import 'preact';
|
|
8
8
|
|
|
9
|
-
type CMSRequest = Request & {
|
|
10
|
-
cmsClient: RootCMSClient;
|
|
11
|
-
};
|
|
12
|
-
interface CMSRouteContext {
|
|
13
|
-
/** HTTP request object. Only available in SSR mode. */
|
|
14
|
-
req?: CMSRequest;
|
|
15
|
-
slug: string;
|
|
16
|
-
mode: 'draft' | 'published';
|
|
17
|
-
cmsClient: RootCMSClient;
|
|
18
|
-
}
|
|
19
|
-
interface CMSRouteOptions {
|
|
20
|
-
/**
|
|
21
|
-
* Collection mapped to the route.
|
|
22
|
-
*/
|
|
23
|
-
collection: string;
|
|
24
|
-
/**
|
|
25
|
-
* Route param name used for the slug. Used for dynamic routes, e.g.
|
|
26
|
-
* `[...slug].tsx`. Defaults to "slug".
|
|
27
|
-
*/
|
|
28
|
-
slugParam?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Slug to use for the route. Used for non-dynamic, single-document routes.
|
|
31
|
-
*/
|
|
32
|
-
slug?: string;
|
|
33
|
-
/**
|
|
34
|
-
* Hook that allows callers to modify the Root CMS `BatchRequest` object. If a
|
|
35
|
-
* new `BatchRequest` is returned, it will replace the default one created by
|
|
36
|
-
* `cmsRoute()`.
|
|
37
|
-
*/
|
|
38
|
-
preRequestHook?: (batchRequest: BatchRequest, context: CMSRouteContext) => void | BatchRequest;
|
|
39
|
-
/**
|
|
40
|
-
* Callback function that returns a map of Promises that contain fetched data.
|
|
41
|
-
* Once the promise is resolved, the values are injected into page's props
|
|
42
|
-
* for rendering.
|
|
43
|
-
*/
|
|
44
|
-
fetchData?: (context: CMSRouteContext) => Record<string, Promise<any>>;
|
|
45
|
-
/**
|
|
46
|
-
* Hook for amending any props values before being passed to the page
|
|
47
|
-
* component.
|
|
48
|
-
*/
|
|
49
|
-
preRenderHook?: (props: any, context: CMSRouteContext) => any | Promise<any>;
|
|
50
|
-
/**
|
|
51
|
-
* Hook for setting any response headers.
|
|
52
|
-
*/
|
|
53
|
-
setResponseHeaders?: (req: Request, res: Response) => void;
|
|
54
|
-
/**
|
|
55
|
-
* Sets Cache-Control header to `private`.
|
|
56
|
-
*/
|
|
57
|
-
disableCacheControl?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Enables SSG mode for sites that serve on SCS or other static servers.
|
|
60
|
-
*/
|
|
61
|
-
enableSSG?: boolean;
|
|
62
|
-
}
|
|
63
|
-
interface CMSDoc {
|
|
64
|
-
id: string;
|
|
65
|
-
slug: string;
|
|
66
|
-
sys?: {
|
|
67
|
-
locales?: string[];
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Utility for generating SSR and SSG handlers in a Root route file.
|
|
72
|
-
*/
|
|
73
|
-
declare function cmsRoute(options: CMSRouteOptions): {
|
|
74
|
-
getStaticPaths: GetStaticPaths | null;
|
|
75
|
-
getStaticProps: GetStaticProps | null;
|
|
76
|
-
handle: (req: CMSRequest, res: Response) => Promise<void>;
|
|
77
|
-
};
|
|
78
|
-
declare function resolvePromisesMap(promisesMap: Record<string, Promise<any>>): Promise<Record<string, any>>;
|
|
79
|
-
/**
|
|
80
|
-
* Issues an HTTP redirect, preserving any query params from the original req.
|
|
81
|
-
*/
|
|
82
|
-
declare function redirectWithQuery(req: Request, res: Response, redirectCode: number, redirectPath: string): void;
|
|
83
|
-
|
|
84
9
|
/** @deprecated Use client.ts instead. */
|
|
85
10
|
|
|
86
11
|
/**
|
|
@@ -126,4 +51,4 @@ declare function loadTranslations(rootConfig: RootConfig, options?: LoadTranslat
|
|
|
126
51
|
*/
|
|
127
52
|
declare function loadTranslationsForLocale(rootConfig: RootConfig, locale: string, options?: LoadTranslationsOptions): Promise<LocaleTranslations>;
|
|
128
53
|
|
|
129
|
-
export {
|
|
54
|
+
export { LoadTranslationsOptions, LocaleTranslations, TranslationsMap, getDoc, listDocs, loadTranslations, loadTranslationsForLocale, numDocs, publishScheduledDocs };
|