@aws-sdk/lib-dynamodb 3.490.0 → 3.495.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.
package/dist-cjs/index.js CHANGED
@@ -1,10 +1,1025 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NumberValue = void 0;
4
- const tslib_1 = require("tslib");
5
- tslib_1.__exportStar(require("./DynamoDBDocument"), exports);
6
- tslib_1.__exportStar(require("./DynamoDBDocumentClient"), exports);
7
- tslib_1.__exportStar(require("./commands"), exports);
8
- tslib_1.__exportStar(require("./pagination"), exports);
9
- var util_dynamodb_1 = require("@aws-sdk/util-dynamodb");
10
- Object.defineProperty(exports, "NumberValue", { enumerable: true, get: function () { return util_dynamodb_1.NumberValueImpl; } });
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ BatchExecuteStatementCommand: () => BatchExecuteStatementCommand,
24
+ BatchGetCommand: () => BatchGetCommand,
25
+ BatchWriteCommand: () => BatchWriteCommand,
26
+ DeleteCommand: () => DeleteCommand,
27
+ DynamoDBDocument: () => DynamoDBDocument,
28
+ DynamoDBDocumentClient: () => DynamoDBDocumentClient,
29
+ DynamoDBDocumentClientCommand: () => DynamoDBDocumentClientCommand,
30
+ ExecuteStatementCommand: () => ExecuteStatementCommand,
31
+ ExecuteTransactionCommand: () => ExecuteTransactionCommand,
32
+ GetCommand: () => GetCommand,
33
+ NumberValue: () => import_util_dynamodb.NumberValueImpl,
34
+ PaginationConfiguration: () => import_types.PaginationConfiguration,
35
+ PutCommand: () => PutCommand,
36
+ QueryCommand: () => QueryCommand,
37
+ ScanCommand: () => ScanCommand,
38
+ TransactGetCommand: () => TransactGetCommand,
39
+ TransactWriteCommand: () => TransactWriteCommand,
40
+ UpdateCommand: () => UpdateCommand,
41
+ __Client: () => import_smithy_client.Client,
42
+ paginateQuery: () => paginateQuery,
43
+ paginateScan: () => paginateScan
44
+ });
45
+ module.exports = __toCommonJS(src_exports);
46
+
47
+ // src/commands/BatchExecuteStatementCommand.ts
48
+ var import_client_dynamodb = require("@aws-sdk/client-dynamodb");
49
+
50
+
51
+ // src/baseCommand/DynamoDBDocumentClientCommand.ts
52
+ var import_smithy_client = require("@smithy/smithy-client");
53
+
54
+ // src/commands/utils.ts
55
+ var import_util_dynamodb = require("@aws-sdk/util-dynamodb");
56
+ var SELF = null;
57
+ var ALL_VALUES = {};
58
+ var ALL_MEMBERS = [];
59
+ var NEXT_LEVEL = "*";
60
+ var processObj = /* @__PURE__ */ __name((obj, processFunc, keyNodes) => {
61
+ if (obj !== void 0) {
62
+ if (keyNodes == null) {
63
+ return processFunc(obj);
64
+ } else {
65
+ const keys = Object.keys(keyNodes);
66
+ const goToNextLevel = keys.length === 1 && keys[0] === NEXT_LEVEL;
67
+ const someChildren = keys.length >= 1 && !goToNextLevel;
68
+ const allChildren = keys.length === 0;
69
+ if (someChildren) {
70
+ return processKeysInObj(obj, processFunc, keyNodes);
71
+ } else if (allChildren) {
72
+ return processAllKeysInObj(obj, processFunc, SELF);
73
+ } else if (goToNextLevel) {
74
+ return Object.entries(obj ?? {}).reduce((acc, [k, v]) => {
75
+ acc[k] = processObj(v, processFunc, keyNodes[NEXT_LEVEL]);
76
+ return acc;
77
+ }, Array.isArray(obj) ? [] : {});
78
+ }
79
+ }
80
+ }
81
+ return void 0;
82
+ }, "processObj");
83
+ var processKeysInObj = /* @__PURE__ */ __name((obj, processFunc, keyNodes) => {
84
+ let accumulator;
85
+ if (Array.isArray(obj)) {
86
+ accumulator = [...obj];
87
+ } else {
88
+ accumulator = { ...obj };
89
+ }
90
+ for (const [nodeKey, nodes] of Object.entries(keyNodes)) {
91
+ const processedValue = processObj(obj[nodeKey], processFunc, nodes);
92
+ if (processedValue !== void 0) {
93
+ accumulator[nodeKey] = processedValue;
94
+ }
95
+ }
96
+ return accumulator;
97
+ }, "processKeysInObj");
98
+ var processAllKeysInObj = /* @__PURE__ */ __name((obj, processFunc, keyNodes) => {
99
+ if (Array.isArray(obj)) {
100
+ return obj.map((item) => processObj(item, processFunc, keyNodes));
101
+ }
102
+ return Object.entries(obj).reduce((acc, [key, value]) => {
103
+ const processedValue = processObj(value, processFunc, keyNodes);
104
+ if (processedValue !== void 0) {
105
+ acc[key] = processedValue;
106
+ }
107
+ return acc;
108
+ }, {});
109
+ }, "processAllKeysInObj");
110
+ var marshallInput = /* @__PURE__ */ __name((obj, keyNodes, options) => {
111
+ const marshallFunc = /* @__PURE__ */ __name((toMarshall) => (0, import_util_dynamodb.marshall)(toMarshall, options), "marshallFunc");
112
+ return processKeysInObj(obj, marshallFunc, keyNodes);
113
+ }, "marshallInput");
114
+ var unmarshallOutput = /* @__PURE__ */ __name((obj, keyNodes, options) => {
115
+ const unmarshallFunc = /* @__PURE__ */ __name((toMarshall) => (0, import_util_dynamodb.unmarshall)(toMarshall, options), "unmarshallFunc");
116
+ return processKeysInObj(obj, unmarshallFunc, keyNodes);
117
+ }, "unmarshallOutput");
118
+
119
+ // src/baseCommand/DynamoDBDocumentClientCommand.ts
120
+ var _DynamoDBDocumentClientCommand = class _DynamoDBDocumentClientCommand extends import_smithy_client.Command {
121
+ addMarshallingMiddleware(configuration) {
122
+ const { marshallOptions: marshallOptions2 = {}, unmarshallOptions: unmarshallOptions2 = {} } = configuration.translateConfig || {};
123
+ marshallOptions2.convertTopLevelContainer = marshallOptions2.convertTopLevelContainer ?? true;
124
+ unmarshallOptions2.convertWithoutMapWrapper = unmarshallOptions2.convertWithoutMapWrapper ?? true;
125
+ this.clientCommand.middlewareStack.addRelativeTo(
126
+ (next, context) => async (args) => {
127
+ args.input = marshallInput(this.input, this.inputKeyNodes, marshallOptions2);
128
+ context.dynamoDbDocumentClientOptions = context.dynamoDbDocumentClientOptions || _DynamoDBDocumentClientCommand.defaultLogFilterOverrides;
129
+ const input = args.input;
130
+ context.dynamoDbDocumentClientOptions.overrideInputFilterSensitiveLog = () => {
131
+ var _a;
132
+ return (_a = context.inputFilterSensitiveLog) == null ? void 0 : _a.call(context, input);
133
+ };
134
+ return next(args);
135
+ },
136
+ {
137
+ name: "DocumentMarshall",
138
+ relation: "before",
139
+ toMiddleware: "serializerMiddleware",
140
+ override: true
141
+ }
142
+ );
143
+ this.clientCommand.middlewareStack.addRelativeTo(
144
+ (next, context) => async (args) => {
145
+ const deserialized = await next(args);
146
+ const output = deserialized.output;
147
+ context.dynamoDbDocumentClientOptions = context.dynamoDbDocumentClientOptions || _DynamoDBDocumentClientCommand.defaultLogFilterOverrides;
148
+ context.dynamoDbDocumentClientOptions.overrideOutputFilterSensitiveLog = () => {
149
+ var _a;
150
+ return (_a = context.outputFilterSensitiveLog) == null ? void 0 : _a.call(context, output);
151
+ };
152
+ deserialized.output = unmarshallOutput(deserialized.output, this.outputKeyNodes, unmarshallOptions2);
153
+ return deserialized;
154
+ },
155
+ {
156
+ name: "DocumentUnmarshall",
157
+ relation: "before",
158
+ toMiddleware: "deserializerMiddleware",
159
+ override: true
160
+ }
161
+ );
162
+ }
163
+ };
164
+ __name(_DynamoDBDocumentClientCommand, "DynamoDBDocumentClientCommand");
165
+ _DynamoDBDocumentClientCommand.defaultLogFilterOverrides = {
166
+ overrideInputFilterSensitiveLog(...args) {
167
+ },
168
+ overrideOutputFilterSensitiveLog(...args) {
169
+ }
170
+ };
171
+ var DynamoDBDocumentClientCommand = _DynamoDBDocumentClientCommand;
172
+
173
+ // src/commands/BatchExecuteStatementCommand.ts
174
+ var _BatchExecuteStatementCommand = class _BatchExecuteStatementCommand extends DynamoDBDocumentClientCommand {
175
+ constructor(input) {
176
+ super();
177
+ this.input = input;
178
+ this.inputKeyNodes = {
179
+ Statements: {
180
+ "*": {
181
+ Parameters: ALL_MEMBERS
182
+ // set/list of AttributeValue
183
+ }
184
+ }
185
+ };
186
+ this.outputKeyNodes = {
187
+ Responses: {
188
+ "*": {
189
+ Error: {
190
+ Item: ALL_VALUES
191
+ // map with AttributeValue
192
+ },
193
+ Item: ALL_VALUES
194
+ // map with AttributeValue
195
+ }
196
+ }
197
+ };
198
+ this.clientCommand = new import_client_dynamodb.BatchExecuteStatementCommand(this.input);
199
+ this.middlewareStack = this.clientCommand.middlewareStack;
200
+ }
201
+ /**
202
+ * @internal
203
+ */
204
+ resolveMiddleware(clientStack, configuration, options) {
205
+ this.addMarshallingMiddleware(configuration);
206
+ const stack = clientStack.concat(this.middlewareStack);
207
+ const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
208
+ return async () => handler(this.clientCommand);
209
+ }
210
+ };
211
+ __name(_BatchExecuteStatementCommand, "BatchExecuteStatementCommand");
212
+ var BatchExecuteStatementCommand = _BatchExecuteStatementCommand;
213
+
214
+ // src/commands/BatchGetCommand.ts
215
+
216
+
217
+ var _BatchGetCommand = class _BatchGetCommand extends DynamoDBDocumentClientCommand {
218
+ constructor(input) {
219
+ super();
220
+ this.input = input;
221
+ this.inputKeyNodes = {
222
+ RequestItems: {
223
+ "*": {
224
+ Keys: {
225
+ "*": ALL_VALUES
226
+ // map with AttributeValue
227
+ }
228
+ }
229
+ }
230
+ };
231
+ this.outputKeyNodes = {
232
+ Responses: {
233
+ "*": {
234
+ "*": ALL_VALUES
235
+ // map with AttributeValue
236
+ }
237
+ },
238
+ UnprocessedKeys: {
239
+ "*": {
240
+ Keys: {
241
+ "*": ALL_VALUES
242
+ // map with AttributeValue
243
+ }
244
+ }
245
+ }
246
+ };
247
+ this.clientCommand = new import_client_dynamodb.BatchGetItemCommand(this.input);
248
+ this.middlewareStack = this.clientCommand.middlewareStack;
249
+ }
250
+ /**
251
+ * @internal
252
+ */
253
+ resolveMiddleware(clientStack, configuration, options) {
254
+ this.addMarshallingMiddleware(configuration);
255
+ const stack = clientStack.concat(this.middlewareStack);
256
+ const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
257
+ return async () => handler(this.clientCommand);
258
+ }
259
+ };
260
+ __name(_BatchGetCommand, "BatchGetCommand");
261
+ var BatchGetCommand = _BatchGetCommand;
262
+
263
+ // src/commands/BatchWriteCommand.ts
264
+
265
+
266
+ var _BatchWriteCommand = class _BatchWriteCommand extends DynamoDBDocumentClientCommand {
267
+ constructor(input) {
268
+ super();
269
+ this.input = input;
270
+ this.inputKeyNodes = {
271
+ RequestItems: {
272
+ "*": {
273
+ "*": {
274
+ PutRequest: {
275
+ Item: ALL_VALUES
276
+ // map with AttributeValue
277
+ },
278
+ DeleteRequest: {
279
+ Key: ALL_VALUES
280
+ // map with AttributeValue
281
+ }
282
+ }
283
+ }
284
+ }
285
+ };
286
+ this.outputKeyNodes = {
287
+ UnprocessedItems: {
288
+ "*": {
289
+ "*": {
290
+ PutRequest: {
291
+ Item: ALL_VALUES
292
+ // map with AttributeValue
293
+ },
294
+ DeleteRequest: {
295
+ Key: ALL_VALUES
296
+ // map with AttributeValue
297
+ }
298
+ }
299
+ }
300
+ },
301
+ ItemCollectionMetrics: {
302
+ "*": {
303
+ "*": {
304
+ ItemCollectionKey: ALL_VALUES
305
+ // map with AttributeValue
306
+ }
307
+ }
308
+ }
309
+ };
310
+ this.clientCommand = new import_client_dynamodb.BatchWriteItemCommand(this.input);
311
+ this.middlewareStack = this.clientCommand.middlewareStack;
312
+ }
313
+ /**
314
+ * @internal
315
+ */
316
+ resolveMiddleware(clientStack, configuration, options) {
317
+ this.addMarshallingMiddleware(configuration);
318
+ const stack = clientStack.concat(this.middlewareStack);
319
+ const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
320
+ return async () => handler(this.clientCommand);
321
+ }
322
+ };
323
+ __name(_BatchWriteCommand, "BatchWriteCommand");
324
+ var BatchWriteCommand = _BatchWriteCommand;
325
+
326
+ // src/commands/DeleteCommand.ts
327
+
328
+
329
+ var _DeleteCommand = class _DeleteCommand extends DynamoDBDocumentClientCommand {
330
+ constructor(input) {
331
+ super();
332
+ this.input = input;
333
+ this.inputKeyNodes = {
334
+ Key: ALL_VALUES,
335
+ // map with AttributeValue
336
+ Expected: {
337
+ "*": {
338
+ Value: SELF,
339
+ AttributeValueList: ALL_MEMBERS
340
+ // set/list of AttributeValue
341
+ }
342
+ },
343
+ ExpressionAttributeValues: ALL_VALUES
344
+ // map with AttributeValue
345
+ };
346
+ this.outputKeyNodes = {
347
+ Attributes: ALL_VALUES,
348
+ // map with AttributeValue
349
+ ItemCollectionMetrics: {
350
+ ItemCollectionKey: ALL_VALUES
351
+ // map with AttributeValue
352
+ }
353
+ };
354
+ this.clientCommand = new import_client_dynamodb.DeleteItemCommand(this.input);
355
+ this.middlewareStack = this.clientCommand.middlewareStack;
356
+ }
357
+ /**
358
+ * @internal
359
+ */
360
+ resolveMiddleware(clientStack, configuration, options) {
361
+ this.addMarshallingMiddleware(configuration);
362
+ const stack = clientStack.concat(this.middlewareStack);
363
+ const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
364
+ return async () => handler(this.clientCommand);
365
+ }
366
+ };
367
+ __name(_DeleteCommand, "DeleteCommand");
368
+ var DeleteCommand = _DeleteCommand;
369
+
370
+ // src/commands/ExecuteStatementCommand.ts
371
+
372
+
373
+ var _ExecuteStatementCommand = class _ExecuteStatementCommand extends DynamoDBDocumentClientCommand {
374
+ constructor(input) {
375
+ super();
376
+ this.input = input;
377
+ this.inputKeyNodes = {
378
+ Parameters: ALL_MEMBERS
379
+ // set/list of AttributeValue
380
+ };
381
+ this.outputKeyNodes = {
382
+ Items: {
383
+ "*": ALL_VALUES
384
+ // map with AttributeValue
385
+ },
386
+ LastEvaluatedKey: ALL_VALUES
387
+ // map with AttributeValue
388
+ };
389
+ this.clientCommand = new import_client_dynamodb.ExecuteStatementCommand(this.input);
390
+ this.middlewareStack = this.clientCommand.middlewareStack;
391
+ }
392
+ /**
393
+ * @internal
394
+ */
395
+ resolveMiddleware(clientStack, configuration, options) {
396
+ this.addMarshallingMiddleware(configuration);
397
+ const stack = clientStack.concat(this.middlewareStack);
398
+ const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
399
+ return async () => handler(this.clientCommand);
400
+ }
401
+ };
402
+ __name(_ExecuteStatementCommand, "ExecuteStatementCommand");
403
+ var ExecuteStatementCommand = _ExecuteStatementCommand;
404
+
405
+ // src/commands/ExecuteTransactionCommand.ts
406
+
407
+
408
+ var _ExecuteTransactionCommand = class _ExecuteTransactionCommand extends DynamoDBDocumentClientCommand {
409
+ constructor(input) {
410
+ super();
411
+ this.input = input;
412
+ this.inputKeyNodes = {
413
+ TransactStatements: {
414
+ "*": {
415
+ Parameters: ALL_MEMBERS
416
+ // set/list of AttributeValue
417
+ }
418
+ }
419
+ };
420
+ this.outputKeyNodes = {
421
+ Responses: {
422
+ "*": {
423
+ Item: ALL_VALUES
424
+ // map with AttributeValue
425
+ }
426
+ }
427
+ };
428
+ this.clientCommand = new import_client_dynamodb.ExecuteTransactionCommand(this.input);
429
+ this.middlewareStack = this.clientCommand.middlewareStack;
430
+ }
431
+ /**
432
+ * @internal
433
+ */
434
+ resolveMiddleware(clientStack, configuration, options) {
435
+ this.addMarshallingMiddleware(configuration);
436
+ const stack = clientStack.concat(this.middlewareStack);
437
+ const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
438
+ return async () => handler(this.clientCommand);
439
+ }
440
+ };
441
+ __name(_ExecuteTransactionCommand, "ExecuteTransactionCommand");
442
+ var ExecuteTransactionCommand = _ExecuteTransactionCommand;
443
+
444
+ // src/commands/GetCommand.ts
445
+
446
+
447
+ var _GetCommand = class _GetCommand extends DynamoDBDocumentClientCommand {
448
+ constructor(input) {
449
+ super();
450
+ this.input = input;
451
+ this.inputKeyNodes = {
452
+ Key: ALL_VALUES
453
+ // map with AttributeValue
454
+ };
455
+ this.outputKeyNodes = {
456
+ Item: ALL_VALUES
457
+ // map with AttributeValue
458
+ };
459
+ this.clientCommand = new import_client_dynamodb.GetItemCommand(this.input);
460
+ this.middlewareStack = this.clientCommand.middlewareStack;
461
+ }
462
+ /**
463
+ * @internal
464
+ */
465
+ resolveMiddleware(clientStack, configuration, options) {
466
+ this.addMarshallingMiddleware(configuration);
467
+ const stack = clientStack.concat(this.middlewareStack);
468
+ const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
469
+ return async () => handler(this.clientCommand);
470
+ }
471
+ };
472
+ __name(_GetCommand, "GetCommand");
473
+ var GetCommand = _GetCommand;
474
+
475
+ // src/commands/PutCommand.ts
476
+
477
+
478
+ var _PutCommand = class _PutCommand extends DynamoDBDocumentClientCommand {
479
+ constructor(input) {
480
+ super();
481
+ this.input = input;
482
+ this.inputKeyNodes = {
483
+ Item: ALL_VALUES,
484
+ // map with AttributeValue
485
+ Expected: {
486
+ "*": {
487
+ Value: SELF,
488
+ AttributeValueList: ALL_MEMBERS
489
+ // set/list of AttributeValue
490
+ }
491
+ },
492
+ ExpressionAttributeValues: ALL_VALUES
493
+ // map with AttributeValue
494
+ };
495
+ this.outputKeyNodes = {
496
+ Attributes: ALL_VALUES,
497
+ // map with AttributeValue
498
+ ItemCollectionMetrics: {
499
+ ItemCollectionKey: ALL_VALUES
500
+ // map with AttributeValue
501
+ }
502
+ };
503
+ this.clientCommand = new import_client_dynamodb.PutItemCommand(this.input);
504
+ this.middlewareStack = this.clientCommand.middlewareStack;
505
+ }
506
+ /**
507
+ * @internal
508
+ */
509
+ resolveMiddleware(clientStack, configuration, options) {
510
+ this.addMarshallingMiddleware(configuration);
511
+ const stack = clientStack.concat(this.middlewareStack);
512
+ const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
513
+ return async () => handler(this.clientCommand);
514
+ }
515
+ };
516
+ __name(_PutCommand, "PutCommand");
517
+ var PutCommand = _PutCommand;
518
+
519
+ // src/commands/QueryCommand.ts
520
+
521
+
522
+ var _QueryCommand = class _QueryCommand extends DynamoDBDocumentClientCommand {
523
+ constructor(input) {
524
+ super();
525
+ this.input = input;
526
+ this.inputKeyNodes = {
527
+ KeyConditions: {
528
+ "*": {
529
+ AttributeValueList: ALL_MEMBERS
530
+ // set/list of AttributeValue
531
+ }
532
+ },
533
+ QueryFilter: {
534
+ "*": {
535
+ AttributeValueList: ALL_MEMBERS
536
+ // set/list of AttributeValue
537
+ }
538
+ },
539
+ ExclusiveStartKey: ALL_VALUES,
540
+ // map with AttributeValue
541
+ ExpressionAttributeValues: ALL_VALUES
542
+ // map with AttributeValue
543
+ };
544
+ this.outputKeyNodes = {
545
+ Items: {
546
+ "*": ALL_VALUES
547
+ // map with AttributeValue
548
+ },
549
+ LastEvaluatedKey: ALL_VALUES
550
+ // map with AttributeValue
551
+ };
552
+ this.clientCommand = new import_client_dynamodb.QueryCommand(this.input);
553
+ this.middlewareStack = this.clientCommand.middlewareStack;
554
+ }
555
+ /**
556
+ * @internal
557
+ */
558
+ resolveMiddleware(clientStack, configuration, options) {
559
+ this.addMarshallingMiddleware(configuration);
560
+ const stack = clientStack.concat(this.middlewareStack);
561
+ const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
562
+ return async () => handler(this.clientCommand);
563
+ }
564
+ };
565
+ __name(_QueryCommand, "QueryCommand");
566
+ var QueryCommand = _QueryCommand;
567
+
568
+ // src/commands/ScanCommand.ts
569
+
570
+
571
+ var _ScanCommand = class _ScanCommand extends DynamoDBDocumentClientCommand {
572
+ constructor(input) {
573
+ super();
574
+ this.input = input;
575
+ this.inputKeyNodes = {
576
+ ScanFilter: {
577
+ "*": {
578
+ AttributeValueList: ALL_MEMBERS
579
+ // set/list of AttributeValue
580
+ }
581
+ },
582
+ ExclusiveStartKey: ALL_VALUES,
583
+ // map with AttributeValue
584
+ ExpressionAttributeValues: ALL_VALUES
585
+ // map with AttributeValue
586
+ };
587
+ this.outputKeyNodes = {
588
+ Items: {
589
+ "*": ALL_VALUES
590
+ // map with AttributeValue
591
+ },
592
+ LastEvaluatedKey: ALL_VALUES
593
+ // map with AttributeValue
594
+ };
595
+ this.clientCommand = new import_client_dynamodb.ScanCommand(this.input);
596
+ this.middlewareStack = this.clientCommand.middlewareStack;
597
+ }
598
+ /**
599
+ * @internal
600
+ */
601
+ resolveMiddleware(clientStack, configuration, options) {
602
+ this.addMarshallingMiddleware(configuration);
603
+ const stack = clientStack.concat(this.middlewareStack);
604
+ const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
605
+ return async () => handler(this.clientCommand);
606
+ }
607
+ };
608
+ __name(_ScanCommand, "ScanCommand");
609
+ var ScanCommand = _ScanCommand;
610
+
611
+ // src/commands/TransactGetCommand.ts
612
+
613
+
614
+ var _TransactGetCommand = class _TransactGetCommand extends DynamoDBDocumentClientCommand {
615
+ constructor(input) {
616
+ super();
617
+ this.input = input;
618
+ this.inputKeyNodes = {
619
+ TransactItems: {
620
+ "*": {
621
+ Get: {
622
+ Key: ALL_VALUES
623
+ // map with AttributeValue
624
+ }
625
+ }
626
+ }
627
+ };
628
+ this.outputKeyNodes = {
629
+ Responses: {
630
+ "*": {
631
+ Item: ALL_VALUES
632
+ // map with AttributeValue
633
+ }
634
+ }
635
+ };
636
+ this.clientCommand = new import_client_dynamodb.TransactGetItemsCommand(this.input);
637
+ this.middlewareStack = this.clientCommand.middlewareStack;
638
+ }
639
+ /**
640
+ * @internal
641
+ */
642
+ resolveMiddleware(clientStack, configuration, options) {
643
+ this.addMarshallingMiddleware(configuration);
644
+ const stack = clientStack.concat(this.middlewareStack);
645
+ const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
646
+ return async () => handler(this.clientCommand);
647
+ }
648
+ };
649
+ __name(_TransactGetCommand, "TransactGetCommand");
650
+ var TransactGetCommand = _TransactGetCommand;
651
+
652
+ // src/commands/TransactWriteCommand.ts
653
+
654
+
655
+ var _TransactWriteCommand = class _TransactWriteCommand extends DynamoDBDocumentClientCommand {
656
+ constructor(input) {
657
+ super();
658
+ this.input = input;
659
+ this.inputKeyNodes = {
660
+ TransactItems: {
661
+ "*": {
662
+ ConditionCheck: {
663
+ Key: ALL_VALUES,
664
+ // map with AttributeValue
665
+ ExpressionAttributeValues: ALL_VALUES
666
+ // map with AttributeValue
667
+ },
668
+ Put: {
669
+ Item: ALL_VALUES,
670
+ // map with AttributeValue
671
+ ExpressionAttributeValues: ALL_VALUES
672
+ // map with AttributeValue
673
+ },
674
+ Delete: {
675
+ Key: ALL_VALUES,
676
+ // map with AttributeValue
677
+ ExpressionAttributeValues: ALL_VALUES
678
+ // map with AttributeValue
679
+ },
680
+ Update: {
681
+ Key: ALL_VALUES,
682
+ // map with AttributeValue
683
+ ExpressionAttributeValues: ALL_VALUES
684
+ // map with AttributeValue
685
+ }
686
+ }
687
+ }
688
+ };
689
+ this.outputKeyNodes = {
690
+ ItemCollectionMetrics: {
691
+ "*": {
692
+ "*": {
693
+ ItemCollectionKey: ALL_VALUES
694
+ // map with AttributeValue
695
+ }
696
+ }
697
+ }
698
+ };
699
+ this.clientCommand = new import_client_dynamodb.TransactWriteItemsCommand(this.input);
700
+ this.middlewareStack = this.clientCommand.middlewareStack;
701
+ }
702
+ /**
703
+ * @internal
704
+ */
705
+ resolveMiddleware(clientStack, configuration, options) {
706
+ this.addMarshallingMiddleware(configuration);
707
+ const stack = clientStack.concat(this.middlewareStack);
708
+ const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
709
+ return async () => handler(this.clientCommand);
710
+ }
711
+ };
712
+ __name(_TransactWriteCommand, "TransactWriteCommand");
713
+ var TransactWriteCommand = _TransactWriteCommand;
714
+
715
+ // src/commands/UpdateCommand.ts
716
+
717
+
718
+ var _UpdateCommand = class _UpdateCommand extends DynamoDBDocumentClientCommand {
719
+ constructor(input) {
720
+ super();
721
+ this.input = input;
722
+ this.inputKeyNodes = {
723
+ Key: ALL_VALUES,
724
+ // map with AttributeValue
725
+ AttributeUpdates: {
726
+ "*": {
727
+ Value: SELF
728
+ }
729
+ },
730
+ Expected: {
731
+ "*": {
732
+ Value: SELF,
733
+ AttributeValueList: ALL_MEMBERS
734
+ // set/list of AttributeValue
735
+ }
736
+ },
737
+ ExpressionAttributeValues: ALL_VALUES
738
+ // map with AttributeValue
739
+ };
740
+ this.outputKeyNodes = {
741
+ Attributes: ALL_VALUES,
742
+ // map with AttributeValue
743
+ ItemCollectionMetrics: {
744
+ ItemCollectionKey: ALL_VALUES
745
+ // map with AttributeValue
746
+ }
747
+ };
748
+ this.clientCommand = new import_client_dynamodb.UpdateItemCommand(this.input);
749
+ this.middlewareStack = this.clientCommand.middlewareStack;
750
+ }
751
+ /**
752
+ * @internal
753
+ */
754
+ resolveMiddleware(clientStack, configuration, options) {
755
+ this.addMarshallingMiddleware(configuration);
756
+ const stack = clientStack.concat(this.middlewareStack);
757
+ const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
758
+ return async () => handler(this.clientCommand);
759
+ }
760
+ };
761
+ __name(_UpdateCommand, "UpdateCommand");
762
+ var UpdateCommand = _UpdateCommand;
763
+
764
+ // src/DynamoDBDocumentClient.ts
765
+
766
+ var _DynamoDBDocumentClient = class _DynamoDBDocumentClient extends import_smithy_client.Client {
767
+ constructor(client, translateConfig) {
768
+ super(client.config);
769
+ this.config = client.config;
770
+ this.config.translateConfig = translateConfig;
771
+ this.middlewareStack = client.middlewareStack;
772
+ }
773
+ static from(client, translateConfig) {
774
+ return new _DynamoDBDocumentClient(client, translateConfig);
775
+ }
776
+ destroy() {
777
+ }
778
+ };
779
+ __name(_DynamoDBDocumentClient, "DynamoDBDocumentClient");
780
+ var DynamoDBDocumentClient = _DynamoDBDocumentClient;
781
+
782
+ // src/DynamoDBDocument.ts
783
+ var _DynamoDBDocument = class _DynamoDBDocument extends DynamoDBDocumentClient {
784
+ static from(client, translateConfig) {
785
+ return new _DynamoDBDocument(client, translateConfig);
786
+ }
787
+ batchExecuteStatement(args, optionsOrCb, cb) {
788
+ const command = new BatchExecuteStatementCommand(args);
789
+ if (typeof optionsOrCb === "function") {
790
+ this.send(command, optionsOrCb);
791
+ } else if (typeof cb === "function") {
792
+ if (typeof optionsOrCb !== "object")
793
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
794
+ this.send(command, optionsOrCb || {}, cb);
795
+ } else {
796
+ return this.send(command, optionsOrCb);
797
+ }
798
+ }
799
+ batchGet(args, optionsOrCb, cb) {
800
+ const command = new BatchGetCommand(args);
801
+ if (typeof optionsOrCb === "function") {
802
+ this.send(command, optionsOrCb);
803
+ } else if (typeof cb === "function") {
804
+ if (typeof optionsOrCb !== "object")
805
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
806
+ this.send(command, optionsOrCb || {}, cb);
807
+ } else {
808
+ return this.send(command, optionsOrCb);
809
+ }
810
+ }
811
+ batchWrite(args, optionsOrCb, cb) {
812
+ const command = new BatchWriteCommand(args);
813
+ if (typeof optionsOrCb === "function") {
814
+ this.send(command, optionsOrCb);
815
+ } else if (typeof cb === "function") {
816
+ if (typeof optionsOrCb !== "object")
817
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
818
+ this.send(command, optionsOrCb || {}, cb);
819
+ } else {
820
+ return this.send(command, optionsOrCb);
821
+ }
822
+ }
823
+ delete(args, optionsOrCb, cb) {
824
+ const command = new DeleteCommand(args);
825
+ if (typeof optionsOrCb === "function") {
826
+ this.send(command, optionsOrCb);
827
+ } else if (typeof cb === "function") {
828
+ if (typeof optionsOrCb !== "object")
829
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
830
+ this.send(command, optionsOrCb || {}, cb);
831
+ } else {
832
+ return this.send(command, optionsOrCb);
833
+ }
834
+ }
835
+ executeStatement(args, optionsOrCb, cb) {
836
+ const command = new ExecuteStatementCommand(args);
837
+ if (typeof optionsOrCb === "function") {
838
+ this.send(command, optionsOrCb);
839
+ } else if (typeof cb === "function") {
840
+ if (typeof optionsOrCb !== "object")
841
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
842
+ this.send(command, optionsOrCb || {}, cb);
843
+ } else {
844
+ return this.send(command, optionsOrCb);
845
+ }
846
+ }
847
+ executeTransaction(args, optionsOrCb, cb) {
848
+ const command = new ExecuteTransactionCommand(args);
849
+ if (typeof optionsOrCb === "function") {
850
+ this.send(command, optionsOrCb);
851
+ } else if (typeof cb === "function") {
852
+ if (typeof optionsOrCb !== "object")
853
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
854
+ this.send(command, optionsOrCb || {}, cb);
855
+ } else {
856
+ return this.send(command, optionsOrCb);
857
+ }
858
+ }
859
+ get(args, optionsOrCb, cb) {
860
+ const command = new GetCommand(args);
861
+ if (typeof optionsOrCb === "function") {
862
+ this.send(command, optionsOrCb);
863
+ } else if (typeof cb === "function") {
864
+ if (typeof optionsOrCb !== "object")
865
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
866
+ this.send(command, optionsOrCb || {}, cb);
867
+ } else {
868
+ return this.send(command, optionsOrCb);
869
+ }
870
+ }
871
+ put(args, optionsOrCb, cb) {
872
+ const command = new PutCommand(args);
873
+ if (typeof optionsOrCb === "function") {
874
+ this.send(command, optionsOrCb);
875
+ } else if (typeof cb === "function") {
876
+ if (typeof optionsOrCb !== "object")
877
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
878
+ this.send(command, optionsOrCb || {}, cb);
879
+ } else {
880
+ return this.send(command, optionsOrCb);
881
+ }
882
+ }
883
+ query(args, optionsOrCb, cb) {
884
+ const command = new QueryCommand(args);
885
+ if (typeof optionsOrCb === "function") {
886
+ this.send(command, optionsOrCb);
887
+ } else if (typeof cb === "function") {
888
+ if (typeof optionsOrCb !== "object")
889
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
890
+ this.send(command, optionsOrCb || {}, cb);
891
+ } else {
892
+ return this.send(command, optionsOrCb);
893
+ }
894
+ }
895
+ scan(args, optionsOrCb, cb) {
896
+ const command = new ScanCommand(args);
897
+ if (typeof optionsOrCb === "function") {
898
+ this.send(command, optionsOrCb);
899
+ } else if (typeof cb === "function") {
900
+ if (typeof optionsOrCb !== "object")
901
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
902
+ this.send(command, optionsOrCb || {}, cb);
903
+ } else {
904
+ return this.send(command, optionsOrCb);
905
+ }
906
+ }
907
+ transactGet(args, optionsOrCb, cb) {
908
+ const command = new TransactGetCommand(args);
909
+ if (typeof optionsOrCb === "function") {
910
+ this.send(command, optionsOrCb);
911
+ } else if (typeof cb === "function") {
912
+ if (typeof optionsOrCb !== "object")
913
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
914
+ this.send(command, optionsOrCb || {}, cb);
915
+ } else {
916
+ return this.send(command, optionsOrCb);
917
+ }
918
+ }
919
+ transactWrite(args, optionsOrCb, cb) {
920
+ const command = new TransactWriteCommand(args);
921
+ if (typeof optionsOrCb === "function") {
922
+ this.send(command, optionsOrCb);
923
+ } else if (typeof cb === "function") {
924
+ if (typeof optionsOrCb !== "object")
925
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
926
+ this.send(command, optionsOrCb || {}, cb);
927
+ } else {
928
+ return this.send(command, optionsOrCb);
929
+ }
930
+ }
931
+ update(args, optionsOrCb, cb) {
932
+ const command = new UpdateCommand(args);
933
+ if (typeof optionsOrCb === "function") {
934
+ this.send(command, optionsOrCb);
935
+ } else if (typeof cb === "function") {
936
+ if (typeof optionsOrCb !== "object")
937
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
938
+ this.send(command, optionsOrCb || {}, cb);
939
+ } else {
940
+ return this.send(command, optionsOrCb);
941
+ }
942
+ }
943
+ };
944
+ __name(_DynamoDBDocument, "DynamoDBDocument");
945
+ var DynamoDBDocument = _DynamoDBDocument;
946
+
947
+ // src/pagination/Interfaces.ts
948
+ var import_types = require("@smithy/types");
949
+
950
+ // src/pagination/QueryPaginator.ts
951
+
952
+ var makePagedClientRequest = /* @__PURE__ */ __name(async (client, input, ...args) => {
953
+ return await client.send(new QueryCommand(input), ...args);
954
+ }, "makePagedClientRequest");
955
+ async function* paginateQuery(config, input, ...additionalArguments) {
956
+ let token = config.startingToken || void 0;
957
+ let hasNext = true;
958
+ let page;
959
+ while (hasNext) {
960
+ input.ExclusiveStartKey = token;
961
+ input["Limit"] = config.pageSize;
962
+ if (config.client instanceof DynamoDBDocumentClient) {
963
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
964
+ } else {
965
+ throw new Error("Invalid client, expected DynamoDBDocument | DynamoDBDocumentClient");
966
+ }
967
+ yield page;
968
+ token = page.LastEvaluatedKey;
969
+ hasNext = !!token;
970
+ }
971
+ return void 0;
972
+ }
973
+ __name(paginateQuery, "paginateQuery");
974
+
975
+ // src/pagination/ScanPaginator.ts
976
+
977
+ var makePagedClientRequest2 = /* @__PURE__ */ __name(async (client, input, ...args) => {
978
+ return await client.send(new ScanCommand(input), ...args);
979
+ }, "makePagedClientRequest");
980
+ async function* paginateScan(config, input, ...additionalArguments) {
981
+ let token = config.startingToken || void 0;
982
+ let hasNext = true;
983
+ let page;
984
+ while (hasNext) {
985
+ input.ExclusiveStartKey = token;
986
+ input["Limit"] = config.pageSize;
987
+ if (config.client instanceof DynamoDBDocumentClient) {
988
+ page = await makePagedClientRequest2(config.client, input, ...additionalArguments);
989
+ } else {
990
+ throw new Error("Invalid client, expected DynamoDBDocument | DynamoDBDocumentClient");
991
+ }
992
+ yield page;
993
+ token = page.LastEvaluatedKey;
994
+ hasNext = !!token;
995
+ }
996
+ return void 0;
997
+ }
998
+ __name(paginateScan, "paginateScan");
999
+
1000
+ // src/index.ts
1001
+
1002
+ // Annotate the CommonJS export names for ESM import in node:
1003
+ 0 && (module.exports = {
1004
+ BatchExecuteStatementCommand,
1005
+ BatchGetCommand,
1006
+ BatchWriteCommand,
1007
+ DeleteCommand,
1008
+ DynamoDBDocument,
1009
+ DynamoDBDocumentClient,
1010
+ DynamoDBDocumentClientCommand,
1011
+ ExecuteStatementCommand,
1012
+ ExecuteTransactionCommand,
1013
+ GetCommand,
1014
+ NumberValue,
1015
+ PaginationConfiguration,
1016
+ PutCommand,
1017
+ QueryCommand,
1018
+ ScanCommand,
1019
+ TransactGetCommand,
1020
+ TransactWriteCommand,
1021
+ UpdateCommand,
1022
+ __Client,
1023
+ paginateQuery,
1024
+ paginateScan
1025
+ });