@devpad/cli 2.3.4 → 2.3.5
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/index.js +297 -7
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -12453,9 +12453,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
12453
12453
|
_chainOrCallSubCommandHook(promise, subCommand, event) {
|
|
12454
12454
|
let result = promise;
|
|
12455
12455
|
if (this._lifeCycleHooks[event] !== undefined) {
|
|
12456
|
-
this._lifeCycleHooks[event].forEach((
|
|
12456
|
+
this._lifeCycleHooks[event].forEach((hook2) => {
|
|
12457
12457
|
result = this._chainOrCall(result, () => {
|
|
12458
|
-
return
|
|
12458
|
+
return hook2(this, subCommand);
|
|
12459
12459
|
});
|
|
12460
12460
|
});
|
|
12461
12461
|
}
|
|
@@ -15824,7 +15824,7 @@ var require_emoji_regex = __commonJS(function(exports, module) {
|
|
|
15824
15824
|
};
|
|
15825
15825
|
});
|
|
15826
15826
|
|
|
15827
|
-
// ../api/dist/chunk-
|
|
15827
|
+
// ../api/dist/chunk-A7B2SE7T.js
|
|
15828
15828
|
init_drizzle_orm();
|
|
15829
15829
|
init_sqlite_core();
|
|
15830
15830
|
init_zod();
|
|
@@ -15878,6 +15878,7 @@ var api_keys = sqliteTable("api_keys", {
|
|
|
15878
15878
|
name: text("name"),
|
|
15879
15879
|
note: text("note"),
|
|
15880
15880
|
scope: text("scope", { enum: ["devpad", "blog", "media", "pulse", "all"] }).notNull().default("all"),
|
|
15881
|
+
project_id: text("project_id").references(() => project.id),
|
|
15881
15882
|
enabled: integer("enabled", { mode: "boolean" }).notNull().default(true),
|
|
15882
15883
|
last_used_at: text("last_used_at"),
|
|
15883
15884
|
...timestamps(),
|
|
@@ -15897,7 +15898,8 @@ var project = sqliteTable("project", {
|
|
|
15897
15898
|
link_text: text("link_text"),
|
|
15898
15899
|
visibility: text("visibility", { enum: ["PUBLIC", "PRIVATE", "HIDDEN", "ARCHIVED", "DRAFT", "DELETED"] }).notNull().default("PRIVATE"),
|
|
15899
15900
|
current_version: text("current_version"),
|
|
15900
|
-
scan_branch: text("scan_branch")
|
|
15901
|
+
scan_branch: text("scan_branch"),
|
|
15902
|
+
github_autoclose: integer("github_autoclose", { mode: "boolean" }).notNull().default(false)
|
|
15901
15903
|
});
|
|
15902
15904
|
var ACTIONS = [
|
|
15903
15905
|
"CREATE_TASK",
|
|
@@ -16048,6 +16050,32 @@ var task_event = sqliteTable("task_event", {
|
|
|
16048
16050
|
index("task_event_subject_id_idx").on(table3.subject_id),
|
|
16049
16051
|
index("task_event_dispatch_status_idx").on(table3.dispatch_status)
|
|
16050
16052
|
]);
|
|
16053
|
+
var hook = sqliteTable("hook", {
|
|
16054
|
+
...entity2("hook"),
|
|
16055
|
+
project_id: text("project_id").notNull().references(() => project.id),
|
|
16056
|
+
enabled: integer("enabled", { mode: "boolean" }).notNull().default(true),
|
|
16057
|
+
trigger: text("trigger", { mode: "json" }).notNull(),
|
|
16058
|
+
action: text("action", { mode: "json" }).notNull()
|
|
16059
|
+
}, (table3) => [index("hook_project_id_idx").on(table3.project_id)]);
|
|
16060
|
+
var HOOK_DELIVERY_STATUSES = ["pending", "delivered", "failed_transient", "failed_permanent"];
|
|
16061
|
+
var hook_delivery = sqliteTable("hook_delivery", {
|
|
16062
|
+
id: text("id").primaryKey(),
|
|
16063
|
+
hook_id: text("hook_id").notNull().references(() => hook.id),
|
|
16064
|
+
event_id: text("event_id").notNull(),
|
|
16065
|
+
status: text("status", { enum: HOOK_DELIVERY_STATUSES }).notNull().default("pending"),
|
|
16066
|
+
attempts: integer("attempts").notNull().default(0),
|
|
16067
|
+
last_error: text("last_error"),
|
|
16068
|
+
...timestamps()
|
|
16069
|
+
}, (table3) => [
|
|
16070
|
+
index("hook_delivery_hook_id_idx").on(table3.hook_id),
|
|
16071
|
+
index("hook_delivery_status_idx").on(table3.status)
|
|
16072
|
+
]);
|
|
16073
|
+
var github_webhook_event = sqliteTable("github_webhook_event", {
|
|
16074
|
+
id: text("id").primaryKey(),
|
|
16075
|
+
delivery_guid: text("delivery_guid").notNull(),
|
|
16076
|
+
event_type: text("event_type").notNull(),
|
|
16077
|
+
processed_at: text("processed_at").notNull().default(sql`(CURRENT_TIMESTAMP)`)
|
|
16078
|
+
}, (table3) => [index("github_webhook_event_delivery_guid_idx").on(table3.delivery_guid)]);
|
|
16051
16079
|
var checklist = sqliteTable("checklist", {
|
|
16052
16080
|
...entity2("checklist"),
|
|
16053
16081
|
task_id: text("task_id").notNull().references(() => task.id),
|
|
@@ -16241,6 +16269,13 @@ var task_rollup_relations = relations(task_rollup, ({ one }) => ({
|
|
|
16241
16269
|
var task_event_relations = relations(task_event, ({ one }) => ({
|
|
16242
16270
|
subject: one(task, { fields: [task_event.subject_id], references: [task.id] })
|
|
16243
16271
|
}));
|
|
16272
|
+
var hook_relations = relations(hook, ({ one, many }) => ({
|
|
16273
|
+
project: one(project, { fields: [hook.project_id], references: [project.id] }),
|
|
16274
|
+
deliveries: many(hook_delivery)
|
|
16275
|
+
}));
|
|
16276
|
+
var hook_delivery_relations = relations(hook_delivery, ({ one }) => ({
|
|
16277
|
+
hook: one(hook, { fields: [hook_delivery.hook_id], references: [hook.id] })
|
|
16278
|
+
}));
|
|
16244
16279
|
var checklist_relations = relations(checklist, ({ one, many }) => ({
|
|
16245
16280
|
task: one(task, { fields: [checklist.task_id], references: [task.id] }),
|
|
16246
16281
|
items: many(checklist_item)
|
|
@@ -16615,6 +16650,52 @@ var task_event_payload = exports_external.discriminatedUnion("kind", [
|
|
|
16615
16650
|
exports_external.object({ kind: exports_external.literal("policy.fired"), policy: exports_external.enum(COMPLETION_POLICIES) }),
|
|
16616
16651
|
exports_external.object({ kind: exports_external.literal("node.completion_stale"), child_id: exports_external.string() })
|
|
16617
16652
|
]);
|
|
16653
|
+
var hook_selector = exports_external.object({
|
|
16654
|
+
subject_kind: exports_external.enum(TASK_KINDS).optional(),
|
|
16655
|
+
tag: exports_external.string().optional(),
|
|
16656
|
+
ancestor_id: exports_external.string().optional()
|
|
16657
|
+
});
|
|
16658
|
+
var hook_trigger = exports_external.object({
|
|
16659
|
+
kinds: exports_external.array(exports_external.enum(TASK_EVENT_KINDS)).min(1),
|
|
16660
|
+
selector: hook_selector.default({})
|
|
16661
|
+
});
|
|
16662
|
+
var hook_action_input = exports_external.discriminatedUnion("kind", [
|
|
16663
|
+
exports_external.object({ kind: exports_external.literal("webhook"), url: exports_external.string().url(), secret: exports_external.string().min(1).optional() }),
|
|
16664
|
+
exports_external.object({
|
|
16665
|
+
kind: exports_external.literal("vault"),
|
|
16666
|
+
scope: exports_external.string().min(1),
|
|
16667
|
+
op: exports_external.string().min(1),
|
|
16668
|
+
args: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
16669
|
+
}),
|
|
16670
|
+
exports_external.object({ kind: exports_external.literal("pipeline"), package_id: exports_external.string().min(1) })
|
|
16671
|
+
]);
|
|
16672
|
+
var hook_action_stored = exports_external.discriminatedUnion("kind", [
|
|
16673
|
+
exports_external.object({ kind: exports_external.literal("webhook"), url: exports_external.string().url(), secret_encrypted: exports_external.string().optional() }),
|
|
16674
|
+
exports_external.object({
|
|
16675
|
+
kind: exports_external.literal("vault"),
|
|
16676
|
+
scope: exports_external.string().min(1),
|
|
16677
|
+
op: exports_external.string().min(1),
|
|
16678
|
+
args: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
16679
|
+
}),
|
|
16680
|
+
exports_external.object({ kind: exports_external.literal("pipeline"), package_id: exports_external.string().min(1) })
|
|
16681
|
+
]);
|
|
16682
|
+
var hook_action_public = exports_external.discriminatedUnion("kind", [
|
|
16683
|
+
exports_external.object({ kind: exports_external.literal("webhook"), url: exports_external.string().url(), has_secret: exports_external.boolean() }),
|
|
16684
|
+
exports_external.object({
|
|
16685
|
+
kind: exports_external.literal("vault"),
|
|
16686
|
+
scope: exports_external.string().min(1),
|
|
16687
|
+
op: exports_external.string().min(1),
|
|
16688
|
+
args: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
16689
|
+
}),
|
|
16690
|
+
exports_external.object({ kind: exports_external.literal("pipeline"), package_id: exports_external.string().min(1) })
|
|
16691
|
+
]);
|
|
16692
|
+
var upsert_hook = exports_external.object({
|
|
16693
|
+
id: exports_external.string().optional(),
|
|
16694
|
+
project_id: exports_external.string(),
|
|
16695
|
+
enabled: exports_external.boolean().default(true),
|
|
16696
|
+
trigger: hook_trigger,
|
|
16697
|
+
action: hook_action_input
|
|
16698
|
+
});
|
|
16618
16699
|
|
|
16619
16700
|
// ../api/dist/chunk-5L3AUVMM.js
|
|
16620
16701
|
init_dist();
|
|
@@ -17316,6 +17397,12 @@ var ApiClient2 = class {
|
|
|
17316
17397
|
delete: (id2) => wrap(() => this.clients.milestones.delete(`/milestones/${id2}`)),
|
|
17317
17398
|
goals: (id2) => wrap(() => this.clients.milestones.get(`/milestones/${id2}/goals`))
|
|
17318
17399
|
};
|
|
17400
|
+
this.hooks = {
|
|
17401
|
+
list: (project_id) => wrap(() => this.clients.hooks.get("/hooks", { query: { project_id } })),
|
|
17402
|
+
upsert: (data) => wrap(() => data.id ? this.clients.hooks.patch(`/hooks/${data.id}`, { body: data }) : this.clients.hooks.post("/hooks", { body: data })),
|
|
17403
|
+
delete: (id2) => wrap(() => this.clients.hooks.delete(`/hooks/${id2}`)),
|
|
17404
|
+
deliveries: (id2, status) => wrap(() => this.clients.hooks.get(`/hooks/${id2}/deliveries`, status ? { query: { status } } : {}))
|
|
17405
|
+
};
|
|
17319
17406
|
this.goals = {
|
|
17320
17407
|
list: () => wrap(() => this.clients.goals.get("/goals")),
|
|
17321
17408
|
find: (id2) => wrap(() => this.clients.goals.get(`/goals/${id2}`)),
|
|
@@ -17773,7 +17860,8 @@ var ApiClient2 = class {
|
|
|
17773
17860
|
blog: new ApiClient({ ...clientOptions, category: "blog" }),
|
|
17774
17861
|
media: new ApiClient({ ...clientOptions, category: "media" }),
|
|
17775
17862
|
pulse: new ApiClient({ ...clientOptions, base_url: `${base_url}/pulse`, category: "pulse" }),
|
|
17776
|
-
pipelines: new ApiClient({ ...clientOptions, category: "pipelines" })
|
|
17863
|
+
pipelines: new ApiClient({ ...clientOptions, category: "pipelines" }),
|
|
17864
|
+
hooks: new ApiClient({ ...clientOptions, category: "hooks" })
|
|
17777
17865
|
};
|
|
17778
17866
|
}
|
|
17779
17867
|
history() {
|
|
@@ -17859,6 +17947,16 @@ var milestone_by_id = exports_external.object({
|
|
|
17859
17947
|
var goal_by_id = exports_external.object({
|
|
17860
17948
|
id: exports_external.string().describe("Goal ID")
|
|
17861
17949
|
});
|
|
17950
|
+
var hook_filters = exports_external.object({
|
|
17951
|
+
project_id: exports_external.string().describe("Project ID to list hooks for")
|
|
17952
|
+
});
|
|
17953
|
+
var hook_by_id = exports_external.object({
|
|
17954
|
+
id: exports_external.string().describe("Hook ID")
|
|
17955
|
+
});
|
|
17956
|
+
var hook_deliveries_input = exports_external.object({
|
|
17957
|
+
id: exports_external.string().describe("Hook ID"),
|
|
17958
|
+
status: exports_external.enum(["pending", "delivered", "failed_transient", "failed_permanent"]).optional().describe("Filter by delivery status — use failed_permanent to see the DLQ")
|
|
17959
|
+
});
|
|
17862
17960
|
var github_branches = exports_external.object({
|
|
17863
17961
|
owner: exports_external.string().describe("Repository owner"),
|
|
17864
17962
|
repo: exports_external.string().describe("Repository name")
|
|
@@ -17956,6 +18054,30 @@ var tools = {
|
|
|
17956
18054
|
finished_at: input.finished_at
|
|
17957
18055
|
}))
|
|
17958
18056
|
}),
|
|
18057
|
+
devpad_hooks_list: define_tool({
|
|
18058
|
+
name: "devpad_hooks_list",
|
|
18059
|
+
description: "List hooks configured for a project",
|
|
18060
|
+
inputSchema: hook_filters,
|
|
18061
|
+
execute: async (client, input) => unwrap2(await client.hooks.list(input.project_id))
|
|
18062
|
+
}),
|
|
18063
|
+
devpad_hooks_upsert: define_tool({
|
|
18064
|
+
name: "devpad_hooks_upsert",
|
|
18065
|
+
description: "Create or update a hook (webhook/vault/pipeline action fired on matching task_event kinds). Pass 'id' to update.",
|
|
18066
|
+
inputSchema: upsert_hook,
|
|
18067
|
+
execute: async (client, input) => unwrap2(await client.hooks.upsert(input))
|
|
18068
|
+
}),
|
|
18069
|
+
devpad_hooks_delete: define_tool({
|
|
18070
|
+
name: "devpad_hooks_delete",
|
|
18071
|
+
description: "Delete a hook",
|
|
18072
|
+
inputSchema: hook_by_id,
|
|
18073
|
+
execute: async (client, input) => unwrap2(await client.hooks.delete(input.id))
|
|
18074
|
+
}),
|
|
18075
|
+
devpad_hooks_deliveries: define_tool({
|
|
18076
|
+
name: "devpad_hooks_deliveries",
|
|
18077
|
+
description: "List delivery attempts for a hook, optionally filtered by status (the DLQ is status=failed_permanent)",
|
|
18078
|
+
inputSchema: hook_deliveries_input,
|
|
18079
|
+
execute: async (client, input) => unwrap2(await client.hooks.deliveries(input.id, input.status))
|
|
18080
|
+
}),
|
|
17959
18081
|
devpad_goals_list: define_tool({
|
|
17960
18082
|
name: "devpad_goals_list",
|
|
17961
18083
|
description: "List goals for authenticated user",
|
|
@@ -19724,6 +19846,12 @@ var ApiClient22 = class {
|
|
|
19724
19846
|
delete: (id2) => wrap2(() => this.clients.milestones.delete(`/milestones/${id2}`)),
|
|
19725
19847
|
goals: (id2) => wrap2(() => this.clients.milestones.get(`/milestones/${id2}/goals`))
|
|
19726
19848
|
};
|
|
19849
|
+
this.hooks = {
|
|
19850
|
+
list: (project_id) => wrap2(() => this.clients.hooks.get("/hooks", { query: { project_id } })),
|
|
19851
|
+
upsert: (data) => wrap2(() => data.id ? this.clients.hooks.patch(`/hooks/${data.id}`, { body: data }) : this.clients.hooks.post("/hooks", { body: data })),
|
|
19852
|
+
delete: (id2) => wrap2(() => this.clients.hooks.delete(`/hooks/${id2}`)),
|
|
19853
|
+
deliveries: (id2, status) => wrap2(() => this.clients.hooks.get(`/hooks/${id2}/deliveries`, status ? { query: { status } } : {}))
|
|
19854
|
+
};
|
|
19727
19855
|
this.goals = {
|
|
19728
19856
|
list: () => wrap2(() => this.clients.goals.get("/goals")),
|
|
19729
19857
|
find: (id2) => wrap2(() => this.clients.goals.get(`/goals/${id2}`)),
|
|
@@ -20181,7 +20309,8 @@ var ApiClient22 = class {
|
|
|
20181
20309
|
blog: new ApiClient3({ ...clientOptions, category: "blog" }),
|
|
20182
20310
|
media: new ApiClient3({ ...clientOptions, category: "media" }),
|
|
20183
20311
|
pulse: new ApiClient3({ ...clientOptions, base_url: `${base_url}/pulse`, category: "pulse" }),
|
|
20184
|
-
pipelines: new ApiClient3({ ...clientOptions, category: "pipelines" })
|
|
20312
|
+
pipelines: new ApiClient3({ ...clientOptions, category: "pipelines" }),
|
|
20313
|
+
hooks: new ApiClient3({ ...clientOptions, category: "hooks" })
|
|
20185
20314
|
};
|
|
20186
20315
|
}
|
|
20187
20316
|
history() {
|
|
@@ -20267,6 +20396,16 @@ var milestone_by_id2 = exports_external.object({
|
|
|
20267
20396
|
var goal_by_id2 = exports_external.object({
|
|
20268
20397
|
id: exports_external.string().describe("Goal ID")
|
|
20269
20398
|
});
|
|
20399
|
+
var hook_filters2 = exports_external.object({
|
|
20400
|
+
project_id: exports_external.string().describe("Project ID to list hooks for")
|
|
20401
|
+
});
|
|
20402
|
+
var hook_by_id2 = exports_external.object({
|
|
20403
|
+
id: exports_external.string().describe("Hook ID")
|
|
20404
|
+
});
|
|
20405
|
+
var hook_deliveries_input2 = exports_external.object({
|
|
20406
|
+
id: exports_external.string().describe("Hook ID"),
|
|
20407
|
+
status: exports_external.enum(["pending", "delivered", "failed_transient", "failed_permanent"]).optional().describe("Filter by delivery status — use failed_permanent to see the DLQ")
|
|
20408
|
+
});
|
|
20270
20409
|
var github_branches2 = exports_external.object({
|
|
20271
20410
|
owner: exports_external.string().describe("Repository owner"),
|
|
20272
20411
|
repo: exports_external.string().describe("Repository name")
|
|
@@ -20364,6 +20503,30 @@ var tools2 = {
|
|
|
20364
20503
|
finished_at: input.finished_at
|
|
20365
20504
|
}))
|
|
20366
20505
|
}),
|
|
20506
|
+
devpad_hooks_list: define_tool2({
|
|
20507
|
+
name: "devpad_hooks_list",
|
|
20508
|
+
description: "List hooks configured for a project",
|
|
20509
|
+
inputSchema: hook_filters2,
|
|
20510
|
+
execute: async (client, input) => unwrap3(await client.hooks.list(input.project_id))
|
|
20511
|
+
}),
|
|
20512
|
+
devpad_hooks_upsert: define_tool2({
|
|
20513
|
+
name: "devpad_hooks_upsert",
|
|
20514
|
+
description: "Create or update a hook (webhook/vault/pipeline action fired on matching task_event kinds). Pass 'id' to update.",
|
|
20515
|
+
inputSchema: upsert_hook,
|
|
20516
|
+
execute: async (client, input) => unwrap3(await client.hooks.upsert(input))
|
|
20517
|
+
}),
|
|
20518
|
+
devpad_hooks_delete: define_tool2({
|
|
20519
|
+
name: "devpad_hooks_delete",
|
|
20520
|
+
description: "Delete a hook",
|
|
20521
|
+
inputSchema: hook_by_id2,
|
|
20522
|
+
execute: async (client, input) => unwrap3(await client.hooks.delete(input.id))
|
|
20523
|
+
}),
|
|
20524
|
+
devpad_hooks_deliveries: define_tool2({
|
|
20525
|
+
name: "devpad_hooks_deliveries",
|
|
20526
|
+
description: "List delivery attempts for a hook, optionally filtered by status (the DLQ is status=failed_permanent)",
|
|
20527
|
+
inputSchema: hook_deliveries_input2,
|
|
20528
|
+
execute: async (client, input) => unwrap3(await client.hooks.deliveries(input.id, input.status))
|
|
20529
|
+
}),
|
|
20367
20530
|
devpad_goals_list: define_tool2({
|
|
20368
20531
|
name: "devpad_goals_list",
|
|
20369
20532
|
description: "List goals for authenticated user",
|
|
@@ -24225,6 +24388,7 @@ var api_keys2 = sqliteTable("api_keys", {
|
|
|
24225
24388
|
name: text("name"),
|
|
24226
24389
|
note: text("note"),
|
|
24227
24390
|
scope: text("scope", { enum: ["devpad", "blog", "media", "pulse", "all"] }).notNull().default("all"),
|
|
24391
|
+
project_id: text("project_id").references(() => project2.id),
|
|
24228
24392
|
enabled: integer("enabled", { mode: "boolean" }).notNull().default(true),
|
|
24229
24393
|
last_used_at: text("last_used_at"),
|
|
24230
24394
|
...timestamps2(),
|
|
@@ -24244,7 +24408,8 @@ var project2 = sqliteTable("project", {
|
|
|
24244
24408
|
link_text: text("link_text"),
|
|
24245
24409
|
visibility: text("visibility", { enum: ["PUBLIC", "PRIVATE", "HIDDEN", "ARCHIVED", "DRAFT", "DELETED"] }).notNull().default("PRIVATE"),
|
|
24246
24410
|
current_version: text("current_version"),
|
|
24247
|
-
scan_branch: text("scan_branch")
|
|
24411
|
+
scan_branch: text("scan_branch"),
|
|
24412
|
+
github_autoclose: integer("github_autoclose", { mode: "boolean" }).notNull().default(false)
|
|
24248
24413
|
});
|
|
24249
24414
|
var ACTIONS2 = [
|
|
24250
24415
|
"CREATE_TASK",
|
|
@@ -24395,6 +24560,32 @@ var task_event2 = sqliteTable("task_event", {
|
|
|
24395
24560
|
index("task_event_subject_id_idx").on(table3.subject_id),
|
|
24396
24561
|
index("task_event_dispatch_status_idx").on(table3.dispatch_status)
|
|
24397
24562
|
]);
|
|
24563
|
+
var hook2 = sqliteTable("hook", {
|
|
24564
|
+
...entity3("hook"),
|
|
24565
|
+
project_id: text("project_id").notNull().references(() => project2.id),
|
|
24566
|
+
enabled: integer("enabled", { mode: "boolean" }).notNull().default(true),
|
|
24567
|
+
trigger: text("trigger", { mode: "json" }).notNull(),
|
|
24568
|
+
action: text("action", { mode: "json" }).notNull()
|
|
24569
|
+
}, (table3) => [index("hook_project_id_idx").on(table3.project_id)]);
|
|
24570
|
+
var HOOK_DELIVERY_STATUSES2 = ["pending", "delivered", "failed_transient", "failed_permanent"];
|
|
24571
|
+
var hook_delivery2 = sqliteTable("hook_delivery", {
|
|
24572
|
+
id: text("id").primaryKey(),
|
|
24573
|
+
hook_id: text("hook_id").notNull().references(() => hook2.id),
|
|
24574
|
+
event_id: text("event_id").notNull(),
|
|
24575
|
+
status: text("status", { enum: HOOK_DELIVERY_STATUSES2 }).notNull().default("pending"),
|
|
24576
|
+
attempts: integer("attempts").notNull().default(0),
|
|
24577
|
+
last_error: text("last_error"),
|
|
24578
|
+
...timestamps2()
|
|
24579
|
+
}, (table3) => [
|
|
24580
|
+
index("hook_delivery_hook_id_idx").on(table3.hook_id),
|
|
24581
|
+
index("hook_delivery_status_idx").on(table3.status)
|
|
24582
|
+
]);
|
|
24583
|
+
var github_webhook_event2 = sqliteTable("github_webhook_event", {
|
|
24584
|
+
id: text("id").primaryKey(),
|
|
24585
|
+
delivery_guid: text("delivery_guid").notNull(),
|
|
24586
|
+
event_type: text("event_type").notNull(),
|
|
24587
|
+
processed_at: text("processed_at").notNull().default(sql`(CURRENT_TIMESTAMP)`)
|
|
24588
|
+
}, (table3) => [index("github_webhook_event_delivery_guid_idx").on(table3.delivery_guid)]);
|
|
24398
24589
|
var checklist2 = sqliteTable("checklist", {
|
|
24399
24590
|
...entity3("checklist"),
|
|
24400
24591
|
task_id: text("task_id").notNull().references(() => task2.id),
|
|
@@ -24588,6 +24779,13 @@ var task_rollup_relations2 = relations(task_rollup2, ({ one }) => ({
|
|
|
24588
24779
|
var task_event_relations2 = relations(task_event2, ({ one }) => ({
|
|
24589
24780
|
subject: one(task2, { fields: [task_event2.subject_id], references: [task2.id] })
|
|
24590
24781
|
}));
|
|
24782
|
+
var hook_relations2 = relations(hook2, ({ one, many }) => ({
|
|
24783
|
+
project: one(project2, { fields: [hook2.project_id], references: [project2.id] }),
|
|
24784
|
+
deliveries: many(hook_delivery2)
|
|
24785
|
+
}));
|
|
24786
|
+
var hook_delivery_relations2 = relations(hook_delivery2, ({ one }) => ({
|
|
24787
|
+
hook: one(hook2, { fields: [hook_delivery2.hook_id], references: [hook2.id] })
|
|
24788
|
+
}));
|
|
24591
24789
|
var checklist_relations2 = relations(checklist2, ({ one, many }) => ({
|
|
24592
24790
|
task: one(task2, { fields: [checklist2.task_id], references: [task2.id] }),
|
|
24593
24791
|
items: many(checklist_item2)
|
|
@@ -24964,6 +25162,52 @@ var task_event_payload2 = exports_external.discriminatedUnion("kind", [
|
|
|
24964
25162
|
exports_external.object({ kind: exports_external.literal("policy.fired"), policy: exports_external.enum(COMPLETION_POLICIES2) }),
|
|
24965
25163
|
exports_external.object({ kind: exports_external.literal("node.completion_stale"), child_id: exports_external.string() })
|
|
24966
25164
|
]);
|
|
25165
|
+
var hook_selector2 = exports_external.object({
|
|
25166
|
+
subject_kind: exports_external.enum(TASK_KINDS2).optional(),
|
|
25167
|
+
tag: exports_external.string().optional(),
|
|
25168
|
+
ancestor_id: exports_external.string().optional()
|
|
25169
|
+
});
|
|
25170
|
+
var hook_trigger2 = exports_external.object({
|
|
25171
|
+
kinds: exports_external.array(exports_external.enum(TASK_EVENT_KINDS2)).min(1),
|
|
25172
|
+
selector: hook_selector2.default({})
|
|
25173
|
+
});
|
|
25174
|
+
var hook_action_input2 = exports_external.discriminatedUnion("kind", [
|
|
25175
|
+
exports_external.object({ kind: exports_external.literal("webhook"), url: exports_external.string().url(), secret: exports_external.string().min(1).optional() }),
|
|
25176
|
+
exports_external.object({
|
|
25177
|
+
kind: exports_external.literal("vault"),
|
|
25178
|
+
scope: exports_external.string().min(1),
|
|
25179
|
+
op: exports_external.string().min(1),
|
|
25180
|
+
args: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
25181
|
+
}),
|
|
25182
|
+
exports_external.object({ kind: exports_external.literal("pipeline"), package_id: exports_external.string().min(1) })
|
|
25183
|
+
]);
|
|
25184
|
+
var hook_action_stored2 = exports_external.discriminatedUnion("kind", [
|
|
25185
|
+
exports_external.object({ kind: exports_external.literal("webhook"), url: exports_external.string().url(), secret_encrypted: exports_external.string().optional() }),
|
|
25186
|
+
exports_external.object({
|
|
25187
|
+
kind: exports_external.literal("vault"),
|
|
25188
|
+
scope: exports_external.string().min(1),
|
|
25189
|
+
op: exports_external.string().min(1),
|
|
25190
|
+
args: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
25191
|
+
}),
|
|
25192
|
+
exports_external.object({ kind: exports_external.literal("pipeline"), package_id: exports_external.string().min(1) })
|
|
25193
|
+
]);
|
|
25194
|
+
var hook_action_public2 = exports_external.discriminatedUnion("kind", [
|
|
25195
|
+
exports_external.object({ kind: exports_external.literal("webhook"), url: exports_external.string().url(), has_secret: exports_external.boolean() }),
|
|
25196
|
+
exports_external.object({
|
|
25197
|
+
kind: exports_external.literal("vault"),
|
|
25198
|
+
scope: exports_external.string().min(1),
|
|
25199
|
+
op: exports_external.string().min(1),
|
|
25200
|
+
args: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
25201
|
+
}),
|
|
25202
|
+
exports_external.object({ kind: exports_external.literal("pipeline"), package_id: exports_external.string().min(1) })
|
|
25203
|
+
]);
|
|
25204
|
+
var upsert_hook2 = exports_external.object({
|
|
25205
|
+
id: exports_external.string().optional(),
|
|
25206
|
+
project_id: exports_external.string(),
|
|
25207
|
+
enabled: exports_external.boolean().default(true),
|
|
25208
|
+
trigger: hook_trigger2,
|
|
25209
|
+
action: hook_action_input2
|
|
25210
|
+
});
|
|
24967
25211
|
|
|
24968
25212
|
// src/graph-commands.ts
|
|
24969
25213
|
async function print_json(data) {
|
|
@@ -25523,6 +25767,52 @@ github.command("branches <owner> <repo>").description("List branches for a GitHu
|
|
|
25523
25767
|
handleError(error);
|
|
25524
25768
|
}
|
|
25525
25769
|
});
|
|
25770
|
+
var keysCmd = program2.command("keys").description("Manage API keys");
|
|
25771
|
+
keysCmd.command("list").description("List your API keys").option("-f, --format <format>", "Output format (json|table)", "json").action(async (options) => {
|
|
25772
|
+
const spinner = make_spinner2("Fetching API keys...").start();
|
|
25773
|
+
try {
|
|
25774
|
+
const client = getApiClient();
|
|
25775
|
+
const result = await client.auth.keys.list();
|
|
25776
|
+
if (!result.ok)
|
|
25777
|
+
throw new Error(result.error.message);
|
|
25778
|
+
spinner.succeed("API keys fetched");
|
|
25779
|
+
await formatOutput(result.value, options.format);
|
|
25780
|
+
} catch (error) {
|
|
25781
|
+
spinner.fail("Failed to fetch API keys");
|
|
25782
|
+
handleError(error);
|
|
25783
|
+
}
|
|
25784
|
+
});
|
|
25785
|
+
keysCmd.command("create").description("Create a new API key").option("-n, --name <name>", "Key name").option("-s, --scope <scope>", "Key scope (devpad|blog|media|pulse|all)", "devpad").option("-p, --project <id>", "Scope this key to a single project (least privilege \u2014 omit for an all-projects key)").option("-f, --format <format>", "Output format (json|table)", "json").action(async (options) => {
|
|
25786
|
+
const spinner = make_spinner2("Creating API key...").start();
|
|
25787
|
+
try {
|
|
25788
|
+
const client = getApiClient();
|
|
25789
|
+
const result = await client.auth.keys.create({
|
|
25790
|
+
name: options.name,
|
|
25791
|
+
scope: options.scope,
|
|
25792
|
+
project_id: options.project
|
|
25793
|
+
});
|
|
25794
|
+
if (!result.ok)
|
|
25795
|
+
throw new Error(result.error.message);
|
|
25796
|
+
spinner.succeed("API key created \u2014 save the raw key now, it won't be shown again");
|
|
25797
|
+
await formatOutput(result.value, options.format);
|
|
25798
|
+
} catch (error) {
|
|
25799
|
+
spinner.fail("Failed to create API key");
|
|
25800
|
+
handleError(error);
|
|
25801
|
+
}
|
|
25802
|
+
});
|
|
25803
|
+
keysCmd.command("revoke <id>").description("Revoke an API key").action(async (id3) => {
|
|
25804
|
+
const spinner = make_spinner2("Revoking API key...").start();
|
|
25805
|
+
try {
|
|
25806
|
+
const client = getApiClient();
|
|
25807
|
+
const result = await client.auth.keys.revoke(id3);
|
|
25808
|
+
if (!result.ok)
|
|
25809
|
+
throw new Error(result.error.message);
|
|
25810
|
+
spinner.succeed("API key revoked");
|
|
25811
|
+
} catch (error) {
|
|
25812
|
+
spinner.fail("Failed to revoke API key");
|
|
25813
|
+
handleError(error);
|
|
25814
|
+
}
|
|
25815
|
+
});
|
|
25526
25816
|
var user3 = program2.command("user").description("User preferences and history");
|
|
25527
25817
|
user3.command("history").description("Get user activity history").option("-f, --format <format>", "Output format (json|table)", "json").action(async (options) => {
|
|
25528
25818
|
const spinner = make_spinner2("Fetching user history...").start();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devpad/cli",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.5",
|
|
4
4
|
"description": "Command line interface for devpad project management",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"mime": "^3.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@devpad/api": "^2.3.
|
|
54
|
-
"@devpad/pipeline-fakes": "^2.3.
|
|
55
|
-
"@devpad/pipeline-templates": "^2.3.
|
|
56
|
-
"@devpad/schema": "^2.3.
|
|
53
|
+
"@devpad/api": "^2.3.5",
|
|
54
|
+
"@devpad/pipeline-fakes": "^2.3.5",
|
|
55
|
+
"@devpad/pipeline-templates": "^2.3.5",
|
|
56
|
+
"@devpad/schema": "^2.3.5",
|
|
57
57
|
"@types/node": "^20.11.24",
|
|
58
58
|
"bun-types": "latest",
|
|
59
59
|
"chalk": "^5.3.0",
|