@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,7 +1,7 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
import { t as resolveVercelQueueRegion } from "../../vercel-region-
|
|
4
|
-
|
|
1
|
+
import { c as queueRemovedOptionsError, d as normalizeQueueEnqueueInput, l as queueUnsupportedOptionsError, s as queueProviderResult, t as readQueueTimes, u as createQueueMessageId } from "../../duration-C5w_-Rf4.js";
|
|
2
|
+
import { t as queueErrorDiagnostics } from "../../error-diagnostics-Dv6nKZQW.js";
|
|
3
|
+
import { t as resolveVercelQueueRegion } from "../../vercel-region-DEsR1YJQ.js";
|
|
4
|
+
// src/providers/vercel.ts
|
|
5
5
|
function invalidVercelSendResponse(cause) {
|
|
6
6
|
return [queueErrorDiagnostics.QUEUE_PROVIDER_INVALID_RESPONSE({ cause }), void 0];
|
|
7
7
|
}
|
|
@@ -169,8 +169,7 @@ async function createVercelQueueClient(provider) {
|
|
|
169
169
|
callback: client.handleCallback.bind(client)
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
|
-
|
|
173
|
-
//#region src/internal/runtime/vercel-client.ts
|
|
172
|
+
// src/internal/runtime/vercel-client.ts
|
|
174
173
|
async function createVercelQueueRuntimeClient(options) {
|
|
175
174
|
if (options.driver !== "vercel") throw queueErrorDiagnostics.QUEUE_DRIVER_MISMATCH({
|
|
176
175
|
driver: options.driver,
|
|
@@ -178,5 +177,4 @@ async function createVercelQueueRuntimeClient(options) {
|
|
|
178
177
|
});
|
|
179
178
|
return await createVercelQueueClient(options);
|
|
180
179
|
}
|
|
181
|
-
//#endregion
|
|
182
180
|
export { createVercelQueueRuntimeClient };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { b as QueueClient } from "../../types-
|
|
2
|
-
import { t as QueueRuntimeDriverOptions } from "../../types-
|
|
3
|
-
//#region src/internal/runtime/worker-client.d.ts
|
|
1
|
+
import { b as QueueClient } from "../../types-BzPGPV9z.js";
|
|
2
|
+
import { t as QueueRuntimeDriverOptions } from "../../types-BevEYrUV.js";
|
|
4
3
|
/** Worker package conditions keep the Node driver and its optional peer outside the build graph. */
|
|
5
|
-
export declare function createPostgresQueueRuntimeClient(options: QueueRuntimeDriverOptions): Promise<QueueClient>;
|
|
6
|
-
//#endregion
|
|
4
|
+
export declare function createPostgresQueueRuntimeClient(options: QueueRuntimeDriverOptions): Promise<QueueClient>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as queueErrorDiagnostics } from "../../error-diagnostics-
|
|
2
|
-
|
|
1
|
+
import { t as queueErrorDiagnostics } from "../../error-diagnostics-Dv6nKZQW.js";
|
|
2
|
+
// src/internal/runtime/worker-client.ts
|
|
3
3
|
/** Worker package conditions keep the Node driver and its optional peer outside the build graph. */
|
|
4
4
|
async function createPostgresQueueRuntimeClient(options) {
|
|
5
5
|
throw queueErrorDiagnostics.QUEUE_DRIVER_MISMATCH({
|
|
@@ -7,5 +7,4 @@ async function createPostgresQueueRuntimeClient(options) {
|
|
|
7
7
|
expected: "cloudflare"
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
//#endregion
|
|
11
10
|
export { createPostgresQueueRuntimeClient };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineDiagnostics } from "nostics";
|
|
2
|
-
|
|
2
|
+
// ../internal/src/invariant.ts
|
|
3
3
|
const invariantDiagnostics = /*#__PURE__*/ defineDiagnostics({
|
|
4
4
|
docsBase: "https://vitehub.dev/docs/development/diagnostics",
|
|
5
5
|
codes: { INTERNAL_INVARIANT_FAILED: {
|
|
@@ -18,5 +18,4 @@ function invariantError(what) {
|
|
|
18
18
|
function invariant(condition, what) {
|
|
19
19
|
if (!condition) throw invariantError(what);
|
|
20
20
|
}
|
|
21
|
-
//#endregion
|
|
22
21
|
export { invariant as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { A as QueueJobStore } from "./types-
|
|
2
|
-
//#region src/providers/local.d.ts
|
|
1
|
+
import { A as QueueJobStore } from "./types-BzPGPV9z.js";
|
|
3
2
|
/** One job for the engine. `vite dev` and the clients read `delay` and `retention` into seconds first. */
|
|
4
3
|
interface LocalQueueEntry {
|
|
5
4
|
delaySeconds?: number;
|
|
@@ -19,5 +18,4 @@ interface LocalQueueEngine extends QueueJobStore {
|
|
|
19
18
|
/** Reads the stored jobs and starts their delivery. Later calls return the same promise. */
|
|
20
19
|
start: () => Promise<void>;
|
|
21
20
|
}
|
|
22
|
-
//#endregion
|
|
23
21
|
export { LocalQueueEngine as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { c as queueRemovedOptionsError, d as normalizeQueueEnqueueInput, i as localUnsupportedEnqueueOptions, l as queueUnsupportedOptionsError, n as cloudflareUnsupportedEnqueueOptions, o as postgresUnsupportedEnqueueOptions, s as queueProviderResult, t as readQueueTimes, u as createQueueMessageId } from "./duration-C5w_-Rf4.js";
|
|
2
|
+
import { i as reportQueueDeliveryError, n as createQueueDeliveryErrorReport, r as isNonRetryableQueueError, t as checkQueueHandlerResponse } from "./handler-response-CchTXVjm.js";
|
|
3
|
+
import { t as queueErrorDiagnostics } from "./error-diagnostics-Dv6nKZQW.js";
|
|
4
4
|
import { mkdir, readFile, readdir, rename, rm, writeFile } from "node:fs/promises";
|
|
5
5
|
import { join, resolve } from "pathe";
|
|
6
6
|
import { randomUUID } from "node:crypto";
|
|
@@ -555,5 +555,4 @@ function createLocalQueueClient(engine, queue) {
|
|
|
555
555
|
}
|
|
556
556
|
};
|
|
557
557
|
}
|
|
558
|
-
//#endregion
|
|
559
558
|
export { localQueueDeliveryRules as i, createLocalQueueEngine as n, delayMs as r, createLocalQueueClient as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../internal/src/object.ts
|
|
2
2
|
/** A non-null object that is not an array. Functions do not pass. */
|
|
3
3
|
function isRecord(value) {
|
|
4
4
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -11,5 +11,4 @@ function isRecordOrFunction(value) {
|
|
|
11
11
|
function cloneRecord(value) {
|
|
12
12
|
return value && typeof value === "object" && !Array.isArray(value) ? { ...value } : {};
|
|
13
13
|
}
|
|
14
|
-
//#endregion
|
|
15
14
|
export { isRecord as n, isRecordOrFunction as r, cloneRecord as t };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts
|
|
2
1
|
/** The Standard Typed interface. This is a base type extended by other specs. */
|
|
3
2
|
interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
4
3
|
/** The Standard properties. */
|
|
@@ -74,8 +73,6 @@ declare namespace StandardSchemaV1 {
|
|
|
74
73
|
/** Infers the output type of a Standard. */
|
|
75
74
|
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
76
75
|
}
|
|
77
|
-
//#endregion
|
|
78
|
-
//#region ../internal/src/operation-definition.d.ts
|
|
79
76
|
/** `read` never changes state. `write` changes state. `destructive` deletes or publishes. */
|
|
80
77
|
type OperationKind = "read" | "write" | "destructive";
|
|
81
78
|
/** The signed-in user of a call. */
|
|
@@ -241,5 +238,4 @@ interface OperationContributionEntry {
|
|
|
241
238
|
/** `false`: the app already has these operations at runtime. Only tools such as the CLI and `vitehub inspect` read the entry. */
|
|
242
239
|
runtime?: false;
|
|
243
240
|
}
|
|
244
|
-
//#endregion
|
|
245
241
|
export { OperationContributionEntry as n, AnyOperation as t };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { t as redactInspectionText } from "./inspect-CwdWUhPj.js";
|
|
2
|
+
import { t as queueErrorDiagnostics } from "./error-diagnostics-Dv6nKZQW.js";
|
|
3
|
+
import { a as normalizePublicQueueIdentifier, r as isQueueError } from "./duration-C5w_-Rf4.js";
|
|
4
|
+
import { i as getQueueRuntimeConfig, o as getQueueRuntimeJobStore, s as listQueueDefinitionNames } from "./state-DqxeV11k.js";
|
|
5
|
+
import { n as dynamicQueue } from "./client-CwoCdKct.js";
|
|
6
6
|
import { runtimeErrorDiagnostics } from "@vite-hub/runtime/internal/error-diagnostics";
|
|
7
|
-
|
|
7
|
+
// src/runtime/operations.ts
|
|
8
8
|
const statuses = {
|
|
9
9
|
QUEUE_DEFINITION_NAME_INVALID: 400,
|
|
10
10
|
QUEUE_DEFINITION_NOT_FOUND: 404,
|
|
@@ -119,5 +119,4 @@ async function retryQueueJob(id) {
|
|
|
119
119
|
async function clearQueueJobs(input) {
|
|
120
120
|
return { cleared: await (await localJobs()).clear(input) };
|
|
121
121
|
}
|
|
122
|
-
//#endregion
|
|
123
122
|
export { clearQueueJobs, listQueueJobs, listQueues, retryQueueJob, sendToQueue, showQueueJob };
|
package/dist/operations.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./local-
|
|
3
|
-
import {
|
|
4
|
-
//#region src/runtime/operations.d.ts
|
|
1
|
+
import { t as AnyOperation } from "./operation-definition-CqZkx1Rm.js";
|
|
2
|
+
import "./local-B72WRWkS.js";
|
|
3
|
+
import { A as QueueJobStore, d as LocalQueueJob, f as LocalQueueJobDetail, h as LocalQueueStatus, p as LocalQueueRules, w as QueueDriver } from "./types-BzPGPV9z.js";
|
|
5
4
|
interface QueueListResult {
|
|
6
5
|
/** `undefined` when the runtime has not installed a Queue configuration. */
|
|
7
6
|
provider?: QueueDriver;
|
|
@@ -58,13 +57,10 @@ interface QueueSendOperationInput {
|
|
|
58
57
|
payload: unknown;
|
|
59
58
|
queue: string;
|
|
60
59
|
}
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region src/operations.d.ts
|
|
63
60
|
/**
|
|
64
61
|
* The `queue.*` operations: list and send, and the stored jobs of the local and postgres providers. `vite dev` runs
|
|
65
62
|
* every job with the local provider. Cloudflare and Vercel do not let a producer read their queue, so the job
|
|
66
63
|
* operations fail there.
|
|
67
64
|
*/
|
|
68
65
|
export declare const queueOperations: readonly AnyOperation[];
|
|
69
|
-
//#endregion
|
|
70
66
|
export type { LocalQueueJob, LocalQueueJobDetail, QueueJobsClearInput, QueueJobsListInput, QueueJobsListResult, QueueListResult, QueueSendOperationInput, QueueSendOperationResult };
|