@vite-hub/webhooks 0.5.1 → 0.6.1

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 CHANGED
@@ -99,6 +99,7 @@ export async function connectAndSend(userId: string, url: string, secret: string
99
99
  | `createMemberEndpoint({ owner, ownerName?, ownerEmail?, name, kind, url?, secret?, agent?, address?, hosts? })` | Stores a member's receiver. `kind` is `"url"` or `"inbox"`. The URL must pass `checkWebhookUrl()` with `hosts`, which defaults to `relay.t3.codes`. `address` says where the agent can be reached, such as its T3 thread URL: a member has one endpoint per address, and a new one replaces the one with the same address. |
100
100
  | `sendToMemberEndpoint(owner, body, { event, key, address?, endpointId? })` | Posts to the member's endpoint with `address`, else to their newest. Pass `endpointId` to send only to that endpoint with no fallback. Posts in the request with a 10 second timeout and the usual signature. The same `key` posts once per endpoint. Returns `[error, { id, status }]`, where `status` is `"sent"`, `"inbox"`, `"pending"` (the Queue retries), or `"failed"`. |
101
101
  | `listMemberDeliveries(owner, { address?, endpointId?, limit?, before? })` | The selected endpoint and its deliveries, newest first, or `null`. Inbox agents should pass the `endpointId` from pairing so their reads never switch to another endpoint. An empty `address` prefers the unaddressed endpoint. |
102
+ | `getMemberDelivery(id)` | The `state` of a member delivery and `inbox`, true when it waits in an inbox, or `undefined`. It never returns the body. `inbox` stays true after the member removes the endpoint. |
102
103
  | `startMemberPairing(owner)`, `pairMemberEndpoint(input, { hosts? })`, `allowMemberPairing(owner, code, { name, ownerName?, ownerEmail?, hosts? })` | Pair a member's agent with a one-use code that works for 10 minutes. Give the agent the `code` and `secret` that start returns. A route passes its post, `{ code, url, thread? }` or `{ code, inbox }`, to `pairMemberEndpoint`, and the member's Allow creates the endpoint, with the agent's T3 thread link as its address. `getMemberPairing`, `cancelMemberPairing`, and `refuseMemberPairing` poll, close, and use up a code. Comments Send pairs this way. |
103
104
  | `getMemberEndpoint(owner, { endpointId?, address? })`, `listMemberEndpoints({ limit?, after? })`, `removeMemberEndpoint(owner, id)`, `removeMemberEndpoints(owner)`, `disableMemberEndpoint(id, { by? })`, `enableMemberEndpoint(id)` | Read, list a page with the newest delivery to each endpoint, remove, disable, or enable an endpoint. None returns the receiver URL or the secret. |
104
105
  | `checkWebhookUrl(url, { hosts? })` | Refuses a URL that is not `https`, holds credentials, uses a host outside `hosts`, or names or resolves to a loopback, private, link-local, or metadata address. Cloudflare Workers cannot resolve names, so there `hosts` alone decides. |
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as WebhookDeliveryErrorCode, _ as CreateMemberEndpointErrorCode, a as SendToMemberEndpointResult, b as SendToMemberEndpointErrorCode, c as enableMemberEndpoint, d as listMemberDeliveries, f as listMemberEndpoints, g as sendToMemberEndpoint, h as removeMemberEndpoints, i as SendToMemberEndpointOptions, l as getMemberDeliveryState, m as removeMemberEndpoint, n as MemberDeliveries, o as createMemberEndpoint, p as memberEndpointHosts, r as MemberEndpointWithLastDelivery, s as disableMemberEndpoint, t as CreateMemberEndpointOptions, u as getMemberEndpoint, v as MemberEndpointErrorCode, x as SendWebhookErrorCode, y as MemberPairingErrorCode } from "./members-BjDcAAhY.js";
2
- import { B as WebhookSignature, F as sealWebhooksText, I as unsealWebhooksText, L as WebhookDefinition, R as WebhookEvent, V as defineWebhook, a as SendWebhookResult, s as WebhookEventBody, z as WebhookOptions } from "./runtime-BdILDcW1.js";
1
+ import { C as WebhookDeliveryErrorCode, S as SendWebhookErrorCode, _ as sendToMemberEndpoint, a as SendToMemberEndpointResult, b as MemberPairingErrorCode, c as enableMemberEndpoint, d as getMemberEndpoint, f as listMemberDeliveries, g as removeMemberEndpoints, h as removeMemberEndpoint, i as SendToMemberEndpointOptions, l as getMemberDelivery, m as memberEndpointHosts, n as MemberDeliveries, o as createMemberEndpoint, p as listMemberEndpoints, r as MemberEndpointWithLastDelivery, s as disableMemberEndpoint, t as CreateMemberEndpointOptions, u as getMemberDeliveryState, v as CreateMemberEndpointErrorCode, x as SendToMemberEndpointErrorCode, y as MemberEndpointErrorCode } from "./members-Cn93y6gO.js";
2
+ import { B as WebhookSignature, F as sealWebhooksText, I as unsealWebhooksText, L as WebhookDefinition, R as WebhookEvent, V as defineWebhook, a as SendWebhookResult, s as WebhookEventBody, z as WebhookOptions } from "./runtime-BYILR6Zc.js";
3
3
  import { a as MemberLastDelivery, i as MemberEndpointKind, o as MemberPairingState, r as MemberEndpoint } from "./database-C5cwO1an.js";
4
4
  import { Result } from "@vite-hub/runtime";
5
5
  /** How long a pairing code works: 10 minutes. */
