@aws-sdk/util-dynamodb 3.596.0 → 3.600.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.
@@ -1,5 +1,6 @@
1
1
  import { AttributeValue } from "@aws-sdk/client-dynamodb";
2
2
  import { NativeAttributeBinary, NativeAttributeValue } from "./models";
3
+ import { NumberValue } from "./NumberValue";
3
4
  /**
4
5
  * An optional configuration object for `marshall`
5
6
  */
@@ -32,16 +33,37 @@ export interface marshallOptions {
32
33
  * @param options - An optional configuration object for `marshall`
33
34
  *
34
35
  */
36
+ export declare function marshall(data: null, options?: marshallOptions): AttributeValue.NULLMember;
37
+ export declare function marshall(data: Set<bigint> | Set<number> | Set<NumberValue>, options?: marshallOptions): AttributeValue.NSMember;
35
38
  export declare function marshall(data: Set<string>, options?: marshallOptions): AttributeValue.SSMember;
36
- export declare function marshall(data: Set<number>, options?: marshallOptions): AttributeValue.NSMember;
37
39
  export declare function marshall(data: Set<NativeAttributeBinary>, options?: marshallOptions): AttributeValue.BSMember;
38
- export declare function marshall<M extends {
39
- [K in keyof M]: NativeAttributeValue;
40
- }>(data: M, options?: marshallOptions): Record<string, AttributeValue>;
41
- export declare function marshall<L extends NativeAttributeValue[]>(data: L, options?: marshallOptions): AttributeValue[];
42
- export declare function marshall(data: string, options?: marshallOptions): AttributeValue.SMember;
43
- export declare function marshall(data: number, options?: marshallOptions): AttributeValue.NMember;
44
40
  export declare function marshall(data: NativeAttributeBinary, options?: marshallOptions): AttributeValue.BMember;
45
- export declare function marshall(data: null, options?: marshallOptions): AttributeValue.NULLMember;
46
41
  export declare function marshall(data: boolean, options?: marshallOptions): AttributeValue.BOOLMember;
42
+ export declare function marshall(data: number | NumberValue | bigint, options?: marshallOptions): AttributeValue.NMember;
43
+ export declare function marshall(data: string, options?: marshallOptions): AttributeValue.SMember;
44
+ export declare function marshall(data: boolean, options?: marshallOptions): AttributeValue.BOOLMember;
45
+ export declare function marshall<O extends {
46
+ convertTopLevelContainer: true;
47
+ }>(data: NativeAttributeValue[], options: marshallOptions & O): AttributeValue.LMember;
48
+ export declare function marshall<O extends {
49
+ convertTopLevelContainer: false;
50
+ }>(data: NativeAttributeValue[], options: marshallOptions & O): AttributeValue[];
51
+ export declare function marshall<O extends {
52
+ convertTopLevelContainer: boolean;
53
+ }>(data: NativeAttributeValue[], options: marshallOptions & O): AttributeValue[] | AttributeValue.LMember;
54
+ export declare function marshall(data: NativeAttributeValue[], options?: marshallOptions): AttributeValue[];
55
+ export declare function marshall<O extends {
56
+ convertTopLevelContainer: true;
57
+ }>(data: Map<string, NativeAttributeValue> | Record<string, NativeAttributeValue>, options: marshallOptions & O): AttributeValue.MMember;
58
+ export declare function marshall<O extends {
59
+ convertTopLevelContainer: false;
60
+ }>(data: Map<string, NativeAttributeValue> | Record<string, NativeAttributeValue>, options: marshallOptions & O): Record<string, AttributeValue>;
61
+ export declare function marshall<O extends {
62
+ convertTopLevelContainer: boolean;
63
+ }>(data: Map<string, NativeAttributeValue> | Record<string, NativeAttributeValue>, options: marshallOptions & O): Record<string, AttributeValue> | AttributeValue.MMember;
64
+ export declare function marshall(data: Map<string, NativeAttributeValue> | Record<string, NativeAttributeValue>, options?: marshallOptions): Record<string, AttributeValue>;
65
+ export declare function marshall(data: any, options?: marshallOptions): any;
66
+ /**
67
+ * This signature will be unmatchable but is included for information.
68
+ */
47
69
  export declare function marshall(data: unknown, options?: marshallOptions): AttributeValue.$UnknownMember;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ import type { Exact } from "@smithy/types";
2
3
  /**
3
4
  * A interface recognizable as a numeric value that stores the underlying number
4
5
  * as a string.
@@ -10,11 +11,17 @@
10
11
  export interface NumberValue {
11
12
  readonly value: string;
12
13
  }
14
+ /**
15
+ * @public
16
+ */
13
17
  export type NativeAttributeValue = NativeScalarAttributeValue | {
14
18
  [key: string]: NativeAttributeValue;
15
19
  } | NativeAttributeValue[] | Set<number | bigint | NumberValue | string | NativeAttributeBinary | undefined> | InstanceType<{
16
20
  new (...args: any[]): any;
17
21
  }>;
22
+ /**
23
+ * @public
24
+ */
18
25
  export type NativeScalarAttributeValue = null | undefined | boolean | number | NumberValue | bigint | NativeAttributeBinary | string;
19
26
  /**
20
27
  * Declare File in case DOM is not added to the tsconfig lib causing
@@ -25,4 +32,11 @@ declare global {
25
32
  interface File {
26
33
  }
27
34
  }
28
- export type NativeAttributeBinary = ArrayBuffer | Blob | Buffer | DataView | File | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;
35
+ type Unavailable = never;
36
+ type BlobDefined = Exact<Blob, {}> extends true ? false : true;
37
+ type BlobOptionalType = BlobDefined extends true ? Blob : Unavailable;
38
+ /**
39
+ * @public
40
+ */
41
+ export type NativeAttributeBinary = ArrayBuffer | BlobOptionalType | Buffer | DataView | File | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;
42
+ export {};
@@ -1,5 +1,6 @@
1
1
  import { AttributeValue } from "@aws-sdk/client-dynamodb";
2
2
  import { NativeAttributeBinary, NativeAttributeValue } from "./models";
3
+ import { NumberValue } from "./NumberValue";
3
4
  export interface marshallOptions {
4
5
  convertEmptyValues?: boolean;
5
6
  removeUndefinedValues?: boolean;
@@ -7,46 +8,103 @@ export interface marshallOptions {
7
8
  convertTopLevelContainer?: boolean;
8
9
  }
9
10
  export declare function marshall(
10
- data: Set<string>,
11
+ data: null,
11
12
  options?: marshallOptions
12
- ): AttributeValue.SSMember;
13
+ ): AttributeValue.NULLMember;
13
14
  export declare function marshall(
14
- data: Set<number>,
15
+ data: Set<bigint> | Set<number> | Set<NumberValue>,
15
16
  options?: marshallOptions
16
17
  ): AttributeValue.NSMember;
18
+ export declare function marshall(
19
+ data: Set<string>,
20
+ options?: marshallOptions
21
+ ): AttributeValue.SSMember;
17
22
  export declare function marshall(
18
23
  data: Set<NativeAttributeBinary>,
19
24
  options?: marshallOptions
20
25
  ): AttributeValue.BSMember;
21
- export declare function marshall<
22
- M extends {
23
- [K in keyof M]: NativeAttributeValue;
24
- }
25
- >(data: M, options?: marshallOptions): Record<string, AttributeValue>;
26
- export declare function marshall<L extends NativeAttributeValue[]>(
27
- data: L,
28
- options?: marshallOptions
29
- ): AttributeValue[];
30
26
  export declare function marshall(
31
- data: string,
27
+ data: NativeAttributeBinary,
32
28
  options?: marshallOptions
33
- ): AttributeValue.SMember;
29
+ ): AttributeValue.BMember;
34
30
  export declare function marshall(
35
- data: number,
31
+ data: boolean,
36
32
  options?: marshallOptions
37
- ): AttributeValue.NMember;
33
+ ): AttributeValue.BOOLMember;
38
34
  export declare function marshall(
39
- data: NativeAttributeBinary,
35
+ data: number | NumberValue | bigint,
40
36
  options?: marshallOptions
41
- ): AttributeValue.BMember;
37
+ ): AttributeValue.NMember;
42
38
  export declare function marshall(
43
- data: null,
39
+ data: string,
44
40
  options?: marshallOptions
45
- ): AttributeValue.NULLMember;
41
+ ): AttributeValue.SMember;
46
42
  export declare function marshall(
47
43
  data: boolean,
48
44
  options?: marshallOptions
49
45
  ): AttributeValue.BOOLMember;
