@lunora/queue 1.0.0-alpha.7 → 1.0.0-alpha.8

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
@@ -2,5 +2,5 @@ export { createQueueCaptureSink, shouldCaptureQueue } from './packem_shared/crea
2
2
  export { createQueueContext } from './packem_shared/createQueueContext-D0XCdCsd.mjs';
3
3
  export { default as createQueues } from './packem_shared/createQueues-14-vSICK.mjs';
4
4
  export { defineQueue, isQueueDefinition, queueBindingName, queueDefaultName } from './packem_shared/defineQueue-D40gREfg.mjs';
5
- export { dispatchQueueBatch } from './packem_shared/dispatchQueueBatch-DbA5vKBs.mjs';
6
- export { createQueueRunContext } from './packem_shared/createQueueRunContext-wScWyFao.mjs';
5
+ export { dispatchQueueBatch } from './packem_shared/dispatchQueueBatch-DSEWhEy8.mjs';
6
+ export { createQueueRunContext } from './packem_shared/createQueueRunContext-C8jboCk6.mjs';
@@ -54,9 +54,16 @@ const createDispatchRunner = (options) => {
54
54
  throw new LunoraError("INTERNAL", `${label}: \`LUNORA_ADMIN_TOKEN\` must be set on the Worker env to authenticate function dispatch`);
55
55
  }
56
56
  const url = `${trimTrailingSlashes(origin)}${SCHEDULER_DISPATCH_PATH}`;
57
+ const headers = { authorization: `Bearer ${token}`, "content-type": "application/json" };
58
+ if (options.identity?.userId !== void 0) {
59
+ headers["x-lunora-userid"] = options.identity.userId;
60
+ }
61
+ if (options.identity?.claims !== void 0) {
62
+ headers["x-lunora-identity"] = JSON.stringify(options.identity.claims);
63
+ }
57
64
  const response = await fetchImpl(url, {
58
65
  body: JSON.stringify({ args: args ?? {}, functionPath: function_.__lunoraRef, shardKey: runOptions.shardKey }),
59
- headers: { authorization: `Bearer ${token}`, "content-type": "application/json" },
66
+ headers,
60
67
  method: "POST"
61
68
  });
62
69
  if (!response.ok) {
@@ -1,5 +1,5 @@
1
1
  import { LunoraError } from '@lunora/errors';
2
- import { createQueueRunContext } from './createQueueRunContext-wScWyFao.mjs';
2
+ import { createQueueRunContext } from './createQueueRunContext-C8jboCk6.mjs';
3
3
 
4
4
  const DEFAULT_MAX_RETRIES = 3;
5
5
  const timestampToMs = (value) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/queue",
3
- "version": "1.0.0-alpha.7",
3
+ "version": "1.0.0-alpha.8",
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",
@@ -44,7 +44,7 @@
44
44
  "access": "public"
45
45
  },
46
46
  "dependencies": {
47
- "@lunora/errors": "1.0.0-alpha.4"
47
+ "@lunora/errors": "1.0.0-alpha.5"
48
48
  },
49
49
  "engines": {
50
50
  "node": "^22.15.0 || >=24.11.0"