@voltro/cli 0.24.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +670 -0
  2. package/THIRD-PARTY-NOTICES.md +2 -2
  3. package/dist/{apiBuild-B2m4XK_8.js → apiBuild-BtrTyKnF.js} +15 -15
  4. package/dist/apiBuild-DDJ0It4j.js +2 -0
  5. package/dist/bin.js +3 -3
  6. package/dist/{commands-CaIhTsC2.js → commands-D-9iYF2D.js} +1889 -1591
  7. package/dist/dbCommand-DrzXimKf.js +2 -0
  8. package/dist/{dbCommand-CC61CsAc.js → dbCommand-uuNCrFAb.js} +172 -163
  9. package/dist/{dev-DPkQVUTP.js → dev-BnWq4jeA.js} +1 -1
  10. package/dist/{dev-NCuEhNxs.js → dev-Dbm6SWtn.js} +2369 -1774
  11. package/dist/fileConventions-3bffWssN.js +30 -0
  12. package/dist/{frameworkTableAssembly-sg41s14F.js → frameworkTableAssembly-BwHU9Euq.js} +12 -8
  13. package/dist/frameworkTableAssembly-lrjZtk0G.js +2 -0
  14. package/dist/index.js +1 -1
  15. package/dist/{inspect-_ldwsAwH.js → inspect-CUCCzw2I.js} +20 -4
  16. package/dist/inspect-gt8bq-Tz.js +2 -0
  17. package/dist/{inspectMetrics-dcC7gnxu.js → inspectMetrics-BU90mvJN.js} +15 -15
  18. package/dist/{manifestBuild-Bs1Uw22_.js → manifestBuild-BnzAxp2O.js} +1 -1
  19. package/dist/manifestBuild-ifczArzr.js +2 -0
  20. package/dist/serveCommand-XBXuwJty.js +1294 -0
  21. package/dist/serveEntry.js +2 -2
  22. package/dist/{start-C_4VUDT8.js → start-BGXIf6zT.js} +2 -2
  23. package/dist/startEntry.js +2 -2
  24. package/package.json +17 -17
  25. package/templates/AGENTS.core.md +12 -5
  26. package/templates/AGENTS.md +14 -7
  27. package/templates/agent-docs/_index.md +2 -2
  28. package/templates/agent-docs/_manifest.json +3 -3
  29. package/templates/agent-docs/cli.md +15 -0
  30. package/templates/agent-docs/data.md +339 -2
  31. package/templates/agent-docs/database/migrations.md +40 -0
  32. package/templates/agent-docs/database/schema.md +127 -0
  33. package/templates/agent-docs/deployment.md +28 -0
  34. package/templates/agent-docs/plugins.md +26 -4
  35. package/templates/agent-docs/reference.md +2 -2
  36. package/templates/agent-docs/security.md +18 -0
  37. package/templates/agent-docs/templates/apibackends.md +5 -5
  38. package/templates/agent-docs/templates/overview.md +1 -1
  39. package/templates/agent-docs/whats-new.md +278 -168
  40. package/templates/agent-docs/workflows.md +160 -42
  41. package/templates/apps/api-ai/package.json +7 -7
  42. package/templates/apps/api-auth/package.json +8 -8
  43. package/templates/apps/api-backend/package.json +7 -7
  44. package/templates/apps/api-backend-deactivation/package.json +7 -7
  45. package/templates/apps/api-backend-mail/package.json +8 -8
  46. package/templates/apps/api-backend-mariadb/package.json +9 -9
  47. package/templates/apps/api-backend-storage/package.json +8 -8
  48. package/templates/apps/api-data-advanced/package.json +8 -8
  49. package/templates/apps/api-durable/README.md +2 -1
  50. package/templates/apps/api-durable/events/orders.event.ts +18 -0
  51. package/templates/apps/api-durable/mutations/orders.place.mutation.server.ts +17 -15
  52. package/templates/apps/api-durable/package.json +8 -8
  53. package/templates/apps/api-durable/triggers/order.placed.trigger.tsx +6 -4
  54. package/templates/apps/api-feature-flags/package.json +9 -9
  55. package/templates/apps/api-governance/package.json +8 -8
  56. package/templates/apps/api-kv/package.json +8 -8
  57. package/templates/apps/api-moderation/package.json +8 -8
  58. package/templates/apps/api-observability/package.json +8 -8
  59. package/templates/apps/api-ratelimit/package.json +8 -8
  60. package/templates/apps/api-rbac/package.json +8 -8
  61. package/templates/apps/api-rest/package.json +7 -7
  62. package/templates/apps/api-saas/package.json +11 -11
  63. package/templates/apps/api-search/package.json +8 -8
  64. package/templates/apps/api-versioning/package.json +8 -8
  65. package/templates/apps/api-webhooks/README.md +2 -2
  66. package/templates/apps/api-webhooks/events/orders.event.ts +35 -0
  67. package/templates/apps/api-webhooks/package.json +9 -9
  68. package/templates/apps/api-webhooks/template.json +1 -1
  69. package/templates/apps/changelog/package.json +6 -6
  70. package/templates/apps/edge-functions/package.json +2 -2
  71. package/templates/apps/frontend-admin/package.json +8 -8
  72. package/templates/apps/frontend-app/package.json +8 -8
  73. package/templates/apps/frontend-blank/package.json +7 -7
  74. package/templates/apps/frontend-contact/package.json +7 -7
  75. package/templates/apps/frontend-dashboard/package.json +7 -7
  76. package/templates/apps/frontend-docs/package.json +7 -7
  77. package/templates/apps/frontend-i18n/package.json +6 -6
  78. package/templates/apps/frontend-landing/package.json +7 -7
  79. package/templates/apps/frontend-spa/package.json +7 -7
  80. package/templates/apps/frontend-ssr/package.json +7 -7
  81. package/templates/apps/frontend-ssr-api/package.json +8 -8
  82. package/templates/apps/frontend-static-blog/package.json +6 -6
  83. package/dist/apiBuild-UEM3QBke.js +0 -2
  84. package/dist/dbCommand-Cr__4ATv.js +0 -2
  85. package/dist/fileConventions-CBNPZVOV.js +0 -29
  86. package/dist/frameworkTableAssembly-DRJrAVr1.js +0 -2
  87. package/dist/inspect-BA67TF6v.js +0 -2
  88. package/dist/manifestBuild-i-fRHg_H.js +0 -2
  89. package/dist/serveCommand-C4gzDZzc.js +0 -1175
  90. package/templates/apps/api-webhooks/events/order.completed.webhook.tsx +0 -22
