@auriclabs/events 0.1.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.
@@ -0,0 +1,377 @@
1
+ import { PaginationResponse } from "@auriclabs/pagination";
2
+ import { Writable } from "node:stream";
3
+
4
+ //#region src/types.d.ts
5
+ type Brand<T, B extends string> = T & {
6
+ readonly __brand: B;
7
+ };
8
+ type Source = Brand<string, 'Source'>;
9
+ type AggregateId = Brand<string, 'AggregateId'>;
10
+ type AggregateType = Brand<string, 'AggregateType'>;
11
+ type EventId = Brand<string, 'EventId'>;
12
+ type AggregatePK = `AGG#${string}#${string}`;
13
+ type EventSK = `EVT#${string}` | 'HEAD';
14
+ type ItemType = 'event' | 'head';
15
+ interface EventRecord<P = unknown> {
16
+ /** DynamoDB keys */
17
+ pk: AggregatePK;
18
+ sk: EventSK;
19
+ itemType: Extract<ItemType, 'event'>;
20
+ /** Aggregate routing */
21
+ source: Source;
22
+ aggregateId: AggregateId;
23
+ aggregateType: AggregateType;
24
+ version: number;
25
+ /** Event identity & semantics */
26
+ eventId: EventId;
27
+ eventType: string;
28
+ schemaVersion?: number;
29
+ occurredAt: string;
30
+ /** Tracing (optional) */
31
+ correlationId?: string;
32
+ causationId?: string;
33
+ actorId?: string;
34
+ /** Domain payload */
35
+ payload: Readonly<P>;
36
+ }
37
+ interface AggregateHead {
38
+ /** DynamoDB keys */
39
+ pk: AggregatePK;
40
+ sk: 'HEAD';
41
+ itemType: Extract<ItemType, 'head'>;
42
+ /** Aggregate identity */
43
+ aggregateId: AggregateId;
44
+ aggregateType: AggregateType;
45
+ /** Version tracking */
46
+ currentVersion: number;
47
+ /** Idempotency/debug */
48
+ lastEventId?: EventId;
49
+ lastIdemKey?: string;
50
+ updatedAt: string;
51
+ }
52
+ type EventHandlers = Record<string, ((event: EventRecord<any>) => Promise<void> | void) | string>;
53
+ //#endregion
54
+ //#region src/event-service.d.ts
55
+ interface AppendArgs<P = unknown> {
56
+ aggregateType: string;
57
+ aggregateId: string;
58
+ source: string;
59
+ /** Version you observed before appending (0 for brand new) */
60
+ expectedVersion: number;
61
+ /** Required for idempotent retries (e.g., the command id) */
62
+ idempotencyKey: string;
63
+ eventId: string;
64
+ eventType: string;
65
+ occurredAt?: string;
66
+ payload?: Readonly<P>;
67
+ schemaVersion?: number;
68
+ correlationId?: string;
69
+ causationId?: string;
70
+ actorId?: string;
71
+ }
72
+ interface AppendEventResult {
73
+ pk: string;
74
+ sk: string;
75
+ version: number;
76
+ }
77
+ interface EventService {
78
+ appendEvent<P = unknown>(args: AppendArgs<P>): Promise<AppendEventResult>;
79
+ getHead(aggregateType: string, aggregateId: string): Promise<AggregateHead | undefined>;
80
+ getEvent(aggregateType: string, aggregateId: string, version: number): Promise<EventRecord | undefined>;
81
+ listEvents(params: {
82
+ aggregateType: string;
83
+ aggregateId: string;
84
+ fromVersionExclusive?: number;
85
+ toVersionInclusive?: number;
86
+ limit?: number;
87
+ }): Promise<PaginationResponse<EventRecord>>;
88
+ }
89
+ declare function createEventService(tableName: string): EventService;
90
+ //#endregion
91
+ //#region src/init.d.ts
92
+ declare function initEvents(config: {
93
+ tableName: string;
94
+ }): void;
95
+ declare function getEventService(): EventService;
96
+ //#endregion
97
+ //#region src/context.d.ts
98
+ type EventContext = Partial<AppendArgs>;
99
+ declare const setEventContext: (newContext: EventContext) => void;
100
+ declare const getEventContext: () => Partial<AppendArgs<unknown>>;
101
+ declare const resetEventContext: () => void;
102
+ declare const appendEventContext: (event: EventContext) => void;
103
+ //#endregion
104
+ //#region src/dispatch-event.d.ts
105
+ type DispatchEventArgs = Omit<AppendArgs, 'eventId' | 'expectedVersion' | 'schemaVersion' | 'occurredAt' | 'idempotencyKey'> & Partial<Pick<AppendArgs, 'idempotencyKey' | 'eventId'>>;
106
+ declare const dispatchEvent: (event: DispatchEventArgs) => Promise<AppendEventResult>;
107
+ //#endregion
108
+ //#region src/dispatch-events.d.ts
109
+ interface DispatchEventsArgs {
110
+ inOrder?: boolean;
111
+ }
112
+ declare const dispatchEvents: (events: DispatchEventArgs[], {
113
+ inOrder
114
+ }?: DispatchEventsArgs) => Promise<void>;
115
+ //#endregion
116
+ //#region src/create-dispatch.d.ts
117
+ type MakePartial<T, O> = Omit<T, keyof O> & Partial<O>;
118
+ type DispatchRecord<Options extends Partial<DispatchEventArgs> = Partial<DispatchEventArgs>> = Record<string, (...args: any[]) => ValueOrFactoryRecord<MakePartial<DispatchEventArgs, Options>> | DispatchEventArgsFactory<Options>>;
119
+ type ValueOrFactory<T> = T | ((context: EventContext) => T);
120
+ type ValueOrFactoryRecord<T> = { [K in keyof T]: ValueOrFactory<T[K]> };
121
+ type DispatchEventArgsFactory<Options extends Partial<DispatchEventArgs>> = (context: EventContext) => MakePartial<DispatchEventArgs, Options>;
122
+ type DispatchRecordResponse<R extends DispatchRecord<O>, O extends Partial<DispatchEventArgs>> = { [K in keyof R]: (...args: Parameters<R[K]>) => Promise<AppendEventResult> };
123
+ declare function createDispatch<DR extends DispatchRecord<O>, O extends Partial<DispatchEventArgs>>(record: DR, optionsOrFactory?: ValueOrFactoryRecord<O> | ((context: EventContext) => O)): DispatchRecordResponse<DR, O>;
124
+ //#endregion
125
+ //#region ../../node_modules/.pnpm/@types+aws-lambda@8.10.152/node_modules/@types/aws-lambda/handler.d.ts
126
+ /**
127
+ * {@link Handler} context parameter.
128
+ * See {@link https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html AWS documentation}.
129
+ */
130
+ interface Context {
131
+ callbackWaitsForEmptyEventLoop: boolean;
132
+ functionName: string;
133
+ functionVersion: string;
134
+ invokedFunctionArn: string;
135
+ memoryLimitInMB: string;
136
+ awsRequestId: string;
137
+ logGroupName: string;
138
+ logStreamName: string;
139
+ identity?: CognitoIdentity | undefined;
140
+ clientContext?: ClientContext | undefined;
141
+ tenantId?: string | undefined;
142
+ getRemainingTimeInMillis(): number; // Functions for compatibility with earlier Node.js Runtime v0.10.42
143
+ // No longer documented, so they are deprecated, but they still work
144
+ // as of the 12.x runtime, so they are not removed from the types.
145
+ /** @deprecated Use handler callback or promise result */
146
+ done(error?: Error, result?: any): void;
147
+ /** @deprecated Use handler callback with first argument or reject a promise result */
148
+ fail(error: Error | string): void;
149
+ /** @deprecated Use handler callback with second argument or resolve a promise result */
150
+ succeed(messageOrObject: any): void; // Unclear what behavior this is supposed to have, I couldn't find any still extant reference,
151
+ // and it behaves like the above, ignoring the object parameter.
152
+ /** @deprecated Use handler callback or promise result */
153
+ succeed(message: string, object: any): void;
154
+ }
155
+ interface CognitoIdentity {
156
+ cognitoIdentityId: string;
157
+ cognitoIdentityPoolId: string;
158
+ }
159
+ interface ClientContext {
160
+ client: ClientContextClient;
161
+ Custom?: any;
162
+ env: ClientContextEnv;
163
+ }
164
+ interface ClientContextClient {
165
+ installationId: string;
166
+ appTitle: string;
167
+ appVersionName: string;
168
+ appVersionCode: string;
169
+ appPackageName: string;
170
+ }
171
+ interface ClientContextEnv {
172
+ platformVersion: string;
173
+ platform: string;
174
+ make: string;
175
+ model: string;
176
+ locale: string;
177
+ }
178
+ /**
179
+ * Interface for using response streaming from AWS Lambda.
180
+ * To indicate to the runtime that Lambda should stream your function’s responses, you must wrap your function handler with the `awslambda.streamifyResponse()` decorator.
181
+ *
182
+ * The `streamifyResponse` decorator accepts the following additional parameter, `responseStream`, besides the default node handler parameters, `event`, and `context`.
183
+ * The new `responseStream` object provides a stream object that your function can write data to. Data written to this stream is sent immediately to the client. You can optionally set the Content-Type header of the response to pass additional metadata to your client about the contents of the stream.
184
+ *
185
+ * {@link https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/ AWS blog post}
186
+ * {@link https://docs.aws.amazon.com/lambda/latest/dg/config-rs-write-functions.html AWS documentation}
187
+ *
188
+ * @example <caption>Writing to the response stream</caption>
189
+ * import 'aws-lambda';
190
+ *
191
+ * export const handler = awslambda.streamifyResponse(
192
+ * async (event, responseStream, context) => {
193
+ * responseStream.setContentType("text/plain");
194
+ * responseStream.write("Hello, world!");
195
+ * responseStream.end();
196
+ * }
197
+ * );
198
+ *
199
+ * @example <caption>Using pipeline</caption>
200
+ * import 'aws-lambda';
201
+ * import { Readable } from 'stream';
202
+ * import { pipeline } from 'stream/promises';
203
+ * import zlib from 'zlib';
204
+ *
205
+ * export const handler = awslambda.streamifyResponse(
206
+ * async (event, responseStream, context) => {
207
+ * // As an example, convert event to a readable stream.
208
+ * const requestStream = Readable.from(Buffer.from(JSON.stringify(event)));
209
+ *
210
+ * await pipeline(requestStream, zlib.createGzip(), responseStream);
211
+ * }
212
+ * );
213
+ */
214
+ type StreamifyHandler<TEvent = any, TResult = any> = (event: TEvent, responseStream: awslambda.HttpResponseStream, context: Context) => TResult | Promise<TResult>;
215
+ declare global {
216
+ namespace awslambda {
217
+ class HttpResponseStream extends Writable {
218
+ static from(writable: Writable, metadata: Record<string, unknown>): HttpResponseStream;
219
+ setContentType: (contentType: string) => void;
220
+ }
221
+ /**
222
+ * Decorator for using response streaming from AWS Lambda.
223
+ * To indicate to the runtime that Lambda should stream your function’s responses, you must wrap your function handler with the `awslambda.streamifyResponse()` decorator.
224
+ *
225
+ * The `streamifyResponse` decorator accepts the following additional parameter, `responseStream`, besides the default node handler parameters, `event`, and `context`.
226
+ * The new `responseStream` object provides a stream object that your function can write data to. Data written to this stream is sent immediately to the client. You can optionally set the Content-Type header of the response to pass additional metadata to your client about the contents of the stream.
227
+ *
228
+ * {@link https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/ AWS blog post}
229
+ * {@link https://docs.aws.amazon.com/lambda/latest/dg/config-rs-write-functions.html AWS documentation}
230
+ *
231
+ * @example <caption>Writing to the response stream</caption>
232
+ * import 'aws-lambda';
233
+ *
234
+ * export const handler = awslambda.streamifyResponse(
235
+ * async (event, responseStream, context) => {
236
+ * responseStream.setContentType("text/plain");
237
+ * responseStream.write("Hello, world!");
238
+ * responseStream.end();
239
+ * }
240
+ * );
241
+ *
242
+ * @example <caption>Using pipeline</caption>
243
+ * import 'aws-lambda';
244
+ * import { Readable } from 'stream';
245
+ * import { pipeline } from 'stream/promises';
246
+ * import zlib from 'zlib';
247
+ *
248
+ * export const handler = awslambda.streamifyResponse(
249
+ * async (event, responseStream, context) => {
250
+ * // As an example, convert event to a readable stream.
251
+ * const requestStream = Readable.from(Buffer.from(JSON.stringify(event)));
252
+ *
253
+ * await pipeline(requestStream, zlib.createGzip(), responseStream);
254
+ * }
255
+ * );
256
+ */
257
+ function streamifyResponse<TEvent = any, TResult = void>(handler: StreamifyHandler<TEvent, TResult>): StreamifyHandler<TEvent, TResult>;
258
+ }
259
+ }
260
+ //#endregion
261
+ //#region ../../node_modules/.pnpm/@types+aws-lambda@8.10.152/node_modules/@types/aws-lambda/trigger/dynamodb-stream.d.ts
262
+ // http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_AttributeValue.html
263
+ interface AttributeValue {
264
+ B?: string | undefined;
265
+ BS?: string[] | undefined;
266
+ BOOL?: boolean | undefined;
267
+ L?: AttributeValue[] | undefined;
268
+ M?: {
269
+ [id: string]: AttributeValue;
270
+ } | undefined;
271
+ N?: string | undefined;
272
+ NS?: string[] | undefined;
273
+ NULL?: boolean | undefined;
274
+ S?: string | undefined;
275
+ SS?: string[] | undefined;
276
+ }
277
+ // http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_StreamRecord.html
278
+ interface StreamRecord {
279
+ ApproximateCreationDateTime?: number | undefined;
280
+ Keys?: {
281
+ [key: string]: AttributeValue;
282
+ } | undefined;
283
+ NewImage?: {
284
+ [key: string]: AttributeValue;
285
+ } | undefined;
286
+ OldImage?: {
287
+ [key: string]: AttributeValue;
288
+ } | undefined;
289
+ SequenceNumber?: string | undefined;
290
+ SizeBytes?: number | undefined;
291
+ StreamViewType?: "KEYS_ONLY" | "NEW_IMAGE" | "OLD_IMAGE" | "NEW_AND_OLD_IMAGES" | undefined;
292
+ }
293
+ // http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_Record.html
294
+ interface DynamoDBRecord {
295
+ awsRegion?: string | undefined;
296
+ dynamodb?: StreamRecord | undefined;
297
+ eventID?: string | undefined;
298
+ eventName?: "INSERT" | "MODIFY" | "REMOVE" | undefined;
299
+ eventSource?: string | undefined;
300
+ eventSourceARN?: string | undefined;
301
+ eventVersion?: string | undefined;
302
+ userIdentity?: any;
303
+ }
304
+ // http://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-ddb-update
305
+ interface DynamoDBStreamEvent {
306
+ Records: DynamoDBRecord[];
307
+ }
308
+ //#endregion
309
+ //#region ../../node_modules/.pnpm/@types+aws-lambda@8.10.152/node_modules/@types/aws-lambda/trigger/sqs.d.ts
310
+ // SQS
311
+ // https://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html#supported-event-source-sqs
312
+ interface SQSRecord {
313
+ messageId: string;
314
+ receiptHandle: string;
315
+ body: string;
316
+ attributes: SQSRecordAttributes;
317
+ messageAttributes: SQSMessageAttributes;
318
+ md5OfBody: string;
319
+ md5OfMessageAttributes?: string;
320
+ eventSource: string;
321
+ eventSourceARN: string;
322
+ awsRegion: string;
323
+ }
324
+ interface SQSEvent {
325
+ Records: SQSRecord[];
326
+ }
327
+ interface SQSRecordAttributes {
328
+ AWSTraceHeader?: string | undefined;
329
+ ApproximateReceiveCount: string;
330
+ SentTimestamp: string;
331
+ SenderId: string;
332
+ ApproximateFirstReceiveTimestamp: string;
333
+ SequenceNumber?: string | undefined;
334
+ MessageGroupId?: string | undefined;
335
+ MessageDeduplicationId?: string | undefined;
336
+ DeadLetterQueueSourceArn?: string | undefined; // Undocumented, but used by AWS to support their re-drive functionality in the console
337
+ }
338
+ type SQSMessageAttributeDataType = "String" | "Number" | "Binary" | string;
339
+ interface SQSMessageAttribute {
340
+ stringValue?: string | undefined;
341
+ binaryValue?: string | undefined;
342
+ stringListValues?: string[] | undefined; // Not implemented. Reserved for future use.
343
+ binaryListValues?: string[] | undefined; // Not implemented. Reserved for future use.
344
+ dataType: SQSMessageAttributeDataType;
345
+ }
346
+ interface SQSMessageAttributes {
347
+ [name: string]: SQSMessageAttribute;
348
+ }
349
+ // https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-batchfailurereporting
350
+ interface SQSBatchResponse {
351
+ batchItemFailures: SQSBatchItemFailure[];
352
+ }
353
+ interface SQSBatchItemFailure {
354
+ itemIdentifier: string;
355
+ }
356
+ //#endregion
357
+ //#region src/create-event-listener.d.ts
358
+ interface CreateEventListenerOptions {
359
+ debug?: boolean;
360
+ }
361
+ declare const createEventListener: (eventHandlers: EventHandlers, {
362
+ debug
363
+ }?: CreateEventListenerOptions) => (sqsEvent: SQSEvent) => Promise<SQSBatchResponse>;
364
+ //#endregion
365
+ //#region src/stream-handler.d.ts
366
+ interface CreateStreamHandlerConfig {
367
+ busName: string;
368
+ queueUrls: string[];
369
+ }
370
+ /**
371
+ * Creates a Lambda handler for DynamoDB stream events.
372
+ * Processes INSERT events from the event store table and forwards them to SQS queues and EventBridge.
373
+ */
374
+ declare function createStreamHandler(config: CreateStreamHandlerConfig): (event: DynamoDBStreamEvent) => Promise<void>;
375
+ //#endregion
376
+ export { AggregateHead, AggregateId, AggregatePK, AggregateType, AppendArgs, AppendEventResult, Brand, CreateEventListenerOptions, CreateStreamHandlerConfig, DispatchEventArgs, DispatchEventArgsFactory, DispatchEventsArgs, DispatchRecord, DispatchRecordResponse, EventContext, EventHandlers, EventId, EventRecord, EventSK, EventService, ItemType, MakePartial, Source, ValueOrFactory, ValueOrFactoryRecord, appendEventContext, createDispatch, createEventListener, createEventService, createStreamHandler, dispatchEvent, dispatchEvents, getEventContext, getEventService, initEvents, resetEventContext, setEventContext };
377
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":["Writable","Handler","TEvent","TResult","Context","Callback","Promise","event","context","callback","CognitoIdentity","ClientContext","Error","callbackWaitsForEmptyEventLoop","functionName","functionVersion","invokedFunctionArn","memoryLimitInMB","awsRequestId","logGroupName","logStreamName","identity","clientContext","tenantId","getRemainingTimeInMillis","done","error","result","fail","succeed","messageOrObject","message","object","cognitoIdentityId","cognitoIdentityPoolId","ClientContextClient","ClientContextEnv","client","Custom","env","installationId","appTitle","appVersionName","appVersionCode","appPackageName","platformVersion","platform","make","model","locale","StreamifyHandler","awslambda","HttpResponseStream","responseStream","_0","Record","global","from","writable","metadata","setContentType","contentType","streamifyResponse","handler","sideEffect","Handler","DynamoDBStreamHandler","DynamoDBStreamEvent","DynamoDBBatchResponse","AttributeValue","B","BS","BOOL","L","M","id","N","NS","NULL","S","SS","StreamRecord","ApproximateCreationDateTime","Keys","key","NewImage","OldImage","SequenceNumber","SizeBytes","StreamViewType","DynamoDBRecord","awsRegion","dynamodb","eventID","eventName","eventSource","eventSourceARN","eventVersion","userIdentity","Records","DynamoDBBatchItemFailure","batchItemFailures","itemIdentifier","Handler","SQSHandler","SQSEvent","SQSBatchResponse","SQSRecord","SQSRecordAttributes","SQSMessageAttributes","messageId","receiptHandle","body","attributes","messageAttributes","md5OfBody","md5OfMessageAttributes","eventSource","eventSourceARN","awsRegion","Records","AWSTraceHeader","ApproximateReceiveCount","SentTimestamp","SenderId","ApproximateFirstReceiveTimestamp","SequenceNumber","MessageGroupId","MessageDeduplicationId","DeadLetterQueueSourceArn","SQSMessageAttributeDataType","SQSMessageAttribute","stringValue","binaryValue","stringListValues","binaryListValues","dataType","name","SQSBatchItemFailure","batchItemFailures","itemIdentifier"],"sources":["../src/types.ts","../src/event-service.ts","../src/init.ts","../src/context.ts","../src/dispatch-event.ts","../src/dispatch-events.ts","../src/create-dispatch.ts","../../../node_modules/.pnpm/@types+aws-lambda@8.10.152/node_modules/@types/aws-lambda/handler.d.ts","../../../node_modules/.pnpm/@types+aws-lambda@8.10.152/node_modules/@types/aws-lambda/trigger/dynamodb-stream.d.ts","../../../node_modules/.pnpm/@types+aws-lambda@8.10.152/node_modules/@types/aws-lambda/trigger/sqs.d.ts","../src/create-event-list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