@aphexcms/cms-core 11.1.1 → 11.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/dist/api/docs-ui.d.ts +22 -0
- package/dist/api/docs-ui.d.ts.map +1 -0
- package/dist/api/docs-ui.js +19 -0
- package/dist/api/schemas/assets.d.ts +11 -0
- package/dist/api/schemas/assets.d.ts.map +1 -1
- package/dist/api/schemas/assets.js +24 -0
- package/dist/auth/auth-hooks.d.ts.map +1 -1
- package/dist/auth/auth-hooks.js +4 -1
- package/dist/server/api/index.d.ts.map +1 -1
- package/dist/server/api/index.js +7 -0
- package/dist/server/api/openapi/generate.d.ts +13 -0
- package/dist/server/api/openapi/generate.d.ts.map +1 -0
- package/dist/server/api/openapi/generate.js +529 -0
- package/dist/server/api/openapi/json-schema.d.ts +45 -0
- package/dist/server/api/openapi/json-schema.d.ts.map +1 -0
- package/dist/server/api/openapi/json-schema.js +206 -0
- package/dist/server/api/openapi/registry.d.ts +78 -0
- package/dist/server/api/openapi/registry.d.ts.map +1 -0
- package/dist/server/api/openapi/registry.js +628 -0
- package/dist/server/api/routes/agent-change-sets.d.ts +6 -0
- package/dist/server/api/routes/agent-change-sets.d.ts.map +1 -1
- package/dist/server/api/routes/agent-change-sets.js +2 -1
- package/dist/server/api/routes/jobs.d.ts +32 -0
- package/dist/server/api/routes/jobs.d.ts.map +1 -1
- package/dist/server/api/routes/jobs.js +7 -3
- package/dist/server/api/routes/openapi.d.ts +34 -0
- package/dist/server/api/routes/openapi.d.ts.map +1 -0
- package/dist/server/api/routes/openapi.js +97 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -0
- package/dist/types/config.d.ts +15 -0
- package/dist/types/config.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobs.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/api/routes/jobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"jobs.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/api/routes/jobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAqBzC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;iBAMxB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;iBAK1B,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;iBAA+C,CAAC;AA6FxE,eAAO,MAAM,UAAU,EAAE,IAAI,CAAC,QAAQ,CAuKnC,CAAC"}
|
|
@@ -17,20 +17,24 @@ const jobStatus = z.enum(['pending', 'leased', 'completed', 'failed', 'cancelled
|
|
|
17
17
|
* Super admins only — it's the one place the admin UI crosses a tenant boundary.
|
|
18
18
|
*/
|
|
19
19
|
const historyScope = z.enum(['organization', 'all']);
|
|
20
|
-
|
|
20
|
+
// Exported so the OpenAPI registry can describe these query strings from the same
|
|
21
|
+
// object the handler validates with. Staying here rather than moving to
|
|
22
|
+
// `api/schemas/jobs.ts` keeps the convention that GET-only shapes live with their
|
|
23
|
+
// handler — the registry imports them, it doesn't need them relocated.
|
|
24
|
+
export const listJobsQuery = z.object({
|
|
21
25
|
status: jobStatus.optional(),
|
|
22
26
|
type: z.string().optional(),
|
|
23
27
|
scope: historyScope.optional(),
|
|
24
28
|
limit: z.coerce.number().int().min(1).max(200).optional(),
|
|
25
29
|
offset: z.coerce.number().int().min(0).optional()
|
|
26
30
|
});
|
|
27
|
-
const listEventsQuery = z.object({
|
|
31
|
+
export const listEventsQuery = z.object({
|
|
28
32
|
type: z.string().optional(),
|
|
29
33
|
scope: historyScope.optional(),
|
|
30
34
|
limit: z.coerce.number().int().min(1).max(200).optional(),
|
|
31
35
|
offset: z.coerce.number().int().min(0).optional()
|
|
32
36
|
});
|
|
33
|
-
const healthQuery = z.object({ scope: historyScope.optional() });
|
|
37
|
+
export const healthQuery = z.object({ scope: historyScope.optional() });
|
|
34
38
|
/** Map an adapter Page into the ApiResponse `pagination` shape the client expects. */
|
|
35
39
|
function toPagination(page) {
|
|
36
40
|
const pageSize = page.limit || 1;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import type { AphexEnv } from '../index.js';
|
|
3
|
+
/**
|
|
4
|
+
* `GET /api/openapi.json` — the spec for *this* instance.
|
|
5
|
+
*
|
|
6
|
+
* Generated per request rather than served from a file, because half of it only
|
|
7
|
+
* exists at runtime: the per-collection document shapes come from
|
|
8
|
+
* `cmsEngine.config.schemaTypes`. A checked-in file would describe `draftData`
|
|
9
|
+
* as an untyped record forever.
|
|
10
|
+
*
|
|
11
|
+
* Authenticated (see `protectedApiRoutes` in `auth/auth-hooks.ts`): the document
|
|
12
|
+
* enumerates this deployment's entire content model, which is not something to
|
|
13
|
+
* hand to anonymous callers even though no content is included.
|
|
14
|
+
*
|
|
15
|
+
* Not cached: generation is pure object-building over schemas already in memory,
|
|
16
|
+
* and a stale spec after a schema change is worse than the microseconds saved.
|
|
17
|
+
*/
|
|
18
|
+
export declare const openapiRouter: Hono<AphexEnv>;
|
|
19
|
+
/**
|
|
20
|
+
* `GET /api/docs` — a rendered reference for the spec above.
|
|
21
|
+
*
|
|
22
|
+
* Scalar rather than Swagger UI: it reads OpenAPI 3.1 natively (Swagger UI still
|
|
23
|
+
* treats 3.1 as a best-effort downgrade, and 3.1 is what `z.toJSONSchema` emits
|
|
24
|
+
* cleanly), and it's a single script tag with no build step.
|
|
25
|
+
*
|
|
26
|
+
* Authenticated, though the page carries no content of its own. Two reasons: an
|
|
27
|
+
* unauthenticated visitor can't read `/api/openapi.json` anyway, so they'd get a
|
|
28
|
+
* shell that fails to load its document and renders a cryptic error; and an
|
|
29
|
+
* Aphex-branded API console answering on every content site is a fingerprint
|
|
30
|
+
* nobody asked for. Signed out, this redirects to the login page — which says
|
|
31
|
+
* what happened, unlike a 401 rendered inside a spec viewer.
|
|
32
|
+
*/
|
|
33
|
+
export declare const openapiDocsRouter: Hono<AphexEnv>;
|
|
34
|
+
//# sourceMappingURL=openapi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/api/routes/openapi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,EAAE,IAAI,CAAC,QAAQ,CAUvC,CAAC;AAqBH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,EAAE,IAAI,CAAC,QAAQ,CA0C3C,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import { generateOpenApiDocument } from '../openapi/generate.js';
|
|
3
|
+
import { isApiDocsEnabled } from '../../../api/docs-ui.js';
|
|
4
|
+
/**
|
|
5
|
+
* `GET /api/openapi.json` — the spec for *this* instance.
|
|
6
|
+
*
|
|
7
|
+
* Generated per request rather than served from a file, because half of it only
|
|
8
|
+
* exists at runtime: the per-collection document shapes come from
|
|
9
|
+
* `cmsEngine.config.schemaTypes`. A checked-in file would describe `draftData`
|
|
10
|
+
* as an untyped record forever.
|
|
11
|
+
*
|
|
12
|
+
* Authenticated (see `protectedApiRoutes` in `auth/auth-hooks.ts`): the document
|
|
13
|
+
* enumerates this deployment's entire content model, which is not something to
|
|
14
|
+
* hand to anonymous callers even though no content is included.
|
|
15
|
+
*
|
|
16
|
+
* Not cached: generation is pure object-building over schemas already in memory,
|
|
17
|
+
* and a stale spec after a schema change is worse than the microseconds saved.
|
|
18
|
+
*/
|
|
19
|
+
export const openapiRouter = new Hono().get('/', (c) => {
|
|
20
|
+
const { cmsEngine } = c.var.aphexCMS;
|
|
21
|
+
const url = new URL(c.req.url);
|
|
22
|
+
const doc = generateOpenApiDocument({
|
|
23
|
+
schemaTypes: cmsEngine.config.schemaTypes,
|
|
24
|
+
serverUrl: `${url.protocol}//${url.host}`
|
|
25
|
+
});
|
|
26
|
+
return c.json(doc);
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* The Scalar build this page loads, pinned by exact version with an integrity
|
|
30
|
+
* hash.
|
|
31
|
+
*
|
|
32
|
+
* Pinned because the page is same-origin with the admin: whatever this script
|
|
33
|
+
* is, it runs with the signed-in user's cookies and can call the whole write API
|
|
34
|
+
* as them. An unpinned `@scalar/api-reference` resolves to whatever jsDelivr
|
|
35
|
+
* serves today, which means a third party can change what executes on your admin
|
|
36
|
+
* origin without anyone here deciding to upgrade. The SRI hash makes that
|
|
37
|
+
* concrete rather than trusted: if the bytes differ, the browser refuses to run
|
|
38
|
+
* them and the page degrades to empty instead of running something unreviewed.
|
|
39
|
+
*
|
|
40
|
+
* Bumping this is a deliberate two-step: change the version, recompute the hash
|
|
41
|
+
* (`curl -sL <url> | openssl dgst -sha384 -binary | openssl base64 -A`).
|
|
42
|
+
*/
|
|
43
|
+
const SCALAR_VERSION = '1.68.0';
|
|
44
|
+
const SCALAR_SRC = `https://cdn.jsdelivr.net/npm/@scalar/api-reference@${SCALAR_VERSION}`;
|
|
45
|
+
const SCALAR_INTEGRITY = 'sha384-ayGz8N+NChlUEfR0zr5Zy3T6Q4lhcdiASJNoshS6+vxV56ZE300qfWNBjj9pqsLN';
|
|
46
|
+
/**
|
|
47
|
+
* `GET /api/docs` — a rendered reference for the spec above.
|
|
48
|
+
*
|
|
49
|
+
* Scalar rather than Swagger UI: it reads OpenAPI 3.1 natively (Swagger UI still
|
|
50
|
+
* treats 3.1 as a best-effort downgrade, and 3.1 is what `z.toJSONSchema` emits
|
|
51
|
+
* cleanly), and it's a single script tag with no build step.
|
|
52
|
+
*
|
|
53
|
+
* Authenticated, though the page carries no content of its own. Two reasons: an
|
|
54
|
+
* unauthenticated visitor can't read `/api/openapi.json` anyway, so they'd get a
|
|
55
|
+
* shell that fails to load its document and renders a cryptic error; and an
|
|
56
|
+
* Aphex-branded API console answering on every content site is a fingerprint
|
|
57
|
+
* nobody asked for. Signed out, this redirects to the login page — which says
|
|
58
|
+
* what happened, unlike a 401 rendered inside a spec viewer.
|
|
59
|
+
*/
|
|
60
|
+
export const openapiDocsRouter = new Hono().get('/', (c) => {
|
|
61
|
+
const { config } = c.var.aphexCMS.cmsEngine;
|
|
62
|
+
if (!isApiDocsEnabled(config)) {
|
|
63
|
+
return c.notFound();
|
|
64
|
+
}
|
|
65
|
+
// The auth hook resolves a session for any `/api/*` path but only rejects the
|
|
66
|
+
// routes it protects, so this is a populated principal or null.
|
|
67
|
+
if (!c.var.auth) {
|
|
68
|
+
const loginUrl = config.auth?.loginUrl || '/login';
|
|
69
|
+
return c.redirect(loginUrl, 302);
|
|
70
|
+
}
|
|
71
|
+
return c.html(`<!doctype html>
|
|
72
|
+
<html>
|
|
73
|
+
<head>
|
|
74
|
+
<meta charset="utf-8" />
|
|
75
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
76
|
+
<meta name="robots" content="noindex" />
|
|
77
|
+
<title>AphexCMS API reference</title>
|
|
78
|
+
</head>
|
|
79
|
+
<body>
|
|
80
|
+
<div id="app"></div>
|
|
81
|
+
<script
|
|
82
|
+
src="${SCALAR_SRC}"
|
|
83
|
+
integrity="${SCALAR_INTEGRITY}"
|
|
84
|
+
crossorigin="anonymous"
|
|
85
|
+
></script>
|
|
86
|
+
<script>
|
|
87
|
+
Scalar.createApiReference('#app', {
|
|
88
|
+
url: '/api/openapi.json',
|
|
89
|
+
// Send the admin session cookie with the spec fetch.
|
|
90
|
+
fetch: (input, init) => fetch(input, { ...init, credentials: 'same-origin' }),
|
|
91
|
+
theme: 'default',
|
|
92
|
+
hideDownloadButton: false
|
|
93
|
+
});
|
|
94
|
+
</script>
|
|
95
|
+
</body>
|
|
96
|
+
</html>`);
|
|
97
|
+
});
|
package/dist/server/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export { DEFAULT_ALLOWED_MIME_TYPES } from '../utils/file-accept.js';
|
|
|
15
15
|
export { CMSEngine } from '../engine.js';
|
|
16
16
|
export { createCMSHook, __notifyAphexConfigChanged, type CMSInstances } from '../hooks.js';
|
|
17
17
|
export * from '../api/limits.js';
|
|
18
|
+
export * from '../api/docs-ui.js';
|
|
18
19
|
export * from '../images/index.js';
|
|
19
20
|
export * from '../db/interfaces/index.js';
|
|
20
21
|
export * from '../storage/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/server/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAE/B,cAAc,kBAAkB,CAAC;AAEjC,cAAc,gBAAgB,CAAC;AAE/B,cAAc,gBAAgB,CAAC;AAE/B,cAAc,aAAa,CAAC;AAG5B,OAAO,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AACxF,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AAGzC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9E,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAGlE,OAAO,EAAE,SAAS,EAAE,MAAM,WA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from '../hooks.js';
|
|
|
27
27
|
// Plain constants and pure helpers — no imports of their own, so this adds
|
|
28
28
|
// nothing to any chunk that already touches this barrel.
|
|
29
29
|
export * from '../api/limits.js';
|
|
30
|
+
export * from '../api/docs-ui.js';
|
|
30
31
|
export * from '../images/index.js';
|
|
31
32
|
export * from '../db/interfaces/index.js';
|
|
32
33
|
// Storage adapters and interfaces
|
package/dist/types/config.d.ts
CHANGED
|
@@ -200,6 +200,21 @@ export interface CMSConfig {
|
|
|
200
200
|
* - `GraphQLConfig` object: enabled with custom options
|
|
201
201
|
*/
|
|
202
202
|
graphql?: boolean | GraphQLConfig;
|
|
203
|
+
/**
|
|
204
|
+
* OpenAPI description of the HTTP API.
|
|
205
|
+
*
|
|
206
|
+
* `GET /api/openapi.json` is always mounted and always authenticated — the
|
|
207
|
+
* document enumerates this instance's whole content model.
|
|
208
|
+
*
|
|
209
|
+
* `docsUi` governs only the rendered reference at `GET /api/docs`, which is
|
|
210
|
+
* mounted by default and authenticated like the JSON. Set `false` to unmount
|
|
211
|
+
* it — the one thing the page does that the JSON endpoint doesn't is load
|
|
212
|
+
* Scalar from a public CDN, so this is the switch for an instance that
|
|
213
|
+
* shouldn't pull third-party scripts.
|
|
214
|
+
*/
|
|
215
|
+
openapi?: {
|
|
216
|
+
docsUi?: boolean;
|
|
217
|
+
};
|
|
203
218
|
/**
|
|
204
219
|
* Log level for the built-in console logger. Defaults to 'debug' in dev, 'warn' in production.
|
|
205
220
|
* Ignored when a custom `logger` is provided.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/types/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAA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