dyno-table 2.2.0 → 2.3.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 (106) hide show
  1. package/README.md +200 -1860
  2. package/dist/builders.cjs +55 -0
  3. package/dist/builders.d.cts +4 -0
  4. package/dist/builders.d.ts +4 -0
  5. package/dist/builders.js +2 -0
  6. package/dist/chunk-2EWNZOUK.js +618 -0
  7. package/dist/chunk-2WIBY7PZ.js +46 -0
  8. package/dist/chunk-7UJJ7JXM.cjs +63 -0
  9. package/dist/chunk-DTFJJASK.js +3200 -0
  10. package/dist/chunk-EODPMYPE.js +558 -0
  11. package/dist/chunk-KA3VPIPS.cjs +560 -0
  12. package/dist/chunk-NTA6GDPP.cjs +622 -0
  13. package/dist/chunk-PB7BBCZO.cjs +32 -0
  14. package/dist/chunk-QVRMYGC4.js +29 -0
  15. package/dist/chunk-XYL43FDX.cjs +3217 -0
  16. package/dist/{conditions-CC3NDfUU.d.cts → conditions-CcZL0sR2.d.cts} +1 -1
  17. package/dist/{conditions-DD0bvyHm.d.ts → conditions-D_w7vVYG.d.ts} +1 -1
  18. package/dist/conditions.cjs +67 -62
  19. package/dist/conditions.d.cts +1 -1
  20. package/dist/conditions.d.ts +1 -1
  21. package/dist/conditions.js +1 -48
  22. package/dist/entity.cjs +14 -625
  23. package/dist/entity.d.cts +5 -13
  24. package/dist/entity.d.ts +5 -13
  25. package/dist/entity.js +2 -626
  26. package/dist/index-2cbm07Bi.d.ts +2797 -0
  27. package/dist/index-DlN8G9hd.d.cts +2797 -0
  28. package/dist/index.cjs +111 -4446
  29. package/dist/index.d.cts +3 -11
  30. package/dist/index.d.ts +3 -11
  31. package/dist/index.js +5 -4428
  32. package/dist/standard-schema.cjs +0 -2
  33. package/dist/standard-schema.js +0 -2
  34. package/dist/table.cjs +7 -3782
  35. package/dist/table.d.cts +163 -12
  36. package/dist/table.d.ts +163 -12
  37. package/dist/table.js +3 -3785
  38. package/dist/types.cjs +0 -2
  39. package/dist/types.js +0 -2
  40. package/dist/utils.cjs +10 -30
  41. package/dist/utils.js +1 -31
  42. package/package.json +12 -67
  43. package/dist/batch-builder-BPoHyN_Q.d.cts +0 -398
  44. package/dist/batch-builder-Cdo49C2r.d.ts +0 -398
  45. package/dist/builder-types-BTVhQSHI.d.cts +0 -169
  46. package/dist/builder-types-CzuLR4Th.d.ts +0 -169
  47. package/dist/builders/condition-check-builder.cjs +0 -422
  48. package/dist/builders/condition-check-builder.cjs.map +0 -1
  49. package/dist/builders/condition-check-builder.d.cts +0 -153
  50. package/dist/builders/condition-check-builder.d.ts +0 -153
  51. package/dist/builders/condition-check-builder.js +0 -420
  52. package/dist/builders/condition-check-builder.js.map +0 -1
  53. package/dist/builders/delete-builder.cjs +0 -484
  54. package/dist/builders/delete-builder.cjs.map +0 -1
  55. package/dist/builders/delete-builder.d.cts +0 -211
  56. package/dist/builders/delete-builder.d.ts +0 -211
  57. package/dist/builders/delete-builder.js +0 -482
  58. package/dist/builders/delete-builder.js.map +0 -1
  59. package/dist/builders/paginator.cjs +0 -193
  60. package/dist/builders/paginator.cjs.map +0 -1
  61. package/dist/builders/paginator.d.cts +0 -155
  62. package/dist/builders/paginator.d.ts +0 -155
  63. package/dist/builders/paginator.js +0 -191
  64. package/dist/builders/paginator.js.map +0 -1
  65. package/dist/builders/put-builder.cjs +0 -554
  66. package/dist/builders/put-builder.cjs.map +0 -1
  67. package/dist/builders/put-builder.d.cts +0 -319
  68. package/dist/builders/put-builder.d.ts +0 -319
  69. package/dist/builders/put-builder.js +0 -552
  70. package/dist/builders/put-builder.js.map +0 -1
  71. package/dist/builders/query-builder.cjs +0 -743
  72. package/dist/builders/query-builder.cjs.map +0 -1
  73. package/dist/builders/query-builder.d.cts +0 -6
  74. package/dist/builders/query-builder.d.ts +0 -6
  75. package/dist/builders/query-builder.js +0 -741
  76. package/dist/builders/query-builder.js.map +0 -1
  77. package/dist/builders/transaction-builder.cjs +0 -906
  78. package/dist/builders/transaction-builder.cjs.map +0 -1
  79. package/dist/builders/transaction-builder.d.cts +0 -464
  80. package/dist/builders/transaction-builder.d.ts +0 -464
  81. package/dist/builders/transaction-builder.js +0 -904
  82. package/dist/builders/transaction-builder.js.map +0 -1
  83. package/dist/builders/update-builder.cjs +0 -668
  84. package/dist/builders/update-builder.cjs.map +0 -1
  85. package/dist/builders/update-builder.d.cts +0 -374
  86. package/dist/builders/update-builder.d.ts +0 -374
  87. package/dist/builders/update-builder.js +0 -666
  88. package/dist/builders/update-builder.js.map +0 -1
  89. package/dist/conditions.cjs.map +0 -1
  90. package/dist/conditions.js.map +0 -1
  91. package/dist/entity.cjs.map +0 -1
  92. package/dist/entity.js.map +0 -1
  93. package/dist/index.cjs.map +0 -1
  94. package/dist/index.js.map +0 -1
  95. package/dist/query-builder-CUWdavZw.d.ts +0 -477
  96. package/dist/query-builder-DoZzZz_c.d.cts +0 -477
  97. package/dist/standard-schema.cjs.map +0 -1
  98. package/dist/standard-schema.js.map +0 -1
  99. package/dist/table-CZBMkW2Z.d.ts +0 -276
  100. package/dist/table-f-3wsT7K.d.cts +0 -276
  101. package/dist/table.cjs.map +0 -1
  102. package/dist/table.js.map +0 -1
  103. package/dist/types.cjs.map +0 -1
  104. package/dist/types.js.map +0 -1
  105. package/dist/utils.cjs.map +0 -1
  106. package/dist/utils.js.map +0 -1