@@ -1,34 +1,36 @@
1
1
  // `orders.place` — EXECUTOR (server-only, default export).
2
2
  //
3
- // Inserts the order in the mutation transaction, then emits a domain
4
- // event AFTER commit. `ctx.events.emit(...)` is post-commit safe: the
5
- // event is recorded + the `order.placed` trigger fans out only once the
6
- // row is durably written, so a rollback never starts a fulfillment
7
- // workflow for an order that doesn't exist.
3
+ // Inserts the order and publishes a declared domain event in the SAME
4
+ // transaction. `ctx.events.publish(...)` fires on COMMIT and not at all on
5
+ // rollback, so a rolled-back order can neither start a fulfillment workflow nor
6
+ // tell a connected client that it exists you do not have to sequence the two
7
+ // by hand.
8
8
 
9
9
  import { assertOwnTenant } from '@voltro/plugin-multitenancy/guard'
10
+ import { Effect } from 'effect'
10
11
  import type { AppContext } from '@voltro/runtime'
12
+ import { orderPlaced } from '../events/orders.event'
11
13
 
12
- const execute = async (
14
+ const execute = (
13
15
  input: { tenantId: string; customerName: string; amountCents: number },
14
16
  ctx: AppContext,
15
- ) => {
17
+ ) => Effect.gen(function* () {
16
18
  // Cross-tenant write guard — reject a caller spoofing input.tenantId.
17
19
  assertOwnTenant(input.tenantId, ctx.request.subject)
18
20
 
19
21
  // Framework auto-injects an `order_…` id + the tenant/audit columns.
20
- const row = await ctx.store.insert('orders', {
22
+ const row = yield* Effect.promise(() => ctx.store.insert('orders', {
21
23
  status: 'placed',
22
24
  customerName: input.customerName,
23
25
  amountCents: input.amountCents,
24
26
  tenantId: input.tenantId,
25
- })
27
+ }))
26
28
 
27
- // Post-commit fan-out the `order.placed` trigger starts the
28
- // `orders.fulfill` workflow. `ctx.events` is only present when the
29
- // runtime wired the events facade (it always is under `voltro dev`);
30
- // guard so a unit-test ctx without it doesn't throw.
31
- await ctx.events?.emit('order.placed', {
29
+ // One publish, both audiences: the `order.placed` trigger starts the
30
+ // `orders.fulfill` workflow, and any client watching this order sees it live.
31
+ // Both on the commit boundary they cannot disagree about whether it
32
+ // happened.
33
+ yield* ctx.events!.publish(orderPlaced, { orderId: row['id'] as string }, {
32
34
  orderId: row['id'] as string,
33
35
  tenantId: input.tenantId,
34
36
  })
@@ -40,6 +42,6 @@ const execute = async (
40
42
  amountCents: row['amountCents'] as number,
41
43
  tenantId: row['tenantId'] as string,
42
44
  }
43
- }
45
+ })
44
46
 
45
47
  export default execute
@@ -12,17 +12,17 @@
12
12
  "dependencies": {
13
13
  "@effect/platform": "^0.97.0",
14
14
  "@effect/rpc": "^0.76.0",
15
- "@voltro/cli": "0.24.0",
16
- "@voltro/database": "0.24.0",
17
- "@voltro/env": "0.24.0",
18
- "@voltro/plugin-multitenancy": "0.24.0",
19
- "@voltro/protocol": "0.24.0",
20
- "@voltro/runtime": "0.24.0",
21
- "@voltro/workflow": "0.24.0",
15
+ "@voltro/cli": "0.26.0",
16
+ "@voltro/database": "0.26.0",
17
+ "@voltro/env": "0.26.0",
18
+ "@voltro/plugin-multitenancy": "0.26.0",
19
+ "@voltro/protocol": "0.26.0",
20
+ "@voltro/runtime": "0.26.0",
21
+ "@voltro/workflow": "0.26.0",
22
22
  "effect": "^3.22.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@voltro/testing": "0.24.0",
25
+ "@voltro/testing": "0.26.0",
26
26
  "typescript": "^6.0.3",
27
27
  "vitest": "^4.1.10"
28
28
  }
@@ -1,9 +1,10 @@
1
1
  // Event → workflow trigger. Auto-discovered (`*.trigger.tsx`); no
2
2
  // app.config wiring needed.
3
3
  //
4
- // When any handler emits `order.placed` (the `orders.place` mutation
5
- // does, post-commit), this trigger starts the `orders.fulfill`
6
- // workflow. The event payload IS the workflow payload here (both are
4
+ // When any handler publishes `order.placed` (the `orders.place` mutation does,
5
+ // on commit), this trigger starts the `orders.fulfill` workflow. It binds the
6
+ // DECLARED event rather than its name, so renaming the event moves this file
7
+ // with it instead of silently matching nothing. The event payload IS the workflow payload here (both are
7
8
  // `{ orderId, tenantId }`), so no `payload` mapper is needed — pass one
8
9
  // when the shapes differ.
9
10
  //
@@ -11,11 +12,12 @@
11
12
  // (crash + replay), the matching key short-circuits the second start.
12
13
 
13
14
  import { defineEventTrigger } from '@voltro/runtime'
15
+ import { orderPlaced } from '../events/orders.event'
14
16
 
15
17
  export default defineEventTrigger<
16
18
  { orderId: string; tenantId: string }
17
19
  >({
18
- event: 'order.placed',
20
+ on: orderPlaced,
19
21
  workflow: 'orders.fulfill',
20
22
  idempotencyKey: (event) => `order.placed:${event.data.orderId}`,
21
23
  })
@@ -13,18 +13,18 @@
13
13
  "dependencies": {
14
14
  "@effect/platform": "^0.97.0",
15
15
  "@effect/rpc": "^0.76.0",
16
- "@voltro/cli": "0.24.0",
17
- "@voltro/database": "0.24.0",
18
- "@voltro/env": "0.24.0",
19
- "@voltro/plugin-flags": "0.24.0",
20
- "@voltro/plugin-multitenancy": "0.24.0",
21
- "@voltro/protocol": "0.24.0",
22
- "@voltro/runtime": "0.24.0",
23
- "@voltro/sql-postgres": "0.24.0",
16
+ "@voltro/cli": "0.26.0",
17
+ "@voltro/database": "0.26.0",
18
+ "@voltro/env": "0.26.0",
19
+ "@voltro/plugin-flags": "0.26.0",
20
+ "@voltro/plugin-multitenancy": "0.26.0",
21
+ "@voltro/protocol": "0.26.0",
22
+ "@voltro/runtime": "0.26.0",
23
+ "@voltro/sql-postgres": "0.26.0",
24
24
  "effect": "^3.22.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@voltro/testing": "0.24.0",
27
+ "@voltro/testing": "0.26.0",
28
28
  "typescript": "^6.0.3",
29
29
  "vitest": "^4.1.10"
30
30
  }
@@ -13,17 +13,17 @@
13
13
  "dependencies": {
14
14
  "@effect/platform": "^0.97.0",
15
15
  "@effect/rpc": "^0.76.0",
16
- "@voltro/cli": "0.24.0",
17
- "@voltro/database": "0.24.0",
18
- "@voltro/env": "0.24.0",
19
- "@voltro/plugin-audit": "0.24.0",
20
- "@voltro/plugin-governance": "0.24.0",
21
- "@voltro/protocol": "0.24.0",
22
- "@voltro/runtime": "0.24.0",
16
+ "@voltro/cli": "0.26.0",
17
+ "@voltro/database": "0.26.0",
18
+ "@voltro/env": "0.26.0",
19
+ "@voltro/plugin-audit": "0.26.0",
20
+ "@voltro/plugin-governance": "0.26.0",
21
+ "@voltro/protocol": "0.26.0",
22
+ "@voltro/runtime": "0.26.0",
23
23
  "effect": "^3.22.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@voltro/testing": "0.24.0",
26
+ "@voltro/testing": "0.26.0",
27
27
  "typescript": "^6.0.3",
28
28
  "vitest": "^4.1.10"
29
29
  }
@@ -12,17 +12,17 @@
12
12
  "dependencies": {
13
13
  "@effect/platform": "^0.97.0",
14
14
  "@effect/rpc": "^0.76.0",
15
- "@voltro/cli": "0.24.0",
16
- "@voltro/database": "0.24.0",
17
- "@voltro/env": "0.24.0",
18
- "@voltro/kv": "0.24.0",
19
- "@voltro/plugin-multitenancy": "0.24.0",
20
- "@voltro/protocol": "0.24.0",
21
- "@voltro/runtime": "0.24.0",
15
+ "@voltro/cli": "0.26.0",
16
+ "@voltro/database": "0.26.0",
17
+ "@voltro/env": "0.26.0",
18
+ "@voltro/kv": "0.26.0",
19
+ "@voltro/plugin-multitenancy": "0.26.0",
20
+ "@voltro/protocol": "0.26.0",
21
+ "@voltro/runtime": "0.26.0",
22
22
  "effect": "^3.22.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@voltro/testing": "0.24.0",
25
+ "@voltro/testing": "0.26.0",
26
26
  "typescript": "^6.0.3",
27
27
  "vitest": "^4.1.10"
28
28
  }
@@ -13,17 +13,17 @@
13
13
  "dependencies": {
14
14
  "@effect/platform": "^0.97.0",
15
15
  "@effect/rpc": "^0.76.0",
16
- "@voltro/cli": "0.24.0",
17
- "@voltro/database": "0.24.0",
18
- "@voltro/env": "0.24.0",
19
- "@voltro/plugin-moderation": "0.24.0",
20
- "@voltro/plugin-multitenancy": "0.24.0",
21
- "@voltro/protocol": "0.24.0",
22
- "@voltro/runtime": "0.24.0",
16
+ "@voltro/cli": "0.26.0",
17
+ "@voltro/database": "0.26.0",
18
+ "@voltro/env": "0.26.0",
19
+ "@voltro/plugin-moderation": "0.26.0",
20
+ "@voltro/plugin-multitenancy": "0.26.0",
21
+ "@voltro/protocol": "0.26.0",
22
+ "@voltro/runtime": "0.26.0",
23
23
  "effect": "^3.22.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@voltro/testing": "0.24.0",
26
+ "@voltro/testing": "0.26.0",
27
27
  "typescript": "^6.0.3",
28
28
  "vitest": "^4.1.10"
29
29
  }
@@ -13,17 +13,17 @@
13
13
  "dependencies": {
14
14
  "@effect/platform": "^0.97.0",
15
15
  "@effect/rpc": "^0.76.0",
16
- "@voltro/cli": "0.24.0",
17
- "@voltro/database": "0.24.0",
18
- "@voltro/plugin-multitenancy": "0.24.0",
19
- "@voltro/plugin-prometheus": "0.24.0",
20
- "@voltro/plugin-sentry": "0.24.0",
21
- "@voltro/protocol": "0.24.0",
22
- "@voltro/runtime": "0.24.0",
16
+ "@voltro/cli": "0.26.0",
17
+ "@voltro/database": "0.26.0",
18
+ "@voltro/plugin-multitenancy": "0.26.0",
19
+ "@voltro/plugin-prometheus": "0.26.0",
20
+ "@voltro/plugin-sentry": "0.26.0",
21
+ "@voltro/protocol": "0.26.0",
22
+ "@voltro/runtime": "0.26.0",
23
23
  "effect": "^3.22.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@voltro/testing": "0.24.0",
26
+ "@voltro/testing": "0.26.0",
27
27
  "typescript": "^6.0.3",
28
28
  "vitest": "^4.1.10"
29
29
  }
@@ -13,17 +13,17 @@
13
13
  "dependencies": {
14
14
  "@effect/platform": "^0.97.0",
15
15
  "@effect/rpc": "^0.76.0",
16
- "@voltro/cli": "0.24.0",
17
- "@voltro/database": "0.24.0",
18
- "@voltro/env": "0.24.0",
19
- "@voltro/plugin-multitenancy": "0.24.0",
20
- "@voltro/plugin-ratelimit": "0.24.0",
21
- "@voltro/protocol": "0.24.0",
22
- "@voltro/runtime": "0.24.0",
16
+ "@voltro/cli": "0.26.0",
17
+ "@voltro/database": "0.26.0",
18
+ "@voltro/env": "0.26.0",
19
+ "@voltro/plugin-multitenancy": "0.26.0",
20
+ "@voltro/plugin-ratelimit": "0.26.0",
21
+ "@voltro/protocol": "0.26.0",
22
+ "@voltro/runtime": "0.26.0",
23
23
  "effect": "^3.22.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@voltro/testing": "0.24.0",
26
+ "@voltro/testing": "0.26.0",
27
27
  "typescript": "^6.0.3",
28
28
  "vitest": "^4.1.10"
29
29
  }
@@ -13,17 +13,17 @@
13
13
  "dependencies": {
14
14
  "@effect/platform": "^0.97.0",
15
15
  "@effect/rpc": "^0.76.0",
16
- "@voltro/cli": "0.24.0",
17
- "@voltro/database": "0.24.0",
18
- "@voltro/env": "0.24.0",
19
- "@voltro/plugin-multitenancy": "0.24.0",
20
- "@voltro/plugin-rbac": "0.24.0",
21
- "@voltro/protocol": "0.24.0",
22
- "@voltro/runtime": "0.24.0",
16
+ "@voltro/cli": "0.26.0",
17
+ "@voltro/database": "0.26.0",
18
+ "@voltro/env": "0.26.0",
19
+ "@voltro/plugin-multitenancy": "0.26.0",
20
+ "@voltro/plugin-rbac": "0.26.0",
21
+ "@voltro/protocol": "0.26.0",
22
+ "@voltro/runtime": "0.26.0",
23
23
  "effect": "^3.22.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@voltro/testing": "0.24.0",
26
+ "@voltro/testing": "0.26.0",
27
27
  "typescript": "^6.0.3",
28
28
  "vitest": "^4.1.10"
29
29
  }
@@ -13,16 +13,16 @@
13
13
  "dependencies": {
14
14
  "@effect/platform": "^0.97.0",
15
15
  "@effect/rpc": "^0.76.0",
16
- "@voltro/cli": "0.24.0",
17
- "@voltro/database": "0.24.0",
18
- "@voltro/plugin-openapi": "0.24.0",
19
- "@voltro/protocol": "0.24.0",
20
- "@voltro/runtime": "0.24.0",
21
- "@voltro/sql-postgres": "0.24.0",
16
+ "@voltro/cli": "0.26.0",
17
+ "@voltro/database": "0.26.0",
18
+ "@voltro/plugin-openapi": "0.26.0",
19
+ "@voltro/protocol": "0.26.0",
20
+ "@voltro/runtime": "0.26.0",
21
+ "@voltro/sql-postgres": "0.26.0",
22
22
  "effect": "^3.22.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@voltro/testing": "0.24.0",
25
+ "@voltro/testing": "0.26.0",
26
26
  "typescript": "^6.0.3",
27
27
  "vitest": "^4.1.10"
28
28
  }
@@ -13,20 +13,20 @@
13
13
  "dependencies": {
14
14
  "@effect/platform": "^0.97.0",
15
15
  "@effect/rpc": "^0.76.0",
16
- "@voltro/cli": "0.24.0",
17
- "@voltro/database": "0.24.0",
18
- "@voltro/plugin-analytics-postgres": "0.24.0",
19
- "@voltro/plugin-billing": "0.24.0",
20
- "@voltro/plugin-multitenancy": "0.24.0",
21
- "@voltro/plugin-notifications": "0.24.0",
22
- "@voltro/plugin-presence": "0.24.0",
23
- "@voltro/protocol": "0.24.0",
24
- "@voltro/runtime": "0.24.0",
25
- "@voltro/sql-postgres": "0.24.0",
16
+ "@voltro/cli": "0.26.0",
17
+ "@voltro/database": "0.26.0",
18
+ "@voltro/plugin-analytics-postgres": "0.26.0",
19
+ "@voltro/plugin-billing": "0.26.0",
20
+ "@voltro/plugin-multitenancy": "0.26.0",
21
+ "@voltro/plugin-notifications": "0.26.0",
22
+ "@voltro/plugin-presence": "0.26.0",
23
+ "@voltro/protocol": "0.26.0",
24
+ "@voltro/runtime": "0.26.0",
25
+ "@voltro/sql-postgres": "0.26.0",
26
26
  "effect": "^3.22.0"
27
27
  },
28
28
  "devDependencies": {
29
- "@voltro/testing": "0.24.0",
29
+ "@voltro/testing": "0.26.0",
30
30
  "typescript": "^6.0.3",
31
31
  "vitest": "^4.1.10"
32
32
  }
@@ -13,17 +13,17 @@
13
13
  "dependencies": {
14
14
  "@effect/platform": "^0.97.0",
15
15
  "@effect/rpc": "^0.76.0",
16
- "@voltro/cli": "0.24.0",
17
- "@voltro/database": "0.24.0",
18
- "@voltro/env": "0.24.0",
19
- "@voltro/plugin-multitenancy": "0.24.0",
20
- "@voltro/plugin-search": "0.24.0",
21
- "@voltro/protocol": "0.24.0",
22
- "@voltro/runtime": "0.24.0",
16
+ "@voltro/cli": "0.26.0",
17
+ "@voltro/database": "0.26.0",
18
+ "@voltro/env": "0.26.0",
19
+ "@voltro/plugin-multitenancy": "0.26.0",
20
+ "@voltro/plugin-search": "0.26.0",
21
+ "@voltro/protocol": "0.26.0",
22
+ "@voltro/runtime": "0.26.0",
23
23
  "effect": "^3.22.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@voltro/testing": "0.24.0",
26
+ "@voltro/testing": "0.26.0",
27
27
  "typescript": "^6.0.3",
28
28
  "vitest": "^4.1.10"
29
29
  }
@@ -13,17 +13,17 @@
13
13
  "dependencies": {
14
14
  "@effect/platform": "^0.97.0",
15
15
  "@effect/rpc": "^0.76.0",
16
- "@voltro/cli": "0.24.0",
17
- "@voltro/database": "0.24.0",
18
- "@voltro/env": "0.24.0",
19
- "@voltro/plugin-multitenancy": "0.24.0",
20
- "@voltro/plugin-versioning": "0.24.0",
21
- "@voltro/protocol": "0.24.0",
22
- "@voltro/runtime": "0.24.0",
16
+ "@voltro/cli": "0.26.0",
17
+ "@voltro/database": "0.26.0",
18
+ "@voltro/env": "0.26.0",
19
+ "@voltro/plugin-multitenancy": "0.26.0",
20
+ "@voltro/plugin-versioning": "0.26.0",
21
+ "@voltro/protocol": "0.26.0",
22
+ "@voltro/runtime": "0.26.0",
23
23
  "effect": "^3.22.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@voltro/testing": "0.24.0",
26
+ "@voltro/testing": "0.26.0",
27
27
  "typescript": "^6.0.3",
28
28
  "vitest": "^4.1.10"
29
29
  }
@@ -15,7 +15,7 @@ apps/acme/api/
15
15
  ├── .env # VOLTRO_WEBHOOK_SECRET_ORDERS (dev signing secret)
16
16
  ├── database/schema.ts # orders + webhookTables() bookkeeping
17
17
  ├── webhooks/orders.webhook.tsx # INCOMING — signature-verified receiver
18
- ├── events/order.completed.webhook.tsx # OUTGOING — defineOutgoingEvent
18
+ ├── events/orders.event.ts # OUTGOING — defineEvent + webhook:
19
19
  ├── mutations/orders.fulfill.mutation.ts # create order + emit (+ .server.ts)
20
20
  └── queries/orders.list.query.ts # reactive list (+ .server.ts)
21
21
  ```
@@ -68,7 +68,7 @@ curl -s -o /dev/null -w '%{http_code}\n' -X POST http://localhost:4000/webhooks/
68
68
 
69
69
  ```ts
70
70
  // events/order.completed.webhook.tsx
71
- export default defineOutgoingEvent({ id: 'order.completed', payload: Schema.Struct({ … }), version: 1 })
71
+ export const orderCompleted = defineEvent({ name: 'order.completed', key: Schema.Struct({}), payload: Schema.Struct({ … }), webhook: { version: 1 } })
72
72
 
73
73
  // mutations/orders.fulfill.mutation.server.ts — after the row commits:
74
74
  const { eventId, deliveries } = await useWebhooks(ctx).emit('order.completed', { orderId, tenantId, … })
@@ -0,0 +1,35 @@
1
+ // OUTGOING event — an event THIS app emits, declared ONCE and reaching every
2
+ // audience that wants it.
3
+ //
4
+ // External systems subscribe at runtime via
5
+ // `ctx.webhooks.subscribe({ event: 'order.completed', url })`; each subscriber
6
+ // is a row in `_voltro_webhook_targets`. A publish fans out to every matching
7
+ // target through a DURABLE delivery workflow — HMAC-signing the outbound
8
+ // request, retrying with backoff, honouring Retry-After — and each attempt is
9
+ // recorded in `_voltro_webhook_deliveries`.
10
+ //
11
+ // The `webhook:` block is what opts it into that. Without it this is an ordinary
12
+ // declared event: connected clients and workflow triggers, no HTTP delivery.
13
+ //
14
+ // `key: Schema.Struct({})` is correct rather than a placeholder — a webhook
15
+ // event is delivered to subscribed TARGETS, so there is nothing for a routing
16
+ // key to address. Add one only if you also want browser clients to subscribe
17
+ // per-something with `useEvent`.
18
+
19
+ import { defineEvent } from '@voltro/protocol'
20
+ import { Schema } from 'effect'
21
+
22
+ export const orderCompleted = defineEvent({
23
+ name: 'order.completed',
24
+ key: Schema.Struct({}),
25
+ payload: Schema.Struct({
26
+ orderId: Schema.String,
27
+ tenantId: Schema.String,
28
+ sku: Schema.String,
29
+ totalCents: Schema.Number,
30
+ }),
31
+ webhook: {
32
+ description: 'An order moved to "fulfilled" — payment captured, items shipped.',
33
+ version: 1,
34
+ },
35
+ })
@@ -13,18 +13,18 @@
13
13
  "dependencies": {
14
14
  "@effect/platform": "^0.97.0",
15
15
  "@effect/rpc": "^0.76.0",
16
- "@voltro/cli": "0.24.0",
17
- "@voltro/database": "0.24.0",
18
- "@voltro/env": "0.24.0",
19
- "@voltro/plugin-multitenancy": "0.24.0",
20
- "@voltro/plugin-webhooks": "0.24.0",
21
- "@voltro/protocol": "0.24.0",
22
- "@voltro/runtime": "0.24.0",
23
- "@voltro/sql-postgres": "0.24.0",
16
+ "@voltro/cli": "0.26.0",
17
+ "@voltro/database": "0.26.0",
18
+ "@voltro/env": "0.26.0",
19
+ "@voltro/plugin-multitenancy": "0.26.0",
20
+ "@voltro/plugin-webhooks": "0.26.0",
21
+ "@voltro/protocol": "0.26.0",
22
+ "@voltro/runtime": "0.26.0",
23
+ "@voltro/sql-postgres": "0.26.0",
24
24
  "effect": "^3.22.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@voltro/testing": "0.24.0",
27
+ "@voltro/testing": "0.26.0",
28
28
  "typescript": "^6.0.3",
29
29
  "vitest": "^4.1.10"
30
30
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "api-webhooks",
3
3
  "kind": "api",
4
- "summary": "First-class webhooks both ways: a signature-verified INCOMING receiver (*.webhook.tsx, genericProvider HMAC) that rejects unsigned/forged requests before your handler runs, plus an OUTGOING defineOutgoingEvent a mutation emits to subscribed targets via a durable delivery workflow.",
4
+ "summary": "First-class webhooks both ways: a signature-verified INCOMING receiver (*.webhook.tsx, genericProvider HMAC) that rejects unsigned/forged requests before your handler runs, plus an OUTGOING event declared with defineEvent({ …, webhook }) that a mutation publishes to subscribed targets via a durable delivery workflow.",
5
5
  "tags": ["api", "webhooks", "integrations", "hmac", "signature", "stripe", "events"]
6
6
  }
@@ -12,12 +12,12 @@
12
12
  "test": "voltro test"
13
13
  },
14
14
  "dependencies": {
15
- "@voltro/changelog": "0.24.0",
16
- "@voltro/cli": "0.24.0",
17
- "@voltro/client": "0.24.0",
18
- "@voltro/env": "0.24.0",
19
- "@voltro/i18n": "0.24.0",
20
- "@voltro/web": "0.24.0",
15
+ "@voltro/changelog": "0.26.0",
16
+ "@voltro/cli": "0.26.0",
17
+ "@voltro/client": "0.26.0",
18
+ "@voltro/env": "0.26.0",
19
+ "@voltro/i18n": "0.26.0",
20
+ "@voltro/web": "0.26.0",
21
21
  "react": "^19.0.0",
22
22
  "react-dom": "^19.0.0"
23
23
  },
@@ -12,8 +12,8 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@effect/platform": "^0.97.0",
15
- "@voltro/cli": "0.24.0",
16
- "@voltro/serverless": "0.24.0",
15
+ "@voltro/cli": "0.26.0",
16
+ "@voltro/serverless": "0.26.0",
17
17
  "effect": "^3.22.0"
18
18
  },
