@heyo-sh/heyo-cms 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +44 -2
- package/dist/access/index.d.ts +9 -0
- package/dist/access/index.d.ts.map +1 -0
- package/dist/access/permissions.d.ts +54 -0
- package/dist/access/permissions.d.ts.map +1 -0
- package/dist/adapters/astro.d.ts +45 -0
- package/dist/adapters/astro.d.ts.map +1 -0
- package/dist/adapters/astro.js +1 -0
- package/dist/adapters/deliver.d.ts +26 -0
- package/dist/adapters/deliver.d.ts.map +1 -0
- package/dist/adapters/next.d.ts +45 -0
- package/dist/adapters/next.d.ts.map +1 -0
- package/dist/adapters/next.js +1 -0
- package/dist/adapters/nuxt.d.ts +51 -0
- package/dist/adapters/nuxt.d.ts.map +1 -0
- package/dist/adapters/nuxt.js +1 -0
- package/dist/adapters/react-router.d.ts +36 -0
- package/dist/adapters/react-router.d.ts.map +1 -0
- package/dist/adapters/react-router.js +1 -0
- package/dist/adapters/sveltekit.d.ts +41 -0
- package/dist/adapters/sveltekit.d.ts.map +1 -0
- package/dist/adapters/sveltekit.js +1 -0
- package/dist/ai/assistant/context.d.ts +64 -0
- package/dist/ai/assistant/context.d.ts.map +1 -0
- package/dist/ai/assistant/limits.d.ts +10 -0
- package/dist/ai/assistant/limits.d.ts.map +1 -0
- package/dist/ai/assistant/plans.d.ts +83 -0
- package/dist/ai/assistant/plans.d.ts.map +1 -0
- package/dist/ai/assistant/prompt.d.ts +22 -0
- package/dist/ai/assistant/prompt.d.ts.map +1 -0
- package/dist/ai/assistant/run.d.ts +59 -0
- package/dist/ai/assistant/run.d.ts.map +1 -0
- package/dist/ai/assistant/runtime.d.ts +35 -0
- package/dist/ai/assistant/runtime.d.ts.map +1 -0
- package/dist/ai/assistant/schema.d.ts +66 -0
- package/dist/ai/assistant/schema.d.ts.map +1 -0
- package/dist/ai/assistant/tools.d.ts +41 -0
- package/dist/ai/assistant/tools.d.ts.map +1 -0
- package/dist/ai/assistant/values.d.ts +33 -0
- package/dist/ai/assistant/values.d.ts.map +1 -0
- package/dist/ai/crypto.d.ts +12 -0
- package/dist/ai/crypto.d.ts.map +1 -0
- package/dist/ai/index.d.ts +19 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/pi.d.ts +89 -0
- package/dist/ai/pi.d.ts.map +1 -0
- package/dist/ai/registry.d.ts +66 -0
- package/dist/ai/registry.d.ts.map +1 -0
- package/dist/ai/service.d.ts +31 -0
- package/dist/ai/service.d.ts.map +1 -0
- package/dist/ai/variant-translation.d.ts +6 -0
- package/dist/ai/variant-translation.d.ts.map +1 -0
- package/dist/ai.d.ts +12 -0
- package/dist/ai.d.ts.map +1 -0
- package/dist/ai.js +1 -0
- package/dist/auth/config.d.ts +65 -0
- package/dist/auth/config.d.ts.map +1 -0
- package/dist/auth/crypto.d.ts +44 -0
- package/dist/auth/crypto.d.ts.map +1 -0
- package/dist/auth/index.d.ts +15 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/oauth.d.ts +93 -0
- package/dist/auth/oauth.d.ts.map +1 -0
- package/dist/auth/service.d.ts +38 -0
- package/dist/auth/service.d.ts.map +1 -0
- package/dist/auth/totp.d.ts +34 -0
- package/dist/auth/totp.d.ts.map +1 -0
- package/dist/auth.d.ts +9 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +30 -0
- package/dist/client/index.d.ts +51 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/types.d.ts +363 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client.d.ts +46 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +1 -0
- package/dist/config.d.ts +31 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +1 -0
- package/dist/content/export.d.ts +28 -0
- package/dist/content/export.d.ts.map +1 -0
- package/dist/content/import.d.ts +65 -0
- package/dist/content/import.d.ts.map +1 -0
- package/dist/content/records.d.ts +73 -0
- package/dist/content/records.d.ts.map +1 -0
- package/dist/content.d.ts +12 -0
- package/dist/content.d.ts.map +1 -0
- package/dist/content.js +1 -0
- package/dist/db/d1.d.ts +29 -0
- package/dist/db/d1.d.ts.map +1 -0
- package/dist/db/d1.js +1 -0
- package/dist/db/mongodb.d.ts +128 -0
- package/dist/db/mongodb.d.ts.map +1 -0
- package/dist/db/mongodb.js +2 -0
- package/dist/db/postgres.d.ts +37 -0
- package/dist/db/postgres.d.ts.map +1 -0
- package/dist/db/postgres.js +1 -0
- package/dist/db/sql/adapter.d.ts +57 -0
- package/dist/db/sql/adapter.d.ts.map +1 -0
- package/dist/db/sql/compile.d.ts +50 -0
- package/dist/db/sql/compile.d.ts.map +1 -0
- package/dist/db/sql/ddl.d.ts +34 -0
- package/dist/db/sql/ddl.d.ts.map +1 -0
- package/dist/db/sql/dialect.d.ts +37 -0
- package/dist/db/sql/dialect.d.ts.map +1 -0
- package/dist/db/sql/driver.d.ts +34 -0
- package/dist/db/sql/driver.d.ts.map +1 -0
- package/dist/db/sql/introspect.d.ts +15 -0
- package/dist/db/sql/introspect.d.ts.map +1 -0
- package/dist/db/sqlite.d.ts +50 -0
- package/dist/db/sqlite.d.ts.map +1 -0
- package/dist/db/sqlite.js +1 -0
- package/dist/defaults.d.ts +5 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/duration.d.ts +12 -0
- package/dist/duration.d.ts.map +1 -0
- package/dist/editor/builtin.d.ts +45 -0
- package/dist/editor/builtin.d.ts.map +1 -0
- package/dist/editor/index.d.ts +14 -0
- package/dist/editor/index.d.ts.map +1 -0
- package/dist/editor/markdown.d.ts +19 -0
- package/dist/editor/markdown.d.ts.map +1 -0
- package/dist/editor/registry.d.ts +30 -0
- package/dist/editor/registry.d.ts.map +1 -0
- package/dist/editor/serialize.d.ts +41 -0
- package/dist/editor/serialize.d.ts.map +1 -0
- package/dist/editor.d.ts +10 -0
- package/dist/editor.d.ts.map +1 -0
- package/dist/editor.js +1 -0
- package/dist/engine/access.d.ts +33 -0
- package/dist/engine/access.d.ts.map +1 -0
- package/dist/engine/activity.d.ts +16 -0
- package/dist/engine/activity.d.ts.map +1 -0
- package/dist/engine/cursor.d.ts +19 -0
- package/dist/engine/cursor.d.ts.map +1 -0
- package/dist/engine/documents.d.ts +81 -0
- package/dist/engine/documents.d.ts.map +1 -0
- package/dist/engine/engine.d.ts +295 -0
- package/dist/engine/engine.d.ts.map +1 -0
- package/dist/engine/field-access.d.ts +21 -0
- package/dist/engine/field-access.d.ts.map +1 -0
- package/dist/engine/hooks.d.ts +58 -0
- package/dist/engine/hooks.d.ts.map +1 -0
- package/dist/engine/index.d.ts +20 -0
- package/dist/engine/index.d.ts.map +1 -0
- package/dist/engine/jobs.d.ts +63 -0
- package/dist/engine/jobs.d.ts.map +1 -0
- package/dist/engine/locales.d.ts +40 -0
- package/dist/engine/locales.d.ts.map +1 -0
- package/dist/engine/outbox.d.ts +81 -0
- package/dist/engine/outbox.d.ts.map +1 -0
- package/dist/engine/relations.d.ts +60 -0
- package/dist/engine/relations.d.ts.map +1 -0
- package/dist/engine/scoped-db.d.ts +13 -0
- package/dist/engine/scoped-db.d.ts.map +1 -0
- package/dist/engine/slugs.d.ts +124 -0
- package/dist/engine/slugs.d.ts.map +1 -0
- package/dist/engine/trash.d.ts +25 -0
- package/dist/engine/trash.d.ts.map +1 -0
- package/dist/errors.d.ts +42 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/fields/builtin.d.ts +169 -0
- package/dist/fields/builtin.d.ts.map +1 -0
- package/dist/fields/index.d.ts +3 -0
- package/dist/fields/index.d.ts.map +1 -0
- package/dist/fields/registry.d.ts +35 -0
- package/dist/fields/registry.d.ts.map +1 -0
- package/dist/fields.d.ts +9 -0
- package/dist/fields.d.ts.map +1 -0
- package/dist/fields.js +1 -0
- package/dist/http/guard.d.ts +45 -0
- package/dist/http/guard.d.ts.map +1 -0
- package/dist/http/handler.d.ts +31 -0
- package/dist/http/handler.d.ts.map +1 -0
- package/dist/http/index.d.ts +13 -0
- package/dist/http/index.d.ts.map +1 -0
- package/dist/http/openapi.d.ts +5 -0
- package/dist/http/openapi.d.ts.map +1 -0
- package/dist/http/params.d.ts +32 -0
- package/dist/http/params.d.ts.map +1 -0
- package/dist/http/request-db.d.ts +19 -0
- package/dist/http/request-db.d.ts.map +1 -0
- package/dist/http/respond.d.ts +48 -0
- package/dist/http/respond.d.ts.map +1 -0
- package/dist/http/rich-text.d.ts +41 -0
- package/dist/http/rich-text.d.ts.map +1 -0
- package/dist/http/router.d.ts +55 -0
- package/dist/http/router.d.ts.map +1 -0
- package/dist/http/routes/access.d.ts +13 -0
- package/dist/http/routes/access.d.ts.map +1 -0
- package/dist/http/routes/admin.d.ts +28 -0
- package/dist/http/routes/admin.d.ts.map +1 -0
- package/dist/http/routes/ai.d.ts +26 -0
- package/dist/http/routes/ai.d.ts.map +1 -0
- package/dist/http/routes/auth.d.ts +13 -0
- package/dist/http/routes/auth.d.ts.map +1 -0
- package/dist/http/routes/documents.d.ts +24 -0
- package/dist/http/routes/documents.d.ts.map +1 -0
- package/dist/http/routes/generate.d.ts +5 -0
- package/dist/http/routes/generate.d.ts.map +1 -0
- package/dist/http/routes/media.d.ts +58 -0
- package/dist/http/routes/media.d.ts.map +1 -0
- package/dist/http/routes/panel.d.ts +20 -0
- package/dist/http/routes/panel.d.ts.map +1 -0
- package/dist/http/routes/system.d.ts +25 -0
- package/dist/http/routes/system.d.ts.map +1 -0
- package/dist/http/routes/webhooks.d.ts +17 -0
- package/dist/http/routes/webhooks.d.ts.map +1 -0
- package/dist/http/spec.d.ts +28 -0
- package/dist/http/spec.d.ts.map +1 -0
- package/dist/http.d.ts +17 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +1 -0
- package/dist/i18n/index.d.ts +12 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/names.d.ts +25 -0
- package/dist/i18n/names.d.ts.map +1 -0
- package/dist/ids.d.ts +28 -0
- package/dist/ids.d.ts.map +1 -0
- package/dist/index-2ddk43me.js +2 -0
- package/dist/index-2prbs05k.js +2 -0
- package/dist/index-385ggnge.js +2 -0
- package/dist/index-466cwb0b.js +2 -0
- package/dist/index-4qrep5f0.js +26 -0
- package/dist/index-67e458ws.js +2 -0
- package/dist/index-6m1kjq9g.js +2 -0
- package/dist/index-6w10rch0.js +3 -0
- package/dist/index-761dec5z.js +2 -0
- package/dist/index-8nzmqy0f.js +2 -0
- package/dist/index-8x2em6c8.js +14 -0
- package/dist/index-91fa1gzf.js +2 -0
- package/dist/index-9g2n7xa6.js +2 -0
- package/dist/index-a8jcwqsf.js +2 -0
- package/dist/index-abfzb1ve.js +2 -0
- package/dist/index-cv0hpz3d.js +2 -0
- package/dist/index-ebtj6ebd.js +0 -0
- package/dist/index-g041kfa5.js +18 -0
- package/dist/index-g4crf47y.js +0 -0
- package/dist/index-hbx67b20.js +7 -0
- package/dist/index-hpast878.js +40 -0
- package/dist/index-kc1j3h6z.js +2 -0
- package/dist/index-p2cqsmvw.js +2 -0
- package/dist/index-rg9tpg3p.js +5 -0
- package/dist/index-rw0hze6x.js +2 -0
- package/dist/index-s9x07zb3.js +2 -0
- package/dist/index-sgdnp83t.js +2 -0
- package/dist/index-szaq03qq.js +2 -0
- package/dist/index-vkwzdfte.js +5 -0
- package/dist/index-vzhxn50e.js +2 -0
- package/dist/index-x72d1hzh.js +2 -0
- package/dist/index-y8kzzn94.js +2 -0
- package/dist/index-ypcmns0v.js +2 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/jobs/runner.d.ts +77 -0
- package/dist/jobs/runner.d.ts.map +1 -0
- package/dist/jobs.d.ts +11 -0
- package/dist/jobs.d.ts.map +1 -0
- package/dist/jobs.js +1 -0
- package/dist/media/cloudflare.d.ts +58 -0
- package/dist/media/cloudflare.d.ts.map +1 -0
- package/dist/media/document.d.ts +29 -0
- package/dist/media/document.d.ts.map +1 -0
- package/dist/media/gc.d.ts +46 -0
- package/dist/media/gc.d.ts.map +1 -0
- package/dist/media/index.d.ts +20 -0
- package/dist/media/index.d.ts.map +1 -0
- package/dist/media/pipeline.d.ts +55 -0
- package/dist/media/pipeline.d.ts.map +1 -0
- package/dist/media/probe.d.ts +6 -0
- package/dist/media/probe.d.ts.map +1 -0
- package/dist/media/service.d.ts +26 -0
- package/dist/media/service.d.ts.map +1 -0
- package/dist/media/sharp.d.ts +28 -0
- package/dist/media/sharp.d.ts.map +1 -0
- package/dist/media/strip.d.ts +16 -0
- package/dist/media/strip.d.ts.map +1 -0
- package/dist/media/urls.d.ts +77 -0
- package/dist/media/urls.d.ts.map +1 -0
- package/dist/media/usages.d.ts +77 -0
- package/dist/media/usages.d.ts.map +1 -0
- package/dist/media/variants.d.ts +61 -0
- package/dist/media/variants.d.ts.map +1 -0
- package/dist/migrations.d.ts +115 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +1 -0
- package/dist/panel.d.ts +31 -0
- package/dist/panel.d.ts.map +1 -0
- package/dist/plugins/indexnow.d.ts +82 -0
- package/dist/plugins/indexnow.d.ts.map +1 -0
- package/dist/plugins.d.ts +9 -0
- package/dist/plugins.d.ts.map +1 -0
- package/dist/plugins.js +1 -0
- package/dist/query.d.ts +40 -0
- package/dist/query.d.ts.map +1 -0
- package/dist/query.js +1 -0
- package/dist/run-bjge3v8e.js +6 -0
- package/dist/schema/describe.d.ts +19 -0
- package/dist/schema/describe.d.ts.map +1 -0
- package/dist/schema/index.d.ts +5 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/plan.d.ts +20 -0
- package/dist/schema/plan.d.ts.map +1 -0
- package/dist/schema/snapshot.d.ts +24 -0
- package/dist/schema/snapshot.d.ts.map +1 -0
- package/dist/schema/system.d.ts +31 -0
- package/dist/schema/system.d.ts.map +1 -0
- package/dist/schema.d.ts +7 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +1 -0
- package/dist/slugify.d.ts +31 -0
- package/dist/slugify.d.ts.map +1 -0
- package/dist/storage/bytes.d.ts +17 -0
- package/dist/storage/bytes.d.ts.map +1 -0
- package/dist/storage/http.d.ts +43 -0
- package/dist/storage/http.d.ts.map +1 -0
- package/dist/storage/local.d.ts +31 -0
- package/dist/storage/local.d.ts.map +1 -0
- package/dist/storage/providers.d.ts +95 -0
- package/dist/storage/providers.d.ts.map +1 -0
- package/dist/storage/sign.d.ts +53 -0
- package/dist/storage/sign.d.ts.map +1 -0
- package/dist/strings.d.ts +13 -0
- package/dist/strings.d.ts.map +1 -0
- package/dist/telemetry.d.ts +137 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +1 -0
- package/dist/types/activity.d.ts +68 -0
- package/dist/types/activity.d.ts.map +1 -0
- package/dist/types/actor.d.ts +26 -0
- package/dist/types/actor.d.ts.map +1 -0
- package/dist/types/ai.d.ts +357 -0
- package/dist/types/ai.d.ts.map +1 -0
- package/dist/types/api.d.ts +268 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/auth.d.ts +310 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/config.d.ts +647 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/database.d.ts +75 -0
- package/dist/types/database.d.ts.map +1 -0
- package/dist/types/editor.d.ts +166 -0
- package/dist/types/editor.d.ts.map +1 -0
- package/dist/types/events.d.ts +72 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/fields.d.ts +142 -0
- package/dist/types/fields.d.ts.map +1 -0
- package/dist/types/hooks.d.ts +142 -0
- package/dist/types/hooks.d.ts.map +1 -0
- package/dist/types/index.d.ts +25 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/instance.d.ts +263 -0
- package/dist/types/instance.d.ts.map +1 -0
- package/dist/types/jobs.d.ts +78 -0
- package/dist/types/jobs.d.ts.map +1 -0
- package/dist/types/json.d.ts +24 -0
- package/dist/types/json.d.ts.map +1 -0
- package/dist/types/locales.d.ts +30 -0
- package/dist/types/locales.d.ts.map +1 -0
- package/dist/types/media.d.ts +342 -0
- package/dist/types/media.d.ts.map +1 -0
- package/dist/types/panel.d.ts +249 -0
- package/dist/types/panel.d.ts.map +1 -0
- package/dist/types/plugin.d.ts +194 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/query.d.ts +101 -0
- package/dist/types/query.d.ts.map +1 -0
- package/dist/types/schema.d.ts +203 -0
- package/dist/types/schema.d.ts.map +1 -0
- package/dist/types/storage.d.ts +61 -0
- package/dist/types/storage.d.ts.map +1 -0
- package/dist/types/telemetry.d.ts +14 -0
- package/dist/types/telemetry.d.ts.map +1 -0
- package/dist/types/trash.d.ts +42 -0
- package/dist/types/trash.d.ts.map +1 -0
- package/dist/types/webhooks.d.ts +133 -0
- package/dist/types/webhooks.d.ts.map +1 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/uploads.d.ts +22 -0
- package/dist/uploads.d.ts.map +1 -0
- package/dist/uploads.js +9 -0
- package/dist/webhooks/index.d.ts +10 -0
- package/dist/webhooks/index.d.ts.map +1 -0
- package/dist/webhooks/job.d.ts +17 -0
- package/dist/webhooks/job.d.ts.map +1 -0
- package/dist/webhooks/service.d.ts +53 -0
- package/dist/webhooks/service.d.ts.map +1 -0
- package/dist/webhooks/sign.d.ts +26 -0
- package/dist/webhooks/sign.d.ts.map +1 -0
- package/dist/webhooks.d.ts +10 -0
- package/dist/webhooks.d.ts.map +1 -0
- package/dist/webhooks.js +1 -0
- package/package.json +187 -4
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { DatabaseAdapter, DatabaseAdapterFactory } from "../types/database";
|
|
2
|
+
/**
|
|
3
|
+
* What `bun:sqlite` and `node:sqlite` both already are.
|
|
4
|
+
*
|
|
5
|
+
* Synchronous, prepared-statement based, and identical enough in shape that
|
|
6
|
+
* one driver covers both runtimes. Neither module is imported here: a Worker
|
|
7
|
+
* bundle must not pull in a native SQLite it will never run.
|
|
8
|
+
*/
|
|
9
|
+
export interface SqliteDatabase {
|
|
10
|
+
prepare(sql: string): SqliteStatement;
|
|
11
|
+
exec(sql: string): void;
|
|
12
|
+
close?(): void;
|
|
13
|
+
}
|
|
14
|
+
export interface SqliteStatement {
|
|
15
|
+
all(...values: unknown[]): unknown[];
|
|
16
|
+
run(...values: unknown[]): {
|
|
17
|
+
changes?: number | bigint;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface SqliteOptions {
|
|
21
|
+
id?: string;
|
|
22
|
+
/**
|
|
23
|
+
* How long a write waits for another connection's lock, in milliseconds,
|
|
24
|
+
* before it fails with "database is locked". Defaults to 5000, the value
|
|
25
|
+
* `better-sqlite3` uses; `bun:sqlite` and `node:sqlite` start at 0, which
|
|
26
|
+
* fails the moment a second process — the CLI next to a dev server — is
|
|
27
|
+
* writing. A timeout the database was already given is kept unless this
|
|
28
|
+
* is set.
|
|
29
|
+
*/
|
|
30
|
+
busyTimeout?: number;
|
|
31
|
+
}
|
|
32
|
+
export interface SqliteFileOptions extends SqliteOptions {
|
|
33
|
+
/** Path on disk. `:memory:` is accepted and is what the tests use. */
|
|
34
|
+
file: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Creates the SQLite adapter.
|
|
38
|
+
*
|
|
39
|
+
* Transactions use the generic `BEGIN`/`COMMIT` path in the adapter, opened
|
|
40
|
+
* as `BEGIN IMMEDIATE` (see `sqliteDialect`): SQLite has exactly one writer,
|
|
41
|
+
* so there is no pool to pin a transaction to, and the write lock is better
|
|
42
|
+
* taken up front, where the busy timeout below can wait for it.
|
|
43
|
+
*
|
|
44
|
+
* Passing `{ file }` opens the database on first use through whichever SQLite
|
|
45
|
+
* the runtime provides — `bun:sqlite` or `node:sqlite` — so a configuration
|
|
46
|
+
* module stays importable in a runtime that has neither.
|
|
47
|
+
*/
|
|
48
|
+
export declare function sqlite(options: SqliteFileOptions): DatabaseAdapterFactory;
|
|
49
|
+
export declare function sqlite(database: SqliteDatabase, options?: SqliteOptions): DatabaseAdapter;
|
|
50
|
+
//# sourceMappingURL=sqlite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/db/sqlite.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;AAK3B;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;IACtC,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,CAAC,IAAI,IAAI,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC;IACrC,GAAG,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG;QAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CAC1D;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;CACd;AAoCD;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,sBAAsB,CAAC;AAC3E,wBAAgB,MAAM,CACpB,QAAQ,EAAE,cAAc,EACxB,OAAO,CAAC,EAAE,aAAa,GACtB,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ce,st}from"../index-4qrep5f0.js";import{n}from"../index-x72d1hzh.js";var r=5000;class s{database;id;constructor(e,t="sqlite"){this.database=e;this.id=t}async all(e,t){return this.database.prepare(e).all(...t)}async run(e,t){let a=this.database.prepare(e).run(...t);return{rowsAffected:Number(a.changes??0)}}async exec(e){this.database.exec(e)}async close(){this.database.close?.()}}function o(e,t={}){if("file"in e&&typeof e.file==="string")return async()=>o(await u(e.file),e);let a=e;return l(a,t.busyTimeout),new ce(new s(a,t.id??"sqlite"),st)}function l(e,t){if(t===void 0){let[a]=e.prepare("PRAGMA busy_timeout").all();if(Number(a?.timeout??0)>0)return}else if(!Number.isFinite(t)||t<0)throw new n("database","busyTimeout must be a number of milliseconds, 0 or more");e.exec(`PRAGMA busy_timeout = ${Math.trunc(t??r)}`)}async function u(e){for(let t of["bun:sqlite","node:sqlite"])try{let a=await import(t),i=a.Database??a.DatabaseSync;if(i)return new i(e)}catch{}throw new n("database","no SQLite is available in this runtime; pass a database instance instead")}export{o as sqlite};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Shared defaults that are safe to import from a browser bundle. */
|
|
2
|
+
export declare const defaultBasePath = "/api/heyo-cms";
|
|
3
|
+
export declare const defaultAdminPath = "/admin";
|
|
4
|
+
export declare const defaultMigrationsDirectory = "./migrations";
|
|
5
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,eAAO,MAAM,eAAe,kBAAkB,CAAC;AAC/C,eAAO,MAAM,gBAAgB,WAAW,CAAC;AACzC,eAAO,MAAM,0BAA0B,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses `30d` into milliseconds.
|
|
3
|
+
*
|
|
4
|
+
* Durations are strings in the configuration because `2592000000` in a diff
|
|
5
|
+
* tells a reviewer nothing. They are parsed once, while the configuration is
|
|
6
|
+
* being built, so a typo is a start-up error rather than a job that silently
|
|
7
|
+
* never runs.
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseDuration(value: string, path?: string): number;
|
|
10
|
+
/** Parses `25mb` into bytes, for the same reason `parseDuration` exists. */
|
|
11
|
+
export declare function parseByteSize(value: string, path?: string): number;
|
|
12
|
+
//# sourceMappingURL=duration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration.d.ts","sourceRoot":"","sources":["../src/duration.ts"],"names":[],"mappings":"AAWA;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,SAAK,GAAG,MAAM,CAS9D;AASD,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,SAAK,GAAG,MAAM,CAS9D"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { EditorMarkDefinition, EditorNodeDefinition } from "../types/editor";
|
|
2
|
+
/**
|
|
3
|
+
* The nodes TipTap's starter kit produces, declared through the public API.
|
|
4
|
+
*
|
|
5
|
+
* Every one of them goes through `defineEditorNode()` — no shortcut, no
|
|
6
|
+
* internal map a built-in gets to use and a plugin does not. That is the same
|
|
7
|
+
* rule the field registry follows, and for the same reason: an extension
|
|
8
|
+
* point that the product itself bypasses is an extension point nobody can
|
|
9
|
+
* trust (stage 9).
|
|
10
|
+
*
|
|
11
|
+
* The serialisers below are therefore also the worked examples. A plugin
|
|
12
|
+
* adding a `callout` writes exactly this much code.
|
|
13
|
+
*/
|
|
14
|
+
export declare const docNode: EditorNodeDefinition;
|
|
15
|
+
export declare const paragraphNode: EditorNodeDefinition;
|
|
16
|
+
export declare const headingNode: EditorNodeDefinition;
|
|
17
|
+
export declare const blockquoteNode: EditorNodeDefinition;
|
|
18
|
+
export declare const bulletListNode: EditorNodeDefinition;
|
|
19
|
+
export declare const orderedListNode: EditorNodeDefinition;
|
|
20
|
+
export declare const listItemNode: EditorNodeDefinition;
|
|
21
|
+
export declare const taskListNode: EditorNodeDefinition;
|
|
22
|
+
export declare const taskItemNode: EditorNodeDefinition;
|
|
23
|
+
export declare const codeBlockNode: EditorNodeDefinition;
|
|
24
|
+
export declare const horizontalRuleNode: EditorNodeDefinition;
|
|
25
|
+
export declare const hardBreakNode: EditorNodeDefinition;
|
|
26
|
+
/**
|
|
27
|
+
* An image, by media id.
|
|
28
|
+
*
|
|
29
|
+
* `mediaId` is the attribute the lifecycle counts (section 6): a bare `src`
|
|
30
|
+
* is a URL, and a URL is not a reference. The serialiser prefers a resolved
|
|
31
|
+
* URL when the caller can provide one and falls back to the stored `src`,
|
|
32
|
+
* because a document exported from a CLI still has to render somewhere.
|
|
33
|
+
*/
|
|
34
|
+
export declare const imageNode: EditorNodeDefinition;
|
|
35
|
+
export declare const tableNode: EditorNodeDefinition;
|
|
36
|
+
export declare const tableRowNode: EditorNodeDefinition;
|
|
37
|
+
export declare const tableHeaderNode: EditorNodeDefinition;
|
|
38
|
+
export declare const tableCellNode: EditorNodeDefinition;
|
|
39
|
+
export declare const boldMark: EditorMarkDefinition;
|
|
40
|
+
export declare const italicMark: EditorMarkDefinition;
|
|
41
|
+
export declare const underlineMark: EditorMarkDefinition;
|
|
42
|
+
export declare const strikeMark: EditorMarkDefinition;
|
|
43
|
+
export declare const codeMark: EditorMarkDefinition;
|
|
44
|
+
export declare const linkMark: EditorMarkDefinition;
|
|
45
|
+
//# sourceMappingURL=builtin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtin.d.ts","sourceRoot":"","sources":["../../src/editor/builtin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EAErB,MAAM,iBAAiB,CAAC;AASzB;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,OAAO,EAAE,oBAKpB,CAAC;AAEH,eAAO,MAAM,aAAa,EAAE,oBAQ1B,CAAC;AAEH,eAAO,MAAM,WAAW,EAAE,oBAWxB,CAAC;AAEH,eAAO,MAAM,cAAc,EAAE,oBAU3B,CAAC;AAEH,eAAO,MAAM,cAAc,EAAE,oBAO3B,CAAC;AAEH,eAAO,MAAM,eAAe,EAAE,oBAkB5B,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,oBAKzB,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,oBAMzB,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,oBAQzB,CAAC;AAEH,eAAO,MAAM,aAAa,EAAE,oBAyB1B,CAAC;AAEH,eAAO,MAAM,kBAAkB,EAAE,oBAO/B,CAAC;AAEH,eAAO,MAAM,aAAa,EAAE,oBAQ1B,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,EAAE,oBAqCtB,CAAC;AAEH,eAAO,MAAM,SAAS,EAAE,oBAsBtB,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,oBAMzB,CAAC;AAEH,eAAO,MAAM,eAAe,EAAE,oBAU5B,CAAC;AAEH,eAAO,MAAM,aAAa,EAAE,oBAU1B,CAAC;AAMH,eAAO,MAAM,QAAQ,EAAE,oBAIrB,CAAC;AAEH,eAAO,MAAM,UAAU,EAAE,oBAIvB,CAAC;AAEH,eAAO,MAAM,aAAa,EAAE,oBAM1B,CAAC;AAEH,eAAO,MAAM,UAAU,EAAE,oBAIvB,CAAC;AAEH,eAAO,MAAM,QAAQ,EAAE,oBAIrB,CAAC;AAEH,eAAO,MAAM,QAAQ,EAAE,oBAWrB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The rich-text schema: nodes, marks and the serialisers they are required to
|
|
3
|
+
* carry.
|
|
4
|
+
*
|
|
5
|
+
* Importing this module registers the built-in nodes, which is why the
|
|
6
|
+
* serialisers in `renderRichText()` work without any configuration. A plugin
|
|
7
|
+
* that adds a node imports `defineEditorNode` from here and gets exactly the
|
|
8
|
+
* same treatment.
|
|
9
|
+
*/
|
|
10
|
+
export { blockquoteNode, boldMark, bulletListNode, codeBlockNode, codeMark, docNode, hardBreakNode, headingNode, horizontalRuleNode, imageNode, italicMark, linkMark, listItemNode, orderedListNode, paragraphNode, strikeMark, tableCellNode, tableHeaderNode, tableNode, tableRowNode, taskItemNode, taskListNode, underlineMark, } from "./builtin";
|
|
11
|
+
export { richTextFromMarkdown, richTextFromText } from "./markdown";
|
|
12
|
+
export { defineEditorMark, defineEditorNode, describeEditorSchema, getEditorMark, getEditorNode, registeredEditorMarks, registeredEditorNodes, } from "./registry";
|
|
13
|
+
export { escapeHtml, escapeMarkdown, htmlAttributes, indentContinuation, renderRichText, richTextToHtml, richTextToMarkdown, richTextToPlainText, stringAttr, } from "./serialize";
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editor/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,cAAc,EACd,QAAQ,EACR,cAAc,EACd,aAAa,EACb,QAAQ,EACR,OAAO,EACP,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,aAAa,EACb,UAAU,EACV,aAAa,EACb,eAAe,EACf,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,aAAa,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,GACX,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { RichTextDocument } from "../types/editor";
|
|
2
|
+
/**
|
|
3
|
+
* Markdown back into a ProseMirror document.
|
|
4
|
+
*
|
|
5
|
+
* The AI runtime needs this and nothing else does yet: a model is shown a
|
|
6
|
+
* field as Markdown, because that is the format every model writes well, and
|
|
7
|
+
* what comes back has to become a document the editor can open. Without the
|
|
8
|
+
* parser the only honest options would be inserting the raw Markdown as
|
|
9
|
+
* literal text — which is what every CMS that bolts AI onto rich text gets
|
|
10
|
+
* wrong — or refusing AI on rich-text fields.
|
|
11
|
+
*
|
|
12
|
+
* It is deliberately a small parser: the block grammar the serialiser in this
|
|
13
|
+
* directory emits, plus the inline marks. Anything it does not recognise
|
|
14
|
+
* stays as text, which is the failure mode that loses nothing.
|
|
15
|
+
*/
|
|
16
|
+
export declare function richTextFromMarkdown(markdown: string): RichTextDocument;
|
|
17
|
+
/** A plain string as one paragraph per blank-line-separated chunk. */
|
|
18
|
+
export declare function richTextFromText(text: string): RichTextDocument;
|
|
19
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/editor/markdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAA8B,MAAM,iBAAiB,CAAC;AAEpF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,CASvE;AAED,sEAAsE;AACtE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAgB/D"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { EditorMarkDefinition, EditorNodeDefinition, EditorSchemaDescription } from "../types/editor";
|
|
2
|
+
/**
|
|
3
|
+
* Declares a node of the rich-text schema.
|
|
4
|
+
*
|
|
5
|
+
* The serialisers are not optional, and that is the whole point of the
|
|
6
|
+
* function (stage 9). A node without them renders in the panel and nowhere
|
|
7
|
+
* else: `GET /posts/1` answers with a shape no consumer knows, and the
|
|
8
|
+
* promise that the REST API is usable without a frontend quietly stops being
|
|
9
|
+
* true. Refusing at registration makes that failure a start-up error in the
|
|
10
|
+
* plugin that caused it, naming the plugin, instead of a rendering bug in
|
|
11
|
+
* somebody else's site.
|
|
12
|
+
*/
|
|
13
|
+
export declare function defineEditorNode(definition: EditorNodeDefinition): EditorNodeDefinition;
|
|
14
|
+
/** Declares a mark. Same contract, one fewer dimension. */
|
|
15
|
+
export declare function defineEditorMark(definition: EditorMarkDefinition): EditorMarkDefinition;
|
|
16
|
+
export declare function getEditorNode(name: string): EditorNodeDefinition | undefined;
|
|
17
|
+
export declare function getEditorMark(name: string): EditorMarkDefinition | undefined;
|
|
18
|
+
export declare function registeredEditorNodes(): string[];
|
|
19
|
+
export declare function registeredEditorMarks(): string[];
|
|
20
|
+
/**
|
|
21
|
+
* The schema as data, for the panel and for `cms.inspect()`.
|
|
22
|
+
*
|
|
23
|
+
* Serialisers and components are dropped: one is a closure and the other is
|
|
24
|
+
* a React component, and neither survives JSON. What crosses is exactly what
|
|
25
|
+
* TipTap needs to build a schema — names, groups, content expressions,
|
|
26
|
+
* attribute defaults — so a plugin's node renders in a bundle compiled before
|
|
27
|
+
* the plugin existed.
|
|
28
|
+
*/
|
|
29
|
+
export declare function describeEditorSchema(): EditorSchemaDescription;
|
|
30
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/editor/registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAezB;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,oBAAoB,GAC/B,oBAAoB,CA6BtB;AAED,2DAA2D;AAC3D,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,oBAAoB,GAC/B,oBAAoB,CAmBtB;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAE5E;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAE5E;AAED,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAEhD;AAED,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAEhD;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,IAAI,uBAAuB,CAkB9D"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { RenderRichTextOptions, RichTextNode } from "../types/editor";
|
|
2
|
+
import type { JsonValue } from "../types/json";
|
|
3
|
+
/**
|
|
4
|
+
* Turning a stored document into something a consumer can use.
|
|
5
|
+
*
|
|
6
|
+
* The walker is here and the formatting is in the node definitions, which is
|
|
7
|
+
* the split that makes a third-party node a first-class one: a definition
|
|
8
|
+
* receives its children already serialised and decides how to wrap them, and
|
|
9
|
+
* never has to know how the rest of the tree is rendered (stage 9).
|
|
10
|
+
*
|
|
11
|
+
* An unknown node — one written by an editor that had a plugin this
|
|
12
|
+
* deployment does not — renders its children rather than disappearing. A
|
|
13
|
+
* paragraph inside a node nobody recognises is still the author's text, and
|
|
14
|
+
* dropping it would lose content on a configuration change.
|
|
15
|
+
*/
|
|
16
|
+
export declare function renderRichText(value: unknown, options: RenderRichTextOptions): string;
|
|
17
|
+
export declare function richTextToHtml(value: unknown, options?: Omit<RenderRichTextOptions, "format">): string;
|
|
18
|
+
export declare function richTextToMarkdown(value: unknown, options?: Omit<RenderRichTextOptions, "format">): string;
|
|
19
|
+
/**
|
|
20
|
+
* Text with no markup at all.
|
|
21
|
+
*
|
|
22
|
+
* What a search index, an excerpt and a token budget want: three uses that
|
|
23
|
+
* would each otherwise strip HTML with a regular expression.
|
|
24
|
+
*/
|
|
25
|
+
export declare function richTextToPlainText(value: unknown, options?: Omit<RenderRichTextOptions, "format">): string;
|
|
26
|
+
export declare function escapeHtml(value: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Escaping for Markdown, deliberately minimal.
|
|
29
|
+
*
|
|
30
|
+
* Only the characters that would otherwise change the structure of the
|
|
31
|
+
* document. Escaping more produces output full of backslashes, which is
|
|
32
|
+
* worse than the rare literal asterisk it protects.
|
|
33
|
+
*/
|
|
34
|
+
export declare function escapeMarkdown(value: string): string;
|
|
35
|
+
/** `<a href="x" rel="y">`, with empty attributes dropped. */
|
|
36
|
+
export declare function htmlAttributes(attributes: Record<string, JsonValue | undefined>): string;
|
|
37
|
+
/** Indents every line but the first: Markdown's rule for nested blocks. */
|
|
38
|
+
export declare function indentContinuation(value: string, spaces: number): string;
|
|
39
|
+
export declare function attr(node: RichTextNode, name: string): JsonValue | undefined;
|
|
40
|
+
export declare function stringAttr(node: RichTextNode, name: string): string | undefined;
|
|
41
|
+
//# sourceMappingURL=serialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/editor/serialize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EAMrB,YAAY,EACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG/C;;;;;;;;;;;;GAYG;AAEH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,qBAAqB,GAC7B,MAAM,CAaR;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CAAM,GAClD,MAAM,CAER;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CAAM,GAClD,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CAAM,GAClD,MAAM,CAER;AA2GD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMhD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,6DAA6D;AAC7D,wBAAgB,cAAc,CAC5B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC,GAChD,MAAM,CAWR;AAED,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAGxE;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAE5E;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,SAAS,CAGpB"}
|
package/dist/editor.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@heyo-sh/heyo-cms/editor`.
|
|
3
|
+
*
|
|
4
|
+
* The rich-text schema and its serialisers. Imported by the panel to build
|
|
5
|
+
* the TipTap schema, and by anything that has to turn a stored document into
|
|
6
|
+
* HTML, Markdown or plain text without a browser.
|
|
7
|
+
*/
|
|
8
|
+
export * from "./editor/index";
|
|
9
|
+
export type { EditorMarkDefinition, EditorNodeDefinition, EditorSchemaDescription, MarkSerializer, MarkSerializerContext, NodeSerializer, NodeSerializerContext, RenderRichTextOptions, RichTextDocument, RichTextFormat, RichTextImageOptions, RichTextMark, RichTextMediaImage, RichTextNode, } from "./types/editor";
|
|
10
|
+
//# sourceMappingURL=editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../src/editor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,gBAAgB,CAAC;AAC/B,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,EAClB,YAAY,GACb,MAAM,gBAAgB,CAAC"}
|
package/dist/editor.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{So,To,Co,Oo,Po,_o,$o,Io,jo,Eo,Mo,Do,qo,Lo,Fo,No,Uo,Jo,Wo,zo,Ho,Bo,Vo,he,En}from"./index-g041kfa5.js";import{k,Z,Ot,rn,ao,lo,Te,Q,co,X,uo,Fe,Go,Ne,Xe,ee}from"./index-hbx67b20.js";export{Oo as blockquoteNode,Jo as boldMark,Po as bulletListNode,Eo as codeBlockNode,Bo as codeMark,Z as defineEditorMark,k as defineEditorNode,Te as describeEditorSchema,So as docNode,Fe as escapeHtml,Go as escapeMarkdown,rn as getEditorMark,Ot as getEditorNode,Do as hardBreakNode,Co as headingNode,Mo as horizontalRuleNode,Ne as htmlAttributes,qo as imageNode,Xe as indentContinuation,Wo as italicMark,Vo as linkMark,$o as listItemNode,_o as orderedListNode,To as paragraphNode,lo as registeredEditorMarks,ao as registeredEditorNodes,Q as renderRichText,he as richTextFromMarkdown,En as richTextFromText,co as richTextToHtml,X as richTextToMarkdown,uo as richTextToPlainText,Ho as strikeMark,ee as stringAttr,Uo as tableCellNode,No as tableHeaderNode,Lo as tableNode,Fo as tableRowNode,jo as taskItemNode,Io as taskListNode,zo as underlineMark};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Actor } from "../types/actor";
|
|
2
|
+
import type { AccessOperation, RbacConfig, ResolvedCollection } from "../types/config";
|
|
3
|
+
import type { JsonObject } from "../types/json";
|
|
4
|
+
import type { Where } from "../types/query";
|
|
5
|
+
export interface AccessRequest {
|
|
6
|
+
actor: Actor | null;
|
|
7
|
+
operation: AccessOperation;
|
|
8
|
+
locale: string | null;
|
|
9
|
+
record?: JsonObject;
|
|
10
|
+
/**
|
|
11
|
+
* Present when the configuration declares roles.
|
|
12
|
+
*
|
|
13
|
+
* It changes the default for a collection with no rule from "open" to
|
|
14
|
+
* "needs `collection:action`" — the only safe reading once roles exist, and
|
|
15
|
+
* the reason declaring `rbac` is a decision rather than a formality.
|
|
16
|
+
*/
|
|
17
|
+
rbac?: RbacConfig | undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Evaluates a collection's access rule for one operation.
|
|
21
|
+
*
|
|
22
|
+
* `false` throws here; a `Where` is returned so the caller can add it to the
|
|
23
|
+
* query with `and(requestWhere, accessWhere)`. Filtering after fetching would
|
|
24
|
+
* leak through counts, pagination and `hasNextPage` — the rule has to reach
|
|
25
|
+
* the database, not the serialiser (stage 4).
|
|
26
|
+
*
|
|
27
|
+
* An explicit rule is the final word: RBAC is not consulted for an operation
|
|
28
|
+
* the collection decided for itself, because a rule that said `true` and was
|
|
29
|
+
* then overruled by a permission the developer forgot to grant would be
|
|
30
|
+
* indistinguishable from a bug.
|
|
31
|
+
*/
|
|
32
|
+
export declare function accessFilter(collection: ResolvedCollection, request: AccessRequest): Promise<Where | undefined>;
|
|
33
|
+
//# sourceMappingURL=access.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access.d.ts","sourceRoot":"","sources":["../../src/engine/access.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EACV,eAAe,EAEf,UAAU,EACV,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAoB5C,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,eAAe,CAAC;IAC3B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CAC/B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,CAChC,UAAU,EAAE,kBAAkB,EAC9B,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,CAiB5B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CmsActivity } from "../types/activity";
|
|
2
|
+
import type { DatabaseAdapter } from "../types/database";
|
|
3
|
+
export interface ActivityReaderOptions {
|
|
4
|
+
database: () => Promise<DatabaseAdapter>;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* `cms.activity`: reading the trail the engine writes.
|
|
8
|
+
*
|
|
9
|
+
* Paged by the row id, descending. The ids are ordered — that is why they are
|
|
10
|
+
* generated the way they are — so the cursor is the last id and nothing else:
|
|
11
|
+
* paging by `created_at` would repeat or skip rows every time two writes to
|
|
12
|
+
* the same document land in the same millisecond, which is the normal case
|
|
13
|
+
* for a form that saves five fields.
|
|
14
|
+
*/
|
|
15
|
+
export declare function createActivity(options: ActivityReaderOptions): CmsActivity;
|
|
16
|
+
//# sourceMappingURL=activity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../src/engine/activity.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAIV,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AASzD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,CAAC;CAC1C;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,WAAW,CAoC1E"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { OrderBy, Row, Where } from "../types/query";
|
|
2
|
+
/**
|
|
3
|
+
* Keyset pagination over the sort the caller asked for.
|
|
4
|
+
*
|
|
5
|
+
* `offset` re-reads and re-skips every preceding row, which is what makes
|
|
6
|
+
* page 400 of an archive slow and what makes a page shift when somebody
|
|
7
|
+
* publishes while a reader is paging. A cursor is a `WHERE`, so it costs the
|
|
8
|
+
* same on page 400 as on page 1 and cannot skip or repeat a row.
|
|
9
|
+
*/
|
|
10
|
+
export declare function encodeCursor(row: Row, orderBy: OrderBy[]): string;
|
|
11
|
+
/**
|
|
12
|
+
* Turns a cursor back into a filter.
|
|
13
|
+
*
|
|
14
|
+
* For `a asc, b desc` the predicate is `a > va OR (a = va AND b < vb)`: one
|
|
15
|
+
* disjunct per sort key, each pinning the keys before it. The last key is
|
|
16
|
+
* always `id`, so the comparison is total and no two rows can tie.
|
|
17
|
+
*/
|
|
18
|
+
export declare function cursorWhere(cursor: string, orderBy: OrderBy[]): Where;
|
|
19
|
+
//# sourceMappingURL=cursor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../src/engine/cursor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAe,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAevE;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,MAAM,CAUjE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CA0BrE"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { Actor } from "../types/actor";
|
|
2
|
+
import type { ResolvedCollection } from "../types/config";
|
|
3
|
+
import type { ColumnValue, Row } from "../types/query";
|
|
4
|
+
import type { JsonObject, JsonValue } from "../types/json";
|
|
5
|
+
import { type LocaleContext } from "./locales";
|
|
6
|
+
/**
|
|
7
|
+
* The columns the engine owns on every document.
|
|
8
|
+
*
|
|
9
|
+
* They are accepted in an input object and ignored rather than rejected, so
|
|
10
|
+
* `update({ id, data: doc })` — reading a document, editing one field and
|
|
11
|
+
* writing the whole thing back — works without the caller having to strip
|
|
12
|
+
* them first.
|
|
13
|
+
*/
|
|
14
|
+
export declare const systemDocumentFields: readonly ["id", "revision", "createdAt", "updatedAt", "updatedBy", "deletedAt", "purgeAfter", "scheduledAt", "scheduledPatch", "_fallback", "_localeFields"];
|
|
15
|
+
/**
|
|
16
|
+
* Turns a stored row into the document a caller sees.
|
|
17
|
+
*
|
|
18
|
+
* One locale is resolved here, once, so nothing downstream — hook, event,
|
|
19
|
+
* REST response, template — ever has to know which fields are translated
|
|
20
|
+
* (section 9).
|
|
21
|
+
*/
|
|
22
|
+
export declare function rowToDocument(row: Row, collection: ResolvedCollection, locale: LocaleContext): JsonObject;
|
|
23
|
+
export interface StoredData {
|
|
24
|
+
/** The full document body as it will be written to the `data` column. */
|
|
25
|
+
data: JsonObject;
|
|
26
|
+
/** Field names the caller actually wrote, in declaration order. */
|
|
27
|
+
touched: string[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Folds a caller's input into the stored body.
|
|
31
|
+
*
|
|
32
|
+
* The caller speaks one locale and the storage speaks all of them, so this is
|
|
33
|
+
* where a flat `{ title: "Hello" }` becomes `{ title: { en: "Hello" } }`
|
|
34
|
+
* without disturbing the other translations.
|
|
35
|
+
*/
|
|
36
|
+
export declare function toStoredData(collection: ResolvedCollection, input: JsonObject, locale: LocaleContext, previous?: JsonObject): StoredData;
|
|
37
|
+
/**
|
|
38
|
+
* Validates the fields a write touched, with the field's own zod schema.
|
|
39
|
+
*
|
|
40
|
+
* Only the touched ones: a localized field is required per locale, and
|
|
41
|
+
* demanding every translation before a German draft can be saved would make
|
|
42
|
+
* partial translations impossible — which section 9 says are the norm. A
|
|
43
|
+
* create touches everything, so `required` is still enforced where it matters.
|
|
44
|
+
*/
|
|
45
|
+
export declare function validateFields(collection: ResolvedCollection, data: JsonObject, locale: LocaleContext, fields: string[]): void;
|
|
46
|
+
/** Field names whose resolved value differs between two documents. */
|
|
47
|
+
export declare function changedFields(collection: ResolvedCollection, previous: JsonObject, next: JsonObject): string[];
|
|
48
|
+
/**
|
|
49
|
+
* A system table row as JSON.
|
|
50
|
+
*
|
|
51
|
+
* System tables use real columns and therefore snake_case, which is a storage
|
|
52
|
+
* detail. A `depth` expansion that handed a template `storage_key` would be
|
|
53
|
+
* leaking it (a `media` relation is resolved through this).
|
|
54
|
+
*/
|
|
55
|
+
export declare function systemRowToJson(row: Row): JsonObject;
|
|
56
|
+
/**
|
|
57
|
+
* A scheduled change as it is stored.
|
|
58
|
+
*
|
|
59
|
+
* The locale travels with the patch because a patch is written in one
|
|
60
|
+
* language: applying `{ title: "Hallo" }` next Friday has to write the German
|
|
61
|
+
* title, not the default one (section 9). The actor travels with it because
|
|
62
|
+
* the change is applied as an ordinary update and therefore has to pass the
|
|
63
|
+
* same access control a human write would.
|
|
64
|
+
*/
|
|
65
|
+
export interface ScheduledPatch {
|
|
66
|
+
data: JsonObject;
|
|
67
|
+
locale: string;
|
|
68
|
+
actor: Actor | null;
|
|
69
|
+
}
|
|
70
|
+
export declare function scheduledPatch(row: Row): ScheduledPatch | null;
|
|
71
|
+
/**
|
|
72
|
+
* The stored revision, defaulting to 1.
|
|
73
|
+
*
|
|
74
|
+
* A row written before the column existed reads as revision 1 rather than as
|
|
75
|
+
* `null`: the number means "how many times this has changed", and a document
|
|
76
|
+
* that has never changed since the column arrived has changed once.
|
|
77
|
+
*/
|
|
78
|
+
export declare function toRevision(value: ColumnValue | undefined): number;
|
|
79
|
+
export declare function toIso(value: ColumnValue | undefined): string | null;
|
|
80
|
+
export declare function asObject(value: ColumnValue | JsonValue | undefined): JsonObject;
|
|
81
|
+
//# sourceMappingURL=documents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../../src/engine/documents.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,WAAW,CAAC;AAEnB;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,YAC/B,IAAI,EACJ,UAAU,EACV,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,EACX,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,eAAe,CACP,CAAC;AAIX;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,kBAAkB,EAC9B,MAAM,EAAE,aAAa,GACpB,UAAU,CA2DZ;AAED,MAAM,WAAW,UAAU;IACzB,yEAAyE;IACzE,IAAI,EAAE,UAAU,CAAC;IACjB,mEAAmE;IACnE,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,kBAAkB,EAC9B,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,aAAa,EACrB,QAAQ,CAAC,EAAE,UAAU,GACpB,UAAU,CA+BZ;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,kBAAkB,EAC9B,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,MAAM,EAAE,GACf,IAAI,CA6BN;AAED,sEAAsE;AACtE,wBAAgB,aAAa,CAC3B,UAAU,EAAE,kBAAkB,EAC9B,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,UAAU,GACf,MAAM,EAAE,CAIV;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG,UAAU,CAWpD;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,cAAc,GAAG,IAAI,CAQ9D;AAsBD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,MAAM,CAGjE;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAInE;AAED,wBAAgB,QAAQ,CACtB,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,SAAS,GACzC,UAAU,CAKZ"}
|