@@ -156,4 +156,4 @@ export interface SendWebhookOptions {
156
156
  * ```
157
157
  */
158
158
  export declare function sendWebhook<TName extends WebhookName>(name: TName, body: unknown, options: SendWebhookOptions): Promise<Result<SendWebhookResult, SendWebhookErrorCode>>;
159
- export { type AllowMemberPairingOptions, type CheckWebhookUrlOptions, type CreateMemberEndpointErrorCode, type CreateMemberEndpointOptions, type MemberAllowResult, type MemberDeliveries, type MemberEndpoint, type MemberEndpointErrorCode, type MemberEndpointKind, type MemberEndpointWithLastDelivery, type MemberLastDelivery, type MemberPairResult, type MemberPairing, type MemberPairingErrorCode, type MemberPairingState, type SendToMemberEndpointErrorCode, type SendToMemberEndpointOptions, type SendToMemberEndpointResult, type SendWebhookErrorCode, type SendWebhookResult, type WebhookDefinition, type WebhookDeliveryErrorCode, type WebhookEvent, type WebhookEventBody, type WebhookOptions, type WebhookSignature, createMemberEndpoint, defineWebhook, disableMemberEndpoint, enableMemberEndpoint, getMemberDeliveryState, getMemberEndpoint, listMemberDeliveries, listMemberEndpoints, memberEndpointHosts, removeMemberEndpoint, removeMemberEndpoints, sealWebhooksText, sendToMemberEndpoint, unsealWebhooksText };
159
+ export { type AllowMemberPairingOptions, type CheckWebhookUrlOptions, type CreateMemberEndpointErrorCode, type CreateMemberEndpointOptions, type MemberAllowResult, type MemberDeliveries, type MemberEndpoint, type MemberEndpointErrorCode, type MemberEndpointKind, type MemberEndpointWithLastDelivery, type MemberLastDelivery, type MemberPairResult, type MemberPairing, type MemberPairingErrorCode, type MemberPairingState, type SendToMemberEndpointErrorCode, type SendToMemberEndpointOptions, type SendToMemberEndpointResult, type SendWebhookErrorCode, type SendWebhookResult, type WebhookDefinition, type WebhookDeliveryErrorCode, type WebhookEvent, type WebhookEventBody, type WebhookOptions, type WebhookSignature, createMemberEndpoint, defineWebhook, disableMemberEndpoint, enableMemberEndpoint, getMemberDelivery, getMemberDeliveryState, getMemberEndpoint, listMemberDeliveries, listMemberEndpoints, memberEndpointHosts, removeMemberEndpoint, removeMemberEndpoints, sealWebhooksText, sendToMemberEndpoint, unsealWebhooksText };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { M as unsealWebhooksText, N as defineWebhook, T as checkWebhookUrl, _ as requireMemberEndpoints, k as sealWebhooksText, y as sendDynamicWebhook } from "./runtime-BFiCJOMB.js";
2
- import { a as getMemberEndpoint, c as memberEndpointHosts, d as removeMemberEndpoints, f as sendToMemberEndpoint, i as getMemberDeliveryState, n as disableMemberEndpoint, o as listMemberDeliveries, r as enableMemberEndpoint, s as listMemberEndpoints, t as createMemberEndpoint, u as removeMemberEndpoint } from "./members-Cr_Nlyg4.js";
2
+ import { a as getMemberDeliveryState, c as listMemberEndpoints, d as removeMemberEndpoint, f as removeMemberEndpoints, i as getMemberDelivery, l as memberEndpointHosts, n as disableMemberEndpoint, o as getMemberEndpoint, p as sendToMemberEndpoint, r as enableMemberEndpoint, s as listMemberDeliveries, t as createMemberEndpoint } from "./members-DvpsP5Px.js";
3
3
  import { t as webhooksErrors } from "./errors-DT8uyCh7.js";
4
4
  // src/pairing.ts
5
5
  /** How long a pairing code works: 10 minutes. */
@@ -261,4 +261,4 @@ async function allowMemberPairing(owner, code, options) {
261
261
  function sendWebhook(name, body, options) {
262
262
  return sendDynamicWebhook(name, body, options);
263
263
  }
264
- export { allowMemberPairing, cancelMemberPairing, checkWebhookUrl, createMemberEndpoint, defineWebhook, disableMemberEndpoint, enableMemberEndpoint, getMemberDeliveryState, getMemberEndpoint, getMemberPairing, listMemberDeliveries, listMemberEndpoints, memberEndpointHosts, memberPairingAddress, memberPairingLifetime, pairMemberEndpoint, refuseMemberPairing, removeMemberEndpoint, removeMemberEndpoints, sealWebhooksText, sendToMemberEndpoint, sendWebhook, startMemberPairing, unsealWebhooksText };
264
+ export { allowMemberPairing, cancelMemberPairing, checkWebhookUrl, createMemberEndpoint, defineWebhook, disableMemberEndpoint, enableMemberEndpoint, getMemberDelivery, getMemberDeliveryState, getMemberEndpoint, getMemberPairing, listMemberDeliveries, listMemberEndpoints, memberEndpointHosts, memberPairingAddress, memberPairingLifetime, pairMemberEndpoint, refuseMemberPairing, removeMemberEndpoint, removeMemberEndpoints, sealWebhooksText, sendToMemberEndpoint, sendWebhook, startMemberPairing, unsealWebhooksText };
@@ -340,4 +340,12 @@ declare function listMemberDeliveries(owner: string, options?: {
340
340
  } & Pick<ListWebhookDeliveriesOptions, "limit" | "before">): Promise<Result<MemberDeliveries | null, MemberEndpointErrorCode>>;
341
341
  /** Reads only the state of a known member delivery, never its body. */
342
342
  declare function getMemberDeliveryState(id: string): Promise<WebhookDeliveryState | undefined>;
343
- export { webhooksErrors as C, WebhookDeliveryErrorCode as S, CreateMemberEndpointErrorCode as _, SendToMemberEndpointResult as a, SendToMemberEndpointErrorCode as b, enableMemberEndpoint as c, listMemberDeliveries as d, listMemberEndpoints as f, sendToMemberEndpoint as g, removeMemberEndpoints as h, SendToMemberEndpointOptions as i, getMemberDeliveryState as l, removeMemberEndpoint as m, MemberDeliveries as n, createMemberEndpoint as o, memberEndpointHosts as p, MemberEndpointWithLastDelivery as r, disableMemberEndpoint as s, CreateMemberEndpointOptions as t, getMemberEndpoint as u, MemberEndpointErrorCode as v, SendWebhookErrorCode as x, MemberPairingErrorCode as y };
343
+ /**
344
+ * Reads the state of a known member delivery, and whether it waits in an inbox, never its body. `inbox` stays true after
345
+ * the member removes the endpoint, so it tells where an old delivery went.
346
+ */
347
+ declare function getMemberDelivery(id: string): Promise<{
348
+ state: WebhookDeliveryState;
349
+ inbox: boolean;
350
+ } | undefined>;
351
+ export { WebhookDeliveryErrorCode as C, SendWebhookErrorCode as S, sendToMemberEndpoint as _, SendToMemberEndpointResult as a, MemberPairingErrorCode as b, enableMemberEndpoint as c, getMemberEndpoint as d, listMemberDeliveries as f, removeMemberEndpoints as g, removeMemberEndpoint as h, SendToMemberEndpointOptions as i, getMemberDelivery as l, memberEndpointHosts as m, MemberDeliveries as n, createMemberEndpoint as o, listMemberEndpoints as p, MemberEndpointWithLastDelivery as r, disableMemberEndpoint as s, CreateMemberEndpointOptions as t, getMemberDeliveryState as u, CreateMemberEndpointErrorCode as v, webhooksErrors as w, SendToMemberEndpointErrorCode as x, MemberEndpointErrorCode as y };
@@ -16,6 +16,7 @@ var members_exports = /* @__PURE__ */ __exportAll({
16
16
  createMemberEndpoint: () => createMemberEndpoint,
17
17
  disableMemberEndpoint: () => disableMemberEndpoint,
18
18
  enableMemberEndpoint: () => enableMemberEndpoint,
19
+ getMemberDelivery: () => getMemberDelivery,
19
20
  getMemberDeliveryState: () => getMemberDeliveryState,
20
21
  getMemberEndpoint: () => getMemberEndpoint,
21
22
  listMemberDeliveries: () => listMemberDeliveries,
@@ -302,7 +303,18 @@ async function listMemberDeliveries(owner, options = {}) {
302
303
  }
303
304
  /** Reads only the state of a known member delivery, never its body. */
304
305
  async function getMemberDeliveryState(id) {
306
+ return (await getMemberDelivery(id))?.state;
307
+ }
308
+ /**
309
+ * Reads the state of a known member delivery, and whether it waits in an inbox, never its body. `inbox` stays true after
310
+ * the member removes the endpoint, so it tells where an old delivery went.
311
+ */
312
+ async function getMemberDelivery(id) {
305
313
  const row = await requireMemberEndpoints().store.get(id);
306
- return row?.webhook.startsWith("@") ? row.state : void 0;
314
+ if (!row?.webhook.startsWith("@")) return void 0;
315
+ return {
316
+ state: row.state,
317
+ inbox: row.state === "sent" && row.lastStatus === null
318
+ };
307
319
  }
308
- export { getMemberEndpoint as a, memberEndpointHosts as c, removeMemberEndpoints as d, sendToMemberEndpoint as f, getMemberDeliveryState as i, members_exports as l, disableMemberEndpoint as n, listMemberDeliveries as o, enableMemberEndpoint as r, listMemberEndpoints as s, createMemberEndpoint as t, removeMemberEndpoint as u };
320
+ export { getMemberDeliveryState as a, listMemberEndpoints as c, removeMemberEndpoint as d, removeMemberEndpoints as f, getMemberDelivery as i, memberEndpointHosts as l, disableMemberEndpoint as n, getMemberEndpoint as o, sendToMemberEndpoint as p, enableMemberEndpoint as r, listMemberDeliveries as s, createMemberEndpoint as t, members_exports as u };
@@ -1,6 +1,6 @@
1
1
  import { t as AnyOperation } from "./operations-8hqTi0DH.js";
2
2
  import { r as MemberEndpoint } from "./database-C5cwO1an.js";
3
- import { r as MemberEndpointWithLastDelivery } from "./members-BjDcAAhY.js";
3
+ import { r as MemberEndpointWithLastDelivery } from "./members-Cn93y6gO.js";
4
4
  /**
5
5
  * One member endpoint, as `webhooks.endpoints` lists it for admins: no URL, no secret, and no email. `mine` is true
6
6
  * when the caller owns it, so the Console shows Redeliver only on the caller's own deliveries.
@@ -1,5 +1,6 @@
1
1
  import { n as isRecordOrFunction } from "./object-CAK6UYR5.js";
2
2
  import { t as webhooksErrors } from "./errors-DT8uyCh7.js";
3
+ import { toJsonSchema } from "@valibot/to-json-schema";
3
4
  import * as v from "valibot";
4
5
  // ../../node_modules/.pnpm/nostics@1.4.0/node_modules/nostics/dist/index.mjs
5
6
  /**
@@ -407,688 +408,6 @@ function standardJsonSchema(schema, direction, target = "draft-2020-12", library
407
408
  return;
408
409
  }
409
410
  }
410
- // ../../node_modules/.pnpm/@valibot+to-json-schema@1.8.0_valibot@1.5.0_typescript@6.0.3_/node_modules/@valibot/to-json-schema/dist/index.mjs
411
- /**
412
- * Adds an error message to the errors array.
413
- *
414
- * @param errors The array of error messages.
415
- * @param message The error message to add.
416
- *
417
- * @returns The new errors.
418
- */
419
- function addError(errors, message) {
420
- if (errors) {
421
- errors.push(message);
422
- return errors;
423
- }
424
- return [message];
425
- }
426
- const ESCAPE_REGEX = /[.*+?^${}()|[\]\\]/g;
427
- /**
428
- * Escapes special regex characters in a string.
429
- *
430
- * @param string The string to escape.
431
- *
432
- * @returns The escaped string.
433
- */
434
- function escapeRegExp(string) {
435
- return string.replace(ESCAPE_REGEX, "\\$&");
436
- }
437
- /**
438
- * Throws an error or logs a warning based on the configuration.
439
- *
440
- * @param message The message to throw or log.
441
- * @param config The conversion configuration.
442
- */
443
- function handleError(message, config) {
444
- switch (config?.errorMode) {
445
- case "ignore": break;
446
- case "warn":
447
- console.warn(message);
448
- break;
449
- default: throw new Error(message);
450
- }
451
- }
452
- /**
453
- * Whether a value is JSON compatible for a const keyword.
454
- *
455
- * @param value The value to check.
456
- *
457
- * @returns Whether the value is JSON compatible.
458
- */
459
- function isJsonConstValue(value) {
460
- return typeof value === "boolean" || typeof value === "number" && Number.isFinite(value) || typeof value === "string";
461
- }
462
- /**
463
- * Whether values are JSON compatible for an enum keyword.
464
- *
465
- * @param values The values to check.
466
- *
467
- * @returns Whether the values are JSON compatible.
468
- */
469
- function isJsonEnumValues(values) {
470
- return values.every(isJsonConstValue);
471
- }
472
- /**
473
- * Schema reference map with collision-free reference ID allocation.
474
- */
475
- var ReferenceMap = class extends Map {
476
- /**
477
- * Creates an empty schema reference map.
478
- */
479
- constructor() {
480
- super();
481
- this.count = 0;
482
- this.usedIds = /* @__PURE__ */ new Set();
483
- }
484
- /**
485
- * Adds a schema reference and reserves its ID.
486
- *
487
- * @param schema The Valibot schema.
488
- * @param referenceId The reference ID.
489
- *
490
- * @returns The reference map.
491
- */
492
- set(schema, referenceId) {
493
- this.usedIds.add(referenceId);
494
- return super.set(schema, referenceId);
495
- }
496
- /**
497
- * Creates a reference ID that is not yet used.
498
- *
499
- * @param definitions The JSON Schema definitions.
500
- *
501
- * @returns The unused reference ID.
502
- */
503
- createId(definitions) {
504
- while (this.usedIds.has(`${this.count}`) || `${this.count}` in definitions) this.count++;
505
- return `${this.count++}`;
506
- }
507
- };
508
- /**
509
- * Returns the stricter lower bound.
510
- *
511
- * @param current The current lower bound.
512
- * @param value The new lower bound.
513
- *
514
- * @returns The stricter lower bound.
515
- */
516
- function getLowerBound(current, value) {
517
- if (typeof current !== "number" || !Number.isFinite(current) || value > current) return value;
518
- return current;
519
- }
520
- /**
521
- * Returns the stricter upper bound.
522
- *
523
- * @param current The current upper bound.
524
- * @param value The new upper bound.
525
- *
526
- * @returns The stricter upper bound.
527
- */
528
- function getUpperBound(current, value) {
529
- if (typeof current !== "number" || !Number.isFinite(current) || value < current) return value;
530
- return current;
531
- }
532
- /**
533
- * Returns the combined not restriction.
534
- *
535
- * @param current The current not restriction.
536
- * @param value The new not restriction.
537
- *
538
- * @returns The combined not restriction.
539
- */
540
- /* @__NO_SIDE_EFFECTS__ */
541
- function getNotRestriction(current, value) {
542
- return current !== void 0 ? { anyOf: [current, value] } : value;
543
- }
544
- /**
545
- * Intersects allowed values with an existing enum restriction.
546
- *
547
- * @param jsonSchema The JSON Schema object.
548
- * @param values The allowed values.
549
- */
550
- function intersectEnum(jsonSchema, values) {
551
- let enumValues = jsonSchema.enum ?? values;
552
- if (jsonSchema.enum) {
553
- const valueSet = new Set(values);
554
- enumValues = enumValues.filter((value) => valueSet.has(value));
555
- }
556
- if (enumValues.length) jsonSchema.enum = [...new Set(enumValues)];
557
- else {
558
- delete jsonSchema.enum;
559
- jsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, {});
560
- }
561
- }
562
- /**
563
- * Converts any supported Valibot action to the JSON Schema format.
564
- *
565
- * @param jsonSchema The JSON Schema object.
566
- * @param valibotAction The Valibot action object.
567
- * @param config The conversion configuration.
568
- *
569
- * @returns The converted JSON Schema.
570
- */
571
- function convertAction(jsonSchema, valibotAction, config) {
572
- if (config?.ignoreActions?.includes(valibotAction.type)) return jsonSchema;
573
- let errors;
574
- switch (valibotAction.type) {
575
- case "base64":
576
- jsonSchema.contentEncoding = "base64";
577
- break;
578
- case "bic":
579
- case "cuid2":
580
- case "decimal":
581
- case "digits":
582
- case "domain":
583
- case "emoji":
584
- case "hash":
585
- case "hexadecimal":
586
- case "hex_color":
587
- case "isrc":
588
- case "iso_time_second":
589
- case "iso_week":
590
- case "ksuid":
591
- case "mac":
592
- case "mac48":
593
- case "mac64":
594
- case "nanoid":
595
- case "octal":
596
- case "slug":
597
- case "ulid":
598
- if (jsonSchema.pattern) errors = addError(errors, `The "${valibotAction.type}" action is not supported in combination with another regex action.`);
599
- else jsonSchema.pattern = valibotAction.requirement.source;
600
- break;
601
- case "description":
602
- jsonSchema.description = valibotAction.description;
603
- break;
604
- case "email":
605
- case "rfc_email":
606
- jsonSchema.format = "email";
607
- break;
608
- case "ends_with":
609
- if (jsonSchema.pattern) errors = addError(errors, `The "${valibotAction.type}" action is not supported in combination with another regex action.`);
610
- else jsonSchema.pattern = `${escapeRegExp(valibotAction.requirement)}$`;
611
- break;
612
- case "empty":
613
- if (jsonSchema.type === "array") jsonSchema.maxItems = 0;
614
- else {
615
- if (jsonSchema.type !== "string") errors = addError(errors, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
616
- jsonSchema.maxLength = 0;
617
- }
618
- break;
619
- case "entries":
620
- if (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {
621
- errors = addError(errors, "The requirement of the \"entries\" action must be a non-negative integer.");
622
- break;
623
- }
624
- jsonSchema.minProperties = getLowerBound(jsonSchema.minProperties, valibotAction.requirement);
625
- jsonSchema.maxProperties = getUpperBound(jsonSchema.maxProperties, valibotAction.requirement);
626
- break;
627
- case "examples":
628
- if (Array.isArray(jsonSchema.examples)) jsonSchema.examples = [...jsonSchema.examples, ...valibotAction.examples];
629
- else jsonSchema.examples = valibotAction.examples;
630
- break;
631
- case "gt_value":
632
- if (jsonSchema.type !== "number" && jsonSchema.type !== "integer") {
633
- errors = addError(errors, `The "gt_value" action is not supported on type "${jsonSchema.type}".`);
634
- break;
635
- }
636
- if (!Number.isFinite(valibotAction.requirement)) {
637
- errors = addError(errors, "The requirement of the \"gt_value\" action is not JSON compatible.");
638
- break;
639
- }
640
- if (config?.target === "openapi-3.0") {
641
- errors = addError(errors, "The \"gt_value\" action is not supported for OpenAPI 3.0.");
642
- break;
643
- }
644
- jsonSchema.exclusiveMinimum = getLowerBound(jsonSchema.exclusiveMinimum, valibotAction.requirement);
645
- break;
646
- case "includes":
647
- if (jsonSchema.pattern) errors = addError(errors, `The "${valibotAction.type}" action is not supported in combination with another regex action.`);
648
- else jsonSchema.pattern = escapeRegExp(valibotAction.requirement);
649
- break;
650
- case "integer":
651
- jsonSchema.type = "integer";
652
- break;
653
- case "ipv4":
654
- jsonSchema.format = "ipv4";
655
- break;
656
- case "ipv6":
657
- jsonSchema.format = "ipv6";
658
- break;
659
- case "iso_date":
660
- jsonSchema.format = "date";
661
- break;
662
- case "iso_date_time":
663
- case "iso_timestamp":
664
- jsonSchema.format = "date-time";
665
- break;
666
- case "iso_time":
667
- jsonSchema.format = "time";
668
- break;
669
- case "jws_compact":
670
- if (jsonSchema.pattern) errors = addError(errors, `The "${valibotAction.type}" action is not supported in combination with another regex action.`);
671
- else jsonSchema.pattern = valibotAction.requirement.source;
672
- break;
673
- case "length":
674
- if (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {
675
- errors = addError(errors, "The requirement of the \"length\" action must be a non-negative integer.");
676
- break;
677
- }
678
- if (jsonSchema.type === "array") {
679
- jsonSchema.minItems = getLowerBound(jsonSchema.minItems, valibotAction.requirement);
680
- jsonSchema.maxItems = getUpperBound(jsonSchema.maxItems, valibotAction.requirement);
681
- } else {
682
- if (jsonSchema.type !== "string") errors = addError(errors, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
683
- jsonSchema.minLength = getLowerBound(jsonSchema.minLength, valibotAction.requirement);
684
- jsonSchema.maxLength = getUpperBound(jsonSchema.maxLength, valibotAction.requirement);
685
- }
686
- break;
687
- case "lt_value":
688
- if (jsonSchema.type !== "number" && jsonSchema.type !== "integer") {
689
- errors = addError(errors, `The "lt_value" action is not supported on type "${jsonSchema.type}".`);
690
- break;
691
- }
692
- if (!Number.isFinite(valibotAction.requirement)) {
693
- errors = addError(errors, "The requirement of the \"lt_value\" action is not JSON compatible.");
694
- break;
695
- }
696
- if (config?.target === "openapi-3.0") {
697
- errors = addError(errors, "The \"lt_value\" action is not supported for OpenAPI 3.0.");
698
- break;
699
- }
700
- jsonSchema.exclusiveMaximum = getUpperBound(jsonSchema.exclusiveMaximum, valibotAction.requirement);
701
- break;
702
- case "max_entries":
703
- if (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {
704
- errors = addError(errors, "The requirement of the \"max_entries\" action must be a non-negative integer.");
705
- break;
706
- }
707
- jsonSchema.maxProperties = getUpperBound(jsonSchema.maxProperties, valibotAction.requirement);
708
- break;
709
- case "max_length":
710
- if (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {
711
- errors = addError(errors, "The requirement of the \"max_length\" action must be a non-negative integer.");
712
- break;
713
- }
714
- if (jsonSchema.type === "array") jsonSchema.maxItems = getUpperBound(jsonSchema.maxItems, valibotAction.requirement);
715
- else {
716
- if (jsonSchema.type !== "string") errors = addError(errors, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
717
- jsonSchema.maxLength = getUpperBound(jsonSchema.maxLength, valibotAction.requirement);
718
- }
719
- break;
720
- case "max_value":
721
- if (jsonSchema.type !== "number" && jsonSchema.type !== "integer") {
722
- errors = addError(errors, `The "max_value" action is not supported on type "${jsonSchema.type}".`);
723
- break;
724
- }
725
- if (!Number.isFinite(valibotAction.requirement)) {
726
- errors = addError(errors, "The requirement of the \"max_value\" action is not JSON compatible.");
727
- break;
728
- }
729
- jsonSchema.maximum = getUpperBound(jsonSchema.maximum, valibotAction.requirement);
730
- break;
731
- case "metadata":
732
- if (typeof valibotAction.metadata.title === "string") jsonSchema.title = valibotAction.metadata.title;
733
- if (typeof valibotAction.metadata.description === "string") jsonSchema.description = valibotAction.metadata.description;
734
- if (Array.isArray(valibotAction.metadata.examples)) if (Array.isArray(jsonSchema.examples)) jsonSchema.examples = [...jsonSchema.examples, ...valibotAction.metadata.examples];
735
- else jsonSchema.examples = valibotAction.metadata.examples;
736
- for (const key of Object.keys(valibotAction.metadata)) if (key !== "title" && key !== "description" && key !== "examples" && key !== "__proto__") jsonSchema[key] = valibotAction.metadata[key];
737
- break;
738
- case "min_entries":
739
- if (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {
740
- errors = addError(errors, "The requirement of the \"min_entries\" action must be a non-negative integer.");
741
- break;
742
- }
743
- jsonSchema.minProperties = getLowerBound(jsonSchema.minProperties, valibotAction.requirement);
744
- break;
745
- case "min_length":
746
- if (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {
747
- errors = addError(errors, "The requirement of the \"min_length\" action must be a non-negative integer.");
748
- break;
749
- }
750
- if (jsonSchema.type === "array") jsonSchema.minItems = getLowerBound(jsonSchema.minItems, valibotAction.requirement);
751
- else {
752
- if (jsonSchema.type !== "string") errors = addError(errors, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
753
- jsonSchema.minLength = getLowerBound(jsonSchema.minLength, valibotAction.requirement);
754
- }
755
- break;
756
- case "min_value":
757
- if (jsonSchema.type !== "number" && jsonSchema.type !== "integer") {
758
- errors = addError(errors, `The "min_value" action is not supported on type "${jsonSchema.type}".`);
759
- break;
760
- }
761
- if (!Number.isFinite(valibotAction.requirement)) {
762
- errors = addError(errors, "The requirement of the \"min_value\" action is not JSON compatible.");
763
- break;
764
- }
765
- jsonSchema.minimum = getLowerBound(jsonSchema.minimum, valibotAction.requirement);
766
- break;
767
- case "multiple_of":
768
- jsonSchema.multipleOf = valibotAction.requirement;
769
- break;
770
- case "non_empty":
771
- if (jsonSchema.type === "array") jsonSchema.minItems = getLowerBound(jsonSchema.minItems, 1);
772
- else {
773
- if (jsonSchema.type !== "string") errors = addError(errors, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
774
- jsonSchema.minLength = getLowerBound(jsonSchema.minLength, 1);
775
- }
776
- break;
777
- case "not_value":
778
- if (!isJsonConstValue(valibotAction.requirement)) {
779
- errors = addError(errors, "The requirement of the \"not_value\" action is not JSON compatible.");
780
- break;
781
- }
782
- jsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, config?.target === "openapi-3.0" ? { enum: [valibotAction.requirement] } : { const: valibotAction.requirement });
783
- break;
784
- case "not_values":
785
- if (!isJsonEnumValues(valibotAction.requirement)) {
786
- errors = addError(errors, "A requirement of the \"not_values\" action is not JSON compatible.");
787
- break;
788
- }
789
- if (valibotAction.requirement.length) jsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, { enum: [...new Set(valibotAction.requirement)] });
790
- break;
791
- case "regex":
792
- if (valibotAction.requirement.flags) errors = addError(errors, "RegExp flags are not supported by JSON Schema.");
793
- if (jsonSchema.pattern) errors = addError(errors, `The "${valibotAction.type}" action is not supported in combination with another regex action.`);
794
- else jsonSchema.pattern = valibotAction.requirement.source;
795
- break;
796
- case "safe_integer":
797
- jsonSchema.type = "integer";
798
- jsonSchema.minimum = getLowerBound(jsonSchema.minimum, Number.MIN_SAFE_INTEGER);
799
- jsonSchema.maximum = getUpperBound(jsonSchema.maximum, Number.MAX_SAFE_INTEGER);
800
- break;
801
- case "starts_with":
802
- if (jsonSchema.pattern) errors = addError(errors, `The "${valibotAction.type}" action is not supported in combination with another regex action.`);
803
- else jsonSchema.pattern = `^${escapeRegExp(valibotAction.requirement)}`;
804
- break;
805
- case "title":
806
- jsonSchema.title = valibotAction.title;
807
- break;
808
- case "url":
809
- jsonSchema.format = "uri";
810
- break;
811
- case "uuid":
812
- jsonSchema.format = "uuid";
813
- break;
814
- case "value":
815
- if (!isJsonConstValue(valibotAction.requirement)) {
816
- errors = addError(errors, "The requirement of the \"value\" action is not JSON compatible.");
817
- break;
818
- }
819
- if (config?.target === "openapi-3.0") intersectEnum(jsonSchema, [valibotAction.requirement]);
820
- else if ("const" in jsonSchema && jsonSchema.const !== valibotAction.requirement) errors = addError(errors, `The "${valibotAction.type}" action is not supported in combination with a different "const" restriction.`);
821
- else jsonSchema.const = valibotAction.requirement;
822
- break;
823
- case "values":
824
- if (!isJsonEnumValues(valibotAction.requirement)) {
825
- errors = addError(errors, "A requirement of the \"values\" action is not JSON compatible.");
826
- break;
827
- }
828
- intersectEnum(jsonSchema, valibotAction.requirement);
829
- break;
830
- default: errors = addError(errors, `The "${valibotAction.type}" action cannot be converted to JSON Schema.`);
831
- }
832
- if (config?.overrideAction) {
833
- const actionOverride = config.overrideAction({
834
- valibotAction,
835
- jsonSchema,
836
- errors
837
- });
838
- if (actionOverride) return { ...actionOverride };
839
- }
840
- if (errors) for (const message of errors) handleError(message, config);
841
- return jsonSchema;
842
- }
843
- /**
844
- * Flattens a Valibot pipe by recursively expanding nested pipes.
845
- *
846
- * @param pipe The pipeline to flatten.
847
- *
848
- * @returns A flat pipeline.
849
- */
850
- function flattenPipe(pipe) {
851
- return pipe.flatMap((item) => "pipe" in item ? flattenPipe(item.pipe) : item);
852
- }
853
- /**
854
- * Returns the JSON Pointer reference for a definition key.
855
- *
856
- * @param referenceId The unescaped definition key.
857
- *
858
- * @returns The encoded JSON Pointer fragment.
859
- */
860
- function getDefinitionRef(referenceId) {
861
- return `#/$defs/${referenceId.replaceAll("~", "~0").replaceAll("/", "~1")}`;
862
- }
863
- /**
864
- * Converts any supported Valibot schema to the JSON Schema format.
865
- *
866
- * @param jsonSchema The JSON Schema object.
867
- * @param valibotSchema The Valibot schema object.
868
- * @param config The conversion configuration.
869
- * @param context The conversion context.
870
- * @param skipRef Whether to skip using a reference.
871
- *
872
- * @returns The converted JSON Schema.
873
- */
874
- function convertSchema(jsonSchema, valibotSchema, config, context, skipRef = false) {
875
- if (!skipRef) {
876
- const referenceId = context.referenceMap.get(valibotSchema);
877
- if (referenceId) {
878
- jsonSchema.$ref = getDefinitionRef(referenceId);
879
- if (config?.overrideRef) {
880
- const refOverride = config.overrideRef({
881
- ...context,
882
- referenceId,
883
- valibotSchema,
884
- jsonSchema
885
- });
886
- if (refOverride) jsonSchema.$ref = refOverride;
887
- }
888
- return jsonSchema;
889
- }
890
- }
891
- if ("pipe" in valibotSchema) {
892
- const flatPipe = flattenPipe(valibotSchema.pipe);
893
- let startIndex = 0;
894
- let stopIndex = flatPipe.length - 1;
895
- if (config?.typeMode === "input") {
896
- const inputStopIndex = flatPipe.slice(1).findIndex((item) => item.kind === "schema" || item.kind === "transformation" && (item.type === "find_item" || item.type === "parse_json" || item.type === "raw_transform" || item.type === "reduce_items" || item.type === "stringify_json" || item.type === "to_bigint" || item.type === "to_boolean" || item.type === "to_date" || item.type === "to_number" || item.type === "to_string" || item.type === "transform"));
897
- if (inputStopIndex !== -1) stopIndex = inputStopIndex;
898
- } else if (config?.typeMode === "output") {
899
- const outputStartIndex = flatPipe.findLastIndex((item) => item.kind === "schema");
900
- if (outputStartIndex !== -1) startIndex = outputStartIndex;
901
- }
902
- for (let index = startIndex; index <= stopIndex; index++) {
903
- const valibotPipeItem = flatPipe[index];
904
- if (valibotPipeItem.kind === "schema") {
905
- if (index > startIndex) handleError("Set the \"typeMode\" config to \"input\" or \"output\" to convert pipelines with multiple schemas.", config);
906
- jsonSchema = convertSchema(jsonSchema, valibotPipeItem, config, context, true);
907
- } else jsonSchema = convertAction(jsonSchema, valibotPipeItem, config);
908
- }
909
- return jsonSchema;
910
- }
911
- let errors;
912
- switch (valibotSchema.type) {
913
- case "boolean":
914
- jsonSchema.type = "boolean";
915
- break;
916
- case "null":
917
- if (config?.target === "openapi-3.0") jsonSchema.enum = [null];
918
- else jsonSchema.type = "null";
919
- break;
920
- case "number":
921
- jsonSchema.type = "number";
922
- break;
923
- case "string":
924
- jsonSchema.type = "string";
925
- break;
926
- case "array":
927
- jsonSchema.type = "array";
928
- jsonSchema.items = convertSchema({}, valibotSchema.item, config, context);
929
- break;
930
- case "tuple":
931
- case "tuple_with_rest":
932
- case "loose_tuple":
933
- case "strict_tuple":
934
- jsonSchema.type = "array";
935
- if (config?.target === "openapi-3.0") {
936
- jsonSchema.items = { anyOf: [] };
937
- jsonSchema.minItems = valibotSchema.items.length;
938
- for (const item of valibotSchema.items) jsonSchema.items.anyOf.push(convertSchema({}, item, config, context));
939
- if (valibotSchema.type === "tuple_with_rest") jsonSchema.items.anyOf.push(convertSchema({}, valibotSchema.rest, config, context));
940
- else if (valibotSchema.type === "strict_tuple" || valibotSchema.type === "tuple") jsonSchema.maxItems = valibotSchema.items.length;
941
- } else if (config?.target === "draft-2020-12") {
942
- jsonSchema.prefixItems = [];
943
- jsonSchema.minItems = valibotSchema.items.length;
944
- for (const item of valibotSchema.items) jsonSchema.prefixItems.push(convertSchema({}, item, config, context));
945
- if (valibotSchema.type === "tuple_with_rest") jsonSchema.items = convertSchema({}, valibotSchema.rest, config, context);
946
- else if (valibotSchema.type === "strict_tuple") jsonSchema.items = false;
947
- } else {
948
- jsonSchema.items = [];
949
- jsonSchema.minItems = valibotSchema.items.length;
950
- for (const item of valibotSchema.items) jsonSchema.items.push(convertSchema({}, item, config, context));
951
- if (valibotSchema.type === "tuple_with_rest") jsonSchema.additionalItems = convertSchema({}, valibotSchema.rest, config, context);
952
- else if (valibotSchema.type === "strict_tuple") jsonSchema.additionalItems = false;
953
- }
954
- break;
955
- case "object":
956
- case "object_with_rest":
957
- case "loose_object":
958
- case "strict_object":
959
- jsonSchema.type = "object";
960
- jsonSchema.properties = {};
961
- jsonSchema.required = [];
962
- for (const key in valibotSchema.entries) {
963
- const entry = valibotSchema.entries[key];
964
- jsonSchema.properties[key] = convertSchema({}, entry, config, context);
965
- if (entry.type !== "exact_optional" && entry.type !== "nullish" && entry.type !== "optional") jsonSchema.required.push(key);
966
- }
967
- if (valibotSchema.type === "object_with_rest") jsonSchema.additionalProperties = convertSchema({}, valibotSchema.rest, config, context);
968
- else if (valibotSchema.type === "strict_object") jsonSchema.additionalProperties = false;
969
- break;
970
- case "record":
971
- if (config?.target === "openapi-3.0" && "pipe" in valibotSchema.key) errors = addError(errors, "The \"record\" schema with a schema for the key that contains a \"pipe\" cannot be converted to JSON Schema.");
972
- if (valibotSchema.key.type !== "string") errors = addError(errors, `The "record" schema with the "${valibotSchema.key.type}" schema for the key cannot be converted to JSON Schema.`);
973
- jsonSchema.type = "object";
974
- if (config?.target !== "openapi-3.0") jsonSchema.propertyNames = convertSchema({}, valibotSchema.key, config, context);
975
- jsonSchema.additionalProperties = convertSchema({}, valibotSchema.value, config, context);
976
- break;
977
- case "any":
978
- case "unknown": break;
979
- case "never":
980
- jsonSchema.not = {};
981
- break;
982
- case "nullable":
983
- case "nullish":
984
- if (config?.target === "openapi-3.0") {
985
- const innerSchema = convertSchema({}, valibotSchema.wrapped, config, context);
986
- Object.assign(jsonSchema, innerSchema);
987
- jsonSchema.nullable = true;
988
- } else jsonSchema.anyOf = [convertSchema({}, valibotSchema.wrapped, config, context), { type: "null" }];
989
- if (valibotSchema.default !== void 0) jsonSchema.default = typeof valibotSchema.default === "function" ? valibotSchema.default() : valibotSchema.default;
990
- break;
991
- case "exact_optional":
992
- case "optional":
993
- case "undefinedable":
994
- jsonSchema = convertSchema(jsonSchema, valibotSchema.wrapped, config, context);
995
- if (valibotSchema.default !== void 0) jsonSchema.default = typeof valibotSchema.default === "function" ? valibotSchema.default() : valibotSchema.default;
996
- break;
997
- case "literal":
998
- if (!isJsonConstValue(valibotSchema.literal)) {
999
- errors = addError(errors, "The value of the \"literal\" schema is not JSON compatible.");
1000
- break;
1001
- }
1002
- if (config?.target === "openapi-3.0") jsonSchema.enum = [valibotSchema.literal];
1003
- else jsonSchema.const = valibotSchema.literal;
1004
- break;
1005
- case "enum":
1006
- case "picklist": {
1007
- const options = valibotSchema.options;
1008
- if (!options.every((option) => typeof option === "string" || typeof option === "number" && Number.isFinite(option))) {
1009
- errors = addError(errors, `An option of the "${valibotSchema.type}" schema is not JSON compatible.`);
1010
- break;
1011
- }
1012
- jsonSchema.enum = options;
1013
- if (options.every((option) => typeof option === "string")) jsonSchema.type = "string";
1014
- else if (options.every((option) => typeof option === "number")) jsonSchema.type = "number";
1015
- else if (config?.target !== "openapi-3.0") jsonSchema.type = ["string", "number"];
1016
- break;
1017
- }
1018
- case "union":
1019
- jsonSchema.anyOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));
1020
- break;
1021
- case "variant":
1022
- jsonSchema.oneOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));
1023
- break;
1024
- case "intersect":
1025
- jsonSchema.allOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));
1026
- break;
1027
- case "lazy": {
1028
- let wrappedValibotSchema = context.getterMap.get(valibotSchema.getter);
1029
- if (!wrappedValibotSchema) {
1030
- wrappedValibotSchema = valibotSchema.getter(void 0);
1031
- context.getterMap.set(valibotSchema.getter, wrappedValibotSchema);
1032
- }
1033
- let referenceId = context.referenceMap.get(wrappedValibotSchema);
1034
- if (!referenceId) {
1035
- referenceId = context.referenceMap.createId(context.definitions);
1036
- context.referenceMap.set(wrappedValibotSchema, referenceId);
1037
- context.definitions[referenceId] = convertSchema({}, wrappedValibotSchema, config, context, true);
1038
- }
1039
- jsonSchema.$ref = getDefinitionRef(referenceId);
1040
- if (config?.overrideRef) {
1041
- const refOverride = config.overrideRef({
1042
- ...context,
1043
- referenceId,
1044
- valibotSchema: wrappedValibotSchema,
1045
- jsonSchema
1046
- });
1047
- if (refOverride) jsonSchema.$ref = refOverride;
1048
- }
1049
- break;
1050
- }
1051
- default: errors = addError(errors, `The "${valibotSchema.type}" schema cannot be converted to JSON Schema.`);
1052
- }
1053
- if (config?.overrideSchema) {
1054
- const schemaOverride = config.overrideSchema({
1055
- ...context,
1056
- referenceId: context.referenceMap.get(valibotSchema),
1057
- valibotSchema,
1058
- jsonSchema,
1059
- errors
1060
- });
1061
- if (schemaOverride) return { ...schemaOverride };
1062
- }
1063
- if (errors) for (const message of errors) handleError(message, config);
1064
- return jsonSchema;
1065
- }
1066
- /**
1067
- * Converts a Valibot schema to the JSON Schema format.
1068
- *
1069
- * @param schema The Valibot schema object.
1070
- * @param config The JSON Schema configuration.
1071
- *
1072
- * @returns The converted JSON Schema.
1073
- */
1074
- function toJsonSchema(schema, config) {
1075
- const context = {
1076
- definitions: {},
1077
- referenceMap: new ReferenceMap(),
1078
- getterMap: /* @__PURE__ */ new Map()
1079
- };
1080
- const definitions = config?.definitions ?? void 0;
1081
- if (definitions) {
1082
- for (const key in definitions) context.referenceMap.set(definitions[key], key);
1083
- for (const key in definitions) context.definitions[key] = convertSchema({}, definitions[key], config, context, true);
1084
- }
1085
- const jsonSchema = convertSchema({}, schema, config, context);
1086
- const target = config?.target ?? "draft-07";
1087
- if (target === "draft-2020-12") jsonSchema.$schema = "https://json-schema.org/draft/2020-12/schema";
1088
- else if (target === "draft-07") jsonSchema.$schema = "http://json-schema.org/draft-07/schema#";
1089
- if (context.referenceMap.size) jsonSchema.$defs = context.definitions;
1090
- return jsonSchema;
1091
- }
1092
411
  // ../internal/src/valibot.ts
