@owlmeans/queue 0.1.18-rc.4 → 0.1.18-rc.41

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.
Files changed (110) hide show
  1. package/README.md +286 -8
  2. package/agent-meta/manifest.json +9 -2
  3. package/agent-meta/skills/queue/SKILL.md +243 -12
  4. package/agent-meta/skills/scheduled-jobs/SKILL.md +151 -0
  5. package/build/bridge/types.d.ts +25 -0
  6. package/build/bridge/types.d.ts.map +1 -0
  7. package/build/bridge/types.js +2 -0
  8. package/build/bridge/types.js.map +1 -0
  9. package/build/bridge.d.ts +7 -0
  10. package/build/bridge.d.ts.map +1 -0
  11. package/build/bridge.js +37 -0
  12. package/build/bridge.js.map +1 -0
  13. package/build/config.d.ts +34 -0
  14. package/build/config.d.ts.map +1 -0
  15. package/build/config.js +59 -0
  16. package/build/config.js.map +1 -0
  17. package/build/consts.d.ts +33 -0
  18. package/build/consts.d.ts.map +1 -0
  19. package/build/consts.js +35 -0
  20. package/build/consts.js.map +1 -0
  21. package/build/entrypoint-jobs/types.d.ts +29 -0
  22. package/build/entrypoint-jobs/types.d.ts.map +1 -0
  23. package/build/entrypoint-jobs/types.js +2 -0
  24. package/build/entrypoint-jobs/types.js.map +1 -0
  25. package/build/entrypoint-jobs.d.ts +5 -0
  26. package/build/entrypoint-jobs.d.ts.map +1 -0
  27. package/build/entrypoint-jobs.js +84 -0
  28. package/build/entrypoint-jobs.js.map +1 -0
  29. package/build/errors.d.ts +68 -0
  30. package/build/errors.d.ts.map +1 -0
  31. package/build/errors.js +103 -0
  32. package/build/errors.js.map +1 -0
  33. package/build/index.d.ts +18 -0
  34. package/build/index.d.ts.map +1 -1
  35. package/build/index.js +13 -1
  36. package/build/index.js.map +1 -1
  37. package/build/protocol/types.d.ts +12 -0
  38. package/build/protocol/types.d.ts.map +1 -0
  39. package/build/protocol/types.js +2 -0
  40. package/build/protocol/types.js.map +1 -0
  41. package/build/protocol.d.ts +13 -0
  42. package/build/protocol.d.ts.map +1 -0
  43. package/build/protocol.js +63 -0
  44. package/build/protocol.js.map +1 -0
  45. package/build/queue-config/types.d.ts +29 -0
  46. package/build/queue-config/types.d.ts.map +1 -0
  47. package/build/queue-config/types.js +2 -0
  48. package/build/queue-config/types.js.map +1 -0
  49. package/build/queue-config.d.ts +9 -0
  50. package/build/queue-config.d.ts.map +1 -0
  51. package/build/queue-config.js +83 -0
  52. package/build/queue-config.js.map +1 -0
  53. package/build/queue-route/types.d.ts +14 -0
  54. package/build/queue-route/types.d.ts.map +1 -0
  55. package/build/queue-route/types.js +2 -0
  56. package/build/queue-route/types.js.map +1 -0
  57. package/build/queue-route.d.ts +4 -0
  58. package/build/queue-route.d.ts.map +1 -0
  59. package/build/queue-route.js +24 -0
  60. package/build/queue-route.js.map +1 -0
  61. package/build/route.d.ts +9 -0
  62. package/build/route.d.ts.map +1 -0
  63. package/build/route.js +16 -0
  64. package/build/route.js.map +1 -0
  65. package/build/transport.d.ts +15 -0
  66. package/build/transport.d.ts.map +1 -0
  67. package/build/transport.js +59 -0
  68. package/build/transport.js.map +1 -0
  69. package/build/types.d.ts +312 -0
  70. package/build/types.d.ts.map +1 -0
  71. package/build/types.js +2 -0
  72. package/build/types.js.map +1 -0
  73. package/build/types.local.d.ts +4 -0
  74. package/build/types.local.d.ts.map +1 -0
  75. package/build/types.local.js +2 -0
  76. package/build/types.local.js.map +1 -0
  77. package/build/utils.d.ts +4 -0
  78. package/build/utils.d.ts.map +1 -0
  79. package/build/utils.js +4 -0
  80. package/build/utils.js.map +1 -0
  81. package/build/worker.d.ts +10 -0
  82. package/build/worker.d.ts.map +1 -0
  83. package/build/worker.js +24 -0
  84. package/build/worker.js.map +1 -0
  85. package/package.json +13 -3
  86. package/src/bridge/types.ts +25 -0
  87. package/src/bridge.ts +46 -0
  88. package/src/config.ts +80 -0
  89. package/src/consts.ts +38 -0
  90. package/src/entrypoint-jobs/types.ts +29 -0
  91. package/src/entrypoint-jobs.ts +105 -0
  92. package/src/errors.ts +121 -0
  93. package/src/index.ts +18 -0
  94. package/src/protocol/types.ts +16 -0
  95. package/src/protocol.ts +95 -0
  96. package/src/queue-config/types.ts +29 -0
  97. package/src/queue-config.ts +102 -0
  98. package/src/queue-route/types.ts +14 -0
  99. package/src/queue-route.ts +33 -0
  100. package/src/route.ts +23 -0
  101. package/src/transport.ts +77 -0
  102. package/src/types.ts +326 -0
  103. package/src/utils.ts +5 -0
  104. package/src/worker.ts +27 -0
  105. package/tests/bridge.spec.ts +64 -0
  106. package/tests/config.spec.ts +67 -0
  107. package/tests/protocol.spec.ts +58 -0
  108. package/tests/schedule.spec.ts +99 -0
  109. package/tsconfig.json +1 -0
  110. package/build/.gitkeep +0 -0
