@lunora/queue 1.0.0-alpha.1 → 1.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createQueueContext } from './packem_shared/createQueueContext-D0XCdCsd.mjs';
|
|
2
2
|
export { default as createQueues } from './packem_shared/createQueues-14-vSICK.mjs';
|
|
3
3
|
export { defineQueue, isQueueDefinition, queueBindingName, queueDefaultName } from './packem_shared/defineQueue-D40gREfg.mjs';
|
|
4
|
-
export { dispatchQueueBatch } from './packem_shared/dispatchQueueBatch-
|
|
5
|
-
export { createQueueRunContext } from './packem_shared/createQueueRunContext-
|
|
4
|
+
export { dispatchQueueBatch } from './packem_shared/dispatchQueueBatch-DR15pYS7.mjs';
|
|
5
|
+
export { createQueueRunContext } from './packem_shared/createQueueRunContext-_2hD-TK7.mjs';
|
package/dist/packem_shared/{createQueueRunContext-DVqG7Oyk.mjs → createQueueRunContext-_2hD-TK7.mjs}
RENAMED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { LunoraError } from '@lunora/errors';
|
|
2
|
+
|
|
1
3
|
const createDispatchLogger = (prefix) => {
|
|
2
4
|
return {
|
|
3
5
|
debug: (message, ...rest) => {
|
|
@@ -33,11 +35,11 @@ const createDispatchRunner = (options) => {
|
|
|
33
35
|
}
|
|
34
36
|
const origin = options.env.LUNORA_ORIGIN_URL;
|
|
35
37
|
if (typeof origin !== "string" || origin.length === 0) {
|
|
36
|
-
throw new
|
|
38
|
+
throw new LunoraError("INTERNAL", `${label}: \`LUNORA_ORIGIN_URL\` must be set on the Worker env so a handler can call back into Lunora functions`);
|
|
37
39
|
}
|
|
38
40
|
const token = options.env.LUNORA_ADMIN_TOKEN;
|
|
39
41
|
if (typeof token !== "string" || token.length === 0) {
|
|
40
|
-
throw new
|
|
42
|
+
throw new LunoraError("INTERNAL", `${label}: \`LUNORA_ADMIN_TOKEN\` must be set on the Worker env to authenticate function dispatch`);
|
|
41
43
|
}
|
|
42
44
|
const url = `${trimTrailingSlashes(origin)}${SCHEDULER_DISPATCH_PATH}`;
|
|
43
45
|
const response = await fetchImpl(url, {
|
|
@@ -46,7 +48,7 @@ const createDispatchRunner = (options) => {
|
|
|
46
48
|
method: "POST"
|
|
47
49
|
});
|
|
48
50
|
if (!response.ok) {
|
|
49
|
-
throw new
|
|
51
|
+
throw new LunoraError("INTERNAL", `${label}: function dispatch failed (${String(response.status)}): ${await response.text()}`);
|
|
50
52
|
}
|
|
51
53
|
const text = await response.text();
|
|
52
54
|
if (text.length === 0) {
|
package/dist/packem_shared/{dispatchQueueBatch-DVMmBISH.mjs → dispatchQueueBatch-DR15pYS7.mjs}
RENAMED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LunoraError } from '@lunora/errors';
|
|
2
|
+
import { createQueueRunContext } from './createQueueRunContext-_2hD-TK7.mjs';
|
|
2
3
|
|
|
3
4
|
const dispatchQueueBatch = async (batch, registry, options) => {
|
|
4
5
|
const entry = registry[batch.queue];
|
|
5
6
|
if (entry === void 0) {
|
|
6
7
|
const known = Object.keys(registry);
|
|
7
8
|
const suffix = known.length === 0 ? "no push queues are declared" : `known push queues: ${known.join(", ")}`;
|
|
8
|
-
throw new
|
|
9
|
+
throw new LunoraError("INTERNAL", `@lunora/queue: received a batch for queue "${batch.queue}" but no push handler is registered (${suffix})`);
|
|
9
10
|
}
|
|
10
11
|
const { handler } = entry.definition;
|
|
11
12
|
if (typeof handler !== "function") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/queue",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.3",
|
|
4
4
|
"description": "Cloudflare Queues for Lunora: defineQueue producers + consumers, the ctx.queues surface, and the generated queue() worker handler",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"background-jobs",
|
|
@@ -43,6 +43,9 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@lunora/errors": "1.0.0-alpha.1"
|
|
48
|
+
},
|
|
46
49
|
"engines": {
|
|
47
50
|
"node": "^22.15.0 || >=24.11.0"
|
|
48
51
|
}
|