@cogenta/cli 0.3.0 → 0.4.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/admin-assets/assets/index-C9a7O_Xs.css +1 -0
- package/dist/admin-assets/assets/index-DXvMgWvn.js +74 -0
- package/dist/admin-assets/fonts/ibm-plex-mono-400.woff2 +0 -0
- package/dist/admin-assets/fonts/ibm-plex-mono-500.woff2 +0 -0
- package/dist/admin-assets/fonts/ibm-plex-mono-600.woff2 +0 -0
- package/dist/admin-assets/fonts/ibm-plex-mono-700.woff2 +0 -0
- package/dist/admin-assets/fonts/ibm-plex-sans-var.woff2 +0 -0
- package/dist/admin-assets/index.html +2 -2
- package/dist/commands/serve.d.ts +52 -1
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +408 -6
- package/dist/commands/serve.js.map +1 -1
- package/dist/commands/theme-render.d.ts +38 -1
- package/dist/commands/theme-render.d.ts.map +1 -1
- package/dist/commands/theme-render.js +93 -4
- package/dist/commands/theme-render.js.map +1 -1
- package/dist/commands/users.d.ts.map +1 -1
- package/dist/commands/users.js +6 -36
- package/dist/commands/users.js.map +1 -1
- package/dist/reset-mail.d.ts +39 -0
- package/dist/reset-mail.d.ts.map +1 -0
- package/dist/reset-mail.js +45 -0
- package/dist/reset-mail.js.map +1 -0
- package/package.json +15 -12
- package/dist/admin-assets/assets/index-Buwdj1V2.js +0 -71
- package/dist/admin-assets/assets/index-Csef0SiA.css +0 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>Cogenta</title>
|
|
7
|
-
<script type="module" crossorigin src="/admin/assets/index-
|
|
8
|
-
<link rel="stylesheet" crossorigin href="/admin/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/admin/assets/index-DXvMgWvn.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/admin/assets/index-C9a7O_Xs.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="root"></div>
|
package/dist/commands/serve.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type IncomingMessage, type ServerResponse } from 'node:http';
|
|
2
|
-
import { type
|
|
2
|
+
import { type AnalyticsStore } from '@cogenta/analytics';
|
|
3
|
+
import { type AgentsRouter, type AnalyticsRouter, type ApiKeysRouter, type AssistantRouter, type AuditRouter, type AuthRouter, createContentGateway, type ImportRouter, type MarketplaceRouter, type MediaImageProcessor, type MediaRouter, type MenuRouter, type NoticeRouter, type OpsStatusRouter, type PermissionLayer, type RedirectRouter, type RestRouter, type SearchRouter, type SitePlanRouter, type TaxonomyRouter, type UsersRouter } from '@cogenta/api';
|
|
3
4
|
import { type AuthStore } from '@cogenta/auth';
|
|
5
|
+
import { type CommerceAdminRouter } from '@cogenta/commerce';
|
|
4
6
|
import { type DatabaseHandle, type HealthReport, type Logger, type MediaStore, type StorageDriver } from '@cogenta/core';
|
|
5
7
|
import { type CollectionDefinition, type RedirectStore, type SchemaDocument, type TaxonomyDefinition } from '@cogenta/schema';
|
|
6
8
|
import type { GraphQLSchema } from 'graphql';
|
|
@@ -50,14 +52,42 @@ interface Site {
|
|
|
50
52
|
readonly auditRouter: AuditRouter;
|
|
51
53
|
/** `GET /api/search` — the full-text index, reachable for the first time (L10 task 3). */
|
|
52
54
|
readonly searchRouter: SearchRouter;
|
|
55
|
+
/**
|
|
56
|
+
* Self-hosted, cookie-free page-view analytics (`@cogenta/analytics`).
|
|
57
|
+
*
|
|
58
|
+
* `analyticsStore` is the aggregate/write side used both by `analyticsRouter`
|
|
59
|
+
* (`/api/analytics/beacon` and `/api/analytics/summary`) and directly by the
|
|
60
|
+
* admin dashboard widget's server-rendered data. Always mounted — a site
|
|
61
|
+
* with nobody reading the dashboard still collects nothing more than it
|
|
62
|
+
* would with the feature switched off (R1/R2 spirit: purely additive).
|
|
63
|
+
*/
|
|
64
|
+
readonly analyticsStore: AnalyticsStore;
|
|
65
|
+
readonly analyticsRouter: AnalyticsRouter;
|
|
53
66
|
/** `/api/taxonomies/*` — terms, mounted apart from content because a taxonomy is not a collection (`schema@2.0`, ADR-0022). */
|
|
54
67
|
readonly taxonomyRouter: TaxonomyRouter;
|
|
68
|
+
/** `/api/marketplace/*` — L17's local plugin/theme/skin catalog, reusing `@cogenta/plugins`' real Ed25519 verification unchanged. Always mounted; the catalog is empty until a site configures one. */
|
|
69
|
+
readonly marketplaceRouter: MarketplaceRouter;
|
|
70
|
+
/** `/api/menus/*` — navigation menus. Not schema-declared like a taxonomy: created and edited entirely at runtime, so this is always mounted, empty until the admin (or the API) creates the first one. */
|
|
71
|
+
readonly menuRouter: MenuRouter;
|
|
72
|
+
/**
|
|
73
|
+
* `/api/commerce/*` — contract E's back office (ADR-0024), mounted for the
|
|
74
|
+
* first time. `@cogenta/commerce`'s tables are only created and this
|
|
75
|
+
* router is only present once a site actually reaches this point — a site
|
|
76
|
+
* that never sells anything never pays for it (mirrors the taxonomy story).
|
|
77
|
+
*/
|
|
78
|
+
readonly commerceRouter: CommerceAdminRouter;
|
|
79
|
+
/** `/api/redirects` — admin-only management of the redirect table `cogenta serve` already applies to every public GET (audit follow-up to L10 task 2). */
|
|
80
|
+
readonly redirectRouter: RedirectRouter;
|
|
81
|
+
/** `GET /api/security-status` and `GET /api/webhooks-status` — read-only mirrors of the site's configuration file, admin-only (audit follow-up to L10 task 6 / L14 task 1). */
|
|
82
|
+
readonly opsStatusRouter: OpsStatusRouter;
|
|
55
83
|
/** ADR-0021's half that replaces the MFA sign-in gate: recommendations the admin shows, never a block. */
|
|
56
84
|
readonly noticeRouter: NoticeRouter;
|
|
57
85
|
/** Refused sign-ins, watched for a run worth alerting on (L14 task 4). `null` when nothing is configured to receive one. */
|
|
58
86
|
readonly securityAlerts: SecurityAlertWatch | null;
|
|
59
87
|
/** Account management from the admin instead of `cogenta users create` on a terminal (L11 task 3). */
|
|
60
88
|
readonly usersRouter: UsersRouter;
|
|
89
|
+
/** `/api/api-keys` — machine-to-machine bearer credentials, admin-only (L13 task 8). */
|
|
90
|
+
readonly apiKeysRouter: ApiKeysRouter;
|
|
61
91
|
/** Only set when a caller passes `agents` into `assembleSite` — no site constructs one today (R2: agents are optional, not a hard dependency of the CMS). */
|
|
62
92
|
readonly agentsRouter?: AgentsRouter;
|
|
63
93
|
/**
|
|
@@ -68,6 +98,13 @@ interface Site {
|
|
|
68
98
|
* `SITE_PLAN_NO_PROVIDER` for the routes that would need a model.
|
|
69
99
|
*/
|
|
70
100
|
readonly sitePlanRouter?: SitePlanRouter;
|
|
101
|
+
/**
|
|
102
|
+
* `/api/import` — the admin's counterpart to `cogenta import wordpress` on
|
|
103
|
+
* a terminal. Always mounted: unlike the site planner it needs no external
|
|
104
|
+
* provider, only this site's own database and storage, which `assembleSite`
|
|
105
|
+
* already has in scope.
|
|
106
|
+
*/
|
|
107
|
+
readonly importRouter: ImportRouter;
|
|
71
108
|
/**
|
|
72
109
|
* `/api/assistant` — L18. Always mounted, even on a site with no AI provider:
|
|
73
110
|
* it is the route that *answers* `{available: false}`, which is what lets the
|
|
@@ -116,6 +153,13 @@ interface Site {
|
|
|
116
153
|
readonly database: HealthReport;
|
|
117
154
|
readonly storage: HealthReport;
|
|
118
155
|
}>;
|
|
156
|
+
/**
|
|
157
|
+
* Drains one batch of due scheduled-publication jobs. `runServe` calls this
|
|
158
|
+
* on a `setInterval` for as long as the process runs — see its comment for
|
|
159
|
+
* why a fixed period is the honest, R1-compliant substitute for a real
|
|
160
|
+
* worker. Exposed so a test can call it directly instead of waiting.
|
|
161
|
+
*/
|
|
162
|
+
readonly tickScheduledPublishing: () => Promise<number>;
|
|
119
163
|
dispose(): Promise<void>;
|
|
120
164
|
}
|
|
121
165
|
/**
|
|
@@ -162,6 +206,13 @@ export interface ServeOptions {
|
|
|
162
206
|
* only the write is held to the decision.
|
|
163
207
|
*/
|
|
164
208
|
readonly development?: boolean;
|
|
209
|
+
/**
|
|
210
|
+
* Overrides `SCHEDULED_PUBLISH_TICK_MS`. Not a CLI flag — an operator has
|
|
211
|
+
* no reason to change a 60-second cadence, and this exists so a test can
|
|
212
|
+
* prove the interval really drains the queue without waiting a minute for
|
|
213
|
+
* it.
|
|
214
|
+
*/
|
|
215
|
+
readonly scheduledPublishTickMs?: number;
|
|
165
216
|
}
|
|
166
217
|
/**
|
|
167
218
|
* Runs until `options.signal` aborts. Returns 0 on a clean shutdown, 1 if
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAA;AAInF,OAAO,EAEL,KAAK,YAAY,EAEjB,KAAK,eAAe,EAEpB,KAAK,WAAW,EAChB,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAA;AAInF,OAAO,EACL,KAAK,cAAc,EAGpB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAEL,KAAK,YAAY,EAEjB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,EAEpB,KAAK,WAAW,EAChB,KAAK,UAAU,EAQf,oBAAoB,EAqBpB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,cAAc,EAGnB,KAAK,UAAU,EAEf,KAAK,YAAY,EACjB,KAAK,cAAc,EAEnB,KAAK,cAAc,EACnB,KAAK,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