lambda-toolkit 0.0.3-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,2541 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE__aws_sdk_client_athena_fac0b5e3__ from "@aws-sdk/client-athena";
2
+ import * as __WEBPACK_EXTERNAL_MODULE__aws_sdk_client_dynamodb_8ad5c6c3__ from "@aws-sdk/client-dynamodb";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__aws_sdk_client_lambda_45e15e4c__ from "@aws-sdk/client-lambda";
4
+ import * as __WEBPACK_EXTERNAL_MODULE__aws_sdk_client_s3_166f32a4__ from "@aws-sdk/client-s3";
5
+ import * as __WEBPACK_EXTERNAL_MODULE__aws_sdk_client_sesv2_6677e3b1__ from "@aws-sdk/client-sesv2";
6
+ import * as __WEBPACK_EXTERNAL_MODULE__aws_sdk_client_sns_aa88aa43__ from "@aws-sdk/client-sns";
7
+ import * as __WEBPACK_EXTERNAL_MODULE__aws_sdk_client_sqs_1f0ecae0__ from "@aws-sdk/client-sqs";
8
+ import * as __WEBPACK_EXTERNAL_MODULE__aws_sdk_client_ssm_6758df31__ from "@aws-sdk/client-ssm";
9
+ import * as __WEBPACK_EXTERNAL_MODULE__aws_sdk_client_timestream_query_1be755b6__ from "@aws-sdk/client-timestream-query";
10
+ import * as __WEBPACK_EXTERNAL_MODULE__aws_sdk_client_timestream_write_3c1b228d__ from "@aws-sdk/client-timestream-write";
11
+ import * as __WEBPACK_EXTERNAL_MODULE__aws_sdk_lib_dynamodb_4ad47c88__ from "@aws-sdk/lib-dynamodb";
12
+ import * as __WEBPACK_EXTERNAL_MODULE__aws_sdk_s3_request_presigner_c7ff9288__ from "@aws-sdk/s3-request-presigner";
13
+ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "node:module";
14
+ /******/ var __webpack_modules__ = ({
15
+
16
+ /***/ 8278:
17
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
18
+
19
+ const joinUnique = __webpack_require__( 2836 );
20
+ const joinUniqueCustom = __webpack_require__( 536 );
21
+ const splitBatches = __webpack_require__( 4821 );
22
+
23
+ module.exports = {
24
+ joinUnique,
25
+ joinUniqueCustom,
26
+ splitBatches
27
+ };
28
+
29
+
30
+ /***/ }),
31
+
32
+ /***/ 2836:
33
+ /***/ ((module) => {
34
+
35
+ module.exports = ( ...args ) => [ ...new Set( args.filter( Array.isArray ).flat() ) ];
36
+
37
+
38
+ /***/ }),
39
+
40
+ /***/ 536:
41
+ /***/ ((module) => {
42
+
43
+ module.exports = ( { key, items } ) => [
44
+ ...items.filter( Array.isArray ).flat().reduce( ( map, v ) => {
45
+ const k = key( v );
46
+ if ( !map.has( k ) ) {
47
+ map.set( k, v );
48
+ }
49
+ return map;
50
+ }, new Map() ).values()
51
+ ];
52
+
53
+
54
+ /***/ }),
55
+
56
+ /***/ 4821:
57
+ /***/ ((module) => {
58
+
59
+ module.exports = ( items, size ) => items.reduce( ( arrs, item ) =>
60
+ ( arrs[0] && arrs[0].length < size ) ?
61
+ [ [ ...arrs[0], item ] ].concat( arrs.slice( 1 ) ) :
62
+ [ [ item ] ].concat( arrs )
63
+ , [] ).reverse();
64
+
65
+
66
+ /***/ }),
67
+
68
+ /***/ 228:
69
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
70
+
71
+ const { AthenaClient } = __webpack_require__( 1448 );
72
+ const clientProvider = __webpack_require__( 9039 );
73
+ const query = __webpack_require__( 140 );
74
+ const createInstance = __webpack_require__( 5438 );
75
+
76
+ const methods = {
77
+ query
78
+ };
79
+
80
+ module.exports = createInstance( clientProvider.bind( null, AthenaClient ), methods );
81
+
82
+
83
+ /***/ }),
84
+
85
+ /***/ 7337:
86
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
87
+
88
+ const { GetQueryExecutionCommand, GetQueryResultsCommand } = __webpack_require__( 1448 );
89
+ const parseResults = __webpack_require__( 834 );
90
+ const pollingDelay = __webpack_require__( 4127 );
91
+
92
+ const sleep = t => new Promise( r => setTimeout( () => r(), t ) );
93
+
94
+ const getQueryResults = async ( { client, queryExecutionId, maxResults, token } ) => {
95
+ const { NextToken: nextToken, ResultSet } = await client.send( new GetQueryResultsCommand( {
96
+ ...{ QueryExecutionId: queryExecutionId },
97
+ ...( maxResults ? { MaxResults: maxResults } : {} ),
98
+ ...( token ? { NextToken: token } : {} )
99
+ } ) );
100
+
101
+ return { nextToken, items: parseResults( ResultSet ) };
102
+ };
103
+ const getQueryResultsRecursive = async ( { client, queryExecutionId, token } ) => {
104
+ const { nextToken, items } = await getQueryResults( { client, queryExecutionId, token } );
105
+
106
+ if ( nextToken ) {
107
+ return { items: items.concat( ( await getQueryResultsRecursive( { client, queryExecutionId, token: nextToken } ) ).items ) };
108
+ }
109
+ return { items };
110
+ };
111
+
112
+ /**
113
+ * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/athena/command/GetQueryResultsCommand/
114
+ * { client, recursive, queryExecutionId, maxResults, paginationToken }
115
+ */
116
+ const getResults = async ( { client, recursive, queryExecutionId, token, maxResults } ) => {
117
+ const { QueryExecution: { Status: status } } = await client.send( new GetQueryExecutionCommand( { QueryExecutionId: queryExecutionId } ) );
118
+
119
+ if ( status.State === 'FAILED' ) {
120
+ throw new Error( status.AthenaError?.ErrorMessage ?? status.StateChangeReason );
121
+ }
122
+
123
+ if ( status.State === 'SUCCEEDED' ) {
124
+ const fn = recursive ? getQueryResultsRecursive : getQueryResults;
125
+ return fn( { client, recursive, queryExecutionId, token, maxResults } );
126
+ }
127
+
128
+ // sleep an try again
129
+ await sleep( pollingDelay );
130
+ return getResults( { client, recursive, queryExecutionId, token, maxResults } );
131
+ };
132
+
133
+ module.exports = getResults;
134
+
135
+
136
+ /***/ }),
137
+
138
+ /***/ 834:
139
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
140
+
141
+ const parseValue = __webpack_require__( 9129 );
142
+
143
+ module.exports = resultSet => {
144
+ const columns = resultSet.ResultSetMetadata.ColumnInfo
145
+ .map( col => ( { name: col.Name, type: col.Type } ) );
146
+
147
+ // first data row contains the table field names
148
+ return resultSet.Rows.slice( 1 ).map( row => {
149
+ const values = row.Data.map( d => d.VarCharValue );
150
+ return columns.reduce( ( obj, p, i ) => Object.assign( obj, { [p.name]: parseValue( values[i], p.type ) } ), {} );
151
+ } );
152
+ };
153
+
154
+
155
+ /***/ }),
156
+
157
+ /***/ 9129:
158
+ /***/ ((module) => {
159
+
160
+ /* eslint consistent-return: 0 */
161
+ const removeNullValues = ( o, isArray = Array.isArray( o ) ) =>
162
+ Object.entries( o ).reduce( ( newObj, [ k, v ] ) => {
163
+ if ( v === null && !isArray ) { return newObj; }
164
+ return Object.assign( newObj, { [k]: v?.constructor === Object ? removeNullValues( v ) : v } );
165
+ }, isArray ? [] : {} );
166
+
167
+ module.exports = ( v, type ) => {
168
+ if ( [ null, undefined ].includes( v ) ) {
169
+ return undefined;
170
+ }
171
+ if ( v === '' && type !== 'varchar' ) {
172
+ return undefined;
173
+ }
174
+ if ( type === 'boolean' ) {
175
+ return v === 'true';
176
+ }
177
+ if ( [ 'float', 'decimal', 'double' ].includes( type ) ) {
178
+ return parseFloat( v );
179
+ }
180
+ if ( [ 'tinyint', 'smallint', 'int', 'bigint' ].includes( type ) ) {
181
+ return parseInt( v );
182
+ }
183
+ if ( 'timestamp' === type ) {
184
+ return new Date( v ).getTime();
185
+ }
186
+ if ( [ 'row', 'array' ].includes( type ) ) {
187
+ const obj = v.replace( /(?<=(?:{|,\s)[\w-_]+)=/g, '@@DELIMITER@@' ) // replaces delimiter = with @@DELIMITER@@
188
+ .replace( /(?<={|,\s)([\w_-]+)(?=@@DELIMITER@@)/g, '"$1"' ) // wrap object keys
189
+ .replace( /(?<=@@DELIMITER@@)((?:(?!,\s|}|\[|{).)+)/g, '"$1"' ) // wrap object values
190
+ .replace( /(?<=\[|,\s)((?:(?!,\s|{|\]|").)+)/g, '"$1"' ) // wrap array values
191
+ .replace( /"null"/g, 'null' ) // convert "null" to null
192
+ .replace( /@@DELIMITER@@/g, ':' ); // replaces @@DELIMITER@@ for :
193
+
194
+ return removeNullValues( JSON.parse( obj ) );
195
+ }
196
+ if ( 'json' === type ) {
197
+ return JSON.parse( v );
198
+ }
199
+ return v;
200
+ };
201
+
202
+
203
+ /***/ }),
204
+
205
+ /***/ 4127:
206
+ /***/ ((module) => {
207
+
208
+ module.exports = 500;
209
+
210
+
211
+ /***/ }),
212
+
213
+ /***/ 5723:
214
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
215
+
216
+ const { randomBytes } = __webpack_require__( 6982 );
217
+ const { StartQueryExecutionCommand } = __webpack_require__( 1448 );
218
+
219
+ /**
220
+ * args : https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/athena/command/StartQueryExecutionCommand/
221
+ * A ClientRequestToken is created automatically
222
+ */
223
+ module.exports = async ( { client, ...args } ) => {
224
+ const cmd = new StartQueryExecutionCommand( {
225
+ ClientRequestToken: randomBytes( 16 ).toString( 'hex' ),
226
+ ...args
227
+ } );
228
+ const { QueryExecutionId: queryId } = await client.send( cmd );
229
+ return queryId;
230
+ };
231
+
232
+
233
+ /***/ }),
234
+
235
+ /***/ 140:
236
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
237
+
238
+ const { encode, decode } = __webpack_require__( 5744 );
239
+ const startQuery = __webpack_require__( 5723 );
240
+ const getResults = __webpack_require__( 7337 );
241
+
242
+ const getQueryExecutionId = async ( { client, nativeArgs, recursive, paginationToken } ) => {
243
+ if ( !recursive && paginationToken ) {
244
+ const { queryExecutionId, token } = decode( paginationToken );
245
+ return { queryExecutionId, token };
246
+ }
247
+
248
+ const queryExecutionId = await startQuery( { client, ...nativeArgs } );
249
+ return { queryExecutionId };
250
+ };
251
+
252
+ /**
253
+ * @class Result
254
+ * @type {Object}
255
+ * @property {Object[]} items Each query result row, parsed to a camelized js object
256
+ * @property {String} paginationToken The next pagination token, if recursive = false ans there are more results for the query
257
+ */
258
+
259
+ /**
260
+ * Executes an Athena Query
261
+ * @param {*} client The native client
262
+ * @param {Object} nativeArgs The native args to start the Athena Query
263
+ * @param {Object=} options Query configuration
264
+ * @param {Boolean=} [options.recursive=false] If to recursive query all results or to return a paginationToken after each page
265
+ * @param {String=} options.paginationToken The pagination token received in the previous call to resume the query (only used when recursive = false)
266
+ * @param {Number=} options.maxResults The maximum number of results per page (only when using pagination token)
267
+ * @returns {Result} The query result
268
+ */
269
+ module.exports = async ( client, nativeArgs, options ) => {
270
+ const { recursive = false, paginationToken, maxResults } = options;
271
+
272
+ const { queryExecutionId, token } = await getQueryExecutionId( { client, nativeArgs, recursive, paginationToken } );
273
+
274
+ const { nextToken, items } = await getResults( { client, queryExecutionId, token, recursive, maxResults } );
275
+ return { paginationToken: nextToken ? encode( { queryExecutionId, token: nextToken } ) : undefined, items };
276
+ };
277
+
278
+
279
+ /***/ }),
280
+
281
+ /***/ 4164:
282
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
283
+
284
+ const cacheSym = Symbol.for( 'cache' );
285
+ const crypto = __webpack_require__( 6982 );
286
+
287
+ const hash = text => crypto.createHash( 'md5' ).update( text ).digest( 'hex' );
288
+
289
+ const propOpts = {
290
+ enumerable: false,
291
+ configurable: false,
292
+ writable: false
293
+ };
294
+
295
+ module.exports = {
296
+ set: ( key, value ) => {
297
+ const keySym = Symbol.for( hash( key ) );
298
+
299
+ if ( !global[cacheSym] ) {
300
+ Object.defineProperty( global, cacheSym, { ...propOpts, value: {} } );
301
+ }
302
+
303
+ Object.defineProperty( global[cacheSym], keySym, { ...propOpts, value } );
304
+ },
305
+ get: key => {
306
+ return global[cacheSym]?.[Symbol.for( hash( key ) )];
307
+ }
308
+ };
309
+
310
+
311
+ /***/ }),
312
+
313
+ /***/ 5438:
314
+ /***/ ((module) => {
315
+
316
+ /**
317
+ * This is base object each AWS abstraction will provide
318
+ */
319
+ module.exports = ( providerFn, methods ) => {
320
+ // This creates the "instance",
321
+ // so calling the method as a function returns a copy of its client instantiated with the given args
322
+ // every method called from it will use this instance
323
+ const factory = args => {
324
+ const client = providerFn( args );
325
+ // return self, so it is possible use the native client
326
+ methods.getClient = () => client;
327
+ return Object.entries( methods ).reduce( ( o, [ k, v ] ) => Object.assign( o, { [k]: v.bind( null, client ) } ), { } );
328
+ };
329
+
330
+ // This is the singleton part;
331
+ // First add the static method to the factory;
332
+ Object.entries( methods ).forEach( ( [ key, value ] ) => factory[key] = value );
333
+
334
+ // Then add the special method "getClient", so it is possible use the native client
335
+ factory.getClient = client => client;
336
+
337
+ // Finally makes the proxy which will allow each singleton method to use the client provider of the AWS service+
338
+ return new Proxy( factory, {
339
+ get( target, key ) {
340
+ const t = target[key];
341
+ return ( typeof t === 'function' ) ? t.bind( null, providerFn() ) : t;
342
+ }
343
+ } );
344
+ };
345
+
346
+
347
+ /***/ }),
348
+
349
+ /***/ 5744:
350
+ /***/ ((module) => {
351
+
352
+ module.exports = {
353
+ encode: k => {
354
+ if ( k === null || k === undefined ) { return k; }
355
+
356
+ return Buffer.from( JSON.stringify( k ) ).toString( 'base64' );
357
+ },
358
+ decode: k => {
359
+ if ( k === null || k === undefined ) { return k; }
360
+
361
+ const result = Buffer.from( k, 'base64' ).toString( 'utf8' );
362
+ try {
363
+ return JSON.parse( result );
364
+ } catch {
365
+ return result;
366
+ }
367
+ }
368
+ };
369
+
370
+
371
+ /***/ }),
372
+
373
+ /***/ 9039:
374
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
375
+
376
+ const cache = __webpack_require__( 4164 );
377
+
378
+ module.exports = ( constructor, args = [] ) => {
379
+ const cacheKey = `${constructor.name}(${args.map( arg => JSON.stringify( arg ) ).join( ',' )})`;
380
+ return cache.get( cacheKey ) ?? ( () => {
381
+ const client = Reflect.construct( constructor, args );
382
+ // console.log( 'client', client );
383
+ // const client = new constructor( ...args );
384
+ cache.set( cacheKey, client );
385
+ return client;
386
+ } )();
387
+ };
388
+
389
+
390
+ /***/ }),
391
+
392
+ /***/ 8593:
393
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
394
+
395
+ const { BatchWriteCommand } = __webpack_require__( 5369 );
396
+ const splitBatches = __webpack_require__( 4821 );
397
+
398
+ const batchSize = 25;
399
+
400
+ const getMapper = method => method === 'put' ? v => ( { PutRequest: { Item: v } } ) : v => ( { DeleteRequest: { Key: v } } );
401
+
402
+ const process = async ( { client, method, table, batches } ) => {
403
+ if ( batches.length === 0 ) { return true; }
404
+
405
+ const response = await client.send( new BatchWriteCommand( { RequestItems: { [table]: batches[0] } } ) );
406
+
407
+ const unprocessed = response.UnprocessedItems?.[table];
408
+ return process( {
409
+ client, method, table,
410
+ batches: unprocessed ? splitBatches( batches.slice( 1 ).flat().concat( unprocessed ), batchSize ) : batches.slice( 1 )
411
+ } );
412
+ };
413
+
414
+ module.exports = async ( client, method, table, items ) =>
415
+ process( { client, method, table, batches: splitBatches( items.map( getMapper( method ) ), batchSize ) } );
416
+
417
+
418
+ /***/ }),
419
+
420
+ /***/ 2966:
421
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
422
+
423
+ const { DynamoDBClient } = __webpack_require__( 1271 );
424
+ const { DynamoDBDocumentClient } = __webpack_require__( 5369 );
425
+ const cache = __webpack_require__( 4164 );
426
+
427
+ module.exports = nativeArgs => {
428
+ const translateConfig = {
429
+ // Yes I copied those from the docs, read more here:
430
+ // https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_lib_dynamodb.html#dynamodbdocumentclientresolvedconfig-1
431
+ marshallOptions: {
432
+ // Whether to automatically convert empty strings, blobs, and sets to `null`.
433
+ convertEmptyValues: true, // false, by default.
434
+ // Whether to remove undefined values while marshalling.
435
+ removeUndefinedValues: true, // false, by default.
436
+ // Whether to convert typeof object to map attribute.
437
+ convertClassInstanceToMap: true // false, by default.
438
+ },
439
+ unmarshallOptions: {
440
+ // Whether to return numbers as a string instead of converting them to native JavaScript numbers.
441
+ wrapNumbers: false // false, by default.
442
+ }
443
+ };
444
+
445
+ const key = `Dynamodb(${JSON.stringify( nativeArgs )}).DocumentClient`;
446
+ return cache.get( key ) ?? ( () => {
447
+ const client = new DynamoDBClient( nativeArgs );
448
+ const docClient = DynamoDBDocumentClient.from( client, translateConfig );
449
+
450
+ cache.set( key, docClient );
451
+ return docClient;
452
+ } )();
453
+ };
454
+
455
+
456
+ /***/ }),
457
+
458
+ /***/ 1417:
459
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
460
+
461
+ const { GetCommand } = __webpack_require__( 5369 );
462
+
463
+ const parseArgs = args => {
464
+ // native args mode
465
+ if ( args[0] instanceof Object ) {
466
+ return args[0];
467
+ }
468
+ // sugar mode
469
+ return {
470
+ TableName: args[0],
471
+ Key: args[1]
472
+ };
473
+ };
474
+
475
+ module.exports = async ( client, ...args ) => {
476
+ const response = await client.send( new GetCommand( parseArgs( args ) ) );
477
+ return response.Item;
478
+ };
479
+
480
+
481
+ /***/ }),
482
+
483
+ /***/ 1505:
484
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
485
+
486
+ const documentClientProvider = __webpack_require__( 2966 );
487
+ const get = __webpack_require__( 1417 );
488
+ const put = __webpack_require__( 9628 );
489
+ const putBatch = __webpack_require__( 5847 );
490
+ const query = __webpack_require__( 5265 );
491
+ const remove = __webpack_require__( 6777 );
492
+ const removeBatch = __webpack_require__( 3862 );
493
+ const scan = __webpack_require__( 748 );
494
+ const smartUpdate = __webpack_require__( 2266 );
495
+ const transactWrite = __webpack_require__( 1659 );
496
+ const update = __webpack_require__( 4144 );
497
+ const createInstance = __webpack_require__( 5438 );
498
+
499
+ const methods = {
500
+ get,
501
+ put,
502
+ putBatch,
503
+ query,
504
+ remove,
505
+ removeBatch,
506
+ scan,
507
+ smartUpdate,
508
+ transactWrite,
509
+ update
510
+ };
511
+
512
+ module.exports = createInstance( documentClientProvider, methods );
513
+
514
+
515
+ /***/ }),
516
+
517
+ /***/ 9628:
518
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
519
+
520
+ const { PutCommand } = __webpack_require__( 5369 );
521
+
522
+ const parseArgs = args => {
523
+ // native args mode
524
+ if ( args[0] instanceof Object ) {
525
+ return args[0];
526
+ }
527
+ // sugar mode
528
+ return {
529
+ TableName: args[0],
530
+ Item: args[1],
531
+ ReturnValues: 'NONE',
532
+ ReturnConsumedCapacity: 'NONE'
533
+ };
534
+ };
535
+
536
+ /**
537
+ *
538
+ * @param {*} client
539
+ * @param {...any} args The args. either one object with the native args or two string args, tableName and item.
540
+ * @returns
541
+ */
542
+ module.exports = async ( client, ...args ) => {
543
+ const nativeArgs = parseArgs( args );
544
+ const response = await client.send( new PutCommand( nativeArgs ) );
545
+ return response.Attributes ?? nativeArgs.Item;
546
+ };
547
+
548
+
549
+ /***/ }),
550
+
551
+ /***/ 5847:
552
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
553
+
554
+ const batchWrite = __webpack_require__( 8593 );
555
+
556
+ module.exports = async ( client, ...args ) => batchWrite( client, 'put', ...args );
557
+
558
+
559
+ /***/ }),
560
+
561
+ /***/ 5265:
562
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
563
+
564
+ const select = __webpack_require__( 2157 );
565
+
566
+ module.exports = async ( client, ...args ) => select( client, 'query', ...args );
567
+
568
+
569
+ /***/ }),
570
+
571
+ /***/ 6777:
572
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
573
+
574
+ const { DeleteCommand } = __webpack_require__( 5369 );
575
+
576
+ module.exports = async ( client, tableName, key ) => {
577
+ const { Attributes: item } = await client.send( new DeleteCommand( {
578
+ ReturnValues: 'ALL_OLD',
579
+ TableName: tableName,
580
+ Key: key
581
+ } ) );
582
+ return item;
583
+ };
584
+
585
+
586
+ /***/ }),
587
+
588
+ /***/ 3862:
589
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
590
+
591
+ const batchWrite = __webpack_require__( 8593 );
592
+
593
+ module.exports = async ( client, ...args ) => batchWrite( client, 'remove', ...args );
594
+
595
+
596
+ /***/ }),
597
+
598
+ /***/ 748:
599
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
600
+
601
+ const select = __webpack_require__( 2157 );
602
+
603
+ module.exports = async ( client, ...args ) => select( client, 'scan', ...args );
604
+
605
+
606
+ /***/ }),
607
+
608
+ /***/ 2157:
609
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
610
+
611
+ const { encode, decode } = __webpack_require__( 5744 );
612
+ const { ScanCommand, QueryCommand } = __webpack_require__( 5369 );
613
+
614
+ const query = async ( { client, command, args, recursive, startKey, items = [], count = 0 } ) => {
615
+ const response = await client.send( new command( {
616
+ ...args,
617
+ ...( startKey && { ExclusiveStartKey: startKey } )
618
+ } ) );
619
+
620
+ const isCount = args.Select === 'COUNT';
621
+ const hasLimit = Number.isFinite( args.Limit );
622
+
623
+ const result = {
624
+ items: isCount ? null : items.concat( response.Items ),
625
+ count: count + response.Count,
626
+ startKey: response.LastEvaluatedKey
627
+ };
628
+
629
+ if ( !recursive ) {
630
+ return { items: result.items, count: result.count, ...( result.startKey && { nextToken: encode( result.startKey ) } ) };
631
+ }
632
+
633
+ if ( result.startKey && ( isCount || ( hasLimit && result.items.length < args.Limit ) || ( !isCount && !hasLimit ) ) ) {
634
+ return query( { client, command, args, recursive, ...result } );
635
+ }
636
+
637
+ if ( isCount ) {
638
+ return { items: null, count: result.count };
639
+ }
640
+ const trimmedItems = result.items.slice( 0, args.Limit );
641
+ return { items: trimmedItems, count: trimmedItems.length };
642
+ };
643
+
644
+ module.exports = async ( client, method, args, options = { recursive: false, paginationToken: null } ) => {
645
+ const command = method === 'scan' ? ScanCommand : QueryCommand;
646
+
647
+ return query( { client, command, args, recursive: options.recursive, startKey: decode( options.paginationToken ) } );
648
+ };
649
+
650
+
651
+ /***/ }),
652
+
653
+ /***/ 2266:
654
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
655
+
656
+ const { UpdateCommand } = __webpack_require__( 5369 );
657
+
658
+ module.exports = async ( client, tableName, key, keyValues ) => {
659
+ const { updates, removals, names, values } = Object.entries( keyValues ).reduce( ( args, [ k, value ], index ) => {
660
+ const isRemoval = value === undefined;
661
+
662
+ const attrs = k.split( '.' ).map( ( attr, i ) => {
663
+ const arrayPosition = attr.match( /\[(\d+)\]$/ )?.[1];
664
+ return {
665
+ key: `#${attr.replace( /\[\d+\]$|[^a-zA-Z0-9_]/g, '' )}${i}`,
666
+ name: attr.replace( /\[\d+\]$/g, '' ),
667
+ arrayPosition
668
+ };
669
+ } );
670
+ const fullPath = attrs.map( attr => attr.key + ( attr.arrayPosition ? `[${attr.arrayPosition}]` : '' ) ).join( '.' );
671
+ const valueId = `:v${index}`;
672
+ const expAttrNames = attrs.reduce( ( obj, attr ) =>
673
+ Object.assign( {}, obj, { [attr.key]: attr.name } )
674
+ , {} );
675
+
676
+ Object.assign( args.names, expAttrNames );
677
+
678
+ if ( isRemoval ) {
679
+ args.removals.push( fullPath );
680
+ } else {
681
+ args.updates.push( fullPath + ' = ' + valueId );
682
+ Object.assign( args.values, { [valueId]: value } );
683
+ }
684
+
685
+ return args;
686
+ }, { removals: [], updates: [], names: {}, values: {} } );
687
+
688
+ const conditionalExpressions = [];
689
+ for ( const k of Object.keys( key ) ) {
690
+ Object.assign( names, { [`#key_${k}`]: k } );
691
+ conditionalExpressions.push( `attribute_exists(#key_${k})` );
692
+ }
693
+
694
+ if ( updates.length + removals.length === 0 ) { return null; }
695
+
696
+ const expressions = [];
697
+ if ( updates.length ) {
698
+ expressions.push( 'SET ' + updates.join( ', ' ) );
699
+ } if ( removals.length ) {
700
+ expressions.push( 'REMOVE ' + removals.join( ', ' ) );
701
+ }
702
+
703
+ const statement = {
704
+ TableName: tableName,
705
+ ReturnValues: 'ALL_NEW',
706
+ Key: key,
707
+ ConditionExpression: conditionalExpressions.join( ' AND ' ),
708
+ UpdateExpression: expressions.join( ' ' ),
709
+ ExpressionAttributeNames: names
710
+ };
711
+ if ( Object.keys( values ).length > 0 ) {
712
+ statement.ExpressionAttributeValues = values;
713
+ }
714
+
715
+ try {
716
+ const response = await client.send( new UpdateCommand( statement ) );
717
+ return response.Attributes;
718
+ } catch ( error ) {
719
+ if ( error.constructor.name === 'ConditionalCheckFailedException' ) {
720
+ console.info( 'Fail to update a record that was not found.' );
721
+ return null;
722
+ }
723
+ throw error;
724
+ }
725
+ };
726
+
727
+
728
+ /***/ }),
729
+
730
+ /***/ 1659:
731
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
732
+
733
+ const { TransactWriteCommand } = __webpack_require__( 5369 );
734
+
735
+ module.exports = async ( client, items ) => {
736
+ const response = await client.send( new TransactWriteCommand( { TransactItems: items } ) );
737
+ return response;
738
+ };
739
+
740
+
741
+ /***/ }),
742
+
743
+ /***/ 4144:
744
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
745
+
746
+ const { UpdateCommand } = __webpack_require__( 5369 );
747
+
748
+ module.exports = async ( client, nativeArgs ) => {
749
+ const args = Object.assign( { ReturnValues: 'ALL_NEW' }, nativeArgs );
750
+ const response = await client.send( new UpdateCommand( args ) );
751
+ return response.Attributes;
752
+ };
753
+
754
+
755
+ /***/ }),
756
+
757
+ /***/ 4870:
758
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
759
+
760
+ const athena = __webpack_require__( 228 );
761
+ const dynamo = __webpack_require__( 1505 );
762
+ const lambda = __webpack_require__( 3544 );
763
+ const s3 = __webpack_require__( 645 );
764
+ const ses = __webpack_require__( 5624 );
765
+ const sns = __webpack_require__( 3099 );
766
+ const sqs = __webpack_require__( 3340 );
767
+ const ssm = __webpack_require__( 5888 );
768
+ const timestreamQuery = __webpack_require__( 4225 );
769
+ const timestreamWrite = __webpack_require__( 2538 );
770
+
771
+ module.exports = {
772
+ athena,
773
+ dynamo,
774
+ lambda,
775
+ s3,
776
+ ses,
777
+ sns,
778
+ sqs,
779
+ ssm,
780
+ timestreamQuery,
781
+ timestreamWrite
782
+ };
783
+
784
+
785
+ /***/ }),
786
+
787
+ /***/ 3544:
788
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
789
+
790
+ const invoke = __webpack_require__( 5894 );
791
+ const { LambdaClient } = __webpack_require__( 4588 );
792
+ const clientProvider = __webpack_require__( 9039 );
793
+ const createInstance = __webpack_require__( 5438 );
794
+
795
+ const methods = {
796
+ invoke
797
+ };
798
+
799
+ module.exports = createInstance( clientProvider.bind( null, LambdaClient ), methods );
800
+
801
+
802
+ /***/ }),
803
+
804
+ /***/ 5894:
805
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
806
+
807
+ const { InvokeCommand } = __webpack_require__( 4588 );
808
+ const AWSLambdaError = __webpack_require__( 468 );
809
+
810
+ module.exports = async ( client, name, payload = {}, type = 'RequestResponse' ) => {
811
+ const response = await client.send( new InvokeCommand( {
812
+ FunctionName: name,
813
+ InvocationType: type,
814
+ Payload: Buffer.from( JSON.stringify( payload ) )
815
+ } ) );
816
+
817
+ if ( response.FunctionError ) {
818
+ throw new AWSLambdaError( response );
819
+ }
820
+
821
+ if ( type !== 'RequestResponse' ) { return true; }
822
+
823
+ try {
824
+ return JSON.parse( Buffer.from( response.Payload ).toString() );
825
+ } catch {
826
+ return response.Payload;
827
+ }
828
+ };
829
+
830
+
831
+ /***/ }),
832
+
833
+ /***/ 468:
834
+ /***/ ((module) => {
835
+
836
+ const parsePayload = payload => {
837
+ try {
838
+ return JSON.parse( Buffer.from( payload ).toString( 'utf-8' ) );
839
+ } catch {
840
+ return null;
841
+ }
842
+ };
843
+
844
+ module.exports = class LambdaError extends Error {
845
+ constructor( response ) {
846
+ const { StatusCode: statusCode, Payload: rawPayload } = response;
847
+ const payload = parsePayload( rawPayload );
848
+ const lambdaErrorType = payload?.errorType ?? Error.name;
849
+ const lambdaErrorMessage = payload?.errorMessage;
850
+ if ( statusCode === 200 ) {
851
+ super( `Invoked function threw "[${lambdaErrorType}]${lambdaErrorMessage ? ' ' + lambdaErrorMessage : ''}"` );
852
+ } else {
853
+ super( 'Error invoking the function' );
854
+ }
855
+ this.statusCode = statusCode;
856
+ this.lambdaErrorType = lambdaErrorType;
857
+ this.lambdaErrorMessage = lambdaErrorMessage;
858
+ }
859
+ };
860
+
861
+
862
+ /***/ }),
863
+
864
+ /***/ 3936:
865
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
866
+
867
+ const { CopyObjectCommand } = __webpack_require__( 2965 );
868
+
869
+ module.exports = async ( client, bucket, key, source, nativeArgs ) => {
870
+ const response = await client.send( new CopyObjectCommand( {
871
+ ...nativeArgs,
872
+ Bucket: bucket,
873
+ Key: key,
874
+ CopySource: source
875
+ } ) );
876
+ return response;
877
+ };
878
+
879
+
880
+ /***/ }),
881
+
882
+ /***/ 345:
883
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
884
+
885
+ const { GetObjectCommand } = __webpack_require__( 2965 );
886
+
887
+ module.exports = async ( client, bucket, key, nativeArgs ) => {
888
+ const response = await client.send( new GetObjectCommand( {
889
+ ...nativeArgs,
890
+ Bucket: bucket,
891
+ Key: key
892
+ } ) );
893
+ const stream = response.Body;
894
+ return Buffer.concat( await stream.toArray() ).toString( 'utf-8' );
895
+ };
896
+
897
+
898
+ /***/ }),
899
+
900
+ /***/ 3758:
901
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
902
+
903
+ const { getSignedUrl } = __webpack_require__( 5207 );
904
+ const { GetObjectCommand } = __webpack_require__( 2965 );
905
+
906
+ module.exports = async ( client, bucket, key, expiration ) => {
907
+ const getObjectCmd = new GetObjectCommand( { Bucket: bucket, Key: key } );
908
+ const url = await getSignedUrl( client, getObjectCmd, { expiresIn: expiration } );
909
+ return url;
910
+ };
911
+
912
+
913
+ /***/ }),
914
+
915
+ /***/ 279:
916
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
917
+
918
+ const { HeadObjectCommand } = __webpack_require__( 2965 );
919
+
920
+ module.exports = async ( client, bucket, key ) =>
921
+ client.send( new HeadObjectCommand( { Bucket: bucket, Key: key } ) );
922
+
923
+
924
+ /***/ }),
925
+
926
+ /***/ 645:
927
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
928
+
929
+ const copy = __webpack_require__( 3936 );
930
+ const download = __webpack_require__( 345 );
931
+ const getSignedUrl = __webpack_require__( 3758 );
932
+ const head = __webpack_require__( 279 );
933
+ const upload = __webpack_require__( 9704 );
934
+ const { S3Client } = __webpack_require__( 2965 );
935
+ const clientProvider = __webpack_require__( 9039 );
936
+ const createInstance = __webpack_require__( 5438 );
937
+
938
+ const methods = {
939
+ copy,
940
+ download,
941
+ getSignedUrl,
942
+ head,
943
+ upload
944
+ };
945
+
946
+ module.exports = createInstance( clientProvider.bind( null, S3Client ), methods );
947
+
948
+
949
+ /***/ }),
950
+
951
+ /***/ 9704:
952
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
953
+
954
+ const { PutObjectCommand } = __webpack_require__( 2965 );
955
+
956
+ module.exports = ( client, bucket, key, body, nativeArgs ) =>
957
+ client.send( new PutObjectCommand( {
958
+ ...nativeArgs,
959
+ Bucket: bucket,
960
+ Key: key,
961
+ Body: typeof body === 'string' ? body : JSON.stringify( body )
962
+ } ) );
963
+
964
+
965
+ /***/ }),
966
+
967
+ /***/ 809:
968
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
969
+
970
+ const { DeleteSuppressedDestinationCommand } = __webpack_require__( 8716 );
971
+
972
+ module.exports = ( client, address ) => client.send( new DeleteSuppressedDestinationCommand( { EmailAddress: address } ) );
973
+
974
+
975
+ /***/ }),
976
+
977
+ /***/ 5624:
978
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
979
+
980
+ const deleteSuppressedDestination = __webpack_require__( 809 );
981
+ const sendEmail = __webpack_require__( 1783 );
982
+ const { SESv2Client } = __webpack_require__( 8716 );
983
+ const clientProvider = __webpack_require__( 9039 );
984
+ const createInstance = __webpack_require__( 5438 );
985
+
986
+ const methods = {
987
+ deleteSuppressedDestination,
988
+ sendEmail
989
+ };
990
+
991
+ module.exports = createInstance( clientProvider.bind( null, SESv2Client ), methods );
992
+
993
+
994
+ /***/ }),
995
+
996
+ /***/ 1783:
997
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
998
+
999
+ const { SendEmailCommand } = __webpack_require__( 8716 );
1000
+
1001
+ module.exports = ( client, { to = [], from, html, subject }, args ) =>
1002
+ client.send( new SendEmailCommand( {
1003
+ Destination: {
1004
+ ToAddresses: to
1005
+ },
1006
+ Content: {
1007
+ Simple: {
1008
+ Body: {
1009
+ Html: {
1010
+ Data: html,
1011
+ Charset: 'utf-8'
1012
+ }
1013
+ },
1014
+ Subject: {
1015
+ Data: subject
1016
+ }
1017
+ }
1018
+ },
1019
+ FromEmailAddress: from,
1020
+ ...args
1021
+ } ) );
1022
+
1023
+
1024
+ /***/ }),
1025
+
1026
+ /***/ 3099:
1027
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1028
+
1029
+ const publish = __webpack_require__( 8080 );
1030
+ const { SNSClient } = __webpack_require__( 6523 );
1031
+ const clientProvider = __webpack_require__( 9039 );
1032
+ const createInstance = __webpack_require__( 5438 );
1033
+
1034
+ const methods = {
1035
+ publish
1036
+ };
1037
+
1038
+ module.exports = createInstance( clientProvider.bind( null, SNSClient ), methods );
1039
+
1040
+
1041
+ /***/ }),
1042
+
1043
+ /***/ 8080:
1044
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1045
+
1046
+ const { PublishCommand } = __webpack_require__( 6523 );
1047
+
1048
+ module.exports = async ( client, topic, message, args = {} ) => {
1049
+ const response = await client.send( new PublishCommand( {
1050
+ ...args,
1051
+ TopicArn: topic,
1052
+ Message: typeof message === 'string' ? message : JSON.stringify( message )
1053
+ } ) );
1054
+ return response.MessageId;
1055
+ };
1056
+
1057
+
1058
+ /***/ }),
1059
+
1060
+ /***/ 5637:
1061
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1062
+
1063
+ const { DeleteMessageCommand } = __webpack_require__( 8896 );
1064
+
1065
+ module.exports = async ( client, queue, receiptHandle ) =>
1066
+ client.send( new DeleteMessageCommand( {
1067
+ QueueUrl: queue,
1068
+ ReceiptHandle: receiptHandle
1069
+ } ) );
1070
+
1071
+
1072
+ /***/ }),
1073
+
1074
+ /***/ 3340:
1075
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1076
+
1077
+ const deleteMessage = __webpack_require__( 5637 );
1078
+ const sendMessage = __webpack_require__( 6720 );
1079
+ const sendMessageBatch = __webpack_require__( 3131 );
1080
+ const { SQSClient } = __webpack_require__( 8896 );
1081
+ const clientProvider = __webpack_require__( 9039 );
1082
+ const createInstance = __webpack_require__( 5438 );
1083
+
1084
+ const methods = {
1085
+ deleteMessage,
1086
+ sendMessage,
1087
+ sendMessageBatch
1088
+ };
1089
+
1090
+ module.exports = createInstance( clientProvider.bind( null, SQSClient ), methods );
1091
+
1092
+
1093
+ /***/ }),
1094
+
1095
+ /***/ 8175:
1096
+ /***/ ((module) => {
1097
+
1098
+ /*
1099
+ References:
1100
+ - https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html
1101
+ - https://stackoverflow.com/questions/58809098/remove-invalid-characters-from-message-sent-to-aws-amazon-sqs
1102
+ */
1103
+ module.exports = v => v?.replace( /[^\u0009\u000A\u000D\u0020-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}]/ug, '' ) // eslint-disable-line
1104
+
1105
+
1106
+ /***/ }),
1107
+
1108
+ /***/ 6720:
1109
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1110
+
1111
+ const { SendMessageCommand } = __webpack_require__( 8896 );
1112
+ const sanitizeSqs = __webpack_require__( 8175 );
1113
+
1114
+ module.exports = async ( client, queue, body, args ) => {
1115
+ const response = await client.send( new SendMessageCommand( {
1116
+ ...args,
1117
+ MessageBody: sanitizeSqs( typeof body === 'string' ? body : JSON.stringify( body ) ),
1118
+ QueueUrl: queue
1119
+ } ) );
1120
+ return response.MessageId;
1121
+ };
1122
+
1123
+
1124
+ /***/ }),
1125
+
1126
+ /***/ 3131:
1127
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1128
+
1129
+ const { SendMessageBatchCommand } = __webpack_require__( 8896 );
1130
+ const sanitizeSqs = __webpack_require__( 8175 );
1131
+
1132
+ module.exports = async ( client, queue, messages ) => {
1133
+ if ( messages.length > 10 ) {
1134
+ throw new Error( 'SQS.sendMessageBatch only accepts up to then messages.' );
1135
+ }
1136
+ const response = await client.send( new SendMessageBatchCommand( {
1137
+ QueueUrl: queue,
1138
+ Entries: messages.map( ( { body, id = null, ...args }, index ) => ( {
1139
+ ...args,
1140
+ Id: id ?? `message_${index}`,
1141
+ MessageBody: sanitizeSqs( typeof body === 'string' ? body : JSON.stringify( body ) )
1142
+ } ) )
1143
+ } ) );
1144
+
1145
+ if ( response.Failed?.length > 0 ) {
1146
+ const error = new Error( 'SQS.sendMessageBatch Failed. See error details' );
1147
+ error.details = response.Failed;
1148
+ throw error;
1149
+ }
1150
+ return response;
1151
+ };
1152
+
1153
+
1154
+ /***/ }),
1155
+
1156
+ /***/ 8660:
1157
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1158
+
1159
+ const cacheStorage = __webpack_require__( 4164 );
1160
+ const { GetParameterCommand } = __webpack_require__( 9812 );
1161
+
1162
+ module.exports = async ( client, name ) => {
1163
+ const key = `SSM_${name}`;
1164
+ const cacheValue = cacheStorage.get( key );
1165
+ if ( cacheValue ) { return cacheValue; }
1166
+
1167
+ try {
1168
+ const response = await client.send( new GetParameterCommand( { Name: name, WithDecryption: true } ) );
1169
+ const value = response?.Parameter?.Value;
1170
+ cacheStorage.set( key, value );
1171
+ return value;
1172
+ } catch ( error ) {
1173
+ if ( error.constructor.name === 'ParameterNotFound' ) {
1174
+ return null;
1175
+ }
1176
+ throw error;
1177
+ }
1178
+ };
1179
+
1180
+
1181
+ /***/ }),
1182
+
1183
+ /***/ 5888:
1184
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1185
+
1186
+ const get = __webpack_require__( 8660 );
1187
+ const { SSMClient } = __webpack_require__( 9812 );
1188
+ const clientProvider = __webpack_require__( 9039 );
1189
+ const createInstance = __webpack_require__( 5438 );
1190
+
1191
+ const methods = { get };
1192
+
1193
+ module.exports = createInstance( clientProvider.bind( null, SSMClient ), methods );
1194
+
1195
+
1196
+ /***/ }),
1197
+
1198
+ /***/ 4225:
1199
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1200
+
1201
+ const query = __webpack_require__( 3649 );
1202
+ const { TimestreamQueryClient } = __webpack_require__( 7359 );
1203
+ const { Agent } = __webpack_require__( 5692 );
1204
+ const clientProvider = __webpack_require__( 9039 );
1205
+ const createInstance = __webpack_require__( 5438 );
1206
+
1207
+ const methods = { query };
1208
+ const defaultArgs = {
1209
+ maxRetries: 10,
1210
+ httpOptions: { timeout: 60000, agent: new Agent( { maxSockets: 5000 } ) }
1211
+ };
1212
+
1213
+ module.exports = createInstance( args => clientProvider( TimestreamQueryClient, [ Object.assign( {}, defaultArgs, args ) ] ), methods );
1214
+
1215
+
1216
+ /***/ }),
1217
+
1218
+ /***/ 7261:
1219
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1220
+
1221
+ // https://docs.aws.amazon.com/timestream/latest/developerguide/API_query_Type.html
1222
+ // https://docs.aws.amazon.com/timestream/latest/developerguide/supported-data-types.html
1223
+
1224
+ const { ScalarType } = __webpack_require__( 7359 );
1225
+
1226
+ const parseScalarValue = ( type, value ) => {
1227
+ switch ( type ) {
1228
+ case ScalarType.BOOLEAN:
1229
+ return value === 'true';
1230
+ case ScalarType.DOUBLE:
1231
+ return parseFloat( value );
1232
+ case ScalarType.TIMESTAMP:
1233
+ return new Date( `${value.replace( ' ', 'T' )}Z` );
1234
+ case ScalarType.INTEGER:
1235
+ return parseInt( value, 10 );
1236
+ case ScalarType.UNKNOWN: // is NULL
1237
+ return null;
1238
+ case ScalarType.VARCHAR:
1239
+ case ScalarType.BIGINT:
1240
+ case ScalarType.DATE:
1241
+ case ScalarType.TIME:
1242
+ case ScalarType.INTERVAL_DAY_TO_SECOND:
1243
+ case ScalarType.INTERVAL_YEAR_TO_MONTH:
1244
+ default:
1245
+ return value;
1246
+ }
1247
+ };
1248
+
1249
+ const parseValue = ( typeInfo, datum ) => {
1250
+ // value might be null
1251
+ if ( datum['NullValue'] === true ) {
1252
+ return null;
1253
+ }
1254
+
1255
+ // or a time series
1256
+ if ( Object.hasOwn( typeInfo, 'TimeSeriesMeasureValueColumnInfo' ) ) {
1257
+ return datum.TimeSeriesValue.map( v => ( {
1258
+ time: new Date( v.Time ),
1259
+ value: parseValue( typeInfo.TimeSeriesMeasureValueColumnInfo.Type, v.Value )
1260
+ } ) );
1261
+ }
1262
+
1263
+ // maybe an array
1264
+ if ( Object.hasOwn( typeInfo, 'ArrayColumnInfo' ) ) {
1265
+ return datum.ArrayValue.map( v => parseValue( typeInfo.ArrayColumnInfo.Type, v ) );
1266
+ }
1267
+
1268
+ // or even a row
1269
+ if ( Object.hasOwn( typeInfo, 'RowColumnInfo' ) ) {
1270
+ const rowColumnInfo = typeInfo.RowColumnInfo;
1271
+ return datum.RowValue.Data.reduce( ( object, value, index ) => {
1272
+ const { Name: name, Type: typeInfo } = rowColumnInfo[index];
1273
+ return Object.assign( object, { [name]: parseValue( typeInfo, value ) } );
1274
+ }, {} );
1275
+ }
1276
+
1277
+ // if none, it is scalar
1278
+ return parseScalarValue( typeInfo.ScalarType, datum['ScalarValue'] );
1279
+ };
1280
+
1281
+ module.exports = response => {
1282
+ const { ColumnInfo: colInfo, Rows: rows } = response;
1283
+ return rows.map( row =>
1284
+ row.Data.reduce( ( entry, value, index ) => {
1285
+ const { Name: name, Type: typeInfo } = colInfo[index];
1286
+ return Object.assign( entry, { [name]: parseValue( typeInfo, value ) } );
1287
+ }, { } )
1288
+ );
1289
+ };
1290
+
1291
+
1292
+ /***/ }),
1293
+
1294
+ /***/ 3649:
1295
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1296
+
1297
+ const { QueryCommand } = __webpack_require__( 7359 );
1298
+ const { camelize } = __webpack_require__( 5762 );
1299
+ const parseItems = __webpack_require__( 7261 );
1300
+
1301
+ module.exports = async ( client, queryString, { paginationToken = undefined, maxRows = undefined, rawResponse = false } = {} ) => {
1302
+ const response = await client.send( new QueryCommand( { QueryString: queryString, NextToken: paginationToken, MaxRows: maxRows } ) );
1303
+ return rawResponse ? response : {
1304
+ nextToken: response.NextToken,
1305
+ count: response.Rows.length,
1306
+ items: parseItems( response ),
1307
+ queryStatus: camelize( response.QueryStatus )
1308
+ };
1309
+ };
1310
+
1311
+
1312
+ /***/ }),
1313
+
1314
+ /***/ 2538:
1315
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1316
+
1317
+ const writeRecords = __webpack_require__( 8936 );
1318
+ const { TimestreamWriteClient } = __webpack_require__( 3792 );
1319
+ const { Agent } = __webpack_require__( 5692 );
1320
+ const clientProvider = __webpack_require__( 9039 );
1321
+ const createInstance = __webpack_require__( 5438 );
1322
+
1323
+ const methods = { writeRecords };
1324
+ const defaultArgs = {
1325
+ maxRetries: 10,
1326
+ httpOptions: { timeout: 60000, agent: new Agent( { maxSockets: 5000 } ) }
1327
+ };
1328
+
1329
+ module.exports = createInstance( args => clientProvider( TimestreamWriteClient, [ Object.assign( {}, defaultArgs, args ) ] ), methods );
1330
+
1331
+
1332
+ /***/ }),
1333
+
1334
+ /***/ 8936:
1335
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1336
+
1337
+ const { WriteRecordsCommand } = __webpack_require__( 3792 );
1338
+
1339
+ module.exports = async ( client, { database, table, records, ignoreRejections = false } ) => {
1340
+ try {
1341
+ const response = await client.send( new WriteRecordsCommand( {
1342
+ DatabaseName: database,
1343
+ TableName: table,
1344
+ Records: records
1345
+ } ) );
1346
+ return { recordsIngested: response.RecordsIngested };
1347
+ } catch ( error ) {
1348
+ if ( ignoreRejections && error.name === 'RejectedRecordsException' ) {
1349
+ return { rejectedRecords: error.RejectedRecords };
1350
+ }
1351
+ throw error;
1352
+ }
1353
+ };
1354
+
1355
+
1356
+ /***/ }),
1357
+
1358
+ /***/ 5263:
1359
+ /***/ ((module) => {
1360
+
1361
+ module.exports = t => t * 24 * 60 * 60 * 1000;
1362
+
1363
+
1364
+ /***/ }),
1365
+
1366
+ /***/ 6961:
1367
+ /***/ ((module) => {
1368
+
1369
+ module.exports = t => t * 60 * 60 * 1000;
1370
+
1371
+
1372
+ /***/ }),
1373
+
1374
+ /***/ 3830:
1375
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1376
+
1377
+ const days = __webpack_require__( 5263 );
1378
+ const hours = __webpack_require__( 6961 );
1379
+ const minutes = __webpack_require__( 6635 );
1380
+ const months = __webpack_require__( 8119 );
1381
+ const msToS = __webpack_require__( 7416 );
1382
+ const round = __webpack_require__( 3990 );
1383
+ const seconds = __webpack_require__( 7051 );
1384
+
1385
+ module.exports = {
1386
+ days,
1387
+ hours,
1388
+ minutes,
1389
+ months,
1390
+ msToS,
1391
+ round,
1392
+ seconds
1393
+ };
1394
+
1395
+
1396
+ /***/ }),
1397
+
1398
+ /***/ 6635:
1399
+ /***/ ((module) => {
1400
+
1401
+ module.exports = t => t * 60 * 1000;
1402
+
1403
+
1404
+ /***/ }),
1405
+
1406
+ /***/ 8119:
1407
+ /***/ ((module) => {
1408
+
1409
+ module.exports = t => t * 30 * 24 * 60 * 60 * 1000;
1410
+
1411
+
1412
+ /***/ }),
1413
+
1414
+ /***/ 7416:
1415
+ /***/ ((module) => {
1416
+
1417
+ module.exports = v => Math.ceil( v / 1000 );
1418
+
1419
+
1420
+ /***/ }),
1421
+
1422
+ /***/ 3990:
1423
+ /***/ ((module) => {
1424
+
1425
+ module.exports = ( time, interval ) => time - ( time % interval );
1426
+
1427
+
1428
+ /***/ }),
1429
+
1430
+ /***/ 7051:
1431
+ /***/ ((module) => {
1432
+
1433
+ module.exports = t => t * 1000;
1434
+
1435
+
1436
+ /***/ }),
1437
+
1438
+ /***/ 44:
1439
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1440
+
1441
+ const { LambdaApi } = __webpack_require__( 2705 );
1442
+ const array = __webpack_require__( 8278 );
1443
+ const aws = __webpack_require__( 4870 );
1444
+ const epoch = __webpack_require__( 3830 );
1445
+ const math = __webpack_require__( 943 );
1446
+ const object = __webpack_require__( 5762 );
1447
+ const string = __webpack_require__( 268 );
1448
+ const utils = __webpack_require__( 6878 );
1449
+
1450
+ module.exports = {
1451
+ array,
1452
+ aws,
1453
+ epoch,
1454
+ LambdaApi,
1455
+ math,
1456
+ object,
1457
+ string,
1458
+ utils
1459
+ };
1460
+
1461
+
1462
+ /***/ }),
1463
+
1464
+ /***/ 3119:
1465
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1466
+
1467
+ const { snakelize, camelize } = __webpack_require__( 5762 );
1468
+ const charset = 'utf-8';
1469
+
1470
+ const transformFns = {
1471
+ camelcase: camelize,
1472
+ snakecase: snakelize
1473
+ };
1474
+
1475
+ module.exports = class ApiResponse {
1476
+ #headers = null;
1477
+ #statusCode = null;
1478
+ #transformFn = false;
1479
+ #body = '';
1480
+
1481
+ constructor( { headers = {}, transform } = {} ) {
1482
+ this.#transformFn = transformFns[transform] ?? ( v => v );
1483
+ this.#headers = Object.assign( {
1484
+ 'Cache-Control': 'no-store',
1485
+ 'Access-Control-Allow-Origin': '*'
1486
+ }, headers );
1487
+ }
1488
+
1489
+ setContent( statusCode, body, headers = {} ) {
1490
+ this.#statusCode = statusCode;
1491
+ if ( body?.length === 0 || [ null, undefined ].includes( body ) ) {
1492
+ this.#body = '';
1493
+ } else if ( typeof body === 'object' ) {
1494
+ this.#body = JSON.stringify( this.#transformFn( body ) );
1495
+ this.#headers['Content-Type'] = `application/json; charset=${charset}`;
1496
+ } else {
1497
+ this.#body = String( body );
1498
+ this.#headers['Content-Type'] = `text/plain; charset=${charset}`;
1499
+ }
1500
+ this.#headers['Content-Length'] = this.#body.length;
1501
+ Object.assign( this.#headers, headers ?? {} );
1502
+ return this;
1503
+ }
1504
+
1505
+ toJSON() {
1506
+ return {
1507
+ statusCode: this.#statusCode,
1508
+ body: this.#body,
1509
+ headers: this.#headers
1510
+ };
1511
+ }
1512
+ };
1513
+
1514
+
1515
+ /***/ }),
1516
+
1517
+ /***/ 329:
1518
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1519
+
1520
+ const { camelize, snakelize } = __webpack_require__( 5762 );
1521
+
1522
+ const transformFns = {
1523
+ camelcase: camelize,
1524
+ snakecase: snakelize
1525
+ };
1526
+
1527
+ const parseJson = content => {
1528
+ try {
1529
+ return JSON.parse( content );
1530
+ } catch {
1531
+ return content;
1532
+ }
1533
+ };
1534
+
1535
+ module.exports = class Event {
1536
+ #transformFn;
1537
+ authorizer;
1538
+ body;
1539
+ headers;
1540
+ method;
1541
+ params;
1542
+ path;
1543
+ queryString;
1544
+ route;
1545
+
1546
+ context = {};
1547
+
1548
+ constructor( { transform = false } = {} ) {
1549
+ this.#transformFn = transformFns[transform] ?? ( v => v );
1550
+ }
1551
+
1552
+ parseFromAwsEvent( awsEvent ) {
1553
+ this[`parseFromAwsEventV${awsEvent.version !== '1.0' ? 2 : 1}`]( awsEvent );
1554
+ }
1555
+
1556
+ parseFromAwsEventV1( awsEvent ) {
1557
+ const {
1558
+ body,
1559
+ path,
1560
+ resource,
1561
+ httpMethod,
1562
+ requestContext,
1563
+ pathParameters,
1564
+ headers,
1565
+ multiValueHeaders,
1566
+ queryStringParameters,
1567
+ multiValueQueryStringParameters: multiValueQueryString
1568
+ } = awsEvent;
1569
+
1570
+ const unifiedHeaders = {
1571
+ headers,
1572
+ ...Object.fromEntries( Object.entries( multiValueHeaders ?? {} ).map( ( [ k, v ] ) => [ k, Array.isArray( v ) ? v.join( ',' ) : k ] ) )
1573
+ };
1574
+
1575
+ const unifiedQueryString = {
1576
+ queryStringParameters,
1577
+ ...Object.fromEntries( Object.entries( multiValueQueryString ?? {} ).map( ( [ k, v ] ) => [ k, Array.isArray( v ) ? v.join( ',' ) : k ] ) )
1578
+ };
1579
+
1580
+ this.authorizer = requestContext?.authorizer;
1581
+ this.body = body ? this.#transformFn( parseJson( body ) ) : null;
1582
+ this.headers = unifiedHeaders ?? {};
1583
+ this.method = httpMethod;
1584
+ this.params = this.#transformFn( pathParameters ) ?? {};
1585
+ this.path = path;
1586
+ this.queryString = this.#transformFn( unifiedQueryString ) ?? {};
1587
+ this.route = resource;
1588
+ }
1589
+
1590
+ parseFromAwsEventV2( awsEvent ) {
1591
+ const {
1592
+ body,
1593
+ routeKey,
1594
+ requestContext,
1595
+ pathParameters,
1596
+ headers,
1597
+ queryStringParameters
1598
+ } = awsEvent;
1599
+
1600
+ const { http: { method, path } } = requestContext;
1601
+
1602
+ this.authorizer = requestContext?.authorizer;
1603
+ this.body = body ? this.#transformFn( parseJson( body ) ) : null;
1604
+ this.headers = headers ?? {};
1605
+ this.method = method;
1606
+ this.params = this.#transformFn( pathParameters ) ?? {};
1607
+ this.path = path;
1608
+ this.queryString = this.#transformFn( queryStringParameters ) ?? {};
1609
+ this.route = routeKey?.split( ' ' )[1].replace( /\/$/, '' );
1610
+ }
1611
+ };
1612
+
1613
+
1614
+ /***/ }),
1615
+
1616
+ /***/ 3109:
1617
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1618
+
1619
+ const validators = __webpack_require__( 8994 );
1620
+
1621
+ module.exports = class Handler {
1622
+ #method;
1623
+ #fn;
1624
+ #route;
1625
+ #routeIncludes;
1626
+ #routeNotIncludes;
1627
+ #routeMatches;
1628
+ #path;
1629
+ #pathIncludes;
1630
+ #pathNotIncludes;
1631
+ #pathMatches;
1632
+
1633
+ constructor( { method, fn, ...matchers } ) {
1634
+ validators.httpMethod( method );
1635
+ validators.function( fn );
1636
+ validators.matcherRoute( matchers.route );
1637
+ validators.matcherRouteIncludes( matchers.routeIncludes );
1638
+ validators.matcherRouteNotIncludes( matchers.routeNotIncludes );
1639
+ validators.matcherRouteMatch( matchers.routeMatch );
1640
+ validators.matcherPath( matchers.path );
1641
+ validators.matcherPathIncludes( matchers.pathIncludes );
1642
+ validators.matcherPathNotIncludes( matchers.pathNotIncludes );
1643
+ validators.matcherPathMatch( matchers.pathMatch );
1644
+
1645
+ this.#method = method;
1646
+ this.#fn = fn;
1647
+ this.#route = matchers.route;
1648
+ this.#routeIncludes = matchers.routeIncludes;
1649
+ this.#routeNotIncludes = matchers.routeNotIncludes;
1650
+ this.#routeMatches = matchers.routeMatches;
1651
+ this.#path = matchers.path;
1652
+ this.#pathIncludes = matchers.pathIncludes;
1653
+ this.#pathNotIncludes = matchers.pathNotIncludes;
1654
+ this.#pathMatches = matchers.pathMatches;
1655
+ }
1656
+
1657
+ match( event ) {
1658
+ if ( this.#method !== event.method ) {
1659
+ return false;
1660
+ }
1661
+ if ( this.#route ) {
1662
+ return this.#route === event.route;
1663
+ }
1664
+ if ( this.#path ) {
1665
+ return this.#path === event.path;
1666
+ }
1667
+ if ( this.#routeIncludes && !event.route.includes( this.#routeIncludes ) ) {
1668
+ return false;
1669
+ }
1670
+ if ( this.#routeNotIncludes && event.route.includes( this.#routeNotIncludes ) ) {
1671
+ return false;
1672
+ }
1673
+ if ( this.#routeMatches && !this.#routeMatches.test( event.route ) ) {
1674
+ return false;
1675
+ }
1676
+ if ( this.#pathIncludes && !event.path.includes( this.#pathIncludes ) ) {
1677
+ return false;
1678
+ }
1679
+ if ( this.#pathNotIncludes && event.path.includes( this.#pathNotIncludes ) ) {
1680
+ return false;
1681
+ }
1682
+ if ( this.#pathMatches && !this.#pathMatches.test( event.path ) ) {
1683
+ return false;
1684
+ }
1685
+ return true;
1686
+ }
1687
+
1688
+ get fn() { return this.#fn; }
1689
+ };
1690
+
1691
+
1692
+ /***/ }),
1693
+
1694
+ /***/ 798:
1695
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1696
+
1697
+ const validators = __webpack_require__( 8994 );
1698
+
1699
+ module.exports = class Hook {
1700
+ #fn;
1701
+
1702
+ constructor( { fn } ) {
1703
+ validators.function( fn );
1704
+ this.#fn = fn;
1705
+ }
1706
+
1707
+ get fn() { return this.#fn; }
1708
+ };
1709
+
1710
+
1711
+ /***/ }),
1712
+
1713
+ /***/ 2705:
1714
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1715
+
1716
+ const LambdaApi = __webpack_require__( 321 );
1717
+
1718
+ module.exports = { LambdaApi };
1719
+
1720
+
1721
+ /***/ }),
1722
+
1723
+ /***/ 321:
1724
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1725
+
1726
+ const validators = __webpack_require__( 8994 );
1727
+ const ApiResponse = __webpack_require__( 3119 );
1728
+ const Event = __webpack_require__( 329 );
1729
+ const Handler = __webpack_require__( 3109 );
1730
+ const Hook = __webpack_require__( 798 );
1731
+ const UserResponse = __webpack_require__( 8282 );
1732
+ const Text = __webpack_require__( 9760 );
1733
+
1734
+ module.exports = class LambdaApi {
1735
+ #apiResponse = null;
1736
+ #handlers = [];
1737
+ #errorResponses = [];
1738
+ #beforeHooks = [];
1739
+ #afterHooks = [];
1740
+ #transformRequest = [];
1741
+
1742
+ /**
1743
+ * Creates a new Lambda Api
1744
+ *
1745
+ * @param {Object} headers Any headers you want to be included in all responses
1746
+ */
1747
+ constructor( { headers = {}, transformRequest = false, transformResponse = false } = {} ) {
1748
+ validators.transformRequest( transformRequest );
1749
+ validators.transformResponse( transformResponse );
1750
+
1751
+ this.#transformRequest = transformRequest;
1752
+ this.#apiResponse = new ApiResponse( { headers, transform: transformResponse } );
1753
+ }
1754
+
1755
+ /**
1756
+ * Register a function that will run before the matching route (only if matches)
1757
+ *
1758
+ * @param {Object} args
1759
+ * @param {function} args.fn A function
1760
+ */
1761
+ addBeforeHook( { fn } = {} ) {
1762
+ this.#beforeHooks.push( new Hook( { fn } ) );
1763
+ }
1764
+
1765
+ /**
1766
+ * Register a function that will run after the matching route (only if matches)
1767
+ *
1768
+ * @param {Object} args
1769
+ * @param {function} args.fn A function
1770
+ */
1771
+ addAfterHook( { fn } = {} ) {
1772
+ this.#afterHooks.push( new Hook( { fn } ) );
1773
+ }
1774
+
1775
+ /**
1776
+ * Register a handler for a given request method and optionally a path
1777
+ *
1778
+ * @param {Object} args
1779
+ * @param {string} args.method The method to match this handler
1780
+ * @param {function} args.fn The handler function
1781
+ * @param {string} [args.route] A route to match this handler
1782
+ * @param {string} [args.routeIncludes] A part of the route to match this handler
1783
+ * @param {string} [args.routeNotIncludes] A part of the route to not match this handler
1784
+ * @param {RegExp} [args.routeMatches] A RegExp to match the route
1785
+ * @param {string} [args.path] A path to match this handler
1786
+ * @param {string} [args.pathIncludes] A part of the path to match this handler
1787
+ * @param {string} [args.pathNotIncludes] A part of the path to not match this handler
1788
+ * @param {RegExp} [args.pathMatches] A RegExp to match the path
1789
+ */
1790
+ addHandler( { method, fn, ...matchers } = {} ) {
1791
+ this.#handlers.push( new Handler( { method, fn, ...matchers } ) );
1792
+ }
1793
+
1794
+ /**
1795
+ * Register an automatic error code response for given error class (constructor name)
1796
+ *
1797
+ * @param {Object} args
1798
+ * @param {string} args.code The HTTP status code to return
1799
+ * @param {class} args.errorType The error class
1800
+ * @param {string} [args.message=null] Optional message to return for the status code, if not present will default to Error.message
1801
+ * @param {message} [args.errorType] And optional message to display
1802
+ */
1803
+ addErrorHandler( { errorType, code, message = null } = {} ) {
1804
+ validators.statusCode( code );
1805
+ validators.errorType( errorType );
1806
+ this.#errorResponses.push( { errorType, code, message } );
1807
+ }
1808
+
1809
+ /**
1810
+ * Init the flow using a given AWS Lambda APIGateway event (v2 syntax)
1811
+ *
1812
+ * @param {Object} ApiGatewayPayload The raw API Gateway event
1813
+ * @returns {Object} The http response with status, body and headers
1814
+ */
1815
+ async process( awsEvent ) {
1816
+ const event = new Event( { transform: this.#transformRequest } );
1817
+ event.parseFromAwsEvent( awsEvent );
1818
+
1819
+ if ( event.method === 'HEAD' ) {
1820
+ return this.#apiResponse.setContent( 204 ).toJSON();
1821
+ }
1822
+
1823
+ const handler = this.#handlers.find( h => h.match( event ) );
1824
+ if ( !handler ) {
1825
+ return this.#apiResponse.setContent( 405, Text.ERROR_405 ).toJSON();
1826
+ }
1827
+
1828
+ const chain = [
1829
+ ...this.#beforeHooks.map( b => b.fn ),
1830
+ async ev => {
1831
+ const result = await handler.fn( ev );
1832
+ const response = new UserResponse( result );
1833
+ this.#apiResponse.setContent( ...response.values ).toJSON();
1834
+ },
1835
+ ...this.#afterHooks.map( a => a.fn )
1836
+ ];
1837
+
1838
+ try {
1839
+ for ( const fn of chain ) {
1840
+ await fn( event );
1841
+ }
1842
+ return this.#apiResponse.toJSON();
1843
+
1844
+ } catch ( error ) {
1845
+ console.error( 'Lambda API Error', { error, event } );
1846
+
1847
+ const response = this.#errorResponses.find( e => error instanceof e.errorType );
1848
+ if ( response ) {
1849
+ return this.#apiResponse.setContent( response.code, response.message ?? error.message ).toJSON();
1850
+ }
1851
+ return this.#apiResponse.setContent( 500, Text.ERROR_500 ).toJSON();
1852
+ }
1853
+ }
1854
+ };
1855
+
1856
+
1857
+ /***/ }),
1858
+
1859
+ /***/ 3446:
1860
+ /***/ ((module) => {
1861
+
1862
+ module.exports = class LambdaApiValidationError extends Error {};
1863
+
1864
+
1865
+ /***/ }),
1866
+
1867
+ /***/ 9760:
1868
+ /***/ ((module) => {
1869
+
1870
+ module.exports = {
1871
+ ERROR_500: 'Internal Server Error',
1872
+ ERROR_405: 'Method Not Allowed',
1873
+ INVALID_ERROR_TYPE: 'Argument "errorType" must be a constructor Function',
1874
+ INVALID_FN: 'Argument "fn" must be of type function',
1875
+ INVALID_METHOD: 'Argument "method" must be one of the default HTTP methods',
1876
+ INVALID_STATUS_CODE: 'Argument "statusCode" must be valid HTTP Status Code',
1877
+ INVALID_TRANSFORM_REQUEST: 'Argument "transformRequest" must be either "camelize", "snakelize", false or null',
1878
+ INVALID_TRANSFORM_RESPONSE: 'Argument "transformResponse" must be either "camelize", "snakelize", false or null',
1879
+ INVALID_MATCHER_ROUTE: 'Argument "route" must be either undefined or an string with length greater than 0',
1880
+ INVALID_MATCHER_ROUTE_INCLUDES: 'Argument "routeIncludes" must be either undefined or an string with length greater than 0',
1881
+ INVALID_MATCHER_ROUTE_NOT_INCLUDES: 'Argument "routeNotIncludes" must be either undefined or an string with length greater than 0',
1882
+ INVALID_MATCHER_ROUTE_MATCH: 'Argument "routeMatch" must be either undefined or type RegExp',
1883
+ INVALID_MATCHER_PATH: 'Argument "path" must be either undefined or an string with length greater than 0',
1884
+ INVALID_MATCHER_PATH_INCLUDES: 'Argument "pathIncludes" must be either undefined or an string with length greater than 0',
1885
+ INVALID_MATCHER_PATH_NOT_INCLUDES: 'Argument "pathNotIncludes" must be either undefined or an string with length greater than 0',
1886
+ INVALID_MATCHER_PATH_MATCH: 'Argument "pathMatch" must be either undefined or type RegExp',
1887
+ INVALID_USER_RESPONSE: 'Function return must be a number, a string, an array (where p=0 is a number) or an object (where .statusCode is a number)'
1888
+ };
1889
+
1890
+
1891
+ /***/ }),
1892
+
1893
+ /***/ 8282:
1894
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1895
+
1896
+ const validators = __webpack_require__( 8994 );
1897
+ const LambdaApiValidationError = __webpack_require__( 3446 );
1898
+ const Text = __webpack_require__( 9760 );
1899
+
1900
+ module.exports = class UserResponse {
1901
+ constructor( args ) {
1902
+ if ( args === undefined ) {
1903
+ this.values = [ 204 ];
1904
+ } else if ( typeof args === 'string' && args.length === 0 ) {
1905
+ this.values = [ 204 ];
1906
+
1907
+ } else if ( typeof args === 'string' && args.length > 0 ) {
1908
+ this.values = [ 200, args ];
1909
+
1910
+ } else if ( typeof args === 'number' ) {
1911
+ validators.statusCode( args );
1912
+ this.values = [ args ];
1913
+
1914
+ } else if ( Array.isArray( args ) ) {
1915
+ validators.statusCode( args[0] );
1916
+ this.values = args;
1917
+
1918
+ } else if ( args.statusCode ) {
1919
+ validators.statusCode( args.statusCode );
1920
+ this.values = [ args.statusCode, args.body, args.headers ];
1921
+
1922
+ } else if ( [ undefined, null ].includes( args ) ) {
1923
+ this.values = [ 200 ];
1924
+ } else {
1925
+ throw new LambdaApiValidationError( Text.INVALID_USER_RESPONSE );
1926
+ }
1927
+ }
1928
+ };
1929
+
1930
+
1931
+ /***/ }),
1932
+
1933
+ /***/ 8994:
1934
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1935
+
1936
+ const Text = __webpack_require__( 9760 );
1937
+ const LambdaApiValidationError = __webpack_require__( 3446 );
1938
+
1939
+ const evaluate = ( condition, errorMessage ) => {
1940
+ if ( !condition ) { throw new LambdaApiValidationError( errorMessage ); }
1941
+ };
1942
+
1943
+ const isConstructor = v => {
1944
+ try {
1945
+ return !!Reflect.construct( new Proxy( v, {} ), [] );
1946
+ } catch {
1947
+ return false;
1948
+ }
1949
+ };
1950
+
1951
+ module.exports = {
1952
+ errorType: v => evaluate( isConstructor( v ), Text.INVALID_ERROR_TYPE ),
1953
+ function: v => evaluate( typeof v === 'function', Text.INVALID_FN ),
1954
+ httpMethod: v => evaluate( [ 'DELETE', 'GET', 'HEAD', 'PATCH', 'POST', 'PUT' ].includes( v ), Text.INVALID_METHOD ),
1955
+ matcherPath: v => evaluate( v === undefined || ( typeof v === 'string' && v.length > 0 ), Text.INVALID_MATCHER_PATH ),
1956
+ matcherPathIncludes: v => evaluate( v === undefined || ( typeof v === 'string' && v.length > 0 ), Text.INVALID_MATCHER_PATH_INCLUDES ),
1957
+ matcherPathMatch: v => evaluate( v === undefined || v?.constructor?.name === RegExp.name, Text.INVALID_MATCHER_PATH_MATCH ),
1958
+ matcherPathNotIncludes: v => evaluate( v === undefined || ( typeof v === 'string' && v.length > 0 ), Text.INVALID_MATCHER_PATH_NOT_INCLUDES ),
1959
+ matcherRoute: v => evaluate( v === undefined || ( typeof v === 'string' && v.length > 0 ), Text.INVALID_MATCHER_ROUTE ),
1960
+ matcherRouteIncludes: v => evaluate( v === undefined || ( typeof v === 'string' && v.length > 0 ), Text.INVALID_MATCHER_ROUTE_INCLUDES ),
1961
+ matcherRouteMatch: v => evaluate( v === undefined || v?.constructor?.name === RegExp.name, Text.INVALID_MATCHER_ROUTE_MATCH ),
1962
+ matcherRouteNotIncludes: v => evaluate( v === undefined || ( typeof v === 'string' && v.length > 0 ), Text.INVALID_MATCHER_ROUTE_NOT_INCLUDES ),
1963
+ statusCode: v => evaluate( typeof v === 'number' && /^[1-5]\d\d$/.test( String( v ) ), Text.INVALID_STATUS_CODE ),
1964
+ transformRequest: v => evaluate( [ 'camelcase', 'snakecase', null, false ].includes( v ), Text.INVALID_TRANSFORM_REQUEST ),
1965
+ transformResponse: v => evaluate( [ 'camelcase', 'snakecase', null, false ].includes( v ), Text.INVALID_TRANSFORM_RESPONSE )
1966
+ };
1967
+
1968
+
1969
+ /***/ }),
1970
+
1971
+ /***/ 4124:
1972
+ /***/ ((module) => {
1973
+
1974
+ module.exports = values => values.reduce( ( sum, value ) => sum + value, 0 ) / values.length;
1975
+
1976
+
1977
+ /***/ }),
1978
+
1979
+ /***/ 3187:
1980
+ /***/ ((module) => {
1981
+
1982
+ module.exports = values => {
1983
+ //Sort bug: https://www.tutorialrepublic.com/faq/how-to-sort-an-array-of-integers-correctly-in-javascript.php
1984
+ const sorted = values.slice().sort( ( a, b ) => a - b );
1985
+ const evenArray = values.length % 2 === 0;
1986
+ const midIndex = Math.floor( values.length / 2 );
1987
+ return evenArray ? ( sorted[midIndex - 1] + sorted[midIndex] ) / 2 : sorted[midIndex];
1988
+ };
1989
+
1990
+
1991
+ /***/ }),
1992
+
1993
+ /***/ 4692:
1994
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1995
+
1996
+ const calcMedian = __webpack_require__( 3187 );
1997
+
1998
+ module.exports = pop => {
1999
+ const center = calcMedian( pop );
2000
+ return calcMedian( pop.map( v => Math.abs( v - center ) ) );
2001
+ };
2002
+
2003
+
2004
+ /***/ }),
2005
+
2006
+ /***/ 2736:
2007
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2008
+
2009
+ const calcMean = __webpack_require__( 4124 );
2010
+
2011
+ module.exports = values => {
2012
+ const mean = calcMean( values );
2013
+ const squareDiffs = values.map( value => Math.pow( value - mean, 2 ) );
2014
+ const avgSquareDiff = calcMean( squareDiffs );
2015
+ return Math.sqrt( avgSquareDiff );
2016
+ };
2017
+
2018
+
2019
+ /***/ }),
2020
+
2021
+ /***/ 6089:
2022
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2023
+
2024
+ const calcMean = __webpack_require__( 4124 );
2025
+
2026
+ module.exports = values => {
2027
+ if ( values.length < 2 ) { return NaN; }
2028
+
2029
+ const mean = calcMean( values );
2030
+ const squareDiffs = values.map( value => Math.pow( value - mean, 2 ) );
2031
+ const avgSquareDiff = squareDiffs.reduce( ( sum, v ) => sum + v, 0 ) / ( values.length - 1 );
2032
+ return Math.sqrt( avgSquareDiff );
2033
+ };
2034
+
2035
+
2036
+ /***/ }),
2037
+
2038
+ /***/ 4110:
2039
+ /***/ ((module) => {
2040
+
2041
+ module.exports = ( sample, mean, stdDev ) => stdDev === 0 ? NaN : ( sample - mean ) / stdDev;
2042
+
2043
+
2044
+ /***/ }),
2045
+
2046
+ /***/ 943:
2047
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2048
+
2049
+ const calcMean = __webpack_require__( 4124 );
2050
+ const calcMedian = __webpack_require__( 3187 );
2051
+ const calcMedianAbsDev = __webpack_require__( 4692 );
2052
+ const calcStdDevPopulation = __webpack_require__( 2736 );
2053
+ const calcStdDevSample = __webpack_require__( 6089 );
2054
+ const calcZScore = __webpack_require__( 4110 );
2055
+ const roundGaussian = __webpack_require__( 637 );
2056
+ const roundStandard = __webpack_require__( 115 );
2057
+
2058
+ module.exports = {
2059
+ calcMean,
2060
+ calcMedian,
2061
+ calcMedianAbsDev,
2062
+ calcStdDevPopulation,
2063
+ calcStdDevSample,
2064
+ calcZScore,
2065
+ roundGaussian,
2066
+ roundStandard
2067
+ };
2068
+
2069
+
2070
+ /***/ }),
2071
+
2072
+ /***/ 637:
2073
+ /***/ ((module) => {
2074
+
2075
+ module.exports = ( n, d = 2 ) => {
2076
+ if ( !isFinite( n ) || typeof n !== 'number' ) { return NaN; }
2077
+
2078
+ const m = Math.pow( 10, d );
2079
+ const num = +( n * m ).toFixed( 8 ); // Avoid rounding errors
2080
+ const i = Math.floor( num );
2081
+ const f = num - i;
2082
+ const e = 1e-8; // Allow for rounding errors in f
2083
+ const r = ( f > 0.5 - e && f < 0.5 + e ) ? // eslint-disable-line no-nested-ternary
2084
+ ( ( i % 2 === 0 ) ? i : i + 1 ) : Math.round( num );
2085
+ return r / m;
2086
+ };
2087
+
2088
+
2089
+ /***/ }),
2090
+
2091
+ /***/ 115:
2092
+ /***/ ((module) => {
2093
+
2094
+ module.exports = ( n, d = 2 ) => Math.round( n * ( 10 ** d ) ) / ( 10 ** d );
2095
+
2096
+
2097
+ /***/ }),
2098
+
2099
+ /***/ 8256:
2100
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2101
+
2102
+ const isSerializable = __webpack_require__( 8864 );
2103
+ const camelize = __webpack_require__( 3914 );
2104
+
2105
+ const change = ( obj, keepAllCaps ) =>
2106
+ !isSerializable( obj ) ? obj : Object.entries( obj ).reduce( ( transformed, [ key, value ] ) => {
2107
+ delete transformed[key];
2108
+ transformed[camelize( key, { keepAllCaps } )] = typeof value === 'object' ? change( value, keepAllCaps ) : value;
2109
+ return transformed;
2110
+ }, Array.isArray( obj ) ? [] : {} );
2111
+
2112
+ module.exports = ( obj, { keepAllCaps = false } = {} ) => change( obj, keepAllCaps );
2113
+
2114
+
2115
+ /***/ }),
2116
+
2117
+ /***/ 6451:
2118
+ /***/ ((module) => {
2119
+
2120
+ module.exports = ( obj, props ) => Object.fromEntries( Object.entries( obj ).filter( ( [ k ] ) => props.includes( k ) ) );
2121
+
2122
+
2123
+ /***/ }),
2124
+
2125
+ /***/ 5762:
2126
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2127
+
2128
+ const camelize = __webpack_require__( 8256 );
2129
+ const filterProps = __webpack_require__( 6451 );
2130
+ const snakelize = __webpack_require__( 7572 );
2131
+
2132
+ module.exports = {
2133
+ camelize,
2134
+ filterProps,
2135
+ snakelize
2136
+ };
2137
+
2138
+
2139
+ /***/ }),
2140
+
2141
+ /***/ 8864:
2142
+ /***/ ((module) => {
2143
+
2144
+ module.exports = obj =>
2145
+ typeof obj === 'object' &&
2146
+ obj !== null &&
2147
+ !( obj instanceof String ) &&
2148
+ !( obj instanceof Number ) &&
2149
+ !( obj instanceof Boolean ) &&
2150
+ !( obj instanceof Date );
2151
+
2152
+
2153
+ /***/ }),
2154
+
2155
+ /***/ 7572:
2156
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2157
+
2158
+ const isSerializable = __webpack_require__( 8864 );
2159
+ const snakelize = __webpack_require__( 3402 );
2160
+
2161
+ const change = ( obj, keepAllCaps ) =>
2162
+ !isSerializable( obj ) ? obj : Object.entries( obj ).reduce( ( transformed, [ key, value ] ) => {
2163
+ delete transformed[key];
2164
+ transformed[snakelize( key, { keepAllCaps } )] = typeof value === 'object' ? change( value, keepAllCaps ) : value;
2165
+ return transformed;
2166
+ }, Array.isArray( obj ) ? [] : {} );
2167
+
2168
+ module.exports = ( obj, { keepAllCaps = false } = {} ) => change( obj, keepAllCaps );
2169
+
2170
+
2171
+ /***/ }),
2172
+
2173
+ /***/ 3914:
2174
+ /***/ ((module) => {
2175
+
2176
+ // Convert a string to camelCase
2177
+ module.exports = ( input, { keepAllCaps = false } = {} ) =>
2178
+ // Break the string into sequences to rebuild later
2179
+ !input ? input : input.split( /\s/ )
2180
+ // ALL_CAPS terms are ignored
2181
+ .map( term => [ term, keepAllCaps && /^[A-Z_]+$/g.test( term ) ? term : term
2182
+ // Matches the penultimate letter in a sequence of upper case followed by lower case and convert it to lower case
2183
+ // Effectively creating a word break eg: BDay => bDay
2184
+ .replace( /[A-Z](?=[A-Z][a-z])/g, c => `${c[0].toLowerCase()}` )
2185
+ .replace( /([A-Z])([A-Z]+)/g, c => `${c[0]}${c.slice( 1 ).toLowerCase()}` ) // Sequences of upper case
2186
+ .replace( /([-_]\w)/g, c => c[1].toUpperCase() ) // first letter after hyphen and underline
2187
+ .replace( /^([A-Z])/g, c => c[0].toLowerCase() ) // first letter
2188
+ ] )
2189
+ // Rebuild the string replacing the converter terms keeping the original delimiters
2190
+ .reduce( ( result, [ term, repl ] ) => result.replace( term, repl ), input );
2191
+
2192
+
2193
+ /***/ }),
2194
+
2195
+ /***/ 3258:
2196
+ /***/ ((module) => {
2197
+
2198
+ module.exports = input =>
2199
+ // Break the string into sequences to rebuild later
2200
+ !input ? input : input.split( /\s/ )
2201
+ // ALL_CAPS terms are ignored
2202
+ .map( term => [ term, term.charAt( 0 ).toUpperCase() + term.slice( 1 ).toLowerCase() ] )
2203
+ // Rebuild the string replacing the converter terms keeping the original delimiters
2204
+ .reduce( ( result, [ term, repl ] ) => result.replace( term, repl ), input );
2205
+
2206
+
2207
+ /***/ }),
2208
+
2209
+ /***/ 268:
2210
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2211
+
2212
+ const camelize = __webpack_require__( 3914 );
2213
+ const capitalizeWords = __webpack_require__( 3258 );
2214
+ const snakelize = __webpack_require__( 3402 );
2215
+
2216
+ module.exports = {
2217
+ camelize,
2218
+ capitalizeWords,
2219
+ snakelize
2220
+ };
2221
+
2222
+
2223
+ /***/ }),
2224
+
2225
+ /***/ 3402:
2226
+ /***/ ((module) => {
2227
+
2228
+ // convert a string to snake_case
2229
+ module.exports = ( input, { keepAllCaps = false } = {} ) =>
2230
+ // Break the string into sequences to rebuild later
2231
+ !input ? input : input.split( /\s/ )
2232
+ // ALL_CAPS terms are ignored
2233
+ .map( term => [ term, keepAllCaps && /^[A-Z_]+$/g.test( term ) ? term : term
2234
+ .replace( /-/g, '_' ) // replaces hyphen
2235
+ .replace( /([a-z\d])([A-Z])/g, '$1_$2' ) // add _ between lower and upper case letters
2236
+ .replace( /([A-Z])([A-Z])(?=[a-z\d])/g, '$1_$2' ).toLowerCase() // add _ between uppercase char and next uppercase char follow by lowercase
2237
+ ] )
2238
+ // Rebuild the string replacing the converter terms keeping the original delimiters
2239
+ .reduce( ( result, [ term, repl ] ) => result.replace( term, repl ), input );
2240
+
2241
+
2242
+ /***/ }),
2243
+
2244
+ /***/ 6878:
2245
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2246
+
2247
+ const retryOnError = __webpack_require__( 4243 );
2248
+ const sleep = __webpack_require__( 2445 );
2249
+ const Timer = __webpack_require__( 9651 );
2250
+ const untarJsonGz = __webpack_require__( 8233 );
2251
+
2252
+ module.exports = {
2253
+ retryOnError,
2254
+ sleep,
2255
+ Timer,
2256
+ untarJsonGz
2257
+ };
2258
+
2259
+
2260
+ /***/ }),
2261
+
2262
+ /***/ 4243:
2263
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2264
+
2265
+ const sleep = __webpack_require__( 2445 );
2266
+
2267
+ const execWithRetry = async ( closure, { limit, delay, retryHook, execCount = 0 } ) => {
2268
+ if ( !( closure instanceof Function ) ) {
2269
+ throw new Error( 'Closure is not a function' );
2270
+ }
2271
+
2272
+ try {
2273
+ return await closure();
2274
+ } catch ( error ) {
2275
+ // exhausted
2276
+ if ( execCount === limit ) { throw error; }
2277
+
2278
+ // async retry hook to check if it should retry or give up and throw
2279
+ if ( retryHook instanceof Function ) {
2280
+ try {
2281
+ const retry = await retryHook( error, execCount );
2282
+ if ( retry === false ) { return false; }
2283
+
2284
+ // Hook errors break the flow
2285
+ } catch ( hookError ) {
2286
+ console.debug( hookError );
2287
+ throw hookError;
2288
+ }
2289
+ }
2290
+
2291
+ // if there is no hook back-off and retry
2292
+ if ( delay > 0 ) {
2293
+ await sleep( delay ** ( 1 + execCount ) );
2294
+ }
2295
+ return execWithRetry( closure, { limit, delay, retryHook, execCount: execCount + 1 } );
2296
+ }
2297
+ };
2298
+
2299
+ /**
2300
+ *
2301
+ * @param {Function} closure A self contained function that will be invoked
2302
+ * @param {Object} config
2303
+ * @param {Number} limit The max number of retries
2304
+ * @param {Number} delay The delay between each retry (it will be multiplied by the number of retries, so, it is linear back-off)
2305
+ * @param {Function} retryHook A function to be called every-time a retry is needed.
2306
+ * If this functions returns false, the retry error is raised
2307
+ * If this functions throws error, the thrown error is raised
2308
+ * @returns {Any} The closure result
2309
+ */
2310
+ module.exports = async ( closure, { limit = 0, delay = 0, retryHook = null } = {} ) =>
2311
+ execWithRetry( closure, { limit, delay, retryHook } );
2312
+
2313
+
2314
+ /***/ }),
2315
+
2316
+ /***/ 2445:
2317
+ /***/ ((module) => {
2318
+
2319
+ module.exports = t => new Promise( r => setTimeout( r, t ) );
2320
+
2321
+
2322
+ /***/ }),
2323
+
2324
+ /***/ 9651:
2325
+ /***/ ((module) => {
2326
+
2327
+ module.exports = class Timer {
2328
+ #startedAt;
2329
+ #stoppedAt = null;
2330
+ #running = false;
2331
+
2332
+ get elapsed() {
2333
+ if ( this.#running ) {
2334
+ return Date.now() - this.#startedAt;
2335
+ } else if ( !this.#startedAt ) {
2336
+ return 0;
2337
+ } else {
2338
+ return this.#stoppedAt - this.#startedAt;
2339
+ }
2340
+ }
2341
+
2342
+ get running() {
2343
+ return this.#running;
2344
+ }
2345
+
2346
+ start() {
2347
+ if ( !this.#running ) {
2348
+ this.#startedAt = Date.now();
2349
+ this.#running = true;
2350
+ }
2351
+ return this;
2352
+ }
2353
+
2354
+ restart() {
2355
+ this.#running = true;
2356
+ this.#startedAt = Date.now();
2357
+ return this;
2358
+ }
2359
+
2360
+ stop() {
2361
+ if ( this.#running ) {
2362
+ this.#running = false;
2363
+ this.#stoppedAt = Date.now();
2364
+ }
2365
+ return this.#stoppedAt - this.#startedAt;
2366
+ }
2367
+ };
2368
+
2369
+
2370
+ /***/ }),
2371
+
2372
+ /***/ 8233:
2373
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2374
+
2375
+ const { unzipSync } = __webpack_require__( 3106 );
2376
+
2377
+ const firstIndexOf = ( c, ...vars ) => Math.min( ...vars.map( v => c.indexOf( v ) ).filter( n => n > -1 ) );
2378
+ const lastIndexOf = ( c, ...vars ) => Math.max( ...vars.map( v => c.lastIndexOf( v ) ) );
2379
+
2380
+ /**
2381
+ * Decompress JSON
2382
+ *
2383
+ * Reads a gzipped tarball (.tar.gz)
2384
+ * 1. Unzip it
2385
+ * 2. Convert all to utf-8
2386
+ * 3. Split files using the \0star separator
2387
+ * 4. Trim files until JSON markup start/end ({})
2388
+ * 5. JSON parse
2389
+ *
2390
+ * Enjoy this 100% native tarball decompression!
2391
+ */
2392
+ module.exports = raw =>
2393
+ unzipSync( raw )
2394
+ .toString( 'utf-8' )
2395
+ .split( '\0ustar' )
2396
+ .slice( 1 )
2397
+ .map( c =>
2398
+ JSON.parse( c.substring( firstIndexOf( c, '{', '[' ), lastIndexOf( c, '}', ']' ) + 1 ) )
2399
+ );
2400
+
2401
+
2402
+ /***/ }),
2403
+
2404
+ /***/ 1448:
2405
+ /***/ ((module) => {
2406
+
2407
+ module.exports = __WEBPACK_EXTERNAL_MODULE__aws_sdk_client_athena_fac0b5e3__;
2408
+
2409
+ /***/ }),
2410
+
2411
+ /***/ 1271:
2412
+ /***/ ((module) => {
2413
+
2414
+ module.exports = __WEBPACK_EXTERNAL_MODULE__aws_sdk_client_dynamodb_8ad5c6c3__;
2415
+
2416
+ /***/ }),
2417
+
2418
+ /***/ 4588:
2419
+ /***/ ((module) => {
2420
+
2421
+ module.exports = __WEBPACK_EXTERNAL_MODULE__aws_sdk_client_lambda_45e15e4c__;
2422
+
2423
+ /***/ }),
2424
+
2425
+ /***/ 2965:
2426
+ /***/ ((module) => {
2427
+
2428
+ module.exports = __WEBPACK_EXTERNAL_MODULE__aws_sdk_client_s3_166f32a4__;
2429
+
2430
+ /***/ }),
2431
+
2432
+ /***/ 8716:
2433
+ /***/ ((module) => {
2434
+
2435
+ module.exports = __WEBPACK_EXTERNAL_MODULE__aws_sdk_client_sesv2_6677e3b1__;
2436
+
2437
+ /***/ }),
2438
+
2439
+ /***/ 6523:
2440
+ /***/ ((module) => {
2441
+
2442
+ module.exports = __WEBPACK_EXTERNAL_MODULE__aws_sdk_client_sns_aa88aa43__;
2443
+
2444
+ /***/ }),
2445
+
2446
+ /***/ 8896:
2447
+ /***/ ((module) => {
2448
+
2449
+ module.exports = __WEBPACK_EXTERNAL_MODULE__aws_sdk_client_sqs_1f0ecae0__;
2450
+
2451
+ /***/ }),
2452
+
2453
+ /***/ 9812:
2454
+ /***/ ((module) => {
2455
+
2456
+ module.exports = __WEBPACK_EXTERNAL_MODULE__aws_sdk_client_ssm_6758df31__;
2457
+
2458
+ /***/ }),
2459
+
2460
+ /***/ 7359:
2461
+ /***/ ((module) => {
2462
+
2463
+ module.exports = __WEBPACK_EXTERNAL_MODULE__aws_sdk_client_timestream_query_1be755b6__;
2464
+
2465
+ /***/ }),
2466
+
2467
+ /***/ 3792:
2468
+ /***/ ((module) => {
2469
+
2470
+ module.exports = __WEBPACK_EXTERNAL_MODULE__aws_sdk_client_timestream_write_3c1b228d__;
2471
+
2472
+ /***/ }),
2473
+
2474
+ /***/ 5369:
2475
+ /***/ ((module) => {
2476
+
2477
+ module.exports = __WEBPACK_EXTERNAL_MODULE__aws_sdk_lib_dynamodb_4ad47c88__;
2478
+
2479
+ /***/ }),
2480
+
2481
+ /***/ 5207:
2482
+ /***/ ((module) => {
2483
+
2484
+ module.exports = __WEBPACK_EXTERNAL_MODULE__aws_sdk_s3_request_presigner_c7ff9288__;
2485
+
2486
+ /***/ }),
2487
+
2488
+ /***/ 6982:
2489
+ /***/ ((module) => {
2490
+
2491
+ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("crypto");
2492
+
2493
+ /***/ }),
2494
+
2495
+ /***/ 5692:
2496
+ /***/ ((module) => {
2497
+
2498
+ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("https");
2499
+
2500
+ /***/ }),
2501
+
2502
+ /***/ 3106:
2503
+ /***/ ((module) => {
2504
+
2505
+ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("zlib");
2506
+
2507
+ /***/ })
2508
+
2509
+ /******/ });
2510
+ /************************************************************************/
2511
+ /******/ // The module cache
2512
+ /******/ var __webpack_module_cache__ = {};
2513
+ /******/
2514
+ /******/ // The require function
2515
+ /******/ function __webpack_require__(moduleId) {
2516
+ /******/ // Check if module is in cache
2517
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
2518
+ /******/ if (cachedModule !== undefined) {
2519
+ /******/ return cachedModule.exports;
2520
+ /******/ }
2521
+ /******/ // Create a new module (and put it into the cache)
2522
+ /******/ var module = __webpack_module_cache__[moduleId] = {
2523
+ /******/ // no module.id needed
2524
+ /******/ // no module.loaded needed
2525
+ /******/ exports: {}
2526
+ /******/ };
2527
+ /******/
2528
+ /******/ // Execute the module function
2529
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
2530
+ /******/
2531
+ /******/ // Return the exports of the module
2532
+ /******/ return module.exports;
2533
+ /******/ }
2534
+ /******/
2535
+ /************************************************************************/
2536
+ /******/
2537
+ /******/ // startup
2538
+ /******/ // Load entry module and return exports
2539
+ /******/ // This entry module is referenced by other modules so it can't be inlined
2540
+ /******/ var __webpack_exports__ = __webpack_require__(44);
2541
+ /******/