@objectstack/plugin-webhooks 16.0.0 → 17.0.0-rc.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 (39) hide show
  1. package/.turbo/turbo-build.log +22 -22
  2. package/CHANGELOG.md +257 -0
  3. package/dist/{chunk-RBCYKJVL.js → chunk-6EPMRZ7I.js} +28 -2
  4. package/dist/chunk-6EPMRZ7I.js.map +1 -0
  5. package/dist/{chunk-PTMJ5BLL.cjs → chunk-QUTQSOQC.cjs} +28 -2
  6. package/dist/chunk-QUTQSOQC.cjs.map +1 -0
  7. package/dist/index.cjs +222 -24
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +15 -0
  10. package/dist/index.d.ts +15 -0
  11. package/dist/index.js +202 -4
  12. package/dist/index.js.map +1 -1
  13. package/dist/schema.cjs +2 -2
  14. package/dist/schema.cjs.map +1 -1
  15. package/dist/schema.d.cts +339 -143
  16. package/dist/schema.d.ts +339 -143
  17. package/dist/schema.js +1 -1
  18. package/dist/translations-CBQRUIS5.cjs +383 -0
  19. package/dist/translations-CBQRUIS5.cjs.map +1 -0
  20. package/dist/translations-Y3CXWOTM.js +383 -0
  21. package/dist/translations-Y3CXWOTM.js.map +1 -0
  22. package/package.json +5 -5
  23. package/scripts/i18n-extract.config.ts +5 -3
  24. package/src/bootstrap-declared-webhooks.test.ts +283 -0
  25. package/src/bootstrap-declared-webhooks.ts +205 -0
  26. package/src/sys-webhook.object.ts +50 -12
  27. package/src/translations/bundle-ownership.test.ts +41 -0
  28. package/src/translations/en.objects.generated.ts +27 -113
  29. package/src/translations/es-ES.objects.generated.ts +27 -113
  30. package/src/translations/ja-JP.objects.generated.ts +27 -113
  31. package/src/translations/zh-CN.objects.generated.ts +27 -113
  32. package/src/webhook-outbox-plugin.ts +46 -0
  33. package/src/webhook-provenance.ts +86 -0
  34. package/dist/chunk-PTMJ5BLL.cjs.map +0 -1
  35. package/dist/chunk-RBCYKJVL.js.map +0 -1
  36. package/dist/translations-EPJYANXJ.js +0 -727
  37. package/dist/translations-EPJYANXJ.js.map +0 -1
  38. package/dist/translations-L2JAQDJB.cjs +0 -727
  39. package/dist/translations-L2JAQDJB.cjs.map +0 -1
@@ -30,7 +30,12 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
30
30
  },
31
31
  triggers: {
32
32
  label: "Triggers",
33
- help: "Comma-separated event list: create,update,delete"
33
+ help: "Comma-separated event list: create,update,delete",
34
+ options: {
35
+ create: "create",
36
+ update: "update",
37
+ delete: "delete"
38
+ }
34
39
  },
35
40
  url: {
36
41
  label: "Target URL",
@@ -38,7 +43,14 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
38
43
  },
39
44
  method: {
40
45
  label: "HTTP Method",
41
- help: "GET / POST / PUT / PATCH / DELETE"
46
+ help: "GET / POST / PUT / PATCH / DELETE",
47
+ options: {
48
+ get: "GET",
49
+ post: "POST",
50
+ put: "PUT",
51
+ patch: "PATCH",
52
+ delete: "DELETE"
53
+ }
42
54
  },
43
55
  description: {
44
56
  label: "Description"
@@ -51,6 +63,19 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
51
63
  label: "Definition",
52
64
  help: "Serialised Webhook JSON (see @objectstack/spec/automation/webhook) — full headers/auth/retry/payload config"
53
65
  },
66
+ managed_by: {
67
+ label: "Managed By",
68
+ help: "Record provenance: platform = framework built-in / package = app/package-declared (boot-seeded from defineStack webhooks) / admin = created in Setup.",
69
+ options: {
70
+ platform: "platform",
71
+ package: "package",
72
+ admin: "admin"
73
+ }
74
+ },
75
+ customized: {
76
+ label: "Customized",
77
+ help: "Set when an admin edits a package-declared webhook; boot seeding will no longer overwrite the row (a deactivated noisy webhook survives redeploys). Meaningless on admin rows."
78
+ },
54
79
  created_at: {
55
80
  label: "Created At"
56
81
  },
