@xtandard/webhooks 0.1.2 → 0.1.4
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/README.md +9 -6
- package/dist/cli.cjs +4 -4
- package/dist/cli.mjs +4 -4
- package/dist/{core-B1JzRitF.mjs → core-CSnkgzmP.mjs} +2 -2
- package/dist/{core-B1JzRitF.mjs.map → core-CSnkgzmP.mjs.map} +1 -1
- package/dist/{core-DuHD0Rdg.cjs → core-FOX5QhoI.cjs} +2 -2
- package/dist/{core-DuHD0Rdg.cjs.map → core-FOX5QhoI.cjs.map} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.mjs +1 -1
- package/dist/{create-fetch-handler-BNsNcspj.cjs → create-fetch-handler-B9gukX_e.cjs} +3 -3
- package/dist/{create-fetch-handler-BNsNcspj.cjs.map → create-fetch-handler-B9gukX_e.cjs.map} +1 -1
- package/dist/{create-fetch-handler-C6BqzdsN.mjs → create-fetch-handler-KPASJUhE.mjs} +3 -3
- package/dist/{create-fetch-handler-C6BqzdsN.mjs.map → create-fetch-handler-KPASJUhE.mjs.map} +1 -1
- package/dist/{dispatcher-CFfWo-fN.mjs → dispatcher-DIcpJOU0.mjs} +3 -3
- package/dist/{dispatcher-CFfWo-fN.mjs.map → dispatcher-DIcpJOU0.mjs.map} +1 -1
- package/dist/{dispatcher-COdWV6hM.cjs → dispatcher-Dw8nhSxY.cjs} +3 -3
- package/dist/{dispatcher-COdWV6hM.cjs.map → dispatcher-Dw8nhSxY.cjs.map} +1 -1
- package/dist/elysia-shared-Bhsy8h_n.cjs +58 -0
- package/dist/elysia-shared-Bhsy8h_n.cjs.map +1 -0
- package/dist/elysia-shared-BlmFhfOV.mjs +47 -0
- package/dist/elysia-shared-BlmFhfOV.mjs.map +1 -0
- package/dist/elysia-shared-CvSsqMbR.d.mts +19 -0
- package/dist/elysia-shared-DSSrfuoF.d.cts +19 -0
- package/dist/entry-bun.cjs +1 -1
- package/dist/entry-bun.mjs +1 -1
- package/dist/entry-elysia.cjs +5 -25
- package/dist/entry-elysia.cjs.map +1 -1
- package/dist/entry-elysia.d.cts +5 -15
- package/dist/entry-elysia.d.mts +5 -15
- package/dist/entry-elysia.mjs +4 -24
- package/dist/entry-elysia.mjs.map +1 -1
- package/dist/entry-elysia2.cjs +95 -0
- package/dist/entry-elysia2.cjs.map +1 -0
- package/dist/entry-elysia2.d.cts +1273 -0
- package/dist/entry-elysia2.d.mts +1273 -0
- package/dist/entry-elysia2.mjs +93 -0
- package/dist/entry-elysia2.mjs.map +1 -0
- package/dist/entry-express.cjs +1 -1
- package/dist/entry-express.mjs +1 -1
- package/dist/entry-hono.cjs +1 -1
- package/dist/entry-hono.mjs +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +3 -3
- package/dist/react.css +1 -1
- package/dist/react.js +4928 -4944
- package/dist/testing.cjs +2 -2
- package/dist/testing.mjs +2 -2
- package/dist/types-elysia2/adapters/elysia-shared.d.ts +34 -0
- package/dist/types-elysia2/adapters/elysia2.d.ts +820 -0
- package/dist/types-elysia2/auth/contract.d.ts +26 -0
- package/dist/types-elysia2/authorization/contract.d.ts +50 -0
- package/dist/types-elysia2/canonical.d.ts +27 -0
- package/dist/types-elysia2/core.d.ts +344 -0
- package/dist/types-elysia2/deliver.d.ts +79 -0
- package/dist/types-elysia2/delivery-sink.d.ts +57 -0
- package/dist/types-elysia2/dispatcher.d.ts +80 -0
- package/dist/types-elysia2/duration.d.ts +26 -0
- package/dist/types-elysia2/entry-elysia2.d.ts +8 -0
- package/dist/types-elysia2/hooks/contract.d.ts +203 -0
- package/dist/types-elysia2/id.d.ts +24 -0
- package/dist/types-elysia2/keys.d.ts +98 -0
- package/dist/types-elysia2/portal.d.ts +69 -0
- package/dist/types-elysia2/schema.d.ts +229 -0
- package/dist/types-elysia2/server/base-path.d.ts +15 -0
- package/dist/types-elysia2/server/cors.d.ts +36 -0
- package/dist/types-elysia2/server/create-fetch-handler.d.ts +121 -0
- package/dist/types-elysia2/server/openapi.d.ts +25 -0
- package/dist/types-elysia2/server/render-index-html.d.ts +18 -0
- package/dist/types-elysia2/server/routes.d.ts +52 -0
- package/dist/types-elysia2/server/static-assets.d.ts +13 -0
- package/dist/types-elysia2/signing.d.ts +88 -0
- package/dist/types-elysia2/storage/contract.d.ts +75 -0
- package/dist/types-elysia2/validation.d.ts +82 -0
- package/dist/types-elysia2/version.d.ts +8 -0
- package/dist/types-react/react.d.ts +16 -3
- package/dist/types-react/ui/App.d.ts +3 -1
- package/dist/types-react/ui/theme.d.ts +33 -5
- package/dist/ui/assets/{index-BgyX_njf.js → index-BJcdnARt.js} +48 -48
- package/dist/ui/index.html +1 -1
- package/package.json +21 -5
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
+
<img src="https://raw.githubusercontent.com/xantiagoma/xtandard-webhooks/main/docs/assets/logo-256.png" alt="@xtandard/webhooks" width="128" height="128" />
|
|
4
|
+
|
|
3
5
|
# @xtandard/webhooks
|
|
4
6
|
|
|
5
7
|
**Self-hosted, embeddable, [Standard Webhooks](https://www.standardwebhooks.com)-compliant outbound-webhooks control plane.**
|
|
@@ -10,7 +12,7 @@ Mount it inside your existing app, point it at the database you already run, and
|
|
|
10
12
|
[](https://www.npmjs.com/package/@xtandard/webhooks)
|
|
11
13
|
[](./LICENSE)
|
|
12
14
|
|
|
13
|
-
<img src="docs/assets/deliveries.png" alt="Deliveries view: attempt timeline with retries and dead-letters" width="800" />
|
|
15
|
+
<img src="https://raw.githubusercontent.com/xantiagoma/xtandard-webhooks/main/docs/assets/deliveries.png" alt="Deliveries view: attempt timeline with retries and dead-letters" width="800" />
|
|
14
16
|
|
|
15
17
|
</div>
|
|
16
18
|
|
|
@@ -93,7 +95,7 @@ import { webhooksPanel } from "@xtandard/webhooks/elysia";
|
|
|
93
95
|
import { createMemoryStorage } from "@xtandard/webhooks/storage/memory";
|
|
94
96
|
|
|
95
97
|
const webhooks = webhooksPanel({ storage: createMemoryStorage() });
|
|
96
|
-
new Elysia().mount("/webhooks", webhooks
|
|
98
|
+
new Elysia().mount("/webhooks", webhooks).listen(3000);
|
|
97
99
|
```
|
|
98
100
|
|
|
99
101
|
</details>
|
|
@@ -212,7 +214,7 @@ const token = await createPortalToken(process.env.PORTAL_SECRET!, customer.appKe
|
|
|
212
214
|
import { WebhooksPortal } from "@xtandard/webhooks/react";
|
|
213
215
|
import "@xtandard/webhooks/react/styles.css";
|
|
214
216
|
|
|
215
|
-
<WebhooksPortal
|
|
217
|
+
<WebhooksPortal apiBaseUrl="/webhooks" token={token} />;
|
|
216
218
|
```
|
|
217
219
|
|
|
218
220
|
Cross-application access is denied by construction — the host's authorization is never consulted for portal principals. Details: [docs/PORTAL.md](docs/PORTAL.md).
|
|
@@ -250,6 +252,7 @@ Split planes: control data in Postgres, delivery queue in Redis — `queueStorag
|
|
|
250
252
|
| `…/authorization/{none,roles,delegated}` | authorization providers |
|
|
251
253
|
| `…/hooks/log` | reference logging hook |
|
|
252
254
|
| `…/{elysia,hono,express,bun}` | framework adapters |
|
|
255
|
+
| `…/elysia2` | Elysia 2 adapter (typed for Elysia 2 + `@elysia/eden`) |
|
|
253
256
|
| `…/react`, `…/react/styles.css` | `<WebhooksDashboard>` + `<WebhooksPortal>` embeds |
|
|
254
257
|
|
|
255
258
|
## Examples
|
|
@@ -270,9 +273,9 @@ Split planes: control data in Postgres, delivery queue in Redis — `queueStorag
|
|
|
270
273
|
|
|
271
274
|
## Screenshots
|
|
272
275
|
|
|
273
|
-
|
|
|
274
|
-
|
|
|
275
|
-
|  |  |
|
|
276
|
+
| | |
|
|
277
|
+
| --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
278
|
+
|  |  |
|
|
276
279
|
|
|
277
280
|
## CLI
|
|
278
281
|
|
package/dist/cli.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_core = require("./core-
|
|
2
|
+
const require_core = require("./core-FOX5QhoI.cjs");
|
|
3
3
|
//#region src/cli.ts
|
|
4
4
|
const env = (key, fallback = "") => process.env[key] ?? fallback;
|
|
5
5
|
const isTruthy = (value) => value === "1" || value.toLowerCase() === "true";
|
|
@@ -504,7 +504,7 @@ async function run(argv) {
|
|
|
504
504
|
process.stderr.write("Invalid --data: expected a JSON string.\n");
|
|
505
505
|
return 1;
|
|
506
506
|
}
|
|
507
|
-
const { newId } = await Promise.resolve().then(() => require("./core-
|
|
507
|
+
const { newId } = await Promise.resolve().then(() => require("./core-FOX5QhoI.cjs")).then((n) => n.id_exports);
|
|
508
508
|
const { sign } = await Promise.resolve().then(() => require("./signing.cjs"));
|
|
509
509
|
const id = typeof flags.id === "string" ? flags.id : newId("msg");
|
|
510
510
|
const timestamp = typeof flags.timestamp === "string" ? Number(flags.timestamp) : Math.floor(Date.now() / 1e3);
|
|
@@ -574,7 +574,7 @@ async function run(argv) {
|
|
|
574
574
|
}
|
|
575
575
|
case "dispatch": {
|
|
576
576
|
const core = await makeCore();
|
|
577
|
-
const { createDispatcher } = await Promise.resolve().then(() => require("./dispatcher-
|
|
577
|
+
const { createDispatcher } = await Promise.resolve().then(() => require("./dispatcher-Dw8nhSxY.cjs")).then((n) => n.dispatcher_exports);
|
|
578
578
|
createDispatcher(core).start();
|
|
579
579
|
const [storageDesc, queueDesc] = await Promise.all([describeStorage("STORAGE"), env("QUEUE_STORAGE_DRIVER") ? describeStorage("QUEUE") : Promise.resolve("(same store)")]);
|
|
580
580
|
process.stdout.write(`[xtandard/webhooks] storage: ${storageDesc}\n`);
|
|
@@ -604,7 +604,7 @@ async function run(argv) {
|
|
|
604
604
|
const readonly = isTruthy(env("READONLY"));
|
|
605
605
|
const authMode = env("AUTH_MODE", "none");
|
|
606
606
|
const portalSecret = env("PORTAL_SECRET");
|
|
607
|
-
const { createFetchHandler } = await Promise.resolve().then(() => require("./create-fetch-handler-
|
|
607
|
+
const { createFetchHandler } = await Promise.resolve().then(() => require("./create-fetch-handler-B9gukX_e.cjs")).then((n) => n.create_fetch_handler_exports);
|
|
608
608
|
const [storage, queueStorage] = await Promise.all([buildStorage("STORAGE"), buildQueueStorage()]);
|
|
609
609
|
const { auth, authorization } = await buildAuth();
|
|
610
610
|
if (authMode === "none") process.stderr.write("[xtandard/webhooks] AUTH_MODE=none — do NOT expose this publicly without authentication.\n");
|
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as parseDurationList, o as createWebhooksCore, w as durationToMs } from "./core-
|
|
1
|
+
import { T as parseDurationList, o as createWebhooksCore, w as durationToMs } from "./core-CSnkgzmP.mjs";
|
|
2
2
|
//#region src/cli.ts
|
|
3
3
|
const env = (key, fallback = "") => process.env[key] ?? fallback;
|
|
4
4
|
const isTruthy = (value) => value === "1" || value.toLowerCase() === "true";
|
|
@@ -503,7 +503,7 @@ async function run(argv) {
|
|
|
503
503
|
process.stderr.write("Invalid --data: expected a JSON string.\n");
|
|
504
504
|
return 1;
|
|
505
505
|
}
|
|
506
|
-
const { newId } = await import("./core-
|
|
506
|
+
const { newId } = await import("./core-CSnkgzmP.mjs").then((n) => n.S);
|
|
507
507
|
const { sign } = await import("./signing.mjs");
|
|
508
508
|
const id = typeof flags.id === "string" ? flags.id : newId("msg");
|
|
509
509
|
const timestamp = typeof flags.timestamp === "string" ? Number(flags.timestamp) : Math.floor(Date.now() / 1e3);
|
|
@@ -573,7 +573,7 @@ async function run(argv) {
|
|
|
573
573
|
}
|
|
574
574
|
case "dispatch": {
|
|
575
575
|
const core = await makeCore();
|
|
576
|
-
const { createDispatcher } = await import("./dispatcher-
|
|
576
|
+
const { createDispatcher } = await import("./dispatcher-DIcpJOU0.mjs").then((n) => n.r);
|
|
577
577
|
createDispatcher(core).start();
|
|
578
578
|
const [storageDesc, queueDesc] = await Promise.all([describeStorage("STORAGE"), env("QUEUE_STORAGE_DRIVER") ? describeStorage("QUEUE") : Promise.resolve("(same store)")]);
|
|
579
579
|
process.stdout.write(`[xtandard/webhooks] storage: ${storageDesc}\n`);
|
|
@@ -603,7 +603,7 @@ async function run(argv) {
|
|
|
603
603
|
const readonly = isTruthy(env("READONLY"));
|
|
604
604
|
const authMode = env("AUTH_MODE", "none");
|
|
605
605
|
const portalSecret = env("PORTAL_SECRET");
|
|
606
|
-
const { createFetchHandler } = await import("./create-fetch-handler-
|
|
606
|
+
const { createFetchHandler } = await import("./create-fetch-handler-KPASJUhE.mjs").then((n) => n.n);
|
|
607
607
|
const [storage, queueStorage] = await Promise.all([buildStorage("STORAGE"), buildQueueStorage()]);
|
|
608
608
|
const { auth, authorization } = await buildAuth();
|
|
609
609
|
if (authMode === "none") process.stderr.write("[xtandard/webhooks] AUTH_MODE=none — do NOT expose this publicly without authentication.\n");
|
|
@@ -218,7 +218,7 @@ function idPattern(prefix) {
|
|
|
218
218
|
* @module
|
|
219
219
|
*/
|
|
220
220
|
/** The published package version. */
|
|
221
|
-
const VERSION = "0.1.
|
|
221
|
+
const VERSION = "0.1.4";
|
|
222
222
|
//#endregion
|
|
223
223
|
//#region src/hooks/contract.ts
|
|
224
224
|
/**
|
|
@@ -1619,4 +1619,4 @@ function createWebhooksCore(options) {
|
|
|
1619
1619
|
//#endregion
|
|
1620
1620
|
export { attemptDelivery as A, newId as C, DEFAULT_ATTEMPT_TIMEOUT_MS as D, emitDelivery as E, DEFAULT_RESPONSE_BODY_LIMIT as O, id_exports as S, parseDurationList as T, normalizeHooks as _, ReadonlyError as a, VERSION as b, RESERVED_HEADERS as c, validateApplication as d, validateEndpoint as f, defaultHookErrorReporter as g, HookDeniedError as h, PayloadTooLargeError as i, buildSignedRequest as j, activeSecrets as k, ValidationError as l, validateEventType as m, IdempotencyConflictError as n, createWebhooksCore as o, validateEndpointUrl as p, NotFoundError as r, KEY_REGEX as s, ConflictError as t, assertValid as u, runAfter as v, durationToMs as w, idPattern as x, runBefore as y };
|
|
1621
1621
|
|
|
1622
|
-
//# sourceMappingURL=core-
|
|
1622
|
+
//# sourceMappingURL=core-CSnkgzmP.mjs.map
|