@devpad/api 2.6.11 → 2.6.12
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/{chunk-4GRUM2BX.js → chunk-6I7TZ36B.js} +21 -17
- package/dist/{chunk-AXQWQXZR.js → chunk-DHYAC4LG.js} +230 -175
- package/dist/{chunk-5L3AUVMM.js → chunk-V6CM3V4I.js} +35 -9
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1203 -1159
- package/dist/schema/blog.d.ts +5 -5
- package/dist/schema/blog.js +1 -1
- package/dist/schema/index.d.ts +3 -3
- package/dist/schema/index.js +3 -3
- package/dist/schema/media.d.ts +156 -156
- package/dist/schema/media.js +36 -28
- package/dist/{schema.d-CUm4wtV_.d.ts → schema-CizNlS2t.d.ts} +2 -2
- package/dist/{types.d-D1ao8Ynh.d.ts → types-CnplaVqa.d.ts} +238 -241
- package/dist/{types.d-Dt-0_WMH.d.ts → types-T4cFlYTI.d.ts} +818 -818
- package/package.json +7 -2
- package/dist/{errors.d-BUNZEN7j.d.ts → errors-BUNZEN7j.d.ts} +0 -0
- package/dist/{media.d-R87HGuRp.d.ts → media-R87HGuRp.d.ts} +0 -0
- package/dist/{types.d-DbgtG-w1.d.ts → types-CDD2mUV6.d.ts} +73 -73
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../schema/
|
|
1
|
+
// ../schema/src/errors.ts
|
|
2
2
|
import { err } from "@f0rbit/corpus";
|
|
3
3
|
var defaultLogger = ({ error, context }) => {
|
|
4
4
|
console.error(`[${context.timestamp}] [${error.kind}]`, error.message || error.kind, {
|
|
@@ -10,10 +10,8 @@ var defaultLogger = ({ error, context }) => {
|
|
|
10
10
|
var errorLogger = defaultLogger;
|
|
11
11
|
var contextProvider = null;
|
|
12
12
|
var configureErrorLogging = (config) => {
|
|
13
|
-
if (config.logger)
|
|
14
|
-
|
|
15
|
-
if (config.contextProvider)
|
|
16
|
-
contextProvider = config.contextProvider;
|
|
13
|
+
if (config.logger) errorLogger = config.logger;
|
|
14
|
+
if (config.contextProvider) contextProvider = config.contextProvider;
|
|
17
15
|
};
|
|
18
16
|
var logAndReturn = (error, ctx) => {
|
|
19
17
|
const context = {
|
|
@@ -59,23 +57,29 @@ var parseError = (message, ctx) => logAndReturn({ kind: "parse_error", ...messag
|
|
|
59
57
|
var encryptionError = (operation, message, ctx) => logAndReturn({ kind: "encryption_error", operation, ...message && { message } }, ctx);
|
|
60
58
|
var dbError = (message, ctx) => logAndReturn({ kind: "db_error", ...message && { message } }, ctx);
|
|
61
59
|
var conflict = (resource, message, ctx) => logAndReturn({ kind: "conflict", ...resource && { resource }, ...message && { message } }, ctx);
|
|
62
|
-
var protectedEntity = (entity_id, message, modified_by, modified_at, ctx) => logAndReturn(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
60
|
+
var protectedEntity = (entity_id, message, modified_by, modified_at, ctx) => logAndReturn(
|
|
61
|
+
{
|
|
62
|
+
kind: "protected",
|
|
63
|
+
...entity_id && { entity_id },
|
|
64
|
+
...message && { message },
|
|
65
|
+
...modified_by && { modified_by },
|
|
66
|
+
...modified_at && { modified_at }
|
|
67
|
+
},
|
|
68
|
+
ctx
|
|
69
|
+
);
|
|
69
70
|
var badRequest = (message, details, ctx) => logAndReturn({ kind: "bad_request", ...message && { message }, ...details !== void 0 && { details } }, ctx);
|
|
70
71
|
var unauthorized = (message, ctx) => logAndReturn({ kind: "unauthorized", ...message && { message } }, ctx);
|
|
71
72
|
var scanError = (message, ctx) => logAndReturn({ kind: "scan_error", ...message && { message } }, ctx);
|
|
72
73
|
var githubError = (message, ctx) => logAndReturn({ kind: "github_error", ...message && { message } }, ctx);
|
|
73
74
|
var validationFieldError = (field, message, ctx) => logAndReturn({ kind: "validation_error", field, ...message && { message } }, ctx);
|
|
74
|
-
var approvalChannel = (task_id, message, ctx) => logAndReturn(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
75
|
+
var approvalChannel = (task_id, message, ctx) => logAndReturn(
|
|
76
|
+
{
|
|
77
|
+
kind: "approval_channel",
|
|
78
|
+
task_id,
|
|
79
|
+
message: message ?? `Task ${task_id} is an approval node \u2014 only a human (auth_channel=user) may complete it`
|
|
80
|
+
},
|
|
81
|
+
ctx
|
|
82
|
+
);
|
|
79
83
|
var errors = {
|
|
80
84
|
notFound,
|
|
81
85
|
forbidden,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../schema/
|
|
1
|
+
// ../schema/src/database/schema.ts
|
|
2
2
|
import { relations, sql } from "drizzle-orm";
|
|
3
3
|
import { index, int, integer, primaryKey, sqliteTable, text, unique, uniqueIndex } from "drizzle-orm/sqlite-core";
|
|
4
4
|
var timestamps = () => ({
|
|
@@ -167,46 +167,54 @@ var COMPLETION_POLICIES = ["manual", "auto_children"];
|
|
|
167
167
|
var COMPLETED_VIA_VALUES = ["user", "api", "policy"];
|
|
168
168
|
var TASK_LINK_KINDS = ["blocks", "relates_to", "references", "discovered_from", "tracks_metric"];
|
|
169
169
|
var SDLC_STAGES = ["ideate", "plan", "build", "review", "deploy", "live"];
|
|
170
|
-
var task = sqliteTable(
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
170
|
+
var task = sqliteTable(
|
|
171
|
+
"task",
|
|
172
|
+
{
|
|
173
|
+
...owned_entity("task"),
|
|
174
|
+
title: text("title").notNull(),
|
|
175
|
+
progress: text("progress", { enum: ["UNSTARTED", "IN_PROGRESS", "COMPLETED"] }).notNull().default("UNSTARTED"),
|
|
176
|
+
visibility: text("visibility", { enum: ["PUBLIC", "PRIVATE", "HIDDEN", "ARCHIVED", "DRAFT", "DELETED"] }).notNull().default("PRIVATE"),
|
|
177
|
+
goal_id: text("goal_id").references(() => goal.id),
|
|
178
|
+
project_id: text("project_id").references(() => project.id),
|
|
179
|
+
description: text("description"),
|
|
180
|
+
start_time: text("start_time"),
|
|
181
|
+
end_time: text("end_time"),
|
|
182
|
+
summary: text("summary"),
|
|
183
|
+
codebase_task_id: text("codebase_task_id").references(() => codebase_tasks.id),
|
|
184
|
+
priority: text("priority", { enum: ["LOW", "MEDIUM", "HIGH"] }).notNull().default("LOW"),
|
|
185
|
+
// graph columns (v2.4) — self-FK omitted deliberately (mirrors
|
|
186
|
+
// checklist_item.parent_id): guarded writes in the graph service own
|
|
187
|
+
// the invariant, not a DB-level FK constraint.
|
|
188
|
+
parent_id: text("parent_id"),
|
|
189
|
+
rank: text("rank").notNull().default(""),
|
|
190
|
+
rev: integer("rev").notNull().default(0),
|
|
191
|
+
kind: text("kind", { enum: TASK_KINDS }).notNull().default("task"),
|
|
192
|
+
completion_policy: text("completion_policy", { enum: COMPLETION_POLICIES }).notNull().default("manual"),
|
|
193
|
+
completed_via: text("completed_via", { enum: COMPLETED_VIA_VALUES }),
|
|
194
|
+
claimed_by: text("claimed_by"),
|
|
195
|
+
claimed_at: text("claimed_at"),
|
|
196
|
+
// v2.4 (task A4.5) — nullable: opting a task into SDLC stage tracking is
|
|
197
|
+
// per-task, not a blanket migration.
|
|
198
|
+
stage: text("stage", { enum: SDLC_STAGES })
|
|
199
|
+
},
|
|
200
|
+
(table) => [index("task_parent_id_idx").on(table.parent_id)]
|
|
201
|
+
);
|
|
202
|
+
var task_link = sqliteTable(
|
|
203
|
+
"task_link",
|
|
204
|
+
{
|
|
205
|
+
...entity("link"),
|
|
206
|
+
src_id: text("src_id").notNull().references(() => task.id),
|
|
207
|
+
dst_id: text("dst_id").references(() => task.id),
|
|
208
|
+
kind: text("kind", { enum: TASK_LINK_KINDS }).notNull(),
|
|
209
|
+
ref: text("ref", { mode: "json" }),
|
|
210
|
+
note: text("note")
|
|
211
|
+
},
|
|
212
|
+
(table) => [
|
|
213
|
+
unique("task_link_unique").on(table.src_id, table.dst_id, table.kind),
|
|
214
|
+
index("task_link_src_id_idx").on(table.src_id),
|
|
215
|
+
index("task_link_dst_id_idx").on(table.dst_id)
|
|
216
|
+
]
|
|
217
|
+
);
|
|
210
218
|
var task_rollup = sqliteTable("task_rollup", {
|
|
211
219
|
task_id: text("task_id").primaryKey().references(() => task.id),
|
|
212
220
|
direct_done: integer("direct_done").notNull().default(0),
|
|
@@ -242,103 +250,131 @@ var TASK_EVENT_KINDS = [
|
|
|
242
250
|
];
|
|
243
251
|
var TASK_EVENT_ACTORS = ["user", "api", "policy", "github"];
|
|
244
252
|
var TASK_EVENT_DISPATCH_STATUSES = ["pending", "dispatched"];
|
|
245
|
-
var task_event = sqliteTable(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
253
|
+
var task_event = sqliteTable(
|
|
254
|
+
"task_event",
|
|
255
|
+
{
|
|
256
|
+
id: integer("id").primaryKey({ autoIncrement: true }),
|
|
257
|
+
event_id: text("event_id").notNull().unique().$defaultFn(() => `evt_${crypto.randomUUID()}`),
|
|
258
|
+
kind: text("kind", { enum: TASK_EVENT_KINDS }).notNull(),
|
|
259
|
+
subject_id: text("subject_id").notNull(),
|
|
260
|
+
project_id: text("project_id"),
|
|
261
|
+
actor: text("actor", { enum: TASK_EVENT_ACTORS }).notNull(),
|
|
262
|
+
payload: text("payload", { mode: "json" }).notNull(),
|
|
263
|
+
occurred_at: text("occurred_at").notNull().default(sql`(CURRENT_TIMESTAMP)`),
|
|
264
|
+
dispatch_status: text("dispatch_status", { enum: TASK_EVENT_DISPATCH_STATUSES }).notNull().default("pending"),
|
|
265
|
+
dispatched_at: text("dispatched_at")
|
|
266
|
+
},
|
|
267
|
+
(table) => [
|
|
268
|
+
index("task_event_subject_id_idx").on(table.subject_id),
|
|
269
|
+
index("task_event_dispatch_status_idx").on(table.dispatch_status)
|
|
270
|
+
]
|
|
271
|
+
);
|
|
272
|
+
var hook = sqliteTable(
|
|
273
|
+
"hook",
|
|
274
|
+
{
|
|
275
|
+
...entity("hook"),
|
|
276
|
+
project_id: text("project_id").notNull().references(() => project.id),
|
|
277
|
+
enabled: integer("enabled", { mode: "boolean" }).notNull().default(true),
|
|
278
|
+
// HookTrigger: { kinds: TaskEventKind[], selector: { subject_kind?, tag?, ancestor_id? } }
|
|
279
|
+
trigger: text("trigger", { mode: "json" }).notNull(),
|
|
280
|
+
// HookAction: { kind: "webhook", url, secret_encrypted? } | { kind: "vault", scope, op, args? } | { kind: "pipeline", package_id }
|
|
281
|
+
action: text("action", { mode: "json" }).notNull()
|
|
282
|
+
},
|
|
283
|
+
(table) => [index("hook_project_id_idx").on(table.project_id)]
|
|
284
|
+
);
|
|
269
285
|
var HOOK_DELIVERY_STATUSES = ["pending", "delivered", "failed_transient", "failed_permanent"];
|
|
270
|
-
var hook_delivery = sqliteTable(
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
286
|
+
var hook_delivery = sqliteTable(
|
|
287
|
+
"hook_delivery",
|
|
288
|
+
{
|
|
289
|
+
// PK = sha256(`${event_id}:${hook_id}`) — see hooks/dispatch.ts's
|
|
290
|
+
// `hook_delivery_id`. Never generated any other way.
|
|
291
|
+
id: text("id").primaryKey(),
|
|
292
|
+
hook_id: text("hook_id").notNull().references(() => hook.id),
|
|
293
|
+
event_id: text("event_id").notNull(),
|
|
294
|
+
status: text("status", { enum: HOOK_DELIVERY_STATUSES }).notNull().default("pending"),
|
|
295
|
+
attempts: integer("attempts").notNull().default(0),
|
|
296
|
+
last_error: text("last_error"),
|
|
297
|
+
...timestamps()
|
|
298
|
+
},
|
|
299
|
+
(table) => [
|
|
300
|
+
index("hook_delivery_hook_id_idx").on(table.hook_id),
|
|
301
|
+
index("hook_delivery_status_idx").on(table.status)
|
|
302
|
+
]
|
|
303
|
+
);
|
|
304
|
+
var github_webhook_event = sqliteTable(
|
|
305
|
+
"github_webhook_event",
|
|
306
|
+
{
|
|
307
|
+
id: text("id").primaryKey(),
|
|
308
|
+
delivery_guid: text("delivery_guid").notNull(),
|
|
309
|
+
event_type: text("event_type").notNull(),
|
|
310
|
+
processed_at: text("processed_at").notNull().default(sql`(CURRENT_TIMESTAMP)`)
|
|
311
|
+
},
|
|
312
|
+
(table) => [index("github_webhook_event_delivery_guid_idx").on(table.delivery_guid)]
|
|
313
|
+
);
|
|
290
314
|
var DOCUMENT_KINDS = ["plan", "design", "interface"];
|
|
291
315
|
var DOCUMENT_STATUSES = ["draft", "in_review", "approved"];
|
|
292
|
-
var document = sqliteTable(
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
316
|
+
var document = sqliteTable(
|
|
317
|
+
"document",
|
|
318
|
+
{
|
|
319
|
+
...entity("doc"),
|
|
320
|
+
project_id: text("project_id").notNull().references(() => project.id),
|
|
321
|
+
// Nullable subject node — a doc need not be tied to a specific task
|
|
322
|
+
// (e.g. a project-level design doc).
|
|
323
|
+
task_id: text("task_id").references(() => task.id),
|
|
324
|
+
kind: text("kind", { enum: DOCUMENT_KINDS }).notNull(),
|
|
325
|
+
title: text("title").notNull(),
|
|
326
|
+
// Corpus version pointer cache — the DB never stores content, only the
|
|
327
|
+
// latest corpus snapshot version for this document's dedicated store
|
|
328
|
+
// (`docStoreId`). Null until the first push.
|
|
329
|
+
head_version: text("head_version"),
|
|
330
|
+
status: text("status", { enum: DOCUMENT_STATUSES }).notNull().default("draft")
|
|
331
|
+
},
|
|
332
|
+
(table) => [index("document_project_id_idx").on(table.project_id), index("document_task_id_idx").on(table.task_id)]
|
|
333
|
+
);
|
|
306
334
|
var THREAD_STATUSES = ["open", "addressed", "resolved", "orphaned"];
|
|
307
|
-
var annotation_thread = sqliteTable(
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
335
|
+
var annotation_thread = sqliteTable(
|
|
336
|
+
"annotation_thread",
|
|
337
|
+
{
|
|
338
|
+
...id("thread"),
|
|
339
|
+
document_id: text("document_id").notNull().references(() => document.id),
|
|
340
|
+
// The marker's own `id` field (embedded in the doc) — stable across
|
|
341
|
+
// versions/re-anchoring, distinct from this row's own DB id.
|
|
342
|
+
thread_id: text("thread_id").notNull(),
|
|
343
|
+
status: text("status", { enum: THREAD_STATUSES }).notNull().default("open"),
|
|
344
|
+
blocking: int("blocking", { mode: "boolean" }).notNull().default(false),
|
|
345
|
+
...timestamps()
|
|
346
|
+
},
|
|
347
|
+
(table) => [
|
|
348
|
+
unique("annotation_thread_unique").on(table.document_id, table.thread_id),
|
|
349
|
+
index("annotation_thread_document_id_idx").on(table.document_id),
|
|
350
|
+
index("annotation_thread_status_idx").on(table.status)
|
|
351
|
+
]
|
|
352
|
+
);
|
|
321
353
|
var SIGNOFF_SUBJECT_KINDS = ["doc_version", "stage", "pipeline_gate"];
|
|
322
354
|
var SIGNOFF_CHECKPOINTS = ["plan", "types", "design"];
|
|
323
355
|
var SIGNOFF_DECISIONS = ["approved", "changes_requested", "auto"];
|
|
324
|
-
var signoff = sqliteTable(
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
356
|
+
var signoff = sqliteTable(
|
|
357
|
+
"signoff",
|
|
358
|
+
{
|
|
359
|
+
...entity("signoff"),
|
|
360
|
+
subject_kind: text("subject_kind", { enum: SIGNOFF_SUBJECT_KINDS }).notNull(),
|
|
361
|
+
subject_id: text("subject_id").notNull(),
|
|
362
|
+
checkpoint: text("checkpoint", { enum: SIGNOFF_CHECKPOINTS }).notNull(),
|
|
363
|
+
// The `kind:"approval"` task node this checkpoint projects into the
|
|
364
|
+
// graph — null only for the brief window before `request_checkpoint`
|
|
365
|
+
// finishes creating it (never persisted mid-transaction in practice).
|
|
366
|
+
task_id: text("task_id").references(() => task.id),
|
|
367
|
+
decision: text("decision", { enum: SIGNOFF_DECISIONS }),
|
|
368
|
+
decided_by: text("decided_by").references(() => user.id),
|
|
369
|
+
decided_at: text("decided_at"),
|
|
370
|
+
reason: text("reason"),
|
|
371
|
+
content_hash: text("content_hash")
|
|
372
|
+
},
|
|
373
|
+
(table) => [
|
|
374
|
+
index("signoff_subject_idx").on(table.subject_kind, table.subject_id),
|
|
375
|
+
index("signoff_task_id_idx").on(table.task_id)
|
|
376
|
+
]
|
|
377
|
+
);
|
|
342
378
|
var checklist = sqliteTable("checklist", {
|
|
343
379
|
...entity("checklist"),
|
|
344
380
|
task_id: text("task_id").notNull().references(() => task.id),
|
|
@@ -364,17 +400,25 @@ var codebase_tasks = sqliteTable("codebase_tasks", {
|
|
|
364
400
|
context: text("context", { mode: "json" }),
|
|
365
401
|
recent_scan_id: integer("recent_scan_id").references(() => tracker_result.id)
|
|
366
402
|
});
|
|
367
|
-
var tag = sqliteTable(
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
403
|
+
var tag = sqliteTable(
|
|
404
|
+
"tag",
|
|
405
|
+
{
|
|
406
|
+
...owned_entity("tag"),
|
|
407
|
+
title: text("title").notNull(),
|
|
408
|
+
color: text("color"),
|
|
409
|
+
render: int("render", { mode: "boolean" }).notNull().default(true)
|
|
410
|
+
},
|
|
411
|
+
(table) => [unique("tag_unique").on(table.owner_id, table.title)]
|
|
412
|
+
);
|
|
413
|
+
var task_tag = sqliteTable(
|
|
414
|
+
"task_tag",
|
|
415
|
+
{
|
|
416
|
+
task_id: text("task_id").notNull().references(() => task.id),
|
|
417
|
+
tag_id: text("tag_id").notNull().references(() => tag.id),
|
|
418
|
+
...timestamps()
|
|
419
|
+
},
|
|
420
|
+
(table) => [primaryKey({ columns: [table.task_id, table.tag_id] })]
|
|
421
|
+
);
|
|
378
422
|
var commit_detail = sqliteTable("commit_detail", {
|
|
379
423
|
sha: text("sha").primaryKey(),
|
|
380
424
|
message: text("message").notNull(),
|
|
@@ -448,27 +492,35 @@ var pipeline_run = sqliteTable("pipeline_run", {
|
|
|
448
492
|
// `deploy_failed` stage event carrying the same text in its payload.
|
|
449
493
|
error: text("error")
|
|
450
494
|
});
|
|
451
|
-
var pipeline_stage_event = sqliteTable(
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
495
|
+
var pipeline_stage_event = sqliteTable(
|
|
496
|
+
"pipeline_stage_event",
|
|
497
|
+
{
|
|
498
|
+
...id("pipeline-stage-event"),
|
|
499
|
+
run_id: text("run_id").notNull().references(() => pipeline_run.id),
|
|
500
|
+
stage_name: text("stage_name").notNull(),
|
|
501
|
+
kind: text("kind", { enum: STAGE_EVENT_KINDS }).notNull(),
|
|
502
|
+
payload: text("payload", { mode: "json" }),
|
|
503
|
+
ts: text("ts").notNull().default(sql`(CURRENT_TIMESTAMP)`),
|
|
504
|
+
idempotency_hash: text("idempotency_hash")
|
|
505
|
+
},
|
|
506
|
+
(table) => [
|
|
507
|
+
uniqueIndex("idx_pipeline_stage_event_idem_uniq").on(table.run_id, table.idempotency_hash).where(sql`idempotency_hash IS NOT NULL`)
|
|
508
|
+
]
|
|
509
|
+
);
|
|
510
|
+
var pipeline_dispatch = sqliteTable(
|
|
511
|
+
"pipeline_dispatch",
|
|
512
|
+
{
|
|
513
|
+
...id("pipeline-dispatch"),
|
|
514
|
+
run_id: text("run_id").notNull().references(() => pipeline_run.id),
|
|
515
|
+
stage_name: text("stage_name").notNull(),
|
|
516
|
+
commit_sha: text("commit_sha").notNull(),
|
|
517
|
+
status: text("status", { enum: DISPATCH_STATUSES }).notNull().default("claimed"),
|
|
518
|
+
error: text("error"),
|
|
519
|
+
requested_by: text("requested_by"),
|
|
520
|
+
...timestamps()
|
|
521
|
+
},
|
|
522
|
+
(table) => [unique("pipeline_dispatch_run_stage_unique").on(table.run_id, table.stage_name)]
|
|
523
|
+
);
|
|
472
524
|
var pipeline_grant = sqliteTable("pipeline_grant", {
|
|
473
525
|
...entity("pipeline-grant"),
|
|
474
526
|
package_id: text("package_id").notNull().references(() => pipeline_package.id),
|
|
@@ -635,7 +687,7 @@ var signoff_relations = relations(signoff, ({ one }) => ({
|
|
|
635
687
|
decided_by_user: one(user, { fields: [signoff.decided_by], references: [user.id] })
|
|
636
688
|
}));
|
|
637
689
|
|
|
638
|
-
// ../schema/
|
|
690
|
+
// ../schema/src/validation.ts
|
|
639
691
|
import { createSelectSchema } from "drizzle-zod";
|
|
640
692
|
import { z } from "zod";
|
|
641
693
|
var upsert_project = z.object({
|
|
@@ -729,10 +781,12 @@ var upsert_tag = z.object({
|
|
|
729
781
|
owner_id: z.string()
|
|
730
782
|
});
|
|
731
783
|
var project_config = z.object({
|
|
732
|
-
tags: z.array(
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
784
|
+
tags: z.array(
|
|
785
|
+
z.object({
|
|
786
|
+
name: z.string(),
|
|
787
|
+
match: z.array(z.string())
|
|
788
|
+
})
|
|
789
|
+
),
|
|
736
790
|
ignore: z.array(z.string())
|
|
737
791
|
});
|
|
738
792
|
var save_config_request = z.object({
|
|
@@ -745,14 +799,15 @@ var update_user = z.object({
|
|
|
745
799
|
id: z.string(),
|
|
746
800
|
name: z.string().optional(),
|
|
747
801
|
image_url: z.string().optional(),
|
|
748
|
-
task_view: z.union([z.literal("list"), z.literal("grid")]).optional()
|
|
749
|
-
email_verified: z.boolean().optional()
|
|
802
|
+
task_view: z.union([z.literal("list"), z.literal("grid")]).optional()
|
|
750
803
|
});
|
|
751
804
|
var config_schema = z.object({
|
|
752
|
-
tags: z.array(
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
805
|
+
tags: z.array(
|
|
806
|
+
z.object({
|
|
807
|
+
name: z.string(),
|
|
808
|
+
match: z.array(z.string())
|
|
809
|
+
})
|
|
810
|
+
),
|
|
756
811
|
ignore: z.array(z.string().regex(/^[\s\S]*$/, "Invalid path"))
|
|
757
812
|
});
|
|
758
813
|
var upsert_milestone = z.object({
|
|
@@ -877,7 +932,7 @@ var upsert_pipeline_grant = z.object({
|
|
|
877
932
|
scope: grant_scope,
|
|
878
933
|
granted_by: z.string().nullable().optional(),
|
|
879
934
|
granted_at: z.string().nullable().optional(),
|
|
880
|
-
auto_approved: z.boolean().
|
|
935
|
+
auto_approved: z.boolean().optional()
|
|
881
936
|
});
|
|
882
937
|
var upsert_pipeline_approval = z.object({
|
|
883
938
|
run_id: z.string(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../schema/
|
|
1
|
+
// ../schema/src/blog/corpus.ts
|
|
2
2
|
import { define_store, json_codec } from "@f0rbit/corpus";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
var PostContentSchema = z.object({
|
|
@@ -34,12 +34,40 @@ var mapCorpusError = (e) => {
|
|
|
34
34
|
var parsePostContent = PostContentSchema.parse.bind(PostContentSchema);
|
|
35
35
|
var serializePostContent = (content) => JSON.stringify(content);
|
|
36
36
|
|
|
37
|
-
// ../schema/
|
|
38
|
-
import {
|
|
37
|
+
// ../schema/src/blog/corpus-shim.ts
|
|
38
|
+
import {
|
|
39
|
+
at,
|
|
40
|
+
fetch_result,
|
|
41
|
+
first,
|
|
42
|
+
format_error,
|
|
43
|
+
last,
|
|
44
|
+
match,
|
|
45
|
+
pipe,
|
|
46
|
+
to_fallback,
|
|
47
|
+
to_nullable,
|
|
48
|
+
try_catch,
|
|
49
|
+
try_catch_async,
|
|
50
|
+
unwrap_or
|
|
51
|
+
} from "@f0rbit/corpus";
|
|
39
52
|
|
|
40
|
-
// ../schema/
|
|
53
|
+
// ../schema/src/blog/types.ts
|
|
41
54
|
import { z as z2 } from "zod";
|
|
42
|
-
import {
|
|
55
|
+
import {
|
|
56
|
+
at as at2,
|
|
57
|
+
err,
|
|
58
|
+
fetch_result as fetch_result2,
|
|
59
|
+
first as first2,
|
|
60
|
+
format_error as format_error2,
|
|
61
|
+
last as last2,
|
|
62
|
+
match as match2,
|
|
63
|
+
ok,
|
|
64
|
+
pipe as pipe2,
|
|
65
|
+
to_fallback as to_fallback2,
|
|
66
|
+
to_nullable as to_nullable2,
|
|
67
|
+
try_catch as try_catch2,
|
|
68
|
+
try_catch_async as try_catch_async2,
|
|
69
|
+
unwrap_or as unwrap_or2
|
|
70
|
+
} from "@f0rbit/corpus";
|
|
43
71
|
var PostRowSchema = z2.object({
|
|
44
72
|
id: z2.number(),
|
|
45
73
|
uuid: z2.string(),
|
|
@@ -198,10 +226,8 @@ var isPublished = (post) => post.publish_at !== null && post.publish_at <= /* @_
|
|
|
198
226
|
var isScheduled = (post) => post.publish_at !== null && post.publish_at > /* @__PURE__ */ new Date();
|
|
199
227
|
var isDraft = (post) => post.publish_at === null;
|
|
200
228
|
var postStatus = (post) => {
|
|
201
|
-
if (isDraft(post))
|
|
202
|
-
|
|
203
|
-
if (isScheduled(post))
|
|
204
|
-
return "scheduled";
|
|
229
|
+
if (isDraft(post)) return "draft";
|
|
230
|
+
if (isScheduled(post)) return "scheduled";
|
|
205
231
|
return "published";
|
|
206
232
|
};
|
|
207
233
|
var CategoryCreateSchema = z2.object({
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { G as PostListParams, T as PostsResponse, x as Post, D as PostCreate, Q as PostUpdate, Z as VersionInfo, y as PostContent, C as Category, k as CategoryCreate, A as AccessKey } from './types
|
|
2
|
-
import { ai as Profile, u as CreateProfileInput, aw as UpdateProfileInput, aj as ProfileFilter, c as AddFilterInput, aq as Timeline, A as Account, ae as PlatformSettings } from './types
|
|
1
|
+
import { G as PostListParams, T as PostsResponse, x as Post, D as PostCreate, Q as PostUpdate, Z as VersionInfo, y as PostContent, C as Category, k as CategoryCreate, A as AccessKey } from './types-CDD2mUV6.js';
|
|
2
|
+
import { ai as Profile, u as CreateProfileInput, aw as UpdateProfileInput, aj as ProfileFilter, c as AddFilterInput, aq as Timeline, A as Account, ae as PlatformSettings } from './types-T4cFlYTI.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { c as ApiKey, R as Project, aH as UpsertProject, G as GetConfigResult, a4 as SaveConfigRequest, aq as TodoUpdate, H as HistoryAction, T as ProjectGraphResponse, U as ProjectViewLayoutInput, M as Milestone, af as Task, p as Goal, q as Hook, w as HookTrigger, s as HookActionPublic, ay as UpsertHook, u as HookDelivery, am as TaskWithDetails, aK as UpsertTodo, aI as UpsertTag, ai as TaskLink, C as ClaimRequest, m as DoneRequest, a as AdvanceStageRequest, aJ as UpsertTaskLink, f as ApplyRequest, e as ApplyOp, ae as TagWithTypedColor, l as Document, W as PushDocRequest, ap as ThreadMarker, i as CreateThreadRequest, b as AnnotationThread, X as PushInterfaceReportRequest, z as InterfaceDiffClass, a8 as Signoff, _ as RequestCheckpointRequest, k as DecideCheckpointRequest, $ as ReviewItem, D as DashboardResponse, O as PipelineRun, Q as PipelineStageEvent, J as PipelineGrant, L as PipelinePackage, P as PipelineAnalysisTemplate, K as PipelineOidcTrust } from './types
|
|
5
|
-
export { S as ProjectConfig, a0 as ReviewItemKind } from './types
|
|
4
|
+
import { c as ApiKey, R as Project, aH as UpsertProject, G as GetConfigResult, a4 as SaveConfigRequest, aq as TodoUpdate, H as HistoryAction, T as ProjectGraphResponse, U as ProjectViewLayoutInput, M as Milestone, af as Task, p as Goal, q as Hook, w as HookTrigger, s as HookActionPublic, ay as UpsertHook, u as HookDelivery, am as TaskWithDetails, aK as UpsertTodo, aI as UpsertTag, ai as TaskLink, C as ClaimRequest, m as DoneRequest, a as AdvanceStageRequest, aJ as UpsertTaskLink, f as ApplyRequest, e as ApplyOp, ae as TagWithTypedColor, l as Document, W as PushDocRequest, ap as ThreadMarker, i as CreateThreadRequest, b as AnnotationThread, X as PushInterfaceReportRequest, z as InterfaceDiffClass, a8 as Signoff, _ as RequestCheckpointRequest, k as DecideCheckpointRequest, $ as ReviewItem, D as DashboardResponse, O as PipelineRun, Q as PipelineStageEvent, J as PipelineGrant, L as PipelinePackage, P as PipelineAnalysisTemplate, K as PipelineOidcTrust } from './types-CnplaVqa.js';
|
|
5
|
+
export { S as ProjectConfig, a0 as ReviewItemKind } from './types-CnplaVqa.js';
|
|
6
6
|
import { Result } from '@f0rbit/corpus';
|
|
7
7
|
export { Result, err, ok } from '@f0rbit/corpus';
|
|
8
|
-
import { b as CompletionPolicy, H as HookDeliveryStatus, C as CompletedVia, c as DispatchStatus, l as StageEventKind } from './schema
|
|
8
|
+
import { b as CompletionPolicy, H as HookDeliveryStatus, C as CompletedVia, c as DispatchStatus, l as StageEventKind } from './schema-CizNlS2t.js';
|
|
9
9
|
import 'drizzle-orm';
|
|
10
|
-
import './media
|
|
10
|
+
import './media-R87HGuRp.js';
|
|
11
11
|
import 'drizzle-orm/sqlite-core';
|
|
12
12
|
import 'drizzle-zod';
|
|
13
13
|
|