1093
412
  const valibotTargets = /* @__PURE__ */ new Set([
1094
413
  "draft-07",
@@ -1192,7 +511,7 @@ function operationInputJsonSchema(operation) {
1192
511
  }
1193
512
  // src/operations.ts
1194
513
  const runtime = () => import("./runtime.js");
1195
- const members = () => import("./members-Cr_Nlyg4.js").then((n) => n.l);
514
+ const members = () => import("./members-DvpsP5Px.js").then((n) => n.u);
1196
515
  const statuses = {
1197
516
  WEBHOOKS_BODY_INVALID: 400,
1198
517
  WEBHOOKS_DATABASE_MISSING: 409,
@@ -1,4 +1,4 @@
1
- import { C as webhooksErrors, S as WebhookDeliveryErrorCode, a as SendToMemberEndpointResult, x as SendWebhookErrorCode } from "./members-BjDcAAhY.js";
1
+ import { C as WebhookDeliveryErrorCode, S as SendWebhookErrorCode, a as SendToMemberEndpointResult, w as webhooksErrors } from "./members-Cn93y6gO.js";
2
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";
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-BdILDcW1.js";
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
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/vite.d.ts CHANGED
@@ -110,7 +110,7 @@ interface ViteHubConsoleOperationAction {
110
110
  operation: string;
111
111
  input: Readonly<Record<string, string>>;
112
112
  /**
113
- * The result is `{ url }`, such as a one-time link or a provider sign-in: the Console opens it in a new tab, and loads
113
+ * The result is `{ url }`, such as a provider sign-in: the Console opens it in a new tab, and loads
114
114
  * the list again when the person comes back. The URL must be `https:`, or `http:` on a loopback host.
115
115
  */
116
116
  tab?: true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vite-hub/webhooks",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
4
4
  "description": "Send ViteHub events to an outside URL: signed, retried, and debounced on every host.",
5
5
  "keywords": [
6
6
  "debounce",
@@ -55,8 +55,9 @@
55
55
  },
56
56
  "dependencies": {
57
57
  "@standard-schema/spec": "^1.1.0",
58
- "@vite-hub/env": "0.5.1",
59
- "@vite-hub/runtime": "0.5.1",
58
+ "@valibot/to-json-schema": "^1.8.0",
59
+ "@vite-hub/env": "0.6.1",
60
+ "@vite-hub/runtime": "0.6.1",
60
61
  "valibot": "^1.5.0"
61
62
  },
62
63
  "devDependencies": {