@@ -72,116 +97,5 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
72
97
  label: "All"
73
98
  }
74
99
  }
75
- },
76
- sys_webhook_delivery: {
77
- label: "Webhook Delivery",
78
- pluralLabel: "Webhook Deliveries",
79
- description: "Durable outbox row for one webhook attempt. Managed by @objectstack/plugin-webhooks; do not write directly.",
80
- fields: {
81
- id: {
82
- label: "Delivery ID",
83
- help: "UUID — also doubles as the receiver-side idempotency key"
84
- },
85
- webhook_id: {
86
- label: "Webhook ID",
87
- help: "FK to sys_webhook.id (loosely coupled — denormalised URL/secret on row)"
88
- },
89
- event_id: {
90
- label: "Event ID",
91
- help: "Source event id; UNIQUE(event_id, webhook_id) for dedup"
92
- },
93
- event_type: {
94
- label: "Event Type",
95
- help: "e.g. data.record.created"
96
- },
97
- url: {
98
- label: "Target URL",
99
- help: "Snapshotted at enqueue so config edits do not rewrite live rows"
100
- },
101
- method: {
102
- label: "Method"
103
- },
104
- headers_json: {
105
- label: "Headers JSON"
106
- },
107
- secret: {
108
- label: "HMAC Secret"
109
- },
110
- timeout_ms: {
111
- label: "Timeout (ms)"
112
- },
113
- payload_json: {
114
- label: "Payload JSON"
115
- },
116
- partition_key: {
117
- label: "Partition",
118
- help: "hash(webhook_id) mod partitionCount — precomputed for cheap WHERE"
119
- },
120
- status: {
121
- label: "Status",
122
- help: "pending | in_flight | success | failed | dead"
123
- },
124
- attempts: {
125
- label: "Attempts",
126
- help: "Number of POST attempts made so far"
127
- },
128
- claimed_by: {
129
- label: "Claimed By"
130
- },
131
- claimed_at: {
132
- label: "Claimed At (ms)"
133
- },
134
- next_retry_at: {
135
- label: "Next Retry At (ms)"
136
- },
137
- last_attempted_at: {
138
- label: "Last Attempted At (ms)"
139
- },
140
- response_code: {
141
- label: "HTTP Status"
142
- },
143
- response_body: {
144
- label: "Response Body (capped)"
145
- },
146
- error: {
147
- label: "Error"
148
- },
149
- created_at: {
150
- label: "Created At (ms)"
151
- },
152
- updated_at: {
153
- label: "Updated At (ms)"
154
- }
155
- },
156
- _views: {
157
- recent: {
158
- label: "Recent"
159
- },
160
- failures: {
161
- label: "Failures"
162
- },
163
- in_flight: {
164
- label: "In Flight"
165
- },
166
- pending: {
167
- label: "Pending"
168
- },
169
- by_status: {
170
- label: "By Status"
171
- },
172
- by_webhook: {
173
- label: "By Webhook"
174
- },
175
- all_deliveries: {
176
- label: "All"
177
- }
178
- },
179
- _actions: {
180
- redeliver: {
181
- label: "Redeliver",
182
- confirmText: "Replay this delivery? The receiver will get the original payload again — they must be idempotent on the X-Objectstack-Delivery header.",
183
- successMessage: "Queued for redelivery"
184
- }
185
- }
186
100
  }
187
101
  };
@@ -30,7 +30,12 @@ export const esESObjects: NonNullable<TranslationData['objects']> = {
30
30
  },
31
31
  triggers: {
32
32
  label: "Desencadenantes",
33
- help: "Lista de eventos separada por comas: create,update,delete."
33
+ help: "Lista de eventos separada por comas: create,update,delete.",
34
+ options: {
35
+ create: "Crear",
36
+ update: "Actualizar",
37
+ delete: "Eliminar"
38
+ }
34
39
  },