19
19
  "devDependencies": {
@@ -12,18 +12,18 @@
12
12
  "test": "voltro test"
13
13
  },
14
14
  "dependencies": {
15
- "@{{projectName}}/api": "0.24.0",
16
- "@voltro/cli": "0.24.0",
17
- "@voltro/client": "0.24.0",
18
- "@voltro/env": "0.24.0",
19
- "@voltro/i18n": "0.24.0",
20
- "@voltro/ui-shadcn": "0.24.0",
21
- "@voltro/web": "0.24.0",
15
+ "@{{projectName}}/api": "0.26.0",
16
+ "@voltro/cli": "0.26.0",
17
+ "@voltro/client": "0.26.0",
18
+ "@voltro/env": "0.26.0",
19
+ "@voltro/i18n": "0.26.0",
20
+ "@voltro/ui-shadcn": "0.26.0",
21
+ "@voltro/web": "0.26.0",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@voltro/devtools": "0.24.0",
26
+ "@voltro/devtools": "0.26.0",
27
27
  "@types/react": "^19.0.0",
28
28
  "@types/react-dom": "^19.0.0",
29
29
  "typescript": "^6.0.3",
@@ -12,18 +12,18 @@
12
12
  "typecheck": "tsc --noEmit"
13
13
  },
14
14
  "dependencies": {
15
- "@{{projectName}}/api": "0.24.0",
16
- "@voltro/cli": "0.24.0",
17
- "@voltro/client": "0.24.0",
18
- "@voltro/env": "0.24.0",
19
- "@voltro/i18n": "0.24.0",
20
- "@voltro/ui-shadcn": "0.24.0",
21
- "@voltro/web": "0.24.0",
15
+ "@{{projectName}}/api": "0.26.0",
16
+ "@voltro/cli": "0.26.0",
17
+ "@voltro/client": "0.26.0",
18
+ "@voltro/env": "0.26.0",
19
+ "@voltro/i18n": "0.26.0",
20
+ "@voltro/ui-shadcn": "0.26.0",
21
+ "@voltro/web": "0.26.0",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@voltro/devtools": "0.24.0",
26
+ "@voltro/devtools": "0.26.0",
27
27
  "@types/react": "^19.0.0",
28
28
  "@types/react-dom": "^19.0.0",
29
29
  "typescript": "^6.0.3",
@@ -12,17 +12,17 @@
12
12
  "typecheck": "tsc --noEmit"
13
13
  },
14
14
  "dependencies": {
15
- "@voltro/cli": "0.24.0",
16
- "@voltro/client": "0.24.0",
17
- "@voltro/env": "0.24.0",
18
- "@voltro/i18n": "0.24.0",
19
- "@voltro/ui-shadcn": "0.24.0",
20
- "@voltro/web": "0.24.0",
15
+ "@voltro/cli": "0.26.0",
16
+ "@voltro/client": "0.26.0",
17
+ "@voltro/env": "0.26.0",
18
+ "@voltro/i18n": "0.26.0",
19
+ "@voltro/ui-shadcn": "0.26.0",
20
+ "@voltro/web": "0.26.0",
21
21
  "react": "^19.0.0",
22
22
  "react-dom": "^19.0.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@voltro/devtools": "0.24.0",
25
+ "@voltro/devtools": "0.26.0",
26
26
  "@types/react": "^19.0.0",
27
27
  "@types/react-dom": "^19.0.0",
28
28
  "typescript": "^6.0.3",