@@ -1,552 +0,0 @@
1
- // src/conditions.ts
2
- var createComparisonCondition = (type) => (attr, value) => ({
3
- type,
4
- attr,
5
- value
6
- });
7
- var eq = createComparisonCondition("eq");
8
- var ne = createComparisonCondition("ne");
9
- var lt = createComparisonCondition("lt");
10
- var lte = createComparisonCondition("lte");
11
- var gt = createComparisonCondition("gt");
12
- var gte = createComparisonCondition("gte");
13
- var between = (attr, lower, upper) => ({
14
- type: "between",
15
- attr,
16
- value: [lower, upper]
17
- });
18
- var inArray = (attr, values) => ({
19
- type: "in",
20
- attr,
21
- value: values
22
- });
23
- var beginsWith = createComparisonCondition("beginsWith");
24
- var contains = createComparisonCondition("contains");
25
- var attributeExists = (attr) => ({
26
- type: "attributeExists",
27
- attr
28
- });
29
- var attributeNotExists = (attr) => ({
30
- type: "attributeNotExists",
31
- attr
32
- });
33
- var and = (...conditions) => ({
34
- type: "and",
35
- conditions
36
- });
37
- var or = (...conditions) => ({
38
- type: "or",
39
- conditions
40
- });
41
- var not = (condition) => ({
42
- type: "not",
43
- condition
44
- });
45
-
46
- // src/expression.ts
47
- var generateAttributeName = (params, attr) => {
48
- if (attr.includes(".")) {
49
- const pathSegments = attr.split(".");
50
- const segmentNames = [];
51
- for (const segment of pathSegments) {
52
- let segmentName;
53
- for (const [existingName, existingAttr] of Object.entries(params.expressionAttributeNames)) {
54
- if (existingAttr === segment) {
55
- segmentName = existingName;
56
- break;
57
- }
58
- }
59
- if (!segmentName) {
60
- segmentName = `#${Object.keys(params.expressionAttributeNames).length}`;
61
- params.expressionAttributeNames[segmentName] = segment;
62
- }
63
- segmentNames.push(segmentName);
64
- }
65
- return segmentNames.join(".");
66
- }
67
- for (const [existingName, existingAttr] of Object.entries(params.expressionAttributeNames)) {
68
- if (existingAttr === attr) {
69
- return existingName;
70
- }
71
- }
72
- const attrName = `#${Object.keys(params.expressionAttributeNames).length}`;
73
- params.expressionAttributeNames[attrName] = attr;
74
- return attrName;
75
- };
76
- var generateValueName = (params, value) => {
77
- const valueName = `:${params.valueCounter.count++}`;
78
- params.expressionAttributeValues[valueName] = value;
79
- return valueName;
80
- };
81
- var validateCondition = (condition, requiresAttr = true, requiresValue = true) => {
82
- if (requiresAttr && !condition.attr) {
83
- throw new Error(`Attribute is required for ${condition.type} condition`);
84
- }
85
- if (requiresValue && condition.value === void 0) {
86
- throw new Error(`Value is required for ${condition.type} condition`);
87
- }
88
- };
89
- var buildComparisonExpression = (condition, operator, params) => {
90
- validateCondition(condition);
91
- if (!condition.attr) {
92
- throw new Error(`Attribute is required for ${condition.type} condition`);
93
- }
94
- const attrName = generateAttributeName(params, condition.attr);
95
- const valueName = generateValueName(params, condition.value);
96
- return `${attrName} ${operator} ${valueName}`;
97
- };
98
- var buildBetweenExpression = (condition, params) => {
99
- validateCondition(condition);
100
- if (!condition.attr) {
101
- throw new Error(`Attribute is required for ${condition.type} condition`);
102
- }
103
- if (!Array.isArray(condition.value) || condition.value.length !== 2) {
104
- throw new Error("Between condition requires an array of two values");
105
- }
106
- const attrName = generateAttributeName(params, condition.attr);
107
- const lowerName = generateValueName(params, condition.value[0]);
108
- const upperName = generateValueName(params, condition.value[1]);
109
- return `${attrName} BETWEEN ${lowerName} AND ${upperName}`;
110
- };
111
- var buildInExpression = (condition, params) => {
112
- validateCondition(condition);
113
- if (!condition.attr) {
114
- throw new Error(`Attribute is required for ${condition.type} condition`);
115
- }
116
- if (!Array.isArray(condition.value) || condition.value.length === 0) {
117
- throw new Error("In condition requires a non-empty array of values");
118
- }
119
- if (condition.value.length > 100) {
120
- throw new Error("In condition supports a maximum of 100 values");
121
- }
122
- const attrName = generateAttributeName(params, condition.attr);
123
- const valueNames = condition.value.map((value) => generateValueName(params, value));
124
- return `${attrName} IN (${valueNames.join(", ")})`;
125
- };
126
- var buildFunctionExpression = (functionName, condition, params) => {
127
- validateCondition(condition);
128
- if (!condition.attr) {
129
- throw new Error(`Attribute is required for ${condition.type} condition`);
130
- }
131
- const attrName = generateAttributeName(params, condition.attr);
132
- const valueName = generateValueName(params, condition.value);
133
- return `${functionName}(${attrName}, ${valueName})`;
134
- };
135
- var buildAttributeFunction = (functionName, condition, params) => {
136
- validateCondition(condition, true, false);
137
- if (!condition.attr) {
138
- throw new Error(`Attribute is required for ${condition.type} condition`);
139
- }
140
- const attrName = generateAttributeName(params, condition.attr);
141
- return `${functionName}(${attrName})`;
142
- };
143
- var buildLogicalExpression = (operator, conditions, params) => {
144
- if (!conditions || conditions.length === 0) {
145
- throw new Error(`At least one condition is required for ${operator} expression`);
146
- }
147
- const expressions = conditions.map((c) => buildExpression(c, params));
148
- return `(${expressions.join(` ${operator} `)})`;
149
- };
150
- var buildExpression = (condition, params) => {
151
- if (!condition) return "";
152
- try {
153
- const expressionBuilders = {
154
- eq: () => buildComparisonExpression(condition, "=", params),
155
- ne: () => buildComparisonExpression(condition, "<>", params),
156
- lt: () => buildComparisonExpression(condition, "<", params),
157
- lte: () => buildComparisonExpression(condition, "<=", params),
158
- gt: () => buildComparisonExpression(condition, ">", params),
159
- gte: () => buildComparisonExpression(condition, ">=", params),
160
- between: () => buildBetweenExpression(condition, params),
161
- in: () => buildInExpression(condition, params),
162
- beginsWith: () => buildFunctionExpression("begins_with", condition, params),
163
- contains: () => buildFunctionExpression("contains", condition, params),
164
- attributeExists: () => buildAttributeFunction("attribute_exists", condition, params),
165
- attributeNotExists: () => buildAttributeFunction("attribute_not_exists", condition, params),
166
- and: () => {
167
- if (!condition.conditions) {
168
- throw new Error("Conditions array is required for AND operator");
169
- }
170
- return buildLogicalExpression("AND", condition.conditions, params);
171
- },
172
- or: () => {
173
- if (!condition.conditions) {
174
- throw new Error("Conditions array is required for OR operator");
175
- }
176
- return buildLogicalExpression("OR", condition.conditions, params);
177
- },
178
- not: () => {
179
- if (!condition.condition) {
180
- throw new Error("Condition is required for NOT operator");
181
- }
182
- return `NOT (${buildExpression(condition.condition, params)})`;
183
- }
184
- };
185
- const builder = expressionBuilders[condition.type];
186
- if (!builder) {
187
- throw new Error(`Unknown condition type: ${condition.type}`);
188
- }
189
- return builder();
190
- } catch (error) {
191
- if (error instanceof Error) {
192
- console.error(`Error building expression for condition type ${condition.type}:`, error.message);
193
- } else {
194
- console.error(`Error building expression for condition type ${condition.type}:`, error);
195
- }
196
- throw error;
197
- }
198
- };
199
- var prepareExpressionParams = (condition) => {
200
- if (!condition) return {};
201
- const params = {
202
- expressionAttributeNames: {},
203
- expressionAttributeValues: {},
204
- valueCounter: { count: 0 }
205
- };
206
- const expression = buildExpression(condition, params);
207
- return {
208
- expression,
209
- names: Object.keys(params.expressionAttributeNames).length > 0 ? params.expressionAttributeNames : void 0,
210
- values: Object.keys(params.expressionAttributeValues).length > 0 ? params.expressionAttributeValues : void 0
211
- };
212
- };
213
-
214
- // src/utils/debug-expression.ts
215
- function debugCommand(command) {
216
- const result = {};
217
- function replaceAliases(expressionString) {
218
- if (!expressionString) {
219
- return expressionString;
220
- }
221
- let replacedString = expressionString;
222
- for (const alias in command.expressionAttributeNames) {
223
- const attributeName = command.expressionAttributeNames[alias];
224
- const regex = new RegExp(alias, "g");
225
- replacedString = replacedString.replace(regex, attributeName);
226
- }
227
- for (const alias in command.expressionAttributeValues) {
228
- let attributeValue = command.expressionAttributeValues[alias];
229
- if (attributeValue instanceof Set) {
230
- const array = Array.from(attributeValue);
231
- attributeValue = `Set(${array.length}){${array.map((v) => JSON.stringify(v)).join(", ")}}`;
232
- } else {
233
- attributeValue = JSON.stringify(attributeValue);
234
- }
235
- const regex = new RegExp(alias, "g");
236
- replacedString = replacedString.replace(regex, attributeValue);
237
- }
238
- return replacedString;
239
- }
240
- if (command.updateExpression) {
241
- result.updateExpression = replaceAliases(command.updateExpression);
242
- }
243
- if (command.conditionExpression) {
244
- result.conditionExpression = replaceAliases(command.conditionExpression);
245
- }
246
- if (command.filterExpression) {
247
- result.filterExpression = replaceAliases(command.filterExpression);
248
- }
249
- if (command.keyConditionExpression) {
250
- result.keyConditionExpression = replaceAliases(command.keyConditionExpression);
251
- }
252
- if (command.projectionExpression) {
253
- result.projectionExpression = replaceAliases(command.projectionExpression);
254
- }
255
- return {
256
- raw: command,
257
- readable: result
258
- };
259
- }
260
-
261
- // src/builders/put-builder.ts
262
- var PutBuilder = class {
263
- item;
264
- options;
265
- executor;
266
- tableName;
267
- constructor(executor, item, tableName) {
268
- this.executor = executor;
269
- this.item = item;
270
- this.tableName = tableName;
271
- this.options = {
272
- returnValues: "NONE"
273
- };
274
- }
275
- set(valuesOrPath, value) {
276
- if (typeof valuesOrPath === "object") {
277
- Object.assign(this.item, valuesOrPath);
278
- } else {
279
- this.item[valuesOrPath] = value;
280
- }
281
- return this;
282
- }
283
- /**
284
- * Adds a condition that must be satisfied for the put operation to succeed.
285
- *
286
- * @example
287
- * ```ts
288
- * // Ensure item doesn't exist (insert only)
289
- * builder.condition(op => op.attributeNotExists('id'))
290
- *
291
- * // Complex condition with version check
292
- * builder.condition(op =>
293
- * op.and([
294
- * op.attributeExists('id'),
295
- * op.eq('version', currentVersion),
296
- * op.eq('status', 'ACTIVE')
297
- * ])
298
- * )
299
- * ```
300
- *
301
- * @param condition - Either a Condition object or a callback function that builds the condition
302
- * @returns The builder instance for method chaining
303
- */
304
- /**
305
- * Adds a condition that must be satisfied for the put operation to succeed.
306
- *
307
- * @example
308
- * ```typescript
309
- * // Ensure unique dinosaur ID
310
- * builder.condition(op =>
311
- * op.attributeNotExists('id')
312
- * );
313
- *
314
- * // Verify habitat requirements
315
- * builder.condition(op =>
316
- * op.and([
317
- * op.eq('securityStatus', 'READY'),
318
- * op.attributeExists('lastInspection'),
319
- * op.gt('securityLevel', 5)
320
- * ])
321
- * );
322
- *
323
- * // Check breeding facility conditions
324
- * builder.condition(op =>
325
- * op.and([
326
- * op.between('temperature', 25, 30),
327
- * op.between('humidity', 60, 80),
328
- * op.eq('quarantineStatus', 'CLEAR')
329
- * ])
330
- * );
331
- * ```
332
- *
333
- * @param condition - Either a Condition object or a callback function that builds the condition
334
- * @returns The builder instance for method chaining
335
- */
336
- condition(condition) {
337
- if (typeof condition === "function") {
338
- const conditionOperator = {
339
- eq,
340
- ne,
341
- lt,
342
- lte,
343
- gt,
344
- gte,
345
- between,
346
- inArray,
347
- beginsWith,
348
- contains,
349
- attributeExists,
350
- attributeNotExists,
351
- and,
352
- or,
353
- not
354
- };
355
- this.options.condition = condition(conditionOperator);
356
- } else {
357
- this.options.condition = condition;
358
- }
359
- return this;
360
- }
361
- /**
362
- * Sets whether to return the item's previous values (if it existed).
363
- *
364
- * @options
365
- * - NONE: No return value
366
- * - ALL_OLD: Returns the item's previous state if it existed, no read capacity units are consumed
367
- * - CONSISTENT: Performs a GET operation after the put to retrieve the item's new state
368
- * - INPUT: Returns the input values that were passed to the operation
369
- *
370
- * @example
371
- * ```ts
372
- * // Get previous dinosaur state
373
- * const result = await builder
374
- * .returnValues('ALL_OLD')
375
- * .execute();
376
- *
377
- * if (result) {
378
- * console.log('Previous profile:', {
379
- * species: result.species,
380
- * status: result.status,
381
- * stats: {
382
- * health: result.stats.health,
383
- * threatLevel: result.stats.threatLevel
384
- * }
385
- * });
386
- * }
387
- *
388
- * // Return input values for create operations
389
- * const createResult = await builder
390
- * .returnValues('INPUT')
391
- * .execute();
392
- * ```
393
- *
394
- * @param returnValues - Use 'ALL_OLD' to return previous values, 'INPUT' to return input values, 'CONSISTENT' for fresh data, or 'NONE' (default).
395
- * @returns The builder instance for method chaining
396
- */
397
- returnValues(returnValues) {
398
- this.options.returnValues = returnValues;
399
- return this;
400
- }
401
- /**
402
- * Generate the DynamoDB command parameters
403
- */
404
- toDynamoCommand() {
405
- const { expression, names, values } = prepareExpressionParams(this.options.condition);
406
- return {
407
- tableName: this.tableName,
408
- item: this.item,
409
- conditionExpression: expression,
410
- expressionAttributeNames: names,
411
- expressionAttributeValues: values,
412
- returnValues: this.options.returnValues
413
- };
414
- }
415
- /**
416
- * Adds this put operation to a transaction.
417
- *
418
- * @example
419
- * ```ts
420
- * const transaction = new TransactionBuilder();
421
- *
422
- * // Add dinosaur to new habitat
423
- * new PutBuilder(executor, {
424
- * id: 'TREX-002',
425
- * location: 'PADDOCK-B',
426
- * status: 'ACTIVE',
427
- * transferDate: new Date().toISOString()
428
- * }, 'dinosaurs')
429
- * .withTransaction(transaction);
430
- *
431
- * // Update habitat records
432
- * new UpdateBuilder(executor, 'habitats', { id: 'PADDOCK-B' })
433
- * .add('occupants', 1)
434
- * .set('lastTransfer', new Date().toISOString())
435
- * .withTransaction(transaction);
436
- *
437
- * // Execute transfer atomically
438
- * await transaction.execute();
439
- * ```
440
- *
441
- * @param transaction - The transaction builder to add this operation to
442
- * @returns The builder instance for method chaining
443
- */
444
- withTransaction(transaction) {
445
- const command = this.toDynamoCommand();
446
- transaction.putWithCommand(command);
447
- return this;
448
- }
449
- /**
450
- * Adds this put operation to a batch with optional entity type information.
451
- *
452
- * @example Basic Usage
453
- * ```ts
454
- * const batch = table.batchBuilder();
455
- *
456
- * // Add multiple dinosaurs to batch
457
- * dinosaurRepo.create(newDino1).withBatch(batch);
458
- * dinosaurRepo.create(newDino2).withBatch(batch);
459
- * dinosaurRepo.create(newDino3).withBatch(batch);
460
- *
461
- * // Execute all operations efficiently
462
- * await batch.execute();
463
- * ```
464
- *
465
- * @example Typed Usage
466
- * ```ts
467
- * const batch = table.batchBuilder<{
468
- * User: UserEntity;
469
- * Order: OrderEntity;
470
- * }>();
471
- *
472
- * // Add operations with type information
473
- * userRepo.create(newUser).withBatch(batch, 'User');
474
- * orderRepo.create(newOrder).withBatch(batch, 'Order');
475
- *
476
- * // Execute and get typed results
477
- * const result = await batch.execute();
478
- * const users: UserEntity[] = result.reads.itemsByType.User;
479
- * ```
480
- *
481
- * @param batch - The batch builder to add this operation to
482
- * @param entityType - Optional entity type key for type tracking
483
- */
484
- withBatch(batch, entityType) {
485
- const command = this.toDynamoCommand();
486
- batch.putWithCommand(command, entityType);
487
- }
488
- /**
489
- * Executes the put operation against DynamoDB.
490
- *
491
- * @example
492
- * ```ts
493
- * try {
494
- * // Put with condition and return old values
495
- * const result = await new PutBuilder(executor, newItem, 'myTable')
496
- * .condition(op => op.eq('version', 1))
497
- * .returnValues('ALL_OLD')
498
- * .execute();
499
- *
500
- * console.log('Put successful, old item:', result);
501
- * } catch (error) {
502
- * // Handle condition check failure or other errors
503
- * console.error('Put failed:', error);
504
- * }
505
- * ```
506
- *
507
- * @returns A promise that resolves to the operation result (type depends on returnValues setting)
508
- * @throws Will throw an error if the condition check fails or other DynamoDB errors occur
509
- */
510
- async execute() {
511
- const params = this.toDynamoCommand();
512
- return this.executor(params);
513
- }
514
- /**
515
- * Gets a human-readable representation of the put command
516
- * with all expression placeholders replaced by their actual values.
517
- *
518
- * @example
519
- * ```ts
520
- * const debugInfo = new PutBuilder(executor, {
521
- * id: 'RAPTOR-003',
522
- * species: 'Velociraptor',
523
- * status: 'QUARANTINE',
524
- * stats: {
525
- * health: 100,
526
- * aggressionLevel: 7,
527
- * age: 2
528
- * }
529
- * }, 'dinosaurs')
530
- * .condition(op =>
531
- * op.and([
532
- * op.attributeNotExists('id'),
533
- * op.eq('quarantineStatus', 'READY'),
534
- * op.gt('securityLevel', 8)
535
- * ])
536
- * )
537
- * .debug();
538
- *
539
- * console.log('Dinosaur transfer command:', debugInfo);
540
- * ```
541
- *
542
- * @returns A readable representation of the put command with resolved expressions
543
- */
544
- debug() {
545
- const command = this.toDynamoCommand();
546
- return debugCommand(command);
547
- }
548
- };
549
-
550
- export { PutBuilder };
551
- //# sourceMappingURL=put-builder.js.map
552
- //# sourceMappingURL=put-builder.js.map