@objectstack/plugin-webhooks 7.3.0 → 7.4.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.
- package/.turbo/turbo-build.log +30 -26
- package/CHANGELOG.md +105 -0
- package/dist/chunk-7HS5DLU2.js +319 -0
- package/dist/chunk-7HS5DLU2.js.map +1 -0
- package/dist/{chunk-FA66GQEO.cjs → chunk-HF7CCDPB.cjs} +3 -3
- package/dist/{chunk-FA66GQEO.cjs.map → chunk-HF7CCDPB.cjs.map} +1 -1
- package/dist/{chunk-BS2QTZH3.js → chunk-KNGLLSSP.js} +2 -2
- package/dist/{chunk-MJZGD37S.cjs → chunk-TDSI7UHY.cjs} +138 -3
- package/dist/chunk-TDSI7UHY.cjs.map +1 -0
- package/dist/index.cjs +43 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +33 -4
- package/dist/index.js.map +1 -1
- package/dist/schema.cjs +4 -2
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.d.cts +3002 -137
- package/dist/schema.d.ts +3002 -137
- package/dist/schema.js +3 -1
- package/dist/sql-outbox.cjs +3 -3
- package/dist/sql-outbox.js +2 -2
- package/dist/translations-AV47AVPV.js +727 -0
- package/dist/translations-AV47AVPV.js.map +1 -0
- package/dist/translations-OAKKANSP.cjs +727 -0
- package/dist/translations-OAKKANSP.cjs.map +1 -0
- package/package.json +6 -6
- package/scripts/i18n-extract.config.ts +32 -0
- package/src/schema.ts +7 -3
- package/src/sys-webhook.object.ts +177 -0
- package/src/translations/en.objects.generated.ts +187 -0
- package/src/translations/es-ES.objects.generated.ts +187 -0
- package/src/translations/index.ts +23 -0
- package/src/translations/ja-JP.objects.generated.ts +187 -0
- package/src/translations/zh-CN.objects.generated.ts +187 -0
- package/src/webhook-outbox-plugin.ts +38 -7
- package/dist/chunk-33LYZT7O.js +0 -184
- package/dist/chunk-33LYZT7O.js.map +0 -1
- package/dist/chunk-MJZGD37S.cjs.map +0 -1
- /package/dist/{chunk-BS2QTZH3.js.map → chunk-KNGLLSSP.js.map} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @objectstack/plugin-webhooks@7.
|
|
2
|
+
> @objectstack/plugin-webhooks@7.4.0 build /home/runner/work/framework/framework/packages/plugins/plugin-webhooks
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts, src/schema.ts, src/sql-outbox.ts
|
|
@@ -10,35 +10,39 @@
|
|
|
10
10
|
[34mCLI[39m Cleaning output folder
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
[34mCJS[39m Build start
|
|
13
|
-
[32mESM[39m [1mdist/index.js
|
|
14
|
-
[32mESM[39m [1mdist/schema.js
|
|
15
|
-
[32mESM[39m [1mdist/sql-outbox.js
|
|
16
|
-
[32mESM[39m [1mdist/chunk-
|
|
17
|
-
[32mESM[39m [1mdist/chunk-
|
|
18
|
-
[32mESM[39m [1mdist/
|
|
19
|
-
[32mESM[39m [1mdist/
|
|
20
|
-
[32mESM[39m [1mdist/
|
|
21
|
-
[32mESM[39m [1mdist/
|
|
22
|
-
[32mESM[39m [1mdist/chunk-
|
|
23
|
-
[32mESM[39m
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
[32mCJS[39m [1mdist/
|
|
27
|
-
[32mCJS[39m [1mdist/
|
|
28
|
-
[32mCJS[39m [1mdist/
|
|
29
|
-
[32mCJS[39m [1mdist/
|
|
30
|
-
[32mCJS[39m [1mdist/
|
|
31
|
-
[32mCJS[39m [1mdist/
|
|
32
|
-
[32mCJS[39m [1mdist/
|
|
33
|
-
[32mCJS[39m [1mdist/
|
|
34
|
-
[32mCJS[39m
|
|
13
|
+
[32mESM[39m [1mdist/index.js [22m[32m29.28 KB[39m
|
|
14
|
+
[32mESM[39m [1mdist/schema.js [22m[32m203.00 B[39m
|
|
15
|
+
[32mESM[39m [1mdist/sql-outbox.js [22m[32m157.00 B[39m
|
|
16
|
+
[32mESM[39m [1mdist/chunk-KNGLLSSP.js [22m[32m6.92 KB[39m
|
|
17
|
+
[32mESM[39m [1mdist/chunk-7HS5DLU2.js [22m[32m11.84 KB[39m
|
|
18
|
+
[32mESM[39m [1mdist/translations-AV47AVPV.js [22m[32m19.41 KB[39m
|
|
19
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m75.63 KB[39m
|
|
20
|
+
[32mESM[39m [1mdist/schema.js.map [22m[32m71.00 B[39m
|
|
21
|
+
[32mESM[39m [1mdist/sql-outbox.js.map [22m[32m71.00 B[39m
|
|
22
|
+
[32mESM[39m [1mdist/chunk-KNGLLSSP.js.map [22m[32m24.11 KB[39m
|
|
23
|
+
[32mESM[39m [1mdist/chunk-7HS5DLU2.js.map [22m[32m23.16 KB[39m
|
|
24
|
+
[32mESM[39m [1mdist/translations-AV47AVPV.js.map [22m[32m30.54 KB[39m
|
|
25
|
+
[32mESM[39m ⚡️ Build success in 1000ms
|
|
26
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m35.43 KB[39m
|
|
27
|
+
[32mCJS[39m [1mdist/schema.cjs [22m[32m362.00 B[39m
|
|
28
|
+
[32mCJS[39m [1mdist/sql-outbox.cjs [22m[32m269.00 B[39m
|
|
29
|
+
[32mCJS[39m [1mdist/chunk-HF7CCDPB.cjs [22m[32m8.30 KB[39m
|
|
30
|
+
[32mCJS[39m [1mdist/chunk-TDSI7UHY.cjs [22m[32m12.07 KB[39m
|
|
31
|
+
[32mCJS[39m [1mdist/translations-OAKKANSP.cjs [22m[32m19.50 KB[39m
|
|
32
|
+
[32mCJS[39m [1mdist/index.cjs.map [22m[32m68.17 KB[39m
|
|
33
|
+
[32mCJS[39m [1mdist/schema.cjs.map [22m[32m298.00 B[39m
|
|
34
|
+
[32mCJS[39m [1mdist/sql-outbox.cjs.map [22m[32m299.00 B[39m
|
|
35
|
+
[32mCJS[39m [1mdist/chunk-HF7CCDPB.cjs.map [22m[32m27.71 KB[39m
|
|
36
|
+
[32mCJS[39m [1mdist/chunk-TDSI7UHY.cjs.map [22m[32m27.46 KB[39m
|
|
37
|
+
[32mCJS[39m [1mdist/translations-OAKKANSP.cjs.map [22m[32m34.65 KB[39m
|
|
38
|
+
[32mCJS[39m ⚡️ Build success in 1291ms
|
|
35
39
|
[34mDTS[39m Build start
|
|
36
|
-
[32mDTS[39m ⚡️ Build success in
|
|
40
|
+
[32mDTS[39m ⚡️ Build success in 26572ms
|
|
37
41
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m17.49 KB[39m
|
|
38
|
-
[32mDTS[39m [1mdist/schema.d.ts [22m[
|
|
42
|
+
[32mDTS[39m [1mdist/schema.d.ts [22m[32m339.13 KB[39m
|
|
39
43
|
[32mDTS[39m [1mdist/sql-outbox.d.ts [22m[32m2.44 KB[39m
|
|
40
44
|
[32mDTS[39m [1mdist/outbox-CIn7LSyB.d.ts [22m[32m5.82 KB[39m
|
|
41
45
|
[32mDTS[39m [1mdist/index.d.cts [22m[32m17.49 KB[39m
|
|
42
|
-
[32mDTS[39m [1mdist/schema.d.cts [22m[
|
|
46
|
+
[32mDTS[39m [1mdist/schema.d.cts [22m[32m339.13 KB[39m
|
|
43
47
|
[32mDTS[39m [1mdist/sql-outbox.d.cts [22m[32m2.45 KB[39m
|
|
44
48
|
[32mDTS[39m [1mdist/outbox-CIn7LSyB.d.cts [22m[32m5.82 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,110 @@
|
|
|
1
1
|
# @objectstack/plugin-webhooks
|
|
2
2
|
|
|
3
|
+
## 7.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c72daad: ADR-0029 D7 — Setup app navigation contributions.
|
|
8
|
+
|
|
9
|
+
Adds the UI-layer analog of object `own`/`extend`: a package can contribute
|
|
10
|
+
navigation items into an app it does not own, so a shared admin app can be a
|
|
11
|
+
thin shell while each capability plugin ships the menu for the objects it owns.
|
|
12
|
+
|
|
13
|
+
- **`@objectstack/spec`** — new `NavigationContributionSchema` (`{ app, group?,
|
|
14
|
+
priority, items }`) and an optional `navigationContributions` field on the
|
|
15
|
+
manifest.
|
|
16
|
+
- **`@objectstack/objectql`** — `SchemaRegistry.registerAppNavContribution()`
|
|
17
|
+
plus lazy merge in `getApp` / `getAllApps` (by target group id + priority,
|
|
18
|
+
cloning so the stored app is never mutated); the engine wires
|
|
19
|
+
`manifest.navigationContributions` during app registration.
|
|
20
|
+
- **`@objectstack/platform-objects`** — the Setup app becomes a **shell** of
|
|
21
|
+
empty group anchors; its entries for platform-objects-owned objects move to
|
|
22
|
+
`SETUP_NAV_CONTRIBUTIONS`.
|
|
23
|
+
- **`@objectstack/plugin-auth`** — registers `SETUP_NAV_CONTRIBUTIONS` alongside
|
|
24
|
+
the Setup app it already registers.
|
|
25
|
+
- **`@objectstack/plugin-webhooks`** — contributes its `Webhooks` /
|
|
26
|
+
`Webhook Deliveries` entries into the Setup `group_integrations` slot (it owns
|
|
27
|
+
`sys_webhook` / `sys_webhook_delivery` per K2.a), demonstrating end-to-end
|
|
28
|
+
cross-plugin contribution.
|
|
29
|
+
|
|
30
|
+
The rendered Setup nav is identical to the former static artifact — just
|
|
31
|
+
assembled from its owners. A disabled/absent capability contributes nothing and
|
|
32
|
+
its slot stays empty (in addition to the existing `requiresObject` gating).
|
|
33
|
+
This unblocks moving each remaining K2 domain's menu out of the monolith with
|
|
34
|
+
its objects.
|
|
35
|
+
|
|
36
|
+
- eea3f1b: ADR-0029 K0 + K2.a — single-owner invariant and webhooks ownership pilot.
|
|
37
|
+
|
|
38
|
+
**K0 (`@objectstack/objectql`)** — add `SchemaRegistry.assertSingleOwnerPerObject()`,
|
|
39
|
+
the install-time backstop for the kernel-decomposition invariant: every
|
|
40
|
+
registered object must resolve to exactly one `own` contributor. A second
|
|
41
|
+
cross-package owner is already rejected at registration time; this additionally
|
|
42
|
+
catches "extend with no owner" (which would otherwise resolve to nothing). Call
|
|
43
|
+
after kernel bootstrap completes.
|
|
44
|
+
|
|
45
|
+
**K2.a (`@objectstack/plugin-webhooks` ← `@objectstack/platform-objects`)** — move
|
|
46
|
+
the `sys_webhook` object definition out of the `platform-objects` monolith into
|
|
47
|
+
`@objectstack/plugin-webhooks`, where it joins its sibling `sys_webhook_delivery`
|
|
48
|
+
so the plugin owns both its data model and behavior as one unit. `sys_webhook` is
|
|
49
|
+
no longer exported from `@objectstack/platform-objects` (or its `/integration`
|
|
50
|
+
subpath, now an empty barrel); import it from `@objectstack/plugin-webhooks/schema`
|
|
51
|
+
instead. Runtime behavior is unchanged — the webhook plugin already registered
|
|
52
|
+
`sys_webhook` at runtime; only the definition's home moved. Setup-app navigation
|
|
53
|
+
(which references `sys_webhook` by name) and existing i18n bundles (object-name
|
|
54
|
+
keyed) continue to work. Per ADR-0029 D8, migrating the object's i18n extraction
|
|
55
|
+
into the plugin is a tracked follow-up before the next translation regeneration.
|
|
56
|
+
|
|
57
|
+
### Patch Changes
|
|
58
|
+
|
|
59
|
+
- 4404572: ADR-0029 D8 — migrate i18n ownership for the moved domains to their plugins.
|
|
60
|
+
|
|
61
|
+
The object translations for the domains decomposed in K2.a/K2.b/K2 previously
|
|
62
|
+
lived in the `@objectstack/platform-objects` generated bundles even though the
|
|
63
|
+
objects now live in their capability plugins. This moves each domain's i18n
|
|
64
|
+
extraction + bundles to the owning plugin, preserving every hand-translated
|
|
65
|
+
string (zh-CN / ja-JP / es-ES):
|
|
66
|
+
|
|
67
|
+
- Each plugin gains a build-time `scripts/i18n-extract.config.ts` and a
|
|
68
|
+
`src/translations/` bundle (`{locale}.objects.generated.ts` + an `index.ts`
|
|
69
|
+
barrel), generated with `os i18n extract` and self-baselined so re-runs
|
|
70
|
+
preserve translations.
|
|
71
|
+
- Each plugin loads its bundle at runtime on `kernel:ready` via
|
|
72
|
+
`i18n.loadTranslations` (the i18n service is optional — load is best-effort).
|
|
73
|
+
- `plugin-webhooks` ← `sys_webhook`, `sys_webhook_delivery`
|
|
74
|
+
- `plugin-approvals` ← `sys_approval_request`, `sys_approval_action`
|
|
75
|
+
- `plugin-security` ← `sys_role`, `sys_permission_set`,
|
|
76
|
+
`sys_user_permission_set`, `sys_role_permission_set`
|
|
77
|
+
- `plugin-sharing` ← `sys_record_share`, `sys_sharing_rule`, `sys_share_link`
|
|
78
|
+
- `@objectstack/platform-objects` translation bundles are regenerated to drop
|
|
79
|
+
those objects' keys (its extract config already excluded them); all other
|
|
80
|
+
objects' translations and the metadata-form bundles are preserved.
|
|
81
|
+
|
|
82
|
+
Net runtime effect is unchanged (same translations load, now contributed by the
|
|
83
|
+
package that owns each object) — closing the D8 follow-up tracked since K2.a.
|
|
84
|
+
|
|
85
|
+
- Updated dependencies [23c7107]
|
|
86
|
+
- Updated dependencies [c72daad]
|
|
87
|
+
- Updated dependencies [4404572]
|
|
88
|
+
- Updated dependencies [eea3f1b]
|
|
89
|
+
- Updated dependencies [e478e0c]
|
|
90
|
+
- Updated dependencies [4cc2ced]
|
|
91
|
+
- Updated dependencies [13632b1]
|
|
92
|
+
- Updated dependencies [f115182]
|
|
93
|
+
- Updated dependencies [2faf9f2]
|
|
94
|
+
- Updated dependencies [2faf9f2]
|
|
95
|
+
- Updated dependencies [2faf9f2]
|
|
96
|
+
- Updated dependencies [58b450b]
|
|
97
|
+
- Updated dependencies [82eb6cf]
|
|
98
|
+
- Updated dependencies [c381977]
|
|
99
|
+
- Updated dependencies [13d8653]
|
|
100
|
+
- Updated dependencies [ff3d006]
|
|
101
|
+
- Updated dependencies [5e831de]
|
|
102
|
+
- @objectstack/spec@7.4.0
|
|
103
|
+
- @objectstack/platform-objects@7.4.0
|
|
104
|
+
- @objectstack/core@7.4.0
|
|
105
|
+
- @objectstack/service-cluster@7.4.0
|
|
106
|
+
- @objectstack/types@7.4.0
|
|
107
|
+
|
|
3
108
|
## 7.3.0
|
|
4
109
|
|
|
5
110
|
### Patch Changes
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
// src/sys-webhook.object.ts
|
|
2
|
+
import { ObjectSchema, Field } from "@objectstack/spec/data";
|
|
3
|
+
var SysWebhook = ObjectSchema.create({
|
|
4
|
+
name: "sys_webhook",
|
|
5
|
+
label: "Webhook",
|
|
6
|
+
pluralLabel: "Webhooks",
|
|
7
|
+
icon: "webhook",
|
|
8
|
+
isSystem: true,
|
|
9
|
+
managedBy: "config",
|
|
10
|
+
// Authoring a webhook from the UI requires a structured form for the
|
|
11
|
+
// headers / auth / retry / payload blocks — the generic JSON textarea
|
|
12
|
+
// is acceptable as a v1 until a dedicated builder lands. Re-enable
|
|
13
|
+
// create/edit/delete so admins can at least toggle `active` and edit
|
|
14
|
+
// simple URL/method fields without round-tripping through code.
|
|
15
|
+
userActions: { create: true, edit: true, delete: true, import: false },
|
|
16
|
+
description: "Outbound HTTP webhook subscription. Authored via defineWebhook() in code or the Studio editor; executed by the HTTP connector plugin.",
|
|
17
|
+
displayNameField: "name",
|
|
18
|
+
titleFormat: "{label}",
|
|
19
|
+
compactLayout: ["name", "object_name", "url", "active", "updated_at"],
|
|
20
|
+
listViews: {
|
|
21
|
+
active: {
|
|
22
|
+
type: "grid",
|
|
23
|
+
name: "active",
|
|
24
|
+
label: "Active",
|
|
25
|
+
data: { provider: "object", object: "sys_webhook" },
|
|
26
|
+
columns: ["label", "object_name", "url", "method", "active", "updated_at"],
|
|
27
|
+
filter: [{ field: "active", operator: "equals", value: true }],
|
|
28
|
+
sort: [{ field: "label", order: "asc" }],
|
|
29
|
+
pagination: { pageSize: 50 }
|
|
30
|
+
},
|
|
31
|
+
inactive: {
|
|
32
|
+
type: "grid",
|
|
33
|
+
name: "inactive",
|
|
34
|
+
label: "Inactive",
|
|
35
|
+
data: { provider: "object", object: "sys_webhook" },
|
|
36
|
+
columns: ["label", "object_name", "url", "method", "active", "updated_at"],
|
|
37
|
+
filter: [{ field: "active", operator: "equals", value: false }],
|
|
38
|
+
sort: [{ field: "label", order: "asc" }],
|
|
39
|
+
pagination: { pageSize: 50 }
|
|
40
|
+
},
|
|
41
|
+
by_object: {
|
|
42
|
+
type: "grid",
|
|
43
|
+
name: "by_object",
|
|
44
|
+
label: "By Object",
|
|
45
|
+
data: { provider: "object", object: "sys_webhook" },
|
|
46
|
+
columns: ["object_name", "label", "url", "active", "updated_at"],
|
|
47
|
+
sort: [{ field: "object_name", order: "asc" }, { field: "label", order: "asc" }],
|
|
48
|
+
grouping: { fields: [{ field: "object_name", order: "asc", collapsed: false }] },
|
|
49
|
+
pagination: { pageSize: 100 }
|
|
50
|
+
},
|
|
51
|
+
all_webhooks: {
|
|
52
|
+
type: "grid",
|
|
53
|
+
name: "all_webhooks",
|
|
54
|
+
label: "All",
|
|
55
|
+
data: { provider: "object", object: "sys_webhook" },
|
|
56
|
+
columns: ["label", "object_name", "url", "method", "active", "updated_at"],
|
|
57
|
+
sort: [{ field: "label", order: "asc" }],
|
|
58
|
+
pagination: { pageSize: 50 }
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
fields: {
|
|
62
|
+
id: Field.text({ label: "Webhook ID", required: true, readonly: true, group: "System" }),
|
|
63
|
+
name: Field.text({
|
|
64
|
+
label: "Name",
|
|
65
|
+
required: true,
|
|
66
|
+
maxLength: 100,
|
|
67
|
+
description: "Unique snake_case name \u2014 referenced in logs and audit",
|
|
68
|
+
group: "Definition"
|
|
69
|
+
}),
|
|
70
|
+
label: Field.text({
|
|
71
|
+
label: "Display Label",
|
|
72
|
+
required: false,
|
|
73
|
+
maxLength: 200,
|
|
74
|
+
group: "Definition"
|
|
75
|
+
}),
|
|
76
|
+
object_name: Field.text({
|
|
77
|
+
label: "Object",
|
|
78
|
+
required: false,
|
|
79
|
+
maxLength: 100,
|
|
80
|
+
description: "Short object name whose events fire this webhook (blank = manual / API-triggered)",
|
|
81
|
+
group: "Definition"
|
|
82
|
+
}),
|
|
83
|
+
triggers: Field.text({
|
|
84
|
+
label: "Triggers",
|
|
85
|
+
required: false,
|
|
86
|
+
maxLength: 200,
|
|
87
|
+
description: "Comma-separated event list: create,update,delete,undelete,api",
|
|
88
|
+
group: "Definition"
|
|
89
|
+
}),
|
|
90
|
+
url: Field.text({
|
|
91
|
+
label: "Target URL",
|
|
92
|
+
required: true,
|
|
93
|
+
maxLength: 2048,
|
|
94
|
+
description: "External endpoint that receives the POST",
|
|
95
|
+
group: "Definition"
|
|
96
|
+
}),
|
|
97
|
+
method: Field.text({
|
|
98
|
+
label: "HTTP Method",
|
|
99
|
+
required: true,
|
|
100
|
+
defaultValue: "POST",
|
|
101
|
+
maxLength: 10,
|
|
102
|
+
description: "GET / POST / PUT / PATCH / DELETE",
|
|
103
|
+
group: "Definition"
|
|
104
|
+
}),
|
|
105
|
+
description: Field.textarea({ label: "Description", required: false, group: "Definition" }),
|
|
106
|
+
active: Field.boolean({
|
|
107
|
+
label: "Active",
|
|
108
|
+
required: true,
|
|
109
|
+
defaultValue: true,
|
|
110
|
+
description: "Inactive webhooks are skipped by the dispatcher",
|
|
111
|
+
group: "Definition"
|
|
112
|
+
}),
|
|
113
|
+
definition_json: Field.textarea({
|
|
114
|
+
label: "Definition",
|
|
115
|
+
required: true,
|
|
116
|
+
description: "Serialised Webhook JSON (see @objectstack/spec/automation/webhook) \u2014 full headers/auth/retry/payload config",
|
|
117
|
+
group: "Definition"
|
|
118
|
+
}),
|
|
119
|
+
created_at: Field.datetime({
|
|
120
|
+
label: "Created At",
|
|
121
|
+
required: true,
|
|
122
|
+
defaultValue: "NOW()",
|
|
123
|
+
readonly: true,
|
|
124
|
+
group: "System"
|
|
125
|
+
}),
|
|
126
|
+
updated_at: Field.datetime({ label: "Updated At", required: false, group: "System" })
|
|
127
|
+
},
|
|
128
|
+
indexes: [
|
|
129
|
+
{ fields: ["name"], unique: true },
|
|
130
|
+
{ fields: ["object_name"] },
|
|
131
|
+
{ fields: ["active", "object_name"] }
|
|
132
|
+
]
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
// src/sys-webhook-delivery.object.ts
|
|
136
|
+
import { Field as Field2, ObjectSchema as ObjectSchema2 } from "@objectstack/spec/data";
|
|
137
|
+
var SysWebhookDelivery = ObjectSchema2.create({
|
|
138
|
+
name: "sys_webhook_delivery",
|
|
139
|
+
label: "Webhook Delivery",
|
|
140
|
+
pluralLabel: "Webhook Deliveries",
|
|
141
|
+
icon: "package",
|
|
142
|
+
isSystem: true,
|
|
143
|
+
managedBy: "config",
|
|
144
|
+
userActions: { create: false, edit: false, delete: false, import: false },
|
|
145
|
+
description: "Durable outbox row for one webhook attempt. Managed by @objectstack/plugin-webhooks; do not write directly.",
|
|
146
|
+
displayNameField: "id",
|
|
147
|
+
titleFormat: "{event_type} \u2192 {url}",
|
|
148
|
+
compactLayout: ["event_type", "url", "status", "attempts", "next_retry_at"],
|
|
149
|
+
actions: [
|
|
150
|
+
{
|
|
151
|
+
name: "redeliver",
|
|
152
|
+
label: "Redeliver",
|
|
153
|
+
icon: "refresh-cw",
|
|
154
|
+
variant: "secondary",
|
|
155
|
+
locations: ["list_item", "record_header"],
|
|
156
|
+
type: "api",
|
|
157
|
+
target: "/api/v1/webhooks/redeliver",
|
|
158
|
+
method: "POST",
|
|
159
|
+
recordIdParam: "deliveryId",
|
|
160
|
+
confirmText: "Replay this delivery? The receiver will get the original payload again \u2014 they must be idempotent on the X-Objectstack-Delivery header.",
|
|
161
|
+
successMessage: "Queued for redelivery",
|
|
162
|
+
refreshAfter: true,
|
|
163
|
+
// Only terminal rows are safe to replay. Pending / in_flight rows
|
|
164
|
+
// are either already queued or actively being sent — replaying
|
|
165
|
+
// would double-deliver.
|
|
166
|
+
disabled: "!(status in ['success', 'failed', 'dead'])"
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
listViews: {
|
|
170
|
+
recent: {
|
|
171
|
+
type: "grid",
|
|
172
|
+
name: "recent",
|
|
173
|
+
label: "Recent",
|
|
174
|
+
data: { provider: "object", object: "sys_webhook_delivery" },
|
|
175
|
+
columns: ["event_type", "url", "status", "attempts", "response_code", "updated_at"],
|
|
176
|
+
sort: [{ field: "updated_at", order: "desc" }],
|
|
177
|
+
pagination: { pageSize: 50 }
|
|
178
|
+
},
|
|
179
|
+
failures: {
|
|
180
|
+
type: "grid",
|
|
181
|
+
name: "failures",
|
|
182
|
+
label: "Failures",
|
|
183
|
+
data: { provider: "object", object: "sys_webhook_delivery" },
|
|
184
|
+
columns: ["event_type", "url", "status", "attempts", "response_code", "error", "updated_at"],
|
|
185
|
+
filter: [{ field: "status", operator: "in", value: ["failed", "dead"] }],
|
|
186
|
+
sort: [{ field: "updated_at", order: "desc" }],
|
|
187
|
+
pagination: { pageSize: 50 }
|
|
188
|
+
},
|
|
189
|
+
in_flight: {
|
|
190
|
+
type: "grid",
|
|
191
|
+
name: "in_flight",
|
|
192
|
+
label: "In Flight",
|
|
193
|
+
data: { provider: "object", object: "sys_webhook_delivery" },
|
|
194
|
+
columns: ["event_type", "url", "attempts", "claimed_by", "claimed_at"],
|
|
195
|
+
filter: [{ field: "status", operator: "equals", value: "in_flight" }],
|
|
196
|
+
sort: [{ field: "claimed_at", order: "desc" }],
|
|
197
|
+
pagination: { pageSize: 50 }
|
|
198
|
+
},
|
|
199
|
+
pending: {
|
|
200
|
+
type: "grid",
|
|
201
|
+
name: "pending",
|
|
202
|
+
label: "Pending",
|
|
203
|
+
data: { provider: "object", object: "sys_webhook_delivery" },
|
|
204
|
+
columns: ["event_type", "url", "attempts", "next_retry_at", "updated_at"],
|
|
205
|
+
filter: [{ field: "status", operator: "equals", value: "pending" }],
|
|
206
|
+
sort: [{ field: "next_retry_at", order: "asc" }],
|
|
207
|
+
pagination: { pageSize: 50 }
|
|
208
|
+
},
|
|
209
|
+
by_status: {
|
|
210
|
+
type: "grid",
|
|
211
|
+
name: "by_status",
|
|
212
|
+
label: "By Status",
|
|
213
|
+
data: { provider: "object", object: "sys_webhook_delivery" },
|
|
214
|
+
columns: ["status", "event_type", "url", "attempts", "updated_at"],
|
|
215
|
+
sort: [{ field: "status", order: "asc" }, { field: "updated_at", order: "desc" }],
|
|
216
|
+
grouping: { fields: [{ field: "status", order: "asc", collapsed: false }] },
|
|
217
|
+
pagination: { pageSize: 100 }
|
|
218
|
+
},
|
|
219
|
+
by_webhook: {
|
|
220
|
+
type: "grid",
|
|
221
|
+
name: "by_webhook",
|
|
222
|
+
label: "By Webhook",
|
|
223
|
+
data: { provider: "object", object: "sys_webhook_delivery" },
|
|
224
|
+
columns: ["webhook_id", "event_type", "status", "attempts", "updated_at"],
|
|
225
|
+
sort: [{ field: "webhook_id", order: "asc" }, { field: "updated_at", order: "desc" }],
|
|
226
|
+
grouping: { fields: [{ field: "webhook_id", order: "asc", collapsed: true }] },
|
|
227
|
+
pagination: { pageSize: 100 }
|
|
228
|
+
},
|
|
229
|
+
all_deliveries: {
|
|
230
|
+
type: "grid",
|
|
231
|
+
name: "all_deliveries",
|
|
232
|
+
label: "All",
|
|
233
|
+
data: { provider: "object", object: "sys_webhook_delivery" },
|
|
234
|
+
columns: ["event_type", "url", "status", "attempts", "response_code", "updated_at"],
|
|
235
|
+
sort: [{ field: "updated_at", order: "desc" }],
|
|
236
|
+
pagination: { pageSize: 100 }
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
fields: {
|
|
240
|
+
id: Field2.text({
|
|
241
|
+
label: "Delivery ID",
|
|
242
|
+
required: true,
|
|
243
|
+
maxLength: 64,
|
|
244
|
+
description: "UUID \u2014 also doubles as the receiver-side idempotency key"
|
|
245
|
+
}),
|
|
246
|
+
webhook_id: Field2.text({
|
|
247
|
+
label: "Webhook ID",
|
|
248
|
+
required: true,
|
|
249
|
+
maxLength: 64,
|
|
250
|
+
description: "FK to sys_webhook.id (loosely coupled \u2014 denormalised URL/secret on row)"
|
|
251
|
+
}),
|
|
252
|
+
event_id: Field2.text({
|
|
253
|
+
label: "Event ID",
|
|
254
|
+
required: true,
|
|
255
|
+
maxLength: 128,
|
|
256
|
+
description: "Source event id; UNIQUE(event_id, webhook_id) for dedup"
|
|
257
|
+
}),
|
|
258
|
+
event_type: Field2.text({
|
|
259
|
+
label: "Event Type",
|
|
260
|
+
required: true,
|
|
261
|
+
maxLength: 128,
|
|
262
|
+
description: "e.g. data.record.created"
|
|
263
|
+
}),
|
|
264
|
+
url: Field2.text({
|
|
265
|
+
label: "Target URL",
|
|
266
|
+
required: true,
|
|
267
|
+
maxLength: 2048,
|
|
268
|
+
description: "Snapshotted at enqueue so config edits do not rewrite live rows"
|
|
269
|
+
}),
|
|
270
|
+
method: Field2.text({ label: "Method", required: false, maxLength: 10 }),
|
|
271
|
+
headers_json: Field2.textarea({ label: "Headers JSON", required: false }),
|
|
272
|
+
secret: Field2.text({ label: "HMAC Secret", required: false, maxLength: 256 }),
|
|
273
|
+
timeout_ms: Field2.number({ label: "Timeout (ms)", required: false }),
|
|
274
|
+
payload_json: Field2.textarea({ label: "Payload JSON", required: true }),
|
|
275
|
+
partition_key: Field2.number({
|
|
276
|
+
label: "Partition",
|
|
277
|
+
required: true,
|
|
278
|
+
description: "hash(webhook_id) mod partitionCount \u2014 precomputed for cheap WHERE"
|
|
279
|
+
}),
|
|
280
|
+
status: Field2.text({
|
|
281
|
+
label: "Status",
|
|
282
|
+
required: true,
|
|
283
|
+
defaultValue: "pending",
|
|
284
|
+
maxLength: 16,
|
|
285
|
+
description: "pending | in_flight | success | failed | dead"
|
|
286
|
+
}),
|
|
287
|
+
attempts: Field2.number({
|
|
288
|
+
label: "Attempts",
|
|
289
|
+
required: true,
|
|
290
|
+
defaultValue: 0,
|
|
291
|
+
description: "Number of POST attempts made so far"
|
|
292
|
+
}),
|
|
293
|
+
claimed_by: Field2.text({ label: "Claimed By", required: false, maxLength: 128 }),
|
|
294
|
+
claimed_at: Field2.number({ label: "Claimed At (ms)", required: false }),
|
|
295
|
+
next_retry_at: Field2.number({ label: "Next Retry At (ms)", required: false }),
|
|
296
|
+
last_attempted_at: Field2.number({ label: "Last Attempted At (ms)", required: false }),
|
|
297
|
+
response_code: Field2.number({ label: "HTTP Status", required: false }),
|
|
298
|
+
response_body: Field2.textarea({ label: "Response Body (capped)", required: false }),
|
|
299
|
+
error: Field2.textarea({ label: "Error", required: false }),
|
|
300
|
+
created_at: Field2.number({ label: "Created At (ms)", required: true }),
|
|
301
|
+
updated_at: Field2.number({ label: "Updated At (ms)", required: true })
|
|
302
|
+
},
|
|
303
|
+
indexes: [
|
|
304
|
+
{ fields: ["event_id", "webhook_id"], unique: true },
|
|
305
|
+
// Hot path: claim query
|
|
306
|
+
{ fields: ["status", "partition_key", "next_retry_at"] },
|
|
307
|
+
// Reaper: scan stale in_flight rows by claimed_at
|
|
308
|
+
{ fields: ["status", "claimed_at"] },
|
|
309
|
+
{ fields: ["webhook_id"] }
|
|
310
|
+
]
|
|
311
|
+
});
|
|
312
|
+
var SYS_WEBHOOK_DELIVERY = "sys_webhook_delivery";
|
|
313
|
+
|
|
314
|
+
export {
|
|
315
|
+
SysWebhook,
|
|
316
|
+
SysWebhookDelivery,
|
|
317
|
+
SYS_WEBHOOK_DELIVERY
|
|
318
|
+
};
|
|
319
|
+
//# sourceMappingURL=chunk-7HS5DLU2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/sys-webhook.object.ts","../src/sys-webhook-delivery.object.ts"],"sourcesContent":["// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { ObjectSchema, Field } from '@objectstack/spec/data';\n\n/**\n * sys_webhook — Outbound HTTP integration configuration (runtime).\n *\n * Persists a single {@link Webhook} envelope per row so administrators\n * can author, enable/disable, and edit webhook subscriptions from the\n * Studio UI without code changes. The canonical Zod schema for the\n * `definition_json` envelope lives at `@objectstack/spec/automation/webhook`.\n *\n * One row per `name`. The automation runtime\n * (`@objectstack/service-automation`, built-in `http_request` node) loads\n * active rows on boot + on `sys_webhook:changed` events, registers\n * `afterInsert` / `afterUpdate` / `afterDelete` listeners for the\n * targeted object, and dispatches outbound HTTP calls when matching\n * record events fire.\n *\n * Ownership (ADR-0029 K2.a): this object is **owned by\n * `@objectstack/plugin-webhooks`** — the plugin that consumes these rows —\n * alongside its sibling `sys_webhook_delivery`. It used to live in the\n * `@objectstack/platform-objects` monolith and be imported here; the\n * definition now lives with its owner so the plugin ships both data and\n * behavior as one unit.\n *\n * Platform-wide on purpose: every project (standalone, single-tenant,\n * cloud) can integrate with external systems (Slack, Stripe, internal\n * services) the same way.\n *\n * @namespace sys\n */\nexport const SysWebhook = ObjectSchema.create({\n name: 'sys_webhook',\n label: 'Webhook',\n pluralLabel: 'Webhooks',\n icon: 'webhook',\n isSystem: true,\n managedBy: 'config',\n // Authoring a webhook from the UI requires a structured form for the\n // headers / auth / retry / payload blocks — the generic JSON textarea\n // is acceptable as a v1 until a dedicated builder lands. Re-enable\n // create/edit/delete so admins can at least toggle `active` and edit\n // simple URL/method fields without round-tripping through code.\n userActions: { create: true, edit: true, delete: true, import: false },\n description: 'Outbound HTTP webhook subscription. Authored via defineWebhook() in code or the Studio editor; executed by the HTTP connector plugin.',\n displayNameField: 'name',\n titleFormat: '{label}',\n compactLayout: ['name', 'object_name', 'url', 'active', 'updated_at'],\n\n listViews: {\n active: {\n type: 'grid',\n name: 'active',\n label: 'Active',\n data: { provider: 'object', object: 'sys_webhook' },\n columns: ['label', 'object_name', 'url', 'method', 'active', 'updated_at'],\n filter: [{ field: 'active', operator: 'equals', value: true }],\n sort: [{ field: 'label', order: 'asc' }],\n pagination: { pageSize: 50 },\n },\n inactive: {\n type: 'grid',\n name: 'inactive',\n label: 'Inactive',\n data: { provider: 'object', object: 'sys_webhook' },\n columns: ['label', 'object_name', 'url', 'method', 'active', 'updated_at'],\n filter: [{ field: 'active', operator: 'equals', value: false }],\n sort: [{ field: 'label', order: 'asc' }],\n pagination: { pageSize: 50 },\n },\n by_object: {\n type: 'grid',\n name: 'by_object',\n label: 'By Object',\n data: { provider: 'object', object: 'sys_webhook' },\n columns: ['object_name', 'label', 'url', 'active', 'updated_at'],\n sort: [{ field: 'object_name', order: 'asc' }, { field: 'label', order: 'asc' }],\n grouping: { fields: [{ field: 'object_name', order: 'asc', collapsed: false }] },\n pagination: { pageSize: 100 },\n },\n all_webhooks: {\n type: 'grid',\n name: 'all_webhooks',\n label: 'All',\n data: { provider: 'object', object: 'sys_webhook' },\n columns: ['label', 'object_name', 'url', 'method', 'active', 'updated_at'],\n sort: [{ field: 'label', order: 'asc' }],\n pagination: { pageSize: 50 },\n },\n },\n\n fields: {\n id: Field.text({ label: 'Webhook ID', required: true, readonly: true, group: 'System' }),\n\n name: Field.text({\n label: 'Name',\n required: true,\n maxLength: 100,\n description: 'Unique snake_case name — referenced in logs and audit',\n group: 'Definition',\n }),\n\n label: Field.text({\n label: 'Display Label',\n required: false,\n maxLength: 200,\n group: 'Definition',\n }),\n\n object_name: Field.text({\n label: 'Object',\n required: false,\n maxLength: 100,\n description: 'Short object name whose events fire this webhook (blank = manual / API-triggered)',\n group: 'Definition',\n }),\n\n triggers: Field.text({\n label: 'Triggers',\n required: false,\n maxLength: 200,\n description: 'Comma-separated event list: create,update,delete,undelete,api',\n group: 'Definition',\n }),\n\n url: Field.text({\n label: 'Target URL',\n required: true,\n maxLength: 2048,\n description: 'External endpoint that receives the POST',\n group: 'Definition',\n }),\n\n method: Field.text({\n label: 'HTTP Method',\n required: true,\n defaultValue: 'POST',\n maxLength: 10,\n description: 'GET / POST / PUT / PATCH / DELETE',\n group: 'Definition',\n }),\n\n description: Field.textarea({ label: 'Description', required: false, group: 'Definition' }),\n\n active: Field.boolean({\n label: 'Active',\n required: true,\n defaultValue: true,\n description: 'Inactive webhooks are skipped by the dispatcher',\n group: 'Definition',\n }),\n\n definition_json: Field.textarea({\n label: 'Definition',\n required: true,\n description: 'Serialised Webhook JSON (see @objectstack/spec/automation/webhook) — full headers/auth/retry/payload config',\n group: 'Definition',\n }),\n\n created_at: Field.datetime({\n label: 'Created At',\n required: true,\n defaultValue: 'NOW()',\n readonly: true,\n group: 'System',\n }),\n\n updated_at: Field.datetime({ label: 'Updated At', required: false, group: 'System' }),\n },\n\n indexes: [\n { fields: ['name'], unique: true },\n { fields: ['object_name'] },\n { fields: ['active', 'object_name'] },\n ],\n});\n","// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { Field, ObjectSchema } from '@objectstack/spec/data';\n\n/**\n * sys_webhook_delivery — Durable outbox row for one HTTP attempt.\n *\n * Schema is owned by `@objectstack/plugin-webhooks`. Add it to your stack\n * via:\n *\n * import { SysWebhookDelivery } from '@objectstack/plugin-webhooks/schema';\n * defineStack({ objects: [SysWebhookDelivery, ...], plugins: [...] });\n *\n * Designed for the SqlWebhookOutbox claim algorithm:\n *\n * 1. Producers INSERT pending rows (dedup'd by (event_id, webhook_id)).\n * 2. The dispatcher's per-partition lock-holder runs:\n * SELECT id WHERE status='pending' AND partition_key=? AND (next_retry_at <= now OR null)\n * UPDATE SET status='in_flight' WHERE id IN (...) AND status='pending' ← atomic claim\n * POST to target URL\n * UPDATE SET status=success/pending/dead, attempts=attempts+1, ...\n *\n * `partition_key` is precomputed on enqueue (hash(webhook_id) mod N) so the\n * dispatcher can filter cheaply without DB-side hash functions.\n *\n * Indexes are tuned for the hot path: `(status, partition_key, next_retry_at)`\n * is the claim query; `(event_id, webhook_id)` is the dedup uniqueness.\n *\n * @namespace sys\n */\nexport const SysWebhookDelivery = ObjectSchema.create({\n name: 'sys_webhook_delivery',\n label: 'Webhook Delivery',\n pluralLabel: 'Webhook Deliveries',\n icon: 'package',\n isSystem: true,\n managedBy: 'config',\n userActions: { create: false, edit: false, delete: false, import: false },\n description:\n 'Durable outbox row for one webhook attempt. Managed by @objectstack/plugin-webhooks; do not write directly.',\n displayNameField: 'id',\n titleFormat: '{event_type} → {url}',\n compactLayout: ['event_type', 'url', 'status', 'attempts', 'next_retry_at'],\n\n actions: [\n {\n name: 'redeliver',\n label: 'Redeliver',\n icon: 'refresh-cw',\n variant: 'secondary',\n locations: ['list_item', 'record_header'],\n type: 'api',\n target: '/api/v1/webhooks/redeliver',\n method: 'POST',\n recordIdParam: 'deliveryId',\n confirmText:\n 'Replay this delivery? The receiver will get the original payload again — they must be idempotent on the X-Objectstack-Delivery header.',\n successMessage: 'Queued for redelivery',\n refreshAfter: true,\n // Only terminal rows are safe to replay. Pending / in_flight rows\n // are either already queued or actively being sent — replaying\n // would double-deliver.\n disabled: \"!(status in ['success', 'failed', 'dead'])\",\n },\n ],\n\n listViews: {\n recent: {\n type: 'grid',\n name: 'recent',\n label: 'Recent',\n data: { provider: 'object', object: 'sys_webhook_delivery' },\n columns: ['event_type', 'url', 'status', 'attempts', 'response_code', 'updated_at'],\n sort: [{ field: 'updated_at', order: 'desc' }],\n pagination: { pageSize: 50 },\n },\n failures: {\n type: 'grid',\n name: 'failures',\n label: 'Failures',\n data: { provider: 'object', object: 'sys_webhook_delivery' },\n columns: ['event_type', 'url', 'status', 'attempts', 'response_code', 'error', 'updated_at'],\n filter: [{ field: 'status', operator: 'in', value: ['failed', 'dead'] }],\n sort: [{ field: 'updated_at', order: 'desc' }],\n pagination: { pageSize: 50 },\n },\n in_flight: {\n type: 'grid',\n name: 'in_flight',\n label: 'In Flight',\n data: { provider: 'object', object: 'sys_webhook_delivery' },\n columns: ['event_type', 'url', 'attempts', 'claimed_by', 'claimed_at'],\n filter: [{ field: 'status', operator: 'equals', value: 'in_flight' }],\n sort: [{ field: 'claimed_at', order: 'desc' }],\n pagination: { pageSize: 50 },\n },\n pending: {\n type: 'grid',\n name: 'pending',\n label: 'Pending',\n data: { provider: 'object', object: 'sys_webhook_delivery' },\n columns: ['event_type', 'url', 'attempts', 'next_retry_at', 'updated_at'],\n filter: [{ field: 'status', operator: 'equals', value: 'pending' }],\n sort: [{ field: 'next_retry_at', order: 'asc' }],\n pagination: { pageSize: 50 },\n },\n by_status: {\n type: 'grid',\n name: 'by_status',\n label: 'By Status',\n data: { provider: 'object', object: 'sys_webhook_delivery' },\n columns: ['status', 'event_type', 'url', 'attempts', 'updated_at'],\n sort: [{ field: 'status', order: 'asc' }, { field: 'updated_at', order: 'desc' }],\n grouping: { fields: [{ field: 'status', order: 'asc', collapsed: false }] },\n pagination: { pageSize: 100 },\n },\n by_webhook: {\n type: 'grid',\n name: 'by_webhook',\n label: 'By Webhook',\n data: { provider: 'object', object: 'sys_webhook_delivery' },\n columns: ['webhook_id', 'event_type', 'status', 'attempts', 'updated_at'],\n sort: [{ field: 'webhook_id', order: 'asc' }, { field: 'updated_at', order: 'desc' }],\n grouping: { fields: [{ field: 'webhook_id', order: 'asc', collapsed: true }] },\n pagination: { pageSize: 100 },\n },\n all_deliveries: {\n type: 'grid',\n name: 'all_deliveries',\n label: 'All',\n data: { provider: 'object', object: 'sys_webhook_delivery' },\n columns: ['event_type', 'url', 'status', 'attempts', 'response_code', 'updated_at'],\n sort: [{ field: 'updated_at', order: 'desc' }],\n pagination: { pageSize: 100 },\n },\n },\n\n fields: {\n id: Field.text({\n label: 'Delivery ID',\n required: true,\n maxLength: 64,\n description: 'UUID — also doubles as the receiver-side idempotency key',\n }),\n\n webhook_id: Field.text({\n label: 'Webhook ID',\n required: true,\n maxLength: 64,\n description: 'FK to sys_webhook.id (loosely coupled — denormalised URL/secret on row)',\n }),\n\n event_id: Field.text({\n label: 'Event ID',\n required: true,\n maxLength: 128,\n description: 'Source event id; UNIQUE(event_id, webhook_id) for dedup',\n }),\n\n event_type: Field.text({\n label: 'Event Type',\n required: true,\n maxLength: 128,\n description: 'e.g. data.record.created',\n }),\n\n url: Field.text({\n label: 'Target URL',\n required: true,\n maxLength: 2048,\n description: 'Snapshotted at enqueue so config edits do not rewrite live rows',\n }),\n\n method: Field.text({ label: 'Method', required: false, maxLength: 10 }),\n headers_json: Field.textarea({ label: 'Headers JSON', required: false }),\n secret: Field.text({ label: 'HMAC Secret', required: false, maxLength: 256 }),\n timeout_ms: Field.number({ label: 'Timeout (ms)', required: false }),\n payload_json: Field.textarea({ label: 'Payload JSON', required: true }),\n\n partition_key: Field.number({\n label: 'Partition',\n required: true,\n description: 'hash(webhook_id) mod partitionCount — precomputed for cheap WHERE',\n }),\n\n status: Field.text({\n label: 'Status',\n required: true,\n defaultValue: 'pending',\n maxLength: 16,\n description: 'pending | in_flight | success | failed | dead',\n }),\n\n attempts: Field.number({\n label: 'Attempts',\n required: true,\n defaultValue: 0,\n description: 'Number of POST attempts made so far',\n }),\n\n claimed_by: Field.text({ label: 'Claimed By', required: false, maxLength: 128 }),\n claimed_at: Field.number({ label: 'Claimed At (ms)', required: false }),\n next_retry_at: Field.number({ label: 'Next Retry At (ms)', required: false }),\n last_attempted_at: Field.number({ label: 'Last Attempted At (ms)', required: false }),\n response_code: Field.number({ label: 'HTTP Status', required: false }),\n response_body: Field.textarea({ label: 'Response Body (capped)', required: false }),\n error: Field.textarea({ label: 'Error', required: false }),\n\n created_at: Field.number({ label: 'Created At (ms)', required: true }),\n updated_at: Field.number({ label: 'Updated At (ms)', required: true }),\n },\n\n indexes: [\n { fields: ['event_id', 'webhook_id'], unique: true },\n // Hot path: claim query\n { fields: ['status', 'partition_key', 'next_retry_at'] },\n // Reaper: scan stale in_flight rows by claimed_at\n { fields: ['status', 'claimed_at'] },\n { fields: ['webhook_id'] },\n ],\n});\n\n/** Canonical object name — exported so SqlWebhookOutbox callers can override if needed. */\nexport const SYS_WEBHOOK_DELIVERY = 'sys_webhook_delivery' as const;\n"],"mappings":";AAEA,SAAS,cAAc,aAAa;AA8B7B,IAAM,aAAa,aAAa,OAAO;AAAA,EAC5C,MAAM;AAAA,EACN,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM;AAAA,EACN,UAAU;AAAA,EACV,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMX,aAAa,EAAE,QAAQ,MAAM,MAAM,MAAM,QAAQ,MAAM,QAAQ,MAAM;AAAA,EACrE,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,eAAe,CAAC,QAAQ,eAAe,OAAO,UAAU,YAAY;AAAA,EAEpE,WAAW;AAAA,IACT,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,MAA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hsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkTDSI7UHYcjs = require('./chunk-TDSI7UHY.cjs');
|
|
4
4
|
|
|
5
5
|
// src/sql-outbox.ts
|
|
6
6
|
var _crypto = require('crypto');
|
|
@@ -32,7 +32,7 @@ var SqlWebhookOutbox = class {
|
|
|
32
32
|
if (opts.partitionCount <= 0) {
|
|
33
33
|
throw new Error("SqlWebhookOutbox: partitionCount must be > 0");
|
|
34
34
|
}
|
|
35
|
-
this.objectName = _nullishCoalesce(opts.objectName, () => (
|
|
35
|
+
this.objectName = _nullishCoalesce(opts.objectName, () => ( _chunkTDSI7UHYcjs.SYS_WEBHOOK_DELIVERY));
|
|
36
36
|
this.partitionCount = opts.partitionCount;
|
|
37
37
|
}
|
|
38
38
|
async enqueue(input) {
|
|
@@ -253,4 +253,4 @@ var SqlWebhookOutbox = class {
|
|
|
253
253
|
|
|
254
254
|
|
|
255
255
|
exports.RedeliverError = RedeliverError; exports.hashPartition = hashPartition; exports.SqlWebhookOutbox = SqlWebhookOutbox;
|
|
256
|
-
//# sourceMappingURL=chunk-
|
|
256
|
+
//# sourceMappingURL=chunk-HF7CCDPB.cjs.map
|