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