@sonicjs-cms/core 3.0.0-beta.2 → 3.0.0-beta.20
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 +48 -49
- package/dist/admin-documents-form.template-DDSH6ROU.js +6 -0
- package/dist/{admin-documents-form.template-NLSI6Z42.js.map → admin-documents-form.template-DDSH6ROU.js.map} +1 -1
- package/dist/admin-documents-form.template-LSZKGA5J.cjs +19 -0
- package/dist/{admin-layout-catalyst.template-WHJGSWWD.js.map → admin-documents-form.template-LSZKGA5J.cjs.map} +1 -1
- package/dist/{filter-bar.template-DlVYMk-T.d.ts → admin-layout-catalyst.template-DrwDUfsE.d.cts} +25 -1
- package/dist/{filter-bar.template-DlVYMk-T.d.cts → admin-layout-catalyst.template-DrwDUfsE.d.ts} +25 -1
- package/dist/admin-layout-catalyst.template-KDHKVLXR.cjs +21 -0
- package/dist/{admin-layout-catalyst.template-ZK5HD545.cjs.map → admin-layout-catalyst.template-KDHKVLXR.cjs.map} +1 -1
- package/dist/admin-layout-catalyst.template-YQ4EMF2J.js +7 -0
- package/dist/{admin-documents-form.template-KN7JF66Q.cjs.map → admin-layout-catalyst.template-YQ4EMF2J.js.map} +1 -1
- package/dist/{app-Bo0X1OWX.d.ts → app-01M0dIwt.d.ts} +1 -1
- package/dist/{app-Do66yCcV.d.cts → app-aj39TGHB.d.cts} +1 -1
- package/dist/{chunk-ZEZ245PW.js → chunk-2XAQTPAE.js} +4 -236
- package/dist/chunk-2XAQTPAE.js.map +1 -0
- package/dist/{chunk-BDDABDAB.cjs → chunk-36Z3AKX3.cjs} +3 -239
- package/dist/chunk-36Z3AKX3.cjs.map +1 -0
- package/dist/{chunk-VXE42MYF.cjs → chunk-3E7IROND.cjs} +695 -428
- package/dist/chunk-3E7IROND.cjs.map +1 -0
- package/dist/{chunk-BLMTL57B.js → chunk-3TMTYJAJ.js} +26 -4
- package/dist/chunk-3TMTYJAJ.js.map +1 -0
- package/dist/{chunk-AAWNRBRB.cjs → chunk-4SHNHNRP.cjs} +95 -20
- package/dist/chunk-4SHNHNRP.cjs.map +1 -0
- package/dist/{chunk-QAYFOER6.cjs → chunk-5ARIHAGN.cjs} +285 -3
- package/dist/chunk-5ARIHAGN.cjs.map +1 -0
- package/dist/{chunk-XW56B23A.cjs → chunk-5RSB5SEK.cjs} +4 -4
- package/dist/{chunk-XW56B23A.cjs.map → chunk-5RSB5SEK.cjs.map} +1 -1
- package/dist/{chunk-VD2EA3WT.js → chunk-5UCMLBRQ.js} +328 -62
- package/dist/chunk-5UCMLBRQ.js.map +1 -0
- package/dist/{chunk-3TB6AT6X.js → chunk-5V62WT6M.js} +35 -4
- package/dist/chunk-5V62WT6M.js.map +1 -0
- package/dist/{chunk-LRZIAW7U.cjs → chunk-AQJEMVAY.cjs} +3 -3
- package/dist/chunk-AQJEMVAY.cjs.map +1 -0
- package/dist/{chunk-WULONYGB.cjs → chunk-CRGUD4KC.cjs} +9 -9
- package/dist/{chunk-WULONYGB.cjs.map → chunk-CRGUD4KC.cjs.map} +1 -1
- package/dist/{chunk-NLJVSER2.js → chunk-DSXEVMOM.js} +3 -2
- package/dist/chunk-DSXEVMOM.js.map +1 -0
- package/dist/{chunk-H2AXVCLS.cjs → chunk-DTGCXWWM.cjs} +141 -74
- package/dist/chunk-DTGCXWWM.cjs.map +1 -0
- package/dist/{chunk-NUKJ54GA.cjs → chunk-GMMCCIQO.cjs} +6 -6
- package/dist/{chunk-NUKJ54GA.cjs.map → chunk-GMMCCIQO.cjs.map} +1 -1
- package/dist/{chunk-6OUHGKFD.js → chunk-GMZ5TGYP.js} +3 -3
- package/dist/{chunk-6OUHGKFD.js.map → chunk-GMZ5TGYP.js.map} +1 -1
- package/dist/{chunk-6JQOUUOB.js → chunk-JQISFW6U.js} +3 -3
- package/dist/{chunk-6JQOUUOB.js.map → chunk-JQISFW6U.js.map} +1 -1
- package/dist/{chunk-NAVPFIG5.cjs → chunk-K623Q6WD.cjs} +35 -3
- package/dist/chunk-K623Q6WD.cjs.map +1 -0
- package/dist/{chunk-JEQ7FLOD.cjs → chunk-KIGVVO6N.cjs} +16 -10
- package/dist/chunk-KIGVVO6N.cjs.map +1 -0
- package/dist/{chunk-2CB4KY7I.cjs → chunk-LTZ5WYOK.cjs} +29 -7
- package/dist/chunk-LTZ5WYOK.cjs.map +1 -0
- package/dist/{chunk-YHSQVQXX.js → chunk-MYQ7KZUQ.js} +135 -68
- package/dist/chunk-MYQ7KZUQ.js.map +1 -0
- package/dist/{chunk-DNQCEKUK.cjs → chunk-N32OWET6.cjs} +5 -5
- package/dist/{chunk-DNQCEKUK.cjs.map → chunk-N32OWET6.cjs.map} +1 -1
- package/dist/{chunk-HDWE5FRJ.js → chunk-OBA2RYZN.js} +3 -3
- package/dist/{chunk-HDWE5FRJ.js.map → chunk-OBA2RYZN.js.map} +1 -1
- package/dist/{chunk-MVIZJOO5.cjs → chunk-PXNTCCPE.cjs} +8 -8
- package/dist/{chunk-MVIZJOO5.cjs.map → chunk-PXNTCCPE.cjs.map} +1 -1
- package/dist/{chunk-ZGGXCFR6.js → chunk-RDH6PUOP.js} +282 -4
- package/dist/chunk-RDH6PUOP.js.map +1 -0
- package/dist/{chunk-EF2NQUIQ.js → chunk-RMRJGMDE.js} +3 -3
- package/dist/{chunk-EF2NQUIQ.js.map → chunk-RMRJGMDE.js.map} +1 -1
- package/dist/{chunk-IVPRUGTY.js → chunk-SOZUG52O.js} +4 -4
- package/dist/{chunk-IVPRUGTY.js.map → chunk-SOZUG52O.js.map} +1 -1
- package/dist/{chunk-DSA4UX5B.cjs → chunk-TQG5FNNR.cjs} +3 -2
- package/dist/chunk-TQG5FNNR.cjs.map +1 -0
- package/dist/{chunk-GCDZZNIN.js → chunk-UWUP2VMT.js} +16 -10
- package/dist/chunk-UWUP2VMT.js.map +1 -0
- package/dist/{chunk-IESEVHXL.js → chunk-VVYVFCML.js} +12 -3
- package/dist/chunk-VVYVFCML.js.map +1 -0
- package/dist/{chunk-NMPEMSU4.js → chunk-W53J3BJ2.js} +3 -3
- package/dist/chunk-W53J3BJ2.js.map +1 -0
- package/dist/{chunk-RZ6H7OZK.js → chunk-WCA4VENG.js} +87 -12
- package/dist/chunk-WCA4VENG.js.map +1 -0
- package/dist/{chunk-HIKBY7MS.cjs → chunk-XWVDSM2L.cjs} +12 -3
- package/dist/chunk-XWVDSM2L.cjs.map +1 -0
- package/dist/{collection-config-JgHOpFCG.d.ts → collection-config-BTzAvKt2.d.cts} +25 -0
- package/dist/{collection-config-JgHOpFCG.d.cts → collection-config-BTzAvKt2.d.ts} +25 -0
- package/dist/config-6FB2BXMP.js +6 -0
- package/dist/{config-HFXANXCC.js.map → config-6FB2BXMP.js.map} +1 -1
- package/dist/config-OCH7S4WK.cjs +19 -0
- package/dist/{config-ON6FNMYX.cjs.map → config-OCH7S4WK.cjs.map} +1 -1
- package/dist/{define-plugin-BzNHc1ZI.d.ts → define-plugin-BYIey6sp.d.ts} +1 -1
- package/dist/{define-plugin-IWDKYaVm.d.cts → define-plugin-DsKiGu1q.d.cts} +1 -1
- package/dist/document-projection-4HG75S5S.js +4 -0
- package/dist/{document-projection-YYMC6I4U.js.map → document-projection-4HG75S5S.js.map} +1 -1
- package/dist/document-projection-JQHSTSFD.cjs +13 -0
- package/dist/{document-projection-TDWRJX3Z.cjs.map → document-projection-JQHSTSFD.cjs.map} +1 -1
- package/dist/index.cjs +928 -378
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +200 -12
- package/dist/index.d.ts +200 -12
- package/dist/index.js +612 -75
- package/dist/index.js.map +1 -1
- package/dist/middleware.cjs +37 -34
- package/dist/middleware.d.cts +2 -2
- package/dist/middleware.d.ts +2 -2
- package/dist/middleware.js +8 -5
- package/dist/migrations-HZJ6U6SX.js +4 -0
- package/dist/{migrations-WCAVBD7C.js.map → migrations-HZJ6U6SX.js.map} +1 -1
- package/dist/migrations-VQAFXMU7.cjs +13 -0
- package/dist/{migrations-NJJWQUKK.cjs.map → migrations-VQAFXMU7.cjs.map} +1 -1
- package/dist/{plugin-bootstrap-B8ThJU21.d.cts → plugin-bootstrap-BHWQ2df8.d.cts} +1 -1
- package/dist/{plugin-bootstrap-qu8hJgUt.d.ts → plugin-bootstrap-Bj4fxX1q.d.ts} +1 -1
- package/dist/plugins.cjs +40 -40
- package/dist/plugins.d.cts +2 -2
- package/dist/plugins.d.ts +2 -2
- package/dist/plugins.js +3 -3
- package/dist/rbac-7QZ4JZ2E.cjs +14 -0
- package/dist/{rbac-VONLJJKB.cjs.map → rbac-7QZ4JZ2E.cjs.map} +1 -1
- package/dist/rbac-Y43IEQOP.js +5 -0
- package/dist/{rbac-O73MFKDA.js.map → rbac-Y43IEQOP.js.map} +1 -1
- package/dist/routes.cjs +34 -34
- package/dist/routes.d.cts +2 -2
- package/dist/routes.d.ts +2 -2
- package/dist/routes.js +14 -14
- package/dist/services.cjs +42 -42
- package/dist/services.d.cts +16 -3
- package/dist/services.d.ts +16 -3
- package/dist/services.js +3 -3
- package/dist/{telemetry-B9vIV4wh.d.cts → telemetry-Cku1ax74.d.cts} +1 -1
- package/dist/{telemetry-B9vIV4wh.d.ts → telemetry-Cku1ax74.d.ts} +1 -1
- package/dist/templates.cjs +17 -17
- package/dist/templates.d.cts +2 -24
- package/dist/templates.d.ts +2 -24
- package/dist/templates.js +3 -3
- package/dist/{types-Dea1eNxU.d.ts → types-DT7XN5TX.d.cts} +1 -1
- package/dist/{types-Dea1eNxU.d.cts → types-DT7XN5TX.d.ts} +1 -1
- package/dist/types.d.cts +2 -2
- package/dist/types.d.ts +2 -2
- package/dist/utils.cjs +8 -8
- package/dist/utils.d.cts +2 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +2 -2
- package/package.json +1 -1
- package/dist/admin-documents-form.template-KN7JF66Q.cjs +0 -19
- package/dist/admin-documents-form.template-NLSI6Z42.js +0 -6
- package/dist/admin-layout-catalyst.template-WHJGSWWD.js +0 -7
- package/dist/admin-layout-catalyst.template-ZK5HD545.cjs +0 -17
- package/dist/chunk-2CB4KY7I.cjs.map +0 -1
- package/dist/chunk-3TB6AT6X.js.map +0 -1
- package/dist/chunk-AAWNRBRB.cjs.map +0 -1
- package/dist/chunk-BDDABDAB.cjs.map +0 -1
- package/dist/chunk-BLMTL57B.js.map +0 -1
- package/dist/chunk-DSA4UX5B.cjs.map +0 -1
- package/dist/chunk-GCDZZNIN.js.map +0 -1
- package/dist/chunk-H2AXVCLS.cjs.map +0 -1
- package/dist/chunk-HIKBY7MS.cjs.map +0 -1
- package/dist/chunk-IESEVHXL.js.map +0 -1
- package/dist/chunk-JEQ7FLOD.cjs.map +0 -1
- package/dist/chunk-LRZIAW7U.cjs.map +0 -1
- package/dist/chunk-NAVPFIG5.cjs.map +0 -1
- package/dist/chunk-NLJVSER2.js.map +0 -1
- package/dist/chunk-NMPEMSU4.js.map +0 -1
- package/dist/chunk-QAYFOER6.cjs.map +0 -1
- package/dist/chunk-RZ6H7OZK.js.map +0 -1
- package/dist/chunk-VD2EA3WT.js.map +0 -1
- package/dist/chunk-VXE42MYF.cjs.map +0 -1
- package/dist/chunk-YHSQVQXX.js.map +0 -1
- package/dist/chunk-ZEZ245PW.js.map +0 -1
- package/dist/chunk-ZGGXCFR6.js.map +0 -1
- package/dist/config-HFXANXCC.js +0 -6
- package/dist/config-ON6FNMYX.cjs +0 -19
- package/dist/document-projection-TDWRJX3Z.cjs +0 -13
- package/dist/document-projection-YYMC6I4U.js +0 -4
- package/dist/migrations-NJJWQUKK.cjs +0 -13
- package/dist/migrations-WCAVBD7C.js +0 -4
- package/dist/rbac-O73MFKDA.js +0 -5
- package/dist/rbac-VONLJJKB.cjs +0 -14
package/dist/index.d.cts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
export { B as Bindings, a as BootIsolateFn, b as SonicJSApp, S as SonicJSConfig, V as Variables, c as createSonicJSApp, s as setupCoreMiddleware, d as setupCoreRoutes } from './app-
|
|
2
|
-
import { o as DefinedPlugin } from './define-plugin-
|
|
3
|
-
export { B as BooleanField, e as ConfigSchema, f as ConfigSchemaField, h as CronContext, i as CronDeclaration, j as CronDispatchResult, k as CronTickEvent, l as CronablePlugin, H as HookSystemImpl, r as HookUtils, N as NumberField, P as ParsedField, v as PluginManagerClass, an as PluginMenuEntry, x as PluginRegistryImpl, y as PluginValidatorClass, z as PluginsRegistry, A as RegisterPluginsError, G as RegisterPluginsErrorReason, I as RegisterPluginsHostContext, J as RegisterablePlugin, K as RegistryEntry, ao as ResolvedPluginMenuEntry, L as ScopedHookSystemClass, O as SelectField, Q as SettingsFor, U as StringField, Y as applySchemaDefaults, _ as collectCronSchedules, $ as collectCrons, a2 as createScheduledHandler, a3 as definePlugin, a4 as dispatchCronTick, a5 as getHookSystem, ap as getPluginMenu, a6 as getTypedHooks, a8 as hasHookSystem, a9 as isDefinedPlugin, ae as parseConfigSchema, af as parseFormDataToSettings, ah as registerPlugins, ai as renderSchemaFields, aj as resetHookSystem, aq as resetPluginMenu, ar as resolvePluginMenuItems, ak as setHookSystem, as as setPluginMenu } from './define-plugin-
|
|
1
|
+
export { B as Bindings, a as BootIsolateFn, b as SonicJSApp, S as SonicJSConfig, V as Variables, c as createSonicJSApp, s as setupCoreMiddleware, d as setupCoreRoutes } from './app-aj39TGHB.cjs';
|
|
2
|
+
import { o as DefinedPlugin } from './define-plugin-DsKiGu1q.cjs';
|
|
3
|
+
export { B as BooleanField, e as ConfigSchema, f as ConfigSchemaField, h as CronContext, i as CronDeclaration, j as CronDispatchResult, k as CronTickEvent, l as CronablePlugin, H as HookSystemImpl, r as HookUtils, N as NumberField, P as ParsedField, v as PluginManagerClass, an as PluginMenuEntry, x as PluginRegistryImpl, y as PluginValidatorClass, z as PluginsRegistry, A as RegisterPluginsError, G as RegisterPluginsErrorReason, I as RegisterPluginsHostContext, J as RegisterablePlugin, K as RegistryEntry, ao as ResolvedPluginMenuEntry, L as ScopedHookSystemClass, O as SelectField, Q as SettingsFor, U as StringField, Y as applySchemaDefaults, _ as collectCronSchedules, $ as collectCrons, a2 as createScheduledHandler, a3 as definePlugin, a4 as dispatchCronTick, a5 as getHookSystem, ap as getPluginMenu, a6 as getTypedHooks, a8 as hasHookSystem, a9 as isDefinedPlugin, ae as parseConfigSchema, af as parseFormDataToSettings, ah as registerPlugins, ai as renderSchemaFields, aj as resetHookSystem, aq as resetPluginMenu, ar as resolvePluginMenuItems, ak as setHookSystem, as as setPluginMenu } from './define-plugin-DsKiGu1q.cjs';
|
|
4
4
|
import { D1Database as D1Database$1 } from '@cloudflare/workers-types';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { E as EmailProvider, N as NormalizedEmailMessage, t as SendResult } from './types-DT7XN5TX.cjs';
|
|
7
|
+
export { q as EmailLogRow } from './types-DT7XN5TX.cjs';
|
|
8
|
+
import { s as schema } from './plugin-bootstrap-BHWQ2df8.cjs';
|
|
9
|
+
export { m as Content, C as CorePlugin, n as DbPlugin, o as DbPluginHook, L as LogCategory, p as LogConfig, a as LogEntry, b as LogFilter, c as LogLevel, d as Logger, q as Media, M as Migration, e as MigrationService, f as MigrationStatus, N as NewContent, t as NewLogConfig, u as NewMedia, w as NewPlugin, x as NewPluginActivityLog, y as NewPluginAsset, z as NewPluginHook, A as NewPluginRoute, B as NewSystemLog, D as NewUser, E as NewWorkflowHistory, F as PluginActivityLog, G as PluginAsset, P as PluginBootstrapService, H as PluginRoute, g as PluginServiceClass, S as SystemLog, U as User, W as WorkflowHistory, I as apiTokens, J as content, K as contentVersions, h as getAvailableCollectionNames, i as getLogger, j as initLogger, O as insertContentSchema, Q as insertLogConfigSchema, R as insertMediaSchema, T as insertPluginActivityLogSchema, V as insertPluginAssetSchema, X as insertPluginHookSchema, Y as insertPluginRouteSchema, Z as insertPluginSchema, _ as insertSystemLogSchema, $ as insertUserSchema, a0 as insertWorkflowHistorySchema, l as loadCollectionConfig, k as loadCollectionConfigs, a1 as logConfig, a2 as media, a3 as pluginActivityLog, a4 as pluginAssets, a5 as pluginHooks, a6 as pluginRoutes, a7 as plugins, r as registerCollections, a8 as selectContentSchema, a9 as selectLogConfigSchema, aa as selectMediaSchema, ab as selectPluginActivityLogSchema, ac as selectPluginAssetSchema, ad as selectPluginHookSchema, ae as selectPluginRouteSchema, af as selectPluginSchema, ag as selectSystemLogSchema, ah as selectUserSchema, ai as selectWorkflowHistorySchema, aj as systemLogs, ak as users, v as validateCollectionConfig, al as workflowHistory } from './plugin-bootstrap-BHWQ2df8.cjs';
|
|
10
|
+
import { e as FieldType } from './collection-config-BTzAvKt2.cjs';
|
|
11
|
+
export { C as CollectionConfig, b as CollectionConfigModule, c as CollectionSchema, d as CollectionSyncResult, F as FieldConfig } from './collection-config-BTzAvKt2.cjs';
|
|
11
12
|
export { AuthManager, Permission, PermissionManager, UserPermissions, bootstrapMiddleware, cacheHeaders, compressionMiddleware, detailedLoggingMiddleware, getActivePlugins, isPluginActive, logActivity, loggingMiddleware, optionalAuth, performanceLoggingMiddleware, requireActivePlugin, requireActivePlugins, requireAnyPermission, requireAuth, requirePermission, requireRole, securityHeaders, securityLoggingMiddleware } from './middleware.cjs';
|
|
12
13
|
export { ROUTES_INFO, adminApiRoutes, adminCheckboxRoutes, adminCollectionsRoutes, adminContentRoutes, adminDashboardRoutes, adminLogsRoutes, adminMediaRoutes, adminPluginRoutes, adminSettingsRoutes, adminUsersRoutes, apiContentCrudRoutes, apiMediaRoutes, apiRoutes, apiSystemRoutes, authRoutes } from './routes.cjs';
|
|
13
|
-
export { A as AlertData, C as ConfirmationDialogOptions, F as Filter,
|
|
14
|
+
export { A as AdminLayoutCatalystData, a as AlertData, C as ConfirmationDialogOptions, F as Filter, b as FilterBarData, c as FilterOption, d as FormData, e as FormField, P as PaginationData, T as TableColumn, f as TableData, g as getConfirmationDialogScript, r as renderAdminLayoutCatalyst, h as renderAlert, i as renderConfirmationDialog, j as renderFilterBar, k as renderForm, l as renderFormField, m as renderPagination, n as renderTable } from './admin-layout-catalyst.template-DrwDUfsE.cjs';
|
|
14
15
|
export { A as AuthService, C as ContentService, H as HOOKS, a as HookContext, b as HookHandler, c as HookName, d as HookSystem, M as MediaService, P as Plugin, f as PluginAdminPage, g as PluginBuilderOptions, h as PluginComponent, i as PluginConfig, j as PluginContext, k as PluginHook, l as PluginLogger, m as PluginManager, n as PluginMenuItem, o as PluginMiddleware, p as PluginModel, q as PluginRegistry, r as PluginRoutes, s as PluginService, t as PluginStatus, u as PluginValidationResult, v as PluginValidator, S as ScopedHookSystem } from './plugin-DDYetMF-.cjs';
|
|
15
16
|
export { P as PluginManifest } from './plugin-manifest-Dpy8wxIB.cjs';
|
|
16
17
|
export { F as FilterCondition, a as FilterGroup, b as FilterOperator, Q as QueryFilter, c as QueryFilterBuilder, d as QueryResult, S as SONICJS_VERSION, T as TemplateRenderer, e as buildQuery, f as escapeHtml, g as getCoreVersion, m as metricsTracker, r as renderTemplate, s as sanitizeInput, h as sanitizeObject, t as templateRenderer } from './version-DFTyGfIH.cjs';
|
|
@@ -21,11 +22,11 @@ import 'better-auth';
|
|
|
21
22
|
import 'better-auth/plugins/magic-link';
|
|
22
23
|
import 'better-call';
|
|
23
24
|
import 'zod/v4/core';
|
|
24
|
-
import 'zod';
|
|
25
25
|
import 'hono';
|
|
26
26
|
import 'drizzle-zod';
|
|
27
27
|
import 'drizzle-orm/sqlite-core';
|
|
28
28
|
import 'hono/types';
|
|
29
|
+
import 'hono/utils/html';
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
32
|
* Wrangler.toml [triggers] cron codegen
|
|
@@ -212,6 +213,182 @@ declare class RbacService {
|
|
|
212
213
|
|
|
213
214
|
declare function bootstrapDocumentTypes(db: D1Database$1): Promise<void>;
|
|
214
215
|
|
|
216
|
+
type Permission = 'read' | 'create' | 'update' | 'delete' | 'publish' | 'manage';
|
|
217
|
+
type PrincipalType = 'user' | 'role' | 'group' | 'public' | 'token';
|
|
218
|
+
type RefStrength = 'strong' | 'weak';
|
|
219
|
+
type QueryableFieldKind = 'scalar' | 'facet' | 'reference';
|
|
220
|
+
type DocumentStatus = 'draft' | 'published' | 'archived';
|
|
221
|
+
interface QueryableField {
|
|
222
|
+
name: string;
|
|
223
|
+
path?: string;
|
|
224
|
+
kind: QueryableFieldKind;
|
|
225
|
+
type?: 'text' | 'number' | 'integer' | 'boolean' | 'date';
|
|
226
|
+
column?: string;
|
|
227
|
+
refStrength?: RefStrength;
|
|
228
|
+
}
|
|
229
|
+
interface DocumentTypeSettings {
|
|
230
|
+
baseGrants?: Record<string, Permission[]>;
|
|
231
|
+
maxVersionsPerRoot?: number;
|
|
232
|
+
pii?: boolean;
|
|
233
|
+
/** Hide this type from the admin content list and all-view (e.g. internal system types like 'plugin'). */
|
|
234
|
+
internal?: boolean;
|
|
235
|
+
/**
|
|
236
|
+
* Shared/global type: its documents are NOT tenant-scoped — they live in one shared pool and are
|
|
237
|
+
* visible from every tenant. Opt-in (default false). When false, the type is tenant-isolated like
|
|
238
|
+
* everything else. See `effectiveTenantForType` (services/document-request-context.ts).
|
|
239
|
+
*/
|
|
240
|
+
global?: boolean;
|
|
241
|
+
/**
|
|
242
|
+
* Retain historical version rows for this type. Default false.
|
|
243
|
+
* When false: saveDraft updates the working draft row in place and publish deletes the
|
|
244
|
+
* superseded published row (at most ~2 rows per root, no history accumulation).
|
|
245
|
+
* When true: new row per saveDraft + prune to maxVersionsPerRoot (the versioning-plugin opts types in).
|
|
246
|
+
*/
|
|
247
|
+
versioning?: boolean;
|
|
248
|
+
}
|
|
249
|
+
interface Document {
|
|
250
|
+
id: string;
|
|
251
|
+
rootId: string;
|
|
252
|
+
typeId: string;
|
|
253
|
+
typeVersion: number;
|
|
254
|
+
versionOfId: string | null;
|
|
255
|
+
versionNumber: number;
|
|
256
|
+
isCurrentDraft: boolean;
|
|
257
|
+
isPublished: boolean;
|
|
258
|
+
status: DocumentStatus;
|
|
259
|
+
parentRootId: string;
|
|
260
|
+
slug: string | null;
|
|
261
|
+
path: string | null;
|
|
262
|
+
title: string | null;
|
|
263
|
+
zone: string | null;
|
|
264
|
+
sortOrder: number;
|
|
265
|
+
visible: boolean;
|
|
266
|
+
publishedAt: number | null;
|
|
267
|
+
scheduledAt: number | null;
|
|
268
|
+
expiresAt: number | null;
|
|
269
|
+
deletedAt: number | null;
|
|
270
|
+
tenantId: string;
|
|
271
|
+
locale: string;
|
|
272
|
+
translationGroupId: string;
|
|
273
|
+
data: Record<string, unknown>;
|
|
274
|
+
metadata: Record<string, unknown>;
|
|
275
|
+
ownerId: string | null;
|
|
276
|
+
createdBy: string | null;
|
|
277
|
+
updatedBy: string | null;
|
|
278
|
+
createdAt: number;
|
|
279
|
+
updatedAt: number;
|
|
280
|
+
}
|
|
281
|
+
interface PrincipalRef {
|
|
282
|
+
type: PrincipalType;
|
|
283
|
+
id: string;
|
|
284
|
+
}
|
|
285
|
+
declare const createDocumentSchema: z.ZodObject<{
|
|
286
|
+
typeId: z.ZodString;
|
|
287
|
+
tenantId: z.ZodDefault<z.ZodString>;
|
|
288
|
+
locale: z.ZodDefault<z.ZodString>;
|
|
289
|
+
parentRootId: z.ZodDefault<z.ZodString>;
|
|
290
|
+
slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
291
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
292
|
+
zone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
293
|
+
sortOrder: z.ZodDefault<z.ZodNumber>;
|
|
294
|
+
visible: z.ZodDefault<z.ZodBoolean>;
|
|
295
|
+
scheduledAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
296
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
297
|
+
data: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
298
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
299
|
+
ownerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
300
|
+
publishOnCreate: z.ZodDefault<z.ZodBoolean>;
|
|
301
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
302
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
303
|
+
}, z.core.$strip>;
|
|
304
|
+
declare const updateDocumentSchema: z.ZodObject<{
|
|
305
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
306
|
+
slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
307
|
+
zone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
308
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
309
|
+
visible: z.ZodOptional<z.ZodBoolean>;
|
|
310
|
+
scheduledAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
311
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
312
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
313
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
314
|
+
updatedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
315
|
+
}, z.core.$strip>;
|
|
316
|
+
type CreateDocumentInput = z.infer<typeof createDocumentSchema>;
|
|
317
|
+
type UpdateDocumentInput = z.infer<typeof updateDocumentSchema>;
|
|
318
|
+
|
|
319
|
+
type ListStatus = 'published' | 'draft' | 'all';
|
|
320
|
+
interface ListDocumentsOptions {
|
|
321
|
+
typeId?: string;
|
|
322
|
+
/** Which lifecycle axis to list: published row, current-draft row, or either. */
|
|
323
|
+
status?: ListStatus;
|
|
324
|
+
locale?: string;
|
|
325
|
+
parentRootId?: string;
|
|
326
|
+
limit?: number;
|
|
327
|
+
cursorUpdatedAt?: number;
|
|
328
|
+
cursorId?: string;
|
|
329
|
+
now?: number;
|
|
330
|
+
/** Resolved generated-column filters, e.g. { column: 'q_tst_rating', value: 4 }. Caller maps
|
|
331
|
+
* field→column via the type's queryableFields; column names are format-guarded here too. */
|
|
332
|
+
scalarFilters?: Array<{
|
|
333
|
+
column: string;
|
|
334
|
+
value: string | number;
|
|
335
|
+
}>;
|
|
336
|
+
/** Multi-valued facet filter, e.g. { field: 'tags', value: 'homepage' }. Bound as params. */
|
|
337
|
+
facetFilter?: {
|
|
338
|
+
field: string;
|
|
339
|
+
value: string;
|
|
340
|
+
};
|
|
341
|
+
/** Generated-column to sort by (else keyset on updated_at). Format-guarded. */
|
|
342
|
+
sortColumn?: string | null;
|
|
343
|
+
sortDir?: 'ASC' | 'DESC';
|
|
344
|
+
/** Apply the schedule window (scheduled_at/expires_at) — public reads only. */
|
|
345
|
+
timeWindow?: boolean;
|
|
346
|
+
}
|
|
347
|
+
declare class DocumentRepository {
|
|
348
|
+
private db;
|
|
349
|
+
private tenantId;
|
|
350
|
+
private permissions;
|
|
351
|
+
constructor(db: D1Database$1, tenantId: string);
|
|
352
|
+
getById(id: string): Promise<Document | null>;
|
|
353
|
+
getCurrentDraft(rootId: string): Promise<Document | null>;
|
|
354
|
+
getPublished(rootId: string): Promise<Document | null>;
|
|
355
|
+
list(opts?: ListDocumentsOptions): Promise<Document[]>;
|
|
356
|
+
listPublished(opts?: ListDocumentsOptions): Promise<Document[]>;
|
|
357
|
+
listDrafts(opts?: ListDocumentsOptions): Promise<Document[]>;
|
|
358
|
+
getVersionHistory(rootId: string): Promise<Document[]>;
|
|
359
|
+
getInboundReferences(toRootId: string): Promise<Array<{
|
|
360
|
+
fromDocumentId: string;
|
|
361
|
+
fieldName: string;
|
|
362
|
+
refStrength: string;
|
|
363
|
+
}>>;
|
|
364
|
+
isAllowed(principalSet: PrincipalRef[], rootId: string, permission: Permission, typeSettings: DocumentTypeSettings): Promise<boolean>;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
interface DocumentsServiceOptions {
|
|
368
|
+
queryableFields?: QueryableField[];
|
|
369
|
+
typeSchemaVersion?: number;
|
|
370
|
+
maxVersionsPerRoot?: number;
|
|
371
|
+
/** Tenant this service operates within. Every root-keyed lookup is scoped to it (R3). POC default: 'default'. */
|
|
372
|
+
tenantId?: string;
|
|
373
|
+
/** Retain version history (new row per saveDraft, supersede-as-history). Default false (in-place). */
|
|
374
|
+
versioning?: boolean;
|
|
375
|
+
}
|
|
376
|
+
declare class DocumentsService {
|
|
377
|
+
private db;
|
|
378
|
+
private opts;
|
|
379
|
+
private projection;
|
|
380
|
+
private tenantId;
|
|
381
|
+
private versioning;
|
|
382
|
+
constructor(db: D1Database$1, opts?: DocumentsServiceOptions);
|
|
383
|
+
create(input: CreateDocumentInput, createdBy?: string): Promise<Document>;
|
|
384
|
+
saveDraft(rootId: string, input: UpdateDocumentInput, updatedBy?: string): Promise<Document>;
|
|
385
|
+
private updateInPlace;
|
|
386
|
+
publish(documentId: string, publishedBy?: string): Promise<Document>;
|
|
387
|
+
unpublish(documentId: string): Promise<Document>;
|
|
388
|
+
softDelete(documentId: string): Promise<void>;
|
|
389
|
+
erase(rootId: string, tenantId: string): Promise<void>;
|
|
390
|
+
}
|
|
391
|
+
|
|
215
392
|
/**
|
|
216
393
|
* Cloudflare Email binding provider (MailChannels / send_email binding)
|
|
217
394
|
*
|
|
@@ -262,6 +439,17 @@ declare const emailReconciliationPlugin: DefinedPlugin;
|
|
|
262
439
|
declare const redirectPlugin: DefinedPlugin;
|
|
263
440
|
declare function createRedirectPlugin(): DefinedPlugin;
|
|
264
441
|
|
|
442
|
+
/**
|
|
443
|
+
* Hello World Plugin — Payload-shaped pilot port.
|
|
444
|
+
*
|
|
445
|
+
* Demonstrates the v4 plugin shape: definePlugin(...) with declarative menu
|
|
446
|
+
* + configSchema + sync register. Replaces the legacy PluginBuilder fluent
|
|
447
|
+
* API. Keeps the same id/version/routes so existing tests and the manifest
|
|
448
|
+
* registry continue to resolve it.
|
|
449
|
+
*/
|
|
450
|
+
declare const helloWorldPlugin: DefinedPlugin;
|
|
451
|
+
declare function createHelloWorldPlugin(): DefinedPlugin;
|
|
452
|
+
|
|
265
453
|
/**
|
|
266
454
|
* Site Settings Collection
|
|
267
455
|
*
|
|
@@ -541,4 +729,4 @@ declare function createUserProfilesPlugin(): DefinedPlugin;
|
|
|
541
729
|
|
|
542
730
|
declare const VERSION: string;
|
|
543
731
|
|
|
544
|
-
export { BUILT_IN_PROVIDERS, type CFSendEmailBinding, CloudflareEmailProvider, type CloudflareEmailProviderOptions, FieldType, OAuthService, PluginDependencyCycleError, type ProfileFieldDefinition, RbacService, type SortablePlugin, type TopoSortOptions, type UserProfileConfig, VERSION, bootstrapDocumentTypes, createDb, createOAuthProvidersPlugin, createRedirectPlugin, createUserProfilesPlugin, defineUserProfile, emailReconciliationPlugin, generateTriggersComment, getUserProfileConfig, oauthProvidersPlugin, parseCronTriggers, redirectPlugin, _default as siteSettingsCollection, topoSort, updateWranglerTriggers, userProfilesPlugin };
|
|
732
|
+
export { BUILT_IN_PROVIDERS, type CFSendEmailBinding, CloudflareEmailProvider, type CloudflareEmailProviderOptions, DocumentRepository, DocumentsService, FieldType, OAuthService, PluginDependencyCycleError, type ProfileFieldDefinition, RbacService, type SortablePlugin, type TopoSortOptions, type UserProfileConfig, VERSION, bootstrapDocumentTypes, createDb, createHelloWorldPlugin, createOAuthProvidersPlugin, createRedirectPlugin, createUserProfilesPlugin, defineUserProfile, emailReconciliationPlugin, generateTriggersComment, getUserProfileConfig, helloWorldPlugin, oauthProvidersPlugin, parseCronTriggers, redirectPlugin, _default as siteSettingsCollection, topoSort, updateWranglerTriggers, userProfilesPlugin };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
export { B as Bindings, a as BootIsolateFn, b as SonicJSApp, S as SonicJSConfig, V as Variables, c as createSonicJSApp, s as setupCoreMiddleware, d as setupCoreRoutes } from './app-
|
|
2
|
-
import { o as DefinedPlugin } from './define-plugin-
|
|
3
|
-
export { B as BooleanField, e as ConfigSchema, f as ConfigSchemaField, h as CronContext, i as CronDeclaration, j as CronDispatchResult, k as CronTickEvent, l as CronablePlugin, H as HookSystemImpl, r as HookUtils, N as NumberField, P as ParsedField, v as PluginManagerClass, an as PluginMenuEntry, x as PluginRegistryImpl, y as PluginValidatorClass, z as PluginsRegistry, A as RegisterPluginsError, G as RegisterPluginsErrorReason, I as RegisterPluginsHostContext, J as RegisterablePlugin, K as RegistryEntry, ao as ResolvedPluginMenuEntry, L as ScopedHookSystemClass, O as SelectField, Q as SettingsFor, U as StringField, Y as applySchemaDefaults, _ as collectCronSchedules, $ as collectCrons, a2 as createScheduledHandler, a3 as definePlugin, a4 as dispatchCronTick, a5 as getHookSystem, ap as getPluginMenu, a6 as getTypedHooks, a8 as hasHookSystem, a9 as isDefinedPlugin, ae as parseConfigSchema, af as parseFormDataToSettings, ah as registerPlugins, ai as renderSchemaFields, aj as resetHookSystem, aq as resetPluginMenu, ar as resolvePluginMenuItems, ak as setHookSystem, as as setPluginMenu } from './define-plugin-
|
|
1
|
+
export { B as Bindings, a as BootIsolateFn, b as SonicJSApp, S as SonicJSConfig, V as Variables, c as createSonicJSApp, s as setupCoreMiddleware, d as setupCoreRoutes } from './app-01M0dIwt.js';
|
|
2
|
+
import { o as DefinedPlugin } from './define-plugin-BYIey6sp.js';
|
|
3
|
+
export { B as BooleanField, e as ConfigSchema, f as ConfigSchemaField, h as CronContext, i as CronDeclaration, j as CronDispatchResult, k as CronTickEvent, l as CronablePlugin, H as HookSystemImpl, r as HookUtils, N as NumberField, P as ParsedField, v as PluginManagerClass, an as PluginMenuEntry, x as PluginRegistryImpl, y as PluginValidatorClass, z as PluginsRegistry, A as RegisterPluginsError, G as RegisterPluginsErrorReason, I as RegisterPluginsHostContext, J as RegisterablePlugin, K as RegistryEntry, ao as ResolvedPluginMenuEntry, L as ScopedHookSystemClass, O as SelectField, Q as SettingsFor, U as StringField, Y as applySchemaDefaults, _ as collectCronSchedules, $ as collectCrons, a2 as createScheduledHandler, a3 as definePlugin, a4 as dispatchCronTick, a5 as getHookSystem, ap as getPluginMenu, a6 as getTypedHooks, a8 as hasHookSystem, a9 as isDefinedPlugin, ae as parseConfigSchema, af as parseFormDataToSettings, ah as registerPlugins, ai as renderSchemaFields, aj as resetHookSystem, aq as resetPluginMenu, ar as resolvePluginMenuItems, ak as setHookSystem, as as setPluginMenu } from './define-plugin-BYIey6sp.js';
|
|
4
4
|
import { D1Database as D1Database$1 } from '@cloudflare/workers-types';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { E as EmailProvider, N as NormalizedEmailMessage, t as SendResult } from './types-DT7XN5TX.js';
|
|
7
|
+
export { q as EmailLogRow } from './types-DT7XN5TX.js';
|
|
8
|
+
import { s as schema } from './plugin-bootstrap-Bj4fxX1q.js';
|
|
9
|
+
export { m as Content, C as CorePlugin, n as DbPlugin, o as DbPluginHook, L as LogCategory, p as LogConfig, a as LogEntry, b as LogFilter, c as LogLevel, d as Logger, q as Media, M as Migration, e as MigrationService, f as MigrationStatus, N as NewContent, t as NewLogConfig, u as NewMedia, w as NewPlugin, x as NewPluginActivityLog, y as NewPluginAsset, z as NewPluginHook, A as NewPluginRoute, B as NewSystemLog, D as NewUser, E as NewWorkflowHistory, F as PluginActivityLog, G as PluginAsset, P as PluginBootstrapService, H as PluginRoute, g as PluginServiceClass, S as SystemLog, U as User, W as WorkflowHistory, I as apiTokens, J as content, K as contentVersions, h as getAvailableCollectionNames, i as getLogger, j as initLogger, O as insertContentSchema, Q as insertLogConfigSchema, R as insertMediaSchema, T as insertPluginActivityLogSchema, V as insertPluginAssetSchema, X as insertPluginHookSchema, Y as insertPluginRouteSchema, Z as insertPluginSchema, _ as insertSystemLogSchema, $ as insertUserSchema, a0 as insertWorkflowHistorySchema, l as loadCollectionConfig, k as loadCollectionConfigs, a1 as logConfig, a2 as media, a3 as pluginActivityLog, a4 as pluginAssets, a5 as pluginHooks, a6 as pluginRoutes, a7 as plugins, r as registerCollections, a8 as selectContentSchema, a9 as selectLogConfigSchema, aa as selectMediaSchema, ab as selectPluginActivityLogSchema, ac as selectPluginAssetSchema, ad as selectPluginHookSchema, ae as selectPluginRouteSchema, af as selectPluginSchema, ag as selectSystemLogSchema, ah as selectUserSchema, ai as selectWorkflowHistorySchema, aj as systemLogs, ak as users, v as validateCollectionConfig, al as workflowHistory } from './plugin-bootstrap-Bj4fxX1q.js';
|
|
10
|
+
import { e as FieldType } from './collection-config-BTzAvKt2.js';
|
|
11
|
+
export { C as CollectionConfig, b as CollectionConfigModule, c as CollectionSchema, d as CollectionSyncResult, F as FieldConfig } from './collection-config-BTzAvKt2.js';
|
|
11
12
|
export { AuthManager, Permission, PermissionManager, UserPermissions, bootstrapMiddleware, cacheHeaders, compressionMiddleware, detailedLoggingMiddleware, getActivePlugins, isPluginActive, logActivity, loggingMiddleware, optionalAuth, performanceLoggingMiddleware, requireActivePlugin, requireActivePlugins, requireAnyPermission, requireAuth, requirePermission, requireRole, securityHeaders, securityLoggingMiddleware } from './middleware.js';
|
|
12
13
|
export { ROUTES_INFO, adminApiRoutes, adminCheckboxRoutes, adminCollectionsRoutes, adminContentRoutes, adminDashboardRoutes, adminLogsRoutes, adminMediaRoutes, adminPluginRoutes, adminSettingsRoutes, adminUsersRoutes, apiContentCrudRoutes, apiMediaRoutes, apiRoutes, apiSystemRoutes, authRoutes } from './routes.js';
|
|
13
|
-
export { A as AlertData, C as ConfirmationDialogOptions, F as Filter,
|
|
14
|
+
export { A as AdminLayoutCatalystData, a as AlertData, C as ConfirmationDialogOptions, F as Filter, b as FilterBarData, c as FilterOption, d as FormData, e as FormField, P as PaginationData, T as TableColumn, f as TableData, g as getConfirmationDialogScript, r as renderAdminLayoutCatalyst, h as renderAlert, i as renderConfirmationDialog, j as renderFilterBar, k as renderForm, l as renderFormField, m as renderPagination, n as renderTable } from './admin-layout-catalyst.template-DrwDUfsE.js';
|
|
14
15
|
export { A as AuthService, C as ContentService, H as HOOKS, a as HookContext, b as HookHandler, c as HookName, d as HookSystem, M as MediaService, P as Plugin, f as PluginAdminPage, g as PluginBuilderOptions, h as PluginComponent, i as PluginConfig, j as PluginContext, k as PluginHook, l as PluginLogger, m as PluginManager, n as PluginMenuItem, o as PluginMiddleware, p as PluginModel, q as PluginRegistry, r as PluginRoutes, s as PluginService, t as PluginStatus, u as PluginValidationResult, v as PluginValidator, S as ScopedHookSystem } from './plugin-DDYetMF-.js';
|
|
15
16
|
export { P as PluginManifest } from './plugin-manifest-Dpy8wxIB.js';
|
|
16
17
|
export { F as FilterCondition, a as FilterGroup, b as FilterOperator, Q as QueryFilter, c as QueryFilterBuilder, d as QueryResult, S as SONICJS_VERSION, T as TemplateRenderer, e as buildQuery, f as escapeHtml, g as getCoreVersion, m as metricsTracker, r as renderTemplate, s as sanitizeInput, h as sanitizeObject, t as templateRenderer } from './version-DFTyGfIH.js';
|
|
@@ -21,11 +22,11 @@ import 'better-auth';
|
|
|
21
22
|
import 'better-auth/plugins/magic-link';
|
|
22
23
|
import 'better-call';
|
|
23
24
|
import 'zod/v4/core';
|
|
24
|
-
import 'zod';
|
|
25
25
|
import 'hono';
|
|
26
26
|
import 'drizzle-zod';
|
|
27
27
|
import 'drizzle-orm/sqlite-core';
|
|
28
28
|
import 'hono/types';
|
|
29
|
+
import 'hono/utils/html';
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
32
|
* Wrangler.toml [triggers] cron codegen
|
|
@@ -212,6 +213,182 @@ declare class RbacService {
|
|
|
212
213
|
|
|
213
214
|
declare function bootstrapDocumentTypes(db: D1Database$1): Promise<void>;
|
|
214
215
|
|
|
216
|
+
type Permission = 'read' | 'create' | 'update' | 'delete' | 'publish' | 'manage';
|
|
217
|
+
type PrincipalType = 'user' | 'role' | 'group' | 'public' | 'token';
|
|
218
|
+
type RefStrength = 'strong' | 'weak';
|
|
219
|
+
type QueryableFieldKind = 'scalar' | 'facet' | 'reference';
|
|
220
|
+
type DocumentStatus = 'draft' | 'published' | 'archived';
|
|
221
|
+
interface QueryableField {
|
|
222
|
+
name: string;
|
|
223
|
+
path?: string;
|
|
224
|
+
kind: QueryableFieldKind;
|
|
225
|
+
type?: 'text' | 'number' | 'integer' | 'boolean' | 'date';
|
|
226
|
+
column?: string;
|
|
227
|
+
refStrength?: RefStrength;
|
|
228
|
+
}
|
|
229
|
+
interface DocumentTypeSettings {
|
|
230
|
+
baseGrants?: Record<string, Permission[]>;
|
|
231
|
+
maxVersionsPerRoot?: number;
|
|
232
|
+
pii?: boolean;
|
|
233
|
+
/** Hide this type from the admin content list and all-view (e.g. internal system types like 'plugin'). */
|
|
234
|
+
internal?: boolean;
|
|
235
|
+
/**
|
|
236
|
+
* Shared/global type: its documents are NOT tenant-scoped — they live in one shared pool and are
|
|
237
|
+
* visible from every tenant. Opt-in (default false). When false, the type is tenant-isolated like
|
|
238
|
+
* everything else. See `effectiveTenantForType` (services/document-request-context.ts).
|
|
239
|
+
*/
|
|
240
|
+
global?: boolean;
|
|
241
|
+
/**
|
|
242
|
+
* Retain historical version rows for this type. Default false.
|
|
243
|
+
* When false: saveDraft updates the working draft row in place and publish deletes the
|
|
244
|
+
* superseded published row (at most ~2 rows per root, no history accumulation).
|
|
245
|
+
* When true: new row per saveDraft + prune to maxVersionsPerRoot (the versioning-plugin opts types in).
|
|
246
|
+
*/
|
|
247
|
+
versioning?: boolean;
|
|
248
|
+
}
|
|
249
|
+
interface Document {
|
|
250
|
+
id: string;
|
|
251
|
+
rootId: string;
|
|
252
|
+
typeId: string;
|
|
253
|
+
typeVersion: number;
|
|
254
|
+
versionOfId: string | null;
|
|
255
|
+
versionNumber: number;
|
|
256
|
+
isCurrentDraft: boolean;
|
|
257
|
+
isPublished: boolean;
|
|
258
|
+
status: DocumentStatus;
|
|
259
|
+
parentRootId: string;
|
|
260
|
+
slug: string | null;
|
|
261
|
+
path: string | null;
|
|
262
|
+
title: string | null;
|
|
263
|
+
zone: string | null;
|
|
264
|
+
sortOrder: number;
|
|
265
|
+
visible: boolean;
|
|
266
|
+
publishedAt: number | null;
|
|
267
|
+
scheduledAt: number | null;
|
|
268
|
+
expiresAt: number | null;
|
|
269
|
+
deletedAt: number | null;
|
|
270
|
+
tenantId: string;
|
|
271
|
+
locale: string;
|
|
272
|
+
translationGroupId: string;
|
|
273
|
+
data: Record<string, unknown>;
|
|
274
|
+
metadata: Record<string, unknown>;
|
|
275
|
+
ownerId: string | null;
|
|
276
|
+
createdBy: string | null;
|
|
277
|
+
updatedBy: string | null;
|
|
278
|
+
createdAt: number;
|
|
279
|
+
updatedAt: number;
|
|
280
|
+
}
|
|
281
|
+
interface PrincipalRef {
|
|
282
|
+
type: PrincipalType;
|
|
283
|
+
id: string;
|
|
284
|
+
}
|
|
285
|
+
declare const createDocumentSchema: z.ZodObject<{
|
|
286
|
+
typeId: z.ZodString;
|
|
287
|
+
tenantId: z.ZodDefault<z.ZodString>;
|
|
288
|
+
locale: z.ZodDefault<z.ZodString>;
|
|
289
|
+
parentRootId: z.ZodDefault<z.ZodString>;
|
|
290
|
+
slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
291
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
292
|
+
zone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
293
|
+
sortOrder: z.ZodDefault<z.ZodNumber>;
|
|
294
|
+
visible: z.ZodDefault<z.ZodBoolean>;
|
|
295
|
+
scheduledAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
296
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
297
|
+
data: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
298
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
299
|
+
ownerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
300
|
+
publishOnCreate: z.ZodDefault<z.ZodBoolean>;
|
|
301
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
302
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
303
|
+
}, z.core.$strip>;
|
|
304
|
+
declare const updateDocumentSchema: z.ZodObject<{
|
|
305
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
306
|
+
slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
307
|
+
zone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
308
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
309
|
+
visible: z.ZodOptional<z.ZodBoolean>;
|
|
310
|
+
scheduledAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
311
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
312
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
313
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
314
|
+
updatedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
315
|
+
}, z.core.$strip>;
|
|
316
|
+
type CreateDocumentInput = z.infer<typeof createDocumentSchema>;
|
|
317
|
+
type UpdateDocumentInput = z.infer<typeof updateDocumentSchema>;
|
|
318
|
+
|
|
319
|
+
type ListStatus = 'published' | 'draft' | 'all';
|
|
320
|
+
interface ListDocumentsOptions {
|
|
321
|
+
typeId?: string;
|
|
322
|
+
/** Which lifecycle axis to list: published row, current-draft row, or either. */
|
|
323
|
+
status?: ListStatus;
|
|
324
|
+
locale?: string;
|
|
325
|
+
parentRootId?: string;
|
|
326
|
+
limit?: number;
|
|
327
|
+
cursorUpdatedAt?: number;
|
|
328
|
+
cursorId?: string;
|
|
329
|
+
now?: number;
|
|
330
|
+
/** Resolved generated-column filters, e.g. { column: 'q_tst_rating', value: 4 }. Caller maps
|
|
331
|
+
* field→column via the type's queryableFields; column names are format-guarded here too. */
|
|
332
|
+
scalarFilters?: Array<{
|
|
333
|
+
column: string;
|
|
334
|
+
value: string | number;
|
|
335
|
+
}>;
|
|
336
|
+
/** Multi-valued facet filter, e.g. { field: 'tags', value: 'homepage' }. Bound as params. */
|
|
337
|
+
facetFilter?: {
|
|
338
|
+
field: string;
|
|
339
|
+
value: string;
|
|
340
|
+
};
|
|
341
|
+
/** Generated-column to sort by (else keyset on updated_at). Format-guarded. */
|
|
342
|
+
sortColumn?: string | null;
|
|
343
|
+
sortDir?: 'ASC' | 'DESC';
|
|
344
|
+
/** Apply the schedule window (scheduled_at/expires_at) — public reads only. */
|
|
345
|
+
timeWindow?: boolean;
|
|
346
|
+
}
|
|
347
|
+
declare class DocumentRepository {
|
|
348
|
+
private db;
|
|
349
|
+
private tenantId;
|
|
350
|
+
private permissions;
|
|
351
|
+
constructor(db: D1Database$1, tenantId: string);
|
|
352
|
+
getById(id: string): Promise<Document | null>;
|
|
353
|
+
getCurrentDraft(rootId: string): Promise<Document | null>;
|
|
354
|
+
getPublished(rootId: string): Promise<Document | null>;
|
|
355
|
+
list(opts?: ListDocumentsOptions): Promise<Document[]>;
|
|
356
|
+
listPublished(opts?: ListDocumentsOptions): Promise<Document[]>;
|
|
357
|
+
listDrafts(opts?: ListDocumentsOptions): Promise<Document[]>;
|
|
358
|
+
getVersionHistory(rootId: string): Promise<Document[]>;
|
|
359
|
+
getInboundReferences(toRootId: string): Promise<Array<{
|
|
360
|
+
fromDocumentId: string;
|
|
361
|
+
fieldName: string;
|
|
362
|
+
refStrength: string;
|
|
363
|
+
}>>;
|
|
364
|
+
isAllowed(principalSet: PrincipalRef[], rootId: string, permission: Permission, typeSettings: DocumentTypeSettings): Promise<boolean>;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
interface DocumentsServiceOptions {
|
|
368
|
+
queryableFields?: QueryableField[];
|
|
369
|
+
typeSchemaVersion?: number;
|
|
370
|
+
maxVersionsPerRoot?: number;
|
|
371
|
+
/** Tenant this service operates within. Every root-keyed lookup is scoped to it (R3). POC default: 'default'. */
|
|
372
|
+
tenantId?: string;
|
|
373
|
+
/** Retain version history (new row per saveDraft, supersede-as-history). Default false (in-place). */
|
|
374
|
+
versioning?: boolean;
|
|
375
|
+
}
|
|
376
|
+
declare class DocumentsService {
|
|
377
|
+
private db;
|
|
378
|
+
private opts;
|
|
379
|
+
private projection;
|
|
380
|
+
private tenantId;
|
|
381
|
+
private versioning;
|
|
382
|
+
constructor(db: D1Database$1, opts?: DocumentsServiceOptions);
|
|
383
|
+
create(input: CreateDocumentInput, createdBy?: string): Promise<Document>;
|
|
384
|
+
saveDraft(rootId: string, input: UpdateDocumentInput, updatedBy?: string): Promise<Document>;
|
|
385
|
+
private updateInPlace;
|
|
386
|
+
publish(documentId: string, publishedBy?: string): Promise<Document>;
|
|
387
|
+
unpublish(documentId: string): Promise<Document>;
|
|
388
|
+
softDelete(documentId: string): Promise<void>;
|
|
389
|
+
erase(rootId: string, tenantId: string): Promise<void>;
|
|
390
|
+
}
|
|
391
|
+
|
|
215
392
|
/**
|
|
216
393
|
* Cloudflare Email binding provider (MailChannels / send_email binding)
|
|
217
394
|
*
|
|
@@ -262,6 +439,17 @@ declare const emailReconciliationPlugin: DefinedPlugin;
|
|
|
262
439
|
declare const redirectPlugin: DefinedPlugin;
|
|
263
440
|
declare function createRedirectPlugin(): DefinedPlugin;
|
|
264
441
|
|
|
442
|
+
/**
|
|
443
|
+
* Hello World Plugin — Payload-shaped pilot port.
|
|
444
|
+
*
|
|
445
|
+
* Demonstrates the v4 plugin shape: definePlugin(...) with declarative menu
|
|
446
|
+
* + configSchema + sync register. Replaces the legacy PluginBuilder fluent
|
|
447
|
+
* API. Keeps the same id/version/routes so existing tests and the manifest
|
|
448
|
+
* registry continue to resolve it.
|
|
449
|
+
*/
|
|
450
|
+
declare const helloWorldPlugin: DefinedPlugin;
|
|
451
|
+
declare function createHelloWorldPlugin(): DefinedPlugin;
|
|
452
|
+
|
|
265
453
|
/**
|
|
266
454
|
* Site Settings Collection
|
|
267
455
|
*
|
|
@@ -541,4 +729,4 @@ declare function createUserProfilesPlugin(): DefinedPlugin;
|
|
|
541
729
|
|
|
542
730
|
declare const VERSION: string;
|
|
543
731
|
|
|
544
|
-
export { BUILT_IN_PROVIDERS, type CFSendEmailBinding, CloudflareEmailProvider, type CloudflareEmailProviderOptions, FieldType, OAuthService, PluginDependencyCycleError, type ProfileFieldDefinition, RbacService, type SortablePlugin, type TopoSortOptions, type UserProfileConfig, VERSION, bootstrapDocumentTypes, createDb, createOAuthProvidersPlugin, createRedirectPlugin, createUserProfilesPlugin, defineUserProfile, emailReconciliationPlugin, generateTriggersComment, getUserProfileConfig, oauthProvidersPlugin, parseCronTriggers, redirectPlugin, _default as siteSettingsCollection, topoSort, updateWranglerTriggers, userProfilesPlugin };
|
|
732
|
+
export { BUILT_IN_PROVIDERS, type CFSendEmailBinding, CloudflareEmailProvider, type CloudflareEmailProviderOptions, DocumentRepository, DocumentsService, FieldType, OAuthService, PluginDependencyCycleError, type ProfileFieldDefinition, RbacService, type SortablePlugin, type TopoSortOptions, type UserProfileConfig, VERSION, bootstrapDocumentTypes, createDb, createHelloWorldPlugin, createOAuthProvidersPlugin, createRedirectPlugin, createUserProfilesPlugin, defineUserProfile, emailReconciliationPlugin, generateTriggersComment, getUserProfileConfig, helloWorldPlugin, oauthProvidersPlugin, parseCronTriggers, redirectPlugin, _default as siteSettingsCollection, topoSort, updateWranglerTriggers, userProfilesPlugin };
|