@devpad/api 2.5.1 → 2.5.2

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.d.ts CHANGED
@@ -1687,12 +1687,15 @@ declare class ApiClient {
1687
1687
  status: string;
1688
1688
  }>>;
1689
1689
  /**
1690
- * Approve a stage in a pipeline run
1690
+ * Approve a stage in a pipeline run. Identity is resolved
1691
+ * server-side by the worker proxy (`X-Devpad-Actor` header) — the
1692
+ * caller never supplies a `user_id`. Approvals are human-only:
1693
+ * api-channel callers get `403 human_approval_required`; approve
1694
+ * from the devpad web UI while signed in.
1691
1695
  */
1692
1696
  approve: (run_id: string, input: {
1693
1697
  stage_name: string;
1694
1698
  decision: "approved" | "denied";
1695
- user_id: string;
1696
1699
  reason?: string;
1697
1700
  }) => Promise<ApiResult<void>>;
1698
1701
  /**
@@ -1736,13 +1739,16 @@ declare class ApiClient {
1736
1739
  */
1737
1740
  list: (package_id?: string) => Promise<ApiResult<PipelineGrant[]>>;
1738
1741
  /**
1739
- * Approve a grant
1742
+ * Approve a pending grant. Human-only — the actor is resolved
1743
+ * server-side by the worker proxy; api-channel callers get
1744
+ * `403 human_approval_required`.
1740
1745
  */
1741
- approve: (grant_id: string, user_id: string) => Promise<ApiResult<PipelineGrant>>;
1746
+ approve: (grant_id: string) => Promise<ApiResult<PipelineGrant>>;
1742
1747
  /**
1743
- * Deny a grant
1748
+ * Deny a pending grant. Human-only — same actor resolution as
1749
+ * `approve`.
1744
1750
  */
1745
- deny: (grant_id: string, user_id: string, reason?: string) => Promise<ApiResult<{
1751
+ deny: (grant_id: string, reason?: string) => Promise<ApiResult<{
1746
1752
  success: boolean;
1747
1753
  }>>;
1748
1754
  };
package/dist/index.js CHANGED
@@ -1463,7 +1463,11 @@ var ApiClient2 = class {
1463
1463
  })
1464
1464
  ),
1465
1465
  /**
1466
- * Approve a stage in a pipeline run
1466
+ * Approve a stage in a pipeline run. Identity is resolved
1467
+ * server-side by the worker proxy (`X-Devpad-Actor` header) — the
1468
+ * caller never supplies a `user_id`. Approvals are human-only:
1469
+ * api-channel callers get `403 human_approval_required`; approve
1470
+ * from the devpad web UI while signed in.
1467
1471
  */
