@infra-blocks/aws-dynamodb 0.61.0-alpha.0 → 0.62.0-alpha.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/README.md +8 -0
- package/lib/cjs/client.d.ts +2 -2
- package/lib/cjs/client.js +1 -1
- package/lib/cjs/client.js.map +1 -1
- package/lib/cjs/commands/inputs/delete-item.d.ts +3 -2
- package/lib/cjs/commands/inputs/delete-item.js.map +1 -1
- package/lib/cjs/commands/inputs/index.d.ts +1 -0
- package/lib/cjs/commands/inputs/index.js.map +1 -1
- package/lib/cjs/commands/inputs/lib.d.ts +1 -0
- package/lib/cjs/commands/inputs/lib.js.map +1 -1
- package/lib/cjs/commands/inputs/put-item.d.ts +3 -2
- package/lib/cjs/commands/inputs/put-item.js.map +1 -1
- package/lib/cjs/commands/inputs/update-item.d.ts +5 -1
- package/lib/cjs/commands/inputs/update-item.js +12 -6
- package/lib/cjs/commands/inputs/update-item.js.map +1 -1
- package/lib/cjs/commands/outputs/delete-item.js +2 -6
- package/lib/cjs/commands/outputs/delete-item.js.map +1 -1
- package/lib/cjs/commands/outputs/update-item.d.ts +6 -3
- package/lib/cjs/commands/outputs/update-item.js +3 -2
- package/lib/cjs/commands/outputs/update-item.js.map +1 -1
- package/lib/cjs/commands/update-item.d.ts +2 -2
- package/lib/cjs/commands/update-item.js.map +1 -1
- package/lib/esm/client.d.ts +2 -2
- package/lib/esm/client.js +1 -1
- package/lib/esm/client.js.map +1 -1
- package/lib/esm/commands/inputs/delete-item.d.ts +3 -2
- package/lib/esm/commands/inputs/delete-item.js +1 -1
- package/lib/esm/commands/inputs/delete-item.js.map +1 -1
- package/lib/esm/commands/inputs/index.d.ts +1 -0
- package/lib/esm/commands/inputs/index.js.map +1 -1
- package/lib/esm/commands/inputs/lib.d.ts +1 -0
- package/lib/esm/commands/inputs/lib.js.map +1 -1
- package/lib/esm/commands/inputs/put-item.d.ts +3 -2
- package/lib/esm/commands/inputs/put-item.js +1 -1
- package/lib/esm/commands/inputs/put-item.js.map +1 -1
- package/lib/esm/commands/inputs/update-item.d.ts +5 -1
- package/lib/esm/commands/inputs/update-item.js +12 -6
- package/lib/esm/commands/inputs/update-item.js.map +1 -1
- package/lib/esm/commands/outputs/delete-item.js +2 -6
- package/lib/esm/commands/outputs/delete-item.js.map +1 -1
- package/lib/esm/commands/outputs/update-item.d.ts +6 -3
- package/lib/esm/commands/outputs/update-item.js +3 -2
- package/lib/esm/commands/outputs/update-item.js.map +1 -1
- package/lib/esm/commands/update-item.d.ts +2 -2
- package/lib/esm/commands/update-item.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,3 +9,11 @@ A convenience library wrapper around [`@aws-sdk/client-dynamodb`](https://www.np
|
|
|
9
9
|
- More conventional field names. Input and output fields use the more common `camelCase` JS/TS convention
|
|
10
10
|
over the `PascalCase` imposed by the AWS APIs.
|
|
11
11
|
- Pagination is provided for APIs that support it and exposed as `AsyncIterators`.
|
|
12
|
+
|
|
13
|
+
## Noteworthy divergences in naming
|
|
14
|
+
|
|
15
|
+
- `TransactWriteItems` (dis engrish?) is renamed to `WriteTransaction`.
|
|
16
|
+
- `DeleteIem` and `PutItem`'s return payload contains an `item` field, and not and `Attributes` field. This is because
|
|
17
|
+
the user can only specify `ALL_OLD` as optional return value, which will always return a full item.
|
|
18
|
+
- The above is unlike the `UpdateItem` command, which *can* return attributes subsets when `UPDATED_[NEW|OLD]` is specified.
|
|
19
|
+
So, the `UpdateItemOutput` contains an `attributes` field instead of `item` field.
|
package/lib/cjs/client.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ 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, type CreateTableInput, type CreateTableOutput, type DeleteItemInput, type DeleteItemOutput, type DeleteTableInput, type DeleteTableOutput, type DynamoDbClientCommand, type GetItemInput, type GetItemOutput, type PutItemInput, type PutItemOutput, type QueryInput, type QueryOutput, type UpdateItemInput, type UpdateTimeToLiveInput, type UpdateTimeToLiveOutput, type WriteTransactionInput, type WriteTransactionOutput } from "./commands/index.js";
|
|
6
|
+
import { type CommandOutput, type CreateTableInput, type CreateTableOutput, type DeleteItemInput, type DeleteItemOutput, type DeleteTableInput, type DeleteTableOutput, type DynamoDbClientCommand, type GetItemInput, type GetItemOutput, type PutItemInput, type PutItemOutput, type QueryInput, type QueryOutput, type UpdateItemInput, type UpdateItemOutput, type UpdateTimeToLiveInput, type UpdateTimeToLiveOutput, type WriteTransactionInput, type WriteTransactionOutput } from "./commands/index.js";
|
|
7
7
|
import type { Attributes, KeyAttributes, KeySchema } from "./types.js";
|
|
8
8
|
/**
|
|
9
9
|
* Re-export of the native client's, renamed.
|
|
@@ -181,7 +181,7 @@ export declare class DynamoDbClient {
|
|
|
181
181
|
*
|
|
182
182
|
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html
|
|
183
183
|
*/
|
|
184
|
-
updateItem<K extends KeyAttributes = KeyAttributes>(input: UpdateItemInput<K>): Promise<
|
|
184
|
+
updateItem<T extends Attributes = Attributes, K extends KeyAttributes = KeyAttributes>(input: UpdateItemInput<K>): Promise<UpdateItemOutput<T>>;
|
|
185
185
|
/**
|
|
186
186
|
* Updates the time to live settings of a table using the UpdateTimeToLive API.
|
|
187
187
|
*
|
package/lib/cjs/client.js
CHANGED
|
@@ -237,7 +237,7 @@ class DynamoDbClient {
|
|
|
237
237
|
if (this.logger.isDebugEnabled()) {
|
|
238
238
|
this.logger.debug("updateItem(%s)", JSON.stringify(input));
|
|
239
239
|
}
|
|
240
|
-
|
|
240
|
+
return this.send(new index_js_1.UpdateItem(input));
|
|
241
241
|
}
|
|
242
242
|
/**
|
|
243
243
|
* Updates the time to live settings of a table using the UpdateTimeToLive API.
|
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;AAC9C,
|
|
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;AAC9C,kDA8B6B;AAC7B,yCAAmD;AAuCnD;;;GAGG;AACH,MAAa,cAAc;IACR,MAAM,CAAyB;IAC/B,MAAM,CAAS;IAEhC,YAAoB,MAGnB;QACC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,WAAW,CACf,KAA2B;QAE3B,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC;YACjC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QAC9D,CAAC;QAED,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,sBAAW,CAAK,KAAK,CAAC,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;OAMG;IACH,UAAU,CAGR,KAAyB;QACzB,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC;YACjC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7D,CAAC;QAED,OAAO,IAAI,CAAC,IAAI,CAAC,I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AC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;QACjE,OAAO,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACjD,CAAC;CACF;AAvXD,wCAuXC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { DeleteCommandInput } from "@aws-sdk/lib-dynamodb";
|
|
2
2
|
import type { KeyAttributes } from "../../types.js";
|
|
3
3
|
import type { ConditionParams } from "../expressions/index.js";
|
|
4
|
-
|
|
4
|
+
import { type ConditionCheckFailureReturnValue } from "./lib.js";
|
|
5
|
+
export type DeleteItemReturnValue = ConditionCheckFailureReturnValue;
|
|
5
6
|
export type DeleteItemInput<K extends KeyAttributes = KeyAttributes> = {
|
|
6
7
|
table: string;
|
|
7
8
|
key: K;
|
|
8
9
|
condition?: ConditionParams;
|
|
9
10
|
returnValues?: DeleteItemReturnValue;
|
|
10
|
-
returnValuesOnConditionCheckFailure?:
|
|
11
|
+
returnValuesOnConditionCheckFailure?: ConditionCheckFailureReturnValue;
|
|
11
12
|
};
|
|
12
13
|
export declare const DeleteItemInput: {
|
|
13
14
|
encode: typeof encode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-item.js","sourceRoot":"","sources":["../../../../src/commands/inputs/delete-item.ts"],"names":[],"mappings":";;;AAGA,
|
|
1
|
+
{"version":3,"file":"delete-item.js","sourceRoot":"","sources":["../../../../src/commands/inputs/delete-item.ts"],"names":[],"mappings":";;;AAGA,qCAGkB;AAaL,QAAA,eAAe,GAAG;IAC7B,MAAM;CACP,CAAC;AAEF,SAAS,MAAM,CACb,KAAyB;IAEzB,MAAM,MAAM,GAAuB;QACjC,SAAS,EAAE,KAAK,CAAC,KAAK;QACtB,GAAG,EAAE,KAAK,CAAC,GAAG;KACf,CAAC;IAEF,IAAI,KAAK,CAAC,YAAY,IAAI,IAAI,EAAE,CAAC;QAC/B,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IAC3C,CAAC;IAED,IAAI,KAAK,CAAC,mCAAmC,IAAI,IAAI,EAAE,CAAC;QACtD,MAAM,CAAC,mCAAmC;YACxC,KAAK,CAAC,mCAAmC,CAAC;IAC9C,CAAC;IAED,4FAA4F;IAC5F,qBAAqB;IACrB,IAAI,KAAK,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAA,iCAAwB,EAC5D,KAAK,CAAC,SAAS,CAChB,CAAC;IACF,OAAO;QACL,GAAG,MAAM;QACT,mBAAmB,EAAE,UAAU;QAC/B,wBAAwB,EAAE,KAAK;QAC/B,yBAAyB,EAAE,MAAM;KAClC,CAAC;AACJ,CAAC"}
|
|
@@ -3,6 +3,7 @@ export * from "./create-table.js";
|
|
|
3
3
|
export * from "./delete-item.js";
|
|
4
4
|
export * from "./delete-table.js";
|
|
5
5
|
export * from "./get-item.js";
|
|
6
|
+
export type { ConditionCheckFailureReturnValue } from "./lib.js";
|
|
6
7
|
export * from "./put-item.js";
|
|
7
8
|
export * from "./query.js";
|
|
8
9
|
export * from "./update-item.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/inputs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,oDAAkC;AAClC,mDAAiC;AACjC,oDAAkC;AAClC,gDAA8B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/inputs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,oDAAkC;AAClC,mDAAiC;AACjC,oDAAkC;AAClC,gDAA8B;AAE9B,gDAA8B;AAC9B,6CAA2B;AAC3B,mDAAiC;AACjC,2DAAyC;AACzC,yDAAuC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AttributePath, AttributeValue } from "../../types.js";
|
|
2
2
|
import { type PathSubstitution, type ValueSubstitution } from "../attributes/index.js";
|
|
3
3
|
import type { ConditionParams } from "../expressions/index.js";
|
|
4
|
+
export type ConditionCheckFailureReturnValue = "NONE" | "ALL_OLD";
|
|
4
5
|
export declare function intoExpressionComponents(condition: ConditionParams): {
|
|
5
6
|
expression: string;
|
|
6
7
|
names?: Record<PathSubstitution, AttributePath>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../../../src/commands/inputs/lib.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../../../src/commands/inputs/lib.ts"],"names":[],"mappings":";;AAYA,4DAgBC;AA3BD,qDAKgC;AAChC,0EAA6E;AAK7E,SAAgB,wBAAwB,CAAC,SAA0B;IAKjE,MAAM,KAAK,GAAG,yBAAc,CAAC,MAAM,EAAE,CAAC;IACtC,MAAM,MAAM,GAAG,0BAAe,CAAC,MAAM,EAAE,CAAC;IACxC,MAAM,UAAU,GAAG,IAAA,mCAAmB,EAAC,SAAS,CAAC,CAAC,SAAS,CAAC;QAC1D,KAAK;QACL,MAAM;KACP,CAAC,CAAC;IACH,OAAO;QACL,UAAU;QACV,KAAK,EAAE,KAAK,CAAC,gBAAgB,EAAE;QAC/B,MAAM,EAAE,MAAM,CAAC,gBAAgB,EAAE;KAClC,CAAC;AACJ,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { PutCommandInput } from "@aws-sdk/lib-dynamodb";
|
|
2
2
|
import type { Attributes } from "../../types.js";
|
|
3
3
|
import type { ConditionParams } from "../expressions/index.js";
|
|
4
|
-
|
|
4
|
+
import { type ConditionCheckFailureReturnValue } from "./lib.js";
|
|
5
|
+
export type PutItemReturnValue = ConditionCheckFailureReturnValue;
|
|
5
6
|
export type PutItemInput<T extends Attributes = Attributes> = {
|
|
6
7
|
table: string;
|
|
7
8
|
item: T;
|
|
8
9
|
condition?: ConditionParams;
|
|
9
10
|
returnValues?: PutItemReturnValue;
|
|
10
|
-
returnValuesOnConditionCheckFailure?:
|
|
11
|
+
returnValuesOnConditionCheckFailure?: ConditionCheckFailureReturnValue;
|
|
11
12
|
};
|
|
12
13
|
export type PutItemResult<T extends Attributes> = {
|
|
13
14
|
item?: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"put-item.js","sourceRoot":"","sources":["../../../../src/commands/inputs/put-item.ts"],"names":[],"mappings":";;;AAGA,
|
|
1
|
+
{"version":3,"file":"put-item.js","sourceRoot":"","sources":["../../../../src/commands/inputs/put-item.ts"],"names":[],"mappings":";;;AAGA,qCAGkB;AAgBL,QAAA,YAAY,GAAG;IAC1B,MAAM;CACP,CAAC;AAEF,SAAS,MAAM,CACb,KAAsB;IAEtB,MAAM,MAAM,GAAoB;QAC9B,SAAS,EAAE,KAAK,CAAC,KAAK;QACtB,IAAI,EAAE,KAAK,CAAC,IAAI;KACjB,CAAC;IAEF,IAAI,KAAK,CAAC,YAAY,IAAI,IAAI,EAAE,CAAC;QAC/B,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IAC3C,CAAC;IAED,IAAI,KAAK,CAAC,mCAAmC,IAAI,IAAI,EAAE,CAAC;QACtD,MAAM,CAAC,mCAAmC;YACxC,KAAK,CAAC,mCAAmC,CAAC;IAC9C,CAAC;IAED,4FAA4F;IAC5F,qBAAqB;IACrB,IAAI,KAAK,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAA,iCAAwB,EAC5D,KAAK,CAAC,SAAS,CAChB,CAAC;IAEF,OAAO;QACL,GAAG,MAAM;QACT,mBAAmB,EAAE,UAAU;QAC/B,wBAAwB,EAAE,KAAK;QAC/B,yBAAyB,EAAE,MAAM;KAClC,CAAC;AACJ,CAAC"}
|
|
@@ -2,15 +2,19 @@ import type { UpdateCommandInput as NativeUpdateCommandInput } from "@aws-sdk/li
|
|
|
2
2
|
import type { WithRequired } from "@infra-blocks/types";
|
|
3
3
|
import type { KeyAttributes } from "../../types.js";
|
|
4
4
|
import { type ConditionParams, type UpdateExpressionParams } from "../expressions/index.js";
|
|
5
|
-
type
|
|
5
|
+
import type { ConditionCheckFailureReturnValue } from "./lib.js";
|
|
6
|
+
export type UpdateItemReturnValue = "NONE" | "ALL_OLD" | "UPDATED_OLD" | "ALL_NEW" | "UPDATED_NEW";
|
|
6
7
|
export interface UpdateItemInput<K extends KeyAttributes = KeyAttributes> {
|
|
7
8
|
table: string;
|
|
8
9
|
key: K;
|
|
9
10
|
update: UpdateExpressionParams;
|
|
10
11
|
condition?: ConditionParams;
|
|
12
|
+
returnValues?: UpdateItemReturnValue;
|
|
13
|
+
returnValuesOnConditionCheckFailure?: ConditionCheckFailureReturnValue;
|
|
11
14
|
}
|
|
12
15
|
export declare const UpdateItemInput: {
|
|
13
16
|
encode: typeof encode;
|
|
14
17
|
};
|
|
15
18
|
declare function encode<K extends KeyAttributes = KeyAttributes>(input: UpdateItemInput<K>): UpdateCommandInput;
|
|
19
|
+
type UpdateCommandInput = WithRequired<NativeUpdateCommandInput, "UpdateExpression">;
|
|
16
20
|
export {};
|
|
@@ -8,27 +8,33 @@ exports.UpdateItemInput = {
|
|
|
8
8
|
encode,
|
|
9
9
|
};
|
|
10
10
|
function encode(input) {
|
|
11
|
-
const { table, key, condition, update } = input;
|
|
12
11
|
const names = index_js_1.AttributeNames.create();
|
|
13
12
|
const values = index_js_1.AttributeValues.create();
|
|
14
13
|
const result = {
|
|
15
|
-
TableName: table,
|
|
16
|
-
Key: key,
|
|
17
|
-
UpdateExpression: index_js_2.UpdateExpression.from(update).stringify({
|
|
14
|
+
TableName: input.table,
|
|
15
|
+
Key: input.key,
|
|
16
|
+
UpdateExpression: index_js_2.UpdateExpression.from(input.update).stringify({
|
|
18
17
|
names,
|
|
19
18
|
values,
|
|
20
19
|
}),
|
|
21
20
|
};
|
|
21
|
+
if (input.returnValues != null) {
|
|
22
|
+
result.ReturnValues = input.returnValues;
|
|
23
|
+
}
|
|
24
|
+
if (input.returnValuesOnConditionCheckFailure != null) {
|
|
25
|
+
result.ReturnValuesOnConditionCheckFailure =
|
|
26
|
+
input.returnValuesOnConditionCheckFailure;
|
|
27
|
+
}
|
|
22
28
|
// If there is no condition, we know that the names and values are finalized and
|
|
23
29
|
// we are ready to return the payload.
|
|
24
|
-
if (condition == null) {
|
|
30
|
+
if (input.condition == null) {
|
|
25
31
|
result.ExpressionAttributeNames = names.getSubstitutions();
|
|
26
32
|
result.ExpressionAttributeValues = values.getSubstitutions();
|
|
27
33
|
return result;
|
|
28
34
|
}
|
|
29
35
|
// Otherwise, we need to stringify the condition, reusing the same names and values
|
|
30
36
|
// as before.
|
|
31
|
-
result.ConditionExpression = (0, expression_js_1.conditionExpression)(condition).stringify({
|
|
37
|
+
result.ConditionExpression = (0, expression_js_1.conditionExpression)(input.condition).stringify({
|
|
32
38
|
names,
|
|
33
39
|
values,
|
|
34
40
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-item.js","sourceRoot":"","sources":["../../../../src/commands/inputs/update-item.ts"],"names":[],"mappings":";;;AAGA,qDAAyE;AACzE,0EAA6E;AAC7E,sDAIiC;
|
|
1
|
+
{"version":3,"file":"update-item.js","sourceRoot":"","sources":["../../../../src/commands/inputs/update-item.ts"],"names":[],"mappings":";;;AAGA,qDAAyE;AACzE,0EAA6E;AAC7E,sDAIiC;AAoBpB,QAAA,eAAe,GAAG;IAC7B,MAAM;CACP,CAAC;AAEF,SAAS,MAAM,CACb,KAAyB;IAEzB,MAAM,KAAK,GAAG,yBAAc,CAAC,MAAM,EAAE,CAAC;IACtC,MAAM,MAAM,GAAG,0BAAe,CAAC,MAAM,EAAE,CAAC;IACxC,MAAM,MAAM,GAAuB;QACjC,SAAS,EAAE,KAAK,CAAC,KAAK;QACtB,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,gBAAgB,EAAE,2BAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC;YAC9D,KAAK;YACL,MAAM;SACP,CAAC;KACH,CAAC;IAEF,IAAI,KAAK,CAAC,YAAY,IAAI,IAAI,EAAE,CAAC;QAC/B,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IAC3C,CAAC;IAED,IAAI,KAAK,CAAC,mCAAmC,IAAI,IAAI,EAAE,CAAC;QACtD,MAAM,CAAC,mCAAmC;YACxC,KAAK,CAAC,mCAAmC,CAAC;IAC9C,CAAC;IAED,gFAAgF;IAChF,sCAAsC;IACtC,IAAI,KAAK,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;QAC5B,MAAM,CAAC,wBAAwB,GAAG,KAAK,CAAC,gBAAgB,EAAE,CAAC;QAC3D,MAAM,CAAC,yBAAyB,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC7D,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,mFAAmF;IACnF,aAAa;IACb,MAAM,CAAC,mBAAmB,GAAG,IAAA,mCAAmB,EAAC,KAAK,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;QAC1E,KAAK;QACL,MAAM;KACP,CAAC,CAAC;IACH,MAAM,CAAC,wBAAwB,GAAG,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAC3D,MAAM,CAAC,yBAAyB,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;IAC7D,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DeleteItemOutput = void 0;
|
|
4
|
+
const lib_js_1 = require("./lib.js");
|
|
4
5
|
exports.DeleteItemOutput = {
|
|
5
6
|
decode,
|
|
6
7
|
};
|
|
7
8
|
function decode(output) {
|
|
8
|
-
|
|
9
|
-
const result = {};
|
|
10
|
-
if (output.Attributes != null) {
|
|
11
|
-
result.item = output.Attributes;
|
|
12
|
-
}
|
|
13
|
-
return result;
|
|
9
|
+
return (0, lib_js_1.maybeSet)({}, "item", output, "Attributes");
|
|
14
10
|
}
|
|
15
11
|
//# sourceMappingURL=delete-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-item.js","sourceRoot":"","sources":["../../../../src/commands/outputs/delete-item.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"delete-item.js","sourceRoot":"","sources":["../../../../src/commands/outputs/delete-item.ts"],"names":[],"mappings":";;;AAEA,qCAAoC;AAIvB,QAAA,gBAAgB,GAAG;IAC9B,MAAM;CACP,CAAC;AAEF,SAAS,MAAM,CACb,MAA2B;IAE3B,OAAO,IAAA,iBAAQ,EAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { UpdateCommandOutput } from "@aws-sdk/lib-dynamodb";
|
|
2
|
+
import type { Attributes } from "../../types.js";
|
|
3
|
+
export type UpdateItemOutput<T extends Attributes = Attributes> = {
|
|
4
|
+
attributes?: T;
|
|
5
|
+
};
|
|
3
6
|
export declare const UpdateItemOutput: {
|
|
4
7
|
decode: typeof decode;
|
|
5
8
|
};
|
|
6
|
-
declare function decode(
|
|
9
|
+
declare function decode<T extends Attributes = Attributes>(output: UpdateCommandOutput): UpdateItemOutput<T>;
|
|
7
10
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UpdateItemOutput = void 0;
|
|
4
|
+
const lib_js_1 = require("./lib.js");
|
|
4
5
|
exports.UpdateItemOutput = {
|
|
5
6
|
decode,
|
|
6
7
|
};
|
|
7
|
-
function decode(
|
|
8
|
-
return {};
|
|
8
|
+
function decode(output) {
|
|
9
|
+
return (0, lib_js_1.maybeSet)({}, "attributes", output, "Attributes");
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=update-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-item.js","sourceRoot":"","sources":["../../../../src/commands/outputs/update-item.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"update-item.js","sourceRoot":"","sources":["../../../../src/commands/outputs/update-item.ts"],"names":[],"mappings":";;;AAEA,qCAAoC;AAMvB,QAAA,gBAAgB,GAAG;IAC9B,MAAM;CACP,CAAC;AAEF,SAAS,MAAM,CACb,MAA2B;IAE3B,OAAO,IAAA,iBAAQ,EAAC,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { UpdateCommand } from "@aws-sdk/lib-dynamodb";
|
|
2
|
-
import type { KeyAttributes } from "../types.js";
|
|
2
|
+
import type { Attributes, KeyAttributes } from "../types.js";
|
|
3
3
|
import { AbstractCommand } from "./base.js";
|
|
4
4
|
import { UpdateItemInput } from "./inputs/index.js";
|
|
5
5
|
import { UpdateItemOutput } from "./outputs/index.js";
|
|
6
|
-
export declare class UpdateItem<K extends KeyAttributes = KeyAttributes> extends AbstractCommand<UpdateItemInput<K>, UpdateItemOutput
|
|
6
|
+
export declare class UpdateItem<T extends Attributes = Attributes, K extends KeyAttributes = KeyAttributes> extends AbstractCommand<UpdateItemInput<K>, UpdateItemOutput<T>, UpdateCommand> {
|
|
7
7
|
constructor(input: UpdateItemInput<K>);
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-item.js","sourceRoot":"","sources":["../../../src/commands/update-item.ts"],"names":[],"mappings":";;;AAAA,wDAAsD;AAEtD,uCAA4C;AAC5C,gDAAoD;AACpD,iDAAsD;AAEtD,MAAa,
|
|
1
|
+
{"version":3,"file":"update-item.js","sourceRoot":"","sources":["../../../src/commands/update-item.ts"],"names":[],"mappings":";;;AAAA,wDAAsD;AAEtD,uCAA4C;AAC5C,gDAAoD;AACpD,iDAAsD;AAEtD,MAAa,UAGX,SAAQ,yBAIT;IACC,YAAY,KAAyB;QACnC,KAAK,CAAC;YACJ,KAAK;YACL,KAAK,EAAE;gBACL,MAAM,EAAE,0BAAe,CAAC,MAAM;gBAC9B,MAAM,EAAE,2BAAgB,CAAC,MAAM;aAChC;YACD,OAAO,EAAE,4BAAa;SACvB,CAAC,CAAC;IACL,CAAC;CACF;AAlBD,gCAkBC"}
|
package/lib/esm/client.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ 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, type CreateTableInput, type CreateTableOutput, type DeleteItemInput, type DeleteItemOutput, type DeleteTableInput, type DeleteTableOutput, type DynamoDbClientCommand, type GetItemInput, type GetItemOutput, type PutItemInput, type PutItemOutput, type QueryInput, type QueryOutput, type UpdateItemInput, type UpdateTimeToLiveInput, type UpdateTimeToLiveOutput, type WriteTransactionInput, type WriteTransactionOutput } from "./commands/index.js";
|
|
6
|
+
import { type CommandOutput, type CreateTableInput, type CreateTableOutput, type DeleteItemInput, type DeleteItemOutput, type DeleteTableInput, type DeleteTableOutput, type DynamoDbClientCommand, type GetItemInput, type GetItemOutput, type PutItemInput, type PutItemOutput, type QueryInput, type QueryOutput, type UpdateItemInput, type UpdateItemOutput, type UpdateTimeToLiveInput, type UpdateTimeToLiveOutput, type WriteTransactionInput, type WriteTransactionOutput } from "./commands/index.js";
|
|
7
7
|
import type { Attributes, KeyAttributes, KeySchema } from "./types.js";
|
|
8
8
|
/**
|
|
9
9
|
* Re-export of the native client's, renamed.
|
|
@@ -181,7 +181,7 @@ export declare class DynamoDbClient {
|
|
|
181
181
|
*
|
|
182
182
|
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html
|
|
183
183
|
*/
|
|
184
|
-
updateItem<K extends KeyAttributes = KeyAttributes>(input: UpdateItemInput<K>): Promise<
|
|
184
|
+
updateItem<T extends Attributes = Attributes, K extends KeyAttributes = KeyAttributes>(input: UpdateItemInput<K>): Promise<UpdateItemOutput<T>>;
|
|
185
185
|
/**
|
|
186
186
|
* Updates the time to live settings of a table using the UpdateTimeToLive API.
|
|
187
187
|
*
|
package/lib/esm/client.js
CHANGED
|
@@ -234,7 +234,7 @@ export class DynamoDbClient {
|
|
|
234
234
|
if (this.logger.isDebugEnabled()) {
|
|
235
235
|
this.logger.debug("updateItem(%s)", JSON.stringify(input));
|
|
236
236
|
}
|
|
237
|
-
|
|
237
|
+
return this.send(new UpdateItem(input));
|
|
238
238
|
}
|
|
239
239
|
/**
|
|
240
240
|
* Updates the time to live settings of a table using the UpdateTimeToLive API.
|
package/lib/esm/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAgC,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAEL,WAAW,EAGX,UAAU,EAGV,WAAW,EAIX,OAAO,EAGP,OAAO,EAGP,KA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AC,CAAC;QACrB,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;QACtD,MAAM,MAAM,GAAG,sBAAsB,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"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { DeleteCommandInput } from "@aws-sdk/lib-dynamodb";
|
|
2
2
|
import type { KeyAttributes } from "../../types.js";
|
|
3
3
|
import type { ConditionParams } from "../expressions/index.js";
|
|
4
|
-
|
|
4
|
+
import { type ConditionCheckFailureReturnValue } from "./lib.js";
|
|
5
|
+
export type DeleteItemReturnValue = ConditionCheckFailureReturnValue;
|
|
5
6
|
export type DeleteItemInput<K extends KeyAttributes = KeyAttributes> = {
|
|
6
7
|
table: string;
|
|
7
8
|
key: K;
|
|
8
9
|
condition?: ConditionParams;
|
|
9
10
|
returnValues?: DeleteItemReturnValue;
|
|
10
|
-
returnValuesOnConditionCheckFailure?:
|
|
11
|
+
returnValuesOnConditionCheckFailure?: ConditionCheckFailureReturnValue;
|
|
11
12
|
};
|
|
12
13
|
export declare const DeleteItemInput: {
|
|
13
14
|
encode: typeof encode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-item.js","sourceRoot":"","sources":["../../../../src/commands/inputs/delete-item.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"delete-item.js","sourceRoot":"","sources":["../../../../src/commands/inputs/delete-item.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,wBAAwB,GACzB,MAAM,UAAU,CAAC;AAalB,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,MAAM;CACP,CAAC;AAEF,SAAS,MAAM,CACb,KAAyB;IAEzB,MAAM,MAAM,GAAuB;QACjC,SAAS,EAAE,KAAK,CAAC,KAAK;QACtB,GAAG,EAAE,KAAK,CAAC,GAAG;KACf,CAAC;IAEF,IAAI,KAAK,CAAC,YAAY,IAAI,IAAI,EAAE,CAAC;QAC/B,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IAC3C,CAAC;IAED,IAAI,KAAK,CAAC,mCAAmC,IAAI,IAAI,EAAE,CAAC;QACtD,MAAM,CAAC,mCAAmC;YACxC,KAAK,CAAC,mCAAmC,CAAC;IAC9C,CAAC;IAED,4FAA4F;IAC5F,qBAAqB;IACrB,IAAI,KAAK,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,wBAAwB,CAC5D,KAAK,CAAC,SAAS,CAChB,CAAC;IACF,OAAO;QACL,GAAG,MAAM;QACT,mBAAmB,EAAE,UAAU;QAC/B,wBAAwB,EAAE,KAAK;QAC/B,yBAAyB,EAAE,MAAM;KAClC,CAAC;AACJ,CAAC"}
|
|
@@ -3,6 +3,7 @@ export * from "./create-table.js";
|
|
|
3
3
|
export * from "./delete-item.js";
|
|
4
4
|
export * from "./delete-table.js";
|
|
5
5
|
export * from "./get-item.js";
|
|
6
|
+
export type { ConditionCheckFailureReturnValue } from "./lib.js";
|
|
6
7
|
export * from "./put-item.js";
|
|
7
8
|
export * from "./query.js";
|
|
8
9
|
export * from "./update-item.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/inputs/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/inputs/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAE9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AttributePath, AttributeValue } from "../../types.js";
|
|
2
2
|
import { type PathSubstitution, type ValueSubstitution } from "../attributes/index.js";
|
|
3
3
|
import type { ConditionParams } from "../expressions/index.js";
|
|
4
|
+
export type ConditionCheckFailureReturnValue = "NONE" | "ALL_OLD";
|
|
4
5
|
export declare function intoExpressionComponents(condition: ConditionParams): {
|
|
5
6
|
expression: string;
|
|
6
7
|
names?: Record<PathSubstitution, AttributePath>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../../../src/commands/inputs/lib.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,eAAe,GAGhB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../../../src/commands/inputs/lib.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,eAAe,GAGhB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAK7E,MAAM,UAAU,wBAAwB,CAAC,SAA0B;IAKjE,MAAM,KAAK,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;IACtC,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC;IACxC,MAAM,UAAU,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;QAC1D,KAAK;QACL,MAAM;KACP,CAAC,CAAC;IACH,OAAO;QACL,UAAU;QACV,KAAK,EAAE,KAAK,CAAC,gBAAgB,EAAE;QAC/B,MAAM,EAAE,MAAM,CAAC,gBAAgB,EAAE;KAClC,CAAC;AACJ,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { PutCommandInput } from "@aws-sdk/lib-dynamodb";
|
|
2
2
|
import type { Attributes } from "../../types.js";
|
|
3
3
|
import type { ConditionParams } from "../expressions/index.js";
|
|
4
|
-
|
|
4
|
+
import { type ConditionCheckFailureReturnValue } from "./lib.js";
|
|
5
|
+
export type PutItemReturnValue = ConditionCheckFailureReturnValue;
|
|
5
6
|
export type PutItemInput<T extends Attributes = Attributes> = {
|
|
6
7
|
table: string;
|
|
7
8
|
item: T;
|
|
8
9
|
condition?: ConditionParams;
|
|
9
10
|
returnValues?: PutItemReturnValue;
|
|
10
|
-
returnValuesOnConditionCheckFailure?:
|
|
11
|
+
returnValuesOnConditionCheckFailure?: ConditionCheckFailureReturnValue;
|
|
11
12
|
};
|
|
12
13
|
export type PutItemResult<T extends Attributes> = {
|
|
13
14
|
item?: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"put-item.js","sourceRoot":"","sources":["../../../../src/commands/inputs/put-item.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"put-item.js","sourceRoot":"","sources":["../../../../src/commands/inputs/put-item.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,wBAAwB,GACzB,MAAM,UAAU,CAAC;AAgBlB,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,MAAM;CACP,CAAC;AAEF,SAAS,MAAM,CACb,KAAsB;IAEtB,MAAM,MAAM,GAAoB;QAC9B,SAAS,EAAE,KAAK,CAAC,KAAK;QACtB,IAAI,EAAE,KAAK,CAAC,IAAI;KACjB,CAAC;IAEF,IAAI,KAAK,CAAC,YAAY,IAAI,IAAI,EAAE,CAAC;QAC/B,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IAC3C,CAAC;IAED,IAAI,KAAK,CAAC,mCAAmC,IAAI,IAAI,EAAE,CAAC;QACtD,MAAM,CAAC,mCAAmC;YACxC,KAAK,CAAC,mCAAmC,CAAC;IAC9C,CAAC;IAED,4FAA4F;IAC5F,qBAAqB;IACrB,IAAI,KAAK,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,wBAAwB,CAC5D,KAAK,CAAC,SAAS,CAChB,CAAC;IAEF,OAAO;QACL,GAAG,MAAM;QACT,mBAAmB,EAAE,UAAU;QAC/B,wBAAwB,EAAE,KAAK;QAC/B,yBAAyB,EAAE,MAAM;KAClC,CAAC;AACJ,CAAC"}
|
|
@@ -2,15 +2,19 @@ import type { UpdateCommandInput as NativeUpdateCommandInput } from "@aws-sdk/li
|
|
|
2
2
|
import type { WithRequired } from "@infra-blocks/types";
|
|
3
3
|
import type { KeyAttributes } from "../../types.js";
|
|
4
4
|
import { type ConditionParams, type UpdateExpressionParams } from "../expressions/index.js";
|
|
5
|
-
type
|
|
5
|
+
import type { ConditionCheckFailureReturnValue } from "./lib.js";
|
|
6
|
+
export type UpdateItemReturnValue = "NONE" | "ALL_OLD" | "UPDATED_OLD" | "ALL_NEW" | "UPDATED_NEW";
|
|
6
7
|
export interface UpdateItemInput<K extends KeyAttributes = KeyAttributes> {
|
|
7
8
|
table: string;
|
|
8
9
|
key: K;
|
|
9
10
|
update: UpdateExpressionParams;
|
|
10
11
|
condition?: ConditionParams;
|
|
12
|
+
returnValues?: UpdateItemReturnValue;
|
|
13
|
+
returnValuesOnConditionCheckFailure?: ConditionCheckFailureReturnValue;
|
|
11
14
|
}
|
|
12
15
|
export declare const UpdateItemInput: {
|
|
13
16
|
encode: typeof encode;
|
|
14
17
|
};
|
|
15
18
|
declare function encode<K extends KeyAttributes = KeyAttributes>(input: UpdateItemInput<K>): UpdateCommandInput;
|
|
19
|
+
type UpdateCommandInput = WithRequired<NativeUpdateCommandInput, "UpdateExpression">;
|
|
16
20
|
export {};
|
|
@@ -5,27 +5,33 @@ export const UpdateItemInput = {
|
|
|
5
5
|
encode,
|
|
6
6
|
};
|
|
7
7
|
function encode(input) {
|
|
8
|
-
const { table, key, condition, update } = input;
|
|
9
8
|
const names = AttributeNames.create();
|
|
10
9
|
const values = AttributeValues.create();
|
|
11
10
|
const result = {
|
|
12
|
-
TableName: table,
|
|
13
|
-
Key: key,
|
|
14
|
-
UpdateExpression: UpdateExpression.from(update).stringify({
|
|
11
|
+
TableName: input.table,
|
|
12
|
+
Key: input.key,
|
|
13
|
+
UpdateExpression: UpdateExpression.from(input.update).stringify({
|
|
15
14
|
names,
|
|
16
15
|
values,
|
|
17
16
|
}),
|
|
18
17
|
};
|
|
18
|
+
if (input.returnValues != null) {
|
|
19
|
+
result.ReturnValues = input.returnValues;
|
|
20
|
+
}
|
|
21
|
+
if (input.returnValuesOnConditionCheckFailure != null) {
|
|
22
|
+
result.ReturnValuesOnConditionCheckFailure =
|
|
23
|
+
input.returnValuesOnConditionCheckFailure;
|
|
24
|
+
}
|
|
19
25
|
// If there is no condition, we know that the names and values are finalized and
|
|
20
26
|
// we are ready to return the payload.
|
|
21
|
-
if (condition == null) {
|
|
27
|
+
if (input.condition == null) {
|
|
22
28
|
result.ExpressionAttributeNames = names.getSubstitutions();
|
|
23
29
|
result.ExpressionAttributeValues = values.getSubstitutions();
|
|
24
30
|
return result;
|
|
25
31
|
}
|
|
26
32
|
// Otherwise, we need to stringify the condition, reusing the same names and values
|
|
27
33
|
// as before.
|
|
28
|
-
result.ConditionExpression = conditionExpression(condition).stringify({
|
|
34
|
+
result.ConditionExpression = conditionExpression(input.condition).stringify({
|
|
29
35
|
names,
|
|
30
36
|
values,
|
|
31
37
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-item.js","sourceRoot":"","sources":["../../../../src/commands/inputs/update-item.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAEL,gBAAgB,GAEjB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"update-item.js","sourceRoot":"","sources":["../../../../src/commands/inputs/update-item.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAEL,gBAAgB,GAEjB,MAAM,yBAAyB,CAAC;AAoBjC,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,MAAM;CACP,CAAC;AAEF,SAAS,MAAM,CACb,KAAyB;IAEzB,MAAM,KAAK,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;IACtC,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC;IACxC,MAAM,MAAM,GAAuB;QACjC,SAAS,EAAE,KAAK,CAAC,KAAK;QACtB,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,gBAAgB,EAAE,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC;YAC9D,KAAK;YACL,MAAM;SACP,CAAC;KACH,CAAC;IAEF,IAAI,KAAK,CAAC,YAAY,IAAI,IAAI,EAAE,CAAC;QAC/B,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IAC3C,CAAC;IAED,IAAI,KAAK,CAAC,mCAAmC,IAAI,IAAI,EAAE,CAAC;QACtD,MAAM,CAAC,mCAAmC;YACxC,KAAK,CAAC,mCAAmC,CAAC;IAC9C,CAAC;IAED,gFAAgF;IAChF,sCAAsC;IACtC,IAAI,KAAK,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;QAC5B,MAAM,CAAC,wBAAwB,GAAG,KAAK,CAAC,gBAAgB,EAAE,CAAC;QAC3D,MAAM,CAAC,yBAAyB,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC7D,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,mFAAmF;IACnF,aAAa;IACb,MAAM,CAAC,mBAAmB,GAAG,mBAAmB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;QAC1E,KAAK;QACL,MAAM;KACP,CAAC,CAAC;IACH,MAAM,CAAC,wBAAwB,GAAG,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAC3D,MAAM,CAAC,yBAAyB,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;IAC7D,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
+
import { maybeSet } from "./lib.js";
|
|
1
2
|
export const DeleteItemOutput = {
|
|
2
3
|
decode,
|
|
3
4
|
};
|
|
4
5
|
function decode(output) {
|
|
5
|
-
|
|
6
|
-
const result = {};
|
|
7
|
-
if (output.Attributes != null) {
|
|
8
|
-
result.item = output.Attributes;
|
|
9
|
-
}
|
|
10
|
-
return result;
|
|
6
|
+
return maybeSet({}, "item", output, "Attributes");
|
|
11
7
|
}
|
|
12
8
|
//# sourceMappingURL=delete-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-item.js","sourceRoot":"","sources":["../../../../src/commands/outputs/delete-item.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"delete-item.js","sourceRoot":"","sources":["../../../../src/commands/outputs/delete-item.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAIpC,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,MAAM;CACP,CAAC;AAEF,SAAS,MAAM,CACb,MAA2B;IAE3B,OAAO,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { UpdateCommandOutput } from "@aws-sdk/lib-dynamodb";
|
|
2
|
+
import type { Attributes } from "../../types.js";
|
|
3
|
+
export type UpdateItemOutput<T extends Attributes = Attributes> = {
|
|
4
|
+
attributes?: T;
|
|
5
|
+
};
|
|
3
6
|
export declare const UpdateItemOutput: {
|
|
4
7
|
decode: typeof decode;
|
|
5
8
|
};
|
|
6
|
-
declare function decode(
|
|
9
|
+
declare function decode<T extends Attributes = Attributes>(output: UpdateCommandOutput): UpdateItemOutput<T>;
|
|
7
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-item.js","sourceRoot":"","sources":["../../../../src/commands/outputs/update-item.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update-item.js","sourceRoot":"","sources":["../../../../src/commands/outputs/update-item.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAMpC,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,MAAM;CACP,CAAC;AAEF,SAAS,MAAM,CACb,MAA2B;IAE3B,OAAO,QAAQ,CAAC,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { UpdateCommand } from "@aws-sdk/lib-dynamodb";
|
|
2
|
-
import type { KeyAttributes } from "../types.js";
|
|
2
|
+
import type { Attributes, KeyAttributes } from "../types.js";
|
|
3
3
|
import { AbstractCommand } from "./base.js";
|
|
4
4
|
import { UpdateItemInput } from "./inputs/index.js";
|
|
5
5
|
import { UpdateItemOutput } from "./outputs/index.js";
|
|
6
|
-
export declare class UpdateItem<K extends KeyAttributes = KeyAttributes> extends AbstractCommand<UpdateItemInput<K>, UpdateItemOutput
|
|
6
|
+
export declare class UpdateItem<T extends Attributes = Attributes, K extends KeyAttributes = KeyAttributes> extends AbstractCommand<UpdateItemInput<K>, UpdateItemOutput<T>, UpdateCommand> {
|
|
7
7
|
constructor(input: UpdateItemInput<K>);
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-item.js","sourceRoot":"","sources":["../../../src/commands/update-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"update-item.js","sourceRoot":"","sources":["../../../src/commands/update-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,OAAO,UAGX,SAAQ,eAIT;IACC,YAAY,KAAyB;QACnC,KAAK,CAAC;YACJ,KAAK;YACL,KAAK,EAAE;gBACL,MAAM,EAAE,eAAe,CAAC,MAAM;gBAC9B,MAAM,EAAE,gBAAgB,CAAC,MAAM;aAChC;YACD,OAAO,EAAE,aAAa;SACvB,CAAC,CAAC;IACL,CAAC;CACF"}
|