@blinkk/root-cms 3.0.1-alpha.0 → 3.0.1-beta.2
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 +12 -6
- package/dist/chunk-ATPWU3CU.js +921 -0
- package/dist/chunk-CRK7N6RR.js +298 -0
- package/dist/{chunk-YMUZ5H5C.js → chunk-F4SODS5S.js} +108 -297
- package/dist/{chunk-MSJGHSR6.js → chunk-MAZA5B27.js} +23 -27
- package/dist/chunk-TRM4MQHU.js +1180 -0
- package/dist/{chunk-KDXHFMIH.js → chunk-XLX37FRL.js} +3 -0
- package/dist/cli.js +3 -2
- package/dist/{client-cP6yMgT8.d.ts → client-1puwLgNx.d.ts} +317 -24
- package/dist/client.d.ts +2 -2
- package/dist/client.js +2 -1
- package/dist/core.d.ts +3 -3
- package/dist/core.js +8 -1
- package/dist/functions.js +3 -2
- package/dist/{generate-types-MHWSSOWV.js → generate-types-SPV7I3A5.js} +1 -1
- package/dist/plugin.d.ts +2 -2
- package/dist/plugin.js +369 -79
- package/dist/project.d.ts +16 -3
- package/dist/project.js +3 -1
- package/dist/richtext.d.ts +25 -18
- package/dist/richtext.js +98 -43
- package/dist/{schema-D7MOj-YC.d.ts → schema-Db_xODoi.d.ts} +66 -1
- package/dist/ui/signin.css +1 -1
- package/dist/ui/signin.js +3 -3
- package/dist/ui/ui.css +1 -1
- package/dist/ui/ui.js +259 -175
- package/dist/ui/ui.js.LEGAL.txt +16 -3
- package/package.json +12 -8
- package/dist/ai-OZY3JXDH.js +0 -19
- package/dist/altText-RDKJNVGH.js +0 -7
- package/dist/chunk-H6ZKML2S.js +0 -157
- package/dist/chunk-N4Z3O53K.js +0 -191
- package/dist/chunk-T5UK2H24.js +0 -419
|
@@ -222,6 +222,9 @@ function fieldType(field, options) {
|
|
|
222
222
|
if (field.type === "multiselect") {
|
|
223
223
|
return dom.type.array(dom.type.string);
|
|
224
224
|
}
|
|
225
|
+
if (field.type === "number") {
|
|
226
|
+
return dom.type.number;
|
|
227
|
+
}
|
|
225
228
|
if (field.type === "oneof") {
|
|
226
229
|
const oneOf = dom.create.namedTypeReference("RootCMSOneOf");
|
|
227
230
|
if (field.types && Array.isArray(field.types)) {
|
package/dist/cli.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateTypes
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XLX37FRL.js";
|
|
4
4
|
import {
|
|
5
5
|
RootCMSClient,
|
|
6
6
|
getCmsPlugin,
|
|
7
7
|
unmarshalData
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-F4SODS5S.js";
|
|
9
|
+
import "./chunk-CRK7N6RR.js";
|
|
9
10
|
import "./chunk-MLKGABMK.js";
|
|
10
11
|
|
|
11
12
|
// cli/cli.ts
|
|
@@ -1,12 +1,74 @@
|
|
|
1
1
|
import { RootConfig, Plugin, Request } from '@blinkk/root';
|
|
2
2
|
import { App } from 'firebase-admin/app';
|
|
3
3
|
import { Firestore, WriteBatch, Timestamp, Query } from 'firebase-admin/firestore';
|
|
4
|
-
import { C as Collection } from './schema-
|
|
4
|
+
import { C as Collection } from './schema-Db_xODoi.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Provider type for an AI model. Use `openai-compatible` for any OpenAI-style
|
|
8
|
+
* endpoint (e.g. local Ollama, vLLM, OpenRouter).
|
|
8
9
|
*/
|
|
9
|
-
type
|
|
10
|
+
type AiProvider = 'openai' | 'openai-compatible' | 'anthropic' | 'google';
|
|
11
|
+
/**
|
|
12
|
+
* Configuration for a single chat model.
|
|
13
|
+
*
|
|
14
|
+
* Inspired by Ollama's `Modelfile` and LiteLLM's model config: each entry maps
|
|
15
|
+
* a CMS-facing id to a provider, model id and credentials.
|
|
16
|
+
*/
|
|
17
|
+
interface AiModelConfig {
|
|
18
|
+
/** Stable id used by the CMS UI and stored alongside chat history. */
|
|
19
|
+
id: string;
|
|
20
|
+
/** Optional human-readable label rendered in the model picker. */
|
|
21
|
+
label?: string;
|
|
22
|
+
/** Optional description shown under the label. */
|
|
23
|
+
description?: string;
|
|
24
|
+
/** AI provider/family to route requests to. */
|
|
25
|
+
provider: AiProvider;
|
|
26
|
+
/**
|
|
27
|
+
* Provider-specific model id (e.g. `gpt-4o`, `claude-opus-4-5`,
|
|
28
|
+
* `gemini-2.5-pro`). Defaults to `id` if omitted.
|
|
29
|
+
*/
|
|
30
|
+
modelId?: string;
|
|
31
|
+
/** API key for the provider. */
|
|
32
|
+
apiKey?: string;
|
|
33
|
+
/** Override the provider's base URL (required for `openai-compatible`). */
|
|
34
|
+
baseURL?: string;
|
|
35
|
+
/** Custom headers to send with each request. */
|
|
36
|
+
headers?: Record<string, string>;
|
|
37
|
+
/** Capabilities advertised to the UI. */
|
|
38
|
+
capabilities?: {
|
|
39
|
+
/** Whether the model can call tools. Defaults to `true`. */
|
|
40
|
+
tools?: boolean;
|
|
41
|
+
/** Whether the model can stream reasoning/thinking. Defaults to `false`. */
|
|
42
|
+
reasoning?: boolean;
|
|
43
|
+
/** Whether the model accepts image attachments. Defaults to `false`. */
|
|
44
|
+
attachments?: boolean;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Full AI config registered on the cms plugin.
|
|
49
|
+
*/
|
|
50
|
+
interface AiConfig {
|
|
51
|
+
/** Models exposed in the model picker. The first entry is the default. */
|
|
52
|
+
models: AiModelConfig[];
|
|
53
|
+
/** Id of the default model. Defaults to the first model in `models`. */
|
|
54
|
+
defaultModel?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Image generation models. Used by the image generator and any other
|
|
57
|
+
* features that produce images. Only the `openai` and `google` providers
|
|
58
|
+
* support image generation.
|
|
59
|
+
*/
|
|
60
|
+
imageModels?: AiModelConfig[];
|
|
61
|
+
/** Id of the default image model. Defaults to the first entry in `imageModels`. */
|
|
62
|
+
defaultImageModel?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Optional system prompt prepended to every conversation. If a `ROOT.md`
|
|
65
|
+
* file exists at the project root, its contents are appended to this
|
|
66
|
+
* prompt automatically.
|
|
67
|
+
*/
|
|
68
|
+
systemPrompt?: string;
|
|
69
|
+
/** Maximum tool-loop steps before stopping. Defaults to 10. */
|
|
70
|
+
maxSteps?: number;
|
|
71
|
+
}
|
|
10
72
|
|
|
11
73
|
/** The result status of a check. */
|
|
12
74
|
type CheckStatus = 'success' | 'warning' | 'error';
|
|
@@ -54,6 +116,105 @@ interface CMSCheck {
|
|
|
54
116
|
run: (ctx: CheckContext) => Promise<CheckResult>;
|
|
55
117
|
}
|
|
56
118
|
|
|
119
|
+
/**
|
|
120
|
+
* Base shape for a service registered with the CMS plugin.
|
|
121
|
+
*
|
|
122
|
+
* Services are extension points that let plugins provide capabilities
|
|
123
|
+
* (e.g. email delivery, cache, translations) that root-cms can call into.
|
|
124
|
+
* Every service shares the same identifying fields — `id`, `label`, optional
|
|
125
|
+
* `icon` — and is registered via the `services` option on `cmsPlugin()`.
|
|
126
|
+
*
|
|
127
|
+
* Concrete service interfaces (e.g. `CMSEmailService`,
|
|
128
|
+
* `CMSTranslationService`) extend this base and add the handler functions
|
|
129
|
+
* specific to their capability.
|
|
130
|
+
*/
|
|
131
|
+
interface CMSService {
|
|
132
|
+
/** Unique ID for the service (e.g. `'sendgrid'`, `'crowdin'`). */
|
|
133
|
+
id: string;
|
|
134
|
+
/** Human-readable label displayed in the UI (e.g. "SendGrid"). */
|
|
135
|
+
label: string;
|
|
136
|
+
/**
|
|
137
|
+
* Optional icon URL displayed in the UI next to the label. Similar to the
|
|
138
|
+
* sidebar tools `icon` option, this should be a URL to an image.
|
|
139
|
+
*/
|
|
140
|
+
icon?: string;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Base context passed to service handler functions. Concrete services may
|
|
144
|
+
* extend this with additional fields specific to the call site (e.g. the
|
|
145
|
+
* translation context adds `docId`, `collectionId`, etc.).
|
|
146
|
+
*/
|
|
147
|
+
interface CMSServiceContext {
|
|
148
|
+
/** The Root.js config. */
|
|
149
|
+
rootConfig: RootConfig;
|
|
150
|
+
/** The Root CMS client for accessing the database. */
|
|
151
|
+
cmsClient: RootCMSClient;
|
|
152
|
+
/**
|
|
153
|
+
* Email of the user that triggered the action, if any. Some service calls
|
|
154
|
+
* are initiated by the system rather than a user, in which case this is
|
|
155
|
+
* undefined.
|
|
156
|
+
*/
|
|
157
|
+
user?: {
|
|
158
|
+
email: string;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** Result returned by a notification service `onAction` handler. */
|
|
163
|
+
interface NotificationResult {
|
|
164
|
+
/**
|
|
165
|
+
* Delivery status.
|
|
166
|
+
* - `'success'`: the notification was delivered.
|
|
167
|
+
* - `'error'`: delivery failed; `message` should describe why.
|
|
168
|
+
* - `'info'` (default): the service handled the action but did not
|
|
169
|
+
* deliver a notification (e.g. the action was filtered out).
|
|
170
|
+
*/
|
|
171
|
+
status?: 'success' | 'info' | 'error';
|
|
172
|
+
/** Optional human-readable message describing the result. */
|
|
173
|
+
message?: string;
|
|
174
|
+
}
|
|
175
|
+
/** Context passed to notification service handler functions. */
|
|
176
|
+
interface NotificationServiceContext extends CMSServiceContext {
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Configuration for defining a CMS notification service.
|
|
180
|
+
*
|
|
181
|
+
* Notification services react to actions in the CMS (publishes, schema
|
|
182
|
+
* changes, comments, etc.) and dispatch them to an external channel.
|
|
183
|
+
* Initially this is intended for email, with Slack, webhooks, and other
|
|
184
|
+
* transports planned.
|
|
185
|
+
*
|
|
186
|
+
* Multiple notification services may be registered; each independently
|
|
187
|
+
* decides whether and how to handle a given action.
|
|
188
|
+
*
|
|
189
|
+
* Example:
|
|
190
|
+
* ```ts
|
|
191
|
+
* cmsPlugin({
|
|
192
|
+
* services: {
|
|
193
|
+
* notifications: [
|
|
194
|
+
* {
|
|
195
|
+
* id: 'sendgrid',
|
|
196
|
+
* label: 'SendGrid',
|
|
197
|
+
* onAction: async (ctx, action) => {
|
|
198
|
+
* if (action.action === 'doc.publish') {
|
|
199
|
+
* await sendgrid.send({ ... });
|
|
200
|
+
* }
|
|
201
|
+
* },
|
|
202
|
+
* },
|
|
203
|
+
* ],
|
|
204
|
+
* },
|
|
205
|
+
* });
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
interface CMSNotificationService extends CMSService {
|
|
209
|
+
/**
|
|
210
|
+
* Async function called when an action occurs in the CMS. Receives the
|
|
211
|
+
* action and may dispatch a notification (e.g. send email, post to Slack)
|
|
212
|
+
* via the service's underlying transport. Can optionally return a
|
|
213
|
+
* `NotificationResult` describing delivery status.
|
|
214
|
+
*/
|
|
215
|
+
onAction?: (ctx: NotificationServiceContext, action: Action) => Promise<void | NotificationResult>;
|
|
216
|
+
}
|
|
217
|
+
|
|
57
218
|
/** A row of translation data keyed by locale. */
|
|
58
219
|
interface TranslationRow {
|
|
59
220
|
/** The source string. */
|
|
@@ -64,11 +225,7 @@ interface TranslationRow {
|
|
|
64
225
|
description?: string;
|
|
65
226
|
}
|
|
66
227
|
/** Context passed to translation service import/export functions. */
|
|
67
|
-
interface TranslationServiceContext {
|
|
68
|
-
/** The Root.js config. */
|
|
69
|
-
rootConfig: RootConfig;
|
|
70
|
-
/** The Root CMS client for accessing the database. */
|
|
71
|
-
cmsClient: RootCMSClient;
|
|
228
|
+
interface TranslationServiceContext extends CMSServiceContext {
|
|
72
229
|
/** The document ID, e.g. `Pages/index`. */
|
|
73
230
|
docId: string;
|
|
74
231
|
/** The collection ID, e.g. `Pages`. */
|
|
@@ -125,16 +282,7 @@ interface TranslationImportResult {
|
|
|
125
282
|
status?: 'success' | 'info' | 'error';
|
|
126
283
|
}
|
|
127
284
|
/** Configuration for defining a CMS translation service. */
|
|
128
|
-
interface CMSTranslationService {
|
|
129
|
-
/** Unique ID for the translation service. */
|
|
130
|
-
id: string;
|
|
131
|
-
/** Human-readable label displayed in the UI (e.g. "Crowdin"). */
|
|
132
|
-
label: string;
|
|
133
|
-
/**
|
|
134
|
-
* Optional icon URL displayed in the UI next to the label. Similar to the
|
|
135
|
-
* sidebar tools `icon` option, this should be a URL to an image.
|
|
136
|
-
*/
|
|
137
|
-
icon?: string;
|
|
285
|
+
interface CMSTranslationService extends CMSService {
|
|
138
286
|
/**
|
|
139
287
|
* Async function to import translations from the service. Should return an
|
|
140
288
|
* array of translation rows that will be merged into the CMS translations
|
|
@@ -170,11 +318,47 @@ type CMSBuiltInSidebarTool = 'home' | 'content' | 'releases' | 'data' | 'assets'
|
|
|
170
318
|
interface CMSUser {
|
|
171
319
|
email: string;
|
|
172
320
|
}
|
|
321
|
+
/**
|
|
322
|
+
* @deprecated The `experiments.ai` flag is now used only as a sidebar toggle.
|
|
323
|
+
* Configure chat models on the top-level `ai` plugin option instead.
|
|
324
|
+
*/
|
|
173
325
|
interface CMSAIConfig {
|
|
174
326
|
/** Custom API endpoint for chat prompts. */
|
|
175
327
|
endpoint?: string;
|
|
176
328
|
/** Gen AI model to use. */
|
|
177
|
-
model?:
|
|
329
|
+
model?: string;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Filters applied to the spotlight / global search indexer. By default every
|
|
333
|
+
* collection and every doc is indexed. Use these options to scope the index to
|
|
334
|
+
* a subset of the project's content.
|
|
335
|
+
*
|
|
336
|
+
* Doc ids use the `<collectionId>/<slug>` format (e.g. `Pages/about`), which
|
|
337
|
+
* matches the format used elsewhere in the CMS.
|
|
338
|
+
*/
|
|
339
|
+
interface CMSSearchIndexConfig {
|
|
340
|
+
/**
|
|
341
|
+
* Collections to include in the search index. If specified, only these
|
|
342
|
+
* collections are indexed. If unset, all collections are indexed (subject to
|
|
343
|
+
* `excludeCollections`).
|
|
344
|
+
*/
|
|
345
|
+
includeCollections?: string[];
|
|
346
|
+
/**
|
|
347
|
+
* Collections to exclude from the search index. Applied after
|
|
348
|
+
* `includeCollections`.
|
|
349
|
+
*/
|
|
350
|
+
excludeCollections?: string[];
|
|
351
|
+
/**
|
|
352
|
+
* Doc ids to include in the search index. If specified, only these docs are
|
|
353
|
+
* indexed (within collections that pass the collection filter). Format:
|
|
354
|
+
* `<collectionId>/<slug>`.
|
|
355
|
+
*/
|
|
356
|
+
includeDocIds?: string[];
|
|
357
|
+
/**
|
|
358
|
+
* Doc ids to exclude from the search index. Applied after `includeDocIds`.
|
|
359
|
+
* Format: `<collectionId>/<slug>`.
|
|
360
|
+
*/
|
|
361
|
+
excludeDocIds?: string[];
|
|
178
362
|
}
|
|
179
363
|
interface CMSSidebarTool {
|
|
180
364
|
/** URL for the sidebar icon image. */
|
|
@@ -252,13 +436,13 @@ type CMSPluginOptions = {
|
|
|
252
436
|
* Engine Images API serving URL.
|
|
253
437
|
*
|
|
254
438
|
* Setting this to `true` uses the default hosted service at
|
|
255
|
-
* https://
|
|
439
|
+
* https://services.rootjs.dev.
|
|
256
440
|
*
|
|
257
441
|
* To set up GCI:
|
|
258
442
|
*
|
|
259
443
|
* - Create a GCS bucket with fine-grained permissions
|
|
260
444
|
* - Share owner access to the bucket with the service account returned in
|
|
261
|
-
* https://
|
|
445
|
+
* https://services.rootjs.dev/_/service_account
|
|
262
446
|
*
|
|
263
447
|
* To disable GCI, leave this value empty or set to `false`, which which will
|
|
264
448
|
* serve images directly from GCS instead.
|
|
@@ -275,7 +459,9 @@ type CMSPluginOptions = {
|
|
|
275
459
|
*/
|
|
276
460
|
tools?: Record<string, CMSSidebarTool>;
|
|
277
461
|
/**
|
|
278
|
-
* Hide specific built-in sidebar tools.
|
|
462
|
+
* Hide specific built-in sidebar tools. Hiding a tool also removes its
|
|
463
|
+
* surfaces from the CMS home page. The underlying routes remain
|
|
464
|
+
* accessible via direct URL.
|
|
279
465
|
*/
|
|
280
466
|
hiddenBuiltInTools?: CMSBuiltInSidebarTool[];
|
|
281
467
|
};
|
|
@@ -292,18 +478,75 @@ type CMSPluginOptions = {
|
|
|
292
478
|
* Callback when an action occurs.
|
|
293
479
|
*/
|
|
294
480
|
onAction?: (action: Action) => any;
|
|
481
|
+
/**
|
|
482
|
+
* Configures the Root CMS AI chat (`/cms/ai`). Provide one or more models
|
|
483
|
+
* — the CMS proxies user requests directly to the configured providers.
|
|
484
|
+
*
|
|
485
|
+
* The shape mirrors open source tools like Ollama and LiteLLM: each entry
|
|
486
|
+
* declares the provider, model id and credentials. Keys live on the server,
|
|
487
|
+
* never on the client.
|
|
488
|
+
*
|
|
489
|
+
* Example:
|
|
490
|
+
* ```ts
|
|
491
|
+
* cmsPlugin({
|
|
492
|
+
* ai: {
|
|
493
|
+
* models: [
|
|
494
|
+
* {
|
|
495
|
+
* id: 'gpt-5.5',
|
|
496
|
+
* label: 'GPT-5.5',
|
|
497
|
+
* provider: 'openai',
|
|
498
|
+
* apiKey: process.env.OPENAI_API_KEY,
|
|
499
|
+
* capabilities: {tools: true, reasoning: true, attachments: true},
|
|
500
|
+
* },
|
|
501
|
+
* {
|
|
502
|
+
* id: 'claude-opus-4-7',
|
|
503
|
+
* label: 'Claude Opus 4.7',
|
|
504
|
+
* provider: 'anthropic',
|
|
505
|
+
* apiKey: process.env.ANTHROPIC_API_KEY,
|
|
506
|
+
* capabilities: {tools: true, reasoning: true, attachments: true},
|
|
507
|
+
* },
|
|
508
|
+
* {
|
|
509
|
+
* id: 'gemini-3.1-pro',
|
|
510
|
+
* label: 'Gemini 3.1 Pro',
|
|
511
|
+
* provider: 'gemini',
|
|
512
|
+
* apiKey: process.env.GEMINI_API_KEY,
|
|
513
|
+
* capabilities: {tools: true, reasoning: true, attachments: true},
|
|
514
|
+
* },
|
|
515
|
+
* {
|
|
516
|
+
* id: 'llama3-local',
|
|
517
|
+
* label: 'Llama 3 (local)',
|
|
518
|
+
* provider: 'openai-compatible',
|
|
519
|
+
* baseURL: 'http://localhost:11434/v1',
|
|
520
|
+
* },
|
|
521
|
+
* ],
|
|
522
|
+
* defaultModel: 'gpt-4o',
|
|
523
|
+
* },
|
|
524
|
+
* });
|
|
525
|
+
* ```
|
|
526
|
+
*
|
|
527
|
+
* For project-specific guidance (conventions, patterns, naming rules, etc.),
|
|
528
|
+
* drop a `ROOT.md` file at the project root. Its contents are appended to
|
|
529
|
+
* the system prompt for every chat — similar to `AGENTS.md` / `CLAUDE.md`.
|
|
530
|
+
*/
|
|
531
|
+
ai?: AiConfig;
|
|
295
532
|
/**
|
|
296
533
|
* Experimental config options. Note: these are subject to change at any time.
|
|
297
534
|
*/
|
|
298
535
|
experiments?: {
|
|
299
536
|
/**
|
|
300
|
-
*
|
|
537
|
+
* @deprecated Use the top-level `ai` config instead. Setting this to
|
|
538
|
+
* `true` keeps the AI chat icon visible in the sidebar.
|
|
301
539
|
*/
|
|
302
540
|
ai?: boolean | CMSAIConfig;
|
|
303
541
|
/**
|
|
304
542
|
* Enables the v2 `TranslationsManager`.
|
|
305
543
|
*/
|
|
306
544
|
v2TranslationsManager?: boolean;
|
|
545
|
+
/**
|
|
546
|
+
* Enables the task manager (sidebar entry, home page card, and
|
|
547
|
+
* `/cms/tasks` routes).
|
|
548
|
+
*/
|
|
549
|
+
taskManager?: boolean;
|
|
307
550
|
};
|
|
308
551
|
/**
|
|
309
552
|
* Adjust console output verbosity. Default is `'info'`.
|
|
@@ -367,6 +610,39 @@ type CMSPluginOptions = {
|
|
|
367
610
|
* ```
|
|
368
611
|
*/
|
|
369
612
|
translations?: CMSTranslationService[];
|
|
613
|
+
/**
|
|
614
|
+
* Notification services that react to CMS actions and dispatch them to
|
|
615
|
+
* external channels (email, Slack, webhooks, etc.). Each service defines
|
|
616
|
+
* an optional server-side `onAction` handler.
|
|
617
|
+
*
|
|
618
|
+
* Example:
|
|
619
|
+
* ```ts
|
|
620
|
+
* cmsPlugin({
|
|
621
|
+
* notifications: [
|
|
622
|
+
* {
|
|
623
|
+
* id: 'sendgrid',
|
|
624
|
+
* label: 'SendGrid',
|
|
625
|
+
* onAction: async (ctx, action) => {
|
|
626
|
+
* if (action.action === 'doc.publish') {
|
|
627
|
+
* await sendgrid.send({ ... });
|
|
628
|
+
* }
|
|
629
|
+
* },
|
|
630
|
+
* },
|
|
631
|
+
* ],
|
|
632
|
+
* });
|
|
633
|
+
* ```
|
|
634
|
+
*/
|
|
635
|
+
notifications?: CMSNotificationService[];
|
|
636
|
+
/**
|
|
637
|
+
* Configuration for the spotlight / global search indexer. Use this to
|
|
638
|
+
* include or exclude specific collections or docs from being indexed.
|
|
639
|
+
*/
|
|
640
|
+
searchIndex?: CMSSearchIndexConfig;
|
|
641
|
+
/**
|
|
642
|
+
* Default UI variant for `oneOf` fields. Individual fields can still
|
|
643
|
+
* override this by setting their own `variant`. Defaults to `'dropdown'`.
|
|
644
|
+
*/
|
|
645
|
+
defaultOneOfVariant?: 'dropdown' | 'picker';
|
|
370
646
|
};
|
|
371
647
|
type CMSPlugin = Plugin & {
|
|
372
648
|
name: 'root-cms';
|
|
@@ -624,6 +900,8 @@ interface DataSource {
|
|
|
624
900
|
syncedBy?: string;
|
|
625
901
|
publishedAt?: Timestamp;
|
|
626
902
|
publishedBy?: string;
|
|
903
|
+
archivedAt?: Timestamp;
|
|
904
|
+
archivedBy?: string;
|
|
627
905
|
}
|
|
628
906
|
interface DataSourceData<T = any> {
|
|
629
907
|
dataSource: DataSource;
|
|
@@ -1005,6 +1283,16 @@ declare class RootCMSClient {
|
|
|
1005
1283
|
* Returns a data source configuration object.
|
|
1006
1284
|
*/
|
|
1007
1285
|
getDataSource(dataSourceId: string): Promise<DataSource | null>;
|
|
1286
|
+
/**
|
|
1287
|
+
* Archives a data source. Archived data sources cannot be synced or published.
|
|
1288
|
+
*/
|
|
1289
|
+
archiveDataSource(dataSourceId: string, options?: {
|
|
1290
|
+
archivedBy?: string;
|
|
1291
|
+
}): Promise<void>;
|
|
1292
|
+
/**
|
|
1293
|
+
* Unarchives a data source.
|
|
1294
|
+
*/
|
|
1295
|
+
unarchiveDataSource(dataSourceId: string): Promise<void>;
|
|
1008
1296
|
/**
|
|
1009
1297
|
* Syncs a data source to draft state.
|
|
1010
1298
|
*/
|
|
@@ -1014,6 +1302,11 @@ declare class RootCMSClient {
|
|
|
1014
1302
|
publishDataSource(dataSourceId: string, options?: {
|
|
1015
1303
|
publishedBy?: string;
|
|
1016
1304
|
}): Promise<void>;
|
|
1305
|
+
/**
|
|
1306
|
+
* Unpublishes a data source. Removes the `publishedAt`/`publishedBy`
|
|
1307
|
+
* metadata from the DataSource doc and deletes the `Data/published` doc.
|
|
1308
|
+
*/
|
|
1309
|
+
unpublishDataSource(dataSourceId: string): Promise<void>;
|
|
1017
1310
|
publishDataSources(dataSourceIds: string[], options?: {
|
|
1018
1311
|
publishedBy: string;
|
|
1019
1312
|
batch?: WriteBatch;
|
|
@@ -1256,4 +1549,4 @@ declare class BatchResponse {
|
|
|
1256
1549
|
private getTranslationsMap;
|
|
1257
1550
|
}
|
|
1258
1551
|
|
|
1259
|
-
export { type CMSAIConfig as $, type Action as A, type BatchRequestOptions as B, type CronUnit as C, type DocMode as D, type TranslationsDoc as E, BatchRequest as F, type GetDocOptions as G, type HttpMethod as H, BatchResponse as I, type Locale as J, type SourceString as K, type LoadTranslationsOptions as L, type TranslatedString as M, type TranslationsDocMode as N, type TranslationsLocaleDocHashMap as O, type TranslationsLocaleDocEntry as P, type MultiLocaleTranslationsMap as Q, RootCMSClient as R, type SetDocOptions as S, type TranslationsMap as T, type UserRole as U, type SingleLocaleTranslationsMap as V, TranslationsManager as W, buildTranslationsDbPath as X, buildTranslationsLocaleDocDbPath as Y, type CMSBuiltInSidebarTool as Z, type CMSUser as _, type LocaleTranslations as a, type
|
|
1552
|
+
export { type CMSAIConfig as $, type Action as A, type BatchRequestOptions as B, type CronUnit as C, type DocMode as D, type TranslationsDoc as E, BatchRequest as F, type GetDocOptions as G, type HttpMethod as H, BatchResponse as I, type Locale as J, type SourceString as K, type LoadTranslationsOptions as L, type TranslatedString as M, type TranslationsDocMode as N, type TranslationsLocaleDocHashMap as O, type TranslationsLocaleDocEntry as P, type MultiLocaleTranslationsMap as Q, RootCMSClient as R, type SetDocOptions as S, type TranslationsMap as T, type UserRole as U, type SingleLocaleTranslationsMap as V, TranslationsManager as W, buildTranslationsDbPath as X, buildTranslationsLocaleDocDbPath as Y, type CMSBuiltInSidebarTool as Z, type CMSUser as _, type LocaleTranslations as a, type CMSSearchIndexConfig as a0, type CMSSidebarTool as a1, type CMSPluginOptions as a2, type CMSPlugin as a3, cmsPlugin as a4, type AiConfig as a5, type AiModelConfig as a6, type AiProvider as a7, type CMSCheck as a8, type CheckResult as a9, type CheckContext as aa, type CheckStatus as ab, translationsCheck as ac, type TranslationsCheckOptions as ad, type CMSService as ae, type CMSServiceContext as af, type CMSNotificationService as ag, type NotificationResult as ah, type NotificationServiceContext as ai, type CMSTranslationService as aj, type TranslationExportResult as ak, type TranslationImportResult as al, type TranslationRow as am, type TranslationServiceContext as an, type Doc as b, type DataSourceCron as c, type DataSource as d, type DataSourceData as e, type DataSourceMode as f, type SaveDraftOptions as g, type UpdateDraftOptions as h, type ListDocsOptions as i, type GetCountOptions as j, type Translation as k, type Release as l, type ListActionsOptions as m, isRichTextData as n, getCmsPlugin as o, marshalData as p, normalizeData as q, type ArrayObject as r, marshalArray as s, toArrayObject as t, unmarshalData as u, unmarshalArray as v, translationsForLocale as w, parseDocId as x, type BatchRequestQuery as y, type BatchRequestQueryOptions as z };
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@blinkk/root';
|
|
2
2
|
import 'firebase-admin/app';
|
|
3
3
|
import 'firebase-admin/firestore';
|
|
4
|
-
export { A as Action, r as ArrayObject, F as BatchRequest, B as BatchRequestOptions, y as BatchRequestQuery, z as BatchRequestQueryOptions, I as BatchResponse, C as CronUnit, d as DataSource, c as DataSourceCron, e as DataSourceData, f as DataSourceMode, b as Doc, D as DocMode, j as GetCountOptions, G as GetDocOptions, H as HttpMethod, m as ListActionsOptions, i as ListDocsOptions, L as LoadTranslationsOptions, a as LocaleTranslations, l as Release, R as RootCMSClient, g as SaveDraftOptions, S as SetDocOptions, k as Translation, E as TranslationsDoc, T as TranslationsMap, h as UpdateDraftOptions, U as UserRole, o as getCmsPlugin, n as isRichTextData, s as marshalArray, p as marshalData, q as normalizeData, x as parseDocId, t as toArrayObject, w as translationsForLocale, v as unmarshalArray, u as unmarshalData } from './client-
|
|
5
|
-
import './schema-
|
|
4
|
+
export { A as Action, r as ArrayObject, F as BatchRequest, B as BatchRequestOptions, y as BatchRequestQuery, z as BatchRequestQueryOptions, I as BatchResponse, C as CronUnit, d as DataSource, c as DataSourceCron, e as DataSourceData, f as DataSourceMode, b as Doc, D as DocMode, j as GetCountOptions, G as GetDocOptions, H as HttpMethod, m as ListActionsOptions, i as ListDocsOptions, L as LoadTranslationsOptions, a as LocaleTranslations, l as Release, R as RootCMSClient, g as SaveDraftOptions, S as SetDocOptions, k as Translation, E as TranslationsDoc, T as TranslationsMap, h as UpdateDraftOptions, U as UserRole, o as getCmsPlugin, n as isRichTextData, s as marshalArray, p as marshalData, q as normalizeData, x as parseDocId, t as toArrayObject, w as translationsForLocale, v as unmarshalArray, u as unmarshalData } from './client-1puwLgNx.js';
|
|
5
|
+
import './schema-Db_xODoi.js';
|
package/dist/client.js
CHANGED
package/dist/core.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { R as RootCMSClient, D as DocMode, L as LoadTranslationsOptions, T as TranslationsMap, a as LocaleTranslations } from './client-
|
|
2
|
-
export { A as Action, r as ArrayObject, F as BatchRequest, B as BatchRequestOptions, y as BatchRequestQuery, z as BatchRequestQueryOptions, I as BatchResponse, C as CronUnit, d as DataSource, c as DataSourceCron, e as DataSourceData, f as DataSourceMode, b as Doc, j as GetCountOptions, G as GetDocOptions, H as HttpMethod, m as ListActionsOptions, i as ListDocsOptions, J as Locale, Q as MultiLocaleTranslationsMap, l as Release, g as SaveDraftOptions, S as SetDocOptions, V as SingleLocaleTranslationsMap, K as SourceString, M as TranslatedString, k as Translation, E as TranslationsDoc, N as TranslationsDocMode, P as TranslationsLocaleDocEntry, O as TranslationsLocaleDocHashMap, W as TranslationsManager, h as UpdateDraftOptions, U as UserRole, X as buildTranslationsDbPath, Y as buildTranslationsLocaleDocDbPath, o as getCmsPlugin, n as isRichTextData, s as marshalArray, p as marshalData, q as normalizeData, x as parseDocId, t as toArrayObject, w as translationsForLocale, v as unmarshalArray, u as unmarshalData } from './client-
|
|
1
|
+
import { R as RootCMSClient, D as DocMode, L as LoadTranslationsOptions, T as TranslationsMap, a as LocaleTranslations } from './client-1puwLgNx.js';
|
|
2
|
+
export { A as Action, r as ArrayObject, F as BatchRequest, B as BatchRequestOptions, y as BatchRequestQuery, z as BatchRequestQueryOptions, I as BatchResponse, C as CronUnit, d as DataSource, c as DataSourceCron, e as DataSourceData, f as DataSourceMode, b as Doc, j as GetCountOptions, G as GetDocOptions, H as HttpMethod, m as ListActionsOptions, i as ListDocsOptions, J as Locale, Q as MultiLocaleTranslationsMap, l as Release, g as SaveDraftOptions, S as SetDocOptions, V as SingleLocaleTranslationsMap, K as SourceString, M as TranslatedString, k as Translation, E as TranslationsDoc, N as TranslationsDocMode, P as TranslationsLocaleDocEntry, O as TranslationsLocaleDocHashMap, W as TranslationsManager, h as UpdateDraftOptions, U as UserRole, X as buildTranslationsDbPath, Y as buildTranslationsLocaleDocDbPath, o as getCmsPlugin, n as isRichTextData, s as marshalArray, p as marshalData, q as normalizeData, x as parseDocId, t as toArrayObject, w as translationsForLocale, v as unmarshalArray, u as unmarshalData } from './client-1puwLgNx.js';
|
|
3
3
|
import { Request, RootConfig, Response, RouteParams, GetStaticProps, GetStaticPaths } 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-Db_xODoi.js';
|
|
6
6
|
import 'firebase-admin/app';
|
|
7
7
|
|
|
8
8
|
/**
|
package/dist/core.js
CHANGED
|
@@ -16,7 +16,8 @@ import {
|
|
|
16
16
|
translationsForLocale,
|
|
17
17
|
unmarshalArray,
|
|
18
18
|
unmarshalData
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-F4SODS5S.js";
|
|
20
|
+
import "./chunk-CRK7N6RR.js";
|
|
20
21
|
import {
|
|
21
22
|
__export
|
|
22
23
|
} from "./chunk-MLKGABMK.js";
|
|
@@ -480,6 +481,7 @@ __export(schema_exports, {
|
|
|
480
481
|
datetime: () => datetime,
|
|
481
482
|
define: () => define,
|
|
482
483
|
defineCollection: () => defineCollection,
|
|
484
|
+
definePreset: () => definePreset,
|
|
483
485
|
defineSchema: () => defineSchema,
|
|
484
486
|
file: () => file,
|
|
485
487
|
glob: () => glob,
|
|
@@ -488,6 +490,7 @@ __export(schema_exports, {
|
|
|
488
490
|
number: () => number,
|
|
489
491
|
object: () => object,
|
|
490
492
|
oneOf: () => oneOf,
|
|
493
|
+
preset: () => preset,
|
|
491
494
|
reference: () => reference,
|
|
492
495
|
references: () => references,
|
|
493
496
|
richtext: () => richtext,
|
|
@@ -560,6 +563,10 @@ function defineSchema(schema) {
|
|
|
560
563
|
return schema;
|
|
561
564
|
}
|
|
562
565
|
var define = defineSchema;
|
|
566
|
+
function definePreset(preset2) {
|
|
567
|
+
return preset2;
|
|
568
|
+
}
|
|
569
|
+
var preset = definePreset;
|
|
563
570
|
function defineCollection(collection2) {
|
|
564
571
|
return collection2;
|
|
565
572
|
}
|
package/dist/functions.js
CHANGED
package/dist/plugin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@blinkk/root';
|
|
2
2
|
import 'firebase-admin/app';
|
|
3
3
|
import 'firebase-admin/firestore';
|
|
4
|
-
export { $ as CMSAIConfig, Z as CMSBuiltInSidebarTool,
|
|
5
|
-
import './schema-
|
|
4
|
+
export { a5 as AiConfig, a6 as AiModelConfig, a7 as AiProvider, $ as CMSAIConfig, Z as CMSBuiltInSidebarTool, a8 as CMSCheck, ag as CMSNotificationService, a3 as CMSPlugin, a2 as CMSPluginOptions, a0 as CMSSearchIndexConfig, ae as CMSService, af as CMSServiceContext, a1 as CMSSidebarTool, aj as CMSTranslationService, _ as CMSUser, aa as CheckContext, a9 as CheckResult, ab as CheckStatus, ah as NotificationResult, ai as NotificationServiceContext, ak as TranslationExportResult, al as TranslationImportResult, am as TranslationRow, an as TranslationServiceContext, ad as TranslationsCheckOptions, a4 as cmsPlugin, ac as translationsCheck } from './client-1puwLgNx.js';
|
|
5
|
+
import './schema-Db_xODoi.js';
|