@webiny/api-sync-system 0.0.0-unstable.9bd236cf5e → 0.0.0-unstable.9f53ea597d
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 +6 -108
- package/constants.js +2 -7
- package/constants.js.map +1 -1
- package/index.js +3 -40
- package/package.json +29 -26
- package/resolver/app/RecordHandler.d.ts +6 -6
- package/resolver/app/RecordHandler.js +84 -114
- package/resolver/app/RecordHandler.js.map +1 -1
- package/resolver/app/RecordsValidation.js +13 -24
- package/resolver/app/RecordsValidation.js.map +1 -1
- package/resolver/app/ResolverApplication.d.ts +1 -1
- package/resolver/app/ResolverApplication.js +27 -42
- package/resolver/app/ResolverApplication.js.map +1 -1
- package/resolver/app/abstractions/RecordHandler.d.ts +1 -1
- package/resolver/app/abstractions/RecordHandler.js +0 -7
- package/resolver/app/abstractions/RecordsValidation.d.ts +2 -2
- package/resolver/app/abstractions/RecordsValidation.js +0 -7
- package/resolver/app/abstractions/ResolverApplication.js +0 -7
- package/resolver/app/abstractions/ResolverRecord.d.ts +1 -1
- package/resolver/app/abstractions/ResolverRecord.js +0 -7
- package/resolver/app/bundler/BaseBundle.d.ts +6 -6
- package/resolver/app/bundler/BaseBundle.js +16 -22
- package/resolver/app/bundler/BaseBundle.js.map +1 -1
- package/resolver/app/bundler/Bundler.d.ts +1 -1
- package/resolver/app/bundler/Bundler.js +12 -25
- package/resolver/app/bundler/Bundler.js.map +1 -1
- package/resolver/app/bundler/Bundles.d.ts +2 -2
- package/resolver/app/bundler/Bundles.js +20 -33
- package/resolver/app/bundler/Bundles.js.map +1 -1
- package/resolver/app/bundler/CommandBundle.d.ts +1 -1
- package/resolver/app/bundler/CommandBundle.js +8 -25
- package/resolver/app/bundler/CommandBundle.js.map +1 -1
- package/resolver/app/bundler/TableBundle.d.ts +1 -1
- package/resolver/app/bundler/TableBundle.js +7 -22
- package/resolver/app/bundler/TableBundle.js.map +1 -1
- package/resolver/app/bundler/types.d.ts +2 -2
- package/resolver/app/bundler/types.js +0 -7
- package/resolver/app/commandHandler/DeleteCommandHandler.d.ts +3 -3
- package/resolver/app/commandHandler/DeleteCommandHandler.js +21 -35
- package/resolver/app/commandHandler/DeleteCommandHandler.js.map +1 -1
- package/resolver/app/commandHandler/PutCommandHandler.d.ts +4 -4
- package/resolver/app/commandHandler/PutCommandHandler.js +15 -28
- package/resolver/app/commandHandler/PutCommandHandler.js.map +1 -1
- package/resolver/app/commandHandler/delete.d.ts +1 -1
- package/resolver/app/commandHandler/delete.js +13 -21
- package/resolver/app/commandHandler/delete.js.map +1 -1
- package/resolver/app/commandHandler/put.d.ts +1 -1
- package/resolver/app/commandHandler/put.js +13 -21
- package/resolver/app/commandHandler/put.js.map +1 -1
- package/resolver/app/data/SourceDataContainer.d.ts +3 -3
- package/resolver/app/data/SourceDataContainer.js +27 -36
- package/resolver/app/data/SourceDataContainer.js.map +1 -1
- package/resolver/app/data/types.d.ts +2 -2
- package/resolver/app/data/types.js +0 -7
- package/resolver/app/fetcher/Fetcher.d.ts +3 -3
- package/resolver/app/fetcher/Fetcher.js +87 -121
- package/resolver/app/fetcher/Fetcher.js.map +1 -1
- package/resolver/app/fetcher/types.d.ts +2 -2
- package/resolver/app/fetcher/types.js +0 -7
- package/resolver/app/ingestor/Ingestor.d.ts +1 -1
- package/resolver/app/ingestor/Ingestor.js +26 -39
- package/resolver/app/ingestor/Ingestor.js.map +1 -1
- package/resolver/app/ingestor/IngestorResult.js +27 -39
- package/resolver/app/ingestor/IngestorResult.js.map +1 -1
- package/resolver/app/ingestor/types.d.ts +2 -2
- package/resolver/app/ingestor/types.js +0 -7
- package/resolver/app/storer/Storer.d.ts +3 -3
- package/resolver/app/storer/Storer.js +73 -95
- package/resolver/app/storer/Storer.js.map +1 -1
- package/resolver/app/storer/types.d.ts +2 -2
- package/resolver/app/storer/types.js +0 -7
- package/resolver/app/transform/TransformHandler.d.ts +4 -4
- package/resolver/app/transform/TransformHandler.js +46 -64
- package/resolver/app/transform/TransformHandler.js.map +1 -1
- package/resolver/app/transform/middleware.d.ts +1 -1
- package/resolver/app/transform/middleware.js +12 -25
- package/resolver/app/transform/middleware.js.map +1 -1
- package/resolver/app/utils/Retry.js +21 -32
- package/resolver/app/utils/Retry.js.map +1 -1
- package/resolver/app/utils/sleep.js +4 -12
- package/resolver/app/utils/sleep.js.map +1 -1
- package/resolver/app/validation/body.d.ts +25 -124
- package/resolver/app/validation/body.js +31 -44
- package/resolver/app/validation/body.js.map +1 -1
- package/resolver/app/validation/createJsonTransform.d.ts +1 -1
- package/resolver/app/validation/createJsonTransform.js +13 -22
- package/resolver/app/validation/createJsonTransform.js.map +1 -1
- package/resolver/app/validation/detail.d.ts +19 -72
- package/resolver/app/validation/detail.js +33 -46
- package/resolver/app/validation/detail.js.map +1 -1
- package/resolver/app/validation/event.d.ts +29 -188
- package/resolver/app/validation/event.js +21 -30
- package/resolver/app/validation/event.js.map +1 -1
- package/resolver/app/validation/numericString.d.ts +1 -1
- package/resolver/app/validation/numericString.js +9 -20
- package/resolver/app/validation/numericString.js.map +1 -1
- package/resolver/app/validation/system.d.ts +2 -14
- package/resolver/app/validation/system.js +9 -18
- package/resolver/app/validation/system.js.map +1 -1
- package/resolver/createEventHandlerPlugin.d.ts +2 -1
- package/resolver/createEventHandlerPlugin.js +85 -121
- package/resolver/createEventHandlerPlugin.js.map +1 -1
- package/resolver/createResolverHandler.d.ts +1 -1
- package/resolver/createResolverHandler.js +60 -75
- package/resolver/createResolverHandler.js.map +1 -1
- package/resolver/deployment/Deployment.d.ts +2 -3
- package/resolver/deployment/Deployment.js +27 -44
- package/resolver/deployment/Deployment.js.map +1 -1
- package/resolver/deployment/Deployments.js +19 -30
- package/resolver/deployment/Deployments.js.map +1 -1
- package/resolver/deployment/DeploymentsFetcher.js +82 -102
- package/resolver/deployment/DeploymentsFetcher.js.map +1 -1
- package/resolver/deployment/types.d.ts +4 -6
- package/resolver/deployment/types.js +0 -7
- package/resolver/lambda/LambdaTrigger.js +25 -34
- package/resolver/lambda/LambdaTrigger.js.map +1 -1
- package/resolver/plugins/CommandHandlerPlugin.d.ts +3 -3
- package/resolver/plugins/CommandHandlerPlugin.js +17 -24
- package/resolver/plugins/CommandHandlerPlugin.js.map +1 -1
- package/resolver/plugins/StorerAfterEachPlugin.d.ts +2 -2
- package/resolver/plugins/StorerAfterEachPlugin.js +21 -29
- package/resolver/plugins/StorerAfterEachPlugin.js.map +1 -1
- package/resolver/plugins/TransformRecordPlugin.d.ts +3 -3
- package/resolver/plugins/TransformRecordPlugin.js +20 -27
- package/resolver/plugins/TransformRecordPlugin.js.map +1 -1
- package/resolver/recordTypes/fileManager/CopyFile.js +44 -74
- package/resolver/recordTypes/fileManager/CopyFile.js.map +1 -1
- package/resolver/recordTypes/fileManager/DeleteFile.d.ts +1 -1
- package/resolver/recordTypes/fileManager/DeleteFile.js +40 -65
- package/resolver/recordTypes/fileManager/DeleteFile.js.map +1 -1
- package/resolver/recordTypes/fileManager/fileManager.d.ts +1 -1
- package/resolver/recordTypes/fileManager/fileManager.js +7 -12
- package/resolver/recordTypes/fileManager/fileManager.js.map +1 -1
- package/resolver/recordTypes/fileManager/fileManagerOnDelete.d.ts +1 -1
- package/resolver/recordTypes/fileManager/fileManagerOnDelete.js +27 -45
- package/resolver/recordTypes/fileManager/fileManagerOnDelete.js.map +1 -1
- package/resolver/recordTypes/fileManager/fileManagerOnPut.d.ts +1 -1
- package/resolver/recordTypes/fileManager/fileManagerOnPut.js +27 -45
- package/resolver/recordTypes/fileManager/fileManagerOnPut.js.map +1 -1
- package/resolver/recordTypes/fileManager/shouldBeHandled.d.ts +1 -1
- package/resolver/recordTypes/fileManager/shouldBeHandled.js +10 -34
- package/resolver/recordTypes/fileManager/shouldBeHandled.js.map +1 -1
- package/resolver/recordTypes/fileManager/types.d.ts +2 -2
- package/resolver/recordTypes/fileManager/types.js +0 -7
- package/resolver/recordTypes/users/CopyUser.d.ts +2 -2
- package/resolver/recordTypes/users/CopyUser.js +44 -61
- package/resolver/recordTypes/users/CopyUser.js.map +1 -1
- package/resolver/recordTypes/users/DeleteUser.d.ts +2 -2
- package/resolver/recordTypes/users/DeleteUser.js +40 -58
- package/resolver/recordTypes/users/DeleteUser.js.map +1 -1
- package/resolver/recordTypes/users/shouldBeHandled.d.ts +1 -1
- package/resolver/recordTypes/users/shouldBeHandled.js +10 -33
- package/resolver/recordTypes/users/shouldBeHandled.js.map +1 -1
- package/resolver/recordTypes/users/types.d.ts +1 -1
- package/resolver/recordTypes/users/types.js +0 -7
- package/resolver/recordTypes/users/users.js +7 -12
- package/resolver/recordTypes/users/users.js.map +1 -1
- package/resolver/recordTypes/users/usersOnDelete.d.ts +2 -2
- package/resolver/recordTypes/users/usersOnDelete.js +26 -44
- package/resolver/recordTypes/users/usersOnDelete.js.map +1 -1
- package/resolver/recordTypes/users/usersOnPut.d.ts +2 -2
- package/resolver/recordTypes/users/usersOnPut.js +27 -45
- package/resolver/recordTypes/users/usersOnPut.js.map +1 -1
- package/sync/FilterOutRecord.d.ts +2 -2
- package/sync/FilterOutRecord.js +8 -24
- package/sync/FilterOutRecord.js.map +1 -1
- package/sync/attachToDynamoDbDocument.d.ts +1 -1
- package/sync/attachToDynamoDbDocument.js +48 -75
- package/sync/attachToDynamoDbDocument.js.map +1 -1
- package/sync/createHandler.js +44 -60
- package/sync/createHandler.js.map +1 -1
- package/sync/createSendDataToEventBridgeOnRequestEnd.js +34 -46
- package/sync/createSendDataToEventBridgeOnRequestEnd.js.map +1 -1
- package/sync/createSyncSystem.d.ts +1 -1
- package/sync/createSyncSystem.js +27 -36
- package/sync/createSyncSystem.js.map +1 -1
- package/sync/filter/createDefaultFilterOutRecordPlugins.d.ts +1 -1
- package/sync/filter/createDefaultFilterOutRecordPlugins.js +37 -86
- package/sync/filter/createDefaultFilterOutRecordPlugins.js.map +1 -1
- package/sync/handler/Handler.d.ts +2 -2
- package/sync/handler/Handler.js +66 -86
- package/sync/handler/Handler.js.map +1 -1
- package/sync/handler/HandlerConverter.js +20 -36
- package/sync/handler/HandlerConverter.js.map +1 -1
- package/sync/handler/converter/BatchGetCommandConverter.js +13 -20
- package/sync/handler/converter/BatchGetCommandConverter.js.map +1 -1
- package/sync/handler/converter/BatchWriteCommandConverter.js +13 -20
- package/sync/handler/converter/BatchWriteCommandConverter.js.map +1 -1
- package/sync/handler/converter/DeleteCommandConverter.js +13 -20
- package/sync/handler/converter/DeleteCommandConverter.js.map +1 -1
- package/sync/handler/converter/GetCommandConverter.js +13 -20
- package/sync/handler/converter/GetCommandConverter.js.map +1 -1
- package/sync/handler/converter/PutCommandConverter.js +13 -20
- package/sync/handler/converter/PutCommandConverter.js.map +1 -1
- package/sync/handler/converter/QueryCommandConverter.js +13 -20
- package/sync/handler/converter/QueryCommandConverter.js.map +1 -1
- package/sync/handler/converter/ScanCommandConverter.js +13 -20
- package/sync/handler/converter/ScanCommandConverter.js.map +1 -1
- package/sync/handler/converter/UpdateCommandConverter.js +13 -20
- package/sync/handler/converter/UpdateCommandConverter.js.map +1 -1
- package/sync/handler/converter/commands/BatchWriteCommandValue.d.ts +2 -2
- package/sync/handler/converter/commands/BatchWriteCommandValue.js +34 -44
- package/sync/handler/converter/commands/BatchWriteCommandValue.js.map +1 -1
- package/sync/handler/converter/commands/DeleteCommandValue.d.ts +2 -2
- package/sync/handler/converter/commands/DeleteCommandValue.js +19 -23
- package/sync/handler/converter/commands/DeleteCommandValue.js.map +1 -1
- package/sync/handler/converter/commands/NullCommandValue.d.ts +1 -1
- package/sync/handler/converter/commands/NullCommandValue.js +7 -14
- package/sync/handler/converter/commands/NullCommandValue.js.map +1 -1
- package/sync/handler/converter/commands/PutCommandValue.d.ts +2 -2
- package/sync/handler/converter/commands/PutCommandValue.js +19 -23
- package/sync/handler/converter/commands/PutCommandValue.js.map +1 -1
- package/sync/handler/converter/commands/UpdateCommandValue.d.ts +2 -2
- package/sync/handler/converter/commands/UpdateCommandValue.js +19 -23
- package/sync/handler/converter/commands/UpdateCommandValue.js.map +1 -1
- package/sync/handler/types.d.ts +3 -3
- package/sync/handler/types.js +0 -7
- package/sync/plugins/FilterOutRecordPlugin.d.ts +1 -1
- package/sync/plugins/FilterOutRecordPlugin.js +18 -28
- package/sync/plugins/FilterOutRecordPlugin.js.map +1 -1
- package/sync/requestPlugin.d.ts +1 -1
- package/sync/requestPlugin.js +39 -55
- package/sync/requestPlugin.js.map +1 -1
- package/sync/types.js +0 -7
- package/sync/utils/getTableType.js +11 -19
- package/sync/utils/getTableType.js.map +1 -1
- package/sync/utils/manifest.d.ts +3 -7
- package/sync/utils/manifest.js +30 -47
- package/sync/utils/manifest.js.map +1 -1
- package/sync/utils/validateSystemInput.d.ts +1 -1
- package/sync/utils/validateSystemInput.js +22 -37
- package/sync/utils/validateSystemInput.js.map +1 -1
- package/types.d.ts +3 -5
- package/types.js +6 -12
- package/types.js.map +1 -1
- package/utils/createSystemName.js +5 -10
- package/utils/createSystemName.js.map +1 -1
- package/worker/actions/copyFile/CopyFile.js +185 -268
- package/worker/actions/copyFile/CopyFile.js.map +1 -1
- package/worker/actions/copyFile/copyFileAction.d.ts +1 -1
- package/worker/actions/copyFile/copyFileAction.js +30 -45
- package/worker/actions/copyFile/copyFileAction.js.map +1 -1
- package/worker/actions/copyFile/copyFileSchema.d.ts +6 -38
- package/worker/actions/copyFile/copyFileSchema.js +14 -23
- package/worker/actions/copyFile/copyFileSchema.js.map +1 -1
- package/worker/actions/copyFile/types.js +0 -7
- package/worker/actions/createUser/CreateUser.d.ts +1 -1
- package/worker/actions/createUser/CreateUser.js +53 -83
- package/worker/actions/createUser/CreateUser.js.map +1 -1
- package/worker/actions/createUser/createUserAction.d.ts +2 -2
- package/worker/actions/createUser/createUserAction.js +28 -39
- package/worker/actions/createUser/createUserAction.js.map +1 -1
- package/worker/actions/createUser/createUserSchema.d.ts +6 -38
- package/worker/actions/createUser/createUserSchema.js +14 -23
- package/worker/actions/createUser/createUserSchema.js.map +1 -1
- package/worker/actions/createUser/types.js +0 -7
- package/worker/actions/deleteFile/DeleteFile.js +52 -74
- package/worker/actions/deleteFile/DeleteFile.js.map +1 -1
- package/worker/actions/deleteFile/deleteFileAction.d.ts +1 -1
- package/worker/actions/deleteFile/deleteFileAction.js +25 -40
- package/worker/actions/deleteFile/deleteFileAction.js.map +1 -1
- package/worker/actions/deleteFile/deleteFileSchema.d.ts +6 -38
- package/worker/actions/deleteFile/deleteFileSchema.js +14 -23
- package/worker/actions/deleteFile/deleteFileSchema.js.map +1 -1
- package/worker/actions/deleteFile/types.js +0 -7
- package/worker/actions/deleteUser/DeleteUser.d.ts +2 -2
- package/worker/actions/deleteUser/DeleteUser.js +39 -60
- package/worker/actions/deleteUser/DeleteUser.js.map +1 -1
- package/worker/actions/deleteUser/deleteUserAction.d.ts +1 -1
- package/worker/actions/deleteUser/deleteUserAction.js +26 -37
- package/worker/actions/deleteUser/deleteUserAction.js.map +1 -1
- package/worker/actions/deleteUser/deleteUserSchema.d.ts +5 -23
- package/worker/actions/deleteUser/deleteUserSchema.js +13 -22
- package/worker/actions/deleteUser/deleteUserSchema.js.map +1 -1
- package/worker/actions/deleteUser/types.js +0 -7
- package/worker/actions/logValidationError.js +6 -14
- package/worker/actions/logValidationError.js.map +1 -1
- package/worker/actions/removeCognitoUserAttributes.js +9 -22
- package/worker/actions/removeCognitoUserAttributes.js.map +1 -1
- package/worker/actions/updateUser/UpdateUser.d.ts +1 -1
- package/worker/actions/updateUser/UpdateUser.js +50 -74
- package/worker/actions/updateUser/UpdateUser.js.map +1 -1
- package/worker/actions/updateUser/types.js +0 -7
- package/worker/actions/updateUser/updateUserAction.d.ts +2 -2
- package/worker/actions/updateUser/updateUserAction.js +28 -39
- package/worker/actions/updateUser/updateUserAction.js.map +1 -1
- package/worker/actions/updateUser/updateUserSchema.d.ts +6 -38
- package/worker/actions/updateUser/updateUserSchema.js +14 -23
- package/worker/actions/updateUser/updateUserSchema.js.map +1 -1
- package/worker/createWorkerHandler.js +32 -45
- package/worker/createWorkerHandler.js.map +1 -1
- package/worker/handler/WorkerActionHandler.d.ts +2 -2
- package/worker/handler/WorkerActionHandler.js +19 -28
- package/worker/handler/WorkerActionHandler.js.map +1 -1
- package/worker/handler/eventHandler.js +18 -27
- package/worker/handler/eventHandler.js.map +1 -1
- package/worker/plugins/WorkerActionPlugin.d.ts +1 -1
- package/worker/plugins/WorkerActionPlugin.js +18 -25
- package/worker/plugins/WorkerActionPlugin.js.map +1 -1
- package/worker/types.js +0 -7
- package/index.js.map +0 -1
- package/resolver/app/abstractions/RecordHandler.js.map +0 -1
- package/resolver/app/abstractions/RecordsValidation.js.map +0 -1
- package/resolver/app/abstractions/ResolverApplication.js.map +0 -1
- package/resolver/app/abstractions/ResolverRecord.js.map +0 -1
- package/resolver/app/bundler/types.js.map +0 -1
- package/resolver/app/data/types.js.map +0 -1
- package/resolver/app/fetcher/types.js.map +0 -1
- package/resolver/app/ingestor/types.js.map +0 -1
- package/resolver/app/storer/types.js.map +0 -1
- package/resolver/deployment/types.js.map +0 -1
- package/resolver/recordTypes/fileManager/types.js.map +0 -1
- package/resolver/recordTypes/users/types.js.map +0 -1
- package/sync/handler/types.js.map +0 -1
- package/sync/types.js.map +0 -1
- package/worker/actions/copyFile/types.js.map +0 -1
- package/worker/actions/createUser/types.js.map +0 -1
- package/worker/actions/deleteFile/types.js.map +0 -1
- package/worker/actions/deleteUser/types.js.map +0 -1
- package/worker/actions/updateUser/types.js.map +0 -1
- package/worker/types.js.map +0 -1
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createBatchWriteCommandConverter = exports.BatchWriteCommandConverter = void 0;
|
|
7
|
-
var _index = require("@webiny/aws-sdk/client-dynamodb/index.js");
|
|
8
|
-
var _BatchWriteCommandValue = require("./commands/BatchWriteCommandValue.js");
|
|
1
|
+
import { BatchWriteCommand } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
2
|
+
import { BatchWriteCommandValue } from "./commands/BatchWriteCommandValue.js";
|
|
9
3
|
class BatchWriteCommandConverter {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
can(input) {
|
|
5
|
+
return input instanceof BatchWriteCommand;
|
|
6
|
+
}
|
|
7
|
+
convert(input) {
|
|
8
|
+
return new BatchWriteCommandValue(input);
|
|
9
|
+
}
|
|
10
|
+
constructor(){
|
|
11
|
+
this.name = "put";
|
|
12
|
+
}
|
|
17
13
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return new BatchWriteCommandConverter();
|
|
21
|
-
};
|
|
22
|
-
exports.createBatchWriteCommandConverter = createBatchWriteCommandConverter;
|
|
14
|
+
const createBatchWriteCommandConverter = ()=>new BatchWriteCommandConverter();
|
|
15
|
+
export { BatchWriteCommandConverter, createBatchWriteCommandConverter };
|
|
23
16
|
|
|
24
17
|
//# sourceMappingURL=BatchWriteCommandConverter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"sync/handler/converter/BatchWriteCommandConverter.js","sources":["../../../../src/sync/handler/converter/BatchWriteCommandConverter.ts"],"sourcesContent":["import { BatchWriteCommand } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandConverter, IDynamoDbCommand } from \"../../types.js\";\nimport { BatchWriteCommandValue } from \"./commands/BatchWriteCommandValue.js\";\n\nexport class BatchWriteCommandConverter implements ICommandConverter {\n public readonly name: string = \"put\";\n\n public can(input: IDynamoDbCommand): boolean {\n return input instanceof BatchWriteCommand;\n }\n public convert(input: BatchWriteCommand) {\n return new BatchWriteCommandValue(input);\n }\n}\n\nexport const createBatchWriteCommandConverter = (): ICommandConverter => {\n return new BatchWriteCommandConverter();\n};\n"],"names":["BatchWriteCommandConverter","input","BatchWriteCommand","BatchWriteCommandValue","createBatchWriteCommandConverter"],"mappings":";;AAIO,MAAMA;IAGF,IAAIC,KAAuB,EAAW;QACzC,OAAOA,iBAAiBC;IAC5B;IACO,QAAQD,KAAwB,EAAE;QACrC,OAAO,IAAIE,uBAAuBF;IACtC;;aAPgB,IAAI,GAAW;;AAQnC;AAEO,MAAMG,mCAAmC,IACrC,IAAIJ"}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createDeleteCommandConverter = exports.DeleteCommandConverter = void 0;
|
|
7
|
-
var _index = require("@webiny/aws-sdk/client-dynamodb/index.js");
|
|
8
|
-
var _DeleteCommandValue = require("./commands/DeleteCommandValue.js");
|
|
1
|
+
import { DeleteCommand } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
2
|
+
import { DeleteCommandValue } from "./commands/DeleteCommandValue.js";
|
|
9
3
|
class DeleteCommandConverter {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
can(input) {
|
|
5
|
+
return input instanceof DeleteCommand;
|
|
6
|
+
}
|
|
7
|
+
convert(input) {
|
|
8
|
+
return new DeleteCommandValue(input);
|
|
9
|
+
}
|
|
10
|
+
constructor(){
|
|
11
|
+
this.name = "delete";
|
|
12
|
+
}
|
|
17
13
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return new DeleteCommandConverter();
|
|
21
|
-
};
|
|
22
|
-
exports.createDeleteCommandConverter = createDeleteCommandConverter;
|
|
14
|
+
const createDeleteCommandConverter = ()=>new DeleteCommandConverter();
|
|
15
|
+
export { DeleteCommandConverter, createDeleteCommandConverter };
|
|
23
16
|
|
|
24
17
|
//# sourceMappingURL=DeleteCommandConverter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"sync/handler/converter/DeleteCommandConverter.js","sources":["../../../../src/sync/handler/converter/DeleteCommandConverter.ts"],"sourcesContent":["import { DeleteCommand } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandConverter, IDynamoDbCommand } from \"../../types.js\";\nimport { DeleteCommandValue } from \"./commands/DeleteCommandValue.js\";\n\nexport class DeleteCommandConverter implements ICommandConverter {\n public readonly name: string = \"delete\";\n\n public can(input: IDynamoDbCommand): boolean {\n return input instanceof DeleteCommand;\n }\n public convert(input: DeleteCommand) {\n return new DeleteCommandValue(input);\n }\n}\n\nexport const createDeleteCommandConverter = (): ICommandConverter => {\n return new DeleteCommandConverter();\n};\n"],"names":["DeleteCommandConverter","input","DeleteCommand","DeleteCommandValue","createDeleteCommandConverter"],"mappings":";;AAIO,MAAMA;IAGF,IAAIC,KAAuB,EAAW;QACzC,OAAOA,iBAAiBC;IAC5B;IACO,QAAQD,KAAoB,EAAE;QACjC,OAAO,IAAIE,mBAAmBF;IAClC;;aAPgB,IAAI,GAAW;;AAQnC;AAEO,MAAMG,+BAA+B,IACjC,IAAIJ"}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createGetCommandConverter = exports.GetCommandConverter = void 0;
|
|
7
|
-
var _index = require("@webiny/aws-sdk/client-dynamodb/index.js");
|
|
8
|
-
var _NullCommandValue = require("./commands/NullCommandValue.js");
|
|
1
|
+
import { GetCommand } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
2
|
+
import { NullCommandValue } from "./commands/NullCommandValue.js";
|
|
9
3
|
class GetCommandConverter {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
can(input) {
|
|
5
|
+
return input instanceof GetCommand;
|
|
6
|
+
}
|
|
7
|
+
convert() {
|
|
8
|
+
return new NullCommandValue();
|
|
9
|
+
}
|
|
10
|
+
constructor(){
|
|
11
|
+
this.name = "get";
|
|
12
|
+
}
|
|
17
13
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return new GetCommandConverter();
|
|
21
|
-
};
|
|
22
|
-
exports.createGetCommandConverter = createGetCommandConverter;
|
|
14
|
+
const createGetCommandConverter = ()=>new GetCommandConverter();
|
|
15
|
+
export { GetCommandConverter, createGetCommandConverter };
|
|
23
16
|
|
|
24
17
|
//# sourceMappingURL=GetCommandConverter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"sync/handler/converter/GetCommandConverter.js","sources":["../../../../src/sync/handler/converter/GetCommandConverter.ts"],"sourcesContent":["import { GetCommand } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandConverter, IDynamoDbCommand } from \"../../types.js\";\nimport { NullCommandValue } from \"./commands/NullCommandValue.js\";\n\nexport class GetCommandConverter implements ICommandConverter {\n public readonly name: string = \"get\";\n\n public can(input: IDynamoDbCommand): boolean {\n return input instanceof GetCommand;\n }\n\n public convert() {\n return new NullCommandValue();\n }\n}\n\nexport const createGetCommandConverter = (): ICommandConverter => {\n return new GetCommandConverter();\n};\n"],"names":["GetCommandConverter","input","GetCommand","NullCommandValue","createGetCommandConverter"],"mappings":";;AAIO,MAAMA;IAGF,IAAIC,KAAuB,EAAW;QACzC,OAAOA,iBAAiBC;IAC5B;IAEO,UAAU;QACb,OAAO,IAAIC;IACf;;aARgB,IAAI,GAAW;;AASnC;AAEO,MAAMC,4BAA4B,IAC9B,IAAIJ"}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createPutCommandConverter = exports.PutCommandConverter = void 0;
|
|
7
|
-
var _index = require("@webiny/aws-sdk/client-dynamodb/index.js");
|
|
8
|
-
var _PutCommandValue = require("./commands/PutCommandValue.js");
|
|
1
|
+
import { PutCommand } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
2
|
+
import { PutCommandValue } from "./commands/PutCommandValue.js";
|
|
9
3
|
class PutCommandConverter {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
can(input) {
|
|
5
|
+
return input instanceof PutCommand;
|
|
6
|
+
}
|
|
7
|
+
convert(input) {
|
|
8
|
+
return new PutCommandValue(input);
|
|
9
|
+
}
|
|
10
|
+
constructor(){
|
|
11
|
+
this.name = "put";
|
|
12
|
+
}
|
|
17
13
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return new PutCommandConverter();
|
|
21
|
-
};
|
|
22
|
-
exports.createPutCommandConverter = createPutCommandConverter;
|
|
14
|
+
const createPutCommandConverter = ()=>new PutCommandConverter();
|
|
15
|
+
export { PutCommandConverter, createPutCommandConverter };
|
|
23
16
|
|
|
24
17
|
//# sourceMappingURL=PutCommandConverter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"sync/handler/converter/PutCommandConverter.js","sources":["../../../../src/sync/handler/converter/PutCommandConverter.ts"],"sourcesContent":["import { PutCommand } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandConverter, IDynamoDbCommand } from \"../../types.js\";\nimport { PutCommandValue } from \"./commands/PutCommandValue.js\";\n\nexport class PutCommandConverter implements ICommandConverter {\n public readonly name: string = \"put\";\n\n public can(input: IDynamoDbCommand): boolean {\n return input instanceof PutCommand;\n }\n public convert(input: PutCommand) {\n return new PutCommandValue(input);\n }\n}\n\nexport const createPutCommandConverter = (): ICommandConverter => {\n return new PutCommandConverter();\n};\n"],"names":["PutCommandConverter","input","PutCommand","PutCommandValue","createPutCommandConverter"],"mappings":";;AAIO,MAAMA;IAGF,IAAIC,KAAuB,EAAW;QACzC,OAAOA,iBAAiBC;IAC5B;IACO,QAAQD,KAAiB,EAAE;QAC9B,OAAO,IAAIE,gBAAgBF;IAC/B;;aAPgB,IAAI,GAAW;;AAQnC;AAEO,MAAMG,4BAA4B,IAC9B,IAAIJ"}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createQueryCommandConverter = exports.QueryCommandConverter = void 0;
|
|
7
|
-
var _index = require("@webiny/aws-sdk/client-dynamodb/index.js");
|
|
8
|
-
var _NullCommandValue = require("./commands/NullCommandValue.js");
|
|
1
|
+
import { QueryCommand } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
2
|
+
import { NullCommandValue } from "./commands/NullCommandValue.js";
|
|
9
3
|
class QueryCommandConverter {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
can(input) {
|
|
5
|
+
return input instanceof QueryCommand || input.constructor?.name === "QueryCommand";
|
|
6
|
+
}
|
|
7
|
+
convert() {
|
|
8
|
+
return new NullCommandValue();
|
|
9
|
+
}
|
|
10
|
+
constructor(){
|
|
11
|
+
this.name = "query";
|
|
12
|
+
}
|
|
17
13
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return new QueryCommandConverter();
|
|
21
|
-
};
|
|
22
|
-
exports.createQueryCommandConverter = createQueryCommandConverter;
|
|
14
|
+
const createQueryCommandConverter = ()=>new QueryCommandConverter();
|
|
15
|
+
export { QueryCommandConverter, createQueryCommandConverter };
|
|
23
16
|
|
|
24
17
|
//# sourceMappingURL=QueryCommandConverter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"sync/handler/converter/QueryCommandConverter.js","sources":["../../../../src/sync/handler/converter/QueryCommandConverter.ts"],"sourcesContent":["import { QueryCommand } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandConverter, IDynamoDbCommand } from \"../../types.js\";\nimport { NullCommandValue } from \"./commands/NullCommandValue.js\";\n\nexport class QueryCommandConverter implements ICommandConverter {\n public readonly name: string = \"query\";\n\n public can(input: IDynamoDbCommand): boolean {\n return input instanceof QueryCommand || input.constructor?.name === \"QueryCommand\";\n }\n\n public convert() {\n return new NullCommandValue();\n }\n}\n\nexport const createQueryCommandConverter = (): ICommandConverter => {\n return new QueryCommandConverter();\n};\n"],"names":["QueryCommandConverter","input","QueryCommand","NullCommandValue","createQueryCommandConverter"],"mappings":";;AAIO,MAAMA;IAGF,IAAIC,KAAuB,EAAW;QACzC,OAAOA,iBAAiBC,gBAAgBD,MAAM,WAAW,EAAE,SAAS;IACxE;IAEO,UAAU;QACb,OAAO,IAAIE;IACf;;aARgB,IAAI,GAAW;;AASnC;AAEO,MAAMC,8BAA8B,IAChC,IAAIJ"}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createScanCommandConverter = exports.ScanCommandConverter = void 0;
|
|
7
|
-
var _index = require("@webiny/aws-sdk/client-dynamodb/index.js");
|
|
8
|
-
var _NullCommandValue = require("./commands/NullCommandValue.js");
|
|
1
|
+
import { ScanCommand } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
2
|
+
import { NullCommandValue } from "./commands/NullCommandValue.js";
|
|
9
3
|
class ScanCommandConverter {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
can(input) {
|
|
5
|
+
return input instanceof ScanCommand;
|
|
6
|
+
}
|
|
7
|
+
convert() {
|
|
8
|
+
return new NullCommandValue();
|
|
9
|
+
}
|
|
10
|
+
constructor(){
|
|
11
|
+
this.name = "query";
|
|
12
|
+
}
|
|
17
13
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return new ScanCommandConverter();
|
|
21
|
-
};
|
|
22
|
-
exports.createScanCommandConverter = createScanCommandConverter;
|
|
14
|
+
const createScanCommandConverter = ()=>new ScanCommandConverter();
|
|
15
|
+
export { ScanCommandConverter, createScanCommandConverter };
|
|
23
16
|
|
|
24
17
|
//# sourceMappingURL=ScanCommandConverter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"sync/handler/converter/ScanCommandConverter.js","sources":["../../../../src/sync/handler/converter/ScanCommandConverter.ts"],"sourcesContent":["import { ScanCommand } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandConverter, IDynamoDbCommand } from \"../../types.js\";\nimport { NullCommandValue } from \"./commands/NullCommandValue.js\";\n\nexport class ScanCommandConverter implements ICommandConverter {\n public readonly name: string = \"query\";\n\n public can(input: IDynamoDbCommand): boolean {\n return input instanceof ScanCommand;\n }\n\n public convert() {\n return new NullCommandValue();\n }\n}\n\nexport const createScanCommandConverter = (): ICommandConverter => {\n return new ScanCommandConverter();\n};\n"],"names":["ScanCommandConverter","input","ScanCommand","NullCommandValue","createScanCommandConverter"],"mappings":";;AAIO,MAAMA;IAGF,IAAIC,KAAuB,EAAW;QACzC,OAAOA,iBAAiBC;IAC5B;IAEO,UAAU;QACb,OAAO,IAAIC;IACf;;aARgB,IAAI,GAAW;;AASnC;AAEO,MAAMC,6BAA6B,IAC/B,IAAIJ"}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createUpdateCommandConverter = exports.UpdateCommandConverter = void 0;
|
|
7
|
-
var _index = require("@webiny/aws-sdk/client-dynamodb/index.js");
|
|
8
|
-
var _UpdateCommandValue = require("./commands/UpdateCommandValue.js");
|
|
1
|
+
import { UpdateCommand } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
2
|
+
import { UpdateCommandValue } from "./commands/UpdateCommandValue.js";
|
|
9
3
|
class UpdateCommandConverter {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
can(input) {
|
|
5
|
+
return input instanceof UpdateCommand;
|
|
6
|
+
}
|
|
7
|
+
convert(input) {
|
|
8
|
+
return new UpdateCommandValue(input);
|
|
9
|
+
}
|
|
10
|
+
constructor(){
|
|
11
|
+
this.name = "update";
|
|
12
|
+
}
|
|
17
13
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return new UpdateCommandConverter();
|
|
21
|
-
};
|
|
22
|
-
exports.createUpdateCommandConverter = createUpdateCommandConverter;
|
|
14
|
+
const createUpdateCommandConverter = ()=>new UpdateCommandConverter();
|
|
15
|
+
export { UpdateCommandConverter, createUpdateCommandConverter };
|
|
23
16
|
|
|
24
17
|
//# sourceMappingURL=UpdateCommandConverter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"sync/handler/converter/UpdateCommandConverter.js","sources":["../../../../src/sync/handler/converter/UpdateCommandConverter.ts"],"sourcesContent":["import { UpdateCommand } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandConverter, IDynamoDbCommand } from \"../../types.js\";\nimport { UpdateCommandValue } from \"./commands/UpdateCommandValue.js\";\n\nexport class UpdateCommandConverter implements ICommandConverter {\n public readonly name: string = \"update\";\n\n public can(input: IDynamoDbCommand): boolean {\n return input instanceof UpdateCommand;\n }\n public convert(input: UpdateCommand) {\n return new UpdateCommandValue(input);\n }\n}\n\nexport const createUpdateCommandConverter = (): ICommandConverter => {\n return new UpdateCommandConverter();\n};\n"],"names":["UpdateCommandConverter","input","UpdateCommand","UpdateCommandValue","createUpdateCommandConverter"],"mappings":";;AAIO,MAAMA;IAGF,IAAIC,KAAuB,EAAW;QACzC,OAAOA,iBAAiBC;IAC5B;IACO,QAAQD,KAAoB,EAAE;QACjC,OAAO,IAAIE,mBAAmBF;IAClC;;aAPgB,IAAI,GAAW;;AAQnC;AAEO,MAAMG,+BAA+B,IACjC,IAAIJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BatchWriteCommand } from "@webiny/aws-sdk/client-dynamodb";
|
|
2
|
-
import type { ICommandValue, ICommandValueItemExtended } from "
|
|
1
|
+
import type { BatchWriteCommand } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
2
|
+
import type { ICommandValue, ICommandValueItemExtended } from "../../../../sync/types.js";
|
|
3
3
|
import type { NonEmptyArray } from "@webiny/api/types.js";
|
|
4
4
|
export declare class BatchWriteCommandValue implements ICommandValue {
|
|
5
5
|
readonly command = "batchWrite";
|
|
@@ -1,51 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.BatchWriteCommandValue = void 0;
|
|
7
|
-
var _getTableType = require("../../../utils/getTableType.js");
|
|
8
|
-
const convert = items => {
|
|
9
|
-
if (items.length === 0) {
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
return items;
|
|
1
|
+
import { getTableType } from "../../../utils/getTableType.js";
|
|
2
|
+
const convert = (items)=>{
|
|
3
|
+
if (0 === items.length) return null;
|
|
4
|
+
return items;
|
|
13
5
|
};
|
|
14
6
|
class BatchWriteCommandValue {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
7
|
+
constructor(input){
|
|
8
|
+
this.command = "batchWrite";
|
|
9
|
+
this.items = [];
|
|
10
|
+
for(const tableName in input.input.RequestItems){
|
|
11
|
+
const values = input.input.RequestItems[tableName];
|
|
12
|
+
for (const value of values)if (value.PutRequest?.Item) {
|
|
13
|
+
const item = value.PutRequest.Item;
|
|
14
|
+
this.items.push({
|
|
15
|
+
command: "put",
|
|
16
|
+
PK: item.PK,
|
|
17
|
+
SK: item.SK,
|
|
18
|
+
tableName,
|
|
19
|
+
tableType: getTableType(tableName),
|
|
20
|
+
input
|
|
21
|
+
});
|
|
22
|
+
} else if (value.DeleteRequest?.Key) {
|
|
23
|
+
const item = value.DeleteRequest.Key;
|
|
24
|
+
this.items.push({
|
|
25
|
+
command: "delete",
|
|
26
|
+
PK: item.PK,
|
|
27
|
+
SK: item.SK,
|
|
28
|
+
tableName,
|
|
29
|
+
tableType: getTableType(tableName),
|
|
30
|
+
input
|
|
31
|
+
});
|
|
32
|
+
}
|
|
41
33
|
}
|
|
42
|
-
}
|
|
43
34
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
35
|
+
getItems() {
|
|
36
|
+
return convert(this.items);
|
|
37
|
+
}
|
|
48
38
|
}
|
|
49
|
-
|
|
39
|
+
export { BatchWriteCommandValue };
|
|
50
40
|
|
|
51
41
|
//# sourceMappingURL=BatchWriteCommandValue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"sync/handler/converter/commands/BatchWriteCommandValue.js","sources":["../../../../../src/sync/handler/converter/commands/BatchWriteCommandValue.ts"],"sourcesContent":["import type { BatchWriteCommand } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandValue, ICommandValueItemExtended } from \"~/sync/types.js\";\nimport type { NonEmptyArray } from \"@webiny/api/types.js\";\nimport { getTableType } from \"~/sync/utils/getTableType.js\";\n\nconst convert = (\n items: ICommandValueItemExtended[]\n): NonEmptyArray<ICommandValueItemExtended> | null => {\n if (items.length === 0) {\n return null;\n }\n return items as NonEmptyArray<ICommandValueItemExtended>;\n};\n\nexport class BatchWriteCommandValue implements ICommandValue {\n public readonly command = \"batchWrite\";\n public readonly items: ICommandValueItemExtended[] = [];\n\n public constructor(input: BatchWriteCommand) {\n for (const tableName in input.input.RequestItems) {\n const values = input.input.RequestItems[tableName];\n for (const value of values) {\n if (value.PutRequest?.Item) {\n const item = value.PutRequest.Item;\n\n this.items.push({\n command: \"put\",\n PK: item.PK,\n SK: item.SK,\n tableName,\n tableType: getTableType(tableName),\n input\n });\n } else if (value.DeleteRequest?.Key) {\n const item = value.DeleteRequest.Key;\n\n this.items.push({\n command: \"delete\",\n PK: item.PK,\n SK: item.SK,\n tableName,\n tableType: getTableType(tableName),\n input\n });\n }\n }\n }\n }\n\n public getItems(): NonEmptyArray<ICommandValueItemExtended> | null {\n return convert(this.items);\n }\n}\n"],"names":["convert","items","BatchWriteCommandValue","input","tableName","values","value","item","getTableType"],"mappings":";AAKA,MAAMA,UAAU,CACZC;IAEA,IAAIA,AAAiB,MAAjBA,MAAM,MAAM,EACZ,OAAO;IAEX,OAAOA;AACX;AAEO,MAAMC;IAIT,YAAmBC,KAAwB,CAAE;aAH7B,OAAO,GAAG;aACV,KAAK,GAAgC,EAAE;QAGnD,IAAK,MAAMC,aAAaD,MAAM,KAAK,CAAC,YAAY,CAAE;YAC9C,MAAME,SAASF,MAAM,KAAK,CAAC,YAAY,CAACC,UAAU;YAClD,KAAK,MAAME,SAASD,OAChB,IAAIC,MAAM,UAAU,EAAE,MAAM;gBACxB,MAAMC,OAAOD,MAAM,UAAU,CAAC,IAAI;gBAElC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;oBACZ,SAAS;oBACT,IAAIC,KAAK,EAAE;oBACX,IAAIA,KAAK,EAAE;oBACXH;oBACA,WAAWI,aAAaJ;oBACxBD;gBACJ;YACJ,OAAO,IAAIG,MAAM,aAAa,EAAE,KAAK;gBACjC,MAAMC,OAAOD,MAAM,aAAa,CAAC,GAAG;gBAEpC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;oBACZ,SAAS;oBACT,IAAIC,KAAK,EAAE;oBACX,IAAIA,KAAK,EAAE;oBACXH;oBACA,WAAWI,aAAaJ;oBACxBD;gBACJ;YACJ;QAER;IACJ;IAEO,WAA4D;QAC/D,OAAOH,QAAQ,IAAI,CAAC,KAAK;IAC7B;AACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DeleteCommand } from "@webiny/aws-sdk/client-dynamodb";
|
|
2
|
-
import type { ICommandValue, ICommandValueItemExtended } from "
|
|
1
|
+
import type { DeleteCommand } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
2
|
+
import type { ICommandValue, ICommandValueItemExtended } from "../../../../sync/types.js";
|
|
3
3
|
import type { NonEmptyArray } from "@webiny/api/types.js";
|
|
4
4
|
export declare class DeleteCommandValue implements ICommandValue {
|
|
5
5
|
readonly command = "delete";
|
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.DeleteCommandValue = void 0;
|
|
7
|
-
var _getTableType = require("../../../utils/getTableType.js");
|
|
1
|
+
import { getTableType } from "../../../utils/getTableType.js";
|
|
8
2
|
class DeleteCommandValue {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
3
|
+
constructor(input){
|
|
4
|
+
this.command = "delete";
|
|
5
|
+
const tableName = input.input.TableName;
|
|
6
|
+
this.item = {
|
|
7
|
+
command: this.command,
|
|
8
|
+
PK: input.input.Key.PK,
|
|
9
|
+
SK: input.input.Key.SK,
|
|
10
|
+
tableName,
|
|
11
|
+
tableType: getTableType(tableName),
|
|
12
|
+
input
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
getItems() {
|
|
16
|
+
return [
|
|
17
|
+
this.item
|
|
18
|
+
];
|
|
19
|
+
}
|
|
24
20
|
}
|
|
25
|
-
|
|
21
|
+
export { DeleteCommandValue };
|
|
26
22
|
|
|
27
23
|
//# sourceMappingURL=DeleteCommandValue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"sync/handler/converter/commands/DeleteCommandValue.js","sources":["../../../../../src/sync/handler/converter/commands/DeleteCommandValue.ts"],"sourcesContent":["import type { DeleteCommand } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandValue, ICommandValueItemExtended } from \"~/sync/types.js\";\nimport type { NonEmptyArray } from \"@webiny/api/types.js\";\nimport { getTableType } from \"~/sync/utils/getTableType.js\";\n\nexport class DeleteCommandValue implements ICommandValue {\n public readonly command = \"delete\";\n public readonly item: ICommandValueItemExtended;\n\n public constructor(input: DeleteCommand) {\n const tableName = input.input.TableName as string;\n this.item = {\n command: this.command,\n PK: input.input.Key!.PK,\n SK: input.input.Key!.SK,\n tableName,\n tableType: getTableType(tableName),\n input\n };\n }\n\n public getItems(): NonEmptyArray<ICommandValueItemExtended> {\n return [this.item];\n }\n}\n"],"names":["DeleteCommandValue","input","tableName","getTableType"],"mappings":";AAKO,MAAMA;IAIT,YAAmBC,KAAoB,CAAE;aAHzB,OAAO,GAAG;QAItB,MAAMC,YAAYD,MAAM,KAAK,CAAC,SAAS;QACvC,IAAI,CAAC,IAAI,GAAG;YACR,SAAS,IAAI,CAAC,OAAO;YACrB,IAAIA,MAAM,KAAK,CAAC,GAAG,CAAE,EAAE;YACvB,IAAIA,MAAM,KAAK,CAAC,GAAG,CAAE,EAAE;YACvBC;YACA,WAAWC,aAAaD;YACxBD;QACJ;IACJ;IAEO,WAAqD;QACxD,OAAO;YAAC,IAAI,CAAC,IAAI;SAAC;IACtB;AACJ"}
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.NullCommandValue = void 0;
|
|
7
1
|
class NullCommandValue {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
2
|
+
getItems() {
|
|
3
|
+
return null;
|
|
4
|
+
}
|
|
5
|
+
constructor(){
|
|
6
|
+
this.command = "null";
|
|
7
|
+
}
|
|
15
8
|
}
|
|
16
|
-
|
|
9
|
+
export { NullCommandValue };
|
|
17
10
|
|
|
18
11
|
//# sourceMappingURL=NullCommandValue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"sync/handler/converter/commands/NullCommandValue.js","sources":["../../../../../src/sync/handler/converter/commands/NullCommandValue.ts"],"sourcesContent":["import type { ICommandValue } from \"~/sync/types.js\";\n\nexport class NullCommandValue implements ICommandValue {\n /**\n * Does not matter what will be here, we will not use it.\n */\n public readonly command = \"null\";\n\n public getItems(): null {\n return null;\n }\n}\n"],"names":["NullCommandValue"],"mappings":"AAEO,MAAMA;IAMF,WAAiB;QACpB,OAAO;IACX;;QALC,KACe,OAAO,GAAG;;AAK9B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PutCommand } from "@webiny/aws-sdk/client-dynamodb";
|
|
2
|
-
import type { ICommandValue, ICommandValueItemExtended } from "
|
|
1
|
+
import type { PutCommand } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
2
|
+
import type { ICommandValue, ICommandValueItemExtended } from "../../../../sync/types.js";
|
|
3
3
|
import type { NonEmptyArray } from "@webiny/api/types.js";
|
|
4
4
|
export declare class PutCommandValue implements ICommandValue {
|
|
5
5
|
readonly command = "put";
|