@aws-sdk/util-dynamodb 3.74.0 → 3.78.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/CHANGELOG.md +27 -0
- package/dist-cjs/marshall.js +20 -1
- package/dist-es/marshall.js +21 -1
- package/dist-types/marshall.d.ts +15 -3
- package/dist-types/ts3.4/marshall.d.ts +14 -5
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.78.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.77.0...v3.78.0) (2022-04-26)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-sdk/util-dynamodb
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.76.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.75.0...v3.76.0) (2022-04-22)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **util-dynamodb:** allow marshall function to handle more input types ([#3539](https://github.com/aws/aws-sdk-js-v3/issues/3539)) ([a5fa267](https://github.com/aws/aws-sdk-js-v3/commit/a5fa26783c7d061e2f32b985fdcf371487efaff4))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [3.75.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.74.0...v3.75.0) (2022-04-21)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @aws-sdk/util-dynamodb
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
# [3.74.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.73.0...v3.74.0) (2022-04-20)
|
|
7
34
|
|
|
8
35
|
**Note:** Version bump only for package @aws-sdk/util-dynamodb
|
package/dist-cjs/marshall.js
CHANGED
|
@@ -2,5 +2,24 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.marshall = void 0;
|
|
4
4
|
const convertToAttr_1 = require("./convertToAttr");
|
|
5
|
-
|
|
5
|
+
function marshall(data, options) {
|
|
6
|
+
const attributeValue = (0, convertToAttr_1.convertToAttr)(data, options);
|
|
7
|
+
const [key, value] = Object.entries(attributeValue)[0];
|
|
8
|
+
switch (key) {
|
|
9
|
+
case "M":
|
|
10
|
+
case "L":
|
|
11
|
+
return value;
|
|
12
|
+
case "SS":
|
|
13
|
+
case "NS":
|
|
14
|
+
case "BS":
|
|
15
|
+
case "S":
|
|
16
|
+
case "N":
|
|
17
|
+
case "B":
|
|
18
|
+
case "NULL":
|
|
19
|
+
case "BOOL":
|
|
20
|
+
case "$unknown":
|
|
21
|
+
default:
|
|
22
|
+
return attributeValue;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
6
25
|
exports.marshall = marshall;
|
package/dist-es/marshall.js
CHANGED
|
@@ -1,2 +1,22 @@
|
|
|
1
|
+
import { __read } from "tslib";
|
|
1
2
|
import { convertToAttr } from "./convertToAttr";
|
|
2
|
-
export
|
|
3
|
+
export function marshall(data, options) {
|
|
4
|
+
var attributeValue = convertToAttr(data, options);
|
|
5
|
+
var _a = __read(Object.entries(attributeValue)[0], 2), key = _a[0], value = _a[1];
|
|
6
|
+
switch (key) {
|
|
7
|
+
case "M":
|
|
8
|
+
case "L":
|
|
9
|
+
return value;
|
|
10
|
+
case "SS":
|
|
11
|
+
case "NS":
|
|
12
|
+
case "BS":
|
|
13
|
+
case "S":
|
|
14
|
+
case "N":
|
|
15
|
+
case "B":
|
|
16
|
+
case "NULL":
|
|
17
|
+
case "BOOL":
|
|
18
|
+
case "$unknown":
|
|
19
|
+
default:
|
|
20
|
+
return attributeValue;
|
|
21
|
+
}
|
|
22
|
+
}
|
package/dist-types/marshall.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AttributeValue } from "@aws-sdk/client-dynamodb";
|
|
2
|
+
import { NativeAttributeBinary, NativeAttributeValue } from "./models";
|
|
2
3
|
/**
|
|
3
4
|
* An optional configuration object for `marshall`
|
|
4
5
|
*/
|
|
@@ -21,7 +22,18 @@ export interface marshallOptions {
|
|
|
21
22
|
*
|
|
22
23
|
* @param {any} data - The data to convert to a DynamoDB record
|
|
23
24
|
* @param {marshallOptions} options - An optional configuration object for `marshall`
|
|
25
|
+
*
|
|
24
26
|
*/
|
|
25
|
-
export declare
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
export declare function marshall(data: Set<string>, options?: marshallOptions): AttributeValue.SSMember;
|
|
28
|
+
export declare function marshall(data: Set<number>, options?: marshallOptions): AttributeValue.NSMember;
|
|
29
|
+
export declare function marshall(data: Set<NativeAttributeBinary>, options?: marshallOptions): AttributeValue.BSMember;
|
|
30
|
+
export declare function marshall<M extends {
|
|
31
|
+
[K in keyof M]: NativeAttributeValue;
|
|
32
|
+
}>(data: M, options?: marshallOptions): Record<string, AttributeValue>;
|
|
33
|
+
export declare function marshall<L extends NativeAttributeValue[]>(data: L, options?: marshallOptions): AttributeValue[];
|
|
34
|
+
export declare function marshall(data: string, options?: marshallOptions): AttributeValue.SMember;
|
|
35
|
+
export declare function marshall(data: number, options?: marshallOptions): AttributeValue.NMember;
|
|
36
|
+
export declare function marshall(data: NativeAttributeBinary, options?: marshallOptions): AttributeValue.BMember;
|
|
37
|
+
export declare function marshall(data: null, options?: marshallOptions): AttributeValue.NULLMember;
|
|
38
|
+
export declare function marshall(data: boolean, options?: marshallOptions): AttributeValue.BOOLMember;
|
|
39
|
+
export declare function marshall(data: unknown, options?: marshallOptions): AttributeValue.$UnknownMember;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AttributeValue } from "@aws-sdk/client-dynamodb";
|
|
2
|
+
import { NativeAttributeBinary, NativeAttributeValue } from "./models";
|
|
2
3
|
|
|
3
4
|
export interface marshallOptions {
|
|
4
5
|
|
|
@@ -9,8 +10,16 @@ export interface marshallOptions {
|
|
|
9
10
|
convertClassInstanceToMap?: boolean;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
export declare
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
export declare function marshall(data: Set<string>, options?: marshallOptions): AttributeValue.SSMember;
|
|
14
|
+
export declare function marshall(data: Set<number>, options?: marshallOptions): AttributeValue.NSMember;
|
|
15
|
+
export declare function marshall(data: Set<NativeAttributeBinary>, options?: marshallOptions): AttributeValue.BSMember;
|
|
16
|
+
export declare function marshall<M extends {
|
|
17
|
+
[K in keyof M]: NativeAttributeValue;
|
|
18
|
+
}>(data: M, options?: marshallOptions): Record<string, AttributeValue>;
|
|
19
|
+
export declare function marshall<L extends NativeAttributeValue[]>(data: L, options?: marshallOptions): AttributeValue[];
|
|
20
|
+
export declare function marshall(data: string, options?: marshallOptions): AttributeValue.SMember;
|
|
21
|
+
export declare function marshall(data: number, options?: marshallOptions): AttributeValue.NMember;
|
|
22
|
+
export declare function marshall(data: NativeAttributeBinary, options?: marshallOptions): AttributeValue.BMember;
|
|
23
|
+
export declare function marshall(data: null, options?: marshallOptions): AttributeValue.NULLMember;
|
|
24
|
+
export declare function marshall(data: boolean, options?: marshallOptions): AttributeValue.BOOLMember;
|
|
25
|
+
export declare function marshall(data: unknown, options?: marshallOptions): AttributeValue.$UnknownMember;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/util-dynamodb",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.78.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
6
6
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"tslib": "^2.3.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@aws-sdk/client-dynamodb": "3.
|
|
25
|
+
"@aws-sdk/client-dynamodb": "3.78.0",
|
|
26
26
|
"@tsconfig/recommended": "1.0.1",
|
|
27
27
|
"concurrently": "7.0.0",
|
|
28
28
|
"downlevel-dts": "0.7.0",
|