@geekmidas/constructs 9.5.0 → 9.6.1
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/CHANGELOG.md +69 -0
- package/dist/Endpoint-ZtG0zVz1.d.mts.map +1 -1
- package/dist/{Queue-I5NfFV0V.d.mts → Queue-Bg6WzavN.d.mts} +26 -3
- package/dist/Queue-Bg6WzavN.d.mts.map +1 -0
- package/dist/{Queue-915lgS2D.mjs → Queue-Cvv-QluM.mjs} +6 -3
- package/dist/Queue-Cvv-QluM.mjs.map +1 -0
- package/dist/{Queue-HbdYCQ-X.cjs → Queue-Di2a2N-b.cjs} +6 -3
- package/dist/Queue-Di2a2N-b.cjs.map +1 -0
- package/dist/{Queue-XQNGO6_-.d.cts → Queue-GJexVGOh.d.cts} +26 -3
- package/dist/Queue-GJexVGOh.d.cts.map +1 -0
- package/dist/adaptors/aws.cjs +4 -2
- package/dist/adaptors/aws.cjs.map +1 -1
- package/dist/adaptors/aws.d.cts +3 -2
- package/dist/adaptors/aws.d.cts.map +1 -1
- package/dist/adaptors/aws.d.mts +3 -2
- package/dist/adaptors/aws.d.mts.map +1 -1
- package/dist/adaptors/aws.mjs +4 -2
- package/dist/adaptors/aws.mjs.map +1 -1
- package/dist/adaptors/testing.d.cts +1 -1
- package/dist/adaptors/testing.d.mts +1 -1
- package/dist/queue/index.cjs +24 -4
- package/dist/queue/index.cjs.map +1 -1
- package/dist/queue/index.d.cts +20 -3
- package/dist/queue/index.d.cts.map +1 -1
- package/dist/queue/index.d.mts +20 -3
- package/dist/queue/index.d.mts.map +1 -1
- package/dist/queue/index.mjs +24 -4
- package/dist/queue/index.mjs.map +1 -1
- package/package.json +22 -22
- package/src/queue/AWSLambdaQueueAdaptor.ts +5 -1
- package/src/queue/Queue.ts +16 -0
- package/src/queue/QueueBuilder.ts +36 -3
- package/src/queue/__tests__/AWSLambdaQueueAdaptor.spec.ts +65 -0
- package/src/queue/__tests__/QueueBuilder.spec.ts +19 -0
- package/dist/Queue-915lgS2D.mjs.map +0 -1
- package/dist/Queue-HbdYCQ-X.cjs.map +0 -1
- package/dist/Queue-I5NfFV0V.d.mts.map +0 -1
- package/dist/Queue-XQNGO6_-.d.cts.map +0 -1
package/dist/queue/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["name: T","timeout: number","batchSize: number","services: T","logger: T","schema: T","fn: QueueHandler<NonNullable<TMessage>, TServices, TLogger>"],"sources":["../../src/queue/QueueBuilder.ts","../../src/queue/index.ts"],"sourcesContent":["import type { Logger } from '@geekmidas/logger';\nimport { DEFAULT_LOGGER } from '@geekmidas/logger/console';\nimport type { Service } from '@geekmidas/services';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport { cloneWith } from '../clone';\nimport { Queue, type QueueHandler } from './Queue';\n\n/**\n * Builds a {@link Queue} worker — `q.queue('orders').services([db]).message(schema).handle(fn)`.\n * Services are an array (sniffed for required env vars); `message` is the typed\n * job payload; `handle` is the single consumer. The queue name is captured as a\n * literal so `queue.publisher` is typed to `{ type: '<name>', payload }`.\n */\nexport class QueueBuilder<\n\tTName extends string = string,\n\tTMessage extends StandardSchemaV1 | undefined = undefined,\n\tTServices extends Service[] = [],\n\tTLogger extends Logger = Logger,\n> {\n\tprivate _name?: string;\n\tprivate _messageSchema?: TMessage;\n\tprivate _timeout = 30000;\n\tprivate _batchSize?: number;\n\tprivate _fifo?: boolean;\n\tprivate _services: TServices = [] as Service[] as TServices;\n\tprivate _logger: TLogger = DEFAULT_LOGGER as TLogger;\n\n\t/** The queue name — drives the infra queue and its `<NAME>_*` env vars. */\n\tqueue<T extends string>(\n\t\tname: T,\n\t): QueueBuilder<T, TMessage, TServices, TLogger> {\n\t\treturn cloneWith(this, { _name: name }) as unknown as QueueBuilder<\n\t\t\tT,\n\t\t\tTMessage,\n\t\t\tTServices,\n\t\t\tTLogger\n\t\t>;\n\t}\n\n\ttimeout(timeout: number): this {\n\t\treturn cloneWith(this, { _timeout: timeout });\n\t}\n\n\t/** SQS event-source batch size (deployed). */\n\tbatchSize(batchSize: number): this {\n\t\treturn cloneWith(this, { _batchSize: batchSize });\n\t}\n\n\t
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["name: T","timeout: number","batchSize: number","fifo:\n\t\t\t| boolean\n\t\t\t| {\n\t\t\t\t\tgroupId: (\n\t\t\t\t\t\tmessage: TMessage extends StandardSchemaV1\n\t\t\t\t\t\t\t? InferStandardSchema<TMessage>\n\t\t\t\t\t\t\t: never,\n\t\t\t\t\t) => string;\n\t\t\t }","services: T","logger: T","schema: T","fn: QueueHandler<NonNullable<TMessage>, TServices, TLogger>"],"sources":["../../src/queue/QueueBuilder.ts","../../src/queue/index.ts"],"sourcesContent":["import type { Logger } from '@geekmidas/logger';\nimport { DEFAULT_LOGGER } from '@geekmidas/logger/console';\nimport type { InferStandardSchema } from '@geekmidas/schema';\nimport type { Service } from '@geekmidas/services';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport { cloneWith } from '../clone';\nimport { Queue, type QueueHandler } from './Queue';\n\n/**\n * Builds a {@link Queue} worker — `q.queue('orders').services([db]).message(schema).handle(fn)`.\n * Services are an array (sniffed for required env vars); `message` is the typed\n * job payload; `handle` is the single consumer. The queue name is captured as a\n * literal so `queue.publisher` is typed to `{ type: '<name>', payload }`.\n */\nexport class QueueBuilder<\n\tTName extends string = string,\n\tTMessage extends StandardSchemaV1 | undefined = undefined,\n\tTServices extends Service[] = [],\n\tTLogger extends Logger = Logger,\n> {\n\tprivate _name?: string;\n\tprivate _messageSchema?: TMessage;\n\tprivate _timeout = 30000;\n\tprivate _batchSize?: number;\n\tprivate _fifo?: boolean;\n\tprivate _envelope = true;\n\tprivate _groupId?: (message: any) => string;\n\tprivate _services: TServices = [] as Service[] as TServices;\n\tprivate _logger: TLogger = DEFAULT_LOGGER as TLogger;\n\n\t/** The queue name — drives the infra queue and its `<NAME>_*` env vars. */\n\tqueue<T extends string>(\n\t\tname: T,\n\t): QueueBuilder<T, TMessage, TServices, TLogger> {\n\t\treturn cloneWith(this, { _name: name }) as unknown as QueueBuilder<\n\t\t\tT,\n\t\t\tTMessage,\n\t\t\tTServices,\n\t\t\tTLogger\n\t\t>;\n\t}\n\n\ttimeout(timeout: number): this {\n\t\treturn cloneWith(this, { _timeout: timeout });\n\t}\n\n\t/** SQS event-source batch size (deployed). */\n\tbatchSize(batchSize: number): this {\n\t\treturn cloneWith(this, { _batchSize: batchSize });\n\t}\n\n\t/**\n\t * Mark the queue as FIFO (deployed). Pass `{ groupId }` to give each message\n\t * its message group, which the queue's publisher then sends: a FIFO queue\n\t * refuses a message without one. Messages in one group keep their order.\n\t */\n\tfifo(\n\t\tfifo:\n\t\t\t| boolean\n\t\t\t| {\n\t\t\t\t\tgroupId: (\n\t\t\t\t\t\tmessage: TMessage extends StandardSchemaV1\n\t\t\t\t\t\t\t? InferStandardSchema<TMessage>\n\t\t\t\t\t\t\t: never,\n\t\t\t\t\t) => string;\n\t\t\t } = true,\n\t): this {\n\t\tif (typeof fifo === 'boolean') {\n\t\t\treturn cloneWith(this, { _fifo: fifo });\n\t\t}\n\t\treturn cloneWith(this, { _fifo: true, _groupId: fifo.groupId });\n\t}\n\n\t/**\n\t * Whether messages arrive in the `{ type, payload }` envelope the queue's\n\t * publisher writes. Pass `false` for a queue fed by something else — an IoT\n\t * rule, a webhook forwarder — whose bodies are the message as they stand: a\n\t * body is then never unwrapped, even one that has a `payload` field of its\n\t * own, and one that is not JSON is the message as a string.\n\t */\n\tenvelope(envelope = true): this {\n\t\treturn cloneWith(this, { _envelope: envelope });\n\t}\n\n\tservices<T extends Service[]>(\n\t\tservices: T,\n\t): QueueBuilder<TName, TMessage, [...TServices, ...T], TLogger> {\n\t\treturn cloneWith(this, {\n\t\t\t_services: [...this._services, ...services] as unknown as TServices,\n\t\t}) as unknown as QueueBuilder<\n\t\t\tTName,\n\t\t\tTMessage,\n\t\t\t[...TServices, ...T],\n\t\t\tTLogger\n\t\t>;\n\t}\n\n\tlogger<T extends Logger>(\n\t\tlogger: T,\n\t): QueueBuilder<TName, TMessage, TServices, T> {\n\t\treturn cloneWith(this, {\n\t\t\t_logger: logger as unknown as TLogger,\n\t\t}) as unknown as QueueBuilder<TName, TMessage, TServices, T>;\n\t}\n\n\t/** The typed message (job) payload the queue carries. */\n\tmessage<T extends StandardSchemaV1>(\n\t\tschema: T,\n\t): QueueBuilder<TName, T, TServices, TLogger> {\n\t\treturn cloneWith(this, {\n\t\t\t_messageSchema: schema as unknown as TMessage,\n\t\t}) as unknown as QueueBuilder<TName, T, TServices, TLogger>;\n\t}\n\n\thandle(\n\t\tfn: QueueHandler<NonNullable<TMessage>, TServices, TLogger>,\n\t): Queue<TName, NonNullable<TMessage>, TServices, TLogger> {\n\t\tif (!this._name) {\n\t\t\tthrow new Error(\n\t\t\t\t'Queue requires a name — call .queue(name) before .handle().',\n\t\t\t);\n\t\t}\n\t\tif (!this._messageSchema) {\n\t\t\tthrow new Error(\n\t\t\t\t'Queue requires a message schema — call .message(schema) before .handle().',\n\t\t\t);\n\t\t}\n\n\t\tconst queue = new Queue<TName, NonNullable<TMessage>, TServices, TLogger>(\n\t\t\tthis._name as TName,\n\t\t\tfn,\n\t\t\tthis._messageSchema as NonNullable<TMessage>,\n\t\t\tthis._timeout,\n\t\t\tthis._services,\n\t\t\tthis._logger,\n\t\t\tthis._batchSize,\n\t\t\tthis._fifo,\n\t\t\tthis._envelope,\n\t\t\tthis._groupId,\n\t\t);\n\n\t\t// No reset. `.handle()` reads this builder and leaves it alone, so a\n\t\t// configured base keeps its configuration for every construct built\n\t\t// from it. The reset that used to be here wiped the base on first use.\n\n\t\treturn queue;\n\t}\n}\n","export {\n\tisQueueResult,\n\tQueue,\n\ttype QueueContext,\n\ttype QueueHandler,\n\ttype QueueMessage,\n\ttype QueueRecord,\n\ttype QueueResult,\n} from './Queue';\n\nimport { QueueBuilder } from './QueueBuilder';\n\nexport { QueueBuilder } from './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AAI,IAAI"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geekmidas/constructs",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.6.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -152,33 +152,33 @@
|
|
|
152
152
|
"pg": "~8.16.3",
|
|
153
153
|
"msw": "~2.10.3",
|
|
154
154
|
"zod": "~4.6.6",
|
|
155
|
-
"@geekmidas/audit": "^9.
|
|
156
|
-
"@geekmidas/cache": "^9.
|
|
157
|
-
"@geekmidas/
|
|
158
|
-
"@geekmidas/
|
|
159
|
-
"@geekmidas/errors": "^9.
|
|
160
|
-
"@geekmidas/events": "^9.
|
|
161
|
-
"@geekmidas/logger": "^9.
|
|
162
|
-
"@geekmidas/
|
|
163
|
-
"@geekmidas/
|
|
164
|
-
"@geekmidas/services": "^9.
|
|
165
|
-
"@geekmidas/testkit": "^9.
|
|
155
|
+
"@geekmidas/audit": "^9.6.1",
|
|
156
|
+
"@geekmidas/cache": "^9.6.1",
|
|
157
|
+
"@geekmidas/envkit": "^9.6.1",
|
|
158
|
+
"@geekmidas/db": "^9.6.1",
|
|
159
|
+
"@geekmidas/errors": "^9.6.1",
|
|
160
|
+
"@geekmidas/events": "^9.6.1",
|
|
161
|
+
"@geekmidas/logger": "^9.6.1",
|
|
162
|
+
"@geekmidas/schema": "^9.6.1",
|
|
163
|
+
"@geekmidas/rate-limit": "^9.6.1",
|
|
164
|
+
"@geekmidas/services": "^9.6.1",
|
|
165
|
+
"@geekmidas/testkit": "^9.6.1"
|
|
166
166
|
},
|
|
167
167
|
"peerDependencies": {
|
|
168
168
|
"@middy/core": ">=6.3.1",
|
|
169
169
|
"@types/aws-lambda": ">=8.10.92",
|
|
170
170
|
"hono": ">=4.8.2",
|
|
171
171
|
"msw": ">=2.0.0",
|
|
172
|
-
"@geekmidas/audit": "^9.
|
|
173
|
-
"@geekmidas/cache": "^9.
|
|
174
|
-
"@geekmidas/db": "^9.
|
|
175
|
-
"@geekmidas/envkit": "^9.
|
|
176
|
-
"@geekmidas/errors": "^9.
|
|
177
|
-
"@geekmidas/events": "^9.
|
|
178
|
-
"@geekmidas/logger": "^9.
|
|
179
|
-
"@geekmidas/rate-limit": "^9.
|
|
180
|
-
"@geekmidas/schema": "^9.
|
|
181
|
-
"@geekmidas/services": "^9.
|
|
172
|
+
"@geekmidas/audit": "^9.6.1",
|
|
173
|
+
"@geekmidas/cache": "^9.6.1",
|
|
174
|
+
"@geekmidas/db": "^9.6.1",
|
|
175
|
+
"@geekmidas/envkit": "^9.6.1",
|
|
176
|
+
"@geekmidas/errors": "^9.6.1",
|
|
177
|
+
"@geekmidas/events": "^9.6.1",
|
|
178
|
+
"@geekmidas/logger": "^9.6.1",
|
|
179
|
+
"@geekmidas/rate-limit": "^9.6.1",
|
|
180
|
+
"@geekmidas/schema": "^9.6.1",
|
|
181
|
+
"@geekmidas/services": "^9.6.1"
|
|
182
182
|
},
|
|
183
183
|
"peerDependenciesMeta": {
|
|
184
184
|
"@geekmidas/audit": {
|
|
@@ -75,10 +75,14 @@ export class AWSLambdaQueue<
|
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* Unwrap the queue payload from an SQS record. The SQS publisher writes
|
|
78
|
-
* `{ type, payload }`; a payload-only body is also accepted as-is.
|
|
78
|
+
* `{ type, payload }`; a payload-only body is also accepted as-is. A queue
|
|
79
|
+
* built with `.envelope(false)` is never unwrapped: its body is the message.
|
|
79
80
|
*/
|
|
80
81
|
private extractPayload(record: SQSRecord): unknown {
|
|
81
82
|
const body = this.safeJsonParse(record.body);
|
|
83
|
+
if (!this.queue.envelope) {
|
|
84
|
+
return body ?? record.body;
|
|
85
|
+
}
|
|
82
86
|
if (body && typeof body === 'object' && 'payload' in body) {
|
|
83
87
|
return (body as { payload: unknown }).payload;
|
|
84
88
|
}
|
package/src/queue/Queue.ts
CHANGED
|
@@ -63,6 +63,20 @@ export class Queue<
|
|
|
63
63
|
public readonly batchSize?: number,
|
|
64
64
|
/** Whether the queue is FIFO (deployed). */
|
|
65
65
|
public readonly fifo?: boolean,
|
|
66
|
+
/**
|
|
67
|
+
* Whether bodies are `{ type, payload }`, as the queue's publisher writes
|
|
68
|
+
* them. `false` for a queue fed by something else (an IoT rule, a webhook
|
|
69
|
+
* forwarder): each body is the message as it stands, never unwrapped.
|
|
70
|
+
*/
|
|
71
|
+
public readonly envelope: boolean = true,
|
|
72
|
+
/**
|
|
73
|
+
* The FIFO message group for each message, from the message itself. Used
|
|
74
|
+
* by {@link Queue.publisher} on a FIFO queue, which refuses a message
|
|
75
|
+
* without a group.
|
|
76
|
+
*/
|
|
77
|
+
public readonly groupId?: (
|
|
78
|
+
message: InferStandardSchema<TMessage>,
|
|
79
|
+
) => string,
|
|
66
80
|
) {
|
|
67
81
|
super(
|
|
68
82
|
ConstructType.Queue,
|
|
@@ -91,6 +105,7 @@ export class Queue<
|
|
|
91
105
|
EventPublisher<QueueMessage<TName, TMessage>>
|
|
92
106
|
> {
|
|
93
107
|
const envVar = `${environmentCase(this.name)}_PUBLISHER_CONNECTION_STRING`;
|
|
108
|
+
const groupId = this.groupId;
|
|
94
109
|
return {
|
|
95
110
|
serviceName: `${this.name}Publisher`,
|
|
96
111
|
async register({ envParser }) {
|
|
@@ -102,6 +117,7 @@ export class Queue<
|
|
|
102
117
|
|
|
103
118
|
return Publisher.fromConnectionString<QueueMessage<TName, TMessage>>(
|
|
104
119
|
connectionString as EventPublisherConnectionString,
|
|
120
|
+
{ groupId: groupId && ((message) => groupId(message.payload)) },
|
|
105
121
|
);
|
|
106
122
|
},
|
|
107
123
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Logger } from '@geekmidas/logger';
|
|
2
2
|
import { DEFAULT_LOGGER } from '@geekmidas/logger/console';
|
|
3
|
+
import type { InferStandardSchema } from '@geekmidas/schema';
|
|
3
4
|
import type { Service } from '@geekmidas/services';
|
|
4
5
|
import type { StandardSchemaV1 } from '@standard-schema/spec';
|
|
5
6
|
import { cloneWith } from '../clone';
|
|
@@ -22,6 +23,8 @@ export class QueueBuilder<
|
|
|
22
23
|
private _timeout = 30000;
|
|
23
24
|
private _batchSize?: number;
|
|
24
25
|
private _fifo?: boolean;
|
|
26
|
+
private _envelope = true;
|
|
27
|
+
private _groupId?: (message: any) => string;
|
|
25
28
|
private _services: TServices = [] as Service[] as TServices;
|
|
26
29
|
private _logger: TLogger = DEFAULT_LOGGER as TLogger;
|
|
27
30
|
|
|
@@ -46,9 +49,37 @@ export class QueueBuilder<
|
|
|
46
49
|
return cloneWith(this, { _batchSize: batchSize });
|
|
47
50
|
}
|
|
48
51
|
|
|
49
|
-
/**
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Mark the queue as FIFO (deployed). Pass `{ groupId }` to give each message
|
|
54
|
+
* its message group, which the queue's publisher then sends: a FIFO queue
|
|
55
|
+
* refuses a message without one. Messages in one group keep their order.
|
|
56
|
+
*/
|
|
57
|
+
fifo(
|
|
58
|
+
fifo:
|
|
59
|
+
| boolean
|
|
60
|
+
| {
|
|
61
|
+
groupId: (
|
|
62
|
+
message: TMessage extends StandardSchemaV1
|
|
63
|
+
? InferStandardSchema<TMessage>
|
|
64
|
+
: never,
|
|
65
|
+
) => string;
|
|
66
|
+
} = true,
|
|
67
|
+
): this {
|
|
68
|
+
if (typeof fifo === 'boolean') {
|
|
69
|
+
return cloneWith(this, { _fifo: fifo });
|
|
70
|
+
}
|
|
71
|
+
return cloneWith(this, { _fifo: true, _groupId: fifo.groupId });
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Whether messages arrive in the `{ type, payload }` envelope the queue's
|
|
76
|
+
* publisher writes. Pass `false` for a queue fed by something else — an IoT
|
|
77
|
+
* rule, a webhook forwarder — whose bodies are the message as they stand: a
|
|
78
|
+
* body is then never unwrapped, even one that has a `payload` field of its
|
|
79
|
+
* own, and one that is not JSON is the message as a string.
|
|
80
|
+
*/
|
|
81
|
+
envelope(envelope = true): this {
|
|
82
|
+
return cloneWith(this, { _envelope: envelope });
|
|
52
83
|
}
|
|
53
84
|
|
|
54
85
|
services<T extends Service[]>(
|
|
@@ -104,6 +135,8 @@ export class QueueBuilder<
|
|
|
104
135
|
this._logger,
|
|
105
136
|
this._batchSize,
|
|
106
137
|
this._fifo,
|
|
138
|
+
this._envelope,
|
|
139
|
+
this._groupId,
|
|
107
140
|
);
|
|
108
141
|
|
|
109
142
|
// No reset. `.handle()` reads this builder and leaves it alone, so a
|
|
@@ -128,4 +128,69 @@ describe('AWSLambdaQueue', () => {
|
|
|
128
128
|
|
|
129
129
|
expect(seen).toEqual([[{ orderId: 'raw' }]]);
|
|
130
130
|
});
|
|
131
|
+
|
|
132
|
+
describe('.envelope(false)', () => {
|
|
133
|
+
/** A device message as an IoT rule forwards it: its own `payload`. */
|
|
134
|
+
const DEVICE_MESSAGE = {
|
|
135
|
+
deviceId: 'device-1',
|
|
136
|
+
topic: 'devices/device-1/telemetry',
|
|
137
|
+
payload: 'temperature=21.5',
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const deviceSchema = z.object({
|
|
141
|
+
deviceId: z.string(),
|
|
142
|
+
topic: z.string(),
|
|
143
|
+
payload: z.string(),
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
/** A queue fed by something other than its publisher. */
|
|
147
|
+
const runRawQueue = <TSchema extends z.ZodType>(
|
|
148
|
+
messageSchema: TSchema,
|
|
149
|
+
bodies: unknown[],
|
|
150
|
+
) => {
|
|
151
|
+
const seen: unknown[][] = [];
|
|
152
|
+
const queue = new QueueBuilder()
|
|
153
|
+
.queue('devices')
|
|
154
|
+
.envelope(false)
|
|
155
|
+
.message(messageSchema)
|
|
156
|
+
.handle(({ messages }) => {
|
|
157
|
+
seen.push(messages);
|
|
158
|
+
});
|
|
159
|
+
const adaptor = new AWSLambdaQueue(new EnvironmentParser({}), queue);
|
|
160
|
+
|
|
161
|
+
return adaptor
|
|
162
|
+
.handler(createEvent(bodies), context, () => {})
|
|
163
|
+
.then((response) => ({ seen, response }));
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
it('keeps a body with its own payload field whole', async () => {
|
|
167
|
+
const { seen, response } = await runRawQueue(deviceSchema, [
|
|
168
|
+
DEVICE_MESSAGE,
|
|
169
|
+
]);
|
|
170
|
+
|
|
171
|
+
expect(response).toEqual({ batchItemFailures: [] });
|
|
172
|
+
expect(seen).toEqual([[DEVICE_MESSAGE]]);
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
it('passes a body that is not JSON through as a string', async () => {
|
|
176
|
+
const { seen } = await runRawQueue(z.string(), ['not,json']);
|
|
177
|
+
|
|
178
|
+
expect(seen).toEqual([['not,json']]);
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it('unwraps the same body when the queue keeps its envelope', async () => {
|
|
182
|
+
const seen: unknown[][] = [];
|
|
183
|
+
const queue = new QueueBuilder()
|
|
184
|
+
.queue('devices')
|
|
185
|
+
.message(z.string())
|
|
186
|
+
.handle(({ messages }) => {
|
|
187
|
+
seen.push(messages);
|
|
188
|
+
});
|
|
189
|
+
const adaptor = new AWSLambdaQueue(new EnvironmentParser({}), queue);
|
|
190
|
+
|
|
191
|
+
await adaptor.handler(createEvent([DEVICE_MESSAGE]), context, () => {});
|
|
192
|
+
|
|
193
|
+
expect(seen).toEqual([[DEVICE_MESSAGE.payload]]);
|
|
194
|
+
});
|
|
195
|
+
});
|
|
131
196
|
});
|
|
@@ -52,6 +52,25 @@ describe('QueueBuilder', () => {
|
|
|
52
52
|
expect(queue.fifo).toBe(true);
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
+
it('marks a queue FIFO with the group each message is sent in', () => {
|
|
56
|
+
const groupId = (message: { orderId: string }) => message.orderId;
|
|
57
|
+
const queue = new QueueBuilder()
|
|
58
|
+
.queue('orders')
|
|
59
|
+
.message(schema)
|
|
60
|
+
.fifo({ groupId })
|
|
61
|
+
.handle(async () => {});
|
|
62
|
+
|
|
63
|
+
expect(queue.fifo).toBe(true);
|
|
64
|
+
expect(queue.groupId).toBe(groupId);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('keeps the envelope unless told otherwise', () => {
|
|
68
|
+
const base = new QueueBuilder().queue('jobs').message(schema);
|
|
69
|
+
|
|
70
|
+
expect(base.handle(async () => {}).envelope).toBe(true);
|
|
71
|
+
expect(base.envelope(false).handle(async () => {}).envelope).toBe(false);
|
|
72
|
+
});
|
|
73
|
+
|
|
55
74
|
it('throws when the name is missing', () => {
|
|
56
75
|
expect(() =>
|
|
57
76
|
new QueueBuilder().message(schema).handle(async () => {}),
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Queue-915lgS2D.mjs","names":["DEFAULT_LOGGER","obj: unknown","name: TName","handler: QueueHandler<TMessage, TServices, TLogger>","messageSchema: TMessage","timeout: number","services: TServices","logger: TLogger","batchSize?: number","fifo?: boolean","value: unknown"],"sources":["../src/queue/Queue.ts"],"sourcesContent":["import { environmentCase } from '@geekmidas/envkit';\nimport {\n\ttype EventPublisher,\n\ttype EventPublisherConnectionString,\n\ttype PublishableMessage,\n\tPublisher,\n} from '@geekmidas/events';\nimport type { Logger } from '@geekmidas/logger';\nimport { ConsoleLogger } from '@geekmidas/logger/console';\nimport type { InferStandardSchema } from '@geekmidas/schema';\nimport type { Service, ServiceRecord } from '@geekmidas/services';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport { Construct, ConstructType } from '../Construct';\n\nconst DEFAULT_LOGGER = new ConsoleLogger() as unknown as Logger;\n\n/**\n * The wire message a queue carries: `{ type: <queue name>, payload: <message> }`.\n * The producer publishes this shape and the worker receives the `payload`s as\n * its `messages`. Typing `type` to the queue name keeps the publisher fully\n * typed and lets pg-boss (local) / SQS (deployed) route by name.\n */\nexport type QueueMessage<\n\tTName extends string,\n\tTMessage extends StandardSchemaV1,\n> = PublishableMessage<TName, InferStandardSchema<TMessage>>;\n\n/**\n * A queue worker — a point-to-point SQS-style queue and its single consumer.\n * Unlike a `Subscriber` (topic fan-out, filtered by `subscribedEvents`), a queue\n * drains every message of its one `message` type. Build one with `q` (see\n * `QueueBuilder`); `gkm build` discovers it into the manifest's `queues` field.\n *\n * The producer side is {@link Queue.publisher} — a ready-to-inject `Service`\n * that any endpoint/function drops into `.services([...])` to send messages.\n */\nexport class Queue<\n\tTName extends string = string,\n\tTMessage extends StandardSchemaV1 = StandardSchemaV1,\n\tTServices extends Service[] = [],\n\tTLogger extends Logger = Logger,\n> extends Construct<TLogger, string, undefined, undefined, TServices> {\n\t__IS_QUEUE__ = true;\n\n\tstatic isQueue(\n\t\tobj: unknown,\n\t): obj is Queue<string, StandardSchemaV1, Service[], Logger> {\n\t\treturn Boolean(\n\t\t\tobj &&\n\t\t\t\t(obj as { __IS_QUEUE__?: boolean }).__IS_QUEUE__ === true &&\n\t\t\t\t(obj as Construct).type === ConstructType.Queue,\n\t\t);\n\t}\n\n\tconstructor(\n\t\tpublic readonly name: TName,\n\t\tpublic readonly handler: QueueHandler<TMessage, TServices, TLogger>,\n\t\tpublic readonly messageSchema: TMessage,\n\t\tpublic override readonly timeout: number = 30000,\n\t\tpublic override readonly services: TServices = [] as unknown as TServices,\n\t\tpublic override readonly logger: TLogger = DEFAULT_LOGGER as TLogger,\n\t\t/** SQS event-source batch size (deployed). */\n\t\tpublic readonly batchSize?: number,\n\t\t/** Whether the queue is FIFO (deployed). */\n\t\tpublic readonly fifo?: boolean,\n\t) {\n\t\tsuper(\n\t\t\tConstructType.Queue,\n\t\t\tlogger,\n\t\t\tservices,\n\t\t\t[],\n\t\t\tundefined,\n\t\t\tundefined,\n\t\t\ttimeout,\n\t\t);\n\t}\n\n\t/**\n\t * The producer side — a `Service` exposing an `EventPublisher` typed to this\n\t * queue's message. Inject it via `.services([queue.publisher])`; the handler\n\t * then calls `services.<name>Publisher.publish([{ type, payload }])`.\n\t *\n\t * It reads `<NAME>_PUBLISHER_CONNECTION_STRING` and builds the transport from\n\t * the URL protocol — `pgboss://` locally, `sqs://` deployed — so the same\n\t * code publishes to Postgres in dev and SQS in prod. Because it's a `Service`,\n\t * `Construct.getEnvironment()` sniffs it, so the env requirement flows into\n\t * the manifest and infra links exactly this queue with least privilege.\n\t */\n\tget publisher(): Service<\n\t\t`${TName}Publisher`,\n\t\tEventPublisher<QueueMessage<TName, TMessage>>\n\t> {\n\t\tconst envVar = `${environmentCase(this.name)}_PUBLISHER_CONNECTION_STRING`;\n\t\treturn {\n\t\t\tserviceName: `${this.name}Publisher`,\n\t\t\tasync register({ envParser }) {\n\t\t\t\tconst { connectionString } = envParser\n\t\t\t\t\t.create((get) => ({\n\t\t\t\t\t\tconnectionString: get(envVar).string(),\n\t\t\t\t\t}))\n\t\t\t\t\t.parse();\n\n\t\t\t\treturn Publisher.fromConnectionString<QueueMessage<TName, TMessage>>(\n\t\t\t\t\tconnectionString as EventPublisherConnectionString,\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t}\n}\n\n/**\n * One message in a batch, with the id its transport gave it: the SQS message id\n * deployed, a generated id locally. The id is what a handler returns in\n * {@link QueueResult} to have that message retried.\n */\nexport type QueueRecord<TMessage extends StandardSchemaV1> = {\n\tid: string;\n\tmessage: InferStandardSchema<TMessage>;\n};\n\n/**\n * What a handler returns to retry only part of a batch: the ids of the records\n * that failed. The rest are acknowledged. Throwing instead retries the whole\n * batch.\n */\nexport type QueueResult = {\n\tfailed: readonly string[];\n};\n\n/** Whether a handler's return value reports failed records. */\nexport function isQueueResult(value: unknown): value is QueueResult {\n\treturn Boolean(\n\t\tvalue &&\n\t\t\ttypeof value === 'object' &&\n\t\t\tArray.isArray((value as { failed?: unknown }).failed),\n\t);\n}\n\n/**\n * The context a queue handler receives — a batch of typed messages.\n *\n * `messages` and `records` are the same batch in the same order; `records`\n * carries each message's id, for a handler that reports failures per message.\n */\nexport type QueueContext<\n\tTMessage extends StandardSchemaV1,\n\tTServices extends Service[] = [],\n\tTLogger extends Logger = Logger,\n> = {\n\tmessages: InferStandardSchema<TMessage>[];\n\trecords: QueueRecord<TMessage>[];\n\tservices: ServiceRecord<TServices>;\n\tlogger: TLogger;\n};\n\nexport type QueueHandler<\n\tTMessage extends StandardSchemaV1,\n\tTServices extends Service[] = [],\n\tTLogger extends Logger = Logger,\n> = (\n\tctx: QueueContext<TMessage, TServices, TLogger>,\n) => unknown | Promise<unknown>;\n"],"mappings":";;;;;;AAcA,MAAMA,mBAAiB,IAAI;;;;;;;;;;AAsB3B,IAAa,QAAb,cAKU,UAA4D;CACrE,eAAe;CAEf,OAAO,QACNC,KAC4D;AAC5D,SAAO,QACN,OACE,IAAmC,iBAAiB,QACpD,IAAkB,SAAS,cAAc,MAC3C;CACD;CAED,YACiBC,MACAC,SACAC,eACSC,UAAkB,KAClBC,WAAsB,CAAE,GACxBC,SAAkBP,kBAE3BQ,WAEAC,MACf;AACD,QACC,cAAc,OACd,QACA,UACA,CAAE,mBAGF,QACA;EAnBe;EACA;EACA;EACS;EACA;EACA;EAET;EAEA;CAWhB;;;;;;;;;;;;CAaD,IAAI,YAGF;EACD,MAAM,UAAU,EAAE,gBAAgB,KAAK,KAAK,CAAC;AAC7C,SAAO;GACN,cAAc,EAAE,KAAK,KAAK;GAC1B,MAAM,SAAS,EAAE,WAAW,EAAE;IAC7B,MAAM,EAAE,kBAAkB,GAAG,UAC3B,OAAO,CAAC,SAAS,EACjB,kBAAkB,IAAI,OAAO,CAAC,QAAQ,CACtC,GAAE,CACF,OAAO;AAET,WAAO,UAAU,qBAChB,iBACA;GACD;EACD;CACD;AACD;;AAsBD,SAAgB,cAAcC,OAAsC;AACnE,QAAO,QACN,gBACQ,UAAU,YACjB,MAAM,QAAS,MAA+B,OAAO,CACtD;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Queue-HbdYCQ-X.cjs","names":["ConsoleLogger","Construct","obj: unknown","ConstructType","name: TName","handler: QueueHandler<TMessage, TServices, TLogger>","messageSchema: TMessage","timeout: number","services: TServices","logger: TLogger","batchSize?: number","fifo?: boolean","value: unknown"],"sources":["../src/queue/Queue.ts"],"sourcesContent":["import { environmentCase } from '@geekmidas/envkit';\nimport {\n\ttype EventPublisher,\n\ttype EventPublisherConnectionString,\n\ttype PublishableMessage,\n\tPublisher,\n} from '@geekmidas/events';\nimport type { Logger } from '@geekmidas/logger';\nimport { ConsoleLogger } from '@geekmidas/logger/console';\nimport type { InferStandardSchema } from '@geekmidas/schema';\nimport type { Service, ServiceRecord } from '@geekmidas/services';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport { Construct, ConstructType } from '../Construct';\n\nconst DEFAULT_LOGGER = new ConsoleLogger() as unknown as Logger;\n\n/**\n * The wire message a queue carries: `{ type: <queue name>, payload: <message> }`.\n * The producer publishes this shape and the worker receives the `payload`s as\n * its `messages`. Typing `type` to the queue name keeps the publisher fully\n * typed and lets pg-boss (local) / SQS (deployed) route by name.\n */\nexport type QueueMessage<\n\tTName extends string,\n\tTMessage extends StandardSchemaV1,\n> = PublishableMessage<TName, InferStandardSchema<TMessage>>;\n\n/**\n * A queue worker — a point-to-point SQS-style queue and its single consumer.\n * Unlike a `Subscriber` (topic fan-out, filtered by `subscribedEvents`), a queue\n * drains every message of its one `message` type. Build one with `q` (see\n * `QueueBuilder`); `gkm build` discovers it into the manifest's `queues` field.\n *\n * The producer side is {@link Queue.publisher} — a ready-to-inject `Service`\n * that any endpoint/function drops into `.services([...])` to send messages.\n */\nexport class Queue<\n\tTName extends string = string,\n\tTMessage extends StandardSchemaV1 = StandardSchemaV1,\n\tTServices extends Service[] = [],\n\tTLogger extends Logger = Logger,\n> extends Construct<TLogger, string, undefined, undefined, TServices> {\n\t__IS_QUEUE__ = true;\n\n\tstatic isQueue(\n\t\tobj: unknown,\n\t): obj is Queue<string, StandardSchemaV1, Service[], Logger> {\n\t\treturn Boolean(\n\t\t\tobj &&\n\t\t\t\t(obj as { __IS_QUEUE__?: boolean }).__IS_QUEUE__ === true &&\n\t\t\t\t(obj as Construct).type === ConstructType.Queue,\n\t\t);\n\t}\n\n\tconstructor(\n\t\tpublic readonly name: TName,\n\t\tpublic readonly handler: QueueHandler<TMessage, TServices, TLogger>,\n\t\tpublic readonly messageSchema: TMessage,\n\t\tpublic override readonly timeout: number = 30000,\n\t\tpublic override readonly services: TServices = [] as unknown as TServices,\n\t\tpublic override readonly logger: TLogger = DEFAULT_LOGGER as TLogger,\n\t\t/** SQS event-source batch size (deployed). */\n\t\tpublic readonly batchSize?: number,\n\t\t/** Whether the queue is FIFO (deployed). */\n\t\tpublic readonly fifo?: boolean,\n\t) {\n\t\tsuper(\n\t\t\tConstructType.Queue,\n\t\t\tlogger,\n\t\t\tservices,\n\t\t\t[],\n\t\t\tundefined,\n\t\t\tundefined,\n\t\t\ttimeout,\n\t\t);\n\t}\n\n\t/**\n\t * The producer side — a `Service` exposing an `EventPublisher` typed to this\n\t * queue's message. Inject it via `.services([queue.publisher])`; the handler\n\t * then calls `services.<name>Publisher.publish([{ type, payload }])`.\n\t *\n\t * It reads `<NAME>_PUBLISHER_CONNECTION_STRING` and builds the transport from\n\t * the URL protocol — `pgboss://` locally, `sqs://` deployed — so the same\n\t * code publishes to Postgres in dev and SQS in prod. Because it's a `Service`,\n\t * `Construct.getEnvironment()` sniffs it, so the env requirement flows into\n\t * the manifest and infra links exactly this queue with least privilege.\n\t */\n\tget publisher(): Service<\n\t\t`${TName}Publisher`,\n\t\tEventPublisher<QueueMessage<TName, TMessage>>\n\t> {\n\t\tconst envVar = `${environmentCase(this.name)}_PUBLISHER_CONNECTION_STRING`;\n\t\treturn {\n\t\t\tserviceName: `${this.name}Publisher`,\n\t\t\tasync register({ envParser }) {\n\t\t\t\tconst { connectionString } = envParser\n\t\t\t\t\t.create((get) => ({\n\t\t\t\t\t\tconnectionString: get(envVar).string(),\n\t\t\t\t\t}))\n\t\t\t\t\t.parse();\n\n\t\t\t\treturn Publisher.fromConnectionString<QueueMessage<TName, TMessage>>(\n\t\t\t\t\tconnectionString as EventPublisherConnectionString,\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t}\n}\n\n/**\n * One message in a batch, with the id its transport gave it: the SQS message id\n * deployed, a generated id locally. The id is what a handler returns in\n * {@link QueueResult} to have that message retried.\n */\nexport type QueueRecord<TMessage extends StandardSchemaV1> = {\n\tid: string;\n\tmessage: InferStandardSchema<TMessage>;\n};\n\n/**\n * What a handler returns to retry only part of a batch: the ids of the records\n * that failed. The rest are acknowledged. Throwing instead retries the whole\n * batch.\n */\nexport type QueueResult = {\n\tfailed: readonly string[];\n};\n\n/** Whether a handler's return value reports failed records. */\nexport function isQueueResult(value: unknown): value is QueueResult {\n\treturn Boolean(\n\t\tvalue &&\n\t\t\ttypeof value === 'object' &&\n\t\t\tArray.isArray((value as { failed?: unknown }).failed),\n\t);\n}\n\n/**\n * The context a queue handler receives — a batch of typed messages.\n *\n * `messages` and `records` are the same batch in the same order; `records`\n * carries each message's id, for a handler that reports failures per message.\n */\nexport type QueueContext<\n\tTMessage extends StandardSchemaV1,\n\tTServices extends Service[] = [],\n\tTLogger extends Logger = Logger,\n> = {\n\tmessages: InferStandardSchema<TMessage>[];\n\trecords: QueueRecord<TMessage>[];\n\tservices: ServiceRecord<TServices>;\n\tlogger: TLogger;\n};\n\nexport type QueueHandler<\n\tTMessage extends StandardSchemaV1,\n\tTServices extends Service[] = [],\n\tTLogger extends Logger = Logger,\n> = (\n\tctx: QueueContext<TMessage, TServices, TLogger>,\n) => unknown | Promise<unknown>;\n"],"mappings":";;;;;;AAcA,MAAM,iBAAiB,IAAIA;;;;;;;;;;AAsB3B,IAAa,QAAb,cAKUC,4BAA4D;CACrE,eAAe;CAEf,OAAO,QACNC,KAC4D;AAC5D,SAAO,QACN,OACE,IAAmC,iBAAiB,QACpD,IAAkB,SAASC,gCAAc,MAC3C;CACD;CAED,YACiBC,MACAC,SACAC,eACSC,UAAkB,KAClBC,WAAsB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