@vite-hub/webhooks 0.5.0 → 0.6.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/README.md +1 -0
- package/dist/{database-ih8X0nxf.d.ts → database-C5cwO1an.d.ts} +0 -4
- package/dist/database.d.ts +1 -1
- package/dist/database.js +2 -3
- package/dist/{errors-CIAKA8pC.js → errors-DT8uyCh7.js} +1 -2
- package/dist/index.d.ts +4 -10
- package/dist/index.js +6 -8
- package/dist/{members-CvRoM95o.d.ts → members-Cn93y6gO.d.ts} +10 -6
- package/dist/{members-B7Lr2AH0.js → members-DvpsP5Px.js} +18 -8
- package/dist/{object-Da1zyPCR.js → object-CAK6UYR5.js} +1 -2
- package/dist/{operations-VyyNZusz.d.ts → operations-8hqTi0DH.d.ts} +0 -2
- package/dist/operations.d.ts +4 -6
- package/dist/operations.js +14 -698
- package/dist/{queue-name-CGeTSHId.d.ts → queue-name-CLdaJFPZ.d.ts} +0 -2
- package/dist/{queue-name-RURp9SQf.js → queue-name-jmgeppja.js} +1 -2
- package/dist/{runtime-jKXp2Hh0.js → runtime-BFiCJOMB.js} +5 -9
- package/dist/{runtime-C-JYQJxn.d.ts → runtime-BYILR6Zc.d.ts} +2 -8
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.js +2 -2
- package/dist/{table-names-C01h1z-T.js → table-names-DAUip4v2.js} +1 -2
- package/dist/vite.d.ts +3 -15
- package/dist/vite.js +10 -16
- package/package.json +10 -9
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/queue-name.ts
|
|
2
2
|
/** The internal Queue that delivers every webhook. Its own module, so the Vite plugin reads it without the runtime. */
|
|
3
3
|
const webhooksQueueName = "vitehub-webhooks";
|
|
4
|
-
//#endregion
|
|
5
4
|
export { webhooksQueueName as t };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as webhooksErrors } from "./errors-
|
|
1
|
+
import { t as webhooksErrors } from "./errors-DT8uyCh7.js";
|
|
2
2
|
import { signWebhook } from "@vite-hub/env";
|
|
3
3
|
import { onRunFailed, runFailedEventNames } from "@vite-hub/runtime/internal/run-failed";
|
|
4
4
|
import { parseDuration } from "@vite-hub/runtime";
|
|
5
5
|
import { importSealKey, sealWithKey, unsealWithKey } from "@vite-hub/env/seal";
|
|
6
6
|
import { getViteHubTestMode } from "@vite-hub/runtime/internal/test-mode";
|
|
7
|
-
|
|
7
|
+
// src/define.ts
|
|
8
8
|
const definitionBrand = Symbol.for("vitehub.webhooks.definition");
|
|
9
9
|
const variableName = /^[A-Z_][A-Z0-9_]*$/i;
|
|
10
10
|
function isWebhookEvent(value) {
|
|
@@ -56,8 +56,7 @@ function defineWebhook(options) {
|
|
|
56
56
|
function isWebhookDefinition(value) {
|
|
57
57
|
return typeof value === "object" && value !== null && Reflect.get(value, definitionBrand) === true;
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
//#region ../internal/src/runtime/cloudflare-env-lookup.ts
|
|
59
|
+
// ../internal/src/runtime/cloudflare-env-lookup.ts
|
|
61
60
|
/** The key of the AsyncLocalStorage store on `globalThis`. Every bundled copy of this module shares the store. */
|
|
62
61
|
const activeEnvStorageKey = Symbol.for("vitehub.cloudflare.env-storage");
|
|
63
62
|
let activeEnv;
|
|
@@ -166,8 +165,7 @@ const sealedMemberBodyPrefix = "vitehub:sealed-member-body:";
|
|
|
166
165
|
function memberBodyLabel(webhook, event) {
|
|
167
166
|
return `delivery:${JSON.stringify([webhook, event])}`;
|
|
168
167
|
}
|
|
169
|
-
|
|
170
|
-
//#region src/url-guard.ts
|
|
168
|
+
// src/url-guard.ts
|
|
171
169
|
function refuse(reason) {
|
|
172
170
|
return [webhooksErrors.WEBHOOKS_URL_REFUSED({ reason }), void 0];
|
|
173
171
|
}
|
|
@@ -306,8 +304,7 @@ async function resolveWebhookUrl(url, options = {}) {
|
|
|
306
304
|
addresses
|
|
307
305
|
}];
|
|
308
306
|
}
|
|
309
|
-
|
|
310
|
-
//#region src/runtime.ts
|
|
307
|
+
// src/runtime.ts
|
|
311
308
|
/** Attempts of one delivery before it is `dead`: one delivery and three retries, as Cloudflare Queues does by default. */
|
|
312
309
|
const webhookMaxAttempts = 4;
|
|
313
310
|
/** How long a receiver has to answer. */
|
|
@@ -914,5 +911,4 @@ async function redeliverToMember(installed, source, endpoint) {
|
|
|
914
911
|
if (wakeError) throw wakeError;
|
|
915
912
|
return result;
|
|
916
913
|
}
|
|
917
|
-
//#endregion
|
|
918
914
|
export { sealedMemberBodyPrefix as A, webhookTestEvent as C, memberBodyLabel as D, outsideHosts as E, unsealWebhooksText as M, defineWebhook as N, sealEndpoint as O, webhookMaxAttempts as S, checkWebhookUrl as T, requireMemberEndpoints as _, flushWebhookDelivery as a, testWebhook as b, installWebhooks as c, listWebhookDeliveries as d, listWebhooks as f, redeliverWebhookDelivery as g, postDelivery as h, deliverWebhookWake as i, unsealEndpoint as j, sealWebhooksText as k, installedWebhooks as l, ownsMemberEndpoint as m, createDeliveryId as n, getWebhookDelivery as o, memberWebhookPrefix as p, deliverMemberClaim as r, inspectDelivery as s, cancelWebhookDelivery as t, listPendingWebhookDeliveries as u, selectDefaultDatabase as v, webhookTimeoutMs as w, wake as x, sendDynamicWebhook as y };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { C as WebhookDeliveryErrorCode, S as SendWebhookErrorCode, a as SendToMemberEndpointResult, w as webhooksErrors } from "./members-Cn93y6gO.js";
|
|
2
|
+
import { f as WebhookDeliveryStore, g as WebhooksDatabase, n as ListWebhookDeliveriesOptions, p as WebhookEndpointStore, r as MemberEndpoint, u as WebhookDelivery } from "./database-C5cwO1an.js";
|
|
3
3
|
import { RunFailedEvent, RunFailedEventName } from "@vite-hub/runtime/internal/run-failed";
|
|
4
4
|
import { Duration, Result } from "@vite-hub/runtime";
|
|
5
|
-
//#region src/define.d.ts
|
|
6
5
|
/** How a delivery is signed. Both use HMAC-SHA256 of the raw body with the secret. */
|
|
7
6
|
type WebhookSignature = "github" | "stripe";
|
|
8
7
|
/**
|
|
@@ -62,8 +61,6 @@ interface WebhookDefinition {
|
|
|
62
61
|
* ```
|
|
63
62
|
*/
|
|
64
63
|
declare function defineWebhook(options: WebhookOptions): WebhookDefinition;
|
|
65
|
-
//#endregion
|
|
66
|
-
//#region src/sealing.d.ts
|
|
67
64
|
/** The URL and secret of a member endpoint, as the sealed text holds them. */
|
|
68
65
|
interface EndpointTarget {
|
|
69
66
|
url: string;
|
|
@@ -77,8 +74,6 @@ type KeyError = ReturnType<typeof webhooksErrors.WEBHOOKS_KEY_UNSET | typeof web
|
|
|
77
74
|
declare function sealWebhooksText(label: string, text: string, developmentKey?: string): Promise<[KeyError, undefined] | [undefined, string]>;
|
|
78
75
|
/** Opens the text that `sealWebhooksText()` sealed with the same `label`. */
|
|
79
76
|
declare function unsealWebhooksText(label: string, sealed: string, developmentKey?: string): Promise<[KeyError, undefined] | [undefined, string]>;
|
|
80
|
-
//#endregion
|
|
81
|
-
//#region src/runtime.d.ts
|
|
82
77
|
/** Attempts of one delivery before it is `dead`: one delivery and three retries, as Cloudflare Queues does by default. */
|
|
83
78
|
declare const webhookMaxAttempts = 4;
|
|
84
79
|
/** How long a receiver has to answer. */
|
|
@@ -263,5 +258,4 @@ declare function cancelWebhookDelivery(id: string): Promise<Result<WebhookDelive
|
|
|
263
258
|
* `WEBHOOKS_DELIVERY_NOT_OWNER`. It posts in the request, as `sendToMemberEndpoint()` does, and returns its status.
|
|
264
259
|
*/
|
|
265
260
|
declare function redeliverWebhookDelivery(id: string, options?: WebhookDeliveryActionOptions): Promise<Result<SendWebhookResult | SendToMemberEndpointResult, WebhookDeliveryErrorCode>>;
|
|
266
|
-
//#endregion
|
|
267
261
|
export { testWebhook as A, WebhookSignature as B, memberWebhookPrefix as C, requireMemberEndpoints as D, redeliverWebhookDelivery as E, sealWebhooksText as F, unsealWebhooksText as I, WebhookDefinition as L, webhookMaxAttempts as M, webhookTestEvent as N, selectDefaultDatabase as O, webhookTimeoutMs as P, WebhookEvent as R, listWebhooks as S, postDelivery as T, defineWebhook as V, inspectDelivery as _, SendWebhookResult as a, listPendingWebhookDeliveries as b, WebhookInfo as c, cancelWebhookDelivery as d, createDeliveryId as f, getWebhookDelivery as g, flushWebhookDelivery as h, PostResult as i, wake as j, sendDynamicWebhook as k, WebhookWake as l, deliverWebhookWake as m, InstalledWebhooks as n, WebhookDeliveryActionOptions as o, deliverMemberClaim as p, MemberCaller as r, WebhookEventBody as s, InstallWebhooksOptions as t, WebhookWakeSender as u, installWebhooks as v, ownsMemberEndpoint as w, listWebhookDeliveries as x, installedWebhooks as y, WebhookOptions as z };
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as testWebhook, C as memberWebhookPrefix, D as requireMemberEndpoints, E as redeliverWebhookDelivery, M as webhookMaxAttempts, N as webhookTestEvent, O as selectDefaultDatabase, P as webhookTimeoutMs, S as listWebhooks, T as postDelivery, _ as inspectDelivery, a as SendWebhookResult, b as listPendingWebhookDeliveries, c as WebhookInfo, d as cancelWebhookDelivery, f as createDeliveryId, g as getWebhookDelivery, h as flushWebhookDelivery, i as PostResult, j as wake, k as sendDynamicWebhook, l as WebhookWake, m as deliverWebhookWake, n as InstalledWebhooks, o as WebhookDeliveryActionOptions, p as deliverMemberClaim, r as MemberCaller, s as WebhookEventBody, t as InstallWebhooksOptions, u as WebhookWakeSender, v as installWebhooks, w as ownsMemberEndpoint, x as listWebhookDeliveries, y as installedWebhooks } from "./runtime-
|
|
2
|
-
import { t as webhooksQueueName } from "./queue-name-
|
|
1
|
+
import { A as testWebhook, C as memberWebhookPrefix, D as requireMemberEndpoints, E as redeliverWebhookDelivery, M as webhookMaxAttempts, N as webhookTestEvent, O as selectDefaultDatabase, P as webhookTimeoutMs, S as listWebhooks, T as postDelivery, _ as inspectDelivery, a as SendWebhookResult, b as listPendingWebhookDeliveries, c as WebhookInfo, d as cancelWebhookDelivery, f as createDeliveryId, g as getWebhookDelivery, h as flushWebhookDelivery, i as PostResult, j as wake, k as sendDynamicWebhook, l as WebhookWake, m as deliverWebhookWake, n as InstalledWebhooks, o as WebhookDeliveryActionOptions, p as deliverMemberClaim, r as MemberCaller, s as WebhookEventBody, t as InstallWebhooksOptions, u as WebhookWakeSender, v as installWebhooks, w as ownsMemberEndpoint, x as listWebhookDeliveries, y as installedWebhooks } from "./runtime-BYILR6Zc.js";
|
|
2
|
+
import { t as webhooksQueueName } from "./queue-name-CLdaJFPZ.js";
|
|
3
3
|
export { InstallWebhooksOptions, InstalledWebhooks, MemberCaller, PostResult, SendWebhookResult, WebhookDeliveryActionOptions, WebhookEventBody, WebhookInfo, WebhookWake, WebhookWakeSender, cancelWebhookDelivery, createDeliveryId, deliverMemberClaim, deliverWebhookWake, flushWebhookDelivery, getWebhookDelivery, inspectDelivery, installWebhooks, installedWebhooks, listPendingWebhookDeliveries, listWebhookDeliveries, listWebhooks, memberWebhookPrefix, ownsMemberEndpoint, postDelivery, redeliverWebhookDelivery, requireMemberEndpoints, selectDefaultDatabase, sendDynamicWebhook, testWebhook, wake, webhookMaxAttempts, webhookTestEvent, webhookTimeoutMs, webhooksQueueName };
|
package/dist/runtime.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as webhookTestEvent, S as webhookMaxAttempts, _ as requireMemberEndpoints, a as flushWebhookDelivery, b as testWebhook, c as installWebhooks, d as listWebhookDeliveries, f as listWebhooks, g as redeliverWebhookDelivery, h as postDelivery, i as deliverWebhookWake, l as installedWebhooks, m as ownsMemberEndpoint, n as createDeliveryId, o as getWebhookDelivery, p as memberWebhookPrefix, r as deliverMemberClaim, s as inspectDelivery, t as cancelWebhookDelivery, u as listPendingWebhookDeliveries, v as selectDefaultDatabase, w as webhookTimeoutMs, x as wake, y as sendDynamicWebhook } from "./runtime-
|
|
2
|
-
import { t as webhooksQueueName } from "./queue-name-
|
|
1
|
+
import { C as webhookTestEvent, S as webhookMaxAttempts, _ as requireMemberEndpoints, a as flushWebhookDelivery, b as testWebhook, c as installWebhooks, d as listWebhookDeliveries, f as listWebhooks, g as redeliverWebhookDelivery, h as postDelivery, i as deliverWebhookWake, l as installedWebhooks, m as ownsMemberEndpoint, n as createDeliveryId, o as getWebhookDelivery, p as memberWebhookPrefix, r as deliverMemberClaim, s as inspectDelivery, t as cancelWebhookDelivery, u as listPendingWebhookDeliveries, v as selectDefaultDatabase, w as webhookTimeoutMs, x as wake, y as sendDynamicWebhook } from "./runtime-BFiCJOMB.js";
|
|
2
|
+
import { t as webhooksQueueName } from "./queue-name-jmgeppja.js";
|
|
3
3
|
export { cancelWebhookDelivery, createDeliveryId, deliverMemberClaim, deliverWebhookWake, flushWebhookDelivery, getWebhookDelivery, inspectDelivery, installWebhooks, installedWebhooks, listPendingWebhookDeliveries, listWebhookDeliveries, listWebhooks, memberWebhookPrefix, ownsMemberEndpoint, postDelivery, redeliverWebhookDelivery, requireMemberEndpoints, selectDefaultDatabase, sendDynamicWebhook, testWebhook, wake, webhookMaxAttempts, webhookTestEvent, webhookTimeoutMs, webhooksQueueName };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/table-names.ts
|
|
2
2
|
/**
|
|
3
3
|
* The schema keys of `webhooksSchema` and their SQL names. Its own module, so the Vite plugin lists the table without
|
|
4
4
|
* loading Drizzle during config resolution.
|
|
@@ -9,5 +9,4 @@ const webhookEndpointsTableNames = {
|
|
|
9
9
|
webhookEndpoints: "vitehub_webhook_endpoints",
|
|
10
10
|
webhookPairings: "vitehub_webhook_pairings"
|
|
11
11
|
};
|
|
12
|
-
//#endregion
|
|
13
12
|
export { webhooksTableNames as n, webhookEndpointsTableNames as t };
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { t as webhooksQueueName } from "./queue-name-
|
|
2
|
-
import { n as OperationContributions } from "./operations-
|
|
1
|
+
import { t as webhooksQueueName } from "./queue-name-CLdaJFPZ.js";
|
|
2
|
+
import { n as OperationContributions } from "./operations-8hqTi0DH.js";
|
|
3
3
|
import { Plugin } from "vite";
|
|
4
|
-
//#region ../internal/src/deployment.d.ts
|
|
5
4
|
/** The host that ViteHub builds for: the `host` option of `vitehub()` and the value of `VITEHUB_HOST`. */
|
|
6
5
|
type ViteHubHost = "cloudflare" | "deno" | "netlify" | "node" | "vercel";
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region ../internal/src/build/deployment-plan-output.d.ts
|
|
9
6
|
/**
|
|
10
7
|
* One set of host variables that the deployed app reads, as `deployment.json` lists it: a Server Env declaration, or
|
|
11
8
|
* a variable that a primitive reads itself, such as `VITEHUB_SECRET` or `BLOB_READ_WRITE_TOKEN`.
|
|
@@ -35,8 +32,6 @@ interface DeploymentEnvContext {
|
|
|
35
32
|
* Return names only, never values.
|
|
36
33
|
*/
|
|
37
34
|
type DeploymentEnvContribution = (context: DeploymentEnvContext) => readonly DeploymentEnvEntry[];
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region ../internal/src/contributions.d.ts
|
|
40
35
|
/** Roots that ViteHub passes to every contribution factory. */
|
|
41
36
|
interface ContributionContext {
|
|
42
37
|
/** Vite root. */
|
|
@@ -48,8 +43,6 @@ interface ContributionContext {
|
|
|
48
43
|
/** The flat list of Vite plugins, so a factory can read what sibling plugins declare. */
|
|
49
44
|
plugins?: readonly unknown[];
|
|
50
45
|
}
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region ../internal/src/console.d.ts
|
|
53
46
|
/** Lists discovered Definitions in a sidebar and shows the selected Definition's fields. */
|
|
54
47
|
interface ViteHubConsoleDefinitionCatalogView {
|
|
55
48
|
kind: "definition-catalog";
|
|
@@ -117,7 +110,7 @@ interface ViteHubConsoleOperationAction {
|
|
|
117
110
|
operation: string;
|
|
118
111
|
input: Readonly<Record<string, string>>;
|
|
119
112
|
/**
|
|
120
|
-
* The result is `{ url }`, such as a
|
|
113
|
+
* The result is `{ url }`, such as a provider sign-in: the Console opens it in a new tab, and loads
|
|
121
114
|
* the list again when the person comes back. The URL must be `https:`, or `http:` on a loopback host.
|
|
122
115
|
*/
|
|
123
116
|
tab?: true;
|
|
@@ -261,16 +254,12 @@ interface ViteHubConsoleSectionDescriptor<TView extends ViteHubConsoleSectionVie
|
|
|
261
254
|
/** Pages next to the main view, in sidebar order. Only document editor sections render pages today. */
|
|
262
255
|
pages?: readonly ViteHubConsoleSectionPage[];
|
|
263
256
|
}
|
|
264
|
-
//#endregion
|
|
265
|
-
//#region src/console.d.ts
|
|
266
257
|
/**
|
|
267
258
|
* Console section for the webhooks of `server/webhooks/` and the member endpoints: each endpoint, the pending debounce
|
|
268
259
|
* timers, and the delivery log, with Send test, Send now, Cancel, Redeliver, and Disable or Enable for a member
|
|
269
260
|
* endpoint. It calls the `webhooks.*` operations with the Console user.
|
|
270
261
|
*/
|
|
271
262
|
export declare const webhooksConsoleSection: ViteHubConsoleWebhooksSection;
|
|
272
|
-
//#endregion
|
|
273
|
-
//#region src/vite.d.ts
|
|
274
263
|
export declare const WEBHOOKS_VITE_PLUGIN_NAME = "@vite-hub/webhooks/vite";
|
|
275
264
|
/** One file of `server/webhooks/`. */
|
|
276
265
|
export interface DiscoveredWebhook {
|
|
@@ -382,5 +371,4 @@ export declare function hubWebhooks(options?: HubWebhooksOptions): Plugin & {
|
|
|
382
371
|
operations: OperationContributions;
|
|
383
372
|
};
|
|
384
373
|
};
|
|
385
|
-
//#endregion
|
|
386
374
|
export { webhooksQueueName };
|
package/dist/vite.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
1
|
+
import { n as isRecordOrFunction, t as isRecord } from "./object-CAK6UYR5.js";
|
|
2
|
+
import { t as webhooksErrors } from "./errors-DT8uyCh7.js";
|
|
3
|
+
import { t as webhooksQueueName } from "./queue-name-jmgeppja.js";
|
|
4
|
+
import { n as webhooksTableNames, t as webhookEndpointsTableNames } from "./table-names-DAUip4v2.js";
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { tmpdir } from "node:os";
|
|
7
7
|
import { basename, dirname, join, parse, relative, resolve } from "node:path";
|
|
8
8
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
9
|
-
|
|
9
|
+
// ../internal/src/build/vite.ts
|
|
10
10
|
const projectRootDirectoryMarkers = [
|
|
11
11
|
["server", "agents"],
|
|
12
12
|
["server", "channels"],
|
|
@@ -79,8 +79,7 @@ function isMissingProjectMarker(error) {
|
|
|
79
79
|
const code = error.code;
|
|
80
80
|
return code === "ENOENT" || code === "ENOTDIR";
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
//#region ../internal/src/vite-stage.ts
|
|
82
|
+
// ../internal/src/vite-stage.ts
|
|
84
83
|
/**
|
|
85
84
|
* Vite's `loadEnv(mode, envDir, "")`: every `.env` value of the mode and the whole shell. With `DEBUG=vite:env`, Vite
|
|
86
85
|
* logs that result to stderr, secrets included. loadEnv is synchronous, so this drops only the writes of this call.
|
|
@@ -94,8 +93,7 @@ function loadAllEnv(loadEnv, mode, envDir) {
|
|
|
94
93
|
process.stderr.write = write;
|
|
95
94
|
}
|
|
96
95
|
}
|
|
97
|
-
|
|
98
|
-
//#region ../internal/src/contributions.ts
|
|
96
|
+
// ../internal/src/contributions.ts
|
|
99
97
|
function isThenable(value) {
|
|
100
98
|
return typeof value.then === "function";
|
|
101
99
|
}
|
|
@@ -122,8 +120,7 @@ async function flattenPluginOptions(plugins) {
|
|
|
122
120
|
await flattenPlugins(plugins ?? [], flattened, /* @__PURE__ */ new Set());
|
|
123
121
|
return flattened;
|
|
124
122
|
}
|
|
125
|
-
|
|
126
|
-
//#region ../internal/src/definition-catalog.ts
|
|
123
|
+
// ../internal/src/definition-catalog.ts
|
|
127
124
|
const sourceFilePattern = /\.(?:c|m)?[jt]sx?$/i;
|
|
128
125
|
const declarationFilePattern = /\.d\.(?:c|m)?[jt]sx?$/i;
|
|
129
126
|
const testFilePattern = /\.(?:test|spec)\.(?:c|m)?[jt]sx?$/i;
|
|
@@ -160,8 +157,7 @@ function createNitroServerKit(value = {}) {
|
|
|
160
157
|
}
|
|
161
158
|
};
|
|
162
159
|
}
|
|
163
|
-
|
|
164
|
-
//#region src/console.ts
|
|
160
|
+
// src/console.ts
|
|
165
161
|
/**
|
|
166
162
|
* Console section for the webhooks of `server/webhooks/` and the member endpoints: each endpoint, the pending debounce
|
|
167
163
|
* timers, and the delivery log, with Send test, Send now, Cancel, Redeliver, and Disable or Enable for a member
|
|
@@ -177,8 +173,7 @@ const webhooksConsoleSection = {
|
|
|
177
173
|
notice: "The list comes from the webhooks.* operations. The Console shows the names of the URL and secret variables and the host of each URL, never the full URL or the secret. Admins see member endpoints read-only and can disable one. Only the member who owns an endpoint can redeliver to it. `vitehub webhooks` and the webhooks MCP tools do the same."
|
|
178
174
|
}
|
|
179
175
|
};
|
|
180
|
-
|
|
181
|
-
//#region src/vite.ts
|
|
176
|
+
// src/vite.ts
|
|
182
177
|
const WEBHOOKS_VITE_PLUGIN_NAME = "@vite-hub/webhooks/vite";
|
|
183
178
|
const extensions = [
|
|
184
179
|
".ts",
|
|
@@ -467,5 +462,4 @@ function hubWebhooks(options = {}) {
|
|
|
467
462
|
} }
|
|
468
463
|
};
|
|
469
464
|
}
|
|
470
|
-
//#endregion
|
|
471
465
|
export { WEBHOOKS_VITE_PLUGIN_NAME, collectWebhooksUses, discoverWebhooks, hubWebhooks, renderWebhooksQueue, renderWebhooksRegistry, renderWebhooksTypes, usesWebhooks, webhooksConsoleSection, webhooksDevelopmentKeyFile, webhooksGeneratedFiles, webhooksQueueName };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vite-hub/webhooks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Send ViteHub events to an outside URL: signed, retried, and debounced on every host.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"debounce",
|
|
@@ -55,24 +55,25 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@standard-schema/spec": "^1.1.0",
|
|
58
|
-
"@
|
|
59
|
-
"@vite-hub/
|
|
58
|
+
"@valibot/to-json-schema": "^1.8.0",
|
|
59
|
+
"@vite-hub/env": "0.6.0",
|
|
60
|
+
"@vite-hub/runtime": "0.6.0",
|
|
60
61
|
"valibot": "^1.5.0"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
64
|
"@libsql/client": "^0.18.0",
|
|
64
|
-
"@types/node": "^24.19.
|
|
65
|
+
"@types/node": "^24.19.2",
|
|
65
66
|
"@vite-hub/internal": "0.0.1",
|
|
66
|
-
"drizzle-orm": "1.0.0-rc.
|
|
67
|
+
"drizzle-orm": "1.0.0-rc.6",
|
|
67
68
|
"nitro": "^3.0.261103-rc",
|
|
68
69
|
"publint": "^0.3.25",
|
|
69
70
|
"typescript": "^6.0.3",
|
|
70
|
-
"vite": "^8.
|
|
71
|
-
"vite-plus": "^
|
|
72
|
-
"vitest": "
|
|
71
|
+
"vite": "^8.3.8",
|
|
72
|
+
"vite-plus": "^1.7.0",
|
|
73
|
+
"vitest": "5.1.0"
|
|
73
74
|
},
|
|
74
75
|
"peerDependencies": {
|
|
75
|
-
"drizzle-orm": "1.0.0-rc.5 || ^1.0.0",
|
|
76
|
+
"drizzle-orm": "1.0.0-rc.5 || 1.0.0-rc.6 || ^1.0.0",
|
|
76
77
|
"vite": ">=8.0.0",
|
|
77
78
|
"nitro": "3.0.261102-rc || ^3.0.261103-rc"
|
|
78
79
|
},
|