@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,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The HTTP layer.
|
|
3
|
+
*
|
|
4
|
+
* Nothing here knows how a document is stored, who may read it or what a
|
|
5
|
+
* hook does: every handler parses a URL, calls one method on the instance and
|
|
6
|
+
* serialises the answer. That is what keeps `cms.api.posts.find()` and
|
|
7
|
+
* `GET /api/heyo-cms/posts` the same operation rather than two implementations
|
|
8
|
+
* of the same intention (section 10).
|
|
9
|
+
*/
|
|
10
|
+
export { createCmsHttp, type CmsHttp } from "./handler";
|
|
11
|
+
export { buildOpenApi } from "./openapi";
|
|
12
|
+
export { Router, type RouteHandler, type RouteMatch, type RouteMiddleware, type RouteRecord, } from "./router";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/http/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,aAAa,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,MAAM,EACN,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,WAAW,GACjB,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CmsInstance } from "../types/instance";
|
|
2
|
+
import type { JsonObject } from "../types/json";
|
|
3
|
+
import type { RouteRecord } from "./router";
|
|
4
|
+
export declare function buildOpenApi(cms: CmsInstance, routes: RouteRecord[]): JsonObject;
|
|
5
|
+
//# sourceMappingURL=openapi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/http/openapi.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAgD5C,wBAAgB,YAAY,CAC1B,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,WAAW,EAAE,GACpB,UAAU,CAiEZ"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Actor } from "../types/actor";
|
|
2
|
+
import type { FindArgs, ReadArgs } from "../types/api";
|
|
3
|
+
import type { ResolvedCollection } from "../types/config";
|
|
4
|
+
import type { OrderBy, Where } from "../types/query";
|
|
5
|
+
export interface ReadQueryOptions {
|
|
6
|
+
actor: Actor | null;
|
|
7
|
+
/** `rest` for everything over HTTP; the panel is marked by a header. */
|
|
8
|
+
source: ReadArgs["source"];
|
|
9
|
+
}
|
|
10
|
+
/** Locale, depth and the trash flag: what every read takes. */
|
|
11
|
+
export declare function readArgs(query: URLSearchParams, options: ReadQueryOptions): ReadArgs;
|
|
12
|
+
/** The whole of `GET /posts`: filters, sort, paging. */
|
|
13
|
+
export declare function findArgs(query: URLSearchParams, collection: ResolvedCollection, options: ReadQueryOptions): FindArgs;
|
|
14
|
+
/**
|
|
15
|
+
* The filter, from either syntax.
|
|
16
|
+
*
|
|
17
|
+
* Both are resolved through the same path resolver, which is what makes a
|
|
18
|
+
* localized field filterable without the caller knowing it is stored as a map:
|
|
19
|
+
* `?title=Hello` with `?locale=de` becomes `data.title.de`, because that is
|
|
20
|
+
* where the German title lives (section 9).
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseWhere(query: URLSearchParams, collection: ResolvedCollection, locale: string | null): Where | undefined;
|
|
23
|
+
export declare function parseSort(raw: string | null, collection: ResolvedCollection, locale: string | null): OrderBy[] | undefined;
|
|
24
|
+
export declare function integer(raw: string | null, name: string, min: number, max: number): number | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* `?flag`, `?flag=true` and `?flag=1` all mean yes.
|
|
27
|
+
*
|
|
28
|
+
* A bare `?permanent` with no value is what somebody types, and reading it as
|
|
29
|
+
* "false" would make a destructive flag silently do nothing.
|
|
30
|
+
*/
|
|
31
|
+
export declare function boolean(raw: string | null, name: string): boolean | undefined;
|
|
32
|
+
//# sourceMappingURL=params.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../src/http/params.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAA2B,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAiF9E,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,wEAAwE;IACxE,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;CAC5B;AAED,+DAA+D;AAC/D,wBAAgB,QAAQ,CACtB,KAAK,EAAE,eAAe,EACtB,OAAO,EAAE,gBAAgB,GACxB,QAAQ,CAiBV;AAED,wDAAwD;AACxD,wBAAgB,QAAQ,CACtB,KAAK,EAAE,eAAe,EACtB,UAAU,EAAE,kBAAkB,EAC9B,OAAO,EAAE,gBAAgB,GACxB,QAAQ,CAkBV;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,eAAe,EACtB,UAAU,EAAE,kBAAkB,EAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,GACpB,KAAK,GAAG,SAAS,CAiCnB;AA0ED,wBAAgB,SAAS,CACvB,GAAG,EAAE,MAAM,GAAG,IAAI,EAClB,UAAU,EAAE,kBAAkB,EAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,GACpB,OAAO,EAAE,GAAG,SAAS,CAevB;AA2HD,wBAAgB,OAAO,CACrB,GAAG,EAAE,MAAM,GAAG,IAAI,EAClB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,MAAM,GAAG,SAAS,CAOpB;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAK7E"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DatabaseAdapter } from "../types/database";
|
|
2
|
+
import type { ScopedDb } from "../types/hooks";
|
|
3
|
+
/**
|
|
4
|
+
* `ctx.db` for a route rather than for a hook.
|
|
5
|
+
*
|
|
6
|
+
* A hook runs inside the operation's transaction, so its `db` joins it. A
|
|
7
|
+
* route is not an operation: there is nothing for a second statement to be
|
|
8
|
+
* atomic with, and holding a transaction open across an `await fetch()` in
|
|
9
|
+
* somebody's plugin would pin a pool connection for as long as the slowest
|
|
10
|
+
* third party takes to answer. So every call here gets its own short
|
|
11
|
+
* transaction, and a route that genuinely needs two statements to agree asks
|
|
12
|
+
* for the adapter and opens one itself.
|
|
13
|
+
*
|
|
14
|
+
* Lazy on purpose: resolving the adapter is what opens a pool or reads a
|
|
15
|
+
* binding, and most requests — a bundled asset, the OpenAPI document, a 404 —
|
|
16
|
+
* never touch the database at all.
|
|
17
|
+
*/
|
|
18
|
+
export declare function requestDb(database: () => Promise<DatabaseAdapter>): ScopedDb;
|
|
19
|
+
//# sourceMappingURL=request-db.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-db.d.ts","sourceRoot":"","sources":["../../src/http/request-db.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,GAAG,QAAQ,CAuB5E"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { JsonObject } from "../types/json";
|
|
2
|
+
/**
|
|
3
|
+
* Every response the handler produces, in one place.
|
|
4
|
+
*
|
|
5
|
+
* The shape matters more than it looks: a client written against this has to
|
|
6
|
+
* be able to tell "the hook stopped it" from "the document is not there" from
|
|
7
|
+
* "your filter is nonsense" without parsing prose, which is why errors carry
|
|
8
|
+
* `code` and why a stopped write is a status rather than a body.
|
|
9
|
+
*/
|
|
10
|
+
export declare const jsonContentType = "application/json; charset=utf-8";
|
|
11
|
+
export declare function json(body: unknown, status?: number, headers?: Record<string, string>): Response;
|
|
12
|
+
export declare function text(body: string, status?: number): Response;
|
|
13
|
+
export declare function noContent(headers?: Record<string, string>): Response;
|
|
14
|
+
/**
|
|
15
|
+
* A write a `before` hook stopped.
|
|
16
|
+
*
|
|
17
|
+
* `null` is the local API's answer (section 5) and HTTP has no `null`, so this
|
|
18
|
+
* is the translation: nothing happened, nothing to return, and a header that
|
|
19
|
+
* says which of the two reasons for a 204 this is. The typed client turns it
|
|
20
|
+
* back into `null`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function stopped(): Response;
|
|
23
|
+
/**
|
|
24
|
+
* The one error shape.
|
|
25
|
+
*
|
|
26
|
+
* A `CmsError` already carries the status and the code — a hook that threw, a
|
|
27
|
+
* refused access rule and a failed field validation all arrive here as one
|
|
28
|
+
* type — so this function never has to guess. Anything else is a bug in the
|
|
29
|
+
* CMS and is reported as a 500 whose message is not forwarded: an exception
|
|
30
|
+
* from a database driver routinely contains a connection string.
|
|
31
|
+
*/
|
|
32
|
+
export declare function errorResponse(error: unknown): Response;
|
|
33
|
+
/**
|
|
34
|
+
* The JSON body of a request.
|
|
35
|
+
*
|
|
36
|
+
* An empty body reads as `{}` because `PATCH /posts/:id` with nothing to say
|
|
37
|
+
* is a legal, if pointless, request — and answering it with a parse error
|
|
38
|
+
* would be a worse description of what happened.
|
|
39
|
+
*/
|
|
40
|
+
export declare function readJson(request: Request): Promise<unknown>;
|
|
41
|
+
/** The body as an object, which is what every write route wants. */
|
|
42
|
+
export declare function readJsonObject(request: Request): Promise<JsonObject>;
|
|
43
|
+
/** `data` out of a write body, refusing the shapes that cannot be a patch. */
|
|
44
|
+
export declare function requireData(body: JsonObject, key?: string): JsonObject;
|
|
45
|
+
export declare function requireString(body: JsonObject, key: string): string;
|
|
46
|
+
export declare function optionalString(body: JsonObject, key: string): string | undefined;
|
|
47
|
+
export declare function optionalStringArray(body: JsonObject, key: string): string[] | undefined;
|
|
48
|
+
//# sourceMappingURL=respond.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"respond.d.ts","sourceRoot":"","sources":["../../src/http/respond.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD;;;;;;;GAOG;AAEH,eAAO,MAAM,eAAe,oCAAoC,CAAC;AAEjE,wBAAgB,IAAI,CAClB,IAAI,EAAE,OAAO,EACb,MAAM,SAAM,EACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,QAAQ,CAKV;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,SAAM,GAAG,QAAQ,CAKzD;AAED,wBAAgB,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,QAAQ,CAEpE;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,IAAI,QAAQ,CAElC;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CA4BtD;AAED;;;;;;GAMG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAWjE;AAED,oEAAoE;AACpE,wBAAsB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAS1E;AAED,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,SAAS,GAAG,UAAU,CAStE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAMnE;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,MAAM,GACV,MAAM,GAAG,SAAS,CAOpB;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,MAAM,GACV,MAAM,EAAE,GAAG,SAAS,CAStB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ResolvedCollection } from "../types/config";
|
|
2
|
+
import type { RichTextFormat, RichTextMediaImage } from "../types/editor";
|
|
3
|
+
import type { CmsInstance } from "../types/instance";
|
|
4
|
+
import type { JsonObject } from "../types/json";
|
|
5
|
+
/**
|
|
6
|
+
* `?richText=html` on a read.
|
|
7
|
+
*
|
|
8
|
+
* The reason this exists is the one `defineEditorNode()` enforces: a
|
|
9
|
+
* ProseMirror document is useless to a consumer that has no ProseMirror. A
|
|
10
|
+
* static site generator, an RSS feed, a mail template and a search index all
|
|
11
|
+
* want the same thing, and without this each of them writes its own
|
|
12
|
+
* half-correct renderer against a tree they do not control.
|
|
13
|
+
*
|
|
14
|
+
* It is opt-in and not the default, because the document *is* the stored
|
|
15
|
+
* value: a client that writes back what it read must get back what is
|
|
16
|
+
* stored, and a response that silently replaced a document with a string
|
|
17
|
+
* would make `GET` then `PATCH` destructive.
|
|
18
|
+
*/
|
|
19
|
+
export declare function richTextFormat(value: string | null): RichTextFormat | undefined;
|
|
20
|
+
export interface RenderOptions {
|
|
21
|
+
collection: ResolvedCollection;
|
|
22
|
+
format: RichTextFormat;
|
|
23
|
+
/** Resolves a `mediaId` on an image node to a URL this deployment serves. */
|
|
24
|
+
mediaUrl: (id: string) => string;
|
|
25
|
+
/** Resolves a `mediaId` to a whole `<img>`: dimensions, `srcset`, alt. */
|
|
26
|
+
mediaImage?: (id: string) => RichTextMediaImage | null;
|
|
27
|
+
}
|
|
28
|
+
/** Renders every rich-text field of one document, in place. */
|
|
29
|
+
export declare function renderDocumentRichText(document: JsonObject, options: RenderOptions): JsonObject;
|
|
30
|
+
export declare function renderPageRichText(documents: JsonObject[], options: RenderOptions): void;
|
|
31
|
+
/** The URL the CMS itself serves a file from, for an image inside prose. */
|
|
32
|
+
export declare function mediaUrlResolver(basePath: string): (id: string) => string;
|
|
33
|
+
/**
|
|
34
|
+
* Every library image the rich-text fields of these documents show, loaded
|
|
35
|
+
* in one query and described for an `<img>`.
|
|
36
|
+
*
|
|
37
|
+
* Undefined without `uploads`: there is no library to look in, and the
|
|
38
|
+
* serialiser's plain `mediaUrl` fallback is the whole answer.
|
|
39
|
+
*/
|
|
40
|
+
export declare function richTextMediaResolver(cms: CmsInstance, documents: JsonObject[], collection: ResolvedCollection, locale: string | null): Promise<((id: string) => RichTextMediaImage | null) | undefined>;
|
|
41
|
+
//# sourceMappingURL=rich-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rich-text.d.ts","sourceRoot":"","sources":["../../src/http/rich-text.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,eAAe,CAAC;AAE3D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,GAAG,IAAI,GACnB,cAAc,GAAG,SAAS,CAQ5B;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,kBAAkB,CAAC;IAC/B,MAAM,EAAE,cAAc,CAAC;IACvB,6EAA6E;IAC7E,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IACjC,0EAA0E;IAC1E,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,kBAAkB,GAAG,IAAI,CAAC;CACxD;AAED,+DAA+D;AAC/D,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,aAAa,GACrB,UAAU,CAkBZ;AAED,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,UAAU,EAAE,EACvB,OAAO,EAAE,aAAa,GACrB,IAAI,CAEN;AAED,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAEzE;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,WAAW,EAChB,SAAS,EAAE,UAAU,EAAE,EACvB,UAAU,EAAE,kBAAkB,EAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,GACpB,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,MAAM,KAAK,kBAAkB,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC,CAmBlE"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { RouteInspection } from "../types/instance";
|
|
2
|
+
import type { OpenApiRouteSpec, RouteContext, RouteMethod } from "../types/plugin";
|
|
3
|
+
/**
|
|
4
|
+
* The router.
|
|
5
|
+
*
|
|
6
|
+
* Written here rather than taken from a package, and that is a decision worth
|
|
7
|
+
* defending. The plan points at Better Auth's arrangement (section 10) and
|
|
8
|
+
* Better Auth does exactly this: its own matcher, because the router ends up
|
|
9
|
+
* in the public contract. Ours is in `RouteContext`, which a plugin author
|
|
10
|
+
* types against — and a plugin ecosystem pinned to somebody else's router
|
|
11
|
+
* major version is the framework coupling this project exists to avoid.
|
|
12
|
+
*
|
|
13
|
+
* What it owes: `:param` and a trailing `*`, static-before-dynamic
|
|
14
|
+
* precedence, 405 with an `Allow` header, and collisions detected while the
|
|
15
|
+
* configuration is still loading.
|
|
16
|
+
*/
|
|
17
|
+
export type RouteHandler = (context: RouteContext) => Response | Promise<Response>;
|
|
18
|
+
export type RouteMiddleware = (context: RouteContext, next: () => Promise<Response>) => Promise<Response>;
|
|
19
|
+
export interface RouteRecord {
|
|
20
|
+
method: RouteMethod;
|
|
21
|
+
/** Relative to `basePath`: `/posts/:id`, `/admin/*`. */
|
|
22
|
+
path: string;
|
|
23
|
+
/** `core`, or the id of the plugin that registered it. */
|
|
24
|
+
source: string;
|
|
25
|
+
handler: RouteHandler;
|
|
26
|
+
middleware?: RouteMiddleware[];
|
|
27
|
+
openapi?: OpenApiRouteSpec;
|
|
28
|
+
}
|
|
29
|
+
export type RouteMatch = {
|
|
30
|
+
kind: "found";
|
|
31
|
+
route: RouteRecord;
|
|
32
|
+
params: Record<string, string>;
|
|
33
|
+
} | {
|
|
34
|
+
kind: "method-not-allowed";
|
|
35
|
+
allowed: RouteMethod[];
|
|
36
|
+
} | {
|
|
37
|
+
kind: "not-found";
|
|
38
|
+
};
|
|
39
|
+
export declare class Router {
|
|
40
|
+
private readonly compiled;
|
|
41
|
+
private readonly signatures;
|
|
42
|
+
add(route: RouteRecord): void;
|
|
43
|
+
/** Registration order is not match order; this is match order. */
|
|
44
|
+
list(): RouteRecord[];
|
|
45
|
+
/**
|
|
46
|
+
* What `cms.inspect().routes` prints.
|
|
47
|
+
*
|
|
48
|
+
* Paths carry `basePath`, because the question somebody has when they print
|
|
49
|
+
* this is "what do I call", and the answer to that is a URL rather than a
|
|
50
|
+
* pattern the router happens to store.
|
|
51
|
+
*/
|
|
52
|
+
routes(basePath: string): RouteInspection[];
|
|
53
|
+
match(method: string, path: string): RouteMatch;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/http/router.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACZ,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,YAAY,GAAG,CACzB,OAAO,EAAE,YAAY,KAClB,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAElC,MAAM,MAAM,eAAe,GAAG,CAC5B,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,KAC1B,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEvB,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,WAAW,CAAC;IACpB,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,CAAC;IACtB,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;IAC/B,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAeD,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GACrE;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,OAAO,EAAE,WAAW,EAAE,CAAA;CAAE,GACtD;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,CAAC;AAE1B,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAuB;IAChD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6B;IAExD,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAuC5B;IAED,kEAAkE;IAClE,IAAI,IAAI,WAAW,EAAE,CAEpB;IAED;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,EAAE,CAO1C;IAED,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAkB9C;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CmsInstance } from "../../types/instance";
|
|
2
|
+
import type { RouteRecord } from "../router";
|
|
3
|
+
/**
|
|
4
|
+
* Who may edit, and what each role means.
|
|
5
|
+
*
|
|
6
|
+
* These are the endpoints with no collection behind them, so the permission
|
|
7
|
+
* check is explicit — `users:read`, `roles:create` — and an authenticated
|
|
8
|
+
* caller is required even when `rbac` is absent (see `guard.ts`). Everything
|
|
9
|
+
* else is `cms.auth`, unchanged: the panel and a provisioning script get the
|
|
10
|
+
* same invitations, the same hashed secrets and the same events.
|
|
11
|
+
*/
|
|
12
|
+
export declare function accessRoutes(cms: CmsInstance): RouteRecord[];
|
|
13
|
+
//# sourceMappingURL=access.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access.d.ts","sourceRoot":"","sources":["../../../src/http/routes/access.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAWxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,EAAE,CAyT5D"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CmsInstance } from "../../types/instance";
|
|
2
|
+
import type { JsonObject } from "../../types/json";
|
|
3
|
+
import type { RouteRecord } from "../router";
|
|
4
|
+
/**
|
|
5
|
+
* The panel, served from the same handler as the API.
|
|
6
|
+
*
|
|
7
|
+
* No separate deployment, no CORS, no second origin to configure: the bundle
|
|
8
|
+
* is files, the handler serves files, and the panel talks to the API through
|
|
9
|
+
* relative URLs (section 10). `admin.assets` is where the files come from —
|
|
10
|
+
* an interface rather than a directory, because the bundle has to be readable
|
|
11
|
+
* from a Worker, where there is no filesystem.
|
|
12
|
+
*
|
|
13
|
+
* Without one — `admin.assets` unset — this answers with a page that says
|
|
14
|
+
* what is missing and links to the generated OpenAPI document.
|
|
15
|
+
* Deliberately not a 404: a mount point that answers nothing is
|
|
16
|
+
* indistinguishable from a mount point that is wrong, and the first thing
|
|
17
|
+
* somebody does after wiring the catch-all route is open this URL.
|
|
18
|
+
*/
|
|
19
|
+
export declare function adminRoutes(cms: CmsInstance): RouteRecord[];
|
|
20
|
+
/**
|
|
21
|
+
* `GET /openapi.json`: the canonical description of this deployment.
|
|
22
|
+
*
|
|
23
|
+
* Takes a function rather than the document because the document describes
|
|
24
|
+
* this route too: the router has to be complete before it can be generated,
|
|
25
|
+
* and generating it on first request also keeps it off the cold-start path.
|
|
26
|
+
*/
|
|
27
|
+
export declare function openApiRoute(document: () => JsonObject): RouteRecord;
|
|
28
|
+
//# sourceMappingURL=admin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../../src/http/routes/admin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,EAAE,CAyF3D;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,UAAU,GAAG,WAAW,CAepE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CmsInstance } from "../../types/instance";
|
|
2
|
+
import type { RouteRecord } from "../router";
|
|
3
|
+
/**
|
|
4
|
+
* The AI endpoints, generated from the configuration like everything else.
|
|
5
|
+
*
|
|
6
|
+
* Two shapes per field action, and the reason there are two is that a document
|
|
7
|
+
* being written for the first time has no id. The panel asks about what is on
|
|
8
|
+
* the screen, which for a new document is only in the browser, so the draft
|
|
9
|
+
* travels in the body and the stored document — when there is one — is read
|
|
10
|
+
* through `cms.api` and merged underneath it.
|
|
11
|
+
*
|
|
12
|
+
* POST /posts/:id/ai/:field/:action
|
|
13
|
+
* POST /posts/ai/:field/:action (an unsaved draft)
|
|
14
|
+
*
|
|
15
|
+
* Then the panel-wide assistant, which is addressed by nothing in particular
|
|
16
|
+
* because it is not about one collection:
|
|
17
|
+
*
|
|
18
|
+
* POST /ai/assistant (SSE)
|
|
19
|
+
* POST /ai/assistant/plans/:id/approve
|
|
20
|
+
*
|
|
21
|
+
* The per-field routes exist only when a field declares `aiGenerate` or a legacy `ai` action.
|
|
22
|
+
* A deployment with no AI has no AI endpoints, which is what
|
|
23
|
+
* `cms.inspect().routes` should say (section 8).
|
|
24
|
+
*/
|
|
25
|
+
export declare function aiRoutes(cms: CmsInstance): RouteRecord[];
|
|
26
|
+
//# sourceMappingURL=ai.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../../src/http/routes/ai.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,EAAE,CA+JxD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CmsInstance } from "../../types/instance";
|
|
2
|
+
import type { RouteRecord } from "../router";
|
|
3
|
+
/**
|
|
4
|
+
* Editor authentication over HTTP.
|
|
5
|
+
*
|
|
6
|
+
* Every handler is a call into `cms.auth` plus a cookie, and the routes that
|
|
7
|
+
* exist are decided by `admin.auth.methods`: a deployment that never enabled
|
|
8
|
+
* magic links does not answer `POST /auth/magic-link` with "not configured",
|
|
9
|
+
* it does not have the endpoint. `cms.inspect().routes` is then a true
|
|
10
|
+
* statement about the doors this deployment has.
|
|
11
|
+
*/
|
|
12
|
+
export declare function authRoutes(cms: CmsInstance): RouteRecord[];
|
|
13
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/http/routes/auth.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAWxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,EAAE,CAkpB1D"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ResolvedCollection } from "../../types/config";
|
|
2
|
+
import type { CmsInstance } from "../../types/instance";
|
|
3
|
+
import type { RouteRecord } from "../router";
|
|
4
|
+
/**
|
|
5
|
+
* CRUD, generated from the configuration.
|
|
6
|
+
*
|
|
7
|
+
* Every handler here is three lines around a call into `cms.api`, and that is
|
|
8
|
+
* the whole design: the REST layer parses a URL and serialises a result, and
|
|
9
|
+
* knows nothing about access control, hooks, locales, the trash or events.
|
|
10
|
+
* A second implementation of any of those — the usual outcome of writing
|
|
11
|
+
* route handlers by hand — is a second set of bugs (section 10).
|
|
12
|
+
*/
|
|
13
|
+
export declare function documentRoutes(cms: CmsInstance): RouteRecord[];
|
|
14
|
+
/**
|
|
15
|
+
* Singletons.
|
|
16
|
+
*
|
|
17
|
+
* Mounted under `/globals/` rather than at the root: a global and a
|
|
18
|
+
* collection are the same machinery, but a URL that could be either would
|
|
19
|
+
* make `/settings` ambiguous the day somebody adds a `settings` collection.
|
|
20
|
+
*/
|
|
21
|
+
export declare function globalRoutes(cms: CmsInstance): RouteRecord[];
|
|
22
|
+
export declare function schemaName(collection: ResolvedCollection): string;
|
|
23
|
+
export declare function inputName(collection: ResolvedCollection): string;
|
|
24
|
+
//# sourceMappingURL=documents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../../../src/http/routes/documents.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAkBxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAkE7C;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,EAAE,CA0T9D;AA6KD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,EAAE,CA8I5D;AAED,wBAAgB,UAAU,CAAC,UAAU,EAAE,kBAAkB,GAAG,MAAM,CAEjE;AAED,wBAAgB,SAAS,CAAC,UAAU,EAAE,kBAAkB,GAAG,MAAM,CAEhE"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CmsInstance } from "../../types/instance";
|
|
2
|
+
import type { RouteRecord } from "../router";
|
|
3
|
+
/** Deterministic field generation: server functions stay on the server. */
|
|
4
|
+
export declare function generateRoutes(cms: CmsInstance): RouteRecord[];
|
|
5
|
+
//# sourceMappingURL=generate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/http/routes/generate.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C,2EAA2E;AAC3E,wBAAgB,cAAc,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,EAAE,CA6J9D"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { CmsInstance } from "../../types/instance";
|
|
2
|
+
import type { MediaVariantResult } from "../../types/media";
|
|
3
|
+
import type { RouteRecord } from "../router";
|
|
4
|
+
/**
|
|
5
|
+
* The media library over HTTP.
|
|
6
|
+
*
|
|
7
|
+
* Registered only when `uploads` is configured. A deployment with no storage
|
|
8
|
+
* adapter has no library, and routes that exist in order to answer "add an
|
|
9
|
+
* uploads section" would put that sentence in `cms.inspect().routes` as if it
|
|
10
|
+
* were a feature.
|
|
11
|
+
*
|
|
12
|
+
* Reading is not gated by RBAC and writing is: a file's URL is public the
|
|
13
|
+
* moment it is on a page, so gating reads would break anonymous rendering and
|
|
14
|
+
* protect nothing that a private bucket and a signed URL do not already
|
|
15
|
+
* protect (stage 6).
|
|
16
|
+
*/
|
|
17
|
+
export declare function mediaRoutes(cms: CmsInstance): RouteRecord[];
|
|
18
|
+
/**
|
|
19
|
+
* One file, as an HTTP response: the API route and the public route share it.
|
|
20
|
+
*
|
|
21
|
+
* The tag is the checksum of the original plus the variant name: two
|
|
22
|
+
* deployments of the same bytes produce the same tag, and a re-render of the
|
|
23
|
+
* same size does not invalidate a cache that is already correct. A variant is
|
|
24
|
+
* addressed by a name whose meaning is fixed by the configuration, so the
|
|
25
|
+
* bytes behind one URL only change when an editor re-crops — which changes
|
|
26
|
+
* the checksum and the tag — and the answer may be kept for a year.
|
|
27
|
+
*
|
|
28
|
+
* Except when the size could not be rendered and the original stands in for
|
|
29
|
+
* it: that answer is right for now and wrong once the processor recovers, so
|
|
30
|
+
* it carries its own tag and is cached for minutes, not for a year.
|
|
31
|
+
*/
|
|
32
|
+
export declare function mediaResponse(request: Request, result: MediaVariantResult, extraHeaders?: Record<string, string>): Promise<Response>;
|
|
33
|
+
/**
|
|
34
|
+
* The files themselves, at addresses made for the web:
|
|
35
|
+
*
|
|
36
|
+
* /media/med_0mv…/condition-report.png
|
|
37
|
+
* /media/med_0mv…/card/condition-report.webp
|
|
38
|
+
*
|
|
39
|
+
* Registered only with `uploads.publicPath`, outside `basePath`, on the root
|
|
40
|
+
* router: the application mounts the CMS handler on this path as well. The
|
|
41
|
+
* id says which file and the optional middle segment which size; the name is
|
|
42
|
+
* for people and image search, and is otherwise ignored, so a renamed file
|
|
43
|
+
* keeps every link it ever had. No actor, no hooks, no RBAC — a file on a
|
|
44
|
+
* page is public, which is what this route exists to say.
|
|
45
|
+
*/
|
|
46
|
+
export declare function publicMediaRoutes(cms: CmsInstance): RouteRecord[];
|
|
47
|
+
/**
|
|
48
|
+
* The orphan sweep, as an endpoint.
|
|
49
|
+
*
|
|
50
|
+
* Here rather than in the jobs module because it is the media lifecycle's
|
|
51
|
+
* only destructive step and reads better next to the library it collects
|
|
52
|
+
* from. It is also registered in `cms.jobs`, so a deployment with a cron
|
|
53
|
+
* never needs this route.
|
|
54
|
+
*/
|
|
55
|
+
export declare function mediaCollectRoute(cms: CmsInstance): RouteRecord[];
|
|
56
|
+
/** The two names a declared size may not take; see the variant route. */
|
|
57
|
+
export declare const reservedMediaSubRoutes: string[];
|
|
58
|
+
//# sourceMappingURL=media.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../src/http/routes/media.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,KAAK,EAKV,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAW7C;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,EAAE,CA6R3D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,kBAAkB,EAC1B,YAAY,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GACxC,OAAO,CAAC,QAAQ,CAAC,CAwBnB;AAYD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,EAAE,CA2CjE;AAcD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,EAAE,CAsCjE;AAED,yEAAyE;AACzE,eAAO,MAAM,sBAAsB,UAA0C,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CmsInstance } from "../../types/instance";
|
|
2
|
+
import type { RouteRecord } from "../router";
|
|
3
|
+
/**
|
|
4
|
+
* `GET /panel`: the configuration, as data.
|
|
5
|
+
*
|
|
6
|
+
* The panel is one static bundle that has to render every deployment, so the
|
|
7
|
+
* first thing it does is ask what this one is: which collections exist, what
|
|
8
|
+
* fields they carry, which languages are registered, whether there is a
|
|
9
|
+
* trash, what the caller is allowed to press. All of it is derived from the
|
|
10
|
+
* configuration — there is no second place to maintain it, which is the same
|
|
11
|
+
* argument that produced the auto-router and the generated OpenAPI document.
|
|
12
|
+
*
|
|
13
|
+
* Open to anonymous callers on purpose. It describes the shape of the
|
|
14
|
+
* deployment, never its content and never a secret, and the sign-in screen
|
|
15
|
+
* needs the title and the enabled methods *before* anybody is signed in. The
|
|
16
|
+
* per-actor parts — `can`, and field-level access — simply answer for
|
|
17
|
+
* "nobody" then, which is the correct answer for nobody.
|
|
18
|
+
*/
|
|
19
|
+
export declare function panelRoutes(cms: CmsInstance): RouteRecord[];
|
|
20
|
+
//# sourceMappingURL=panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../../src/http/routes/panel.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,EAAE,CA8B3D"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { CmsInstance } from "../../types/instance";
|
|
2
|
+
import type { RouteRecord } from "../router";
|
|
3
|
+
/**
|
|
4
|
+
* The endpoints that are about the CMS rather than about content: the trash,
|
|
5
|
+
* the language registry, the audit trail and the sweeps.
|
|
6
|
+
*
|
|
7
|
+
* All four are read through an instance method rather than a query written
|
|
8
|
+
* here, for the same reason the document routes are three lines each. The
|
|
9
|
+
* trash list in particular has to be one paged query across collections —
|
|
10
|
+
* assembling it per collection would page wrongly the moment two collections
|
|
11
|
+
* have entries.
|
|
12
|
+
*/
|
|
13
|
+
export declare function trashRoutes(cms: CmsInstance): RouteRecord[];
|
|
14
|
+
export declare function localeRoutes(cms: CmsInstance): RouteRecord[];
|
|
15
|
+
export declare function activityRoutes(cms: CmsInstance): RouteRecord[];
|
|
16
|
+
/**
|
|
17
|
+
* The sweeps, as endpoints.
|
|
18
|
+
*
|
|
19
|
+
* The package deliberately starts no timer (`cms.jobs` is not a daemon,
|
|
20
|
+
* because it has to run on Workers and on Lambda), so something has to call
|
|
21
|
+
* this: a Vercel cron with an API key, `wrangler`'s scheduled handler calling
|
|
22
|
+
* `cms.jobs.run()` directly, or a developer with curl.
|
|
23
|
+
*/
|
|
24
|
+
export declare function jobRoutes(cms: CmsInstance): RouteRecord[];
|
|
25
|
+
//# sourceMappingURL=system.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../src/http/routes/system.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,EAAE,CAkH3D;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,EAAE,CAmC5D;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,EAAE,CA4D9D;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,EAAE,CAqEzD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CmsInstance } from "../../types/instance";
|
|
2
|
+
import type { RouteRecord } from "../router";
|
|
3
|
+
/**
|
|
4
|
+
* Subscriptions, deliveries, replay.
|
|
5
|
+
*
|
|
6
|
+
* Registered only when `webhooks.enabled` is true, so a deployment that does
|
|
7
|
+
* not use them does not answer on these paths at all — and the panel, which
|
|
8
|
+
* reads `cms.inspect()`-shaped data from `/panel`, hides the screen rather
|
|
9
|
+
* than showing one that 501s.
|
|
10
|
+
*
|
|
11
|
+
* Every endpoint needs a permission in the `resource:action` grammar the
|
|
12
|
+
* rest of the product uses: `webhooks:read`, `webhooks:create`,
|
|
13
|
+
* `webhooks:update`, `webhooks:delete`. Managing where this CMS sends its
|
|
14
|
+
* content is an administrative act, not an editorial one.
|
|
15
|
+
*/
|
|
16
|
+
export declare function webhookRoutes(cms: CmsInstance): RouteRecord[];
|
|
17
|
+
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../src/http/routes/webhooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAMxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,EAAE,CA2N7D"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { JsonObject } from "../types/json";
|
|
2
|
+
/**
|
|
3
|
+
* The small vocabulary the route modules use to document themselves.
|
|
4
|
+
*
|
|
5
|
+
* Keeping it here rather than inline is not tidiness: a response envelope
|
|
6
|
+
* described slightly differently on forty endpoints produces a generated
|
|
7
|
+
* document nobody can code-generate a client from.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ref(schema: string): JsonObject;
|
|
10
|
+
export declare function pathParam(name: string, description: string): JsonObject;
|
|
11
|
+
export declare function queryParam(name: string, type: "string" | "integer" | "boolean", description: string, extra?: JsonObject): JsonObject;
|
|
12
|
+
/** Locale and fallback: every read takes them, so they are written once. */
|
|
13
|
+
export declare const localeParams: JsonObject[];
|
|
14
|
+
export declare const depthParam: JsonObject;
|
|
15
|
+
/** The filter, sort and paging parameters of a list endpoint. */
|
|
16
|
+
export declare function listParams(collection: string): JsonObject[];
|
|
17
|
+
export declare function jsonBody(schema: JsonObject, required?: boolean): JsonObject;
|
|
18
|
+
export declare function okJson(schema: JsonObject, description: string): JsonObject;
|
|
19
|
+
/**
|
|
20
|
+
* The responses every write shares.
|
|
21
|
+
*
|
|
22
|
+
* `204` is in here on purpose: a `before` hook returning `false` stops the
|
|
23
|
+
* operation without an error (section 5), and a client that does not know
|
|
24
|
+
* that will read an empty body as a broken endpoint.
|
|
25
|
+
*/
|
|
26
|
+
export declare function writeResponses(schema: JsonObject, description: string, status?: number): JsonObject;
|
|
27
|
+
export declare function readResponses(schema: JsonObject, description: string): JsonObject;
|
|
28
|
+
//# sourceMappingURL=spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../src/http/spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD;;;;;;GAMG;AAEH,wBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAE9C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,UAAU,CAQvE;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,EACtC,WAAW,EAAE,MAAM,EACnB,KAAK,GAAE,UAAe,GACrB,UAAU,CAQZ;AAED,4EAA4E;AAC5E,eAAO,MAAM,YAAY,EAAE,UAAU,EAGpC,CAAC;AAEF,eAAO,MAAM,UAAU,YAKtB,CAAC;AAEF,iEAAiE;AACjE,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,EAAE,CAoB3D;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,UAAO,GAAG,UAAU,CAKxE;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,GAAG,UAAU,CAK1E;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,UAAU,EAClB,WAAW,EAAE,MAAM,EACnB,MAAM,SAAM,GACX,UAAU,CAaZ;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,UAAU,EAClB,WAAW,EAAE,MAAM,GAClB,UAAU,CAKZ"}
|
package/dist/http.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@heyo-sh/heyo-cms/http`.
|
|
3
|
+
*
|
|
4
|
+
* The HTTP layer, for the two callers who need it directly: a plugin writing
|
|
5
|
+
* route handlers, and a test or tool that wants the router without a request.
|
|
6
|
+
* An application mounts `cms.handler` through a framework adapter and never
|
|
7
|
+
* imports this.
|
|
8
|
+
*/
|
|
9
|
+
export { createCmsHttp, type CmsHttp } from "./http/handler";
|
|
10
|
+
export { buildOpenApi } from "./http/openapi";
|
|
11
|
+
export { Router, type RouteHandler, type RouteMatch, type RouteMiddleware, type RouteRecord, } from "./http/router";
|
|
12
|
+
export { errorResponse, json, noContent, optionalString, optionalStringArray, readJson, readJsonObject, requireData, requireString, stopped, text, } from "./http/respond";
|
|
13
|
+
export { requestSource, requireActor, requirePermission, requireSession, } from "./http/guard";
|
|
14
|
+
export { boolean as booleanParam, findArgs, integer as integerParam, parseSort, parseWhere, readArgs, } from "./http/params";
|
|
15
|
+
export { requestDb } from "./http/request-db";
|
|
16
|
+
export { jsonBody, listParams, localeParams, okJson, pathParam, queryParam, readResponses, ref, writeResponses, } from "./http/spec";
|
|
17
|
+
//# sourceMappingURL=http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,aAAa,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,MAAM,EACN,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,WAAW,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,aAAa,EACb,IAAI,EACJ,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,OAAO,EACP,IAAI,GACL,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,OAAO,IAAI,YAAY,EACvB,QAAQ,EACR,OAAO,IAAI,YAAY,EACvB,SAAS,EACT,UAAU,EACV,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACL,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,MAAM,EACN,SAAS,EACT,UAAU,EACV,aAAa,EACb,GAAG,EACH,cAAc,GACf,MAAM,aAAa,CAAC"}
|
package/dist/http.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./index-6m1kjq9g.js";import"./index-sgdnp83t.js";import"./index-g041kfa5.js";import{Ye,g,Ze,y,j,On,Xn,eo,P,G,i,Pn,oe,K,St,Xt,f,De,v,W,Re,o,c,a,q,_n,h,r,N,Tt,$n,In,Se,qe}from"./index-hpast878.js";import"./index-8x2em6c8.js";import"./index-91fa1gzf.js";import"./index-2prbs05k.js";export{Se as Router,G as booleanParam,$n as buildOpenApi,qe as createCmsHttp,St as errorResponse,On as findArgs,P as integerParam,i as json,h as jsonBody,_n as listParams,q as localeParams,oe as noContent,r as okJson,W as optionalString,Re as optionalStringArray,eo as parseSort,Xn as parseWhere,c as pathParam,a as queryParam,j as readArgs,Xt as readJson,f as readJsonObject,Tt as readResponses,o as ref,In as requestDb,y as requestSource,Ye as requireActor,De as requireData,g as requirePermission,Ze as requireSession,v as requireString,K as stopped,Pn as text,N as writeResponses};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ResolvedCmsConfig } from "../types/config";
|
|
2
|
+
import type { LocaleRecord } from "../types/locales";
|
|
3
|
+
export { isRtlLocale, localeName, LOCALE_NAMES } from "./names";
|
|
4
|
+
/**
|
|
5
|
+
* The configured languages, named.
|
|
6
|
+
*
|
|
7
|
+
* In the order they were configured: a switcher that reorders what somebody
|
|
8
|
+
* typed is a switcher whose order nobody can control. The default locale is
|
|
9
|
+
* flagged rather than hoisted, for the same reason.
|
|
10
|
+
*/
|
|
11
|
+
export declare function localeRecords(config: ResolvedCmsConfig): LocaleRecord[];
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEhE;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,iBAAiB,GAAG,YAAY,EAAE,CAOvE"}
|