@infra-blocks/aws-dynamodb 0.53.0 → 0.54.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/lib/cjs/client.d.ts +10 -6
- package/lib/cjs/client.js +14 -13
- package/lib/cjs/client.js.map +1 -1
- package/lib/cjs/commands/command/codecs/codec.d.ts +4 -0
- package/lib/cjs/commands/command/codecs/codec.js +3 -0
- package/lib/cjs/commands/command/codecs/codec.js.map +1 -0
- package/lib/cjs/commands/command/codecs/delete-item.d.ts +6 -0
- package/lib/cjs/commands/command/codecs/delete-item.js +10 -0
- package/lib/cjs/commands/command/codecs/delete-item.js.map +1 -0
- package/lib/cjs/commands/command/codecs/get-item.d.ts +5 -0
- package/lib/cjs/commands/command/codecs/get-item.js +10 -0
- package/lib/cjs/commands/command/codecs/get-item.js.map +1 -0
- package/lib/cjs/commands/command/command.d.ts +25 -0
- package/lib/cjs/commands/command/command.js +27 -0
- package/lib/cjs/commands/command/command.js.map +1 -0
- package/lib/cjs/commands/command/commands.d.ts +3 -0
- package/lib/cjs/commands/command/commands.js +4 -0
- package/lib/cjs/commands/command/commands.js.map +1 -0
- package/lib/cjs/commands/command/delete-item.d.ts +8 -0
- package/lib/cjs/commands/command/delete-item.js +17 -0
- package/lib/cjs/commands/command/delete-item.js.map +1 -0
- package/lib/cjs/commands/command/get-item.d.ts +8 -0
- package/lib/cjs/commands/command/get-item.js +17 -0
- package/lib/cjs/commands/command/get-item.js.map +1 -0
- package/lib/cjs/commands/command/inputs/create-table.d.ts +7 -0
- package/lib/cjs/commands/command/inputs/create-table.js +3 -0
- package/lib/cjs/commands/command/inputs/create-table.js.map +1 -0
- package/lib/cjs/commands/command/inputs/delete-item.d.ts +12 -0
- package/lib/cjs/commands/command/inputs/delete-item.js +39 -0
- package/lib/cjs/commands/command/inputs/delete-item.js.map +1 -0
- package/lib/cjs/commands/command/inputs/get-item.d.ts +19 -0
- package/lib/cjs/commands/command/inputs/get-item.js +11 -0
- package/lib/cjs/commands/command/inputs/get-item.js.map +1 -0
- package/lib/cjs/commands/command/inputs/index.d.ts +2 -0
- package/lib/cjs/commands/command/inputs/index.js +3 -0
- package/lib/cjs/commands/command/inputs/index.js.map +1 -0
- package/lib/cjs/commands/command/outputs/delete-item.d.ts +6 -0
- package/lib/cjs/commands/command/outputs/delete-item.js +12 -0
- package/lib/cjs/commands/command/outputs/delete-item.js.map +1 -0
- package/lib/cjs/commands/command/outputs/get-item.d.ts +6 -0
- package/lib/cjs/commands/command/outputs/get-item.js +7 -0
- package/lib/cjs/commands/command/outputs/get-item.js.map +1 -0
- package/lib/cjs/commands/command/outputs/index.d.ts +2 -0
- package/lib/cjs/commands/command/outputs/index.js +3 -0
- package/lib/cjs/commands/command/outputs/index.js.map +1 -0
- package/lib/cjs/commands/command/outputs/lib.d.ts +3 -0
- package/lib/cjs/commands/command/outputs/lib.js +12 -0
- package/lib/cjs/commands/command/outputs/lib.js.map +1 -0
- package/lib/cjs/commands/index.d.ts +3 -2
- package/lib/cjs/commands/index.js +2 -0
- package/lib/cjs/commands/index.js.map +1 -1
- package/lib/cjs/commands/write-transaction.d.ts +2 -2
- package/lib/cjs/commands/write-transaction.js +2 -2
- package/lib/cjs/commands/write-transaction.js.map +1 -1
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/client.d.ts +10 -6
- package/lib/esm/client.js +14 -13
- package/lib/esm/client.js.map +1 -1
- package/lib/esm/commands/command/codecs/codec.d.ts +4 -0
- package/lib/esm/commands/command/codecs/codec.js +2 -0
- package/lib/esm/commands/command/codecs/codec.js.map +1 -0
- package/lib/esm/commands/command/codecs/delete-item.d.ts +6 -0
- package/lib/esm/commands/command/codecs/delete-item.js +7 -0
- package/lib/esm/commands/command/codecs/delete-item.js.map +1 -0
- package/lib/esm/commands/command/codecs/get-item.d.ts +5 -0
- package/lib/esm/commands/command/codecs/get-item.js +7 -0
- package/lib/esm/commands/command/codecs/get-item.js.map +1 -0
- package/lib/esm/commands/command/command.d.ts +25 -0
- package/lib/esm/commands/command/command.js +23 -0
- package/lib/esm/commands/command/command.js.map +1 -0
- package/lib/esm/commands/command/commands.d.ts +3 -0
- package/lib/esm/commands/command/commands.js +3 -0
- package/lib/esm/commands/command/commands.js.map +1 -0
- package/lib/esm/commands/command/delete-item.d.ts +8 -0
- package/lib/esm/commands/command/delete-item.js +13 -0
- package/lib/esm/commands/command/delete-item.js.map +1 -0
- package/lib/esm/commands/command/get-item.d.ts +8 -0
- package/lib/esm/commands/command/get-item.js +13 -0
- package/lib/esm/commands/command/get-item.js.map +1 -0
- package/lib/esm/commands/command/inputs/create-table.d.ts +7 -0
- package/lib/esm/commands/command/inputs/create-table.js +2 -0
- package/lib/esm/commands/command/inputs/create-table.js.map +1 -0
- package/lib/esm/commands/command/inputs/delete-item.d.ts +12 -0
- package/lib/esm/commands/command/inputs/delete-item.js +36 -0
- package/lib/esm/commands/command/inputs/delete-item.js.map +1 -0
- package/lib/esm/commands/command/inputs/get-item.d.ts +19 -0
- package/lib/esm/commands/command/inputs/get-item.js +8 -0
- package/lib/esm/commands/command/inputs/get-item.js.map +1 -0
- package/lib/esm/commands/command/inputs/index.d.ts +2 -0
- package/lib/esm/commands/command/inputs/index.js +2 -0
- package/lib/esm/commands/command/inputs/index.js.map +1 -0
- package/lib/esm/commands/command/outputs/delete-item.d.ts +6 -0
- package/lib/esm/commands/command/outputs/delete-item.js +9 -0
- package/lib/esm/commands/command/outputs/delete-item.js.map +1 -0
- package/lib/esm/commands/command/outputs/get-item.d.ts +6 -0
- package/lib/esm/commands/command/outputs/get-item.js +3 -0
- package/lib/esm/commands/command/outputs/get-item.js.map +1 -0
- package/lib/esm/commands/command/outputs/index.d.ts +2 -0
- package/lib/esm/commands/command/outputs/index.js +2 -0
- package/lib/esm/commands/command/outputs/index.js.map +1 -0
- package/lib/esm/commands/command/outputs/lib.d.ts +3 -0
- package/lib/esm/commands/command/outputs/lib.js +9 -0
- package/lib/esm/commands/command/outputs/lib.js.map +1 -0
- package/lib/esm/commands/index.d.ts +3 -2
- package/lib/esm/commands/index.js +2 -0
- package/lib/esm/commands/index.js.map +1 -1
- package/lib/esm/commands/write-transaction.d.ts +2 -2
- package/lib/esm/commands/write-transaction.js +2 -2
- package/lib/esm/commands/write-transaction.js.map +1 -1
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/lib/cjs/commands/delete-item.d.ts +0 -26
- package/lib/cjs/commands/delete-item.js +0 -62
- package/lib/cjs/commands/delete-item.js.map +0 -1
- package/lib/cjs/commands/get-item.d.ts +0 -26
- package/lib/cjs/commands/get-item.js +0 -25
- package/lib/cjs/commands/get-item.js.map +0 -1
- package/lib/esm/commands/delete-item.d.ts +0 -26
- package/lib/esm/commands/delete-item.js +0 -58
- package/lib/esm/commands/delete-item.js.map +0 -1
- package/lib/esm/commands/get-item.d.ts +0 -26
- package/lib/esm/commands/get-item.js +0 -21
- package/lib/esm/commands/get-item.js.map +0 -1
package/lib/cjs/client.d.ts
CHANGED
|
@@ -3,10 +3,13 @@ import type { TranslateConfig } from "@aws-sdk/lib-dynamodb";
|
|
|
3
3
|
import { DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb";
|
|
4
4
|
import type { Logger } from "@infra-blocks/logger-interface";
|
|
5
5
|
import { type Retry, type RetryConfig } from "@infra-blocks/retry";
|
|
6
|
+
import type { CommandOutput } from "./commands/command/command.js";
|
|
7
|
+
import type { DynamoDbClientCommand } from "./commands/command/commands.js";
|
|
8
|
+
import type { DeleteItemInput } from "./commands/command/inputs/delete-item.js";
|
|
9
|
+
import type { DeleteItemOutput } from "./commands/command/outputs/delete-item.js";
|
|
6
10
|
import { type CreateTableParams } from "./commands/create-table.js";
|
|
7
11
|
import { type DeleteTableParams } from "./commands/delete.table.js";
|
|
8
|
-
import {
|
|
9
|
-
import { type GetItemParams } from "./commands/get-item.js";
|
|
12
|
+
import type { GetItemInput, GetItemOutput } from "./commands/index.js";
|
|
10
13
|
import { type PutItemParams, type PutItemResult } from "./commands/put-item.js";
|
|
11
14
|
import { type QueryParams, type QueryResult } from "./commands/query.js";
|
|
12
15
|
import { type UpdateItemParams } from "./commands/update-item.js";
|
|
@@ -65,11 +68,11 @@ export declare class DynamoDbClient {
|
|
|
65
68
|
/**
|
|
66
69
|
* Deletes an item using the DeleteItem API.
|
|
67
70
|
*
|
|
68
|
-
* @param
|
|
71
|
+
* @param input
|
|
69
72
|
*
|
|
70
73
|
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html
|
|
71
74
|
*/
|
|
72
|
-
deleteItem<
|
|
75
|
+
deleteItem<T extends Attributes = Attributes, K extends KeyAttributes = KeyAttributes>(input: DeleteItemInput<K>): Promise<DeleteItemOutput<T>>;
|
|
73
76
|
/**
|
|
74
77
|
* Deletes a table using the DeleteTable API.
|
|
75
78
|
*
|
|
@@ -81,14 +84,14 @@ export declare class DynamoDbClient {
|
|
|
81
84
|
/**
|
|
82
85
|
* Gets an item using the GetItem API.
|
|
83
86
|
*
|
|
84
|
-
* @param
|
|
87
|
+
* @param input - The parameters to use to get the item.
|
|
85
88
|
*
|
|
86
89
|
* @returns The item casted to the generic type provided, or undefined if not such item
|
|
87
90
|
* matches the primary key.
|
|
88
91
|
*
|
|
89
92
|
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_GetItem.html
|
|
90
93
|
*/
|
|
91
|
-
getItem<
|
|
94
|
+
getItem<T extends Attributes = Attributes, K extends KeyAttributes = KeyAttributes>(input: GetItemInput<K>): Promise<GetItemOutput<T>>;
|
|
92
95
|
/**
|
|
93
96
|
* Puts an item using the PutItem API.
|
|
94
97
|
*
|
|
@@ -173,6 +176,7 @@ export declare class DynamoDbClient {
|
|
|
173
176
|
* @param options - Options to pass to the underlying retry mechanism.
|
|
174
177
|
*/
|
|
175
178
|
ready(options?: Omit<RetryConfig, "isRetryableError">): Retry<void>;
|
|
179
|
+
send<C extends DynamoDbClientCommand>(command: C): Promise<CommandOutput<C>>;
|
|
176
180
|
/**
|
|
177
181
|
* Updates an item using the UpdateItem API.
|
|
178
182
|
*
|
package/lib/cjs/client.js
CHANGED
|
@@ -6,10 +6,10 @@ const lib_dynamodb_1 = require("@aws-sdk/lib-dynamodb");
|
|
|
6
6
|
const null_logger_1 = require("@infra-blocks/null-logger");
|
|
7
7
|
const retry_1 = require("@infra-blocks/retry");
|
|
8
8
|
const types_1 = require("@infra-blocks/types");
|
|
9
|
+
const delete_item_js_1 = require("./commands/command/delete-item.js");
|
|
10
|
+
const get_item_js_1 = require("./commands/command/get-item.js");
|
|
9
11
|
const create_table_js_1 = require("./commands/create-table.js");
|
|
10
12
|
const delete_table_js_1 = require("./commands/delete.table.js");
|
|
11
|
-
const delete_item_js_1 = require("./commands/delete-item.js");
|
|
12
|
-
const get_item_js_1 = require("./commands/get-item.js");
|
|
13
13
|
const put_item_js_1 = require("./commands/put-item.js");
|
|
14
14
|
const query_js_1 = require("./commands/query.js");
|
|
15
15
|
const update_item_js_1 = require("./commands/update-item.js");
|
|
@@ -45,17 +45,15 @@ class DynamoDbClient {
|
|
|
45
45
|
/**
|
|
46
46
|
* Deletes an item using the DeleteItem API.
|
|
47
47
|
*
|
|
48
|
-
* @param
|
|
48
|
+
* @param input
|
|
49
49
|
*
|
|
50
50
|
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html
|
|
51
51
|
*/
|
|
52
|
-
deleteItem(
|
|
52
|
+
deleteItem(input) {
|
|
53
53
|
if (this.logger.isDebugEnabled()) {
|
|
54
|
-
this.logger.debug("deleteItem(%s)", JSON.stringify(
|
|
54
|
+
this.logger.debug("deleteItem(%s)", JSON.stringify(input));
|
|
55
55
|
}
|
|
56
|
-
return delete_item_js_1.DeleteItem
|
|
57
|
-
client: this.client,
|
|
58
|
-
});
|
|
56
|
+
return this.send(new delete_item_js_1.DeleteItem(input));
|
|
59
57
|
}
|
|
60
58
|
/**
|
|
61
59
|
* Deletes a table using the DeleteTable API.
|
|
@@ -74,19 +72,18 @@ class DynamoDbClient {
|
|
|
74
72
|
/**
|
|
75
73
|
* Gets an item using the GetItem API.
|
|
76
74
|
*
|
|
77
|
-
* @param
|
|
75
|
+
* @param input - The parameters to use to get the item.
|
|
78
76
|
*
|
|
79
77
|
* @returns The item casted to the generic type provided, or undefined if not such item
|
|
80
78
|
* matches the primary key.
|
|
81
79
|
*
|
|
82
80
|
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_GetItem.html
|
|
83
81
|
*/
|
|
84
|
-
async getItem(
|
|
82
|
+
async getItem(input) {
|
|
85
83
|
if (this.logger.isDebugEnabled()) {
|
|
86
|
-
this.logger.debug("getItem(%s)", JSON.stringify(
|
|
84
|
+
this.logger.debug("getItem(%s)", JSON.stringify(input));
|
|
87
85
|
}
|
|
88
|
-
|
|
89
|
-
return (0, types_1.trusted)(response.Item);
|
|
86
|
+
return this.send(new get_item_js_1.GetItem(input));
|
|
90
87
|
}
|
|
91
88
|
/**
|
|
92
89
|
* Puts an item using the PutItem API.
|
|
@@ -228,6 +225,10 @@ class DynamoDbClient {
|
|
|
228
225
|
},
|
|
229
226
|
});
|
|
230
227
|
}
|
|
228
|
+
// TODO: without branding, one type equals all types...
|
|
229
|
+
async send(command) {
|
|
230
|
+
return (0, types_1.trusted)(command.execute({ client: this.client }));
|
|
231
|
+
}
|
|
231
232
|
/**
|
|
232
233
|
* Updates an item using the UpdateItem API.
|
|
233
234
|
*
|
package/lib/cjs/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";;;AACA,8DAA6E;AAE7E,wDAA+D;AAE/D,2DAAuD;AACvD,+CAA0E;AAC1E,+CAA8C;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";;;AACA,8DAA6E;AAE7E,wDAA+D;AAE/D,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,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QACrB,MAAM,QAAQ,GAAG,IAAI,gCAAc,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;QACtD,MAAM,MAAM,GAAG,qCAAsB,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;QACjE,OAAO,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACjD,CAAC;CACF;AAnXD,wCAmXC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../../../src/commands/command/codecs/codec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteItemCodec = void 0;
|
|
4
|
+
const delete_item_js_1 = require("../inputs/delete-item.js");
|
|
5
|
+
const delete_item_js_2 = require("../outputs/delete-item.js");
|
|
6
|
+
exports.DeleteItemCodec = {
|
|
7
|
+
encode: delete_item_js_1.encode,
|
|
8
|
+
decode: delete_item_js_2.decode,
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=delete-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-item.js","sourceRoot":"","sources":["../../../../../src/commands/command/codecs/delete-item.ts"],"names":[],"mappings":";;;AAAA,6DAAkD;AAClD,8DAAmD;AAEtC,QAAA,eAAe,GAAG;IAC7B,MAAM,EAAN,uBAAM;IACN,MAAM,EAAN,uBAAM;CACP,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { encode } from "../inputs/get-item.js";
|
|
2
|
+
export declare const GetItemCodec: {
|
|
3
|
+
encode: typeof encode;
|
|
4
|
+
decode: <T extends import("../../../types.js").Attributes = import("../../../types.js").Attributes>(output: import("@aws-sdk/lib-dynamodb").GetCommandOutput) => import("../outputs/get-item.js").GetItemOutput<T>;
|
|
5
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetItemCodec = void 0;
|
|
4
|
+
const get_item_js_1 = require("../inputs/get-item.js");
|
|
5
|
+
const get_item_js_2 = require("../outputs/get-item.js");
|
|
6
|
+
exports.GetItemCodec = {
|
|
7
|
+
encode: get_item_js_1.encode,
|
|
8
|
+
decode: get_item_js_2.decode,
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=get-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-item.js","sourceRoot":"","sources":["../../../../../src/commands/command/codecs/get-item.ts"],"names":[],"mappings":";;;AAAA,uDAA+C;AAC/C,wDAAgD;AAEnC,QAAA,YAAY,GAAG;IAC1B,MAAM,EAAN,oBAAM;IACN,MAAM,EAAN,oBAAM;CACP,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** biome-ignore-all lint/suspicious/noExplicitAny: The lib-dynamodb's own types don't compile with their interface.
|
|
2
|
+
* For example, pick any command they offer. None of them are assignable to
|
|
3
|
+
* Parameters<DynamoDBDocumentClient["send"]>[0]. This issue is transitive and makes it very hard to express
|
|
4
|
+
* generic constraints based on their command types, or their client's interface, because they don't work with
|
|
5
|
+
* each other trolololol. Hence, we use any where necessary as an escape hatch to this typing nightmare.
|
|
6
|
+
*/
|
|
7
|
+
import type { DynamoDBDocumentClient, DynamoDBDocumentClientCommand, DynamoDBDocumentClientResolvedConfig } from "@aws-sdk/lib-dynamodb";
|
|
8
|
+
import type { Codec } from "./codecs/codec.js";
|
|
9
|
+
type DocumentClientCommandCtor<DCI extends object, DCO extends object> = new (input: DCI) => DynamoDBDocumentClientCommand<DCI, DCO, any, any, DynamoDBDocumentClientResolvedConfig>;
|
|
10
|
+
export type CommandOutput<C> = C extends Command<any, infer O, any, any> ? O : never;
|
|
11
|
+
export type CommandInput<C extends Command<any, any, any, any>> = C["input"];
|
|
12
|
+
export declare abstract class Command<I extends object, O extends object, DCI extends object, DCO extends object> {
|
|
13
|
+
readonly input: I;
|
|
14
|
+
protected readonly codec: Codec<I, O, DCI, DCO>;
|
|
15
|
+
protected readonly command: DocumentClientCommandCtor<DCI, DCO>;
|
|
16
|
+
protected constructor(params: {
|
|
17
|
+
input: I;
|
|
18
|
+
codec: Codec<I, O, DCI, DCO>;
|
|
19
|
+
command: DocumentClientCommandCtor<DCI, DCO>;
|
|
20
|
+
});
|
|
21
|
+
execute(params: {
|
|
22
|
+
client: DynamoDBDocumentClient;
|
|
23
|
+
}): Promise<O>;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/** biome-ignore-all lint/suspicious/noExplicitAny: The lib-dynamodb's own types don't compile with their interface.
|
|
3
|
+
* For example, pick any command they offer. None of them are assignable to
|
|
4
|
+
* Parameters<DynamoDBDocumentClient["send"]>[0]. This issue is transitive and makes it very hard to express
|
|
5
|
+
* generic constraints based on their command types, or their client's interface, because they don't work with
|
|
6
|
+
* each other trolololol. Hence, we use any where necessary as an escape hatch to this typing nightmare.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.Command = void 0;
|
|
10
|
+
// TODO: don't export outside.
|
|
11
|
+
class Command {
|
|
12
|
+
input;
|
|
13
|
+
codec;
|
|
14
|
+
command;
|
|
15
|
+
constructor(params) {
|
|
16
|
+
const { input, codec, command } = params;
|
|
17
|
+
this.input = input;
|
|
18
|
+
this.codec = codec;
|
|
19
|
+
this.command = command;
|
|
20
|
+
}
|
|
21
|
+
async execute(params) {
|
|
22
|
+
const { client } = params;
|
|
23
|
+
return this.codec.decode(await client.send(new this.command(this.codec.encode(this.input))));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.Command = Command;
|
|
27
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../../src/commands/command/command.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAyBH,8BAA8B;AAC9B,MAAsB,OAAO;IAMlB,KAAK,CAAI;IAEC,KAAK,CAAwB;IAC7B,OAAO,CAAsC;IAEhE,YAAsB,MAIrB;QACC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QACzC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,MAA0C;QACtD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CACtB,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CACnE,CAAC;IACJ,CAAC;CACF;AA5BD,0BA4BC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../../src/commands/command/commands.ts"],"names":[],"mappings":";;AAKA,8CAA8C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type DeleteCommandInput, type DeleteCommandOutput } from "@aws-sdk/lib-dynamodb";
|
|
2
|
+
import type { Attributes, KeyAttributes } from "../../types.js";
|
|
3
|
+
import { Command } from "./command.js";
|
|
4
|
+
import type { DeleteItemInput } from "./inputs/delete-item.js";
|
|
5
|
+
import type { DeleteItemOutput } from "./outputs/delete-item.js";
|
|
6
|
+
export declare class DeleteItem<T extends Attributes = Attributes, K extends KeyAttributes = KeyAttributes> extends Command<DeleteItemInput<K>, DeleteItemOutput<T>, DeleteCommandInput, DeleteCommandOutput> {
|
|
7
|
+
constructor(input: DeleteItemInput<K>);
|
|
8
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteItem = void 0;
|
|
4
|
+
const lib_dynamodb_1 = require("@aws-sdk/lib-dynamodb");
|
|
5
|
+
const delete_item_js_1 = require("./codecs/delete-item.js");
|
|
6
|
+
const command_js_1 = require("./command.js");
|
|
7
|
+
class DeleteItem extends command_js_1.Command {
|
|
8
|
+
constructor(input) {
|
|
9
|
+
super({
|
|
10
|
+
input,
|
|
11
|
+
codec: delete_item_js_1.DeleteItemCodec,
|
|
12
|
+
command: lib_dynamodb_1.DeleteCommand,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.DeleteItem = DeleteItem;
|
|
17
|
+
//# sourceMappingURL=delete-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-item.js","sourceRoot":"","sources":["../../../../src/commands/command/delete-item.ts"],"names":[],"mappings":";;;AAAA,wDAI+B;AAE/B,4DAA0D;AAC1D,6CAAuC;AAIvC,MAAa,UAGX,SAAQ,oBAKT;IACC,YAAY,KAAyB;QACnC,KAAK,CAAC;YACJ,KAAK;YACL,KAAK,EAAE,gCAAe;YACtB,OAAO,EAAE,4BAAa;SACvB,CAAC,CAAC;IACL,CAAC;CACF;AAhBD,gCAgBC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type GetCommandInput, type GetCommandOutput } from "@aws-sdk/lib-dynamodb";
|
|
2
|
+
import type { Attributes, KeyAttributes } from "../../types.js";
|
|
3
|
+
import { Command } from "./command.js";
|
|
4
|
+
import type { GetItemInput } from "./inputs/get-item.js";
|
|
5
|
+
import type { GetItemOutput } from "./outputs/get-item.js";
|
|
6
|
+
export declare class GetItem<T extends Attributes = Attributes, K extends KeyAttributes = KeyAttributes> extends Command<GetItemInput<K>, GetItemOutput<T>, GetCommandInput, GetCommandOutput> {
|
|
7
|
+
constructor(input: GetItemInput<K>);
|
|
8
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetItem = void 0;
|
|
4
|
+
const lib_dynamodb_1 = require("@aws-sdk/lib-dynamodb");
|
|
5
|
+
const get_item_js_1 = require("./codecs/get-item.js");
|
|
6
|
+
const command_js_1 = require("./command.js");
|
|
7
|
+
class GetItem extends command_js_1.Command {
|
|
8
|
+
constructor(input) {
|
|
9
|
+
super({
|
|
10
|
+
input,
|
|
11
|
+
codec: get_item_js_1.GetItemCodec,
|
|
12
|
+
command: lib_dynamodb_1.GetCommand,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.GetItem = GetItem;
|
|
17
|
+
//# sourceMappingURL=get-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-item.js","sourceRoot":"","sources":["../../../../src/commands/command/get-item.ts"],"names":[],"mappings":";;;AAAA,wDAI+B;AAE/B,sDAAoD;AACpD,6CAAuC;AAIvC,MAAa,OAGX,SAAQ,oBAKT;IACC,YAAY,KAAsB;QAChC,KAAK,CAAC;YACJ,KAAK;YACL,KAAK,EAAE,0BAAY;YACnB,OAAO,EAAE,yBAAU;SACpB,CAAC,CAAC;IACL,CAAC;CACF;AAhBD,0BAgBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-table.js","sourceRoot":"","sources":["../../../../../src/commands/command/inputs/create-table.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DeleteCommandInput } from "@aws-sdk/lib-dynamodb";
|
|
2
|
+
import type { KeyAttributes } from "../../../types.js";
|
|
3
|
+
import type { ConditionParams } from "../../expressions/index.js";
|
|
4
|
+
export type DeleteItemReturnValue = "ALL_OLD" | "NONE";
|
|
5
|
+
export type DeleteItemInput<K extends KeyAttributes = KeyAttributes> = {
|
|
6
|
+
table: string;
|
|
7
|
+
key: K;
|
|
8
|
+
condition?: ConditionParams;
|
|
9
|
+
returnValues?: DeleteItemReturnValue;
|
|
10
|
+
returnValuesOnConditionCheckFailure?: DeleteItemReturnValue;
|
|
11
|
+
};
|
|
12
|
+
export declare function encode<K extends KeyAttributes>(input: DeleteItemInput<K>): DeleteCommandInput;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.encode = encode;
|
|
4
|
+
const names_js_1 = require("../../attributes/names.js");
|
|
5
|
+
const values_js_1 = require("../../attributes/values.js");
|
|
6
|
+
const expression_js_1 = require("../../expressions/condition/expression.js");
|
|
7
|
+
function encode(input) {
|
|
8
|
+
const transformed = {
|
|
9
|
+
TableName: input.table,
|
|
10
|
+
Key: input.key,
|
|
11
|
+
};
|
|
12
|
+
if (input.returnValues != null) {
|
|
13
|
+
transformed.ReturnValues = input.returnValues;
|
|
14
|
+
}
|
|
15
|
+
if (input.returnValuesOnConditionCheckFailure != null) {
|
|
16
|
+
transformed.ReturnValuesOnConditionCheckFailure =
|
|
17
|
+
input.returnValuesOnConditionCheckFailure;
|
|
18
|
+
}
|
|
19
|
+
// Expression attribute names and values can only be specified when a condition is provided,
|
|
20
|
+
// which is optional.
|
|
21
|
+
if (input.condition == null) {
|
|
22
|
+
return transformed;
|
|
23
|
+
}
|
|
24
|
+
// TODO: this in a reusable function.
|
|
25
|
+
const names = names_js_1.AttributeNames.create();
|
|
26
|
+
const values = values_js_1.AttributeValues.create();
|
|
27
|
+
// Ask the expression to stringify itself, applying the substitutions by itself.
|
|
28
|
+
const expression = (0, expression_js_1.conditionExpression)(input.condition).stringify({
|
|
29
|
+
names,
|
|
30
|
+
values,
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
...transformed,
|
|
34
|
+
ConditionExpression: expression,
|
|
35
|
+
ExpressionAttributeNames: names.getSubstitutions(),
|
|
36
|
+
ExpressionAttributeValues: values.getSubstitutions(),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=delete-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-item.js","sourceRoot":"","sources":["../../../../../src/commands/command/inputs/delete-item.ts"],"names":[],"mappings":";;AAmBA,wBAsCC;AAvDD,wDAA2D;AAC3D,0DAA6D;AAC7D,6EAAgF;AAehF,SAAgB,MAAM,CACpB,KAAyB;IAEzB,MAAM,WAAW,GAAuB;QACtC,SAAS,EAAE,KAAK,CAAC,KAAK;QACtB,GAAG,EAAE,KAAK,CAAC,GAAG;KACf,CAAC;IAEF,IAAI,KAAK,CAAC,YAAY,IAAI,IAAI,EAAE,CAAC;QAC/B,WAAW,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IAChD,CAAC;IAED,IAAI,KAAK,CAAC,mCAAmC,IAAI,IAAI,EAAE,CAAC;QACtD,WAAW,CAAC,mCAAmC;YAC7C,KAAK,CAAC,mCAAmC,CAAC;IAC9C,CAAC;IAED,4FAA4F;IAC5F,qBAAqB;IACrB,IAAI,KAAK,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;QAC5B,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,qCAAqC;IACrC,MAAM,KAAK,GAAG,yBAAc,CAAC,MAAM,EAAE,CAAC;IACtC,MAAM,MAAM,GAAG,2BAAe,CAAC,MAAM,EAAE,CAAC;IACxC,gFAAgF;IAChF,MAAM,UAAU,GAAG,IAAA,mCAAmB,EAAC,KAAK,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;QAChE,KAAK;QACL,MAAM;KACP,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,WAAW;QACd,mBAAmB,EAAE,UAAU;QAC/B,wBAAwB,EAAE,KAAK,CAAC,gBAAgB,EAAE;QAClD,yBAAyB,EAAE,MAAM,CAAC,gBAAgB,EAAE;KACrD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { GetCommandInput } from "@aws-sdk/lib-dynamodb";
|
|
2
|
+
import type { KeyAttributes } from "../../../types.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input required to call the GetItem API.
|
|
5
|
+
*/
|
|
6
|
+
export interface GetItemInput<K extends KeyAttributes = KeyAttributes> {
|
|
7
|
+
/**
|
|
8
|
+
* The name of the table to query.
|
|
9
|
+
*/
|
|
10
|
+
table: string;
|
|
11
|
+
/**
|
|
12
|
+
* The primary key values of the item to retrieve.
|
|
13
|
+
*
|
|
14
|
+
* This should always include at least the partition key, and the sort key if one
|
|
15
|
+
* is part of the table's primary key. No more than 2 fields are expected here.
|
|
16
|
+
*/
|
|
17
|
+
key: K;
|
|
18
|
+
}
|
|
19
|
+
export declare function encode<K extends KeyAttributes = KeyAttributes>(input: GetItemInput<K>): GetCommandInput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-item.js","sourceRoot":"","sources":["../../../../../src/commands/command/inputs/get-item.ts"],"names":[],"mappings":";;AAoBA,wBAQC;AARD,SAAgB,MAAM,CACpB,KAAsB;IAEtB,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;IACtB,OAAO;QACL,SAAS,EAAE,KAAK,CAAC,KAAK;QACtB,GAAG,EAAE,GAAG;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/command/inputs/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DeleteCommandOutput } from "@aws-sdk/lib-dynamodb";
|
|
2
|
+
import type { Attributes } from "../../../types.js";
|
|
3
|
+
export type DeleteItemOutput<T extends Attributes = Attributes> = {
|
|
4
|
+
item?: T;
|
|
5
|
+
};
|
|
6
|
+
export declare function decode<T extends Attributes = Attributes>(output: DeleteCommandOutput): DeleteItemOutput<T>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decode = decode;
|
|
4
|
+
function decode(output) {
|
|
5
|
+
// TODO: use maybeSet
|
|
6
|
+
const result = {};
|
|
7
|
+
if (output.Attributes != null) {
|
|
8
|
+
result.item = output.Attributes;
|
|
9
|
+
}
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=delete-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-item.js","sourceRoot":"","sources":["../../../../../src/commands/command/outputs/delete-item.ts"],"names":[],"mappings":";;AAKA,wBASC;AATD,SAAgB,MAAM,CACpB,MAA2B;IAE3B,qBAAqB;IACrB,MAAM,MAAM,GAAiC,EAAE,CAAC;IAChD,IAAI,MAAM,CAAC,UAAU,IAAI,IAAI,EAAE,CAAC;QAC9B,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,UAAe,CAAC;IACvC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { GetCommandOutput } from "@aws-sdk/lib-dynamodb";
|
|
2
|
+
import type { Attributes } from "../../../types.js";
|
|
3
|
+
export type GetItemOutput<T extends Attributes = Attributes> = {
|
|
4
|
+
item?: T;
|
|
5
|
+
};
|
|
6
|
+
export declare const decode: <T extends Attributes = Attributes>(output: GetCommandOutput) => GetItemOutput<T>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decode = void 0;
|
|
4
|
+
const lib_js_1 = require("./lib.js");
|
|
5
|
+
const decode = (output) => (0, lib_js_1.maybeSet)({}, "item", output, "Item");
|
|
6
|
+
exports.decode = decode;
|
|
7
|
+
//# sourceMappingURL=get-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-item.js","sourceRoot":"","sources":["../../../../../src/commands/command/outputs/get-item.ts"],"names":[],"mappings":";;;AAEA,qCAAoC;AAK7B,MAAM,MAAM,GAAG,CACpB,MAAwB,EACN,EAAE,CAAC,IAAA,iBAAQ,EAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAF/C,QAAA,MAAM,UAEyC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/command/outputs/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.maybeSet = maybeSet;
|
|
4
|
+
const types_1 = require("@infra-blocks/types");
|
|
5
|
+
function maybeSet(acc, accKey, source, sourceKey, transform) {
|
|
6
|
+
if (source[sourceKey] != null) {
|
|
7
|
+
const newValue = transform != null ? transform(source[sourceKey]) : source[sourceKey];
|
|
8
|
+
acc[accKey] = (0, types_1.trusted)(newValue);
|
|
9
|
+
}
|
|
10
|
+
return (0, types_1.trusted)(acc);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=lib.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../../../../src/commands/command/outputs/lib.ts"],"names":[],"mappings":";;AAEA,4BAmBC;AArBD,+CAA8C;AAE9C,SAAgB,QAAQ,CAOtB,GAAM,EACN,MAAU,EACV,MAAS,EACT,SAAa,EACb,SAA+B;IAE/B,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC;QAC9B,MAAM,QAAQ,GACZ,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACvE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAA,eAAO,EAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,IAAA,eAAO,EAAC,GAAG,CAAC,CAAC;AACtB,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
export type { DeleteItem } from "./command/delete-item.js";
|
|
2
|
+
export * from "./command/inputs/index.js";
|
|
3
|
+
export * from "./command/outputs/index.js";
|
|
1
4
|
export type { CreateTableParams } from "./create-table.js";
|
|
2
5
|
export type { DeleteTableParams } from "./delete.table.js";
|
|
3
|
-
export type { DeleteItemParams, DeleteItemResult, DeleteItemReturnValue, } from "./delete-item.js";
|
|
4
6
|
export * from "./expressions/index.js";
|
|
5
|
-
export type { GetItemParams } from "./get-item.js";
|
|
6
7
|
export type { PutItemParams, PutItemResult, PutItemReturnValue, } from "./put-item.js";
|
|
7
8
|
export type { QueryParams } from "./query.js";
|
|
8
9
|
export type { UpdateItemParams } from "./update-item.js";
|
|
@@ -14,5 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./command/inputs/index.js"), exports);
|
|
18
|
+
__exportStar(require("./command/outputs/index.js"), exports);
|
|
17
19
|
__exportStar(require("./expressions/index.js"), exports);
|
|
18
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,4DAA0C;AAC1C,6DAA2C;AAG3C,yDAAuC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TransactWriteCommand, type TransactWriteCommandInput } from "@aws-sdk/lib-dynamodb";
|
|
2
2
|
import type { Attributes } from "../types.js";
|
|
3
|
-
import {
|
|
3
|
+
import type { DeleteItemInput } from "./command/inputs/index.js";
|
|
4
4
|
import type { ConditionParams } from "./expressions/index.js";
|
|
5
5
|
import { type PutItemParams } from "./put-item.js";
|
|
6
6
|
import type { Command } from "./types.js";
|
|
@@ -15,7 +15,7 @@ export type WriteTransactionAction = {
|
|
|
15
15
|
} | {
|
|
16
16
|
update: UpdateItemParams;
|
|
17
17
|
} | {
|
|
18
|
-
delete:
|
|
18
|
+
delete: DeleteItemInput;
|
|
19
19
|
} | {
|
|
20
20
|
conditionCheck: ConditionCheckParams;
|
|
21
21
|
};
|