@@ -0,0 +1,68 @@
1
+ import { ResilientError } from '@owlmeans/error';
2
+ export declare class QueueError extends ResilientError {
3
+ static typeName: string;
4
+ constructor(message?: string);
5
+ }
6
+ /**
7
+ * The caller stopped waiting. The job is untouched — it may still be queued, running, or already
8
+ * finished; only the wait ended. Read the job back to learn which.
9
+ */
10
+ export declare class QueueTimeout extends QueueError {
11
+ static typeName: string;
12
+ constructor(msg: string);
13
+ }
14
+ /** No job with that id in this queue — it never existed, or it was removed after completing. */
15
+ export declare class UnknownJob extends QueueError {
16
+ static typeName: string;
17
+ constructor(msg: string);
18
+ }
19
+ /**
20
+ * A job name the queue does not declare. Declaring every job a queue accepts is what keeps an
21
+ * enqueue from succeeding into a queue where nothing can ever process it.
22
+ */
23
+ export declare class UnknownJobName extends QueueError {
24
+ static typeName: string;
25
+ constructor(msg: string);
26
+ }
27
+ /** A queue asked for that no declaration names. */
28
+ export declare class UnknownQueue extends QueueError {
29
+ static typeName: string;
30
+ constructor(msg: string);
31
+ }
32
+ /**
33
+ * This process was asked to consume a queue it does not listen to. Which queues a process
34
+ * consumes is configuration (`cfg.queue.listen`), so this is a deployment question, not a code
35
+ * one — the same binary is a producer or a worker depending on it.
36
+ */
37
+ export declare class QueueNotListening extends QueueError {
38
+ static typeName: string;
39
+ constructor(msg: string);
40
+ }
41
+ /**
42
+ * The job named an entrypoint this process does not serve. Unlike a missing queue this is not a
43
+ * declaration problem: the alias exists, but nothing here bound it, so the job was taken by a
44
+ * worker that cannot run it.
45
+ */
46
+ export declare class JobNotServed extends QueueError {
47
+ static typeName: string;
48
+ constructor(msg: string);
49
+ }
50
+ /**
51
+ * The signed envelope is older than the configured lifetime. Freshness is judged from when the
52
+ * producer enqueued the job, not from when a worker picked it up, so a long backlog does not
53
+ * invalidate work that was legitimate when it was submitted.
54
+ */
55
+ export declare class EnvelopeExpired extends QueueError {
56
+ static typeName: string;
57
+ constructor(msg: string);
58
+ }
59
+ /**
60
+ * A schedule the broker could not carry out as written: no id, both or neither of `every` and
61
+ * `pattern`, an option that only means something for the other one, or a job option the broker
62
+ * owns for a scheduled run. The message names the schedule id and the reason.
63
+ */
64
+ export declare class ScheduleMisdeclared extends QueueError {
65
+ static typeName: string;
66
+ constructor(msg: string);
67
+ }
68
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,qBAAa,UAAW,SAAQ,cAAc;IAC5C,OAAuB,QAAQ,SAAe;IAE9C,YAAY,OAAO,GAAE,MAAgB,EAEpC;CACF;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,UAAU;IAC1C,OAAuB,QAAQ,SAAkC;IAEjE,YAAY,GAAG,EAAE,MAAM,EAGtB;CACF;AAED,gGAAgG;AAChG,qBAAa,UAAW,SAAQ,UAAU;IACxC,OAAuB,QAAQ,SAAqC;IAEpE,YAAY,GAAG,EAAE,MAAM,EAGtB;CACF;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,UAAU;IAC5C,OAAuB,QAAQ,SAAyC;IAExE,YAAY,GAAG,EAAE,MAAM,EAGtB;CACF;AAED,mDAAmD;AACnD,qBAAa,YAAa,SAAQ,UAAU;IAC1C,OAAuB,QAAQ,SAAuC;IAEtE,YAAY,GAAG,EAAE,MAAM,EAGtB;CACF;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,UAAU;IAC/C,OAAuB,QAAQ,SAAuC;IAEtE,YAAY,GAAG,EAAE,MAAM,EAGtB;CACF;AAED;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,UAAU;IAC1C,OAAuB,QAAQ,SAAuC;IAEtE,YAAY,GAAG,EAAE,MAAM,EAGtB;CACF;AAED;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,UAAU;IAC7C,OAAuB,QAAQ,SAA0C;IAEzE,YAAY,GAAG,EAAE,MAAM,EAGtB;CACF;AAED;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,UAAU;IACjD,OAAuB,QAAQ,SAA8C;IAE7E,YAAY,GAAG,EAAE,MAAM,EAGtB;CACF"}
@@ -0,0 +1,103 @@
1
+ import { ResilientError } from '@owlmeans/error';
2
+ export class QueueError extends ResilientError {
3
+ static typeName = 'QueueError';
4
+ constructor(message = 'error') {
5
+ super(QueueError.typeName, `queue:${message}`);
6
+ }
7
+ }
8
+ /**
9
+ * The caller stopped waiting. The job is untouched — it may still be queued, running, or already
10
+ * finished; only the wait ended. Read the job back to learn which.
11
+ */
12
+ export class QueueTimeout extends QueueError {
13
+ static typeName = `${QueueError.typeName}Timeout`;
14
+ constructor(msg) {
15
+ super(`timeout:${msg}`);
16
+ this.type = QueueTimeout.typeName;
17
+ }
18
+ }
19
+ /** No job with that id in this queue — it never existed, or it was removed after completing. */
20
+ export class UnknownJob extends QueueError {
21
+ static typeName = `${QueueError.typeName}UnknownJob`;
22
+ constructor(msg) {
23
+ super(`unknown-job:${msg}`);
24
+ this.type = UnknownJob.typeName;
25
+ }
26
+ }
27
+ /**
28
+ * A job name the queue does not declare. Declaring every job a queue accepts is what keeps an
29
+ * enqueue from succeeding into a queue where nothing can ever process it.
30
+ */
31
+ export class UnknownJobName extends QueueError {
32
+ static typeName = `${QueueError.typeName}UnknownJobName`;
33
+ constructor(msg) {
34
+ super(`unknown-job-name:${msg}`);
35
+ this.type = UnknownJobName.typeName;
36
+ }
37
+ }
38
+ /** A queue asked for that no declaration names. */
39
+ export class UnknownQueue extends QueueError {
40
+ static typeName = `${QueueError.typeName}UnknownQueue`;
41
+ constructor(msg) {
42
+ super(`unknown-queue:${msg}`);
43
+ this.type = UnknownQueue.typeName;
44
+ }
45
+ }
46
+ /**
47
+ * This process was asked to consume a queue it does not listen to. Which queues a process
48
+ * consumes is configuration (`cfg.queue.listen`), so this is a deployment question, not a code
49
+ * one — the same binary is a producer or a worker depending on it.
50
+ */
51
+ export class QueueNotListening extends QueueError {
52
+ static typeName = `${QueueError.typeName}NotListening`;
53
+ constructor(msg) {
54
+ super(`not-listening:${msg}`);
55
+ this.type = QueueNotListening.typeName;
56
+ }
57
+ }
58
+ /**
59
+ * The job named an entrypoint this process does not serve. Unlike a missing queue this is not a
60
+ * declaration problem: the alias exists, but nothing here bound it, so the job was taken by a
61
+ * worker that cannot run it.
62
+ */
63
+ export class JobNotServed extends QueueError {
64
+ static typeName = `${QueueError.typeName}JobNotServed`;
65
+ constructor(msg) {
66
+ super(`job-not-served:${msg}`);
67
+ this.type = JobNotServed.typeName;
68
+ }
69
+ }
70
+ /**
71
+ * The signed envelope is older than the configured lifetime. Freshness is judged from when the
72
+ * producer enqueued the job, not from when a worker picked it up, so a long backlog does not
73
+ * invalidate work that was legitimate when it was submitted.
74
+ */
75
+ export class EnvelopeExpired extends QueueError {
76
+ static typeName = `${QueueError.typeName}EnvelopeExpired`;
77
+ constructor(msg) {
78
+ super(`envelope-expired:${msg}`);
79
+ this.type = EnvelopeExpired.typeName;
80
+ }
81
+ }
82
+ /**
83
+ * A schedule the broker could not carry out as written: no id, both or neither of `every` and
84
+ * `pattern`, an option that only means something for the other one, or a job option the broker
85
+ * owns for a scheduled run. The message names the schedule id and the reason.
86
+ */
87
+ export class ScheduleMisdeclared extends QueueError {
88
+ static typeName = `${QueueError.typeName}ScheduleMisdeclared`;
89
+ constructor(msg) {
90
+ super(`schedule-misdeclared:${msg}`);
91
+ this.type = ScheduleMisdeclared.typeName;
92
+ }
93
+ }
94
+ ResilientError.registerErrorClass(QueueError);
95
+ ResilientError.registerErrorClass(QueueTimeout);
96
+ ResilientError.registerErrorClass(UnknownJob);
97
+ ResilientError.registerErrorClass(UnknownJobName);
98
+ ResilientError.registerErrorClass(UnknownQueue);
99
+ ResilientError.registerErrorClass(QueueNotListening);
100
+ ResilientError.registerErrorClass(JobNotServed);
101
+ ResilientError.registerErrorClass(EnvelopeExpired);
102
+ ResilientError.registerErrorClass(ScheduleMisdeclared);
103
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,MAAM,OAAO,UAAW,SAAQ,cAAc;IACrC,MAAM,CAAU,QAAQ,GAAG,YAAY,CAAA;IAE9C,YAAY,OAAO,GAAW,OAAO;QACnC,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC,CAAA;IAChD,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,UAAU;IACnC,MAAM,CAAU,QAAQ,GAAG,GAAG,UAAU,CAAC,QAAQ,SAAS,CAAA;IAEjE,YAAY,GAAW;QACrB,KAAK,CAAC,WAAW,GAAG,EAAE,CAAC,CAAA;QACvB,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAA;IACnC,CAAC;CACF;AAED,gGAAgG;AAChG,MAAM,OAAO,UAAW,SAAQ,UAAU;IACjC,MAAM,CAAU,QAAQ,GAAG,GAAG,UAAU,CAAC,QAAQ,YAAY,CAAA;IAEpE,YAAY,GAAW;QACrB,KAAK,CAAC,eAA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AG,GAAG,UAAU,CAAC,QAAQ,iBAAiB,CAAA;IAEzE,YAAY,GAAW;QACrB,KAAK,CAAC,oBAAoB,GAAG,EAAE,CAAC,CAAA;QAChC,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,QAAQ,CAAA;IACtC,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,mBAAoB,SAAQ,UAAU;IAC1C,MAAM,CAAU,QAAQ,GAAG,GAAG,UAAU,CAAC,QAAQ,qBAAqB,CAAA;IAE7E,YAAY,GAAW;QACrB,KAAK,CAAC,wBAAwB,GAAG,EAAE,CAAC,CAAA;QACpC,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC,QAAQ,CAAA;IAC1C,CAAC;CACF;AAED,cAAc,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAA;AAC7C,cAAc,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAA;AAC/C,cAAc,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAA;AAC7C,cAAc,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAA;AACjD,cAAc,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAA;AAC/C,cAAc,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAA;AACpD,cAAc,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAA;AAC/C,cAAc,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAA;AAClD,cAAc,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA"}
package/build/index.d.ts CHANGED
@@ -1 +1,19 @@
1
+ export * from './types.js';
2
+ export type * from './queue-config/types.js';
3
+ export type * from './bridge/types.js';
4
+ export type * from './queue-route/types.js';
5
+ export type * from './protocol/types.js';
6
+ export type * from './entrypoint-jobs/types.js';
7
+ export * from './consts.js';
8
+ export * from './utils.js';
9
+ export * from './errors.js';
10
+ export * from './config.js';
11
+ export * from './queue-config.js';
12
+ export * from './transport.js';
13
+ export * from './bridge.js';
14
+ export * from './entrypoint-jobs.js';
15
+ export * from './worker.js';
16
+ export * from './protocol.js';
17
+ export * from './route.js';
18
+ export * from './queue-route.js';
1
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,mBAAmB,yBAAyB,CAAA;AAC5C,mBAAmB,mBAAmB,CAAA;AACtC,mBAAmB,wBAAwB,CAAA;AAC3C,mBAAmB,qBAAqB,CAAA;AACxC,mBAAmB,4BAA4B,CAAA;AAC/C,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA"}
package/build/index.js CHANGED
@@ -1,2 +1,14 @@
1
- "use strict";
1
+ export * from './types.js';
2
+ export * from './consts.js';
3
+ export * from './utils.js';
4
+ export * from './errors.js';
5
+ export * from './config.js';
6
+ export * from './queue-config.js';
7
+ export * from './transport.js';
8
+ export * from './bridge.js';
9
+ export * from './entrypoint-jobs.js';
10
+ export * from './worker.js';
11
+ export * from './protocol.js';
12
+ export * from './route.js';
13
+ export * from './queue-route.js';
2
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAM1B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,12 @@
1
+ import type { EntrypointProtocolDeclaration, RequestOf, ResponseOf } from '@owlmeans/entrypoint';
2
+ import type { JobEnvelope, JobOptions, JobRecord, JobReply } from '../types.js';
3
+ /** Enqueueing and awaiting QUEUE protocols in one context, with their exact types kept. */
4
+ export interface QueueProtocolHelper {
5
+ /** Enqueue an immutable QUEUE protocol while preserving its exact request and response types. */
6
+ enqueue: <Protocol extends EntrypointProtocolDeclaration>(declaration: Protocol, request: RequestOf<Protocol>, options?: JobOptions) => Promise<JobRecord<JobEnvelope, JobReply<ResponseOf<Protocol>>>>;
7
+ /** Wait for a protocol job and unwrap the typed entrypoint reply. */
8
+ waitFor: <Protocol extends EntrypointProtocolDeclaration>(declaration: Protocol, job: string | JobRecord<JobEnvelope, JobReply<ResponseOf<Protocol>>>, options?: {
9
+ timeout?: number;
10
+ }) => Promise<ResponseOf<Protocol>>;
11
+ }
12
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/protocol/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAChG,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE/E,2FAA2F;AAC3F,MAAM,WAAW,mBAAmB;IAClC,iGAAiG;IACjG,OAAO,EAAE,CAAC,QAAQ,SAAS,6BAA6B,EACtD,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,UAAU,KACtE,OAAO,CAAC,SAAS,CAAC,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;IACpE,qEAAqE;IACrE,OAAO,EAAE,CAAC,QAAQ,SAAS,6BAA6B,EACtD,WAAW,EAAE,QAAQ,EACrB,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,EACpE,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KAC3B,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAA;CACnC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/protocol/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import { type EntrypointProtocolDeclaration, type RequestOf, type ResponseOf } from '@owlmeans/entrypoint';
2
+ import type { JobEnvelope, JobOptions, JobRecord, JobReply } from './types.js';
3
+ import type { QueueContext } from './types.js';
4
+ import type { QueueProtocolHelper } from './protocol/types.js';
5
+ export declare const makeQueueProtocolHelper: (context: QueueContext) => QueueProtocolHelper;
6
+ export declare const queueProtocolOf: (target: QueueContext) => QueueProtocolHelper;
7
+ /** @deprecated compat:factory-refactor — use `queueProtocolOf(ctx).enqueue(…)` */
8
+ export declare const enqueueProtocol: <Protocol extends EntrypointProtocolDeclaration>(context: QueueContext, declaration: Protocol, request: RequestOf<Protocol>, options?: JobOptions) => Promise<JobRecord<JobEnvelope, JobReply<ResponseOf<Protocol>>>>;
9
+ /** @deprecated compat:factory-refactor — use `queueProtocolOf(ctx).waitFor(…)` */
10
+ export declare const waitForProtocol: <Protocol extends EntrypointProtocolDeclaration>(context: QueueContext, declaration: Protocol, job: string | JobRecord<JobEnvelope, JobReply<ResponseOf<Protocol>>>, options?: {
11
+ timeout?: number;
12
+ }) => Promise<ResponseOf<Protocol>>;
13
+ //# sourceMappingURL=protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,6BAA6B,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAwB,MAAM,sBAAsB,CAAA;AAMhI,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC9E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAE9D,eAAO,MAAM,uBAAuB,YAAa,YAAY,KAAG,mBAiE/D,CAAA;AAED,eAAO,MAAM,eAAe,+CAA8C,CAAA;AAE1E,kFAAkF;AAClF,eAAO,MAAM,eAAe,GAAU,QAAQ,SAAS,6BAA6B,WACzE,YAAY,eACR,QAAQ,WACZ,SAAS,CAAC,QAAQ,CAAC,YAClB,UAAU,KACnB,OAAO,CAAC,SAAS,CAAC,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CACM,CAAA;AAEvE,kFAAkF;AAClF,eAAO,MAAM,eAAe,GAAU,QAAQ,SAAS,6BAA6B,WACzE,YAAY,eACR,QAAQ,OAChB,MAAM,GAAG,SAAS,CAAC,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,YAC1D;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,KAC7B,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAsE,CAAA"}
@@ -0,0 +1,63 @@
1
+ import { isEntrypointProtocol } from '@owlmeans/entrypoint';
2
+ import { memoHelper } from '@owlmeans/context';
3
+ import { ResilientError } from '@owlmeans/error';
4
+ import { queueConfigOf } from './queue-config.js';
5
+ import { UnknownQueue } from './errors.js';
6
+ import { queueRouteHelper } from './queue-route.js';
7
+ export const makeQueueProtocolHelper = (context) => {
8
+ const queueFor = (declaration) => {
9
+ if (declaration == null || typeof declaration !== 'object' || !isEntrypointProtocol(declaration)) {
10
+ throw new UnknownQueue('protocol declaration required');
11
+ }
12
+ if (!queueRouteHelper.isQueueRoute(declaration.route)) {
13
+ throw new UnknownQueue(`${declaration.alias}: not a queue protocol`);
14
+ }
15
+ const { queue } = queueRouteHelper.queueRouteOptions(declaration.route);
16
+ const configured = queueConfigOf(context.cfg).queueOf(queue);
17
+ if (!configured.jobs.includes(declaration.alias)) {
18
+ throw new UnknownQueue(`${queue}:${declaration.alias}`);
19
+ }
20
+ return { protocol: declaration, queue };
21
+ };
22
+ const enqueue = async (declaration, request, options) => {
23
+ const { protocol, queue } = queueFor(declaration);
24
+ const shaped = (request ?? {});
25
+ const envelope = {
26
+ alias: protocol.alias,
27
+ params: shaped.params,
28
+ body: shaped.body,
29
+ query: shaped.query,
30
+ headers: shaped.headers,
31
+ enqueuedAt: new Date().toISOString(),
32
+ };
33
+ return await context.jobs(queue).create({
34
+ queue,
35
+ name: protocol.alias,
36
+ data: envelope,
37
+ opts: options,
38
+ });
39
+ };
40
+ const waitFor = async (declaration, job, options) => {
41
+ const { protocol, queue } = queueFor(declaration);
42
+ if (typeof job !== 'string' && (job.queue !== queue || job.name !== protocol.alias)) {
43
+ throw new UnknownQueue(`${job.queue}:${job.name}`);
44
+ }
45
+ const id = typeof job === 'string' ? job : job.id;
46
+ if (id == null) {
47
+ throw new UnknownQueue(`${queue}:${protocol.alias}: missing job id`);
48
+ }
49
+ const reply = await context.jobs(queue)
50
+ .wait(id, options);
51
+ if (reply.error != null) {
52
+ throw ResilientError.ensure(reply.error);
53
+ }
54
+ return reply.value;
55
+ };
56
+ return { enqueue, waitFor };
57
+ };
58
+ export const queueProtocolOf = memoHelper.oncePer(makeQueueProtocolHelper);
59
+ /** @deprecated compat:factory-refactor — use `queueProtocolOf(ctx).enqueue(…)` */
60
+ export const enqueueProtocol = async (context, declaration, request, options) => await queueProtocolOf(context).enqueue(declaration, request, options);
61
+ /** @deprecated compat:factory-refactor — use `queueProtocolOf(ctx).waitFor(…)` */
62
+ export const waitForProtocol = async (context, declaration, job, options) => await queueProtocolOf(context).waitFor(declaration, job, options);
63
+ //# sourceMappingURL=protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAChI,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAKnD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,OAAqB,EAAuB,EAAE;IACpF,MAAM,QAAQ,GAAG,CAAC,WAAoB,EAGpC,EAAE;QACF,IAAI,WAAW,IAAI,IAAI,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,EAAE,CAAC;YACjG,MAAM,IAAI,YAAY,CAAC,+BAA+B,CAAC,CAAA;QACzD,CAAC;QACD,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;YACtD,MAAM,IAAI,YAAY,CAAC,GAAG,WAAW,CAAC,KAAK,wBAAwB,CAAC,CAAA;QACtE,CAAC;QACD,MAAM,EAAE,KAAK,EAAE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AAO,CAAC,CAAA;AAEvE,kFAAkF;AAClF,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAClC,OAAqB,EACrB,WAAqB,EACrB,GAAoE,EACpE,OAA8B,EACC,EAAE,CAAC,MAAM,eAAe,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA"}
@@ -0,0 +1,29 @@
1
+ import type { QueueDeclaration, ScheduleDeclaration } from '../types.js';
2
+ /** What one configuration declares about its queues and schedules, read and checked. */
3
+ export interface QueueConfigHelper {
4
+ /**
5
+ * @throws {UnknownQueue}
6
+ */
7
+ queueOf: (name: string) => QueueDeclaration;
8
+ queueOfJob: (job: string) => QueueDeclaration | undefined;
9
+ isListening: (name: string) => boolean;
10
+ /**
11
+ * Whether the broker can carry a schedule out as written. Nothing is recorded or changed.
12
+ *
13
+ * @throws {ScheduleMisdeclared} naming the schedule id and the reason.
14
+ * @throws {UnknownQueue} when the schedule's queue is not declared.
15
+ * @throws {UnknownJobName} when that queue does not accept the schedule's job name — a scheduled
16
+ * run of a name nothing declares would fail on every tick instead of once, at declaration.
17
+ */
18
+ assertSchedule: (schedule: ScheduleDeclaration) => void;
19
+ /** The declared schedules, of one queue when it is named. */
20
+ schedulesOf: (queue?: string) => ScheduleDeclaration[];
21
+ /**
22
+ * Check every declared schedule, including any written into the configuration without
23
+ * `declareSchedule`, and refuse two under one id.
24
+ *
25
+ * @throws {ScheduleMisdeclared} / {UnknownQueue} / {UnknownJobName} for the first one that fails.
26
+ */
27
+ assertSchedules: () => void;
28
+ }
29
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/queue-config/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAExE,wFAAwF;AACxF,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,gBAAgB,CAAA;IAC3C,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,gBAAgB,GAAG,SAAS,CAAA;IACzD,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAA;IACtC;;;;;;;OAOG;IACH,cAAc,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,CAAA;IACvD,6DAA6D;IAC7D,WAAW,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,mBAAmB,EAAE,CAAA;IACtD;;;;;OAKG;IACH,eAAe,EAAE,MAAM,IAAI,CAAA;CAC5B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/queue-config/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import type { Config } from './types.js';
2
+ import type { QueueConfigHelper } from './queue-config/types.js';
3
+ /**
4
+ * The queue configuration of one `cfg`. It reads `cfg.queue` on every call, so declarations made
5
+ * after it was built are seen.
6
+ */
7
+ export declare const makeQueueConfigHelper: (cfg: Config) => QueueConfigHelper;
8
+ export declare const queueConfigOf: (target: Config) => QueueConfigHelper;
9
+ //# sourceMappingURL=queue-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue-config.d.ts","sourceRoot":"","sources":["../src/queue-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAqD,MAAM,YAAY,CAAA;AAC3F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAGhE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAAS,MAAM,KAAG,iBA0FnD,CAAA;AAED,eAAO,MAAM,aAAa,uCAA4C,CAAA"}
@@ -0,0 +1,83 @@
1
+ import { memoHelper } from '@owlmeans/context';
2
+ import { ScheduleMisdeclared, UnknownJobName, UnknownQueue } from './errors.js';
3
+ /**
4
+ * The queue configuration of one `cfg`. It reads `cfg.queue` on every call, so declarations made
5
+ * after it was built are seen.
6
+ */
7
+ export const makeQueueConfigHelper = (cfg) => {
8
+ const queueOf = (name) => {
9
+ const queue = cfg.queue?.queues?.find(declared => declared.name === name);
10
+ if (queue == null) {
11
+ throw new UnknownQueue(name);
12
+ }
13
+ return queue;
14
+ };
15
+ const queueOfJob = (job) => cfg.queue?.queues?.find(declared => declared.jobs.includes(job));
16
+ const isListening = (name) => cfg.queue?.listen?.includes(name) === true;
17
+ /** A date option the broker can read — a `Date`, epoch milliseconds or a parsable string. */
18
+ const isInstant = (value) => Number.isFinite((value instanceof Date ? value : new Date(value)).getTime());
19
+ const assertSchedule = (schedule) => {
20
+ const { id } = schedule;
21
+ if (typeof id !== 'string' || id.trim() === '') {
22
+ throw new ScheduleMisdeclared('(empty):id');
23
+ }
24
+ const queue = queueOf(schedule.queue);
25
+ if (!queue.jobs.includes(schedule.name)) {
26
+ throw new UnknownJobName(`${schedule.queue}:${schedule.name}`);
27
+ }
28
+ const every = schedule.every != null;
29
+ const pattern = schedule.pattern != null;
30
+ if (every === pattern) {
31
+ throw new ScheduleMisdeclared(`${id}:every-or-pattern`);
32
+ }
33
+ if (every && !(Number.isSafeInteger(schedule.every) && schedule.every > 0)) {
34
+ throw new ScheduleMisdeclared(`${id}:every`);
35
+ }
36
+ if (pattern && (typeof schedule.pattern !== 'string' || schedule.pattern.trim() === '')) {
37
+ throw new ScheduleMisdeclared(`${id}:pattern`);
38
+ }
39
+ // Both only mean something to a cron pattern: an interval has no wall clock to read in a time
40
+ // zone, and its first run is immediate already.
41
+ if (!pattern && schedule.tz != null) {
42
+ throw new ScheduleMisdeclared(`${id}:tz`);
43
+ }
44
+ if (!pattern && schedule.immediately === true) {
45
+ throw new ScheduleMisdeclared(`${id}:immediately`);
46
+ }
47
+ if (schedule.immediately === true && schedule.startDate != null) {
48
+ throw new ScheduleMisdeclared(`${id}:immediately-start-date`);
49
+ }
50
+ if (schedule.limit != null && !(Number.isSafeInteger(schedule.limit) && schedule.limit > 0)) {
51
+ throw new ScheduleMisdeclared(`${id}:limit`);
52
+ }
53
+ if (schedule.startDate != null && !isInstant(schedule.startDate)) {
54
+ throw new ScheduleMisdeclared(`${id}:start-date`);
55
+ }
56
+ if (schedule.endDate != null && !isInstant(schedule.endDate)) {
57
+ throw new ScheduleMisdeclared(`${id}:end-date`);
58
+ }
59
+ // The type already omits both; a declaration assembled at runtime still reaches this check. The
60
+ // broker names every run itself and places it on the schedule, so either would be overridden.
61
+ const opts = schedule.opts;
62
+ if (opts?.id != null) {
63
+ throw new ScheduleMisdeclared(`${id}:opts-id`);
64
+ }
65
+ if (opts?.delay != null) {
66
+ throw new ScheduleMisdeclared(`${id}:opts-delay`);
67
+ }
68
+ };
69
+ const schedulesOf = (queue) => (cfg.queue?.schedules ?? []).filter(schedule => queue == null || schedule.queue === queue);
70
+ const assertSchedules = () => {
71
+ const seen = new Set();
72
+ for (const schedule of schedulesOf()) {
73
+ assertSchedule(schedule);
74
+ if (seen.has(schedule.id)) {
75
+ throw new ScheduleMisdeclared(`${schedule.id}:duplicate`);
76
+ }
77
+ seen.add(schedule.id);
78
+ }
79
+ };
80
+ return { queueOf, queueOfJob, isListening, assertSchedule, schedulesOf, assertSchedules };
81
+ };
82
+ export const queueConfigOf = memoHelper.oncePer(makeQueueConfigHelper);
83
+ //# sourceMappingURL=queue-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue-config.js","sourceRoot":"","sources":["../src/queue-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAG9C,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/E;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,GAAW,EAAqB,EAAE;IACtE,MAAM,OAAO,GAAG,CAAC,I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AAC,KAAK,KAAK,KAAK,CAAC,CAAA;IAE5F,MAAM,eAAe,GAAG,GAAS,EAAE;QACjC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;QAC9B,KAAK,MAAM,QAAQ,IAAI,WAAW,EAAE,EAAE,CAAC;YACrC,cAAc,CAAC,QAAQ,CAAC,CAAA;YACxB,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;gBAC1B,MAAM,IAAI,mBAAmB,CAAC,GAAG,QAAQ,CAAC,EAAE,YAAY,CAAC,CAAA;YAC3D,CAAC;YACD,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;QACvB,CAAC;IACH,CAAC,CAAA;IAED,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,CAAA;AAC3F,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAA"}
@@ -0,0 +1,14 @@
1
+ import type { RouteDeclaration, RouteModel } from '@owlmeans/route';
2
+ import type { QueueRouteOptions } from '../types.js';
3
+ /** Reads a route declaration as one carried by the queue transport. */
4
+ export interface QueueRouteHelper {
5
+ /** Whether a declaration belongs to the queue transport. */
6
+ isQueueRoute: (route: RouteDeclaration | RouteModel) => boolean;
7
+ /**
8
+ * Read and validate queue-owned route options.
9
+ *
10
+ * @throws {UnknownQueue} for a route of another protocol, or queue options that do not validate
11
+ */
12
+ queueRouteOptions: (route: RouteDeclaration | RouteModel) => Pick<QueueRouteOptions, 'queue' | 'reply'>;
13
+ }
14
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/queue-route/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEpD,uEAAuE;AACvE,MAAM,WAAW,gBAAgB;IAC/B,4DAA4D;IAC5D,YAAY,EAAE,CAAC,KAAK,EAAE,gBAAgB,GAAG,UAAU,KAAK,OAAO,CAAA;IAC/D;;;;OAIG;IACH,iBAAiB,EAAE,CAAC,KAAK,EAAE,gBAAgB,GAAG,UAAU,KAAK,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,OAAO,CAAC,CAAA;CACxG"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/queue-route/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { QueueRouteHelper } from './queue-route/types.js';
2
+ export declare const createQueueRouteHelper: () => QueueRouteHelper;
3
+ export declare const queueRouteHelper: QueueRouteHelper;
4
+ //# sourceMappingURL=queue-route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue-route.d.ts","sourceRoot":"","sources":["../src/queue-route.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D,eAAO,MAAM,sBAAsB,QAAO,gBAwBzC,CAAA;AAED,eAAO,MAAM,gBAAgB,kBAA2B,CAAA"}
@@ -0,0 +1,24 @@
1
+ import { UnknownQueue } from './errors.js';
2
+ import { QUEUE_PROTOCOL } from './consts.js';
3
+ export const createQueueRouteHelper = () => {
4
+ const isQueueRoute = (route) => ('route' in route ? route.route : route).protocol === QUEUE_PROTOCOL;
5
+ const queueRouteOptions = (route) => {
6
+ const declaration = 'route' in route ? route.route : route;
7
+ if (declaration.protocol !== QUEUE_PROTOCOL
8
+ || declaration.protocolOptions == null
9
+ || typeof declaration.protocolOptions !== 'object') {
10
+ throw new UnknownQueue(`${declaration.alias}: not a queue protocol`);
11
+ }
12
+ const options = declaration.protocolOptions;
13
+ if (typeof options.queue !== 'string' || options.queue.trim() === '') {
14
+ throw new UnknownQueue(`${declaration.alias}: route declares no queue`);
15
+ }
16
+ if (options.reply != null && typeof options.reply !== 'boolean') {
17
+ throw new UnknownQueue(`${declaration.alias}: invalid queue reply option`);
18
+ }
19
+ return { queue: options.queue, reply: options.reply };
20
+ };
21
+ return { isQueueRoute, queueRouteOptions };
22
+ };
23
+ export const queueRouteHelper = createQueueRouteHelper();
24
+ //# sourceMappingURL=queue-route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue-route.js","sourceRoot":"","sources":["../src/queue-route.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAI5C,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAqB,EAAE;IAC3D,MAAM,YAAY,GAAG,CAAC,KAAoC,EAAW,EAAE,CACrE,CAAC,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,KAAK,cAAc,CAAA;IAEtE,MAAM,iBAAiB,GAAG,CACxB,KAAoC,EACQ,EAAE;QAC9C,MAAM,WAAW,GAAG,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAA;QAC1D,IAAI,WAAW,CAAC,QAAQ,KAAK,cAAc;eACtC,WAAW,CAAC,eAAe,IAAI,IAAI;eACnC,OAAO,WAAW,CAAC,eAAe,KAAK,QAAQ,EAAE,CAAC;YACrD,MAAM,IAAI,YAAY,CAAC,GAAG,WAAW,CAAC,KAAK,wBAAwB,CAAC,CAAA;QACtE,CAAC;QACD,MAAM,OAAO,GAAG,WAAW,CAAC,eAA0C,CAAA;QACtE,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACrE,MAAM,IAAI,YAAY,CAAC,GAAG,WAAW,CAAC,KAAK,2BAA2B,CAAC,CAAA;QACzE,CAAC;QACD,IAAI,OAAO,CAAC,KAAK,IAAI,IAAI,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAChE,MAAM,IAAI,YAAY,CAAC,GAAG,WAAW,CAAC,KAAK,8BAA8B,CAAC,CAAA;QAC5E,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,KAA4B,EAAE,CAAA;IAC9E,CAAC,CAAA;IAED,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAA;AAC5C,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,sBAAsB,EAAE,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { type RouteDeclaration, type RouteModel, type RouteOptions } from '@owlmeans/route';
2
+ import type { QueueRouteOptions } from './types.js';
3
+ /** Declare a backend route carried by a queue. */
4
+ export declare const job: (opts: QueueRouteOptions, secondary?: Omit<QueueRouteOptions, 'queue'>) => Partial<RouteOptions>;
5
+ /** @deprecated compat:factory-refactor — use `queueRouteHelper.isQueueRoute(…)` */
6
+ export declare const isQueueRoute: (route: RouteDeclaration | RouteModel) => boolean;
7
+ /** @deprecated compat:factory-refactor — use `queueRouteHelper.queueRouteOptions(…)` */
8
+ export declare const queueRouteOptions: (route: RouteDeclaration | RouteModel) => Pick<QueueRouteOptions, 'queue' | 'reply'>;
9
+ //# sourceMappingURL=route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../src/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,gBAAgB,EAAE,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAEpG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAGnD,kDAAkD;AAClD,eAAO,MAAM,GAAG,SACR,iBAAiB,cACX,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,KAC3C,OAAO,CAAC,YAAY,CAMtB,CAAA;AAED,mFAAmF;AACnF,eAAO,MAAM,YAAY,UAAW,gBAAgB,GAAG,UAAU,KAAG,OAA+C,CAAA;AAEnH,wFAAwF;AACxF,eAAO,MAAM,iBAAiB,UAAW,gBAAgB,GAAG,UAAU,KAAG,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,OAAO,CACvE,CAAA"}
package/build/route.js ADDED
@@ -0,0 +1,16 @@
1
+ import { backend } from '@owlmeans/route';
2
+ import { QUEUE_PROTOCOL } from './consts.js';
3
+ import { queueRouteHelper } from './queue-route.js';
4
+ /** Declare a backend route carried by a queue. */
5
+ export const job = (opts, secondary) => {
6
+ const { queue, reply, ...routeOptions } = { ...opts, ...secondary };
7
+ const declaration = backend(routeOptions);
8
+ declaration.protocol = QUEUE_PROTOCOL;
9
+ declaration.protocolOptions = { queue, ...(reply == null ? {} : { reply }) };
10
+ return declaration;
11
+ };
12
+ /** @deprecated compat:factory-refactor — use `queueRouteHelper.isQueueRoute(…)` */
13
+ export const isQueueRoute = (route) => queueRouteHelper.isQueueRoute(route);
14
+ /** @deprecated compat:factory-refactor — use `queueRouteHelper.queueRouteOptions(…)` */
15
+ export const queueRouteOptions = (route) => queueRouteHelper.queueRouteOptions(route);
16
+ //# sourceMappingURL=route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route.js","sourceRoot":"","sources":["../src/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA6D,MAAM,iBAAiB,CAAA;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAEnD,kDAAkD;AAClD,MAAM,CAAC,MAAM,GAAG,GAAG,CACjB,IAAuB,EACvB,SAA4C,EACrB,EAAE;IACzB,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,SAAS,EAAE,CAAA;IACnE,MAAM,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;IACzC,WAAW,CAAC,QAAQ,GAAG,cAAc,CAAA;IACrC,WAAW,CAAC,eAAe,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAA;IAC5E,OAAO,WAAW,CAAA;AACpB,CAAC,CAAA;AAED,mFAAmF;AACnF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAoC,EAAW,EAAE,CAAC,gBAAgB,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;AAEnH,wFAAwF;AACxF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAoC,EAA8C,EAAE,CACpH,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAA"}
@@ -0,0 +1,15 @@
1
+ import { type EntrypointTransport } from '@owlmeans/entrypoint';
2
+ import type { Config, Context } from './types.js';
3
+ /**
4
+ * The producing half of the bridge: it turns a call on a QUEUE entrypoint into a job, and the
5
+ * job's outcome back into a reply.
6
+ *
7
+ * Registering it is the whole opt-in. `apiHandler` looks up a transport by the route's protocol,
8
+ * so a consumer writes `ep.call(...)` against a declaration it shares with every other kind of
9
+ * entrypoint and never learns which one carried it. That is also why the envelope is built from
10
+ * the request rather than from the entrypoint: the far side rebuilds a request, and anything only
11
+ * HTTP understands would not survive the trip anyway.
12
+ */
13
+ export declare const makeQueueTransport: (alias?: string) => EntrypointTransport;
14
+ export declare const appendQueueTransport: <C extends Config, T extends Context<C> = Context<C>>(context: T, alias?: string) => T;
15
+ //# sourceMappingURL=transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AACA,OAAO,EAA+C,KAAK,mBAAmB,EAA4D,MAAM,sBAAsB,CAAA;AAEtK,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAsC,MAAM,YAAY,CAAA;AAIrF;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,WAAW,MAAM,KAAoC,mBAiDnF,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,WAC7E,CAAC,UAAU,MAAM,KACzB,CAMF,CAAA"}