35
40
  url: {
36
41
  label: "URL de destino",
@@ -38,7 +43,14 @@ export const esESObjects: NonNullable<TranslationData['objects']> = {
38
43
  },
39
44
  method: {
40
45
  label: "Método HTTP",
41
- help: "GET / POST / PUT / PATCH / DELETE"
46
+ help: "GET / POST / PUT / PATCH / DELETE",
47
+ options: {
48
+ get: "GET",
49
+ post: "POST",
50
+ put: "PUT",
51
+ patch: "PATCH",
52
+ delete: "DELETE"
53
+ }
42
54
  },
43
55
  description: {
44
56
  label: "Descripción"
@@ -51,6 +63,19 @@ export const esESObjects: NonNullable<TranslationData['objects']> = {
51
63
  label: "Definición",
52
64
  help: "JSON serializado de Webhook (consulte @objectstack/spec/automation/webhook): configuración completa de cabeceras/auth/reintentos/payload."
53
65
  },
66
+ managed_by: {
67
+ label: "Gestionado por",
68
+ help: "Procedencia del registro: platform = integrado en el framework / package = declarado por app o paquete (sembrado al arrancar desde los webhooks de defineStack) / admin = creado en Setup.",
69
+ options: {
70
+ platform: "Plataforma",
71
+ package: "Paquete",
72
+ admin: "Administrador"
73
+ }
74
+ },
75
+ customized: {
76
+ label: "Personalizado",
77
+ help: "Se establece cuando un administrador edita un webhook declarado por un paquete; a partir de entonces el sembrado de arranque deja de sobrescribir la fila (un webhook ruidoso desactivado sobrevive a los redespliegues). Sin sentido en filas admin."
78
+ },
54
79
  created_at: {
55
80
  label: "Creado el"
56
81
  },
@@ -72,116 +97,5 @@ export const esESObjects: NonNullable<TranslationData['objects']> = {
72
97
  label: "Todos"
73
98
  }
74
99
  }
75
- },
76
- sys_webhook_delivery: {
77
- label: "Webhook Delivery",
78
- pluralLabel: "Webhook Deliveries",
79
- description: "Durable outbox row for one webhook attempt. Managed by @objectstack/plugin-webhooks; do not write directly.",
80
- fields: {
81
- id: {
82
- label: "Delivery ID",
83
- help: "UUID — also doubles as the receiver-side idempotency key"
84
- },
85
- webhook_id: {
86
- label: "Webhook ID",
87
- help: "FK to sys_webhook.id (loosely coupled — denormalised URL/secret on row)"
88
- },
89
- event_id: {
90
- label: "Event ID",
91
- help: "Source event id; UNIQUE(event_id, webhook_id) for dedup"
92
- },
93
- event_type: {
94
- label: "Event Type",
95
- help: "e.g. data.record.created"
96
- },
97
- url: {
98
- label: "Target URL",
99
- help: "Snapshotted at enqueue so config edits do not rewrite live rows"
100
- },
101
- method: {
102
- label: "Method"
103
- },
104
- headers_json: {
105
- label: "Headers JSON"
106
- },
107
- secret: {
108
- label: "HMAC Secret"
109
- },
110
- timeout_ms: {
111
- label: "Timeout (ms)"
112
- },
113
- payload_json: {
114
- label: "Payload JSON"
115
- },
116
- partition_key: {
117
- label: "Partition",
118
- help: "hash(webhook_id) mod partitionCount — precomputed for cheap WHERE"
119
- },
120
- status: {
121
- label: "Status",
122
- help: "pending | in_flight | success | failed | dead"
123
- },
124
- attempts: {
125
- label: "Attempts",
126
- help: "Number of POST attempts made so far"
127
- },
128
- claimed_by: {
129
- label: "Claimed By"
130
- },
131
- claimed_at: {
132
- label: "Claimed At (ms)"
133
- },
134
- next_retry_at: {
135
- label: "Next Retry At (ms)"
136
- },
137
- last_attempted_at: {
138
- label: "Last Attempted At (ms)"
139
- },
140
- response_code: {
141
- label: "HTTP Status"
142
- },
143
- response_body: {
144
- label: "Response Body (capped)"
145
- },
146
- error: {
147
- label: "Error"
148
- },
149
- created_at: {
150
- label: "Created At (ms)"
151
- },
152
- updated_at: {
153
- label: "Updated At (ms)"
154
- }
155
- },
156
- _views: {
157
- recent: {
158
- label: "Recent"
159
- },
160
- failures: {
161
- label: "Failures"
162
- },
163
- in_flight: {
164
- label: "In Flight"
165
- },
166
- pending: {
167
- label: "Pending"
168
- },
169
- by_status: {
170
- label: "By Status"
171
- },
172
- by_webhook: {
173
- label: "By Webhook"
174
- },
175
- all_deliveries: {
176
- label: "All"
177
- }
178
- },
179
- _actions: {
180
- redeliver: {
181
- label: "Redeliver",
182
- confirmText: "Replay this delivery? The receiver will get the original payload again — they must be idempotent on the X-Objectstack-Delivery header.",
183
- successMessage: "Queued for redelivery"
184
- }
185
- }
186
100
  }
