dynamo-command-builder 0.1.1 → 0.1.3

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/dist/index.d.ts CHANGED
@@ -1,6 +1,52 @@
1
1
  import { GetCommandInput, PutCommandInput, QueryCommandInput, UpdateCommandInput } from '@aws-sdk/lib-dynamodb';
2
2
  import { z } from 'zod';
3
3
 
4
+ declare const dynamoAttrTypeSch: z.ZodEnum<{
5
+ S: "S";
6
+ N: "N";
7
+ B: "B";
8
+ BOOL: "BOOL";
9
+ NULL: "NULL";
10
+ SS: "SS";
11
+ NS: "NS";
12
+ BS: "BS";
13
+ M: "M";
14
+ L: "L";
15
+ }>;
16
+ type DynamoAttrType = z.infer<typeof dynamoAttrTypeSch>;
17
+ declare const dynamoKeyAttrTypeSch: z.ZodEnum<{
18
+ S: "S";
19
+ N: "N";
20
+ B: "B";
21
+ }>;
22
+ type DynamoKeyAttrType = z.infer<typeof dynamoKeyAttrTypeSch>;
23
+ declare const dynamoComparatorSch: z.ZodEnum<{
24
+ "=": "=";
25
+ "<": "<";
26
+ "<=": "<=";
27
+ ">": ">";
28
+ ">=": ">=";
29
+ BETWEEN: "BETWEEN";
30
+ BEGINS_WITH: "BEGINS_WITH";
31
+ }>;
32
+ type DynamoComparator = z.infer<typeof dynamoComparatorSch>;
33
+ type DynamoQueryRequest = {
34
+ pKey: string;
35
+ pKeyType: string;
36
+ pKeyProp: string;
37
+ sKey?: string;
38
+ sKeyType?: string;
39
+ sKeyProp?: string;
40
+ skValue2?: string;
41
+ skValue2Type?: string;
42
+ skComparator?: string;
43
+ indexName?: string;
44
+ limit?: number;
45
+ lastEvaluatedKey?: Record<string, unknown>;
46
+ sorting?: 'ASC' | 'DESC';
47
+ };
48
+ declare const dynamoQueryRequestSch: z.ZodType<DynamoQueryRequest>;
49
+
4
50
  declare const customGetCommandInputSchema: z.ZodObject<{
5
51
  tableName: z.ZodString;
6
52
  key: z.ZodRecord<z.ZodString, z.ZodUnknown>;
@@ -16,44 +62,7 @@ declare const customGetCommandInputSchema: z.ZodObject<{
16
62
  type CustomGetCommandInput = z.infer<typeof customGetCommandInputSchema>;
17
63
  declare const customQueryCommandInputSchema: z.ZodObject<{
18
64
  tableName: z.ZodString;
19
- queryRequest: z.ZodObject<{
20
- pKey: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>;
21
- pKeyType: z.ZodEnum<{
22
- S: "S";
23
- N: "N";
24
- B: "B";
25
- }>;
26
- pKeyProp: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>;
27
- sKey: z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodOptional<z.ZodString>>;
28
- sKeyType: z.ZodOptional<z.ZodEnum<{
29
- S: "S";
30
- N: "N";
31
- B: "B";
32
- }>>;
33
- sKeyProp: z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodOptional<z.ZodString>>;
34
- skValue2: z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodOptional<z.ZodString>>;
35
- skValue2Type: z.ZodOptional<z.ZodEnum<{
36
- S: "S";
37
- N: "N";
38
- B: "B";
39
- }>>;
40
- skComparator: z.ZodOptional<z.ZodEnum<{
41
- "=": "=";
42
- "<": "<";
43
- "<=": "<=";
44
- ">": ">";
45
- ">=": ">=";
46
- BETWEEN: "BETWEEN";
47
- BEGINS_WITH: "BEGINS_WITH";
48
- }>>;
49
- indexName: z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodOptional<z.ZodString>>;
50
- limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
51
- lastEvaluatedKey: z.ZodPipe<z.ZodTransform<any, unknown>, z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
52
- sorting: z.ZodOptional<z.ZodEnum<{
53
- ASC: "ASC";
54
- DESC: "DESC";
55
- }>>;
56
- }, z.core.$strip>;
65
+ queryRequest: z.ZodType<DynamoQueryRequest, unknown, z.core.$ZodTypeInternals<DynamoQueryRequest, unknown>>;
57
66
  keyConditionExpression: z.ZodOptional<z.ZodString>;
58
67
  filterExpression: z.ZodOptional<z.ZodString>;
59
68
  expressionAttributeNames: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -124,75 +133,6 @@ type CustomUpdateCommandInput = z.infer<typeof customUpdateCommandInputSchema>;
124
133
 
125
134
  declare function buildGetCommandInput(input: CustomGetCommandInput): GetCommandInput;
126
135
 
127
- declare const dynamoAttrTypeSch: z.ZodEnum<{
128
- S: "S";
129
- N: "N";
130
- B: "B";
131
- BOOL: "BOOL";
132
- NULL: "NULL";
133
- SS: "SS";
134
- NS: "NS";
135
- BS: "BS";
136
- M: "M";
137
- L: "L";
138
- }>;
139
- type DynamoAttrType = z.infer<typeof dynamoAttrTypeSch>;
140
- declare const dynamoKeyAttrTypeSch: z.ZodEnum<{
141
- S: "S";
142
- N: "N";
143
- B: "B";
144
- }>;
145
- type DynamoKeyAttrType = z.infer<typeof dynamoKeyAttrTypeSch>;
146
- declare const dynamoComparatorSch: z.ZodEnum<{
147
- "=": "=";
148
- "<": "<";
149
- "<=": "<=";
150
- ">": ">";
151
- ">=": ">=";
152
- BETWEEN: "BETWEEN";
153
- BEGINS_WITH: "BEGINS_WITH";
154
- }>;
155
- type DynamoComparator = z.infer<typeof dynamoComparatorSch>;
156
- declare const dynamoQueryRequestSch: z.ZodObject<{
157
- pKey: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>;
158
- pKeyType: z.ZodEnum<{
159
- S: "S";
160
- N: "N";
161
- B: "B";
162
- }>;
163
- pKeyProp: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>;
164
- sKey: z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodOptional<z.ZodString>>;
165
- sKeyType: z.ZodOptional<z.ZodEnum<{
166
- S: "S";
167
- N: "N";
168
- B: "B";
169
- }>>;
170
- sKeyProp: z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodOptional<z.ZodString>>;
171
- skValue2: z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodOptional<z.ZodString>>;
172
- skValue2Type: z.ZodOptional<z.ZodEnum<{
173
- S: "S";
174
- N: "N";
175
- B: "B";
176
- }>>;
177
- skComparator: z.ZodOptional<z.ZodEnum<{
178
- "=": "=";
179
- "<": "<";
180
- "<=": "<=";
181
- ">": ">";
182
- ">=": ">=";
183
- BETWEEN: "BETWEEN";
184
- BEGINS_WITH: "BEGINS_WITH";
185
- }>>;
186
- indexName: z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodOptional<z.ZodString>>;
187
- limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
188
- lastEvaluatedKey: z.ZodPipe<z.ZodTransform<any, unknown>, z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
189
- sorting: z.ZodOptional<z.ZodEnum<{
190
- ASC: "ASC";
191
- DESC: "DESC";
192
- }>>;
193
- }, z.core.$strip>;
194
- type DynamoQueryRequest = z.infer<typeof dynamoQueryRequestSch>;
195
-
196
136
  declare function buildPutCommandInput(input: CustomPutCommandInput): PutCommandInput;
197
137
 
198
138
  declare function buildQueryCommandInput(input: CustomQueryCommandInput): QueryCommandInput;