@blinkk/root-cms 1.0.1-alpha.0 → 1.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/LICENSE +22 -0
- package/README.md +66 -0
- package/bin/root-cms.js +17 -0
- package/dist/app.js +212 -0
- package/dist/cli.js +346 -0
- package/dist/client.d.ts +273 -0
- package/dist/client.js +600 -0
- package/dist/core.d.ts +55 -0
- package/dist/core.js +865 -0
- package/dist/functions.d.ts +13 -0
- package/dist/functions.js +714 -0
- package/dist/plugin.d.ts +76 -0
- package/dist/plugin.js +1091 -0
- package/dist/project.d.ts +16 -0
- package/dist/project.js +21 -0
- package/dist/richtext.d.ts +73 -0
- package/dist/richtext.js +129 -0
- package/dist/schema--v3Ho5Lj.d.ts +211 -0
- package/dist/ui/signin.css +173 -0
- package/dist/ui/signin.js +9167 -0
- package/dist/ui/ui.css +2352 -0
- package/dist/ui/ui.js +67731 -0
- package/package.json +118 -13
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Request, Plugin } from '@blinkk/root';
|
|
2
|
+
import { App } from 'firebase-admin/app';
|
|
3
|
+
|
|
4
|
+
interface CMSUser {
|
|
5
|
+
email: string;
|
|
6
|
+
}
|
|
7
|
+
type CMSPluginOptions = {
|
|
8
|
+
/**
|
|
9
|
+
* The ID of the project. Data will be stored under the namespace
|
|
10
|
+
* `Projects/${id}` in firestore.
|
|
11
|
+
*/
|
|
12
|
+
id?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The name of the project. Used in the header of the CMS to help identify
|
|
15
|
+
* the project.
|
|
16
|
+
*/
|
|
17
|
+
name?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Firebase config object, which can be obtained in the Firebase Console by
|
|
20
|
+
* going to "Project Settings".
|
|
21
|
+
*/
|
|
22
|
+
firebaseConfig: {
|
|
23
|
+
[key: string]: string;
|
|
24
|
+
apiKey: string;
|
|
25
|
+
authDomain: string;
|
|
26
|
+
projectId: string;
|
|
27
|
+
storageBucket: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* GAPI credentials. Include if using Google Drive and Google Sheets features.
|
|
31
|
+
* See: https://developers.google.com/sheets/api/quickstart/js
|
|
32
|
+
*/
|
|
33
|
+
gapi?: {
|
|
34
|
+
/** https://developers.google.com/sheets/api/quickstart/js#create_an_api_key */
|
|
35
|
+
apiKey: string;
|
|
36
|
+
/** https://developers.google.com/sheets/api/quickstart/js#authorize_credentials_for_a_web_application */
|
|
37
|
+
clientId: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Secret value(s) used for signing the user authentication cookie.
|
|
41
|
+
* @deprecated This is now handled directly by root's sessionMiddleware under
|
|
42
|
+
* `server.sessionCookieSecret` in root.config.ts.
|
|
43
|
+
*/
|
|
44
|
+
cookieSecret?: string | string[];
|
|
45
|
+
/** Function called to check if a user should have access to the CMS. */
|
|
46
|
+
isUserAuthorized?: (req: Request, user: CMSUser) => boolean | Promise<boolean>;
|
|
47
|
+
/**
|
|
48
|
+
* Function to call to check if login is required for a particular request.
|
|
49
|
+
*/
|
|
50
|
+
isLoginRequired?: (req: Request) => boolean;
|
|
51
|
+
/**
|
|
52
|
+
* URL to GCI service for transforming uploaded GCS images to a Google App
|
|
53
|
+
* Engine Images API serving URL.
|
|
54
|
+
*
|
|
55
|
+
* Setting this to `true` uses the default hosted service at
|
|
56
|
+
* https://gci.rootjs.dev.
|
|
57
|
+
*
|
|
58
|
+
* To set up GCI:
|
|
59
|
+
*
|
|
60
|
+
* - Create a GCS bucket with fine-grained permissions
|
|
61
|
+
* - Share owner access to the bucket with the service account returned in
|
|
62
|
+
* https://gci.rootjs.dev/_/service_account
|
|
63
|
+
*
|
|
64
|
+
* To disable GCI, leave this value empty or set to `false`, which which will
|
|
65
|
+
* serve images directly from GCS instead.
|
|
66
|
+
*/
|
|
67
|
+
gci?: string | boolean;
|
|
68
|
+
};
|
|
69
|
+
type CMSPlugin = Plugin & {
|
|
70
|
+
name: 'root-cms';
|
|
71
|
+
getConfig: () => CMSPluginOptions;
|
|
72
|
+
getFirebaseApp: () => App;
|
|
73
|
+
};
|
|
74
|
+
declare function cmsPlugin(options: CMSPluginOptions): CMSPlugin;
|
|
75
|
+
|
|
76
|
+
export { type CMSPlugin, type CMSPluginOptions, type CMSUser, cmsPlugin };
|