@xtandard/webhooks 0.1.2 → 0.1.3
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 +1 -0
- package/dist/cli.cjs +4 -4
- package/dist/cli.mjs +4 -4
- package/dist/{core-DuHD0Rdg.cjs → core-DkIXozBY.cjs} +2 -2
- package/dist/{core-DuHD0Rdg.cjs.map → core-DkIXozBY.cjs.map} +1 -1
- package/dist/{core-B1JzRitF.mjs → core-tmmtadF1.mjs} +2 -2
- package/dist/{core-B1JzRitF.mjs.map → core-tmmtadF1.mjs.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-B5WBbf8x.cjs} +3 -3
- package/dist/{create-fetch-handler-BNsNcspj.cjs.map → create-fetch-handler-B5WBbf8x.cjs.map} +1 -1
- package/dist/{create-fetch-handler-C6BqzdsN.mjs → create-fetch-handler-DZohI08M.mjs} +3 -3
- package/dist/{create-fetch-handler-C6BqzdsN.mjs.map → create-fetch-handler-DZohI08M.mjs.map} +1 -1
- package/dist/{dispatcher-COdWV6hM.cjs → dispatcher-Bn4O874S.cjs} +3 -3
- package/dist/{dispatcher-COdWV6hM.cjs.map → dispatcher-Bn4O874S.cjs.map} +1 -1
- package/dist/{dispatcher-CFfWo-fN.mjs → dispatcher-CQcoIsS9.mjs} +3 -3
- package/dist/{dispatcher-CFfWo-fN.mjs.map → dispatcher-CQcoIsS9.mjs.map} +1 -1
- package/dist/elysia-shared-CgTU3yPa.mjs +47 -0
- package/dist/elysia-shared-CgTU3yPa.mjs.map +1 -0
- package/dist/elysia-shared-Cop1-ie0.cjs +58 -0
- package/dist/elysia-shared-Cop1-ie0.cjs.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/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/package.json +20 -5
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { n as webhooksPanel, t as createPass } from "./elysia-shared-CgTU3yPa.mjs";
|
|
2
|
+
import { Elysia, t } from "elysia";
|
|
3
|
+
//#region src/adapters/elysia2.ts
|
|
4
|
+
/**
|
|
5
|
+
* Elysia **2.x** adapter — same surface as `@xtandard/webhooks/elysia`, built
|
|
6
|
+
* against Elysia 2's types and its `(path, hook, handler)` route order. Use
|
|
7
|
+
* `@xtandard/webhooks/elysia` for Elysia 1.x.
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* new Elysia().mount("/webhooks", webhooksPanel({ basePath: "/webhooks", storage }));
|
|
11
|
+
* // or, typed for Eden treaty (`@elysia/eden`):
|
|
12
|
+
* const app = new Elysia().use(webhooksElysia({ prefix: "/webhooks", storage }));
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* The panel starts the delivery dispatcher by default; pass `dispatcher: false`
|
|
16
|
+
* for split-worker deployments.
|
|
17
|
+
*
|
|
18
|
+
* @module
|
|
19
|
+
*/
|
|
20
|
+
const appParams = t.Object({ app: t.String() });
|
|
21
|
+
const endpointParams = t.Object({
|
|
22
|
+
app: t.String(),
|
|
23
|
+
id: t.String()
|
|
24
|
+
});
|
|
25
|
+
const nameParams = t.Object({ name: t.String() });
|
|
26
|
+
/**
|
|
27
|
+
* Typed Elysia plugin exposing the admin API so the **Eden** client can call it
|
|
28
|
+
* with full path/method/param typing (`edenClient.webhooks.api.applications.get()`).
|
|
29
|
+
* Routes are declared for the typed surface; every handler delegates to the
|
|
30
|
+
* shared fetch pipeline (auth, authorization, portal scoping, error mapping
|
|
31
|
+
* reused). A catch-all also serves the bundled UI.
|
|
32
|
+
*
|
|
33
|
+
* Elysia 2.x only — for Elysia 1.x import from `@xtandard/webhooks/elysia`.
|
|
34
|
+
*/
|
|
35
|
+
function webhooksElysia(options) {
|
|
36
|
+
const { prefix, pass } = createPass(options);
|
|
37
|
+
const app = "/api/applications/:app";
|
|
38
|
+
const endpoint = `${app}/endpoints/:id`;
|
|
39
|
+
return new Elysia({
|
|
40
|
+
prefix,
|
|
41
|
+
name: "xtandard-webhooks"
|
|
42
|
+
}).get("/config", pass).get("/api/openapi.json", pass).get("/api/event-types.json", pass).get("/api/applications", pass).post("/api/applications", { body: t.Object({
|
|
43
|
+
key: t.String(),
|
|
44
|
+
name: t.Optional(t.String()),
|
|
45
|
+
metadata: t.Optional(t.Any())
|
|
46
|
+
}) }, pass).get(app, { params: appParams }, pass).put(app, {
|
|
47
|
+
params: appParams,
|
|
48
|
+
body: t.Any()
|
|
49
|
+
}, pass).delete(app, { params: appParams }, pass).get("/api/event-types", pass).post("/api/event-types", { body: t.Object({
|
|
50
|
+
name: t.String(),
|
|
51
|
+
description: t.Optional(t.String()),
|
|
52
|
+
groupName: t.Optional(t.String()),
|
|
53
|
+
schema: t.Optional(t.Any()),
|
|
54
|
+
deprecated: t.Optional(t.Boolean())
|
|
55
|
+
}) }, pass).get("/api/event-types/:name", { params: nameParams }, pass).put("/api/event-types/:name", {
|
|
56
|
+
params: nameParams,
|
|
57
|
+
body: t.Any()
|
|
58
|
+
}, pass).delete("/api/event-types/:name", { params: nameParams }, pass).get(`${app}/endpoints`, { params: appParams }, pass).post(`${app}/endpoints`, {
|
|
59
|
+
params: appParams,
|
|
60
|
+
body: t.Object({
|
|
61
|
+
url: t.String(),
|
|
62
|
+
description: t.Optional(t.String()),
|
|
63
|
+
eventTypes: t.Optional(t.Array(t.String())),
|
|
64
|
+
headers: t.Optional(t.Record(t.String(), t.String())),
|
|
65
|
+
metadata: t.Optional(t.Any()),
|
|
66
|
+
disabled: t.Optional(t.Boolean())
|
|
67
|
+
})
|
|
68
|
+
}, pass).get(endpoint, { params: endpointParams }, pass).put(endpoint, {
|
|
69
|
+
params: endpointParams,
|
|
70
|
+
body: t.Any()
|
|
71
|
+
}, pass).delete(endpoint, { params: endpointParams }, pass).get(`${endpoint}/secret`, { params: endpointParams }, pass).post(`${endpoint}/rotate-secret`, { params: endpointParams }, pass).post(`${endpoint}/enable`, { params: endpointParams }, pass).post(`${endpoint}/disable`, { params: endpointParams }, pass).post(`${endpoint}/test`, {
|
|
72
|
+
params: endpointParams,
|
|
73
|
+
body: t.Object({
|
|
74
|
+
eventType: t.String(),
|
|
75
|
+
payload: t.Optional(t.Any())
|
|
76
|
+
})
|
|
77
|
+
}, pass).post(`${endpoint}/recover`, {
|
|
78
|
+
params: endpointParams,
|
|
79
|
+
body: t.Object({ since: t.String() })
|
|
80
|
+
}, pass).get(`${app}/messages`, { params: appParams }, pass).post(`${app}/messages`, {
|
|
81
|
+
params: appParams,
|
|
82
|
+
body: t.Object({
|
|
83
|
+
eventType: t.String(),
|
|
84
|
+
payload: t.Any(),
|
|
85
|
+
timestamp: t.Optional(t.String()),
|
|
86
|
+
idempotencyKey: t.Optional(t.String())
|
|
87
|
+
})
|
|
88
|
+
}, pass).get(`${app}/messages/:id`, { params: endpointParams }, pass).get(`${app}/deliveries`, { params: appParams }, pass).get(`${app}/deliveries/:id`, { params: endpointParams }, pass).post(`${app}/deliveries/:id/retry`, { params: endpointParams }, pass).get(`${app}/audit`, { params: appParams }, pass).all("/*", pass);
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
91
|
+
export { webhooksElysia, webhooksPanel };
|
|
92
|
+
|
|
93
|
+
//# sourceMappingURL=entry-elysia2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-elysia2.mjs","names":[],"sources":["../src/adapters/elysia2.ts"],"sourcesContent":["/**\n * Elysia **2.x** adapter — same surface as `@xtandard/webhooks/elysia`, built\n * against Elysia 2's types and its `(path, hook, handler)` route order. Use\n * `@xtandard/webhooks/elysia` for Elysia 1.x.\n *\n * ```ts\n * new Elysia().mount(\"/webhooks\", webhooksPanel({ basePath: \"/webhooks\", storage }));\n * // or, typed for Eden treaty (`@elysia/eden`):\n * const app = new Elysia().use(webhooksElysia({ prefix: \"/webhooks\", storage }));\n * ```\n *\n * The panel starts the delivery dispatcher by default; pass `dispatcher: false`\n * for split-worker deployments.\n *\n * @module\n */\n\nimport { Elysia, t } from \"elysia\";\nimport {\n createPass,\n webhooksPanel,\n type ElysiaWebhooksHandler,\n type WebhooksElysiaOptions,\n type WebhooksPanelOptions,\n} from \"./elysia-shared.ts\";\n\nexport { webhooksPanel };\nexport type { ElysiaWebhooksHandler, WebhooksElysiaOptions, WebhooksPanelOptions };\n\nconst appParams = t.Object({ app: t.String() });\nconst endpointParams = t.Object({ app: t.String(), id: t.String() });\nconst nameParams = t.Object({ name: t.String() });\n\n/**\n * Typed Elysia plugin exposing the admin API so the **Eden** client can call it\n * with full path/method/param typing (`edenClient.webhooks.api.applications.get()`).\n * Routes are declared for the typed surface; every handler delegates to the\n * shared fetch pipeline (auth, authorization, portal scoping, error mapping\n * reused). A catch-all also serves the bundled UI.\n *\n * Elysia 2.x only — for Elysia 1.x import from `@xtandard/webhooks/elysia`.\n */\nexport function webhooksElysia(options: WebhooksElysiaOptions) {\n const { prefix, pass } = createPass(options);\n\n const app = \"/api/applications/:app\";\n const endpoint = `${app}/endpoints/:id`;\n\n return new Elysia({ prefix, name: \"xtandard-webhooks\" })\n .get(\"/config\", pass)\n .get(\"/api/openapi.json\", pass)\n .get(\"/api/event-types.json\", pass)\n .get(\"/api/applications\", pass)\n .post(\n \"/api/applications\",\n {\n body: t.Object({\n key: t.String(),\n name: t.Optional(t.String()),\n metadata: t.Optional(t.Any()),\n }),\n },\n pass,\n )\n .get(app, { params: appParams }, pass)\n .put(app, { params: appParams, body: t.Any() }, pass)\n .delete(app, { params: appParams }, pass)\n .get(\"/api/event-types\", pass)\n .post(\n \"/api/event-types\",\n {\n body: t.Object({\n name: t.String(),\n description: t.Optional(t.String()),\n groupName: t.Optional(t.String()),\n schema: t.Optional(t.Any()),\n deprecated: t.Optional(t.Boolean()),\n }),\n },\n pass,\n )\n .get(\"/api/event-types/:name\", { params: nameParams }, pass)\n .put(\"/api/event-types/:name\", { params: nameParams, body: t.Any() }, pass)\n .delete(\"/api/event-types/:name\", { params: nameParams }, pass)\n .get(`${app}/endpoints`, { params: appParams }, pass)\n .post(\n `${app}/endpoints`,\n {\n params: appParams,\n body: t.Object({\n url: t.String(),\n description: t.Optional(t.String()),\n eventTypes: t.Optional(t.Array(t.String())),\n headers: t.Optional(t.Record(t.String(), t.String())),\n metadata: t.Optional(t.Any()),\n disabled: t.Optional(t.Boolean()),\n }),\n },\n pass,\n )\n .get(endpoint, { params: endpointParams }, pass)\n .put(endpoint, { params: endpointParams, body: t.Any() }, pass)\n .delete(endpoint, { params: endpointParams }, pass)\n .get(`${endpoint}/secret`, { params: endpointParams }, pass)\n .post(`${endpoint}/rotate-secret`, { params: endpointParams }, pass)\n .post(`${endpoint}/enable`, { params: endpointParams }, pass)\n .post(`${endpoint}/disable`, { params: endpointParams }, pass)\n .post(\n `${endpoint}/test`,\n {\n params: endpointParams,\n body: t.Object({ eventType: t.String(), payload: t.Optional(t.Any()) }),\n },\n pass,\n )\n .post(\n `${endpoint}/recover`,\n {\n params: endpointParams,\n body: t.Object({ since: t.String() }),\n },\n pass,\n )\n .get(`${app}/messages`, { params: appParams }, pass)\n .post(\n `${app}/messages`,\n {\n params: appParams,\n body: t.Object({\n eventType: t.String(),\n payload: t.Any(),\n timestamp: t.Optional(t.String()),\n idempotencyKey: t.Optional(t.String()),\n }),\n },\n pass,\n )\n .get(`${app}/messages/:id`, { params: endpointParams }, pass)\n .get(`${app}/deliveries`, { params: appParams }, pass)\n .get(`${app}/deliveries/:id`, { params: endpointParams }, pass)\n .post(`${app}/deliveries/:id/retry`, { params: endpointParams }, pass)\n .get(`${app}/audit`, { params: appParams }, pass)\n .all(\"/*\", pass); // bundled UI assets + SPA fallback\n}\n"],"mappings":"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"}
|
package/dist/entry-express.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_create_fetch_handler = require("./create-fetch-handler-
|
|
2
|
+
const require_create_fetch_handler = require("./create-fetch-handler-B5WBbf8x.cjs");
|
|
3
3
|
//#region src/adapters/express.ts
|
|
4
4
|
function headersFrom(req) {
|
|
5
5
|
const headers = new Headers();
|
package/dist/entry-express.mjs
CHANGED
package/dist/entry-hono.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_create_fetch_handler = require("./create-fetch-handler-
|
|
2
|
+
const require_create_fetch_handler = require("./create-fetch-handler-B5WBbf8x.cjs");
|
|
3
3
|
let hono = require("hono");
|
|
4
4
|
//#region src/adapters/hono.ts
|
|
5
5
|
/**
|
package/dist/entry-hono.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_keys = require("./keys-FiKpaVHX.cjs");
|
|
3
3
|
const require_schema = require("./schema.cjs");
|
|
4
|
-
const require_core = require("./core-
|
|
4
|
+
const require_core = require("./core-DkIXozBY.cjs");
|
|
5
5
|
const require_signing = require("./signing.cjs");
|
|
6
6
|
const require_contract = require("./contract-Bf1qguwt.cjs");
|
|
7
|
-
const require_dispatcher = require("./dispatcher-
|
|
7
|
+
const require_dispatcher = require("./dispatcher-Bn4O874S.cjs");
|
|
8
8
|
const require_contract$1 = require("./contract-B2d5dNU3.cjs");
|
|
9
|
-
const require_create_fetch_handler = require("./create-fetch-handler-
|
|
9
|
+
const require_create_fetch_handler = require("./create-fetch-handler-B5WBbf8x.cjs");
|
|
10
10
|
//#region src/storage/watch.ts
|
|
11
11
|
/**
|
|
12
12
|
* Wrap a storage so it implements {@link WatchableWebhooksStorage} using
|
package/dist/index.d.cts
CHANGED
|
@@ -17,7 +17,7 @@ import { SECRET_PREFIX, VerifyInput, WebhookVerificationError, generateSecret, s
|
|
|
17
17
|
* @module
|
|
18
18
|
*/
|
|
19
19
|
/** The published package version. */
|
|
20
|
-
declare const VERSION = "0.1.
|
|
20
|
+
declare const VERSION = "0.1.3";
|
|
21
21
|
declare namespace keys_d_exports {
|
|
22
22
|
export { DueEntry, RESERVED_APPLICATION_KEYS, ROOT, applicationMetaKey, applicationPrefix, applicationsKey, attemptKey, attemptsPrefix, auditLogKey, byEndpointKey, byEndpointPrefix, byMessageKey, byMessagePrefix, deliveriesPrefix, deliveryKey, dueKey, duePrefix, endpointKey, endpointsKey, eventTypeKey, eventTypesKey, globalAuditLogKey, idempotencyKey, lastSegment, messageKey, messagesPrefix, parseDueKey };
|
|
23
23
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -15,7 +15,7 @@ import { SECRET_PREFIX, VerifyInput, WebhookVerificationError, generateSecret, s
|
|
|
15
15
|
* @module
|
|
16
16
|
*/
|
|
17
17
|
/** The published package version. */
|
|
18
|
-
declare const VERSION = "0.1.
|
|
18
|
+
declare const VERSION = "0.1.3";
|
|
19
19
|
declare namespace keys_d_exports {
|
|
20
20
|
export { DueEntry, RESERVED_APPLICATION_KEYS, ROOT, applicationMetaKey, applicationPrefix, applicationsKey, attemptKey, attemptsPrefix, auditLogKey, byEndpointKey, byEndpointPrefix, byMessageKey, byMessagePrefix, deliveriesPrefix, deliveryKey, dueKey, duePrefix, endpointKey, endpointsKey, eventTypeKey, eventTypesKey, globalAuditLogKey, idempotencyKey, lastSegment, messageKey, messagesPrefix, parseDueKey };
|
|
21
21
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SCHEMA_VERSION, isTerminalDeliveryStatus } from "./schema.mjs";
|
|
2
|
-
import { A as attemptDelivery, C as newId, D as DEFAULT_ATTEMPT_TIMEOUT_MS, E as emitDelivery, O as DEFAULT_RESPONSE_BODY_LIMIT, T as parseDurationList, _ as normalizeHooks, a as ReadonlyError, b as VERSION, c as RESERVED_HEADERS, d as validateApplication, f as validateEndpoint, g as defaultHookErrorReporter, h as HookDeniedError, i as PayloadTooLargeError, j as buildSignedRequest, k as activeSecrets, l as ValidationError, m as validateEventType, n as IdempotencyConflictError, o as createWebhooksCore, p as validateEndpointUrl, r as NotFoundError, s as KEY_REGEX, t as ConflictError, u as assertValid, v as runAfter, w as durationToMs, x as idPattern, y as runBefore } from "./core-
|
|
2
|
+
import { A as attemptDelivery, C as newId, D as DEFAULT_ATTEMPT_TIMEOUT_MS, E as emitDelivery, O as DEFAULT_RESPONSE_BODY_LIMIT, T as parseDurationList, _ as normalizeHooks, a as ReadonlyError, b as VERSION, c as RESERVED_HEADERS, d as validateApplication, f as validateEndpoint, g as defaultHookErrorReporter, h as HookDeniedError, i as PayloadTooLargeError, j as buildSignedRequest, k as activeSecrets, l as ValidationError, m as validateEventType, n as IdempotencyConflictError, o as createWebhooksCore, p as validateEndpointUrl, r as NotFoundError, s as KEY_REGEX, t as ConflictError, u as assertValid, v as runAfter, w as durationToMs, x as idPattern, y as runBefore } from "./core-tmmtadF1.mjs";
|
|
3
3
|
import { SECRET_PREFIX, WebhookVerificationError, generateSecret, sign, signatureHeader, verify } from "./signing.mjs";
|
|
4
4
|
import { x as keys_exports } from "./keys-Byyj4quQ.mjs";
|
|
5
5
|
import { a as requirePeer, i as isWatchable, n as isCompareAndSwap, r as isTransactional, t as hasDeliveryQueue } from "./contract-BEhDcd_5.mjs";
|
|
6
|
-
import { n as createDispatcher, t as DEFAULT_RETRY_SCHEDULE } from "./dispatcher-
|
|
6
|
+
import { n as createDispatcher, t as DEFAULT_RETRY_SCHEDULE } from "./dispatcher-CQcoIsS9.mjs";
|
|
7
7
|
import { n as isMutatingAction, t as MUTATING_ACTIONS } from "./contract-9XpcwcCn.mjs";
|
|
8
|
-
import { a as PORTAL_TOKEN_PREFIX, c as verifyPortalToken, i as buildOpenApiDocument, o as PortalTokenError, r as DEFAULT_PORTAL_ACTIONS, s as createPortalToken, t as createFetchHandler } from "./create-fetch-handler-
|
|
8
|
+
import { a as PORTAL_TOKEN_PREFIX, c as verifyPortalToken, i as buildOpenApiDocument, o as PortalTokenError, r as DEFAULT_PORTAL_ACTIONS, s as createPortalToken, t as createFetchHandler } from "./create-fetch-handler-DZohI08M.mjs";
|
|
9
9
|
//#region src/storage/watch.ts
|
|
10
10
|
/**
|
|
11
11
|
* Wrap a storage so it implements {@link WatchableWebhooksStorage} using
|
package/dist/testing.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_core = require("./core-
|
|
2
|
+
const require_core = require("./core-DkIXozBY.cjs");
|
|
3
3
|
const require_signing = require("./signing.cjs");
|
|
4
|
-
const require_dispatcher = require("./dispatcher-
|
|
4
|
+
const require_dispatcher = require("./dispatcher-Bn4O874S.cjs");
|
|
5
5
|
const require_memory = require("./memory-8Ef-PL5a.cjs");
|
|
6
6
|
let node_http = require("node:http");
|
|
7
7
|
//#region src/testing.ts
|
package/dist/testing.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { o as createWebhooksCore } from "./core-
|
|
1
|
+
import { o as createWebhooksCore } from "./core-tmmtadF1.mjs";
|
|
2
2
|
import { verify } from "./signing.mjs";
|
|
3
|
-
import { n as createDispatcher } from "./dispatcher-
|
|
3
|
+
import { n as createDispatcher } from "./dispatcher-CQcoIsS9.mjs";
|
|
4
4
|
import { t as createMemoryStorage } from "./memory-BMsSSwqn.mjs";
|
|
5
5
|
import { createServer } from "node:http";
|
|
6
6
|
//#region src/testing.ts
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Elysia-version-agnostic pieces shared by the 1.x (`./elysia.ts`) and 2.x
|
|
3
|
+
* (`./elysia2.ts`) adapters. Must not import `elysia`: each adapter's types are
|
|
4
|
+
* built against a different major.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
import { createFetchHandler, type WebhooksPanelOptions } from "../server/create-fetch-handler.ts";
|
|
9
|
+
/** A web-standard fetch handler with `core` + `dispatcher` + `openapi()` attached. */
|
|
10
|
+
export type ElysiaWebhooksHandler = ((request: Request) => Promise<Response>) & {
|
|
11
|
+
core: ReturnType<typeof createFetchHandler>["core"];
|
|
12
|
+
dispatcher: ReturnType<typeof createFetchHandler>["dispatcher"];
|
|
13
|
+
openapi: ReturnType<typeof createFetchHandler>["openapi"];
|
|
14
|
+
};
|
|
15
|
+
/** Create a panel handler suitable for `Elysia.mount(path, handler)`. */
|
|
16
|
+
export declare function webhooksPanel(options: WebhooksPanelOptions): ElysiaWebhooksHandler;
|
|
17
|
+
/** Options for `webhooksElysia`. */
|
|
18
|
+
export interface WebhooksElysiaOptions extends WebhooksPanelOptions {
|
|
19
|
+
/** Mount prefix; also used as the panel basePath. Default `"/webhooks"`. */
|
|
20
|
+
prefix?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Build the handler every declared route delegates to. Elysia parses the body
|
|
24
|
+
* for declared routes, draining the stream; rebuild the Request from the parsed
|
|
25
|
+
* body before delegating (mirrors the Express adapter).
|
|
26
|
+
*/
|
|
27
|
+
export declare function createPass(options: WebhooksElysiaOptions): {
|
|
28
|
+
prefix: string;
|
|
29
|
+
pass: (ctx: {
|
|
30
|
+
request: Request;
|
|
31
|
+
body?: unknown;
|
|
32
|
+
}) => Promise<Response>;
|
|
33
|
+
};
|
|
34
|
+
export type { WebhooksPanelOptions };
|