@webiny/api-sync-system 6.3.0 → 6.4.0-beta.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/constants.js +2 -1
- package/constants.js.map +1 -1
- package/index.js +0 -2
- package/package.json +14 -14
- package/resolver/app/RecordHandler.js +83 -105
- package/resolver/app/RecordHandler.js.map +1 -1
- package/resolver/app/RecordsValidation.js +11 -14
- package/resolver/app/RecordsValidation.js.map +1 -1
- package/resolver/app/ResolverApplication.js +24 -31
- package/resolver/app/ResolverApplication.js.map +1 -1
- package/resolver/app/abstractions/RecordHandler.js +0 -3
- package/resolver/app/abstractions/RecordsValidation.js +0 -3
- package/resolver/app/abstractions/ResolverApplication.js +0 -3
- package/resolver/app/abstractions/ResolverRecord.js +0 -3
- package/resolver/app/bundler/BaseBundle.js +17 -16
- package/resolver/app/bundler/BaseBundle.js.map +1 -1
- package/resolver/app/bundler/Bundler.js +13 -18
- package/resolver/app/bundler/Bundler.js.map +1 -1
- package/resolver/app/bundler/Bundles.js +21 -26
- package/resolver/app/bundler/Bundles.js.map +1 -1
- package/resolver/app/bundler/CommandBundle.js +7 -16
- package/resolver/app/bundler/CommandBundle.js.map +1 -1
- package/resolver/app/bundler/TableBundle.js +6 -13
- package/resolver/app/bundler/TableBundle.js.map +1 -1
- package/resolver/app/bundler/types.js +0 -3
- package/resolver/app/commandHandler/DeleteCommandHandler.js +22 -29
- package/resolver/app/commandHandler/DeleteCommandHandler.js.map +1 -1
- package/resolver/app/commandHandler/PutCommandHandler.js +16 -22
- package/resolver/app/commandHandler/PutCommandHandler.js.map +1 -1
- package/resolver/app/commandHandler/delete.js +11 -12
- package/resolver/app/commandHandler/delete.js.map +1 -1
- package/resolver/app/commandHandler/put.js +11 -12
- package/resolver/app/commandHandler/put.js.map +1 -1
- package/resolver/app/data/SourceDataContainer.js +28 -30
- package/resolver/app/data/SourceDataContainer.js.map +1 -1
- package/resolver/app/data/types.js +0 -3
- package/resolver/app/fetcher/Fetcher.js +84 -109
- package/resolver/app/fetcher/Fetcher.js.map +1 -1
- package/resolver/app/fetcher/types.js +0 -3
- package/resolver/app/ingestor/Ingestor.js +27 -32
- package/resolver/app/ingestor/Ingestor.js.map +1 -1
- package/resolver/app/ingestor/IngestorResult.js +28 -32
- package/resolver/app/ingestor/IngestorResult.js.map +1 -1
- package/resolver/app/ingestor/types.js +0 -3
- package/resolver/app/storer/Storer.js +71 -85
- package/resolver/app/storer/Storer.js.map +1 -1
- package/resolver/app/storer/types.js +0 -3
- package/resolver/app/transform/TransformHandler.js +45 -56
- package/resolver/app/transform/TransformHandler.js.map +1 -1
- package/resolver/app/transform/middleware.js +13 -20
- package/resolver/app/transform/middleware.js.map +1 -1
- package/resolver/app/utils/Retry.js +21 -24
- package/resolver/app/utils/Retry.js.map +1 -1
- package/resolver/app/utils/sleep.js +4 -5
- package/resolver/app/utils/sleep.js.map +1 -1
- package/resolver/app/validation/body.js +26 -31
- package/resolver/app/validation/body.js.map +1 -1
- package/resolver/app/validation/createJsonTransform.js +12 -13
- package/resolver/app/validation/createJsonTransform.js.map +1 -1
- package/resolver/app/validation/detail.js +30 -35
- package/resolver/app/validation/detail.js.map +1 -1
- package/resolver/app/validation/event.js +17 -18
- package/resolver/app/validation/event.js.map +1 -1
- package/resolver/app/validation/numericString.js +8 -11
- package/resolver/app/validation/numericString.js.map +1 -1
- package/resolver/app/validation/system.js +8 -9
- package/resolver/app/validation/system.js.map +1 -1
- package/resolver/createEventHandlerPlugin.js +70 -99
- package/resolver/createEventHandlerPlugin.js.map +1 -1
- package/resolver/createResolverHandler.js +49 -57
- package/resolver/createResolverHandler.js.map +1 -1
- package/resolver/deployment/Deployment.js +28 -31
- package/resolver/deployment/Deployment.js.map +1 -1
- package/resolver/deployment/Deployments.js +20 -23
- package/resolver/deployment/Deployments.js.map +1 -1
- package/resolver/deployment/DeploymentsFetcher.js +75 -84
- package/resolver/deployment/DeploymentsFetcher.js.map +1 -1
- package/resolver/deployment/types.js +0 -3
- package/resolver/lambda/LambdaTrigger.js +24 -26
- package/resolver/lambda/LambdaTrigger.js.map +1 -1
- package/resolver/plugins/CommandHandlerPlugin.js +16 -15
- package/resolver/plugins/CommandHandlerPlugin.js.map +1 -1
- package/resolver/plugins/StorerAfterEachPlugin.js +20 -19
- package/resolver/plugins/StorerAfterEachPlugin.js.map +1 -1
- package/resolver/plugins/TransformRecordPlugin.js +19 -18
- package/resolver/plugins/TransformRecordPlugin.js.map +1 -1
- package/resolver/recordTypes/fileManager/CopyFile.js +44 -67
- package/resolver/recordTypes/fileManager/CopyFile.js.map +1 -1
- package/resolver/recordTypes/fileManager/DeleteFile.js +40 -58
- package/resolver/recordTypes/fileManager/DeleteFile.js.map +1 -1
- package/resolver/recordTypes/fileManager/fileManager.js +5 -3
- package/resolver/recordTypes/fileManager/fileManager.js.map +1 -1
- package/resolver/recordTypes/fileManager/fileManagerOnDelete.js +24 -35
- package/resolver/recordTypes/fileManager/fileManagerOnDelete.js.map +1 -1
- package/resolver/recordTypes/fileManager/fileManagerOnPut.js +24 -35
- package/resolver/recordTypes/fileManager/fileManagerOnPut.js.map +1 -1
- package/resolver/recordTypes/fileManager/shouldBeHandled.js +10 -27
- package/resolver/recordTypes/fileManager/shouldBeHandled.js.map +1 -1
- package/resolver/recordTypes/fileManager/types.js +0 -3
- package/resolver/recordTypes/users/CopyUser.js +44 -54
- package/resolver/recordTypes/users/CopyUser.js.map +1 -1
- package/resolver/recordTypes/users/DeleteUser.js +40 -51
- package/resolver/recordTypes/users/DeleteUser.js.map +1 -1
- package/resolver/recordTypes/users/shouldBeHandled.js +10 -26
- package/resolver/recordTypes/users/shouldBeHandled.js.map +1 -1
- package/resolver/recordTypes/users/types.js +0 -3
- package/resolver/recordTypes/users/users.js +5 -3
- package/resolver/recordTypes/users/users.js.map +1 -1
- package/resolver/recordTypes/users/usersOnDelete.js +23 -34
- package/resolver/recordTypes/users/usersOnDelete.js.map +1 -1
- package/resolver/recordTypes/users/usersOnPut.js +24 -35
- package/resolver/recordTypes/users/usersOnPut.js.map +1 -1
- package/sync/FilterOutRecord.js +9 -17
- package/sync/FilterOutRecord.js.map +1 -1
- package/sync/attachToDynamoDbDocument.js +46 -65
- package/sync/attachToDynamoDbDocument.js.map +1 -1
- package/sync/createHandler.js +31 -40
- package/sync/createHandler.js.map +1 -1
- package/sync/createSendDataToEventBridgeOnRequestEnd.js +32 -37
- package/sync/createSendDataToEventBridgeOnRequestEnd.js.map +1 -1
- package/sync/createSyncSystem.js +24 -26
- package/sync/createSyncSystem.js.map +1 -1
- package/sync/filter/createDefaultFilterOutRecordPlugins.js +37 -76
- package/sync/filter/createDefaultFilterOutRecordPlugins.js.map +1 -1
- package/sync/handler/Handler.js +64 -76
- package/sync/handler/Handler.js.map +1 -1
- package/sync/handler/HandlerConverter.js +21 -29
- package/sync/handler/HandlerConverter.js.map +1 -1
- package/sync/handler/converter/BatchGetCommandConverter.js +12 -11
- package/sync/handler/converter/BatchGetCommandConverter.js.map +1 -1
- package/sync/handler/converter/BatchWriteCommandConverter.js +12 -11
- package/sync/handler/converter/BatchWriteCommandConverter.js.map +1 -1
- package/sync/handler/converter/DeleteCommandConverter.js +12 -11
- package/sync/handler/converter/DeleteCommandConverter.js.map +1 -1
- package/sync/handler/converter/GetCommandConverter.js +12 -11
- package/sync/handler/converter/GetCommandConverter.js.map +1 -1
- package/sync/handler/converter/PutCommandConverter.js +12 -11
- package/sync/handler/converter/PutCommandConverter.js.map +1 -1
- package/sync/handler/converter/QueryCommandConverter.js +12 -11
- package/sync/handler/converter/QueryCommandConverter.js.map +1 -1
- package/sync/handler/converter/ScanCommandConverter.js +12 -11
- package/sync/handler/converter/ScanCommandConverter.js.map +1 -1
- package/sync/handler/converter/UpdateCommandConverter.js +12 -11
- package/sync/handler/converter/UpdateCommandConverter.js.map +1 -1
- package/sync/handler/converter/commands/BatchWriteCommandValue.js +34 -37
- package/sync/handler/converter/commands/BatchWriteCommandValue.js.map +1 -1
- package/sync/handler/converter/commands/DeleteCommandValue.js +19 -16
- package/sync/handler/converter/commands/DeleteCommandValue.js.map +1 -1
- package/sync/handler/converter/commands/NullCommandValue.js +8 -8
- package/sync/handler/converter/commands/NullCommandValue.js.map +1 -1
- package/sync/handler/converter/commands/PutCommandValue.js +19 -16
- package/sync/handler/converter/commands/PutCommandValue.js.map +1 -1
- package/sync/handler/converter/commands/UpdateCommandValue.js +19 -16
- package/sync/handler/converter/commands/UpdateCommandValue.js.map +1 -1
- package/sync/handler/types.js +0 -3
- package/sync/plugins/FilterOutRecordPlugin.js +17 -19
- package/sync/plugins/FilterOutRecordPlugin.js.map +1 -1
- package/sync/requestPlugin.js +33 -48
- package/sync/requestPlugin.js.map +1 -1
- package/sync/types.js +0 -3
- package/sync/utils/getTableType.js +10 -9
- package/sync/utils/getTableType.js.map +1 -1
- package/sync/utils/manifest.js +28 -35
- package/sync/utils/manifest.js.map +1 -1
- package/sync/utils/validateSystemInput.js +21 -29
- package/sync/utils/validateSystemInput.js.map +1 -1
- package/types.js +6 -5
- package/types.js.map +1 -1
- package/utils/createSystemName.js +5 -3
- package/utils/createSystemName.js.map +1 -1
- package/worker/actions/copyFile/CopyFile.js +183 -258
- package/worker/actions/copyFile/CopyFile.js.map +1 -1
- package/worker/actions/copyFile/copyFileAction.js +26 -34
- package/worker/actions/copyFile/copyFileAction.js.map +1 -1
- package/worker/actions/copyFile/copyFileSchema.js +13 -14
- package/worker/actions/copyFile/copyFileSchema.js.map +1 -1
- package/worker/actions/copyFile/types.js +0 -3
- package/worker/actions/createUser/CreateUser.js +51 -74
- package/worker/actions/createUser/CreateUser.js.map +1 -1
- package/worker/actions/createUser/createUserAction.js +24 -28
- package/worker/actions/createUser/createUserAction.js.map +1 -1
- package/worker/actions/createUser/createUserSchema.js +13 -14
- package/worker/actions/createUser/createUserSchema.js.map +1 -1
- package/worker/actions/createUser/types.js +0 -3
- package/worker/actions/deleteFile/DeleteFile.js +52 -67
- package/worker/actions/deleteFile/DeleteFile.js.map +1 -1
- package/worker/actions/deleteFile/deleteFileAction.js +21 -29
- package/worker/actions/deleteFile/deleteFileAction.js.map +1 -1
- package/worker/actions/deleteFile/deleteFileSchema.js +13 -14
- package/worker/actions/deleteFile/deleteFileSchema.js.map +1 -1
- package/worker/actions/deleteFile/types.js +0 -3
- package/worker/actions/deleteUser/DeleteUser.js +38 -52
- package/worker/actions/deleteUser/DeleteUser.js.map +1 -1
- package/worker/actions/deleteUser/deleteUserAction.js +22 -26
- package/worker/actions/deleteUser/deleteUserAction.js.map +1 -1
- package/worker/actions/deleteUser/deleteUserSchema.js +12 -13
- package/worker/actions/deleteUser/deleteUserSchema.js.map +1 -1
- package/worker/actions/deleteUser/types.js +0 -3
- package/worker/actions/logValidationError.js +5 -6
- package/worker/actions/logValidationError.js.map +1 -1
- package/worker/actions/removeCognitoUserAttributes.js +9 -15
- package/worker/actions/removeCognitoUserAttributes.js.map +1 -1
- package/worker/actions/updateUser/UpdateUser.js +48 -65
- package/worker/actions/updateUser/UpdateUser.js.map +1 -1
- package/worker/actions/updateUser/types.js +0 -3
- package/worker/actions/updateUser/updateUserAction.js +24 -28
- package/worker/actions/updateUser/updateUserAction.js.map +1 -1
- package/worker/actions/updateUser/updateUserSchema.js +13 -14
- package/worker/actions/updateUser/updateUserSchema.js.map +1 -1
- package/worker/createWorkerHandler.js +24 -30
- package/worker/createWorkerHandler.js.map +1 -1
- package/worker/handler/WorkerActionHandler.js +19 -21
- package/worker/handler/WorkerActionHandler.js.map +1 -1
- package/worker/handler/eventHandler.js +14 -16
- package/worker/handler/eventHandler.js.map +1 -1
- package/worker/plugins/WorkerActionPlugin.js +17 -16
- package/worker/plugins/WorkerActionPlugin.js.map +1 -1
- package/worker/types.js +0 -3
- 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,30 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
class Bundles {
|
|
2
|
+
constructor(params){
|
|
3
|
+
this.bundles = [];
|
|
4
|
+
this.createBundle = params.createBundle;
|
|
5
|
+
}
|
|
6
|
+
add(params) {
|
|
7
|
+
const { item } = params;
|
|
8
|
+
const bundle = this.getBundle(item);
|
|
9
|
+
bundle.add(item);
|
|
10
|
+
}
|
|
11
|
+
getBundles() {
|
|
12
|
+
return this.bundles;
|
|
13
|
+
}
|
|
14
|
+
getBundle(item) {
|
|
15
|
+
const last = this.bundles[this.bundles.length - 1];
|
|
16
|
+
if (last?.canAdd(item)) return last;
|
|
17
|
+
const bundle = this.createBundle(item);
|
|
18
|
+
this.bundles.push(bundle);
|
|
19
|
+
return bundle;
|
|
20
20
|
}
|
|
21
|
-
const bundle = this.createBundle(item);
|
|
22
|
-
this.bundles.push(bundle);
|
|
23
|
-
return bundle;
|
|
24
|
-
}
|
|
25
21
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
22
|
+
const createBundles = (params)=>new Bundles(params);
|
|
23
|
+
export { Bundles, createBundles };
|
|
29
24
|
|
|
30
25
|
//# sourceMappingURL=Bundles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"resolver/app/bundler/Bundles.js","sources":["../../../../src/resolver/app/bundler/Bundles.ts"],"sourcesContent":["import type { IBundle, IBundles, IBundlesAddParams } from \"~/resolver/app/bundler/types.js\";\nimport type { IIngestorResultItem } from \"~/resolver/app/ingestor/types.js\";\n\nexport interface IBundlesParams {\n createBundle: (item: IIngestorResultItem) => IBundle;\n}\n\nexport class Bundles implements IBundles {\n private readonly bundles: IBundle[] = [];\n private readonly createBundle: (item: IIngestorResultItem) => IBundle;\n\n public constructor(params: IBundlesParams) {\n this.createBundle = params.createBundle;\n }\n\n public add(params: IBundlesAddParams): void {\n const { item } = params;\n\n const bundle = this.getBundle(item);\n\n bundle.add(item);\n }\n\n public getBundles(): IBundle[] {\n return this.bundles;\n }\n\n private getBundle(item: IIngestorResultItem): IBundle {\n const last = this.bundles[this.bundles.length - 1];\n if (last?.canAdd(item)) {\n return last;\n }\n const bundle = this.createBundle(item);\n this.bundles.push(bundle);\n return bundle;\n }\n}\n\nexport const createBundles = (params: IBundlesParams) => {\n return new Bundles(params);\n};\n"],"names":["Bundles","params","item","bundle","last","createBundles"],"mappings":"AAOO,MAAMA;IAIT,YAAmBC,MAAsB,CAAE;aAH1B,OAAO,GAAc,EAAE;QAIpC,IAAI,CAAC,YAAY,GAAGA,OAAO,YAAY;IAC3C;IAEO,IAAIA,MAAyB,EAAQ;QACxC,MAAM,EAAEC,IAAI,EAAE,GAAGD;QAEjB,MAAME,SAAS,IAAI,CAAC,SAAS,CAACD;QAE9BC,OAAO,GAAG,CAACD;IACf;IAEO,aAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO;IACvB;IAEQ,UAAUA,IAAyB,EAAW;QAClD,MAAME,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,EAAE;QAClD,IAAIA,MAAM,OAAOF,OACb,OAAOE;QAEX,MAAMD,SAAS,IAAI,CAAC,YAAY,CAACD;QACjC,IAAI,CAAC,OAAO,CAAC,IAAI,CAACC;QAClB,OAAOA;IACX;AACJ;AAEO,MAAME,gBAAgB,CAACJ,SACnB,IAAID,QAAQC"}
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Used to bundle by source system, table and command.
|
|
3
|
-
* If we receive >1 commands in a single batch, for example, put -> delete -> put -> delete, we need to make sure
|
|
4
|
-
* that commands are executed in that order.
|
|
5
|
-
*
|
|
6
|
-
* This will be used for executing the commands in the target systems.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
1
|
import { BaseBundle } from "./BaseBundle.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
class CommandBundle extends BaseBundle {
|
|
3
|
+
canAdd(item) {
|
|
4
|
+
const command = this.getCommand(item.command);
|
|
5
|
+
return this.command === command && this.table.name === item.table.name && this.source.name === item.source.name;
|
|
6
|
+
}
|
|
15
7
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
8
|
+
const createCommandBundle = (params)=>new CommandBundle(params);
|
|
9
|
+
export { CommandBundle, createCommandBundle };
|
|
19
10
|
|
|
20
11
|
//# sourceMappingURL=CommandBundle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"resolver/app/bundler/CommandBundle.js","sources":["../../../../src/resolver/app/bundler/CommandBundle.ts"],"sourcesContent":["/**\n * Used to bundle by source system, table and command.\n * If we receive >1 commands in a single batch, for example, put -> delete -> put -> delete, we need to make sure\n * that commands are executed in that order.\n *\n * This will be used for executing the commands in the target systems.\n */\nimport type { IBundle } from \"./types.js\";\nimport type { IIngestorResultItem } from \"../ingestor/types.js\";\nimport type { IBaseBundleParams } from \"./BaseBundle.js\";\nimport { BaseBundle } from \"./BaseBundle.js\";\n\nexport class CommandBundle extends BaseBundle {\n public canAdd(item: IIngestorResultItem): boolean {\n const command = this.getCommand(item.command);\n return (\n this.command === command &&\n this.table.name === item.table.name &&\n this.source.name === item.source.name\n );\n }\n}\n\nexport const createCommandBundle = (params: IBaseBundleParams): IBundle => {\n return new CommandBundle(params);\n};\n"],"names":["CommandBundle","BaseBundle","item","command","createCommandBundle","params"],"mappings":";AAYO,MAAMA,sBAAsBC;IACxB,OAAOC,IAAyB,EAAW;QAC9C,MAAMC,UAAU,IAAI,CAAC,UAAU,CAACD,KAAK,OAAO;QAC5C,OACI,IAAI,CAAC,OAAO,KAAKC,WACjB,IAAI,CAAC,KAAK,CAAC,IAAI,KAAKD,KAAK,KAAK,CAAC,IAAI,IACnC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAKA,KAAK,MAAM,CAAC,IAAI;IAE7C;AACJ;AAEO,MAAME,sBAAsB,CAACC,SACzB,IAAIL,cAAcK"}
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This will bundle records by system and table.
|
|
3
|
-
*
|
|
4
|
-
* It will be used to fetch the data from the source system tables.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
1
|
import { BaseBundle } from "./BaseBundle.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
class TableBundle extends BaseBundle {
|
|
3
|
+
canAdd(item) {
|
|
4
|
+
return this.source.name === item.source.name && this.table.name === item.table.name;
|
|
5
|
+
}
|
|
12
6
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
7
|
+
const createTableBundle = (params)=>new TableBundle(params);
|
|
8
|
+
export { TableBundle, createTableBundle };
|
|
16
9
|
|
|
17
10
|
//# sourceMappingURL=TableBundle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"resolver/app/bundler/TableBundle.js","sources":["../../../../src/resolver/app/bundler/TableBundle.ts"],"sourcesContent":["/**\n * This will bundle records by system and table.\n *\n * It will be used to fetch the data from the source system tables.\n */\nimport type { IBundle } from \"./types.js\";\nimport type { IIngestorResultItem } from \"../ingestor/types.js\";\nimport type { IBaseBundleParams } from \"./BaseBundle.js\";\nimport { BaseBundle } from \"./BaseBundle.js\";\n\nexport class TableBundle extends BaseBundle {\n public canAdd(item: IIngestorResultItem): boolean {\n return this.source.name === item.source.name && this.table.name === item.table.name;\n }\n}\n\nexport const createTableBundle = (params: IBaseBundleParams): IBundle => {\n return new TableBundle(params);\n};\n"],"names":["TableBundle","BaseBundle","item","createTableBundle","params"],"mappings":";AAUO,MAAMA,oBAAoBC;IACtB,OAAOC,IAAyB,EAAW;QAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,KAAKA,KAAK,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAKA,KAAK,KAAK,CAAC,IAAI;IACvF;AACJ;AAEO,MAAMC,oBAAoB,CAACC,SACvB,IAAIJ,YAAYI"}
|
|
@@ -1,32 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
await this.storer.store({
|
|
23
|
-
command: "delete",
|
|
24
|
-
deployment: targetDeployment,
|
|
25
|
-
table: targetTable,
|
|
26
|
-
items: result,
|
|
27
|
-
bundle
|
|
28
|
-
});
|
|
29
|
-
}
|
|
1
|
+
class DeleteCommandHandler {
|
|
2
|
+
constructor(params){
|
|
3
|
+
this.storer = params.storer;
|
|
4
|
+
}
|
|
5
|
+
async handle(params) {
|
|
6
|
+
const { targetDeployment, targetTable, bundle } = params;
|
|
7
|
+
const result = bundle.items.map((item)=>{
|
|
8
|
+
if (!item.PK || !item.SK) return null;
|
|
9
|
+
return {
|
|
10
|
+
PK: item.PK,
|
|
11
|
+
SK: item.SK
|
|
12
|
+
};
|
|
13
|
+
}).filter((item)=>!!item);
|
|
14
|
+
await this.storer.store({
|
|
15
|
+
command: "delete",
|
|
16
|
+
deployment: targetDeployment,
|
|
17
|
+
table: targetTable,
|
|
18
|
+
items: result,
|
|
19
|
+
bundle
|
|
20
|
+
});
|
|
21
|
+
}
|
|
30
22
|
}
|
|
23
|
+
export { DeleteCommandHandler };
|
|
31
24
|
|
|
32
25
|
//# sourceMappingURL=DeleteCommandHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"resolver/app/commandHandler/DeleteCommandHandler.js","sources":["../../../../src/resolver/app/commandHandler/DeleteCommandHandler.ts"],"sourcesContent":["import type { IStoreItem, IStorer } from \"../storer/types.js\";\nimport type { IDeployment } from \"~/resolver/deployment/types.js\";\nimport type { ITable } from \"~/sync/types.js\";\nimport type { IBundle } from \"~/resolver/app/bundler/types.js\";\n\nexport interface IDeleteCommandHandlerHandleParams {\n targetDeployment: IDeployment;\n targetTable: ITable;\n items: IStoreItem[];\n bundle: IBundle;\n}\n\nexport interface IDeleteCommandHandlerParams {\n storer: IStorer;\n}\n\nexport class DeleteCommandHandler {\n private readonly storer: IStorer;\n\n public constructor(params: IDeleteCommandHandlerParams) {\n this.storer = params.storer;\n }\n public async handle(params: IDeleteCommandHandlerHandleParams): Promise<void> {\n const { targetDeployment, targetTable, bundle } = params;\n const result = bundle.items\n .map(item => {\n if (!item.PK || !item.SK) {\n return null;\n }\n return {\n PK: item.PK,\n SK: item.SK\n };\n })\n .filter((item): item is IStoreItem => {\n return !!item;\n });\n\n await this.storer.store({\n command: \"delete\",\n deployment: targetDeployment,\n table: targetTable,\n items: result,\n bundle\n });\n }\n}\n"],"names":["DeleteCommandHandler","params","targetDeployment","targetTable","bundle","result","item"],"mappings":"AAgBO,MAAMA;IAGT,YAAmBC,MAAmC,CAAE;QACpD,IAAI,CAAC,MAAM,GAAGA,OAAO,MAAM;IAC/B;IACA,MAAa,OAAOA,MAAyC,EAAiB;QAC1E,MAAM,EAAEC,gBAAgB,EAAEC,WAAW,EAAEC,MAAM,EAAE,GAAGH;QAClD,MAAMI,SAASD,OAAO,KAAK,CACtB,GAAG,CAACE,CAAAA;YACD,IAAI,CAACA,KAAK,EAAE,IAAI,CAACA,KAAK,EAAE,EACpB,OAAO;YAEX,OAAO;gBACH,IAAIA,KAAK,EAAE;gBACX,IAAIA,KAAK,EAAE;YACf;QACJ,GACC,MAAM,CAAC,CAACA,OACE,CAAC,CAACA;QAGjB,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YACpB,SAAS;YACT,YAAYJ;YACZ,OAAOC;YACP,OAAOE;YACPD;QACJ;IACJ;AACJ"}
|
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
command: "put",
|
|
17
|
-
deployment: targetDeployment,
|
|
18
|
-
table: targetTable,
|
|
19
|
-
items: result,
|
|
20
|
-
bundle
|
|
21
|
-
});
|
|
22
|
-
}
|
|
1
|
+
class PutCommandHandler {
|
|
2
|
+
constructor(params){
|
|
3
|
+
this.storer = params.storer;
|
|
4
|
+
}
|
|
5
|
+
async handle(params) {
|
|
6
|
+
const { items, targetDeployment, targetTable, bundle } = params;
|
|
7
|
+
const result = items.filter((item)=>!!item.PK && !!item.SK);
|
|
8
|
+
await this.storer.store({
|
|
9
|
+
command: "put",
|
|
10
|
+
deployment: targetDeployment,
|
|
11
|
+
table: targetTable,
|
|
12
|
+
items: result,
|
|
13
|
+
bundle
|
|
14
|
+
});
|
|
15
|
+
}
|
|
23
16
|
}
|
|
17
|
+
export { PutCommandHandler };
|
|
24
18
|
|
|
25
19
|
//# sourceMappingURL=PutCommandHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"resolver/app/commandHandler/PutCommandHandler.js","sources":["../../../../src/resolver/app/commandHandler/PutCommandHandler.ts"],"sourcesContent":["import type { IStoreItem, IStorer } from \"../storer/types.js\";\nimport type { ITable } from \"~/sync/types.js\";\nimport type { IDeployment } from \"~/resolver/deployment/types.js\";\nimport type { IBundle } from \"~/resolver/app/bundler/types.js\";\n\nexport interface IPutCommandHandlerHandleParams {\n items: IStoreItem[];\n bundle: IBundle;\n targetDeployment: IDeployment;\n targetTable: ITable;\n}\n\nexport interface IPutCommandHandlerParams {\n storer: IStorer;\n}\n\nexport class PutCommandHandler {\n private readonly storer: IStorer;\n\n public constructor(params: IPutCommandHandlerParams) {\n this.storer = params.storer;\n }\n\n public async handle(params: IPutCommandHandlerHandleParams): Promise<void> {\n const { items, targetDeployment, targetTable, bundle } = params;\n\n const result = items.filter(item => {\n return !!item.PK && !!item.SK;\n });\n\n await this.storer.store({\n command: \"put\",\n deployment: targetDeployment,\n table: targetTable,\n items: result,\n bundle\n });\n }\n}\n"],"names":["PutCommandHandler","params","items","targetDeployment","targetTable","bundle","result","item"],"mappings":"AAgBO,MAAMA;IAGT,YAAmBC,MAAgC,CAAE;QACjD,IAAI,CAAC,MAAM,GAAGA,OAAO,MAAM;IAC/B;IAEA,MAAa,OAAOA,MAAsC,EAAiB;QACvE,MAAM,EAAEC,KAAK,EAAEC,gBAAgB,EAAEC,WAAW,EAAEC,MAAM,EAAE,GAAGJ;QAEzD,MAAMK,SAASJ,MAAM,MAAM,CAACK,CAAAA,OACjB,CAAC,CAACA,KAAK,EAAE,IAAI,CAAC,CAACA,KAAK,EAAE;QAGjC,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YACpB,SAAS;YACT,YAAYJ;YACZ,OAAOC;YACP,OAAOE;YACPD;QACJ;IACJ;AACJ"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { CommandHandlerPlugin, createCommandHandlerPlugin } from "../../plugins/CommandHandlerPlugin.js";
|
|
2
2
|
import { DeleteCommandHandler } from "./DeleteCommandHandler.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
plugin.name = `${CommandHandlerPlugin.type}.delete`;
|
|
14
|
-
return plugin;
|
|
3
|
+
const createDeleteCommandHandlerPlugin = ()=>{
|
|
4
|
+
const plugin = createCommandHandlerPlugin({
|
|
5
|
+
canHandle: (command)=>"delete" === command,
|
|
6
|
+
handle: async (params)=>{
|
|
7
|
+
const handler = new DeleteCommandHandler(params);
|
|
8
|
+
return handler.handle(params);
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
plugin.name = `${CommandHandlerPlugin.type}.delete`;
|
|
12
|
+
return plugin;
|
|
15
13
|
};
|
|
14
|
+
export { createDeleteCommandHandlerPlugin };
|
|
16
15
|
|
|
17
16
|
//# sourceMappingURL=delete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"resolver/app/commandHandler/delete.js","sources":["../../../../src/resolver/app/commandHandler/delete.ts"],"sourcesContent":["import {\n CommandHandlerPlugin,\n createCommandHandlerPlugin\n} from \"~/resolver/plugins/CommandHandlerPlugin.js\";\nimport { DeleteCommandHandler } from \"./DeleteCommandHandler.js\";\n\nexport const createDeleteCommandHandlerPlugin = () => {\n const plugin = createCommandHandlerPlugin({\n canHandle: command => {\n return command === \"delete\";\n },\n handle: async params => {\n const handler = new DeleteCommandHandler(params);\n\n return handler.handle(params);\n }\n });\n\n plugin.name = `${CommandHandlerPlugin.type}.delete`;\n\n return plugin;\n};\n"],"names":["createDeleteCommandHandlerPlugin","plugin","createCommandHandlerPlugin","command","params","handler","DeleteCommandHandler","CommandHandlerPlugin"],"mappings":";;AAMO,MAAMA,mCAAmC;IAC5C,MAAMC,SAASC,2BAA2B;QACtC,WAAWC,CAAAA,UACAA,AAAY,aAAZA;QAEX,QAAQ,OAAMC;YACV,MAAMC,UAAU,IAAIC,qBAAqBF;YAEzC,OAAOC,QAAQ,MAAM,CAACD;QAC1B;IACJ;IAEAH,OAAO,IAAI,GAAG,GAAGM,qBAAqB,IAAI,CAAC,OAAO,CAAC;IAEnD,OAAON;AACX"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { CommandHandlerPlugin, createCommandHandlerPlugin } from "../../plugins/CommandHandlerPlugin.js";
|
|
2
2
|
import { PutCommandHandler } from "./PutCommandHandler.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
plugin.name = `${CommandHandlerPlugin.type}.put`;
|
|
14
|
-
return plugin;
|
|
3
|
+
const createPutCommandHandlerPlugin = ()=>{
|
|
4
|
+
const plugin = createCommandHandlerPlugin({
|
|
5
|
+
canHandle: (command)=>"put" === command,
|
|
6
|
+
handle: async (params)=>{
|
|
7
|
+
const handler = new PutCommandHandler(params);
|
|
8
|
+
return handler.handle(params);
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
plugin.name = `${CommandHandlerPlugin.type}.put`;
|
|
12
|
+
return plugin;
|
|
15
13
|
};
|
|
14
|
+
export { createPutCommandHandlerPlugin };
|
|
16
15
|
|
|
17
16
|
//# sourceMappingURL=put.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"resolver/app/commandHandler/put.js","sources":["../../../../src/resolver/app/commandHandler/put.ts"],"sourcesContent":["import {\n CommandHandlerPlugin,\n createCommandHandlerPlugin\n} from \"~/resolver/plugins/CommandHandlerPlugin.js\";\nimport { PutCommandHandler } from \"./PutCommandHandler.js\";\n\nexport const createPutCommandHandlerPlugin = () => {\n const plugin = createCommandHandlerPlugin({\n canHandle: command => {\n return command === \"put\";\n },\n handle: async params => {\n const handler = new PutCommandHandler(params);\n\n return handler.handle(params);\n }\n });\n\n plugin.name = `${CommandHandlerPlugin.type}.put`;\n\n return plugin;\n};\n"],"names":["createPutCommandHandlerPlugin","plugin","createCommandHandlerPlugin","command","params","handler","PutCommandHandler","CommandHandlerPlugin"],"mappings":";;AAMO,MAAMA,gCAAgC;IACzC,MAAMC,SAASC,2BAA2B;QACtC,WAAWC,CAAAA,UACAA,AAAY,UAAZA;QAEX,QAAQ,OAAMC;YACV,MAAMC,UAAU,IAAIC,kBAAkBF;YAEtC,OAAOC,QAAQ,MAAM,CAACD;QAC1B;IACJ;IAEAH,OAAO,IAAI,GAAG,GAAGM,qBAAqB,IAAI,CAAC,IAAI,CAAC;IAEhD,OAAON;AACX"}
|
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
// block
|
|
5
|
-
}
|
|
6
|
-
static create() {
|
|
7
|
-
return new SourceDataContainer();
|
|
8
|
-
}
|
|
9
|
-
get(input) {
|
|
10
|
-
const key = this.createKey(input);
|
|
11
|
-
const item = this.items[key];
|
|
12
|
-
return item?.data || null;
|
|
13
|
-
}
|
|
14
|
-
add(item, data) {
|
|
15
|
-
const key = this.createKey(item);
|
|
16
|
-
if (this.items[key]) {
|
|
17
|
-
return;
|
|
1
|
+
class SourceDataContainer {
|
|
2
|
+
constructor(){
|
|
3
|
+
this.items = {};
|
|
18
4
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
5
|
+
static create() {
|
|
6
|
+
return new SourceDataContainer();
|
|
7
|
+
}
|
|
8
|
+
get(input) {
|
|
9
|
+
const key = this.createKey(input);
|
|
10
|
+
const item = this.items[key];
|
|
11
|
+
return item?.data || null;
|
|
12
|
+
}
|
|
13
|
+
add(item, data) {
|
|
14
|
+
const key = this.createKey(item);
|
|
15
|
+
if (this.items[key]) return;
|
|
16
|
+
this.items[key] = {
|
|
17
|
+
...item,
|
|
18
|
+
data
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
merge(container) {
|
|
22
|
+
for(const key in container.items){
|
|
23
|
+
const item = container.items[key];
|
|
24
|
+
this.add(item, item.data);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
createKey(item) {
|
|
28
|
+
return `${item.source.name}#${item.table.name}#${item.PK}#${item.SK}`;
|
|
28
29
|
}
|
|
29
|
-
}
|
|
30
|
-
createKey(item) {
|
|
31
|
-
return `${item.source.name}#${item.table.name}#${item.PK}#${item.SK}`;
|
|
32
|
-
}
|
|
33
30
|
}
|
|
31
|
+
export { SourceDataContainer };
|
|
34
32
|
|
|
35
33
|
//# sourceMappingURL=SourceDataContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"resolver/app/data/SourceDataContainer.js","sources":["../../../../src/resolver/app/data/SourceDataContainer.ts"],"sourcesContent":["import type { GenericRecord } from \"@webiny/api/types.js\";\nimport type { IInputItem, IItem, ISourceDataContainer } from \"~/resolver/app/data/types.js\";\nimport type { IStoreItem } from \"~/resolver/app/storer/types.js\";\n\nexport class SourceDataContainer implements ISourceDataContainer {\n public readonly items: GenericRecord<string, IItem> = {};\n\n private constructor() {\n // block\n }\n\n public static create(): ISourceDataContainer {\n return new SourceDataContainer();\n }\n\n public get(input: IInputItem): IStoreItem | null {\n const key = this.createKey(input);\n const item = this.items[key];\n return item?.data || null;\n }\n\n public add(item: IInputItem, data: IStoreItem | null): void {\n const key = this.createKey(item);\n if (this.items[key]) {\n return;\n }\n\n this.items[key] = {\n ...item,\n data\n };\n }\n\n public merge(container: ISourceDataContainer): void {\n for (const key in container.items) {\n const item = container.items[key];\n this.add(item, item.data);\n }\n }\n\n private createKey(item: IInputItem): string {\n return `${item.source.name}#${item.table.name}#${item.PK}#${item.SK}`;\n }\n}\n"],"names":["SourceDataContainer","input","key","item","data","container"],"mappings":"AAIO,MAAMA;IAGT,aAAsB;aAFN,KAAK,GAAiC,CAAC;IAIvD;IAEA,OAAc,SAA+B;QACzC,OAAO,IAAIA;IACf;IAEO,IAAIC,KAAiB,EAAqB;QAC7C,MAAMC,MAAM,IAAI,CAAC,SAAS,CAACD;QAC3B,MAAME,OAAO,IAAI,CAAC,KAAK,CAACD,IAAI;QAC5B,OAAOC,MAAM,QAAQ;IACzB;IAEO,IAAIA,IAAgB,EAAEC,IAAuB,EAAQ;QACxD,MAAMF,MAAM,IAAI,CAAC,SAAS,CAACC;QAC3B,IAAI,IAAI,CAAC,KAAK,CAACD,IAAI,EACf;QAGJ,IAAI,CAAC,KAAK,CAACA,IAAI,GAAG;YACd,GAAGC,IAAI;YACPC;QACJ;IACJ;IAEO,MAAMC,SAA+B,EAAQ;QAChD,IAAK,MAAMH,OAAOG,UAAU,KAAK,CAAE;YAC/B,MAAMF,OAAOE,UAAU,KAAK,CAACH,IAAI;YACjC,IAAI,CAAC,GAAG,CAACC,MAAMA,KAAK,IAAI;QAC5B;IACJ;IAEQ,UAAUA,IAAgB,EAAU;QACxC,OAAO,GAAGA,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,EAAEA,KAAK,KAAK,CAAC,IAAI,CAAC,CAAC,EAAEA,KAAK,EAAE,CAAC,CAAC,EAAEA,KAAK,EAAE,EAAE;IACzE;AACJ"}
|