dineway 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dist/{apply-CAPvMfoU.mjs → apply-iVSqz2qs.mjs} +132 -39
- package/dist/astro/index.d.mts +18 -9
- package/dist/astro/index.mjs +238 -16
- package/dist/astro/middleware/auth.d.mts +16 -5
- package/dist/astro/middleware/auth.mjs +74 -37
- package/dist/astro/middleware/redirect.mjs +24 -8
- package/dist/astro/middleware/request-context.mjs +18 -5
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.mjs +411 -169
- package/dist/astro/types.d.mts +25 -8
- package/dist/{byline-DeWCMU_i.mjs → byline-OhH2dlRu.mjs} +6 -21
- package/dist/{bylines-DyqBV9EQ.mjs → bylines-BGpD9_hy.mjs} +16 -6
- package/dist/cache-BdSY-gQN.mjs +42 -0
- package/dist/chunks--4F8ddV4.mjs +18 -0
- package/dist/cli/index.mjs +935 -15
- package/dist/client/external-auth-headers.d.mts +1 -1
- package/dist/client/index.d.mts +11 -3
- package/dist/client/index.mjs +4 -3
- package/dist/{connection-C9pxzuag.mjs → connection-BCNICDWN.mjs} +22 -5
- package/dist/{content-zSgdNmnt.mjs → content-DWi4d0rT.mjs} +41 -2
- package/dist/database/instrumentation.d.mts +34 -0
- package/dist/database/instrumentation.mjs +53 -0
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +2 -2
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/libsql.mjs +11 -5
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/db/sqlite.mjs +7 -1
- package/dist/db-errors-CEqD7qH9.mjs +23 -0
- package/dist/{default-WYlzADZL.mjs → default-VjJyuuG9.mjs} +2 -0
- package/dist/{dialect-helpers-B9uSp2GJ.mjs → dialect-helpers-DhTzaUxP.mjs} +3 -0
- package/dist/{error-DrxtnGPg.mjs → error-BmL6QipT.mjs} +7 -3
- package/dist/{index-C-jx21qs.d.mts → index-yvc6E_17.d.mts} +157 -30
- package/dist/index.d.mts +11 -11
- package/dist/index.mjs +24 -22
- package/dist/{loader-qKmo0wAY.mjs → loader-sMG4TZ-u.mjs} +9 -3
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +1 -1
- package/dist/media/local-runtime.d.mts +7 -7
- package/dist/page/index.d.mts +10 -2
- package/dist/page/index.mjs +22 -1
- package/dist/patterns-CrCYkMBb.mjs +92 -0
- package/dist/{placeholder-bOx1xCTY.d.mts → placeholder--wOi4TbO.d.mts} +1 -1
- package/dist/{placeholder-B3knXwNc.mjs → placeholder-Cp8g5Emj.mjs} +1 -1
- package/dist/plugins/adapt-sandbox-entry.d.mts +5 -5
- package/dist/plugins/adapt-sandbox-entry.mjs +1 -1
- package/dist/{query-BiaPl_g2.mjs → query-kDmwCsHh.mjs} +118 -50
- package/dist/{redirect-JPqLAbxa.mjs → redirect-DnEWAkVg.mjs} +43 -99
- package/dist/{registry-DSd1GWB8.mjs → registry-C0zjeB9P.mjs} +191 -123
- package/dist/request-cache-Dk5qPSOx.mjs +66 -0
- package/dist/request-context.d.mts +4 -16
- package/dist/{runner-B5l1JfOj.d.mts → runner-CFI6B6J2.d.mts} +1 -1
- package/dist/{runner-BGUGywgG.mjs → runner-DWZm2KQm.mjs} +589 -137
- package/dist/runtime.d.mts +6 -6
- package/dist/runtime.mjs +2 -2
- package/dist/{search-BNruJHDL.mjs → search-BApX1xhM.mjs} +570 -424
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +11 -10
- package/dist/seo/index.d.mts +1 -1
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/s3.d.mts +11 -3
- package/dist/storage/s3.mjs +78 -15
- package/dist/taxonomies-1s5PaS_8.mjs +266 -0
- package/dist/transaction-Cn2rjY78.mjs +27 -0
- package/dist/{types-BgQeVaPj.d.mts → types-BuMDPy5C.d.mts} +52 -3
- package/dist/{types-DuNbGKjF.mjs → types-COeOq9nK.mjs} +6 -1
- package/dist/{types-ju-_ORz7.d.mts → types-CWbdtiux.d.mts} +13 -5
- package/dist/{types-D38djUXv.d.mts → types-Cj0KMIZV.d.mts} +16 -3
- package/dist/{types-DkvMXalq.d.mts → types-DOrVigru.d.mts} +159 -0
- package/dist/{validate-CXnRKfJK.mjs → validate-BZ5wnLLp.mjs} +2 -1
- package/dist/{validate-DVKJJ-M_.d.mts → validate-IPf8n4Fj.d.mts} +4 -51
- package/dist/{validate-CqRJb_xU.mjs → validate-VPnKoIzW.mjs} +10 -10
- package/dist/version-hmtC3Cmv.mjs +6 -0
- package/package.json +49 -38
- package/src/astro/routes/admin.astro +25 -9
- package/src/astro/routes/api/admin/api-tokens/[id].ts +4 -0
- package/src/astro/routes/api/admin/api-tokens/index.ts +24 -2
- package/src/astro/routes/api/admin/briefing.ts +76 -0
- package/src/astro/routes/api/admin/bylines/[id]/index.ts +3 -0
- package/src/astro/routes/api/admin/bylines/index.ts +2 -0
- package/src/astro/routes/api/admin/context/[id]/history.ts +35 -0
- package/src/astro/routes/api/admin/context/[id]/index.ts +35 -0
- package/src/astro/routes/api/admin/context/[id]/review.ts +57 -0
- package/src/astro/routes/api/admin/context/[id]/supersede.ts +58 -0
- package/src/astro/routes/api/admin/context/diff.ts +35 -0
- package/src/astro/routes/api/admin/context/index.ts +69 -0
- package/src/astro/routes/api/admin/context/stale.ts +35 -0
- package/src/astro/routes/api/admin/hitl-requests/[id]/index.ts +38 -0
- package/src/astro/routes/api/admin/hitl-requests/[id]/resolve.ts +54 -0
- package/src/astro/routes/api/admin/hitl-requests/index.ts +38 -0
- package/src/astro/routes/api/admin/hooks/exclusive/[hookName].ts +58 -17
- package/src/astro/routes/api/admin/oauth-clients/[id].ts +28 -1
- package/src/astro/routes/api/admin/oauth-clients/index.ts +25 -1
- package/src/astro/routes/api/admin/plugins/[id]/disable.ts +54 -2
- package/src/astro/routes/api/admin/plugins/[id]/enable.ts +54 -2
- package/src/astro/routes/api/admin/plugins/[id]/uninstall.ts +51 -1
- package/src/astro/routes/api/admin/plugins/[id]/update.ts +98 -3
- package/src/astro/routes/api/admin/plugins/marketplace/[id]/install.ts +72 -1
- package/src/astro/routes/api/admin/review-requests/[id]/index.ts +35 -0
- package/src/astro/routes/api/admin/review-requests/[id]/resolve.ts +52 -0
- package/src/astro/routes/api/admin/review-requests/index.ts +35 -0
- package/src/astro/routes/api/admin/users/[id]/disable.ts +26 -23
- package/src/astro/routes/api/admin/users/[id]/index.ts +41 -21
- package/src/astro/routes/api/auth/invite/register-options.ts +73 -0
- package/src/astro/routes/api/auth/magic-link/send.ts +2 -1
- package/src/astro/routes/api/auth/passkey/options.ts +2 -1
- package/src/astro/routes/api/auth/passkey/verify.ts +5 -1
- package/src/astro/routes/api/auth/signup/request.ts +20 -8
- package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +3 -4
- package/src/astro/routes/api/content/[collection]/[id]/compare.ts +1 -1
- package/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts +16 -2
- package/src/astro/routes/api/content/[collection]/[id]/duplicate.ts +16 -0
- package/src/astro/routes/api/content/[collection]/[id]/permanent.ts +9 -0
- package/src/astro/routes/api/content/[collection]/[id]/preview-url.ts +1 -1
- package/src/astro/routes/api/content/[collection]/[id]/publish.ts +45 -1
- package/src/astro/routes/api/content/[collection]/[id]/restore.ts +12 -2
- package/src/astro/routes/api/content/[collection]/[id]/revisions.ts +1 -1
- package/src/astro/routes/api/content/[collection]/[id]/schedule.ts +24 -0
- package/src/astro/routes/api/content/[collection]/[id]/terms/[taxonomy].ts +3 -0
- package/src/astro/routes/api/content/[collection]/[id]/translations.ts +20 -0
- package/src/astro/routes/api/content/[collection]/[id]/unpublish.ts +13 -0
- package/src/astro/routes/api/content/[collection]/[id].ts +36 -0
- package/src/astro/routes/api/content/[collection]/index.ts +48 -4
- package/src/astro/routes/api/content/[collection]/trash.ts +1 -1
- package/src/astro/routes/api/health.ts +54 -0
- package/src/astro/routes/api/import/wordpress/analyze.ts +2 -10
- package/src/astro/routes/api/import/wordpress/execute.ts +40 -6
- package/src/astro/routes/api/import/wordpress/prepare.ts +36 -5
- package/src/astro/routes/api/import/wordpress/rewrite-urls.ts +33 -1
- package/src/astro/routes/api/import/wordpress-plugin/analyze.ts +3 -3
- package/src/astro/routes/api/import/wordpress-plugin/execute.ts +57 -15
- package/src/astro/routes/api/manifest.ts +13 -1
- package/src/astro/routes/api/mcp.ts +1 -0
- package/src/astro/routes/api/media/providers/[providerId]/[itemId].ts +7 -2
- package/src/astro/routes/api/media/upload-url.ts +11 -2
- package/src/astro/routes/api/media.ts +9 -7
- package/src/astro/routes/api/menus/[name]/items.ts +124 -5
- package/src/astro/routes/api/menus/[name]/reorder.ts +47 -1
- package/src/astro/routes/api/menus/[name].ts +84 -4
- package/src/astro/routes/api/menus/index.ts +46 -2
- package/src/astro/routes/api/oauth/authorize.ts +21 -8
- package/src/astro/routes/api/oauth/device/code.ts +2 -1
- package/src/astro/routes/api/oauth/device/token.ts +2 -1
- package/src/astro/routes/api/oauth/register.ts +182 -0
- package/src/astro/routes/api/oauth/token.ts +18 -7
- package/src/astro/routes/api/openapi.json.ts +3 -2
- package/src/astro/routes/api/plugins/[pluginId]/[...path].ts +21 -4
- package/src/astro/routes/api/redirects/[id].ts +103 -4
- package/src/astro/routes/api/redirects/index.ts +50 -2
- package/src/astro/routes/api/schema/collections/[slug]/fields/[fieldSlug].ts +28 -0
- package/src/astro/routes/api/schema/collections/[slug]/fields/index.ts +15 -0
- package/src/astro/routes/api/schema/collections/[slug]/fields/reorder.ts +13 -0
- package/src/astro/routes/api/schema/collections/[slug]/index.ts +27 -0
- package/src/astro/routes/api/schema/collections/index.ts +14 -0
- package/src/astro/routes/api/search/index.ts +1 -0
- package/src/astro/routes/api/search/suggest.ts +1 -0
- package/src/astro/routes/api/sections/[slug].ts +123 -4
- package/src/astro/routes/api/sections/index.ts +57 -2
- package/src/astro/routes/api/settings.ts +51 -2
- package/src/astro/routes/api/setup/admin-verify.ts +25 -5
- package/src/astro/routes/api/setup/admin.ts +16 -8
- package/src/astro/routes/api/setup/index.ts +3 -2
- package/src/astro/routes/api/taxonomies/[name]/terms/[slug].ts +141 -4
- package/src/astro/routes/api/taxonomies/[name]/terms/index.ts +64 -2
- package/src/astro/routes/api/taxonomies/index.ts +57 -2
- package/src/astro/routes/api/well-known/auth.ts +3 -1
- package/src/astro/routes/api/well-known/oauth-authorization-server.ts +8 -5
- package/src/astro/routes/api/well-known/oauth-protected-resource.ts +3 -2
- package/src/astro/routes/api/widget-areas/[name]/reorder.ts +58 -16
- package/src/astro/routes/api/widget-areas/[name]/widgets/[id].ts +124 -38
- package/src/astro/routes/api/widget-areas/[name]/widgets.ts +66 -20
- package/src/astro/routes/api/widget-areas/[name].ts +55 -7
- package/src/astro/routes/api/widget-areas/index.ts +56 -6
- package/src/components/DinewayHead.astro +15 -7
- package/src/components/DinewayMedia.astro +1 -1
- package/src/components/InlinePortableTextEditor.tsx +1 -1
- package/src/components/Table.astro +68 -41
- package/src/components/index.ts +2 -12
- package/src/components/marks.ts +19 -0
- package/LICENSE +0 -9
- /package/dist/{adapters-BlzWJG82.d.mts → adapters-C2ypTrZZ.d.mts} +0 -0
- /package/dist/{config-Cq8H0SfX.mjs → config-BXwuX8Bx.mjs} +0 -0
- /package/dist/{load-C6FCD1FU.mjs → load-Coc9HpHH.mjs} +0 -0
- /package/dist/{manifest-schema-CTSEyIJ3.mjs → manifest-schema-D1MSVnoI.mjs} +0 -0
- /package/dist/{mode-BlyYtIFO.mjs → mode-47goXBBK.mjs} +0 -0
- /package/dist/{tokens-4vgYuXsZ.mjs → tokens-CJz9ubV6.mjs} +0 -0
- /package/dist/{transport-C5FYnid7.mjs → transport-DB5eDN4x.mjs} +0 -0
- /package/dist/{transport-gIL-e43D.d.mts → transport-Wge_IzKl.d.mts} +0 -0
- /package/dist/{types-CLLdsG3g.d.mts → types-BzcUjoqg.d.mts} +0 -0
- /package/dist/{types-DShnjzb6.mjs → types-griIBQOQ.mjs} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m as FieldType } from "./types-BuMDPy5C.mjs";
|
|
2
2
|
import { z } from "astro/zod";
|
|
3
3
|
import { JSX } from "astro/jsx-runtime";
|
|
4
4
|
|
|
@@ -239,6 +239,8 @@ interface ContentItemSeoInput {
|
|
|
239
239
|
interface ContentItem {
|
|
240
240
|
id: string;
|
|
241
241
|
type: string;
|
|
242
|
+
slug: string | null;
|
|
243
|
+
status: string;
|
|
242
244
|
data: Record<string, unknown>;
|
|
243
245
|
/**
|
|
244
246
|
* SEO metadata, populated when the collection has SEO enabled
|
|
@@ -247,11 +249,21 @@ interface ContentItem {
|
|
|
247
249
|
seo?: ContentItemSeo;
|
|
248
250
|
createdAt: string;
|
|
249
251
|
updatedAt: string;
|
|
252
|
+
publishedAt: string | null;
|
|
253
|
+
locale: string | null;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Content filters supported by the plugin content API.
|
|
257
|
+
*/
|
|
258
|
+
interface ContentListWhere {
|
|
259
|
+
status?: string;
|
|
260
|
+
locale?: string;
|
|
250
261
|
}
|
|
251
262
|
/**
|
|
252
263
|
* Content list options
|
|
253
264
|
*/
|
|
254
265
|
interface ContentListOptions {
|
|
266
|
+
where?: ContentListWhere;
|
|
255
267
|
limit?: number;
|
|
256
268
|
cursor?: string;
|
|
257
269
|
orderBy?: Record<string, "asc" | "desc">;
|
|
@@ -666,6 +678,7 @@ interface ContentHookEvent {
|
|
|
666
678
|
interface ContentDeleteEvent {
|
|
667
679
|
id: string;
|
|
668
680
|
collection: string;
|
|
681
|
+
permanent: boolean;
|
|
669
682
|
}
|
|
670
683
|
/**
|
|
671
684
|
* Content publish state change hook event (fired after publish or unpublish)
|
|
@@ -790,7 +803,7 @@ interface PageMetadataEvent {
|
|
|
790
803
|
* link tags with these rel values. Adding "stylesheet", "prefetch", "prerender"
|
|
791
804
|
* etc. would allow sandboxed plugins to inject external resources.
|
|
792
805
|
*/
|
|
793
|
-
type PageMetadataLinkRel = "canonical" | "alternate" | "author" | "license" | "site.standard.document";
|
|
806
|
+
type PageMetadataLinkRel = "canonical" | "alternate" | "author" | "license" | "nlweb" | "site.standard.document";
|
|
794
807
|
type PageMetadataContribution = {
|
|
795
808
|
kind: "meta";
|
|
796
809
|
name: string;
|
|
@@ -1193,4 +1206,4 @@ interface PluginManifest {
|
|
|
1193
1206
|
admin: PluginAdminConfig;
|
|
1194
1207
|
}
|
|
1195
1208
|
//#endregion
|
|
1196
|
-
export {
|
|
1209
|
+
export { StandardHookEntry as $, PageMetadataContribution as A, PluginDefinition as B, MediaAccess as C, PageFragmentContribution as D, ModerationDecision as E, PluginAdminConfig as F, PortableTextBlockConfig as G, PluginManifest as H, PluginAdminExports as I, RequestMeta as J, PortableTextBlockField as K, PluginAdminPage as L, PageMetadataHandler as M, PageMetadataLinkRel as N, PageFragmentEvent as O, PagePlacement as P, RouteContext as Q, PluginCapability as R, LogAccess as S, MediaUploadEvent as T, PluginRoute as U, PluginHooks as V, PluginStorageConfig as W, ResolvedPlugin as X, ResolvedHook as Y, ResolvedPluginHooks as Z, FieldWidgetConfig as _, CommentAfterModerateEvent as a, StoredComment as at, HttpAccess as b, CommentBeforeCreateHandler as c, ContentAccess as d, StandardHookHandler as et, ContentDeleteEvent as f, EmailMessage as g, CronEvent as h, CommentAfterCreateHandler as i, StorageCollection as it, PageMetadataEvent as j, PageFragmentHandler as k, CommentModerateEvent as l, ContentPublishStateChangeEvent as m, CollectionCommentSettings as n, StandardRouteEntry as nt, CommentAfterModerateHandler as o, isStandardPluginDefinition as ot, ContentHookEvent as p, PublicPageContext as q, CommentAfterCreateEvent as r, StandardRouteHandler as rt, CommentBeforeCreateEvent as s, Element as st, BreadcrumbItem as t, StandardPluginDefinition as tt, CommentModerateHandler as u, HookConfig as v, MediaItem as w, KVAccess as x, HookName as y, PluginContext as z };
|
|
@@ -170,6 +170,155 @@ interface AuditLogTable {
|
|
|
170
170
|
details: string | null;
|
|
171
171
|
status: string | null;
|
|
172
172
|
}
|
|
173
|
+
interface SiteActivityLogTable {
|
|
174
|
+
id: string;
|
|
175
|
+
actor_type: "user" | "api_token" | "system";
|
|
176
|
+
actor_id: string;
|
|
177
|
+
auth_metadata: string | null;
|
|
178
|
+
action_type: string;
|
|
179
|
+
subject_type: string;
|
|
180
|
+
subject_id: string | null;
|
|
181
|
+
related_subject_type: string | null;
|
|
182
|
+
related_subject_id: string | null;
|
|
183
|
+
source_type: "api_route" | "mcp_tool" | "system" | "plugin" | "unknown" | null;
|
|
184
|
+
source_name: string | null;
|
|
185
|
+
result_status: Generated<"succeeded" | "pending" | "failed" | "blocked">;
|
|
186
|
+
scope: string;
|
|
187
|
+
summary: string;
|
|
188
|
+
detail: string | null;
|
|
189
|
+
created_at: Generated<string>;
|
|
190
|
+
}
|
|
191
|
+
interface ContextEntryTable {
|
|
192
|
+
id: string;
|
|
193
|
+
scope: string;
|
|
194
|
+
context_type: string;
|
|
195
|
+
title: string;
|
|
196
|
+
body: string;
|
|
197
|
+
policy_key: string | null;
|
|
198
|
+
source_activity_id: string | null;
|
|
199
|
+
created_by_actor_type: "user" | "api_token" | "system";
|
|
200
|
+
created_by_actor_id: string;
|
|
201
|
+
created_auth_metadata: string | null;
|
|
202
|
+
supersedes_id: string | null;
|
|
203
|
+
version: number;
|
|
204
|
+
is_current: Generated<number>;
|
|
205
|
+
valid_until: string | null;
|
|
206
|
+
reviewed_at: string | null;
|
|
207
|
+
reviewed_by_actor_type: "user" | "api_token" | "system" | null;
|
|
208
|
+
reviewed_by_actor_id: string | null;
|
|
209
|
+
review_note: string | null;
|
|
210
|
+
created_at: Generated<string>;
|
|
211
|
+
updated_at: Generated<string>;
|
|
212
|
+
}
|
|
213
|
+
interface ContextTagTable {
|
|
214
|
+
context_entry_id: string;
|
|
215
|
+
tag: string;
|
|
216
|
+
}
|
|
217
|
+
interface ReviewRequestTable {
|
|
218
|
+
id: string;
|
|
219
|
+
status: Generated<"pending" | "approved" | "rejected">;
|
|
220
|
+
collection: string;
|
|
221
|
+
entry_id: string;
|
|
222
|
+
scope: string;
|
|
223
|
+
live_revision_id: string | null;
|
|
224
|
+
draft_revision_id: string | null;
|
|
225
|
+
reviewed_rev: string;
|
|
226
|
+
action_type: string;
|
|
227
|
+
action_hash: string;
|
|
228
|
+
risk_reason: string | null;
|
|
229
|
+
review_payload: string;
|
|
230
|
+
requested_by_actor_type: "user" | "api_token" | "system";
|
|
231
|
+
requested_by_actor_id: string;
|
|
232
|
+
requested_auth_metadata: string | null;
|
|
233
|
+
resolved_by_actor_type: "user" | "api_token" | "system" | null;
|
|
234
|
+
resolved_by_actor_id: string | null;
|
|
235
|
+
resolved_auth_metadata: string | null;
|
|
236
|
+
review_note: string | null;
|
|
237
|
+
created_at: Generated<string>;
|
|
238
|
+
updated_at: Generated<string>;
|
|
239
|
+
resolved_at: string | null;
|
|
240
|
+
}
|
|
241
|
+
interface EntityAliasTable {
|
|
242
|
+
id: string;
|
|
243
|
+
entity_type: string;
|
|
244
|
+
collection_slug: string | null;
|
|
245
|
+
entity_id: string;
|
|
246
|
+
alias: string;
|
|
247
|
+
normalized_alias: string;
|
|
248
|
+
created_at: Generated<string>;
|
|
249
|
+
}
|
|
250
|
+
interface HandoffSnapshotTable {
|
|
251
|
+
id: string;
|
|
252
|
+
scope: string;
|
|
253
|
+
actor_type: "user" | "api_token" | "system";
|
|
254
|
+
actor_id: string;
|
|
255
|
+
auth_metadata: string | null;
|
|
256
|
+
objective: string;
|
|
257
|
+
reasoning: string;
|
|
258
|
+
key_findings: string;
|
|
259
|
+
touched_objects: string;
|
|
260
|
+
pending_actions: string;
|
|
261
|
+
tool_evidence: string;
|
|
262
|
+
confidence: number | null;
|
|
263
|
+
handoff_kind: "pause" | "review_request" | "assignment";
|
|
264
|
+
reference_type: "review_request" | "assignment" | null;
|
|
265
|
+
reference_id: string | null;
|
|
266
|
+
created_at: Generated<string>;
|
|
267
|
+
resumed_at: string | null;
|
|
268
|
+
}
|
|
269
|
+
interface AssignmentTable {
|
|
270
|
+
id: string;
|
|
271
|
+
scope: string;
|
|
272
|
+
assignment_type: string;
|
|
273
|
+
status: Generated<"pending" | "accepted" | "in_progress" | "blocked" | "completed" | "declined" | "cancelled">;
|
|
274
|
+
priority: Generated<"low" | "normal" | "high" | "urgent">;
|
|
275
|
+
title: string;
|
|
276
|
+
summary: string | null;
|
|
277
|
+
details: string | null;
|
|
278
|
+
assigned_by_actor_type: "user" | "api_token" | "system";
|
|
279
|
+
assigned_by_actor_id: string;
|
|
280
|
+
assigned_to_actor_type: "user" | "api_token" | "system" | null;
|
|
281
|
+
assigned_to_actor_id: string | null;
|
|
282
|
+
metadata: string;
|
|
283
|
+
related_handoff_snapshot_id: string | null;
|
|
284
|
+
related_hitl_request_id: string | null;
|
|
285
|
+
due_at: string | null;
|
|
286
|
+
created_at: Generated<string>;
|
|
287
|
+
updated_at: Generated<string>;
|
|
288
|
+
accepted_at: string | null;
|
|
289
|
+
started_at: string | null;
|
|
290
|
+
blocked_at: string | null;
|
|
291
|
+
completed_at: string | null;
|
|
292
|
+
declined_at: string | null;
|
|
293
|
+
cancelled_at: string | null;
|
|
294
|
+
}
|
|
295
|
+
interface HitlRequestTable {
|
|
296
|
+
id: string;
|
|
297
|
+
scope: string;
|
|
298
|
+
action_type: string;
|
|
299
|
+
status: Generated<"pending" | "approved" | "rejected">;
|
|
300
|
+
priority: Generated<"low" | "normal" | "high" | "urgent">;
|
|
301
|
+
title: string;
|
|
302
|
+
summary: string | null;
|
|
303
|
+
risk_reason: string;
|
|
304
|
+
review_payload: string;
|
|
305
|
+
target_ref_type: string;
|
|
306
|
+
target_ref_id: string;
|
|
307
|
+
requested_by_actor_type: "user" | "api_token" | "system";
|
|
308
|
+
requested_by_actor_id: string;
|
|
309
|
+
requested_auth_metadata: string | null;
|
|
310
|
+
resolved_by_actor_type: "user" | "api_token" | "system" | null;
|
|
311
|
+
resolved_by_actor_id: string | null;
|
|
312
|
+
resolved_auth_metadata: string | null;
|
|
313
|
+
review_note: string | null;
|
|
314
|
+
metadata: string;
|
|
315
|
+
related_assignment_id: string | null;
|
|
316
|
+
related_handoff_snapshot_id: string | null;
|
|
317
|
+
sla_due_at: string | null;
|
|
318
|
+
created_at: Generated<string>;
|
|
319
|
+
updated_at: Generated<string>;
|
|
320
|
+
resolved_at: string | null;
|
|
321
|
+
}
|
|
173
322
|
interface MigrationTable {
|
|
174
323
|
name: string;
|
|
175
324
|
timestamp: string;
|
|
@@ -348,6 +497,14 @@ interface Database {
|
|
|
348
497
|
auth_challenges: AuthChallengeTable;
|
|
349
498
|
options: OptionTable;
|
|
350
499
|
audit_logs: AuditLogTable;
|
|
500
|
+
_dineway_activity_log: SiteActivityLogTable;
|
|
501
|
+
_dineway_context_entries: ContextEntryTable;
|
|
502
|
+
_dineway_context_tags: ContextTagTable;
|
|
503
|
+
_dineway_review_requests: ReviewRequestTable;
|
|
504
|
+
_dineway_entity_aliases: EntityAliasTable;
|
|
505
|
+
_dineway_handoff_snapshots: HandoffSnapshotTable;
|
|
506
|
+
_dineway_assignments: AssignmentTable;
|
|
507
|
+
_dineway_hitl_requests: HitlRequestTable;
|
|
351
508
|
_dineway_migrations: MigrationTable;
|
|
352
509
|
_dineway_collections: CollectionTable;
|
|
353
510
|
_dineway_fields: FieldTable;
|
|
@@ -393,6 +550,8 @@ interface NotFoundLogTable {
|
|
|
393
550
|
referrer: string | null;
|
|
394
551
|
user_agent: string | null;
|
|
395
552
|
ip: string | null;
|
|
553
|
+
hits: number;
|
|
554
|
+
last_seen_at: string | null;
|
|
396
555
|
created_at: string;
|
|
397
556
|
}
|
|
398
557
|
interface BylineTable {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-ClPoSABd.mjs";
|
|
2
|
-
import { t as FIELD_TYPES } from "./types-
|
|
2
|
+
import { t as FIELD_TYPES } from "./types-COeOq9nK.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/seed/validate.ts
|
|
5
5
|
/**
|
|
@@ -59,6 +59,7 @@ function validateSeed(data) {
|
|
|
59
59
|
collectionSlugs.add(collection.slug);
|
|
60
60
|
}
|
|
61
61
|
if (!collection.label) errors.push(`${prefix}: label is required`);
|
|
62
|
+
if (collection.urlPattern && !collection.urlPattern.includes("{slug}")) errors.push(`${prefix}.urlPattern: must include a {slug} placeholder`);
|
|
62
63
|
if (!Array.isArray(collection.fields)) errors.push(`${prefix}.fields: must be an array`);
|
|
63
64
|
else {
|
|
64
65
|
const fieldSlugs = /* @__PURE__ */ new Set();
|
|
@@ -1,55 +1,8 @@
|
|
|
1
|
-
import { t as Database } from "./types-
|
|
2
|
-
import {
|
|
3
|
-
import { d as Storage } from "./types-
|
|
1
|
+
import { t as Database } from "./types-DOrVigru.mjs";
|
|
2
|
+
import { i as SiteSettings, m as FieldType } from "./types-BuMDPy5C.mjs";
|
|
3
|
+
import { d as Storage } from "./types-CWbdtiux.mjs";
|
|
4
4
|
import { Kysely } from "kysely";
|
|
5
5
|
|
|
6
|
-
//#region src/settings/types.d.ts
|
|
7
|
-
/**
|
|
8
|
-
* Site Settings Types
|
|
9
|
-
*
|
|
10
|
-
* Global configuration for the site (title, logo, social links, etc.)
|
|
11
|
-
*/
|
|
12
|
-
/** Media reference for logo/favicon */
|
|
13
|
-
interface MediaReference {
|
|
14
|
-
mediaId: string;
|
|
15
|
-
alt?: string;
|
|
16
|
-
}
|
|
17
|
-
/** Site-level SEO settings */
|
|
18
|
-
interface SeoSettings {
|
|
19
|
-
/** Separator between page title and site title (e.g., " | ", " — ") */
|
|
20
|
-
titleSeparator?: string;
|
|
21
|
-
/** Default OG image when content has no seo_image */
|
|
22
|
-
defaultOgImage?: MediaReference;
|
|
23
|
-
/** Custom robots.txt content. If unset, a default is generated. */
|
|
24
|
-
robotsTxt?: string;
|
|
25
|
-
/** Google Search Console verification meta tag content */
|
|
26
|
-
googleVerification?: string;
|
|
27
|
-
/** Bing Webmaster Tools verification meta tag content */
|
|
28
|
-
bingVerification?: string;
|
|
29
|
-
}
|
|
30
|
-
/** Site settings schema */
|
|
31
|
-
interface SiteSettings {
|
|
32
|
-
title: string;
|
|
33
|
-
tagline?: string;
|
|
34
|
-
logo?: MediaReference;
|
|
35
|
-
favicon?: MediaReference;
|
|
36
|
-
url?: string;
|
|
37
|
-
postsPerPage: number;
|
|
38
|
-
dateFormat: string;
|
|
39
|
-
timezone: string;
|
|
40
|
-
social?: {
|
|
41
|
-
twitter?: string;
|
|
42
|
-
github?: string;
|
|
43
|
-
facebook?: string;
|
|
44
|
-
instagram?: string;
|
|
45
|
-
linkedin?: string;
|
|
46
|
-
youtube?: string;
|
|
47
|
-
};
|
|
48
|
-
seo?: SeoSettings;
|
|
49
|
-
}
|
|
50
|
-
/** Keys that are valid site settings */
|
|
51
|
-
type SiteSettingKey = keyof SiteSettings;
|
|
52
|
-
//#endregion
|
|
53
6
|
//#region src/seed/types.d.ts
|
|
54
7
|
/**
|
|
55
8
|
* Root seed file structure
|
|
@@ -374,4 +327,4 @@ declare function loadUserSeed(): Promise<SeedFile | null>;
|
|
|
374
327
|
*/
|
|
375
328
|
declare function validateSeed(data: unknown): ValidationResult;
|
|
376
329
|
//#endregion
|
|
377
|
-
export {
|
|
330
|
+
export { SeedTaxonomyTerm as _, applySeed as a, ValidationResult as b, SeedCollection as c, SeedFile as d, SeedMenu as f, SeedTaxonomy as g, SeedSection as h, defaultSeed as i, SeedContentEntry as l, SeedRedirect as m, loadSeed as n, SeedApplyOptions as o, SeedMenuItem as p, loadUserSeed as r, SeedApplyResult as s, validateSeed as t, SeedField as u, SeedWidget as v, SeedWidgetArea as y };
|
|
@@ -61,16 +61,6 @@ function validateIdentifier(value, label = "identifier") {
|
|
|
61
61
|
if (!IDENTIFIER_PATTERN.test(value)) throw new IdentifierError(`${label} must match /^[a-z][a-z0-9_]*$/ (got "${value}")`, value);
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
|
-
* Validate that a string is a safe SQL identifier, allowing hyphens.
|
|
65
|
-
*
|
|
66
|
-
* Like `validateIdentifier` but also permits hyphens, which appear in
|
|
67
|
-
* plugin IDs (e.g., "my-plugin"). Matches `/^[a-z][a-z0-9_-]*$/`.
|
|
68
|
-
*
|
|
69
|
-
* @param value - The string to validate
|
|
70
|
-
* @param label - Human-readable label for error messages
|
|
71
|
-
* @throws {IdentifierError} If the value is not valid
|
|
72
|
-
*/
|
|
73
|
-
/**
|
|
74
64
|
* Validate that a string is a safe JSON field name for use in json_extract paths.
|
|
75
65
|
*
|
|
76
66
|
* More permissive than `validateIdentifier` — allows camelCase (mixed case)
|
|
@@ -86,6 +76,16 @@ function validateJsonFieldName(value, label = "JSON field name") {
|
|
|
86
76
|
if (value.length > MAX_IDENTIFIER_LENGTH) throw new IdentifierError(`${label} must be ${MAX_IDENTIFIER_LENGTH} characters or less, got ${value.length}`, value);
|
|
87
77
|
if (!GENERIC_IDENTIFIER_PATTERN.test(value)) throw new IdentifierError(`${label} must match /^[a-zA-Z][a-zA-Z0-9_]*$/ (got "${value}")`, value);
|
|
88
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Validate that a string is a safe SQL identifier, allowing hyphens.
|
|
81
|
+
*
|
|
82
|
+
* Like `validateIdentifier` but also permits hyphens, which appear in
|
|
83
|
+
* plugin IDs (e.g., "my-plugin"). Matches `/^[a-z][a-z0-9_-]*$/`.
|
|
84
|
+
*
|
|
85
|
+
* @param value - The string to validate
|
|
86
|
+
* @param label - Human-readable label for error messages
|
|
87
|
+
* @throws {IdentifierError} If the value is not valid
|
|
88
|
+
*/
|
|
89
89
|
function validatePluginIdentifier(value, label = "plugin identifier") {
|
|
90
90
|
if (!value || typeof value !== "string") throw new IdentifierError(`${label} must be a non-empty string`, String(value));
|
|
91
91
|
if (value.length > MAX_IDENTIFIER_LENGTH) throw new IdentifierError(`${label} must be ${MAX_IDENTIFIER_LENGTH} characters or less, got ${value.length}`, value);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dineway",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Agentic
|
|
3
|
+
"version": "0.1.6",
|
|
4
|
+
"description": "Agentic Website builder for restaurants — structured content meets AI via the Model Context Protocol",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.mts",
|
|
@@ -87,6 +87,10 @@
|
|
|
87
87
|
"types": "./dist/request-context.d.mts",
|
|
88
88
|
"default": "./dist/request-context.mjs"
|
|
89
89
|
},
|
|
90
|
+
"./database/instrumentation": {
|
|
91
|
+
"types": "./dist/database/instrumentation.d.mts",
|
|
92
|
+
"default": "./dist/database/instrumentation.mjs"
|
|
93
|
+
},
|
|
90
94
|
"./seed": {
|
|
91
95
|
"types": "./dist/seed/index.d.mts",
|
|
92
96
|
"default": "./dist/seed/index.mjs"
|
|
@@ -128,8 +132,11 @@
|
|
|
128
132
|
"#api/*": "./src/api/*",
|
|
129
133
|
"#db/*": "./src/database/*",
|
|
130
134
|
"#auth/*": "./src/auth/*",
|
|
135
|
+
"#bylines/*": "./src/bylines/*",
|
|
136
|
+
"#taxonomies/*": "./src/taxonomies/*",
|
|
131
137
|
"#schema/*": "./src/schema/*",
|
|
132
138
|
"#search/*": "./src/search/*",
|
|
139
|
+
"#redirects/*": "./src/redirects/*",
|
|
133
140
|
"#sections/*": "./src/sections/*",
|
|
134
141
|
"#menus/*": "./src/menus/*",
|
|
135
142
|
"#widgets/*": "./src/widgets/*",
|
|
@@ -143,6 +150,7 @@
|
|
|
143
150
|
"#media/*": "./src/media/*",
|
|
144
151
|
"#mcp/*": "./src/mcp/*",
|
|
145
152
|
"#comments/*": "./src/comments/*",
|
|
153
|
+
"#site-context/*": "./src/site-context/*",
|
|
146
154
|
"#types": "./src/astro/types.js"
|
|
147
155
|
},
|
|
148
156
|
"typesVersions": {
|
|
@@ -227,25 +235,38 @@
|
|
|
227
235
|
]
|
|
228
236
|
}
|
|
229
237
|
},
|
|
238
|
+
"scripts": {
|
|
239
|
+
"build": "tsdown",
|
|
240
|
+
"dev": "tsdown --watch",
|
|
241
|
+
"prepublishOnly": "node --run build",
|
|
242
|
+
"typecheck": "tsgo --noEmit",
|
|
243
|
+
"check": "publint && attw --pack --ignore-rules=cjs-resolves-to-esm --ignore-rules=no-resolution --ignore-rules=internal-resolution-error",
|
|
244
|
+
"test": "vitest",
|
|
245
|
+
"test:smoke": "vitest run --config vitest.smoke.config.ts",
|
|
246
|
+
"test:integration": "vitest run --config vitest.integration.config.ts"
|
|
247
|
+
},
|
|
230
248
|
"dependencies": {
|
|
249
|
+
"@dineway-ai/admin": "workspace:*",
|
|
250
|
+
"@dineway-ai/auth": "workspace:*",
|
|
251
|
+
"@dineway-ai/gutenberg-to-portable-text": "workspace:*",
|
|
231
252
|
"@floating-ui/react": "^0.27.16",
|
|
232
253
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
233
254
|
"@portabletext/toolkit": "^5.0.1",
|
|
234
|
-
"@tiptap/core": "
|
|
235
|
-
"@tiptap/extension-focus": "
|
|
236
|
-
"@tiptap/extension-image": "
|
|
237
|
-
"@tiptap/extension-link": "
|
|
238
|
-
"@tiptap/extension-placeholder": "
|
|
239
|
-
"@tiptap/extension-text-align": "
|
|
240
|
-
"@tiptap/extension-typography": "
|
|
241
|
-
"@tiptap/extension-underline": "
|
|
242
|
-
"@tiptap/react": "
|
|
243
|
-
"@tiptap/starter-kit": "
|
|
244
|
-
"@tiptap/suggestion": "
|
|
255
|
+
"@tiptap/core": "catalog:",
|
|
256
|
+
"@tiptap/extension-focus": "catalog:",
|
|
257
|
+
"@tiptap/extension-image": "catalog:",
|
|
258
|
+
"@tiptap/extension-link": "catalog:",
|
|
259
|
+
"@tiptap/extension-placeholder": "catalog:",
|
|
260
|
+
"@tiptap/extension-text-align": "catalog:",
|
|
261
|
+
"@tiptap/extension-typography": "catalog:",
|
|
262
|
+
"@tiptap/extension-underline": "catalog:",
|
|
263
|
+
"@tiptap/react": "catalog:",
|
|
264
|
+
"@tiptap/starter-kit": "catalog:",
|
|
265
|
+
"@tiptap/suggestion": "catalog:",
|
|
245
266
|
"@unpic/placeholder": "^0.1.2",
|
|
246
267
|
"arctic": "^3.7.0",
|
|
247
268
|
"astro-portabletext": "^0.11.0",
|
|
248
|
-
"better-sqlite3": "
|
|
269
|
+
"better-sqlite3": "catalog:",
|
|
249
270
|
"blurhash": "^2.0.5",
|
|
250
271
|
"citty": "^0.1.6",
|
|
251
272
|
"consola": "^3.4.2",
|
|
@@ -261,10 +282,7 @@
|
|
|
261
282
|
"sax": "^1.4.1",
|
|
262
283
|
"ulidx": "^2.4.1",
|
|
263
284
|
"upng-js": "^2.1.0",
|
|
264
|
-
"zod": "^4.3.5"
|
|
265
|
-
"@dineway-ai/auth": "0.1.3",
|
|
266
|
-
"@dineway-ai/admin": "0.1.3",
|
|
267
|
-
"@dineway-ai/gutenberg-to-portable-text": "0.1.3"
|
|
285
|
+
"zod": "^4.3.5"
|
|
268
286
|
},
|
|
269
287
|
"optionalDependencies": {
|
|
270
288
|
"@libsql/kysely-libsql": "^0.4.0",
|
|
@@ -280,7 +298,8 @@
|
|
|
280
298
|
},
|
|
281
299
|
"devDependencies": {
|
|
282
300
|
"@apidevtools/swagger-parser": "^12.1.0",
|
|
283
|
-
"@arethetypeswrong/cli": "
|
|
301
|
+
"@arethetypeswrong/cli": "catalog:",
|
|
302
|
+
"@dineway-ai/blocks": "workspace:*",
|
|
284
303
|
"@rivet-dev/agent-os-common": "^0.0.260331072558",
|
|
285
304
|
"@rivet-dev/agent-os-core": "^0.1.1",
|
|
286
305
|
"@types/better-sqlite3": "^7.6.12",
|
|
@@ -288,29 +307,21 @@
|
|
|
288
307
|
"@types/sanitize-html": "^2.16.0",
|
|
289
308
|
"@types/sax": "^1.2.7",
|
|
290
309
|
"@vitest/ui": "^4.0.17",
|
|
291
|
-
"publint": "
|
|
292
|
-
"tsdown": "
|
|
293
|
-
"typescript": "
|
|
310
|
+
"publint": "catalog:",
|
|
311
|
+
"tsdown": "catalog:",
|
|
312
|
+
"typescript": "catalog:",
|
|
294
313
|
"vite": "^6.0.0",
|
|
295
|
-
"vitest": "
|
|
296
|
-
"zod-openapi": "^5.4.6"
|
|
297
|
-
"@dineway-ai/blocks": "0.1.3"
|
|
314
|
+
"vitest": "catalog:",
|
|
315
|
+
"zod-openapi": "^5.4.6"
|
|
298
316
|
},
|
|
299
317
|
"keywords": [
|
|
300
318
|
"astro",
|
|
301
|
-
"
|
|
319
|
+
"restaurant",
|
|
320
|
+
"agentic",
|
|
321
|
+
"mcp",
|
|
302
322
|
"content",
|
|
303
|
-
"
|
|
323
|
+
"cms"
|
|
304
324
|
],
|
|
305
325
|
"author": "Matt Kane",
|
|
306
|
-
"license": "MIT"
|
|
307
|
-
|
|
308
|
-
"build": "tsdown",
|
|
309
|
-
"dev": "tsdown --watch",
|
|
310
|
-
"typecheck": "tsgo --noEmit",
|
|
311
|
-
"check": "publint && attw --pack --ignore-rules=cjs-resolves-to-esm --ignore-rules=no-resolution --ignore-rules=internal-resolution-error",
|
|
312
|
-
"test": "vitest",
|
|
313
|
-
"test:smoke": "vitest run --config vitest.smoke.config.ts",
|
|
314
|
-
"test:integration": "vitest run --config vitest.integration.config.ts"
|
|
315
|
-
}
|
|
316
|
-
}
|
|
326
|
+
"license": "MIT"
|
|
327
|
+
}
|
|
@@ -9,24 +9,38 @@ import "@dineway-ai/admin/styles.css";
|
|
|
9
9
|
// Use package-qualified import so Astro generates a proper module URL
|
|
10
10
|
// (relative imports resolve to absolute paths which break client hydration)
|
|
11
11
|
import AdminWrapper from "dineway/routes/PluginRegistry";
|
|
12
|
+
import { Font } from "astro:assets";
|
|
12
13
|
|
|
13
14
|
export const prerender = false;
|
|
14
15
|
|
|
15
|
-
import { resolveLocale } from "@dineway-ai/admin/locales";
|
|
16
|
+
import { getLocaleDir, loadMessages, resolveLocale } from "@dineway-ai/admin/locales";
|
|
16
17
|
|
|
17
18
|
const resolvedLocale = resolveLocale(Astro.request);
|
|
18
|
-
const
|
|
19
|
+
const resolvedDir = getLocaleDir(resolvedLocale);
|
|
20
|
+
const messages = await loadMessages(resolvedLocale);
|
|
21
|
+
const adminConfig = Astro.locals.dineway?.config.admin;
|
|
22
|
+
const pageTitle = adminConfig?.siteName ? `${adminConfig.siteName} Admin` : "Dineway Admin";
|
|
23
|
+
const loadingLabel = adminConfig?.siteName
|
|
24
|
+
? `Loading ${adminConfig.siteName}...`
|
|
25
|
+
: "Loading Dineway...";
|
|
19
26
|
---
|
|
20
27
|
|
|
21
28
|
<!doctype html>
|
|
22
|
-
<html lang={resolvedLocale}>
|
|
29
|
+
<html lang={resolvedLocale} dir={resolvedDir}>
|
|
23
30
|
<head>
|
|
24
31
|
<meta charset="UTF-8" />
|
|
25
32
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
26
|
-
<
|
|
27
|
-
|
|
33
|
+
<Font cssVariable="--font-dineway" />
|
|
34
|
+
{
|
|
35
|
+
adminConfig?.favicon ? (
|
|
36
|
+
<link rel="icon" href={adminConfig.favicon} />
|
|
37
|
+
) : (
|
|
38
|
+
<link rel="icon" href="/favicon.svg" />
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
<title>{pageTitle}</title>
|
|
28
42
|
</head>
|
|
29
|
-
<body>
|
|
43
|
+
<body class="isolate">
|
|
30
44
|
<div id="admin-root" class="min-h-screen">
|
|
31
45
|
<div id="dineway-boot-loader">
|
|
32
46
|
<style>
|
|
@@ -59,10 +73,12 @@ const { messages } = await import(`@dineway-ai/admin/locales/${resolvedLocale}/m
|
|
|
59
73
|
}
|
|
60
74
|
#dineway-boot-loader p {
|
|
61
75
|
margin-top: 1rem;
|
|
62
|
-
font-family:
|
|
76
|
+
font-family: var(
|
|
77
|
+
--font-dineway,
|
|
63
78
|
system-ui,
|
|
64
79
|
-apple-system,
|
|
65
|
-
sans-serif
|
|
80
|
+
sans-serif
|
|
81
|
+
);
|
|
66
82
|
font-size: 0.875rem;
|
|
67
83
|
color: light-dark(hsl(215.4 16.3% 46.9%), hsl(215 20.2% 65.1%));
|
|
68
84
|
}
|
|
@@ -74,7 +90,7 @@ const { messages } = await import(`@dineway-ai/admin/locales/${resolvedLocale}/m
|
|
|
74
90
|
</style>
|
|
75
91
|
<div class="loader-inner">
|
|
76
92
|
<div class="spinner"></div>
|
|
77
|
-
<p>
|
|
93
|
+
<p>{loadingLabel}</p>
|
|
78
94
|
</div>
|
|
79
95
|
</div>
|
|
80
96
|
<AdminWrapper client:only="react" locale={resolvedLocale} messages={messages} />
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { Role } from "@dineway-ai/auth";
|
|
8
8
|
import type { APIRoute } from "astro";
|
|
9
9
|
|
|
10
|
+
import { rejectApiTokenAuthControlWrite } from "#api/auth-control-guard.js";
|
|
10
11
|
import { apiError, handleError, unwrapResult } from "#api/error.js";
|
|
11
12
|
import { handleApiTokenRevoke } from "#api/handlers/api-tokens.js";
|
|
12
13
|
|
|
@@ -26,6 +27,9 @@ export const DELETE: APIRoute = async ({ params, locals }) => {
|
|
|
26
27
|
return apiError("FORBIDDEN", "Admin privileges required", 403);
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
const credentialGuard = rejectApiTokenAuthControlWrite(locals, "api_tokens");
|
|
31
|
+
if (credentialGuard) return credentialGuard;
|
|
32
|
+
|
|
29
33
|
const tokenId = params.id;
|
|
30
34
|
if (!tokenId) {
|
|
31
35
|
return apiError("VALIDATION_ERROR", "Token ID is required", 400);
|
|
@@ -9,16 +9,22 @@ import { Role } from "@dineway-ai/auth";
|
|
|
9
9
|
import type { APIRoute } from "astro";
|
|
10
10
|
import { z } from "zod";
|
|
11
11
|
|
|
12
|
+
import { rejectApiTokenAuthControlWrite } from "#api/auth-control-guard.js";
|
|
12
13
|
import { apiError, handleError, unwrapResult } from "#api/error.js";
|
|
13
14
|
import { handleApiTokenCreate, handleApiTokenList } from "#api/handlers/api-tokens.js";
|
|
14
15
|
import { isParseError, parseBody } from "#api/parse.js";
|
|
15
|
-
import {
|
|
16
|
+
import { ALL_VALID_SCOPES } from "#auth/api-tokens.js";
|
|
17
|
+
import {
|
|
18
|
+
experimentalSiteContextWorkflowsEnabled,
|
|
19
|
+
getExperimentalSiteContextWorkflowsDisabledMessage,
|
|
20
|
+
requestedExperimentalSiteContextWorkflowScopes,
|
|
21
|
+
} from "#site-context/experimental-workflows.js";
|
|
16
22
|
|
|
17
23
|
export const prerender = false;
|
|
18
24
|
|
|
19
25
|
const createTokenSchema = z.object({
|
|
20
26
|
name: z.string().min(1).max(100),
|
|
21
|
-
scopes: z.array(z.enum(
|
|
27
|
+
scopes: z.array(z.enum(ALL_VALID_SCOPES)).min(1),
|
|
22
28
|
expiresAt: z.string().datetime().optional(),
|
|
23
29
|
});
|
|
24
30
|
|
|
@@ -56,9 +62,25 @@ export const POST: APIRoute = async ({ request, locals }) => {
|
|
|
56
62
|
return apiError("FORBIDDEN", "Admin privileges required", 403);
|
|
57
63
|
}
|
|
58
64
|
|
|
65
|
+
const credentialGuard = rejectApiTokenAuthControlWrite(locals, "api_tokens");
|
|
66
|
+
if (credentialGuard) return credentialGuard;
|
|
67
|
+
|
|
59
68
|
try {
|
|
60
69
|
const body = await parseBody(request, createTokenSchema);
|
|
61
70
|
if (isParseError(body)) return body;
|
|
71
|
+
const requestedWorkflowScopes = requestedExperimentalSiteContextWorkflowScopes(body.scopes);
|
|
72
|
+
if (requestedWorkflowScopes.length > 0 && !experimentalSiteContextWorkflowsEnabled()) {
|
|
73
|
+
return apiError(
|
|
74
|
+
"NOT_IMPLEMENTED",
|
|
75
|
+
getExperimentalSiteContextWorkflowsDisabledMessage(),
|
|
76
|
+
501,
|
|
77
|
+
{
|
|
78
|
+
status: "workflow_token_scopes_disabled",
|
|
79
|
+
reason: "workflow_token_scopes_disabled",
|
|
80
|
+
scopes: requestedWorkflowScopes,
|
|
81
|
+
},
|
|
82
|
+
);
|
|
83
|
+
}
|
|
62
84
|
|
|
63
85
|
const result = await handleApiTokenCreate(dineway.db, user.id, body);
|
|
64
86
|
return unwrapResult(result, 201);
|