@vite-hub/queue 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/dist/{client-DYE_ZV8c.js → client-CwoCdKct.js} +9 -11
- package/dist/{cloudflare-GosJefIK.js → cloudflare-BMc35cBD.js} +2 -4
- package/dist/{cloudflare-client-BasaJ68s.js → cloudflare-client-xWteD-su.js} +6 -8
- package/dist/{cloudflare-resource-name-BUNNqgkg.js → cloudflare-resource-name-Bv8Z7nDU.js} +3 -4
- package/dist/{config-YEuaeQVq.js → config-Bzp1xmdh.js} +4 -7
- package/dist/{definition-BL_3WHNu.js → definition-CIiFfst2.js} +3 -4
- package/dist/durability.d.ts +1 -3
- package/dist/durability.js +1 -2
- package/dist/{duration-CshzgSSx.js → duration-C5w_-Rf4.js} +4 -7
- package/dist/{error-diagnostics-DukggGP6.js → error-diagnostics-Dv6nKZQW.js} +1 -2
- package/dist/{error-diagnostics-C0KyI408.js → error-diagnostics-kKXseq8d.js} +5 -2
- package/dist/{handler-response-ChtAjPNo.js → handler-response-CchTXVjm.js} +3 -5
- package/dist/index.d.ts +1 -9
- package/dist/index.js +5 -6
- package/dist/{inspect-PeuckaC3.js → inspect-CwdWUhPj.js} +1 -2
- package/dist/internal/runtime/cloudflare-client.d.ts +2 -4
- package/dist/internal/runtime/cloudflare-client.js +1 -2
- package/dist/internal/runtime/cloudflare-vite.d.ts +2 -9
- package/dist/internal/runtime/cloudflare-vite.js +11 -15
- package/dist/internal/runtime/local-client.d.ts +4 -6
- package/dist/internal/runtime/local-client.js +5 -6
- package/dist/internal/runtime/postgres-client.d.ts +4 -7
- package/dist/internal/runtime/postgres-client.js +8 -10
- package/dist/internal/runtime/state.d.ts +3 -5
- package/dist/internal/runtime/state.js +1 -2
- package/dist/internal/runtime/vercel-client.d.ts +2 -4
- package/dist/internal/runtime/vercel-client.js +5 -7
- package/dist/internal/runtime/worker-client.d.ts +3 -5
- package/dist/internal/runtime/worker-client.js +2 -3
- package/dist/{invariant-D8_xBqmZ.js → invariant-CmdvZ3vp.js} +1 -2
- package/dist/{local-DAL5ZgDg.d.ts → local-B72WRWkS.d.ts} +1 -3
- package/dist/{local-CnBd5jdm.js → local-RX10a_Sq.js} +3 -4
- package/dist/{object-D8pRdprI.js → object-DRSmpe04.js} +1 -2
- package/dist/{operation-definition-CI2PJGqu.d.ts → operation-definition-CqZkx1Rm.d.ts} +0 -4
- package/dist/{operations-BL0b9pte.js → operations-CoEXxfUW.js} +6 -7
- package/dist/operations.d.ts +3 -7
- package/dist/operations.js +9 -696
- package/dist/runtime/hosted.d.ts +2 -4
- package/dist/runtime/hosted.js +4 -5
- package/dist/{scan-module-BbqyaLl6.js → scan-module-BaqBao0J.js} +2 -4
- package/dist/{state-ER1YdCBF.js → state-DqxeV11k.js} +5 -8
- package/dist/{types-D6hDNcMY.d.ts → types-BevEYrUV.d.ts} +1 -3
- package/dist/{types-klaR79hV.d.ts → types-BzPGPV9z.d.ts} +0 -2
- package/dist/{vercel-region-DOciq2kx.js → vercel-region-DEsR1YJQ.js} +2 -3
- package/dist/{vercel-C_4vqxcl.js → vercel-sUJOxFBB.js} +2 -3
- package/dist/vite.d.ts +3 -29
- package/dist/vite.js +36 -52
- package/package.json +11 -10
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
1
|
+
import { a as getQueueRuntimeEvent, c as loadQueueDefinition, g as resolveWaitUntil, i as getQueueRuntimeConfig, n as getOrCreateQueueClient, r as getQueueRuntimeClientFactory, u as runWithQueueRuntimeEvent, v as getCloudflareEnv } from "./state-DqxeV11k.js";
|
|
2
|
+
import { n as normalizeQueueOptions } from "./config-Bzp1xmdh.js";
|
|
3
|
+
import { a as normalizePublicQueueIdentifier, c as queueRemovedOptionsError, d as normalizeQueueEnqueueInput, l as queueUnsupportedOptionsError, r as isQueueError, t as readQueueTimes } from "./duration-C5w_-Rf4.js";
|
|
4
|
+
import { t as resolveVercelQueueRegion } from "./vercel-region-DEsR1YJQ.js";
|
|
5
|
+
import { t as getCloudflareQueueBindingName } from "./cloudflare-BMc35cBD.js";
|
|
6
|
+
import { t as getVercelQueueTopicName } from "./vercel-sUJOxFBB.js";
|
|
7
|
+
import { t as queueErrorDiagnostics } from "./error-diagnostics-Dv6nKZQW.js";
|
|
8
8
|
import { getViteHubTestMode } from "@vite-hub/runtime/internal/test-mode";
|
|
9
|
-
|
|
9
|
+
// src/runtime/test-client.ts
|
|
10
10
|
/** The sent jobs of the current test. `vite-hub/test` reads the same list. */
|
|
11
11
|
function queueTestMessages(test) {
|
|
12
12
|
return test.backend("queue", () => []);
|
|
@@ -56,8 +56,7 @@ function createTestQueueClient(test, queue, provider) {
|
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
//#region src/runtime/client.ts
|
|
59
|
+
// src/runtime/client.ts
|
|
61
60
|
async function loadNamedQueueDefinition(name) {
|
|
62
61
|
try {
|
|
63
62
|
return await loadQueueDefinition(name);
|
|
@@ -177,5 +176,4 @@ function sendQueue(name, payload, options) {
|
|
|
177
176
|
function deferQueue(name, payload, options) {
|
|
178
177
|
deferDynamicQueue(name, payload, options);
|
|
179
178
|
}
|
|
180
|
-
//#endregion
|
|
181
179
|
export { useQueue as i, dynamicQueue as n, sendQueue as r, deferQueue as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../internal/src/integrations/hex.ts
|
|
2
2
|
const textEncoder = new TextEncoder();
|
|
3
3
|
const textDecoder = new TextDecoder();
|
|
4
4
|
function encodeNameHex(name) {
|
|
@@ -9,8 +9,7 @@ function decodeNameHex(hex) {
|
|
|
9
9
|
if (!bytes.length || bytes.some((byte) => !Number.isFinite(byte))) return;
|
|
10
10
|
return textDecoder.decode(new Uint8Array(bytes));
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
//#region src/integrations/cloudflare.ts
|
|
12
|
+
// src/integrations/cloudflare.ts
|
|
14
13
|
const defaultCloudflareQueueBindingPrefix = "QUEUE";
|
|
15
14
|
const encodedCloudflareQueueNamePattern = /^queue--([0-9a-f]{2})+$/i;
|
|
16
15
|
function getCloudflareQueueBindingName(name) {
|
|
@@ -22,5 +21,4 @@ function getCloudflareQueueDefinitionName(name, namePrefix = "") {
|
|
|
22
21
|
if (!encodedCloudflareQueueNamePattern.test(encodedName)) return encodedName;
|
|
23
22
|
return decodeNameHex(encodedName.slice(7)) || name;
|
|
24
23
|
}
|
|
25
|
-
//#endregion
|
|
26
24
|
export { getCloudflareQueueDefinitionName as n, encodeNameHex as r, getCloudflareQueueBindingName as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
import { n as getCloudflareQueueDefinitionName } from "./cloudflare-
|
|
4
|
-
import { i as reportQueueDeliveryError, r as isNonRetryableQueueError, t as checkQueueHandlerResponse } from "./handler-response-
|
|
1
|
+
import { a as normalizePublicQueueIdentifier, c as queueRemovedOptionsError, d as normalizeQueueEnqueueInput, l as queueUnsupportedOptionsError, s as queueProviderResult, t as readQueueTimes } from "./duration-C5w_-Rf4.js";
|
|
2
|
+
import { t as queueErrorDiagnostics } from "./error-diagnostics-Dv6nKZQW.js";
|
|
3
|
+
import { n as getCloudflareQueueDefinitionName } from "./cloudflare-BMc35cBD.js";
|
|
4
|
+
import { i as reportQueueDeliveryError, r as isNonRetryableQueueError, t as checkQueueHandlerResponse } from "./handler-response-CchTXVjm.js";
|
|
5
5
|
import { parseDuration } from "@vite-hub/runtime";
|
|
6
|
-
|
|
6
|
+
// src/providers/cloudflare.ts
|
|
7
7
|
const cloudflareBindingName = /^[A-Z_]\w{0,127}$/i;
|
|
8
8
|
function isCloudflareQueueBinding(binding) {
|
|
9
9
|
if (binding === null || typeof binding !== "object" || Array.isArray(binding)) return false;
|
|
@@ -140,8 +140,7 @@ function createCloudflareQueueClient(provider) {
|
|
|
140
140
|
createBatchHandler: createCloudflareQueueBatchHandler
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
-
|
|
144
|
-
//#region src/internal/runtime/cloudflare-client.ts
|
|
143
|
+
// src/internal/runtime/cloudflare-client.ts
|
|
145
144
|
async function createCloudflareQueueRuntimeClient(options) {
|
|
146
145
|
if (options.driver !== "cloudflare") throw queueErrorDiagnostics.QUEUE_DRIVER_MISMATCH({
|
|
147
146
|
driver: options.driver,
|
|
@@ -149,5 +148,4 @@ async function createCloudflareQueueRuntimeClient(options) {
|
|
|
149
148
|
});
|
|
150
149
|
return createCloudflareQueueClient(options);
|
|
151
150
|
}
|
|
152
|
-
//#endregion
|
|
153
151
|
export { createCloudflareQueueBatchHandler as n, createCloudflareQueueRuntimeClient as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { r as encodeNameHex } from "./cloudflare-BMc35cBD.js";
|
|
2
|
+
import { t as queueErrorDiagnostics } from "./error-diagnostics-Dv6nKZQW.js";
|
|
3
|
+
// src/internal/cloudflare-resource-name.ts
|
|
4
4
|
const cloudflareQueueNamePrefix = "queue--";
|
|
5
5
|
const cloudflareQueueNamePattern = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i;
|
|
6
6
|
const cloudflareLegacyQueueDefinitionNamePattern = /^[a-z0-9]+-[a-z0-9]+$/;
|
|
@@ -31,5 +31,4 @@ function getCloudflareQueueName(name, namePrefix = "") {
|
|
|
31
31
|
if (!cloudflareQueueNamePattern.test(queueName)) throw queueErrorDiagnostics.QUEUE_INVALID_NAME({ name: queueName });
|
|
32
32
|
return queueName.length <= maxCloudflareQueueNameLength ? queueName : createBoundedCloudflareQueueName(name, namePrefix);
|
|
33
33
|
}
|
|
34
|
-
//#endregion
|
|
35
34
|
export { getCloudflareQueueName as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as isRecord } from "./object-
|
|
2
|
-
import { t as queueErrorDiagnostics } from "./error-diagnostics-
|
|
1
|
+
import { n as isRecord } from "./object-DRSmpe04.js";
|
|
2
|
+
import { t as queueErrorDiagnostics } from "./error-diagnostics-Dv6nKZQW.js";
|
|
3
3
|
import { defu } from "defu";
|
|
4
4
|
/** Maps a host name or a Nitro preset name, such as `cloudflare-module` or `node-server`, to its ViteHub host. */
|
|
5
5
|
function hostFromNitroPreset(value) {
|
|
@@ -11,8 +11,7 @@ function hostFromNitroPreset(value) {
|
|
|
11
11
|
if (normalized === "node" || normalized.startsWith("node-")) return "node";
|
|
12
12
|
if (normalized.startsWith("vercel")) return "vercel";
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
//#region ../internal/src/hosting.ts
|
|
14
|
+
// ../internal/src/hosting.ts
|
|
16
15
|
/**
|
|
17
16
|
* Returns the Nitro preset name that this build targets, as the developer wrote it.
|
|
18
17
|
* The order is `nitro.preset`, `hosting`, `NITRO_PRESET`, `SERVER_PRESET`, then `VITEHUB_HOST`.
|
|
@@ -43,8 +42,7 @@ function getHostingProvider(hosting) {
|
|
|
43
42
|
const host = hostFromNitroPreset(hosting);
|
|
44
43
|
if (host === "cloudflare" || host === "netlify" || host === "vercel") return host;
|
|
45
44
|
}
|
|
46
|
-
|
|
47
|
-
//#region src/config.ts
|
|
45
|
+
// src/config.ts
|
|
48
46
|
const knownDrivers = /* @__PURE__ */ new Set([
|
|
49
47
|
"cloudflare",
|
|
50
48
|
"local",
|
|
@@ -99,5 +97,4 @@ function normalizeQueueOptions(options, input = {}) {
|
|
|
99
97
|
if (typeof options !== "undefined" && !isRecord(options)) throw queueErrorDiagnostics.QUEUE_INVALID_CONFIG();
|
|
100
98
|
return resolveDriver(options || {}, normalizeHosting(input.hosting), input.postgresDatabase === true);
|
|
101
99
|
}
|
|
102
|
-
//#endregion
|
|
103
100
|
export { resolveHost as a, getHostingProvider as i, normalizeQueueOptions as n, resolveHostPreset as o, postgresQueueUrlVariable as r, defaultLocalQueueBase as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as isRecord } from "./object-
|
|
2
|
-
import { t as queueErrorDiagnostics } from "./error-diagnostics-
|
|
3
|
-
|
|
1
|
+
import { n as isRecord } from "./object-DRSmpe04.js";
|
|
2
|
+
import { t as queueErrorDiagnostics } from "./error-diagnostics-Dv6nKZQW.js";
|
|
3
|
+
// src/definition.ts
|
|
4
4
|
/** Cloudflare accepts a `max_batch_size` from 1 to 100. */
|
|
5
5
|
function isQueueMaxBatchSize(value) {
|
|
6
6
|
return typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= 100;
|
|
@@ -23,5 +23,4 @@ function defineQueue(definition, ...removed) {
|
|
|
23
23
|
if (definition.maxBatchSize !== void 0 && !isQueueMaxBatchSize(definition.maxBatchSize)) throw queueErrorDiagnostics.QUEUE_MAX_BATCH_SIZE_INVALID({ where: "defineQueue()" });
|
|
24
24
|
return definition;
|
|
25
25
|
}
|
|
26
|
-
//#endregion
|
|
27
26
|
export { isQueueMaxBatchSize as n, defineQueue as t };
|
package/dist/durability.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Durability, DurabilityContext } from "@vite-hub/runtime/durability";
|
|
2
|
-
//#region src/durability.d.ts
|
|
3
2
|
/** What the build passes to `queueDurability()`. */
|
|
4
3
|
export interface QueueDurabilityInput {
|
|
5
4
|
/** The folder of the `local` driver. */
|
|
@@ -9,5 +8,4 @@ export interface QueueDurabilityInput {
|
|
|
9
8
|
driver: string;
|
|
10
9
|
}
|
|
11
10
|
/** The durability of Queue jobs, from the driver. */
|
|
12
|
-
export declare function queueDurability(input: QueueDurabilityInput, context: DurabilityContext): Durability[];
|
|
13
|
-
//#endregion
|
|
11
|
+
export declare function queueDurability(input: QueueDurabilityInput, context: DurabilityContext): Durability[];
|
package/dist/durability.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/durability.ts
|
|
2
2
|
const hostedDrivers = {
|
|
3
3
|
cloudflare: "Cloudflare Queues deliver each job once.",
|
|
4
4
|
vercel: "Vercel Queues deliver each job once."
|
|
@@ -43,5 +43,4 @@ function queueDurability(input, context) {
|
|
|
43
43
|
fix: "Use the `postgres` driver with a Postgres Default Database."
|
|
44
44
|
}];
|
|
45
45
|
}
|
|
46
|
-
//#endregion
|
|
47
46
|
export { queueDurability };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as queueErrorDiagnostics } from "./error-diagnostics-
|
|
1
|
+
import { t as queueErrorDiagnostics } from "./error-diagnostics-Dv6nKZQW.js";
|
|
2
2
|
import { parseDuration, toResultError } from "@vite-hub/runtime";
|
|
3
3
|
import { runtimeErrorDiagnostics } from "@vite-hub/runtime/internal/error-diagnostics";
|
|
4
|
-
|
|
4
|
+
// src/enqueue.ts
|
|
5
5
|
let fallbackCounter = 0;
|
|
6
6
|
function createQueueMessageId(prefix = "queue") {
|
|
7
7
|
const uuid = globalThis.crypto?.randomUUID?.();
|
|
@@ -17,8 +17,7 @@ function normalizeQueueEnqueueInput(payload, options = {}) {
|
|
|
17
17
|
payload
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
//#region src/errors.ts
|
|
20
|
+
// src/errors.ts
|
|
22
21
|
const cloudflareUnsupportedEnqueueOptions = [
|
|
23
22
|
"idempotencyKey",
|
|
24
23
|
"region",
|
|
@@ -87,8 +86,7 @@ async function queueProviderResult(provider, operation, run) {
|
|
|
87
86
|
}), void 0];
|
|
88
87
|
}
|
|
89
88
|
}
|
|
90
|
-
|
|
91
|
-
//#region src/duration.ts
|
|
89
|
+
// src/duration.ts
|
|
92
90
|
function readRetentionSeconds(seconds, round) {
|
|
93
91
|
if (!Number.isFinite(seconds) || seconds < 0) throw runtimeErrorDiagnostics.RUNTIME_DURATION_INVALID({
|
|
94
92
|
option: "retention",
|
|
@@ -115,5 +113,4 @@ function readQueueTimes(options, round) {
|
|
|
115
113
|
throw error;
|
|
116
114
|
}
|
|
117
115
|
}
|
|
118
|
-
//#endregion
|
|
119
116
|
export { normalizePublicQueueIdentifier as a, queueRemovedOptionsError as c, normalizeQueueEnqueueInput as d, localUnsupportedEnqueueOptions as i, queueUnsupportedOptionsError as l, cloudflareUnsupportedEnqueueOptions as n, postgresUnsupportedEnqueueOptions as o, isQueueError as r, queueProviderResult as s, readQueueTimes as t, createQueueMessageId as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineErrors } from "@vite-hub/runtime";
|
|
2
|
-
|
|
2
|
+
// src/error-diagnostics.ts
|
|
3
3
|
const queueErrorDiagnostics = /*#__PURE__*/ defineErrors({
|
|
4
4
|
docs: "https://vitehub.dev/docs/queue/diagnostics",
|
|
5
5
|
codes: {
|
|
@@ -181,5 +181,4 @@ const queueErrorDiagnostics = /*#__PURE__*/ defineErrors({
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
});
|
|
184
|
-
//#endregion
|
|
185
184
|
export { queueErrorDiagnostics as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineDiagnostics } from "nostics";
|
|
2
|
-
|
|
2
|
+
// ../internal/src/error-diagnostics.ts
|
|
3
3
|
const dynamicError = { why: ({ message }) => message === void 0 ? "" : String(message) };
|
|
4
4
|
const internalErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
|
|
5
5
|
docsBase: "https://vitehub.dev/docs/development/diagnostics",
|
|
@@ -256,6 +256,10 @@ const internalErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
|
|
|
256
256
|
why: ({ minimum }) => `[vitehub] VITEHUB_SECRET must be at least ${minimum} characters. Generate one with \`openssl rand -base64 32\`.`,
|
|
257
257
|
fix: "Set `VITEHUB_SECRET` to the output of `openssl rand -base64 32`, which has 44 characters."
|
|
258
258
|
},
|
|
259
|
+
INTERNAL_SITE_TOKEN_TOO_LONG: {
|
|
260
|
+
why: ({ length, maximum }) => `The Site access token is ${length} characters, and an app accepts ${maximum}.`,
|
|
261
|
+
fix: "Open the app with a shorter path, or give the person and the project shorter names, so that the Site access token fits."
|
|
262
|
+
},
|
|
259
263
|
INTERNAL_SQLITE_ARGUMENT_INVALID: {
|
|
260
264
|
why: ({ value }) => value === "undefined" ? "undefined cannot be passed as argument to the database" : "Only finite numbers (not Infinity or NaN) can be passed as arguments",
|
|
261
265
|
fix: "Pass query arguments as finite numbers, strings, booleans, bigints, dates, byte arrays, or null. Replace undefined with null, and check numbers with `Number.isFinite()` before the query."
|
|
@@ -270,5 +274,4 @@ const internalErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
|
|
|
270
274
|
}
|
|
271
275
|
}
|
|
272
276
|
});
|
|
273
|
-
//#endregion
|
|
274
277
|
export { internalErrorDiagnostics as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as normalizePublicQueueIdentifier, r as isQueueError } from "./duration-
|
|
1
|
+
import { a as normalizePublicQueueIdentifier, r as isQueueError } from "./duration-C5w_-Rf4.js";
|
|
2
2
|
import { getViteHubErrorShape } from "@vite-hub/runtime";
|
|
3
3
|
import { toResponse } from "@vite-hub/runtime/internal/response";
|
|
4
|
-
|
|
4
|
+
// src/internal/delivery-error.ts
|
|
5
5
|
const retryableQueueCodes = /* @__PURE__ */ new Set(["QUEUE_PROVIDER_FAILED", "QUEUE_PROVIDER_INVALID_RESPONSE"]);
|
|
6
6
|
function isNonRetryableQueueError(error) {
|
|
7
7
|
return isQueueError(error) && !retryableQueueCodes.has(error.code);
|
|
@@ -46,8 +46,7 @@ function createQueueDeliveryErrorReport(error, context) {
|
|
|
46
46
|
function reportQueueDeliveryError(error, context) {
|
|
47
47
|
console.error("[vitehub:queue] Queue Delivery failed.", createQueueDeliveryErrorReport(error, context));
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
//#region src/internal/handler-response.ts
|
|
49
|
+
// src/internal/handler-response.ts
|
|
51
50
|
/** Queue deliveries use the handler's status and discard its response body. */
|
|
52
51
|
function checkQueueHandlerResponse(value) {
|
|
53
52
|
const response = toResponse(value);
|
|
@@ -62,5 +61,4 @@ function discardUnreadBody(body) {
|
|
|
62
61
|
if (!body || body.locked) return;
|
|
63
62
|
body.cancel().catch(() => console.debug("[vitehub:queue] The Queue handler response body could not be cancelled."));
|
|
64
63
|
}
|
|
65
|
-
//#endregion
|
|
66
64
|
export { reportQueueDeliveryError as i, createQueueDeliveryErrorReport as n, isNonRetryableQueueError as r, checkQueueHandlerResponse as t };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { A as QueueJobStore, B as VercelQueueCallbackOptions, C as QueueDefinitionRegistry, D as QueueErrorCode, E as QueueEnqueueOptions, F as QueueRegistry, G as VercelQueueSendBatchMessage, H as VercelQueueErrorCode, I as QueueSendResult, K as VercelQueueSendBatchOptions, L as ResolvedLocalQueueOptions, M as QueueName, N as QueueOptions, O as QueueHandler, P as QueuePayload, R as ResolvedQueueOptions, S as QueueDefinitionOptions, T as QueueDriverOptions, U as VercelQueueRetryDirective, V as VercelQueueClient, W as VercelQueueRetryHandler, _ as PostgresQueueClient, a as CloudflareQueueMessageBatch, b as QueueClient, c as LocalQueueClient, g as NodeQueueDriver, i as CloudflareQueueMessage, j as QueueModuleDriverOptions, k as QueueJob, l as LocalQueueDriverOptions, m as LocalQueueSendBatchMessage, n as CloudflareQueueClient, o as CloudflareQueueSendBatchItem, p as LocalQueueRules, q as VercelQueueSendResult, r as CloudflareQueueErrorCode, s as DiscoveredQueueDefinition, t as CloudflareQueueBatchHandlerOptions, u as LocalQueueErrorCode, v as PostgresQueueDriverOptions, w as QueueDriver, x as QueueDefinition, y as PostgresQueueErrorCode, z as VercelQueueBatchSendResult } from "./types-
|
|
1
|
+
import { A as QueueJobStore, B as VercelQueueCallbackOptions, C as QueueDefinitionRegistry, D as QueueErrorCode, E as QueueEnqueueOptions, F as QueueRegistry, G as VercelQueueSendBatchMessage, H as VercelQueueErrorCode, I as QueueSendResult, K as VercelQueueSendBatchOptions, L as ResolvedLocalQueueOptions, M as QueueName, N as QueueOptions, O as QueueHandler, P as QueuePayload, R as ResolvedQueueOptions, S as QueueDefinitionOptions, T as QueueDriverOptions, U as VercelQueueRetryDirective, V as VercelQueueClient, W as VercelQueueRetryHandler, _ as PostgresQueueClient, a as CloudflareQueueMessageBatch, b as QueueClient, c as LocalQueueClient, g as NodeQueueDriver, i as CloudflareQueueMessage, j as QueueModuleDriverOptions, k as QueueJob, l as LocalQueueDriverOptions, m as LocalQueueSendBatchMessage, n as CloudflareQueueClient, o as CloudflareQueueSendBatchItem, p as LocalQueueRules, q as VercelQueueSendResult, r as CloudflareQueueErrorCode, s as DiscoveredQueueDefinition, t as CloudflareQueueBatchHandlerOptions, u as LocalQueueErrorCode, v as PostgresQueueDriverOptions, w as QueueDriver, x as QueueDefinition, y as PostgresQueueErrorCode, z as VercelQueueBatchSendResult } from "./types-BzPGPV9z.js";
|
|
2
2
|
import { Result } from "@vite-hub/runtime";
|
|
3
|
-
//#region src/definition.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Defines a Queue from one object: `defineQueue({ handler, concurrency })`. The handler receives one object,
|
|
6
5
|
* `{ payload, id, attempts, metadata }`. The payload type of `handler` types `sendQueue()` for this Queue.
|
|
7
6
|
*/
|
|
8
7
|
export declare function defineQueue<TPayload = unknown, TResult = unknown>(definition: QueueDefinition<TPayload, TResult>): QueueDefinition<TPayload, TResult>;
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/enqueue.d.ts
|
|
11
8
|
export declare function createQueueMessageId(prefix?: string): string;
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/runtime/client.d.ts
|
|
14
9
|
declare function useDynamicQueue(name: string): Promise<QueueClient>;
|
|
15
10
|
declare function sendDynamicQueue(name: string, payload: unknown, options?: QueueEnqueueOptions): Promise<Result<QueueSendResult, QueueErrorCode>>;
|
|
16
11
|
declare function deferDynamicQueue(name: string, payload: unknown, options?: QueueEnqueueOptions): void;
|
|
@@ -34,8 +29,5 @@ export declare function sendQueue<TName extends QueueName>(name: TName, payload:
|
|
|
34
29
|
* `onDispatchError` option of the Queue Definition. Call `sendQueue()` when the caller needs the message ID.
|
|
35
30
|
*/
|
|
36
31
|
export declare function deferQueue<TName extends QueueName>(name: TName, payload: NoInfer<QueuePayload<TName>>, options?: QueueEnqueueOptions): void;
|
|
37
|
-
//#endregion
|
|
38
|
-
//#region src/runtime/create-client.d.ts
|
|
39
32
|
export declare function createQueueClient(options: QueueDriverOptions): Promise<QueueClient>;
|
|
40
|
-
//#endregion
|
|
41
33
|
export type { CloudflareQueueBatchHandlerOptions, CloudflareQueueClient, CloudflareQueueErrorCode, CloudflareQueueMessage, CloudflareQueueMessageBatch, CloudflareQueueSendBatchItem, DiscoveredQueueDefinition, LocalQueueClient, LocalQueueDriverOptions, LocalQueueErrorCode, LocalQueueRules, LocalQueueSendBatchMessage, NodeQueueDriver, PostgresQueueClient, PostgresQueueDriverOptions, PostgresQueueErrorCode, QueueClient, QueueDefinition, QueueDefinitionOptions, QueueDefinitionRegistry, QueueDriver, QueueDriverOptions, QueueEnqueueOptions, QueueErrorCode, QueueHandler, QueueJob, QueueJobStore, QueueModuleDriverOptions, QueueName, QueueOptions, QueuePayload, QueueRegistry, QueueSendResult, ResolvedLocalQueueOptions, ResolvedQueueOptions, VercelQueueBatchSendResult, VercelQueueCallbackOptions, VercelQueueClient, VercelQueueErrorCode, VercelQueueRetryDirective, VercelQueueRetryHandler, VercelQueueSendBatchMessage, VercelQueueSendBatchOptions, VercelQueueSendResult };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { t as defineQueue } from "./definition-CIiFfst2.js";
|
|
2
|
+
import { u as createQueueMessageId } from "./duration-C5w_-Rf4.js";
|
|
3
|
+
import { i as useQueue, n as dynamicQueue, r as sendQueue, t as deferQueue } from "./client-CwoCdKct.js";
|
|
4
|
+
import { t as queueErrorDiagnostics } from "./error-diagnostics-Dv6nKZQW.js";
|
|
5
|
+
// src/runtime/create-client.ts
|
|
6
6
|
async function createQueueClient(options) {
|
|
7
7
|
if (options.driver === void 0 && Object.hasOwn(options, "provider")) {
|
|
8
8
|
const provider = options.provider;
|
|
@@ -29,5 +29,4 @@ async function createQueueClient(options) {
|
|
|
29
29
|
const { createVercelQueueRuntimeClient } = await import("./internal/runtime/vercel-client.js");
|
|
30
30
|
return await createVercelQueueRuntimeClient(options);
|
|
31
31
|
}
|
|
32
|
-
//#endregion
|
|
33
32
|
export { createQueueClient, createQueueMessageId, deferQueue, defineQueue, dynamicQueue, sendQueue, useQueue };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { relative } from "pathe";
|
|
2
|
-
|
|
2
|
+
// ../internal/src/inspect.ts
|
|
3
3
|
function relativeDefinitionFile(projectRoot, file) {
|
|
4
4
|
return relative(projectRoot, file).replaceAll("\\", "/");
|
|
5
5
|
}
|
|
@@ -26,5 +26,4 @@ const embeddedSecretAssignmentPattern = new RegExp(String.raw`\b([\w-]*(?:${secr
|
|
|
26
26
|
function redactInspectionText(value) {
|
|
27
27
|
return value.replace(embeddedUrlCredentialPattern, `$1${redactedInspectionValue}@`).replace(embeddedAuthorizationPattern, `$1${redactedInspectionValue}`).replace(embeddedCookiePattern, `$1${redactedInspectionValue}`).replace(embeddedBearerPattern, `Bearer ${redactedInspectionValue}`).replace(embeddedSecretAssignmentPattern, `$1${redactedInspectionValue}`);
|
|
28
28
|
}
|
|
29
|
-
//#endregion
|
|
30
29
|
export { summarizeDefinitions as n, redactInspectionText as t };
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import { T as QueueDriverOptions, b as QueueClient } from "../../types-
|
|
2
|
-
|
|
3
|
-
export declare function createCloudflareQueueRuntimeClient(options: QueueDriverOptions): Promise<QueueClient>;
|
|
4
|
-
//#endregion
|
|
1
|
+
import { T as QueueDriverOptions, b as QueueClient } from "../../types-BzPGPV9z.js";
|
|
2
|
+
export declare function createCloudflareQueueRuntimeClient(options: QueueDriverOptions): Promise<QueueClient>;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { createCloudflareQueueRuntimeClient };
|
|
1
|
+
export { t as createCloudflareQueueRuntimeClient } from "../../cloudflare-client-xWteD-su.js";
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
import { C as QueueDefinitionRegistry, R as ResolvedQueueOptions, a as CloudflareQueueMessageBatch } from "../../types-
|
|
2
|
-
//#region ../internal/src/runtime/cloudflare-env-lookup.d.ts
|
|
1
|
+
import { C as QueueDefinitionRegistry, R as ResolvedQueueOptions, a as CloudflareQueueMessageBatch } from "../../types-BzPGPV9z.js";
|
|
3
2
|
type CloudflareWorkerEnv = Record<string, unknown>;
|
|
4
|
-
//#endregion
|
|
5
|
-
//#region ../internal/src/runtime/cloudflare-env.d.ts
|
|
6
3
|
interface CloudflareWorkerExecutionContext {
|
|
7
4
|
waitUntil?: (promise: Promise<unknown>) => void;
|
|
8
5
|
}
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region ../internal/src/runtime/app.d.ts
|
|
11
6
|
type AppHandler = (request: Request, context?: Record<string, unknown>) => Response | Promise<Response>;
|
|
12
7
|
type VitehubApp = AppHandler | {
|
|
13
8
|
fetch?: AppHandler;
|
|
14
9
|
request?: (request: Request, options?: RequestInit, context?: Record<string, unknown>) => Response | Promise<Response>;
|
|
15
10
|
};
|
|
16
|
-
//#endregion
|
|
17
|
-
//#region src/internal/runtime/cloudflare-vite.d.ts
|
|
18
11
|
export type CloudflareWorkerApp = VitehubApp;
|
|
19
12
|
export interface QueueCloudflareWorkerOptions {
|
|
20
13
|
app?: CloudflareWorkerApp;
|
|
@@ -27,4 +20,4 @@ export interface QueueCloudflareWorker {
|
|
|
27
20
|
queue: (batch: CloudflareQueueMessageBatch, env: CloudflareWorkerEnv, context: CloudflareWorkerExecutionContext) => Promise<void>;
|
|
28
21
|
}
|
|
29
22
|
export declare function createQueueCloudflareWorker(options?: QueueCloudflareWorkerOptions): QueueCloudflareWorker;
|
|
30
|
-
|
|
23
|
+
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { t as internalErrorDiagnostics } from "../../error-diagnostics-kKXseq8d.js";
|
|
2
|
+
import { n as normalizeQueueOptions } from "../../config-Bzp1xmdh.js";
|
|
3
|
+
import { n as getCloudflareQueueDefinitionName } from "../../cloudflare-BMc35cBD.js";
|
|
4
|
+
import { t as getCloudflareQueueName } from "../../cloudflare-resource-name-Bv8Z7nDU.js";
|
|
5
|
+
import { n as createCloudflareQueueBatchHandler, t as createCloudflareQueueRuntimeClient } from "../../cloudflare-client-xWteD-su.js";
|
|
6
|
+
import { _ as runWithActiveCloudflareEnv, c as loadQueueDefinition, d as setQueueRuntimeConfig, h as createCloudflareRuntimeEvent, m as setQueueRuntimeRegistry, u as runWithQueueRuntimeEvent } from "../../state-DqxeV11k.js";
|
|
7
|
+
import { t as queueErrorDiagnostics } from "../../error-diagnostics-Dv6nKZQW.js";
|
|
8
8
|
import { runInRunScopes } from "@vite-hub/runtime/internal/run-scope";
|
|
9
|
-
|
|
9
|
+
// ../internal/src/runtime/app.ts
|
|
10
10
|
function resolveAppFetch(label, app) {
|
|
11
11
|
if (!app) return;
|
|
12
12
|
if (typeof app === "function") return app;
|
|
@@ -14,8 +14,7 @@ function resolveAppFetch(label, app) {
|
|
|
14
14
|
if (typeof app.fetch === "function") return app.fetch.bind(app);
|
|
15
15
|
throw internalErrorDiagnostics.INTERNAL_R0011({ message: `Invalid ${label} app. Expected an h3 app or a fetch-compatible handler.` });
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
//#region ../internal/src/runtime/cloudflare-hosted.ts
|
|
17
|
+
// ../internal/src/runtime/cloudflare-hosted.ts
|
|
19
18
|
function createWebRequestHandler(appHandler) {
|
|
20
19
|
return async (request, context) => await Promise.resolve(appHandler ? appHandler(request, context) : new Response(JSON.stringify({
|
|
21
20
|
status: 404,
|
|
@@ -38,8 +37,7 @@ function createCloudflareHostedWorker(adapter) {
|
|
|
38
37
|
return await handle();
|
|
39
38
|
} };
|
|
40
39
|
}
|
|
41
|
-
|
|
42
|
-
//#region src/runtime/cloudflare-shared.ts
|
|
40
|
+
// src/runtime/cloudflare-shared.ts
|
|
43
41
|
function createQueueJob(message, batch) {
|
|
44
42
|
return {
|
|
45
43
|
attempts: typeof message.attempts === "number" ? message.attempts : 1,
|
|
@@ -51,8 +49,7 @@ function createQueueJob(message, batch) {
|
|
|
51
49
|
payload: message.body
|
|
52
50
|
};
|
|
53
51
|
}
|
|
54
|
-
|
|
55
|
-
//#region src/internal/runtime/cloudflare-vite.ts
|
|
52
|
+
// src/internal/runtime/cloudflare-vite.ts
|
|
56
53
|
function createRegistryDefinitionNames(registry, namePrefix) {
|
|
57
54
|
if (!registry) return void 0;
|
|
58
55
|
const definitions = {};
|
|
@@ -109,5 +106,4 @@ function createQueueCloudflareWorker(options = {}) {
|
|
|
109
106
|
}
|
|
110
107
|
};
|
|
111
108
|
}
|
|
112
|
-
//#endregion
|
|
113
109
|
export { createQueueCloudflareWorker };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as QueueRuntimeOptions, t as QueueRuntimeDriverOptions } from "../../types-
|
|
4
|
-
//#region src/internal/runtime/local-client.d.ts
|
|
1
|
+
import { t as LocalQueueEngine } from "../../local-B72WRWkS.js";
|
|
2
|
+
import { b as QueueClient, h as LocalQueueStatus } from "../../types-BzPGPV9z.js";
|
|
3
|
+
import { n as QueueRuntimeOptions, t as QueueRuntimeDriverOptions } from "../../types-BevEYrUV.js";
|
|
5
4
|
export declare function createLocalQueueRuntimeClient(options: QueueRuntimeDriverOptions): Promise<QueueClient>;
|
|
6
5
|
/**
|
|
7
6
|
* Starts delivery of the stored jobs when the server starts, so jobs from before a restart run without a new send.
|
|
@@ -13,5 +12,4 @@ export declare function useLocalQueueEngine(config: QueueRuntimeOptions): LocalQ
|
|
|
13
12
|
/** Status of the stored jobs, for `vitehub queue list` and the Console. */
|
|
14
13
|
export declare function getLocalQueueStatus(config: QueueRuntimeOptions): Promise<LocalQueueStatus | undefined>;
|
|
15
14
|
/** Stops the timers of every local engine. The stored jobs stay. */
|
|
16
|
-
export declare function closeLocalQueues(): void;
|
|
17
|
-
//#endregion
|
|
15
|
+
export declare function closeLocalQueues(): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { t as defaultLocalQueueBase } from "../../config-Bzp1xmdh.js";
|
|
2
|
+
import { i as localQueueDeliveryRules, n as createLocalQueueEngine, t as createLocalQueueClient } from "../../local-RX10a_Sq.js";
|
|
3
|
+
import { c as loadQueueDefinition, l as missingQueueDefinitionError } from "../../state-DqxeV11k.js";
|
|
4
|
+
import { t as queueErrorDiagnostics } from "../../error-diagnostics-Dv6nKZQW.js";
|
|
5
5
|
import { resolve } from "pathe";
|
|
6
|
-
|
|
6
|
+
// src/internal/runtime/local-client.ts
|
|
7
7
|
const engines = /* @__PURE__ */ new Map();
|
|
8
8
|
function getLocalQueueEngine({ base = defaultLocalQueueBase, development, rules = "local" }) {
|
|
9
9
|
const directory = resolve(base);
|
|
@@ -67,5 +67,4 @@ function closeLocalQueues() {
|
|
|
67
67
|
for (const { engine } of engines.values()) engine.close();
|
|
68
68
|
engines.clear();
|
|
69
69
|
}
|
|
70
|
-
//#endregion
|
|
71
70
|
export { closeLocalQueues, createLocalQueueRuntimeClient, getLocalQueueStatus, startLocalQueue, useLocalQueueEngine };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { b as QueueClient } from "../../types-
|
|
2
|
-
import "../../local-
|
|
3
|
-
import { n as QueueRuntimeOptions, t as QueueRuntimeDriverOptions } from "../../types-
|
|
1
|
+
import { b as QueueClient } from "../../types-BzPGPV9z.js";
|
|
2
|
+
import "../../local-B72WRWkS.js";
|
|
3
|
+
import { n as QueueRuntimeOptions, t as QueueRuntimeDriverOptions } from "../../types-BevEYrUV.js";
|
|
4
4
|
import postgres from "postgres";
|
|
5
|
-
//#region src/providers/postgres.d.ts
|
|
6
5
|
/** A postgres.js client. */
|
|
7
6
|
type PostgresQueueSql = postgres.Sql;
|
|
8
7
|
/**
|
|
@@ -14,8 +13,6 @@ type PostgresQueueConnection = {
|
|
|
14
13
|
} | {
|
|
15
14
|
url: string;
|
|
16
15
|
};
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region src/internal/runtime/postgres-client.d.ts
|
|
19
16
|
/** The Databases of the app, as `@vite-hub/database/drizzle` exports them. */
|
|
20
17
|
export type PostgresQueueDatabases = Readonly<Record<string, {
|
|
21
18
|
db: object;
|
|
@@ -44,4 +41,4 @@ export declare function createPostgresQueueRuntimeClient(options: QueueRuntimeDr
|
|
|
44
41
|
export declare function startPostgresQueue(config: false | QueueRuntimeOptions, databases?: PostgresQueueDatabasesLoader): void;
|
|
45
42
|
/** Stops taking jobs, waits for the running jobs up to 10 seconds, and closes the connections it opened. The jobs stay. */
|
|
46
43
|
export declare function closePostgresQueues(): Promise<void>;
|
|
47
|
-
|
|
44
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { c as
|
|
4
|
-
import { r as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { r as postgresQueueUrlVariable } from "../../config-Bzp1xmdh.js";
|
|
2
|
+
import { t as invariant } from "../../invariant-CmdvZ3vp.js";
|
|
3
|
+
import { c as queueRemovedOptionsError, d as normalizeQueueEnqueueInput, l as queueUnsupportedOptionsError, s as queueProviderResult, t as readQueueTimes, u as createQueueMessageId } from "../../duration-C5w_-Rf4.js";
|
|
4
|
+
import { i as reportQueueDeliveryError, n as createQueueDeliveryErrorReport, r as isNonRetryableQueueError, t as checkQueueHandlerResponse } from "../../handler-response-CchTXVjm.js";
|
|
5
|
+
import { i as localQueueDeliveryRules, r as delayMs } from "../../local-RX10a_Sq.js";
|
|
6
|
+
import { c as loadQueueDefinition, l as missingQueueDefinitionError, p as setQueueRuntimeJobStore, s as listQueueDefinitionNames } from "../../state-DqxeV11k.js";
|
|
7
|
+
import { t as queueErrorDiagnostics } from "../../error-diagnostics-Dv6nKZQW.js";
|
|
8
8
|
import { hostname } from "node:os";
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
10
10
|
import { runInRunScopes } from "@vite-hub/runtime/internal/run-scope";
|
|
@@ -436,8 +436,7 @@ function createPostgresQueueClient(engine, queue, resolveEngine) {
|
|
|
436
436
|
}
|
|
437
437
|
};
|
|
438
438
|
}
|
|
439
|
-
|
|
440
|
-
//#region src/internal/runtime/postgres-client.ts
|
|
439
|
+
// src/internal/runtime/postgres-client.ts
|
|
441
440
|
const postgresUrl = /^postgres(?:ql)?:\/\//i;
|
|
442
441
|
/** A Postgres Database answers this key with a function that returns its connection URL. `@vite-hub/database` sets it. */
|
|
443
442
|
const databaseConnectionUrl = Symbol.for("vitehub.database.postgres.connection-url");
|
|
@@ -573,5 +572,4 @@ function closePostgresQueues() {
|
|
|
573
572
|
});
|
|
574
573
|
return closing;
|
|
575
574
|
}
|
|
576
|
-
//#endregion
|
|
577
575
|
export { closePostgresQueues, createPostgresQueueRuntimeClient, resolvePostgresQueueConnection, startPostgresQueue };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { A as QueueJobStore, C as QueueDefinitionRegistry, b as QueueClient, x as QueueDefinition } from "../../types-
|
|
2
|
-
import { n as QueueRuntimeOptions, t as QueueRuntimeDriverOptions } from "../../types-
|
|
3
|
-
//#region src/internal/runtime/state.d.ts
|
|
1
|
+
import { A as QueueJobStore, C as QueueDefinitionRegistry, b as QueueClient, x as QueueDefinition } from "../../types-BzPGPV9z.js";
|
|
2
|
+
import { n as QueueRuntimeOptions, t as QueueRuntimeDriverOptions } from "../../types-BevEYrUV.js";
|
|
4
3
|
export type QueueRuntimeClientFactory = (options: QueueRuntimeDriverOptions) => QueueClient | Promise<QueueClient>;
|
|
5
4
|
export declare function missingQueueDefinitionError(queue: string): Error;
|
|
6
5
|
export declare function setQueueRuntimeConfig(config: false | QueueRuntimeOptions | undefined, createClient?: QueueRuntimeClientFactory): void;
|
|
@@ -20,5 +19,4 @@ export declare function setQueueRuntimeRegistry(registry: QueueDefinitionRegistr
|
|
|
20
19
|
/** The names of the Queue Definitions that this runtime loads, sorted. */
|
|
21
20
|
export declare function listQueueDefinitionNames(): string[];
|
|
22
21
|
export declare function getOrCreateQueueClient(name: string, createClient: () => Promise<QueueClient>): Promise<QueueClient>;
|
|
23
|
-
export declare function loadQueueDefinition(name: string): Promise<QueueDefinition | undefined>;
|
|
24
|
-
//#endregion
|
|
22
|
+
export declare function loadQueueDefinition(name: string): Promise<QueueDefinition | undefined>;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { enterQueueRuntimeEvent, getOrCreateQueueClient, getQueueRuntimeClientFactory, getQueueRuntimeConfig, getQueueRuntimeEvent, getQueueRuntimeJobStore, listQueueDefinitionNames, loadQueueDefinition, missingQueueDefinitionError, runWithQueueRuntimeEvent, setQueueRuntimeConfig, setQueueRuntimeEventDefaults, setQueueRuntimeJobStore, setQueueRuntimeRegistry };
|
|
1
|
+
export { t as enterQueueRuntimeEvent, n as getOrCreateQueueClient, r as getQueueRuntimeClientFactory, i as getQueueRuntimeConfig, a as getQueueRuntimeEvent, o as getQueueRuntimeJobStore, s as listQueueDefinitionNames, c as loadQueueDefinition, l as missingQueueDefinitionError, u as runWithQueueRuntimeEvent, d as setQueueRuntimeConfig, f as setQueueRuntimeEventDefaults, p as setQueueRuntimeJobStore, m as setQueueRuntimeRegistry } from "../../state-DqxeV11k.js";
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import { T as QueueDriverOptions, b as QueueClient } from "../../types-
|
|
2
|
-
|
|
3
|
-
export declare function createVercelQueueRuntimeClient(options: QueueDriverOptions): Promise<QueueClient>;
|
|
4
|
-
//#endregion
|
|
1
|
+
import { T as QueueDriverOptions, b as QueueClient } from "../../types-BzPGPV9z.js";
|
|
2
|
+
export declare function createVercelQueueRuntimeClient(options: QueueDriverOptions): Promise<QueueClient>;
|