1468
1472
  approve: (run_id, input) => wrap(
1469
1473
  () => this.clients.pipelines.post(`/runs/${run_id}/approve`, {
@@ -1511,19 +1515,22 @@ var ApiClient2 = class {
1511
1515
  })
1512
1516
  ),
1513
1517
  /**
1514
- * Approve a grant
1518
+ * Approve a pending grant. Human-only — the actor is resolved
1519
+ * server-side by the worker proxy; api-channel callers get
1520
+ * `403 human_approval_required`.
1515
1521
  */
1516
- approve: (grant_id, user_id) => wrap(
1522
+ approve: (grant_id) => wrap(
1517
1523
  () => this.clients.pipelines.post(`/grants/${grant_id}/approve`, {
1518
- body: { user_id }
1524
+ body: {}
1519
1525
  })
1520
1526
  ),
1521
1527
  /**
1522
- * Deny a grant
1528
+ * Deny a pending grant. Human-only — same actor resolution as
1529
+ * `approve`.
1523
1530
  */
1524
- deny: (grant_id, user_id, reason) => wrap(
1531
+ deny: (grant_id, reason) => wrap(
1525
1532
  () => this.clients.pipelines.post(`/grants/${grant_id}/deny`, {
1526
- body: { user_id, reason }
1533
+ body: reason !== void 0 ? { reason } : {}
1527
1534
  })
1528
1535
  )
1529
1536
  },
@@ -2474,16 +2481,21 @@ var tools = {
2474
2481
  }),
2475
2482
  devpad_pipelines_approve: define_tool({
2476
2483
  name: "devpad_pipelines_approve",
2477
- description: "Approve or deny a stage in a pipeline run",
2484
+ description: "Approve or deny a stage in a pipeline run. Human-only: the actor is resolved from the caller's own authentication, and approvals are gated to signed-in humans in the devpad web UI \u2014 API-key/MCP callers receive 403 human_approval_required. Failures surface as typed errors, never thrown.",
2478
2485
  inputSchema: z2.object({
2479
2486
  run_id: z2.string().describe("Pipeline run ID"),
2480
2487
  stage_name: z2.string().describe("Stage name to approve"),
2481
2488
  decision: z2.enum(["approved", "denied"]).describe("Approval decision"),
2482
- user_id: z2.string().describe("User ID making the decision"),
2483
2489
  reason: z2.string().optional().describe("Optional reason for the decision")
2484
2490
  }),
2485
2491
  execute: async (client, input) => {
2486
- unwrap(await client.pipelines.approve(input.run_id, input));
2492
+ unwrap(
2493
+ await client.pipelines.approve(input.run_id, {
2494
+ stage_name: input.stage_name,
2495
+ decision: input.decision,
2496
+ reason: input.reason
2497
+ })
2498
+ );
2487
2499
  return { success: true };
2488
2500
  }
2489
2501
  }),
@@ -2546,22 +2558,20 @@ var tools = {
2546
2558
  }),
2547
2559
  devpad_pipelines_grants_approve: define_tool({
2548
2560
  name: "devpad_pipelines_grants_approve",
2549
- description: "Approve a pending vault grant request for a pipeline package",
2561
+ description: "Approve a pending vault grant request for a pipeline package. Human-only: requires a signed-in human deciding in the devpad web UI \u2014 API-key/MCP callers receive 403 human_approval_required.",
2550
2562
  inputSchema: z2.object({
2551
- grant_id: z2.string().describe("Grant ID to approve"),
2552
- user_id: z2.string().describe("User ID making the approval decision")
2563
+ grant_id: z2.string().describe("Grant ID to approve")
2553
2564
  }),
2554
- execute: async (client, input) => unwrap(await client.pipelines.grants.approve(input.grant_id, input.user_id))
2565
+ execute: async (client, input) => unwrap(await client.pipelines.grants.approve(input.grant_id))
2555
2566
  }),
2556
2567
  devpad_pipelines_grants_deny: define_tool({
2557
2568
  name: "devpad_pipelines_grants_deny",
2558
- description: "Deny a pending vault grant request for a pipeline package",
2569
+ description: "Deny a pending vault grant request for a pipeline package. Human-only: requires a signed-in human deciding in the devpad web UI \u2014 API-key/MCP callers receive 403 human_approval_required.",
2559
2570
  inputSchema: z2.object({
2560
2571
  grant_id: z2.string().describe("Grant ID to deny"),
2561
- user_id: z2.string().describe("User ID making the denial decision"),
2562
2572
  reason: z2.string().optional().describe("Optional reason for the denial")
2563
2573
  }),
2564
- execute: async (client, input) => unwrap(await client.pipelines.grants.deny(input.grant_id, input.user_id, input.reason))
2574
+ execute: async (client, input) => unwrap(await client.pipelines.grants.deny(input.grant_id, input.reason))
2565
2575
  }),
2566
2576
  devpad_pipelines_packages_list: define_tool({
2567
2577
  name: "devpad_pipelines_packages_list",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devpad/api",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
4
4
  "description": "TypeScript client library for the devpad API - project and task management made simple",
5
5
  "keywords": [
6
6
  "api",
@@ -68,7 +68,7 @@
68
68
  "zod": "^3.22.4"
69
69
  },
70
70
  "devDependencies": {
71
- "@devpad/schema": "^2.5.1",
71
+ "@devpad/schema": "^2.5.2",
72
72
  "@types/node": "^20.11.24",
73
73
  "bun-types": "latest",
74
74
  "tsup": "^8.0.0",