187
101
  };
@@ -30,7 +30,12 @@ export const jaJPObjects: NonNullable<TranslationData['objects']> = {
30
30
  },
31
31
  triggers: {
32
32
  label: "トリガー",
33
- help: "カンマ区切りのイベントリスト: create,update,delete"
33
+ help: "カンマ区切りのイベントリスト: create,update,delete",
34
+ options: {
35
+ create: "作成",
36
+ update: "更新",
37
+ delete: "削除"
38
+ }
34
39
  },
35
40
  url: {
36
41
  label: "ターゲット URL",
@@ -38,7 +43,14 @@ export const jaJPObjects: NonNullable<TranslationData['objects']> = {
38
43
  },
39
44
  method: {
40
45
  label: "HTTP メソッド",
41
- help: "GET / POST / PUT / PATCH / DELETE"
46
+ help: "GET / POST / PUT / PATCH / DELETE",
47
+ options: {
48
+ get: "GET",
49
+ post: "POST",
50
+ put: "PUT",
51
+ patch: "PATCH",
52
+ delete: "DELETE"
53
+ }
42
54
  },
43
55
  description: {
44
56
  label: "説明"
@@ -51,6 +63,19 @@ export const jaJPObjects: NonNullable<TranslationData['objects']> = {
51
63
  label: "定義",
52
64
  help: "シリアライズされた Webhook JSON(@objectstack/spec/automation/webhook 参照)— ヘッダー/認証/リトライ/ペイロード設定を含む"
53
65
  },
66
+ managed_by: {
67
+ label: "管理元",
68
+ help: "レコードの出所: platform = フレームワーク組み込み / package = アプリ・パッケージ宣言(defineStack の webhooks から起動時シード)/ admin = Setup で作成。",
69
+ options: {
70
+ platform: "プラットフォーム",
71
+ package: "パッケージ",
72
+ admin: "管理者"
73
+ }
74
+ },
75
+ customized: {
76
+ label: "カスタマイズ済み",
77
+ help: "管理者がパッケージ宣言の webhook を編集すると設定されます。以後、起動時シードはこの行を上書きしません(無効化したノイジーな webhook は再デプロイ後も保持)。admin 行では意味を持ちません。"
78
+ },
54
79
  created_at: {
55
80
  label: "作成日時"
56
81
  },
@@ -72,116 +97,5 @@ export const jaJPObjects: NonNullable<TranslationData['objects']> = {
72
97
  label: "すべて"
73
98
  }
74
99
  }
75
- },
76
- sys_webhook_delivery: {
77
- label: "Webhook Delivery",
78
- pluralLabel: "Webhook Deliveries",
79
- description: "Durable outbox row for one webhook attempt. Managed by @objectstack/plugin-webhooks; do not write directly.",
80
- fields: {
81
- id: {
82
- label: "Delivery ID",
83
- help: "UUID — also doubles as the receiver-side idempotency key"
84
- },
85
- webhook_id: {
86
- label: "Webhook ID",
87
- help: "FK to sys_webhook.id (loosely coupled — denormalised URL/secret on row)"
88
- },
89
- event_id: {
90
- label: "Event ID",
91
- help: "Source event id; UNIQUE(event_id, webhook_id) for dedup"
92
- },
93
- event_type: {
94
- label: "Event Type",
95
- help: "e.g. data.record.created"
96
- },
97
- url: {
98
- label: "Target URL",
99
- help: "Snapshotted at enqueue so config edits do not rewrite live rows"
100
- },
101
- method: {
102
- label: "Method"
103
- },
104
- headers_json: {
105
- label: "Headers JSON"
106
- },
107
- secret: {
108
- label: "HMAC Secret"
109
- },
110
- timeout_ms: {
111
- label: "Timeout (ms)"
112
- },
113
- payload_json: {
114
- label: "Payload JSON"
115
- },
116
- partition_key: {
117
- label: "Partition",
118
- help: "hash(webhook_id) mod partitionCount — precomputed for cheap WHERE"
119
- },
120
- status: {
121
- label: "Status",
122
- help: "pending | in_flight | success | failed | dead"
123
- },
124
- attempts: {
125
- label: "Attempts",
126
- help: "Number of POST attempts made so far"
127
- },
128
- claimed_by: {
129
- label: "Claimed By"
130
- },
131
- claimed_at: {
132
- label: "Claimed At (ms)"
133
- },
134
- next_retry_at: {
135
- label: "Next Retry At (ms)"
136
- },
137
- last_attempted_at: {
138
- label: "Last Attempted At (ms)"
139
- },
140
- response_code: {
141
- label: "HTTP Status"
142
- },
143
- response_body: {
144
- label: "Response Body (capped)"
145
- },
146
- error: {
147
- label: "Error"
148
- },
149
- created_at: {
150
- label: "Created At (ms)"
151
- },
152
- updated_at: {
153
- label: "Updated At (ms)"
154
- }
155
- },
156
- _views: {
157
- recent: {
158
- label: "Recent"
159
- },
160
- failures: {
161
- label: "Failures"
162
- },
163
- in_flight: {
164
- label: "In Flight"
165
- },
166
- pending: {
167
- label: "Pending"
168
- },
169
- by_status: {
170
- label: "By Status"
171
- },
172
- by_webhook: {
173
- label: "By Webhook"
174
- },
175
- all_deliveries: {
176
- label: "All"
177
- }
178
- },
179
- _actions: {
180
- redeliver: {
181
- label: "Redeliver",
182
- confirmText: "Replay this delivery? The receiver will get the original payload again — they must be idempotent on the X-Objectstack-Delivery header.",
183
- successMessage: "Queued for redelivery"
184
- }
185
- }
186
100
  }
