@model-ts/dynamodb 3.0.1 → 3.0.2
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 +7 -0
- package/dist/cjs/__test__/client-with-cursor-encryption.test.js +696 -21
- package/dist/cjs/__test__/client-with-cursor-encryption.test.js.map +1 -1
- package/dist/cjs/__test__/client.test.js +775 -95
- package/dist/cjs/__test__/client.test.js.map +1 -1
- package/dist/cjs/client.js +1 -1
- package/dist/cjs/client.js.map +1 -1
- package/dist/cjs/sandbox.js +3 -3
- package/dist/cjs/sandbox.js.map +1 -1
- package/dist/esm/__test__/client-with-cursor-encryption.test.js +696 -21
- package/dist/esm/__test__/client-with-cursor-encryption.test.js.map +1 -1
- package/dist/esm/__test__/client.test.js +776 -96
- package/dist/esm/__test__/client.test.js.map +1 -1
- package/dist/esm/client.js +1 -1
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/sandbox.js +3 -3
- package/dist/esm/sandbox.js.map +1 -1
- package/package.json +1 -1
- package/src/__test__/client-with-cursor-encryption.test.ts +696 -21
- package/src/__test__/client.test.ts +782 -97
- package/src/client.ts +1 -1
- package/src/sandbox.ts +19 -17
package/src/client.ts
CHANGED
|
@@ -741,7 +741,7 @@ export class Client {
|
|
|
741
741
|
? E.left({ ...state, rollbackSuccessful: true })
|
|
742
742
|
: E.right(state)
|
|
743
743
|
|
|
744
|
-
const [currentBatch, remaining] = A.splitAt(
|
|
744
|
+
const [currentBatch, remaining] = A.splitAt(100)(operations)
|
|
745
745
|
|
|
746
746
|
try {
|
|
747
747
|
const transactItems = currentBatch
|
package/src/sandbox.ts
CHANGED
|
@@ -125,23 +125,25 @@ export const createSandbox = async (client: Client): Promise<Sandbox> => {
|
|
|
125
125
|
seed: async (...args: Array<{ [key: string]: any }>) => {
|
|
126
126
|
const chunks = chunksOf(25)(args)
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
.
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
128
|
+
await Promise.all(
|
|
129
|
+
chunks.map(async (chunk) => {
|
|
130
|
+
const items = chunk.map((i) =>
|
|
131
|
+
typeof i?._model?.__dynamoDBEncode === "function"
|
|
132
|
+
? i._model.__dynamoDBEncode(i)
|
|
133
|
+
: typeof i.encode === "function"
|
|
134
|
+
? i.encode()
|
|
135
|
+
: i
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
return client.documentClient
|
|
139
|
+
.batchWrite({
|
|
140
|
+
RequestItems: {
|
|
141
|
+
[tableName]: items.map((i) => ({ PutRequest: { Item: i } })),
|
|
142
|
+
},
|
|
143
|
+
})
|
|
144
|
+
.promise()
|
|
145
|
+
})
|
|
146
|
+
)
|
|
145
147
|
},
|
|
146
148
|
get: (pk: string, sk: string) =>
|
|
147
149
|
client.documentClient
|