46
+ export declare function marshall<
47
+ O extends {
48
+ convertTopLevelContainer: true;
49
+ }
50
+ >(
51
+ data: NativeAttributeValue[],
52
+ options: marshallOptions & O
53
+ ): AttributeValue.LMember;
54
+ export declare function marshall<
55
+ O extends {
56
+ convertTopLevelContainer: false;
57
+ }
58
+ >(data: NativeAttributeValue[], options: marshallOptions & O): AttributeValue[];
59
+ export declare function marshall<
60
+ O extends {
61
+ convertTopLevelContainer: boolean;
62
+ }
63
+ >(
64
+ data: NativeAttributeValue[],
65
+ options: marshallOptions & O
66
+ ): AttributeValue[] | AttributeValue.LMember;
67
+ export declare function marshall(
68
+ data: NativeAttributeValue[],
69
+ options?: marshallOptions
70
+ ): AttributeValue[];
71
+ export declare function marshall<
72
+ O extends {
73
+ convertTopLevelContainer: true;
74
+ }
75
+ >(
76
+ data:
77
+ | Map<string, NativeAttributeValue>
78
+ | Record<string, NativeAttributeValue>,
79
+ options: marshallOptions & O
80
+ ): AttributeValue.MMember;
81
+ export declare function marshall<
82
+ O extends {
83
+ convertTopLevelContainer: false;
84
+ }
85
+ >(
86
+ data:
87
+ | Map<string, NativeAttributeValue>
88
+ | Record<string, NativeAttributeValue>,
89
+ options: marshallOptions & O
90
+ ): Record<string, AttributeValue>;
91
+ export declare function marshall<
92
+ O extends {
93
+ convertTopLevelContainer: boolean;
94
+ }
95
+ >(
96
+ data:
97
+ | Map<string, NativeAttributeValue>
98
+ | Record<string, NativeAttributeValue>,
99
+ options: marshallOptions & O
100
+ ): Record<string, AttributeValue> | AttributeValue.MMember;
101
+ export declare function marshall(
102
+ data:
103
+ | Map<string, NativeAttributeValue>
104
+ | Record<string, NativeAttributeValue>,
105
+ options?: marshallOptions
106
+ ): Record<string, AttributeValue>;
107
+ export declare function marshall(data: any, options?: marshallOptions): any;
50
108
  export declare function marshall(
51
109
  data: unknown,
52
110
  options?: marshallOptions
@@ -1,3 +1,4 @@
1
+ import { Exact } from "@smithy/types";
1
2
  export interface NumberValue {
2
3
  readonly value: string;
3
4
  }
@@ -25,9 +26,12 @@ export type NativeScalarAttributeValue =
25
26
  declare global {
26
27
  interface File {}
27
28
  }
29
+ type Unavailable = never;
30
+ type BlobDefined = Exact<Blob, {}> extends true ? false : true;
31
+ type BlobOptionalType = BlobDefined extends true ? Blob : Unavailable;
28
32
  export type NativeAttributeBinary =
29
33
  | ArrayBuffer
30
- | Blob
34
+ | BlobOptionalType
31
35
  | Buffer
32
36
  | DataView
33
37
  | File
@@ -42,3 +46,4 @@ export type NativeAttributeBinary =
42
46
  | Float64Array
43
47
  | BigInt64Array
44
48
  | BigUint64Array;
49
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/util-dynamodb",
3
- "version": "3.596.0",
3
+ "version": "3.600.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
6
6
  "build:cjs": "node ../../scripts/compilation/inline util-dynamodb",
@@ -24,7 +24,7 @@
24
24
  "tslib": "^2.6.2"
25
25
  },
26
26
  "devDependencies": {
27
- "@aws-sdk/client-dynamodb": "3.596.0",
27
+ "@aws-sdk/client-dynamodb": "3.600.0",
28
28
  "@tsconfig/recommended": "1.0.1",
29
29
  "concurrently": "7.0.0",
30
30
  "downlevel-dts": "0.10.1",
@@ -32,7 +32,7 @@
32
32
  "typescript": "~4.9.5"
33
33
  },
34
34
  "peerDependencies": {
35
- "@aws-sdk/client-dynamodb": "^3.596.0"
35
+ "@aws-sdk/client-dynamodb": "^3.600.0"
36
36
  },
37
37
  "engines": {
38
38
  "node": ">=16.0.0"