187
101
  };
@@ -30,7 +30,12 @@ export const zhCNObjects: NonNullable<TranslationData['objects']> = {
30
30
  },
31
31
  triggers: {
32
32
  label: "触发器",
33
- help: "以逗号分隔的事件列表:create,update,delete"
33
+ help: "以逗号分隔的事件列表:create,update,delete",
34
+ options: {
35
+ create: "创建",
36
+ update: "更新",
37
+ delete: "删除"
38
+ }
34
39
  },
35
40
  url: {
36
41
  label: "目标 URL",
@@ -38,7 +43,14 @@ export const zhCNObjects: NonNullable<TranslationData['objects']> = {
38
43
  },
39
44
  method: {
40
45
  label: "HTTP 方法",
41
- help: "GET / POST / PUT / PATCH / DELETE"
46
+ help: "GET / POST / PUT / PATCH / DELETE",
47
+ options: {
48
+ get: "GET",
49
+ post: "POST",
50
+ put: "PUT",
51
+ patch: "PATCH",
52
+ delete: "DELETE"
53
+ }
42
54
  },
43
55
  description: {
44
56
  label: "描述"
@@ -51,6 +63,19 @@ export const zhCNObjects: NonNullable<TranslationData['objects']> = {
51
63
  label: "定义",
52
64
  help: "序列化的 Webhook JSON(参见 @objectstack/spec/automation/webhook)——包含完整的 headers/auth/retry/payload 配置"
53
65
  },
66
+ managed_by: {
67
+ label: "管理来源",
68
+ help: "记录来源:platform = 框架内置 / package = 应用包声明(由 defineStack 的 webhooks 在启动时种入)/ admin = 在 Setup 中创建。",
69
+ options: {
70
+ platform: "平台",
71
+ package: "包",
72
+ admin: "管理员"
73
+ }
74
+ },
75
+ customized: {
76
+ label: "已定制",
77
+ help: "当管理员编辑应用包声明的 webhook 时置位;此后启动种入不再覆盖该行(被停用的嘈杂 webhook 可跨重新部署保留)。对 admin 来源的记录无意义。"
78
+ },
54
79
  created_at: {
55
80
  label: "创建时间"
56
81
  },
@@ -72,116 +97,5 @@ export const zhCNObjects: NonNullable<TranslationData['objects']> = {
72
97
  label: "全部"
73
98
  }
74
99
  }
75
- },
76
- sys_webhook_delivery: {
77
- label: "Webhook Delivery",
78
- pluralLabel: "Webhook Deliveries",
79
- description: "Durable outbox row for one webhook attempt. Managed by @objectstack/plugin-webhooks; do not write directly.",
80
- fields: {
81
- id: {
82
- label: "Delivery ID",
83
- help: "UUID — also doubles as the receiver-side idempotency key"
84
- },
85
- webhook_id: {
86
- label: "Webhook ID",
87
- help: "FK to sys_webhook.id (loosely coupled — denormalised URL/secret on row)"
88
- },
89
- event_id: {
90
- label: "Event ID",
91
- help: "Source event id; UNIQUE(event_id, webhook_id) for dedup"
92
- },
93
- event_type: {
94
- label: "Event Type",
95
- help: "e.g. data.record.created"
96
- },
97
- url: {
98
- label: "Target URL",
99
- help: "Snapshotted at enqueue so config edits do not rewrite live rows"
100
- },
101
- method: {
102
- label: "Method"
103
- },
104
- headers_json: {
105
- label: "Headers JSON"
106
- },
107
- secret: {
108
- label: "HMAC Secret"
109
- },
110
- timeout_ms: {
111
- label: "Timeout (ms)"
112
- },
113
- payload_json: {
114
- label: "Payload JSON"
115
- },
116
- partition_key: {
117
- label: "Partition",
118
- help: "hash(webhook_id) mod partitionCount — precomputed for cheap WHERE"
119
- },
120
- status: {
121
- label: "Status",
122
- help: "pending | in_flight | success | failed | dead"
123
- },
124
- attempts: {
125
- label: "Attempts",
126
- help: "Number of POST attempts made so far"
127
- },
128
- claimed_by: {
129
- label: "Claimed By"
130
- },
131
- claimed_at: {
132
- label: "Claimed At (ms)"
133
- },
134
- next_retry_at: {
135
- label: "Next Retry At (ms)"
136
- },
137
- last_attempted_at: {
138
- label: "Last Attempted At (ms)"
139
- },
140
- response_code: {
141
- label: "HTTP Status"
142
- },
143
- response_body: {
144
- label: "Response Body (capped)"
145
- },
146
- error: {
147
- label: "Error"
148
- },
149
- created_at: {
150
- label: "Created At (ms)"
151
- },
152
- updated_at: {
153
- label: "Updated At (ms)"
154
- }
155
- },
156
- _views: {
157
- recent: {
158
- label: "Recent"
159
- },
160
- failures: {
161
- label: "Failures"
162
- },
163
- in_flight: {
164
- label: "In Flight"
165
- },
166
- pending: {
167
- label: "Pending"
168
- },
169
- by_status: {
170
- label: "By Status"
171
- },
172
- by_webhook: {
173
- label: "By Webhook"
174
- },
175
- all_deliveries: {
176
- label: "All"
177
- }
178
- },
179
- _actions: {
180
- redeliver: {
181
- label: "Redeliver",
182
- confirmText: "Replay this delivery? The receiver will get the original payload again — they must be idempotent on the X-Objectstack-Delivery header.",
183
- successMessage: "Queued for redelivery"
184
- }
185
- }
186
100
  }
187
101
  };