@webiny/api-sync-system 0.0.0-unstable.b9b64acb6d → 0.0.0-unstable.d0f34a8194
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.d.ts +11 -3
- package/index.js +8 -5
- package/package.json +29 -21
- package/resolver/SyncResolverConfig.d.ts +17 -0
- package/resolver/SyncResolverConfig.js +5 -0
- package/resolver/SyncResolverConfig.js.map +1 -0
- package/resolver/SyncResolverLambdaHandler.d.ts +14 -0
- package/resolver/SyncResolverLambdaHandler.js +159 -0
- package/resolver/SyncResolverLambdaHandler.js.map +1 -0
- 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.d.ts +25 -124
- package/resolver/app/validation/body.js +26 -31
- package/resolver/app/validation/body.js.map +1 -1
- package/resolver/app/validation/createJsonTransform.d.ts +1 -1
- package/resolver/app/validation/createJsonTransform.js +12 -13
- package/resolver/app/validation/createJsonTransform.js.map +1 -1
- package/resolver/app/validation/detail.d.ts +18 -71
- package/resolver/app/validation/detail.js +30 -35
- package/resolver/app/validation/detail.js.map +1 -1
- package/resolver/app/validation/event.d.ts +29 -188
- package/resolver/app/validation/event.js +17 -18
- package/resolver/app/validation/event.js.map +1 -1
- package/resolver/app/validation/numericString.d.ts +1 -1
- package/resolver/app/validation/numericString.js +8 -11
- package/resolver/app/validation/numericString.js.map +1 -1
- package/resolver/app/validation/system.d.ts +2 -14
- package/resolver/app/validation/system.js +8 -9
- package/resolver/app/validation/system.js.map +1 -1
- package/resolver/deployment/Deployment.js +28 -37
- 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 -86
- package/resolver/deployment/DeploymentsFetcher.js.map +1 -1
- package/resolver/deployment/types.d.ts +0 -2
- 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/ApiGatewaySyncDecorator.d.ts +14 -0
- package/sync/ApiGatewaySyncDecorator.js +49 -0
- package/sync/ApiGatewaySyncDecorator.js.map +1 -0
- package/sync/FilterOutRecord.js +9 -17
- package/sync/FilterOutRecord.js.map +1 -1
- package/sync/SyncSystemConfig.d.ts +11 -0
- package/sync/SyncSystemConfig.js +5 -0
- package/sync/SyncSystemConfig.js.map +1 -0
- 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/filter/createDefaultFilterOutRecordPlugins.js +36 -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/types.js +0 -3
- package/sync/utils/getTableType.js +10 -11
- package/sync/utils/getTableType.js.map +1 -1
- package/sync/utils/manifest.d.ts +3 -7
- package/sync/utils/manifest.js +27 -36
- 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.d.ts +0 -3
- package/types.js +6 -6
- package/types.js.map +1 -1
- package/utils/createSystemName.js +5 -3
- package/utils/createSystemName.js.map +1 -1
- package/worker/SyncWorkerConfig.d.ts +9 -0
- package/worker/SyncWorkerConfig.js +5 -0
- package/worker/SyncWorkerConfig.js.map +1 -0
- package/worker/SyncWorkerEventHandler.d.ts +14 -0
- package/worker/SyncWorkerEventHandler.js +5 -0
- package/worker/SyncWorkerEventHandler.js.map +1 -0
- package/worker/SyncWorkerEventType.d.ts +10 -0
- package/worker/SyncWorkerEventType.js +24 -0
- package/worker/SyncWorkerEventType.js.map +1 -0
- package/worker/SyncWorkerLambdaHandler.d.ts +13 -0
- package/worker/SyncWorkerLambdaHandler.js +61 -0
- package/worker/SyncWorkerLambdaHandler.js.map +1 -0
- 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.d.ts +6 -38
- 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.d.ts +6 -38
- 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.d.ts +6 -38
- 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.d.ts +5 -23
- 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.d.ts +6 -38
- package/worker/actions/updateUser/updateUserSchema.js +13 -14
- package/worker/actions/updateUser/updateUserSchema.js.map +1 -1
- package/worker/handler/WorkerActionHandler.js +19 -21
- package/worker/handler/WorkerActionHandler.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/createEventHandlerPlugin.d.ts +0 -11
- package/resolver/createEventHandlerPlugin.js +0 -120
- package/resolver/createEventHandlerPlugin.js.map +0 -1
- package/resolver/createResolverHandler.d.ts +0 -21
- package/resolver/createResolverHandler.js +0 -72
- package/resolver/createResolverHandler.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/createSendDataToEventBridgeOnRequestEnd.d.ts +0 -2
- package/sync/createSendDataToEventBridgeOnRequestEnd.js +0 -44
- package/sync/createSendDataToEventBridgeOnRequestEnd.js.map +0 -1
- package/sync/createSyncSystem.d.ts +0 -16
- package/sync/createSyncSystem.js +0 -35
- package/sync/createSyncSystem.js.map +0 -1
- package/sync/handler/types.js.map +0 -1
- package/sync/requestPlugin.d.ts +0 -9
- package/sync/requestPlugin.js +0 -58
- package/sync/requestPlugin.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/createWorkerHandler.d.ts +0 -11
- package/worker/createWorkerHandler.js +0 -41
- package/worker/createWorkerHandler.js.map +0 -1
- package/worker/handler/eventHandler.d.ts +0 -1
- package/worker/handler/eventHandler.js +0 -24
- package/worker/handler/eventHandler.js.map +0 -1
- package/worker/types.js.map +0 -1
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { createEventHandler as createSQSEventHandler } from "@webiny/handler-aws/sqs/index.js";
|
|
2
|
-
import { createResolverApp } from "./app/ResolverApplication.js";
|
|
3
|
-
import { convertException } from "@webiny/utils";
|
|
4
|
-
import { createRecordHandler } from "./app/RecordHandler.js";
|
|
5
|
-
import { createFetcher } from "./app/fetcher/Fetcher.js";
|
|
6
|
-
import { createDeploymentsFetcher } from "./deployment/DeploymentsFetcher.js";
|
|
7
|
-
import { WebinyError } from "@webiny/error";
|
|
8
|
-
import { createBundler } from "./app/bundler/Bundler.js";
|
|
9
|
-
import { createBundles } from "./app/bundler/Bundles.js";
|
|
10
|
-
import { createCommandBundle } from "./app/bundler/CommandBundle.js";
|
|
11
|
-
import { createTableBundle } from "./app/bundler/TableBundle.js";
|
|
12
|
-
import { TransformHandler } from "./app/transform/TransformHandler.js";
|
|
13
|
-
import { SQSEventHandler } from "@webiny/handler-aws/sqs/plugins/SQSEventHandler.js";
|
|
14
|
-
import { createStorer } from "./app/storer/Storer.js";
|
|
15
|
-
import { StorerAfterEachPlugin } from "./plugins/StorerAfterEachPlugin.js";
|
|
16
|
-
import { SourceDataContainer } from "./app/data/SourceDataContainer.js";
|
|
17
|
-
/**
|
|
18
|
-
* TODO maybe add logger?
|
|
19
|
-
*/
|
|
20
|
-
export const createEventHandlerPlugin = params => {
|
|
21
|
-
const {
|
|
22
|
-
createDocumentClient,
|
|
23
|
-
tableName
|
|
24
|
-
} = params;
|
|
25
|
-
const plugin = createSQSEventHandler(async ({
|
|
26
|
-
event,
|
|
27
|
-
context,
|
|
28
|
-
reply
|
|
29
|
-
}) => {
|
|
30
|
-
if (!tableName) {
|
|
31
|
-
throw new WebinyError({
|
|
32
|
-
message: "Table name variable is not set."
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
try {
|
|
36
|
-
const fetcher = createFetcher({
|
|
37
|
-
maxRetries: 10,
|
|
38
|
-
retryDelay: 1000,
|
|
39
|
-
createDocumentClient: deployment => {
|
|
40
|
-
return createDocumentClient({
|
|
41
|
-
region: deployment.region
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
const deploymentsFetcher = createDeploymentsFetcher({
|
|
46
|
-
client: createDocumentClient({
|
|
47
|
-
region: process.env.AWS_REGION
|
|
48
|
-
}),
|
|
49
|
-
table: tableName
|
|
50
|
-
});
|
|
51
|
-
/**
|
|
52
|
-
* Fetch all possible deployments, out of which we will filter out the deployment that the records came from.
|
|
53
|
-
*/
|
|
54
|
-
const deployments = await deploymentsFetcher.fetch();
|
|
55
|
-
const storerAfterEachPlugins = context.plugins.byType(StorerAfterEachPlugin.type);
|
|
56
|
-
const storer = createStorer({
|
|
57
|
-
createDocumentClient: deployment => {
|
|
58
|
-
return createDocumentClient({
|
|
59
|
-
region: deployment.region
|
|
60
|
-
});
|
|
61
|
-
},
|
|
62
|
-
afterEach: async params => {
|
|
63
|
-
for (const plugin of storerAfterEachPlugins) {
|
|
64
|
-
if (!plugin.canHandle(params)) {
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
await plugin.handle(params);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
const transformHandler = new TransformHandler({
|
|
72
|
-
plugins: context.plugins
|
|
73
|
-
});
|
|
74
|
-
const recordHandler = createRecordHandler({
|
|
75
|
-
plugins: context.plugins,
|
|
76
|
-
fetcher,
|
|
77
|
-
storer,
|
|
78
|
-
deployments,
|
|
79
|
-
transformHandler,
|
|
80
|
-
commandBundler: createBundler({
|
|
81
|
-
createBundles: () => {
|
|
82
|
-
return createBundles({
|
|
83
|
-
createBundle: createCommandBundle
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}),
|
|
87
|
-
tableBundler: createBundler({
|
|
88
|
-
createBundles: () => {
|
|
89
|
-
return createBundles({
|
|
90
|
-
createBundle: createTableBundle
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
}),
|
|
94
|
-
createSourceDataContainer: () => {
|
|
95
|
-
return SourceDataContainer.create();
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
const app = createResolverApp({
|
|
99
|
-
recordHandler,
|
|
100
|
-
deployments
|
|
101
|
-
});
|
|
102
|
-
await app.resolve({
|
|
103
|
-
records: event.Records
|
|
104
|
-
});
|
|
105
|
-
return reply.send({
|
|
106
|
-
ok: true
|
|
107
|
-
});
|
|
108
|
-
} catch (ex) {
|
|
109
|
-
const error = convertException(ex);
|
|
110
|
-
console.error(error);
|
|
111
|
-
return reply.send({
|
|
112
|
-
error
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
plugin.name = `${SQSEventHandler.type}.syncResolver`;
|
|
117
|
-
return plugin;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
//# sourceMappingURL=createEventHandlerPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createEventHandler","createSQSEventHandler","createResolverApp","convertException","createRecordHandler","createFetcher","createDeploymentsFetcher","WebinyError","createBundler","createBundles","createCommandBundle","createTableBundle","TransformHandler","SQSEventHandler","createStorer","StorerAfterEachPlugin","SourceDataContainer","createEventHandlerPlugin","params","createDocumentClient","tableName","plugin","event","context","reply","message","fetcher","maxRetries","retryDelay","deployment","region","deploymentsFetcher","client","process","env","AWS_REGION","table","deployments","fetch","storerAfterEachPlugins","plugins","byType","type","storer","afterEach","canHandle","handle","transformHandler","recordHandler","commandBundler","createBundle","tableBundler","createSourceDataContainer","create","app","resolve","records","Records","send","ok","ex","error","console","name"],"sources":["createEventHandlerPlugin.ts"],"sourcesContent":["import { createEventHandler as createSQSEventHandler } from \"@webiny/handler-aws/sqs/index.js\";\nimport { createResolverApp } from \"./app/ResolverApplication.js\";\nimport { convertException } from \"@webiny/utils\";\nimport { createRecordHandler } from \"./app/RecordHandler.js\";\nimport { createFetcher } from \"~/resolver/app/fetcher/Fetcher.js\";\nimport { createDeploymentsFetcher } from \"~/resolver/deployment/DeploymentsFetcher.js\";\nimport { WebinyError } from \"@webiny/error\";\nimport type {\n DynamoDBClientConfig,\n DynamoDBDocument\n} from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { createBundler } from \"~/resolver/app/bundler/Bundler.js\";\nimport { createBundles } from \"~/resolver/app/bundler/Bundles.js\";\nimport { createCommandBundle } from \"~/resolver/app/bundler/CommandBundle.js\";\nimport { createTableBundle } from \"~/resolver/app/bundler/TableBundle.js\";\nimport { TransformHandler } from \"~/resolver/app/transform/TransformHandler.js\";\nimport type { Reply as FastifyReply } from \"@webiny/handler/types.js\";\nimport { SQSEventHandler } from \"@webiny/handler-aws/sqs/plugins/SQSEventHandler.js\";\nimport { createStorer } from \"./app/storer/Storer.js\";\nimport { StorerAfterEachPlugin } from \"./plugins/StorerAfterEachPlugin.js\";\nimport { SourceDataContainer } from \"~/resolver/app/data/SourceDataContainer.js\";\n\nexport interface ICreateEventHandlerPluginParams {\n tableName: string | undefined;\n createDocumentClient: (params: DynamoDBClientConfig) => Pick<DynamoDBDocument, \"send\">;\n}\n/**\n * TODO maybe add logger?\n */\nexport const createEventHandlerPlugin = (params: ICreateEventHandlerPluginParams) => {\n const { createDocumentClient, tableName } = params;\n\n const plugin = createSQSEventHandler(\n async ({ event, context, reply }): Promise<FastifyReply> => {\n if (!tableName) {\n throw new WebinyError({\n message: \"Table name variable is not set.\"\n });\n }\n try {\n const fetcher = createFetcher({\n maxRetries: 10,\n retryDelay: 1000,\n createDocumentClient: deployment => {\n return createDocumentClient({\n region: deployment.region\n });\n }\n });\n\n const deploymentsFetcher = createDeploymentsFetcher({\n client: createDocumentClient({\n region: process.env.AWS_REGION\n }),\n table: tableName\n });\n /**\n * Fetch all possible deployments, out of which we will filter out the deployment that the records came from.\n */\n const deployments = await deploymentsFetcher.fetch();\n\n const storerAfterEachPlugins = context.plugins.byType<StorerAfterEachPlugin>(\n StorerAfterEachPlugin.type\n );\n\n const storer = createStorer({\n createDocumentClient: deployment => {\n return createDocumentClient({\n region: deployment.region\n });\n },\n afterEach: async params => {\n for (const plugin of storerAfterEachPlugins) {\n if (!plugin.canHandle(params)) {\n continue;\n }\n await plugin.handle(params);\n }\n }\n });\n\n const transformHandler = new TransformHandler({\n plugins: context.plugins\n });\n\n const recordHandler = createRecordHandler({\n plugins: context.plugins,\n fetcher,\n storer,\n deployments,\n transformHandler,\n commandBundler: createBundler({\n createBundles: () => {\n return createBundles({\n createBundle: createCommandBundle\n });\n }\n }),\n tableBundler: createBundler({\n createBundles: () => {\n return createBundles({\n createBundle: createTableBundle\n });\n }\n }),\n createSourceDataContainer: () => {\n return SourceDataContainer.create();\n }\n });\n const app = createResolverApp({\n recordHandler,\n deployments\n });\n\n await app.resolve({\n records: event.Records\n });\n return reply.send({\n ok: true\n });\n } catch (ex) {\n const error = convertException(ex);\n console.error(error);\n return reply.send({\n error\n });\n }\n }\n );\n\n plugin.name = `${SQSEventHandler.type}.syncResolver`;\n\n return plugin;\n};\n"],"mappings":"AAAA,SAASA,kBAAkB,IAAIC,qBAAqB,QAAQ,kCAAkC;AAC9F,SAASC,iBAAiB;AAC1B,SAASC,gBAAgB,QAAQ,eAAe;AAChD,SAASC,mBAAmB;AAC5B,SAASC,aAAa;AACtB,SAASC,wBAAwB;AACjC,SAASC,WAAW,QAAQ,eAAe;AAK3C,SAASC,aAAa;AACtB,SAASC,aAAa;AACtB,SAASC,mBAAmB;AAC5B,SAASC,iBAAiB;AAC1B,SAASC,gBAAgB;AAEzB,SAASC,eAAe,QAAQ,oDAAoD;AACpF,SAASC,YAAY;AACrB,SAASC,qBAAqB;AAC9B,SAASC,mBAAmB;AAM5B;AACA;AACA;AACA,OAAO,MAAMC,wBAAwB,GAAIC,MAAuC,IAAK;EACjF,MAAM;IAAEC,oBAAoB;IAAEC;EAAU,CAAC,GAAGF,MAAM;EAElD,MAAMG,MAAM,GAAGpB,qBAAqB,CAChC,OAAO;IAAEqB,KAAK;IAAEC,OAAO;IAAEC;EAAM,CAAC,KAA4B;IACxD,IAAI,CAACJ,SAAS,EAAE;MACZ,MAAM,IAAIb,WAAW,CAAC;QAClBkB,OAAO,EAAE;MACb,CAAC,CAAC;IACN;IACA,IAAI;MACA,MAAMC,OAAO,GAAGrB,aAAa,CAAC;QAC1BsB,UAAU,EAAE,EAAE;QACdC,UAAU,EAAE,IAAI;QAChBT,oBAAoB,EAAEU,UAAU,IAAI;UAChC,OAAOV,oBAAoB,CAAC;YACxBW,MAAM,EAAED,UAAU,CAACC;UACvB,CAAC,CAAC;QACN;MACJ,CAAC,CAAC;MAEF,MAAMC,kBAAkB,GAAGzB,wBAAwB,CAAC;QAChD0B,MAAM,EAAEb,oBAAoB,CAAC;UACzBW,MAAM,EAAEG,OAAO,CAACC,GAAG,CAACC;QACxB,CAAC,CAAC;QACFC,KAAK,EAAEhB;MACX,CAAC,CAAC;MACF;AAChB;AACA;MACgB,MAAMiB,WAAW,GAAG,MAAMN,kBAAkB,CAACO,KAAK,CAAC,CAAC;MAEpD,MAAMC,sBAAsB,GAAGhB,OAAO,CAACiB,OAAO,CAACC,MAAM,CACjD1B,qBAAqB,CAAC2B,IAC1B,CAAC;MAED,MAAMC,MAAM,GAAG7B,YAAY,CAAC;QACxBK,oBAAoB,EAAEU,UAAU,IAAI;UAChC,OAAOV,oBAAoB,CAAC;YACxBW,MAAM,EAAED,UAAU,CAACC;UACvB,CAAC,CAAC;QACN,CAAC;QACDc,SAAS,EAAE,MAAM1B,MAAM,IAAI;UACvB,KAAK,MAAMG,MAAM,IAAIkB,sBAAsB,EAAE;YACzC,IAAI,CAAClB,MAAM,CAACwB,SAAS,CAAC3B,MAAM,CAAC,EAAE;cAC3B;YACJ;YACA,MAAMG,MAAM,CAACyB,MAAM,CAAC5B,MAAM,CAAC;UAC/B;QACJ;MACJ,CAAC,CAAC;MAEF,MAAM6B,gBAAgB,GAAG,IAAInC,gBAAgB,CAAC;QAC1C4B,OAAO,EAAEjB,OAAO,CAACiB;MACrB,CAAC,CAAC;MAEF,MAAMQ,aAAa,GAAG5C,mBAAmB,CAAC;QACtCoC,OAAO,EAAEjB,OAAO,CAACiB,OAAO;QACxBd,OAAO;QACPiB,MAAM;QACNN,WAAW;QACXU,gBAAgB;QAChBE,cAAc,EAAEzC,aAAa,CAAC;UAC1BC,aAAa,EAAEA,CAAA,KAAM;YACjB,OAAOA,aAAa,CAAC;cACjByC,YAAY,EAAExC;YAClB,CAAC,CAAC;UACN;QACJ,CAAC,CAAC;QACFyC,YAAY,EAAE3C,aAAa,CAAC;UACxBC,aAAa,EAAEA,CAAA,KAAM;YACjB,OAAOA,aAAa,CAAC;cACjByC,YAAY,EAAEvC;YAClB,CAAC,CAAC;UACN;QACJ,CAAC,CAAC;QACFyC,yBAAyB,EAAEA,CAAA,KAAM;UAC7B,OAAOpC,mBAAmB,CAACqC,MAAM,CAAC,CAAC;QACvC;MACJ,CAAC,CAAC;MACF,MAAMC,GAAG,GAAGpD,iBAAiB,CAAC;QAC1B8C,aAAa;QACbX;MACJ,CAAC,CAAC;MAEF,MAAMiB,GAAG,CAACC,OAAO,CAAC;QACdC,OAAO,EAAElC,KAAK,CAACmC;MACnB,CAAC,CAAC;MACF,OAAOjC,KAAK,CAACkC,IAAI,CAAC;QACdC,EAAE,EAAE;MACR,CAAC,CAAC;IACN,CAAC,CAAC,OAAOC,EAAE,EAAE;MACT,MAAMC,KAAK,GAAG1D,gBAAgB,CAACyD,EAAE,CAAC;MAClCE,OAAO,CAACD,KAAK,CAACA,KAAK,CAAC;MACpB,OAAOrC,KAAK,CAACkC,IAAI,CAAC;QACdG;MACJ,CAAC,CAAC;IACN;EACJ,CACJ,CAAC;EAEDxC,MAAM,CAAC0C,IAAI,GAAG,GAAGlD,eAAe,CAAC6B,IAAI,eAAe;EAEpD,OAAOrB,MAAM;AACjB,CAAC","ignoreList":[]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { HandlerCallable, HandlerParams } from "@webiny/handler-aws/sqs/index.js";
|
|
2
|
-
import type { TransformRecordPlugin } from "./plugins/TransformRecordPlugin.js";
|
|
3
|
-
import type { CommandHandlerPlugin } from "./plugins/CommandHandlerPlugin.js";
|
|
4
|
-
import type { DynamoDBClientConfig, DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
5
|
-
import type { LambdaClient, LambdaClientConfig } from "@webiny/aws-sdk/client-lambda/index.js";
|
|
6
|
-
import type { S3Client, S3ClientConfig } from "@webiny/aws-sdk/client-s3/index.js";
|
|
7
|
-
import type { CognitoIdentityProviderClient, CognitoIdentityProviderClientConfig } from "@webiny/aws-sdk/client-cognito-identity-provider/index.js";
|
|
8
|
-
export type AllowedResolverPlugins = TransformRecordPlugin | CommandHandlerPlugin;
|
|
9
|
-
export interface ICreateResolverHandlerParams extends HandlerParams {
|
|
10
|
-
plugins: AllowedResolverPlugins[];
|
|
11
|
-
createS3Client: (params: S3ClientConfig) => Pick<S3Client, "send">;
|
|
12
|
-
createLambdaClient: (config: Partial<LambdaClientConfig>) => Pick<LambdaClient, "send">;
|
|
13
|
-
createDocumentClient: (params: Partial<DynamoDBClientConfig>) => Pick<DynamoDBDocument, "send">;
|
|
14
|
-
createCognitoIdentityProviderClient: (config: Partial<CognitoIdentityProviderClientConfig>) => Pick<CognitoIdentityProviderClient, "send">;
|
|
15
|
-
tableName?: string;
|
|
16
|
-
awsWorkerLambdaArn?: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Handler for the Sync System Resolver - based on SQS handler.
|
|
20
|
-
*/
|
|
21
|
-
export declare const createResolverHandler: (params: ICreateResolverHandlerParams) => HandlerCallable;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { createHandler as createSQSHandler } from "@webiny/handler-aws/sqs/index.js";
|
|
2
|
-
import { PluginsContainer } from "@webiny/plugins";
|
|
3
|
-
import { createEventHandlerPlugin } from "./createEventHandlerPlugin.js";
|
|
4
|
-
import { createPutCommandHandlerPlugin } from "./app/commandHandler/put.js";
|
|
5
|
-
import { createDeleteCommandHandlerPlugin } from "./app/commandHandler/delete.js";
|
|
6
|
-
import { createFileManagerPlugins } from "./recordTypes/fileManager/fileManager.js";
|
|
7
|
-
import { LambdaTrigger } from "./lambda/LambdaTrigger.js";
|
|
8
|
-
import { CopyFile } from "./recordTypes/fileManager/CopyFile.js";
|
|
9
|
-
import { DeleteFile } from "./recordTypes/fileManager/DeleteFile.js";
|
|
10
|
-
import { createUsersPlugins } from "./recordTypes/users/users.js";
|
|
11
|
-
import { CopyUser } from "./recordTypes/users/CopyUser.js";
|
|
12
|
-
import { DeleteUser } from "./recordTypes/users/DeleteUser.js";
|
|
13
|
-
/**
|
|
14
|
-
* Handler for the Sync System Resolver - based on SQS handler.
|
|
15
|
-
*/
|
|
16
|
-
export const createResolverHandler = params => {
|
|
17
|
-
const awsWorkerLambdaArn = params.awsWorkerLambdaArn || process.env.AWS_SYNC_WORKER_LAMBDA_ARN;
|
|
18
|
-
if (!awsWorkerLambdaArn) {
|
|
19
|
-
const message = `Missing "process.env.AWS_SYNC_WORKER_LAMBDA_ARN".`;
|
|
20
|
-
console.error(message);
|
|
21
|
-
throw new Error(message);
|
|
22
|
-
}
|
|
23
|
-
const lambdaTrigger = new LambdaTrigger({
|
|
24
|
-
arn: awsWorkerLambdaArn,
|
|
25
|
-
createLambdaClient: params.createLambdaClient
|
|
26
|
-
});
|
|
27
|
-
const copyFile = new CopyFile({
|
|
28
|
-
createS3Client: params.createS3Client,
|
|
29
|
-
getLambdaTrigger: () => {
|
|
30
|
-
return lambdaTrigger;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
const deleteFile = new DeleteFile({
|
|
34
|
-
createS3Client: params.createS3Client,
|
|
35
|
-
getLambdaTrigger: () => {
|
|
36
|
-
return lambdaTrigger;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
const copyUser = new CopyUser({
|
|
40
|
-
createCognitoIdentityProviderClient: params.createCognitoIdentityProviderClient,
|
|
41
|
-
getLambdaTrigger: () => {
|
|
42
|
-
return lambdaTrigger;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
const deleteUser = new DeleteUser({
|
|
46
|
-
createCognitoIdentityProviderClient: params.createCognitoIdentityProviderClient,
|
|
47
|
-
getLambdaTrigger: () => {
|
|
48
|
-
return lambdaTrigger;
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
const plugins = new PluginsContainer([
|
|
52
|
-
// TODO move into related packages
|
|
53
|
-
createFileManagerPlugins({
|
|
54
|
-
copyFile,
|
|
55
|
-
deleteFile
|
|
56
|
-
}), createUsersPlugins({
|
|
57
|
-
copyUser,
|
|
58
|
-
deleteUser
|
|
59
|
-
}),
|
|
60
|
-
// leave here
|
|
61
|
-
createEventHandlerPlugin({
|
|
62
|
-
createDocumentClient: params.createDocumentClient,
|
|
63
|
-
tableName: params.tableName || process.env.DB_TABLE
|
|
64
|
-
}), createPutCommandHandlerPlugin(), createDeleteCommandHandlerPlugin()]);
|
|
65
|
-
plugins.register(params.plugins);
|
|
66
|
-
return createSQSHandler({
|
|
67
|
-
...params,
|
|
68
|
-
plugins
|
|
69
|
-
});
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
//# sourceMappingURL=createResolverHandler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createHandler","createSQSHandler","PluginsContainer","createEventHandlerPlugin","createPutCommandHandlerPlugin","createDeleteCommandHandlerPlugin","createFileManagerPlugins","LambdaTrigger","CopyFile","DeleteFile","createUsersPlugins","CopyUser","DeleteUser","createResolverHandler","params","awsWorkerLambdaArn","process","env","AWS_SYNC_WORKER_LAMBDA_ARN","message","console","error","Error","lambdaTrigger","arn","createLambdaClient","copyFile","createS3Client","getLambdaTrigger","deleteFile","copyUser","createCognitoIdentityProviderClient","deleteUser","plugins","createDocumentClient","tableName","DB_TABLE","register"],"sources":["createResolverHandler.ts"],"sourcesContent":["import type { HandlerCallable, HandlerParams } from \"@webiny/handler-aws/sqs/index.js\";\nimport { createHandler as createSQSHandler } from \"@webiny/handler-aws/sqs/index.js\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { createEventHandlerPlugin } from \"./createEventHandlerPlugin.js\";\nimport type { TransformRecordPlugin } from \"./plugins/TransformRecordPlugin.js\";\nimport type { CommandHandlerPlugin } from \"./plugins/CommandHandlerPlugin.js\";\nimport { createPutCommandHandlerPlugin } from \"./app/commandHandler/put.js\";\nimport { createDeleteCommandHandlerPlugin } from \"./app/commandHandler/delete.js\";\nimport type {\n DynamoDBClientConfig,\n DynamoDBDocument\n} from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { createFileManagerPlugins } from \"./recordTypes/fileManager/fileManager.js\";\nimport { LambdaTrigger } from \"./lambda/LambdaTrigger.js\";\nimport type { LambdaClient, LambdaClientConfig } from \"@webiny/aws-sdk/client-lambda/index.js\";\nimport type { S3Client, S3ClientConfig } from \"@webiny/aws-sdk/client-s3/index.js\";\nimport { CopyFile } from \"~/resolver/recordTypes/fileManager/CopyFile.js\";\nimport { DeleteFile } from \"./recordTypes/fileManager/DeleteFile.js\";\nimport { createUsersPlugins } from \"~/resolver/recordTypes/users/users.js\";\nimport { CopyUser } from \"./recordTypes/users/CopyUser.js\";\nimport type {\n CognitoIdentityProviderClient,\n CognitoIdentityProviderClientConfig\n} from \"@webiny/aws-sdk/client-cognito-identity-provider/index.js\";\nimport { DeleteUser } from \"./recordTypes/users/DeleteUser.js\";\n\nexport type AllowedResolverPlugins = TransformRecordPlugin | CommandHandlerPlugin;\n\nexport interface ICreateResolverHandlerParams extends HandlerParams {\n plugins: AllowedResolverPlugins[];\n createS3Client: (params: S3ClientConfig) => Pick<S3Client, \"send\">;\n createLambdaClient: (config: Partial<LambdaClientConfig>) => Pick<LambdaClient, \"send\">;\n createDocumentClient: (params: Partial<DynamoDBClientConfig>) => Pick<DynamoDBDocument, \"send\">;\n createCognitoIdentityProviderClient: (\n config: Partial<CognitoIdentityProviderClientConfig>\n ) => Pick<CognitoIdentityProviderClient, \"send\">;\n tableName?: string;\n awsWorkerLambdaArn?: string;\n}\n/**\n * Handler for the Sync System Resolver - based on SQS handler.\n */\nexport const createResolverHandler = (params: ICreateResolverHandlerParams): HandlerCallable => {\n const awsWorkerLambdaArn = params.awsWorkerLambdaArn || process.env.AWS_SYNC_WORKER_LAMBDA_ARN;\n if (!awsWorkerLambdaArn) {\n const message = `Missing \"process.env.AWS_SYNC_WORKER_LAMBDA_ARN\".`;\n console.error(message);\n throw new Error(message);\n }\n\n const lambdaTrigger = new LambdaTrigger({\n arn: awsWorkerLambdaArn,\n createLambdaClient: params.createLambdaClient\n });\n\n const copyFile = new CopyFile({\n createS3Client: params.createS3Client,\n getLambdaTrigger: () => {\n return lambdaTrigger;\n }\n });\n const deleteFile = new DeleteFile({\n createS3Client: params.createS3Client,\n getLambdaTrigger: () => {\n return lambdaTrigger;\n }\n });\n\n const copyUser = new CopyUser({\n createCognitoIdentityProviderClient: params.createCognitoIdentityProviderClient,\n getLambdaTrigger: () => {\n return lambdaTrigger;\n }\n });\n const deleteUser = new DeleteUser({\n createCognitoIdentityProviderClient: params.createCognitoIdentityProviderClient,\n getLambdaTrigger: () => {\n return lambdaTrigger;\n }\n });\n\n const plugins = new PluginsContainer([\n // TODO move into related packages\n createFileManagerPlugins({\n copyFile,\n deleteFile\n }),\n createUsersPlugins({\n copyUser,\n deleteUser\n }),\n // leave here\n createEventHandlerPlugin({\n createDocumentClient: params.createDocumentClient,\n tableName: params.tableName || process.env.DB_TABLE\n }),\n createPutCommandHandlerPlugin(),\n createDeleteCommandHandlerPlugin()\n ]);\n\n plugins.register(params.plugins);\n\n return createSQSHandler({\n ...params,\n plugins\n });\n};\n"],"mappings":"AACA,SAASA,aAAa,IAAIC,gBAAgB,QAAQ,kCAAkC;AACpF,SAASC,gBAAgB,QAAQ,iBAAiB;AAClD,SAASC,wBAAwB;AAGjC,SAASC,6BAA6B;AACtC,SAASC,gCAAgC;AAKzC,SAASC,wBAAwB;AACjC,SAASC,aAAa;AAGtB,SAASC,QAAQ;AACjB,SAASC,UAAU;AACnB,SAASC,kBAAkB;AAC3B,SAASC,QAAQ;AAKjB,SAASC,UAAU;AAenB;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,GAAIC,MAAoC,IAAsB;EAC5F,MAAMC,kBAAkB,GAAGD,MAAM,CAACC,kBAAkB,IAAIC,OAAO,CAACC,GAAG,CAACC,0BAA0B;EAC9F,IAAI,CAACH,kBAAkB,EAAE;IACrB,MAAMI,OAAO,GAAG,mDAAmD;IACnEC,OAAO,CAACC,KAAK,CAACF,OAAO,CAAC;IACtB,MAAM,IAAIG,KAAK,CAACH,OAAO,CAAC;EAC5B;EAEA,MAAMI,aAAa,GAAG,IAAIhB,aAAa,CAAC;IACpCiB,GAAG,EAAET,kBAAkB;IACvBU,kBAAkB,EAAEX,MAAM,CAACW;EAC/B,CAAC,CAAC;EAEF,MAAMC,QAAQ,GAAG,IAAIlB,QAAQ,CAAC;IAC1BmB,cAAc,EAAEb,MAAM,CAACa,cAAc;IACrCC,gBAAgB,EAAEA,CAAA,KAAM;MACpB,OAAOL,aAAa;IACxB;EACJ,CAAC,CAAC;EACF,MAAMM,UAAU,GAAG,IAAIpB,UAAU,CAAC;IAC9BkB,cAAc,EAAEb,MAAM,CAACa,cAAc;IACrCC,gBAAgB,EAAEA,CAAA,KAAM;MACpB,OAAOL,aAAa;IACxB;EACJ,CAAC,CAAC;EAEF,MAAMO,QAAQ,GAAG,IAAInB,QAAQ,CAAC;IAC1BoB,mCAAmC,EAAEjB,MAAM,CAACiB,mCAAmC;IAC/EH,gBAAgB,EAAEA,CAAA,KAAM;MACpB,OAAOL,aAAa;IACxB;EACJ,CAAC,CAAC;EACF,MAAMS,UAAU,GAAG,IAAIpB,UAAU,CAAC;IAC9BmB,mCAAmC,EAAEjB,MAAM,CAACiB,mCAAmC;IAC/EH,gBAAgB,EAAEA,CAAA,KAAM;MACpB,OAAOL,aAAa;IACxB;EACJ,CAAC,CAAC;EAEF,MAAMU,OAAO,GAAG,IAAI/B,gBAAgB,CAAC;EACjC;EACAI,wBAAwB,CAAC;IACrBoB,QAAQ;IACRG;EACJ,CAAC,CAAC,EACFnB,kBAAkB,CAAC;IACfoB,QAAQ;IACRE;EACJ,CAAC,CAAC;EACF;EACA7B,wBAAwB,CAAC;IACrB+B,oBAAoB,EAAEpB,MAAM,CAACoB,oBAAoB;IACjDC,SAAS,EAAErB,MAAM,CAACqB,SAAS,IAAInB,OAAO,CAACC,GAAG,CAACmB;EAC/C,CAAC,CAAC,EACFhC,6BAA6B,CAAC,CAAC,EAC/BC,gCAAgC,CAAC,CAAC,CACrC,CAAC;EAEF4B,OAAO,CAACI,QAAQ,CAACvB,MAAM,CAACmB,OAAO,CAAC;EAEhC,OAAOhC,gBAAgB,CAAC;IACpB,GAAGa,MAAM;IACTmB;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { DynamoDBTableType } from \"~/types.js\";\nimport type { SemVer } from \"semver\";\nimport type { ITable } from \"~/sync/types.js\";\n\nexport interface IDeploymentServices {\n s3Id: string;\n s3Arn: string;\n primaryDynamoDbArn: string;\n primaryDynamoDbName: string;\n primaryDynamoDbHashKey: string;\n primaryDynamoDbRangeKey: string;\n opensearchDynamodbTableArn?: string;\n opensearchDynamodbTableName?: string;\n logDynamodbTableArn: string;\n logDynamodbTableName: string;\n cognitoUserPoolId: string;\n}\n\nexport interface IDeployment<S = IDeploymentServices> {\n name: string;\n env: string;\n variant: string | undefined;\n region: string;\n services: S;\n version: SemVer;\n getTable(type: DynamoDBTableType): ITable;\n}\n\nexport interface IDeployments {\n hasAny(): boolean;\n all(): IDeployment[];\n get(name: string): IDeployment | null;\n without(deployment: Pick<IDeployment, \"name\">): IDeployments;\n}\n\nexport interface IDeploymentsFetcher {\n fetch(): Promise<IDeployments>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { LambdaTrigger } from \"~/resolver/lambda/LambdaTrigger.js\";\nimport type { S3Client, S3ClientConfig } from \"@webiny/aws-sdk/client-s3/index.js\";\nimport type { IDeployment } from \"~/resolver/deployment/types.js\";\nimport type { InvokeCommandOutput } from \"@webiny/aws-sdk/client-lambda/index.js\";\n\nexport interface IGetLambdaTriggerCb<T> {\n (): LambdaTrigger<T>;\n}\n\nexport interface ICreateS3ClientCb {\n (params: S3ClientConfig): Pick<S3Client, \"send\">;\n}\n\nexport interface ICopyFileHandleParams {\n key: string;\n source: IDeployment;\n target: IDeployment;\n}\n\nexport interface ICopyFile {\n handle(params: ICopyFileHandleParams): Promise<InvokeCommandOutput | null>;\n}\n\nexport interface IDeleteFileHandleParams {\n key: string;\n source: IDeployment;\n target: IDeployment;\n}\n\nexport interface IDeleteFile {\n handle(params: IDeleteFileHandleParams): Promise<InvokeCommandOutput | null>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { IDeployment } from \"~/resolver/deployment/types.js\";\nimport type {\n CognitoIdentityProviderClient,\n CognitoIdentityProviderClientConfig\n} from \"@webiny/aws-sdk/client-cognito-identity-provider/index.js\";\nimport type { InvokeCommandOutput } from \"@webiny/aws-sdk/client-lambda/index.js\";\n\nexport interface IUserDeploymentServices {\n cognitoUserPoolId: string;\n}\n\nexport interface ICopyUserHandleParams {\n username: string;\n source: Pick<IDeployment<IUserDeploymentServices>, \"region\" | \"services\">;\n target: Pick<IDeployment<IUserDeploymentServices>, \"region\" | \"services\">;\n}\n\nexport interface ICopyUser {\n handle(params: ICopyUserHandleParams): Promise<InvokeCommandOutput | null>;\n}\n\nexport interface IDeleteUserHandleParams {\n username: string;\n target: Pick<IDeployment<IUserDeploymentServices>, \"region\" | \"services\">;\n}\n\nexport interface IDeleteUser {\n handle(params: IDeleteUserHandleParams): Promise<InvokeCommandOutput | null>;\n}\n\nexport interface ICreateCognitoIdentityProviderClientCb {\n (\n config: Partial<CognitoIdentityProviderClientConfig>\n ): Pick<CognitoIdentityProviderClient, \"send\">;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { createOnRequestResponseSend, createOnRequestTimeout } from "@webiny/handler";
|
|
2
|
-
import { convertException } from "@webiny/utils/exception.js";
|
|
3
|
-
const execute = async handler => {
|
|
4
|
-
try {
|
|
5
|
-
return await handler.flush();
|
|
6
|
-
} catch (ex) {
|
|
7
|
-
const error = convertException(ex);
|
|
8
|
-
console.error({
|
|
9
|
-
flushError: error
|
|
10
|
-
});
|
|
11
|
-
return {
|
|
12
|
-
error
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* We do not want to throw an error here, because we are in the request end.
|
|
16
|
-
*/
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
const isOptionsRequest = request => {
|
|
20
|
-
if (!request?.method) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
return request.method.toUpperCase() === "OPTIONS";
|
|
24
|
-
};
|
|
25
|
-
export const createSendDataToEventBridgeOnRequestEnd = handler => {
|
|
26
|
-
const onRequestResponseSend = createOnRequestResponseSend(async (request, _, payload) => {
|
|
27
|
-
if (isOptionsRequest(request)) {
|
|
28
|
-
return payload;
|
|
29
|
-
}
|
|
30
|
-
await execute(handler);
|
|
31
|
-
return payload;
|
|
32
|
-
});
|
|
33
|
-
onRequestResponseSend.name = "sync.onRequestResponseSend";
|
|
34
|
-
const onRequestTimeout = createOnRequestTimeout(async request => {
|
|
35
|
-
if (isOptionsRequest(request)) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
return await execute(handler);
|
|
39
|
-
});
|
|
40
|
-
onRequestTimeout.name = "sync.onRequestTimeout";
|
|
41
|
-
return [onRequestResponseSend, onRequestTimeout];
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
//# sourceMappingURL=createSendDataToEventBridgeOnRequestEnd.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createOnRequestResponseSend","createOnRequestTimeout","convertException","execute","handler","flush","ex","error","console","flushError","isOptionsRequest","request","method","toUpperCase","createSendDataToEventBridgeOnRequestEnd","onRequestResponseSend","_","payload","name","onRequestTimeout"],"sources":["createSendDataToEventBridgeOnRequestEnd.ts"],"sourcesContent":["import type { IHandler } from \"./types.js\";\nimport { createOnRequestResponseSend, createOnRequestTimeout } from \"@webiny/handler\";\nimport type { Request as FastifyRequest } from \"@webiny/handler/types.js\";\nimport { convertException } from \"@webiny/utils/exception.js\";\n\nconst execute = async (handler: IHandler) => {\n try {\n return await handler.flush();\n } catch (ex) {\n const error = convertException(ex);\n console.error({\n flushError: error\n });\n return {\n error\n };\n /**\n * We do not want to throw an error here, because we are in the request end.\n */\n }\n};\n\nconst isOptionsRequest = (request: FastifyRequest): boolean => {\n if (!request?.method) {\n return false;\n }\n return request.method.toUpperCase() === \"OPTIONS\";\n};\n\nexport const createSendDataToEventBridgeOnRequestEnd = (handler: IHandler) => {\n const onRequestResponseSend = createOnRequestResponseSend(async (request, _, payload) => {\n if (isOptionsRequest(request)) {\n return payload;\n }\n await execute(handler);\n return payload;\n });\n onRequestResponseSend.name = \"sync.onRequestResponseSend\";\n\n const onRequestTimeout = createOnRequestTimeout(async request => {\n if (isOptionsRequest(request)) {\n return;\n }\n return await execute(handler);\n });\n onRequestTimeout.name = \"sync.onRequestTimeout\";\n\n return [onRequestResponseSend, onRequestTimeout];\n};\n"],"mappings":"AACA,SAASA,2BAA2B,EAAEC,sBAAsB,QAAQ,iBAAiB;AAErF,SAASC,gBAAgB,QAAQ,4BAA4B;AAE7D,MAAMC,OAAO,GAAG,MAAOC,OAAiB,IAAK;EACzC,IAAI;IACA,OAAO,MAAMA,OAAO,CAACC,KAAK,CAAC,CAAC;EAChC,CAAC,CAAC,OAAOC,EAAE,EAAE;IACT,MAAMC,KAAK,GAAGL,gBAAgB,CAACI,EAAE,CAAC;IAClCE,OAAO,CAACD,KAAK,CAAC;MACVE,UAAU,EAAEF;IAChB,CAAC,CAAC;IACF,OAAO;MACHA;IACJ,CAAC;IACD;AACR;AACA;EACI;AACJ,CAAC;AAED,MAAMG,gBAAgB,GAAIC,OAAuB,IAAc;EAC3D,IAAI,CAACA,OAAO,EAAEC,MAAM,EAAE;IAClB,OAAO,KAAK;EAChB;EACA,OAAOD,OAAO,CAACC,MAAM,CAACC,WAAW,CAAC,CAAC,KAAK,SAAS;AACrD,CAAC;AAED,OAAO,MAAMC,uCAAuC,GAAIV,OAAiB,IAAK;EAC1E,MAAMW,qBAAqB,GAAGf,2BAA2B,CAAC,OAAOW,OAAO,EAAEK,CAAC,EAAEC,OAAO,KAAK;IACrF,IAAIP,gBAAgB,CAACC,OAAO,CAAC,EAAE;MAC3B,OAAOM,OAAO;IAClB;IACA,MAAMd,OAAO,CAACC,OAAO,CAAC;IACtB,OAAOa,OAAO;EAClB,CAAC,CAAC;EACFF,qBAAqB,CAACG,IAAI,GAAG,4BAA4B;EAEzD,MAAMC,gBAAgB,GAAGlB,sBAAsB,CAAC,MAAMU,OAAO,IAAI;IAC7D,IAAID,gBAAgB,CAACC,OAAO,CAAC,EAAE;MAC3B;IACJ;IACA,OAAO,MAAMR,OAAO,CAACC,OAAO,CAAC;EACjC,CAAC,CAAC;EACFe,gBAAgB,CAACD,IAAI,GAAG,uBAAuB;EAE/C,OAAO,CAACH,qBAAqB,EAAEI,gBAAgB,CAAC;AACpD,CAAC","ignoreList":[]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from "@webiny/plugins/types.js";
|
|
2
|
-
import type { IGetEventBridgeCallable, ISystem } from "./types.js";
|
|
3
|
-
import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
4
|
-
import type { PossiblyUndefinedProperties } from "@webiny/api/types.js";
|
|
5
|
-
import type { FilterOutRecordPlugin } from "./plugins/FilterOutRecordPlugin.js";
|
|
6
|
-
export type IAllowedPlugins = FilterOutRecordPlugin;
|
|
7
|
-
export interface ICreateSyncSystemParams {
|
|
8
|
-
getDocumentClient(): Pick<DynamoDBDocument, "send">;
|
|
9
|
-
getEventBridgeClient: IGetEventBridgeCallable;
|
|
10
|
-
system: PossiblyUndefinedProperties<Omit<ISystem, "name">>;
|
|
11
|
-
plugins?: IAllowedPlugins[];
|
|
12
|
-
}
|
|
13
|
-
export interface ICreateSyncSystemResponse {
|
|
14
|
-
plugins(): Plugin[];
|
|
15
|
-
}
|
|
16
|
-
export declare const createSyncSystem: (params: ICreateSyncSystemParams) => ICreateSyncSystemResponse;
|
package/sync/createSyncSystem.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { validateSystemInput } from "./utils/validateSystemInput.js";
|
|
2
|
-
import { createSyncSystemHandlerOnRequestPlugin } from "./requestPlugin.js";
|
|
3
|
-
import { createDefaultFilterOutRecordPlugins } from "./filter/createDefaultFilterOutRecordPlugins.js";
|
|
4
|
-
const emptyResponse = {
|
|
5
|
-
plugins() {
|
|
6
|
-
return [];
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
export const createSyncSystem = params => {
|
|
10
|
-
const {
|
|
11
|
-
system,
|
|
12
|
-
error
|
|
13
|
-
} = validateSystemInput(params.system);
|
|
14
|
-
/**
|
|
15
|
-
* We do not want to throw any errors. We will log them and just return a function which returns empty array as plugins.
|
|
16
|
-
*/
|
|
17
|
-
if (error) {
|
|
18
|
-
console.error(error);
|
|
19
|
-
return emptyResponse;
|
|
20
|
-
} else if (!system) {
|
|
21
|
-
console.error("Sync System: No system provided. Sync System will not be attached.");
|
|
22
|
-
return emptyResponse;
|
|
23
|
-
}
|
|
24
|
-
return {
|
|
25
|
-
plugins: () => {
|
|
26
|
-
return [...(params.plugins || []), ...createDefaultFilterOutRecordPlugins(), createSyncSystemHandlerOnRequestPlugin({
|
|
27
|
-
getDocumentClient: params.getDocumentClient,
|
|
28
|
-
getEventBridgeClient: params.getEventBridgeClient,
|
|
29
|
-
system
|
|
30
|
-
})];
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
//# sourceMappingURL=createSyncSystem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["validateSystemInput","createSyncSystemHandlerOnRequestPlugin","createDefaultFilterOutRecordPlugins","emptyResponse","plugins","createSyncSystem","params","system","error","console","getDocumentClient","getEventBridgeClient"],"sources":["createSyncSystem.ts"],"sourcesContent":["import type { Plugin } from \"@webiny/plugins/types.js\";\nimport type { IGetEventBridgeCallable, ISystem } from \"./types.js\";\nimport { validateSystemInput } from \"./utils/validateSystemInput.js\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { PossiblyUndefinedProperties } from \"@webiny/api/types.js\";\nimport { createSyncSystemHandlerOnRequestPlugin } from \"./requestPlugin.js\";\nimport type { FilterOutRecordPlugin } from \"./plugins/FilterOutRecordPlugin.js\";\nimport { createDefaultFilterOutRecordPlugins } from \"./filter/createDefaultFilterOutRecordPlugins.js\";\n\nexport type IAllowedPlugins = FilterOutRecordPlugin;\n\nexport interface ICreateSyncSystemParams {\n getDocumentClient(): Pick<DynamoDBDocument, \"send\">;\n getEventBridgeClient: IGetEventBridgeCallable;\n system: PossiblyUndefinedProperties<Omit<ISystem, \"name\">>;\n plugins?: IAllowedPlugins[];\n}\n\nexport interface ICreateSyncSystemResponse {\n plugins(): Plugin[];\n}\n\nconst emptyResponse: ICreateSyncSystemResponse = {\n plugins(): Plugin[] {\n return [];\n }\n};\n\nexport const createSyncSystem = (params: ICreateSyncSystemParams): ICreateSyncSystemResponse => {\n const { system, error } = validateSystemInput(params.system);\n /**\n * We do not want to throw any errors. We will log them and just return a function which returns empty array as plugins.\n */\n if (error) {\n console.error(error);\n return emptyResponse;\n } else if (!system) {\n console.error(\"Sync System: No system provided. Sync System will not be attached.\");\n return emptyResponse;\n }\n\n return {\n plugins: () => {\n return [\n ...(params.plugins || []),\n ...createDefaultFilterOutRecordPlugins(),\n createSyncSystemHandlerOnRequestPlugin({\n getDocumentClient: params.getDocumentClient,\n getEventBridgeClient: params.getEventBridgeClient,\n system\n })\n ];\n }\n };\n};\n"],"mappings":"AAEA,SAASA,mBAAmB;AAG5B,SAASC,sCAAsC;AAE/C,SAASC,mCAAmC;AAe5C,MAAMC,aAAwC,GAAG;EAC7CC,OAAOA,CAAA,EAAa;IAChB,OAAO,EAAE;EACb;AACJ,CAAC;AAED,OAAO,MAAMC,gBAAgB,GAAIC,MAA+B,IAAgC;EAC5F,MAAM;IAAEC,MAAM;IAAEC;EAAM,CAAC,GAAGR,mBAAmB,CAACM,MAAM,CAACC,MAAM,CAAC;EAC5D;AACJ;AACA;EACI,IAAIC,KAAK,EAAE;IACPC,OAAO,CAACD,KAAK,CAACA,KAAK,CAAC;IACpB,OAAOL,aAAa;EACxB,CAAC,MAAM,IAAI,CAACI,MAAM,EAAE;IAChBE,OAAO,CAACD,KAAK,CAAC,oEAAoE,CAAC;IACnF,OAAOL,aAAa;EACxB;EAEA,OAAO;IACHC,OAAO,EAAEA,CAAA,KAAM;MACX,OAAO,CACH,IAAIE,MAAM,CAACF,OAAO,IAAI,EAAE,CAAC,EACzB,GAAGF,mCAAmC,CAAC,CAAC,EACxCD,sCAAsC,CAAC;QACnCS,iBAAiB,EAAEJ,MAAM,CAACI,iBAAiB;QAC3CC,oBAAoB,EAAEL,MAAM,CAACK,oBAAoB;QACjDJ;MACJ,CAAC,CAAC,CACL;IACL;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { NonEmptyArray } from \"@webiny/api/types.js\";\nimport type { DynamoDBTableType, ExtendedCommandType } from \"~/types.js\";\nimport type { ISystem } from \"../types.js\";\n\nexport interface IDetailItem {\n PK: string;\n SK: string;\n command: ExtendedCommandType;\n /**\n * There will be multiple tables that will get populated through the system (regular table and opensearch for start).\n */\n tableName: string;\n tableType: DynamoDBTableType;\n}\n\nexport interface IDetail {\n items: NonEmptyArray<IDetailItem>;\n source: ISystem;\n id: string;\n}\n"],"mappings":"","ignoreList":[]}
|
package/sync/requestPlugin.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
2
|
-
import type { ICommandConverter, IGetEventBridgeCallable, ISystem } from "../sync/types.js";
|
|
3
|
-
export interface ICreateSyncSystemHandlerOnRequestPluginParams {
|
|
4
|
-
getDocumentClient(): Pick<DynamoDBDocument, "send">;
|
|
5
|
-
getEventBridgeClient: IGetEventBridgeCallable;
|
|
6
|
-
system: ISystem;
|
|
7
|
-
commandConverters?: ICommandConverter[];
|
|
8
|
-
}
|
|
9
|
-
export declare const createSyncSystemHandlerOnRequestPlugin: (params: ICreateSyncSystemHandlerOnRequestPluginParams) => import("@webiny/handler").HandlerOnRequestPlugin<import("@webiny/handler/types.js").Context>;
|
package/sync/requestPlugin.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { createHandlerOnRequest } from "@webiny/handler";
|
|
2
|
-
import { getManifest } from "./utils/manifest.js";
|
|
3
|
-
import { attachToDynamoDbDocument } from "./attachToDynamoDbDocument.js";
|
|
4
|
-
import { createSendDataToEventBridgeOnRequestEnd } from "./createSendDataToEventBridgeOnRequestEnd.js";
|
|
5
|
-
import { createHandler } from "./createHandler.js";
|
|
6
|
-
import { convertException } from "@webiny/utils/exception.js";
|
|
7
|
-
export const createSyncSystemHandlerOnRequestPlugin = params => {
|
|
8
|
-
return createHandlerOnRequest(async (_, __, context) => {
|
|
9
|
-
const {
|
|
10
|
-
data: manifest,
|
|
11
|
-
error
|
|
12
|
-
} = await getManifest(params);
|
|
13
|
-
if (error) {
|
|
14
|
-
if (process.env.DEBUG !== "true") {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
console.error("Error happened when fetching manifest.");
|
|
18
|
-
console.log(JSON.stringify({
|
|
19
|
-
error: convertException(error)
|
|
20
|
-
}));
|
|
21
|
-
return;
|
|
22
|
-
} else if (!manifest?.sync?.region) {
|
|
23
|
-
if (process.env.DEBUG !== "true") {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
console.error("There is no manifest.");
|
|
27
|
-
console.log(JSON.stringify({
|
|
28
|
-
manifest
|
|
29
|
-
}));
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
const {
|
|
33
|
-
handler
|
|
34
|
-
} = createHandler({
|
|
35
|
-
getEventBridgeClient: () => {
|
|
36
|
-
return params.getEventBridgeClient({
|
|
37
|
-
region: manifest.sync.region
|
|
38
|
-
});
|
|
39
|
-
},
|
|
40
|
-
system: params.system,
|
|
41
|
-
manifest,
|
|
42
|
-
commandConverters: params.commandConverters,
|
|
43
|
-
getPlugins: () => {
|
|
44
|
-
return context.plugins;
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
attachToDynamoDbDocument({
|
|
48
|
-
handler
|
|
49
|
-
});
|
|
50
|
-
context.plugins.register([
|
|
51
|
-
/**
|
|
52
|
-
* When request ends, send the data to the EventBridge.
|
|
53
|
-
*/
|
|
54
|
-
createSendDataToEventBridgeOnRequestEnd(handler)]);
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
//# sourceMappingURL=requestPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createHandlerOnRequest","getManifest","attachToDynamoDbDocument","createSendDataToEventBridgeOnRequestEnd","createHandler","convertException","createSyncSystemHandlerOnRequestPlugin","params","_","__","context","data","manifest","error","process","env","DEBUG","console","log","JSON","stringify","sync","region","handler","getEventBridgeClient","system","commandConverters","getPlugins","plugins","register"],"sources":["requestPlugin.ts"],"sourcesContent":["import type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandConverter, IGetEventBridgeCallable, ISystem } from \"~/sync/types.js\";\nimport { createHandlerOnRequest } from \"@webiny/handler\";\nimport { getManifest } from \"~/sync/utils/manifest.js\";\nimport { attachToDynamoDbDocument } from \"~/sync/attachToDynamoDbDocument.js\";\nimport { createSendDataToEventBridgeOnRequestEnd } from \"~/sync/createSendDataToEventBridgeOnRequestEnd.js\";\nimport { createHandler } from \"./createHandler.js\";\nimport { convertException } from \"@webiny/utils/exception.js\";\n\nexport interface ICreateSyncSystemHandlerOnRequestPluginParams {\n getDocumentClient(): Pick<DynamoDBDocument, \"send\">;\n getEventBridgeClient: IGetEventBridgeCallable;\n system: ISystem;\n commandConverters?: ICommandConverter[];\n}\n\nexport const createSyncSystemHandlerOnRequestPlugin = (\n params: ICreateSyncSystemHandlerOnRequestPluginParams\n) => {\n return createHandlerOnRequest(async (_, __, context) => {\n const { data: manifest, error } = await getManifest(params);\n if (error) {\n if (process.env.DEBUG !== \"true\") {\n return;\n }\n console.error(\"Error happened when fetching manifest.\");\n console.log(\n JSON.stringify({\n error: convertException(error)\n })\n );\n return;\n } else if (!manifest?.sync?.region) {\n if (process.env.DEBUG !== \"true\") {\n return;\n }\n console.error(\"There is no manifest.\");\n console.log(\n JSON.stringify({\n manifest\n })\n );\n return;\n }\n\n const { handler } = createHandler({\n getEventBridgeClient: () => {\n return params.getEventBridgeClient({\n region: manifest.sync.region\n });\n },\n system: params.system,\n manifest,\n commandConverters: params.commandConverters,\n getPlugins: () => {\n return context.plugins;\n }\n });\n\n attachToDynamoDbDocument({\n handler\n });\n context.plugins.register([\n /**\n * When request ends, send the data to the EventBridge.\n */\n createSendDataToEventBridgeOnRequestEnd(handler)\n ]);\n });\n};\n"],"mappings":"AAEA,SAASA,sBAAsB,QAAQ,iBAAiB;AACxD,SAASC,WAAW;AACpB,SAASC,wBAAwB;AACjC,SAASC,uCAAuC;AAChD,SAASC,aAAa;AACtB,SAASC,gBAAgB,QAAQ,4BAA4B;AAS7D,OAAO,MAAMC,sCAAsC,GAC/CC,MAAqD,IACpD;EACD,OAAOP,sBAAsB,CAAC,OAAOQ,CAAC,EAAEC,EAAE,EAAEC,OAAO,KAAK;IACpD,MAAM;MAAEC,IAAI,EAAEC,QAAQ;MAAEC;IAAM,CAAC,GAAG,MAAMZ,WAAW,CAACM,MAAM,CAAC;IAC3D,IAAIM,KAAK,EAAE;MACP,IAAIC,OAAO,CAACC,GAAG,CAACC,KAAK,KAAK,MAAM,EAAE;QAC9B;MACJ;MACAC,OAAO,CAACJ,KAAK,CAAC,wCAAwC,CAAC;MACvDI,OAAO,CAACC,GAAG,CACPC,IAAI,CAACC,SAAS,CAAC;QACXP,KAAK,EAAER,gBAAgB,CAACQ,KAAK;MACjC,CAAC,CACL,CAAC;MACD;IACJ,CAAC,MAAM,IAAI,CAACD,QAAQ,EAAES,IAAI,EAAEC,MAAM,EAAE;MAChC,IAAIR,OAAO,CAACC,GAAG,CAACC,KAAK,KAAK,MAAM,EAAE;QAC9B;MACJ;MACAC,OAAO,CAACJ,KAAK,CAAC,uBAAuB,CAAC;MACtCI,OAAO,CAACC,GAAG,CACPC,IAAI,CAACC,SAAS,CAAC;QACXR;MACJ,CAAC,CACL,CAAC;MACD;IACJ;IAEA,MAAM;MAAEW;IAAQ,CAAC,GAAGnB,aAAa,CAAC;MAC9BoB,oBAAoB,EAAEA,CAAA,KAAM;QACxB,OAAOjB,MAAM,CAACiB,oBAAoB,CAAC;UAC/BF,MAAM,EAAEV,QAAQ,CAACS,IAAI,CAACC;QAC1B,CAAC,CAAC;MACN,CAAC;MACDG,MAAM,EAAElB,MAAM,CAACkB,MAAM;MACrBb,QAAQ;MACRc,iBAAiB,EAAEnB,MAAM,CAACmB,iBAAiB;MAC3CC,UAAU,EAAEA,CAAA,KAAM;QACd,OAAOjB,OAAO,CAACkB,OAAO;MAC1B;IACJ,CAAC,CAAC;IAEF1B,wBAAwB,CAAC;MACrBqB;IACJ,CAAC,CAAC;IACFb,OAAO,CAACkB,OAAO,CAACC,QAAQ,CAAC;IACrB;AACZ;AACA;IACY1B,uCAAuC,CAACoB,OAAO,CAAC,CACnD,CAAC;EACN,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
package/sync/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { NonEmptyArray } from \"@webiny/api/types.js\";\nimport type {\n BatchGetCommand,\n BatchWriteCommand,\n DeleteCommand,\n GetCommand,\n PutCommand,\n QueryCommand,\n ScanCommand,\n UpdateCommand\n} from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type {\n EventBridgeClient,\n EventBridgeClientConfig,\n PutEventsCommandOutput\n} from \"@webiny/aws-sdk/client-eventbridge/index.js\";\nimport type { AllCommandType, DynamoDBTableType, ExtendedCommandType } from \"~/types.js\";\n\nexport interface IManifestData {\n region: string;\n eventBusName: string;\n eventBusArn: string;\n}\n\nexport interface IManifest {\n sync: IManifestData;\n}\n\nexport type IDynamoDbCommand =\n | PutCommand\n | QueryCommand\n | ScanCommand\n | DeleteCommand\n | BatchWriteCommand\n | BatchGetCommand\n | GetCommand\n | UpdateCommand;\n\nexport interface ICommandValueItem {\n PK: string;\n SK: string;\n command: ExtendedCommandType;\n tableName: string;\n tableType: DynamoDBTableType;\n}\n\nexport interface ICommandValueItemExtended extends ICommandValueItem {\n input: IDynamoDbCommand;\n}\n\nexport interface ICommandValue {\n readonly command: AllCommandType;\n getItems(): NonEmptyArray<ICommandValueItemExtended> | null;\n}\n\nexport interface ICommand<Result extends ICommandValue = ICommandValue> {\n name: string;\n can(input: IDynamoDbCommand): boolean;\n convert(input: IDynamoDbCommand): Result;\n}\n\nexport interface ITable {\n name: string;\n arn: string;\n type: DynamoDBTableType;\n}\n\nexport interface ISystem {\n name: string;\n env: string;\n variant?: string | undefined;\n region: string;\n version: string;\n}\n\nexport interface IHandler {\n readonly id: string;\n flush(): Promise<PutEventsCommandOutput | null>;\n add(input: IDynamoDbCommand): void;\n}\n\nexport interface ICommandConverter<Result extends ICommandValue = ICommandValue> {\n name: string;\n can(input: IDynamoDbCommand): boolean;\n convert(input: IDynamoDbCommand): Result;\n}\n\nexport interface IHandlerConverter {\n register(input: ICommandConverter | ICommandConverter[]): void;\n convert(input: IDynamoDbCommand): ICommandValue;\n}\n\nexport interface IGetEventBridgeCallableParams\n extends Omit<Partial<EventBridgeClientConfig>, \"region\"> {\n region: string;\n}\n\nexport interface IGetEventBridgeCallable {\n (params: IGetEventBridgeCallableParams): Pick<EventBridgeClient, \"send\">;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface ICopyFileActionEventData {\n bucket: string;\n region: string;\n}\n\nexport interface ICopyFileActionEvent {\n key: string;\n action: \"copyFile\";\n source: ICopyFileActionEventData;\n target: ICopyFileActionEventData;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface ICreateUserActionEventData {\n userPoolId: string;\n region: string;\n}\n\nexport interface ICreateUserActionEvent {\n username: string;\n action: \"createUser\";\n source: ICreateUserActionEventData;\n target: ICreateUserActionEventData;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface IDeleteFileActionEventData {\n bucket: string;\n region: string;\n}\n\nexport interface IDeleteFileActionEvent {\n key: string;\n action: \"deleteFile\";\n target: IDeleteFileActionEventData;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface IDeleteUserActionEventData {\n userPoolId: string;\n region: string;\n}\n\nexport interface IDeleteUserActionEvent {\n username: string;\n action: \"deleteUser\";\n target: IDeleteUserActionEventData;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface IUpdateUserActionEventData {\n userPoolId: string;\n region: string;\n}\n\nexport interface IUpdateUserActionEvent {\n username: string;\n action: \"updateUser\";\n source: IUpdateUserActionEventData;\n target: IUpdateUserActionEventData;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { CreateHandlerParams } from "@webiny/handler-aws/raw/index.js";
|
|
2
|
-
import type { Plugin } from "@webiny/plugins/types.js";
|
|
3
|
-
import type { S3Client, S3ClientConfig } from "@webiny/aws-sdk/client-s3/index.js";
|
|
4
|
-
import { type CognitoIdentityProvider, type CognitoIdentityProviderClientConfig } from "@webiny/aws-sdk/client-cognito-identity-provider/index.js";
|
|
5
|
-
export type IAllowedWorkerHandlerPlugins = Plugin[];
|
|
6
|
-
export interface IWorkerHandlerParams extends Omit<CreateHandlerParams, "plugins"> {
|
|
7
|
-
plugins?: IAllowedWorkerHandlerPlugins[];
|
|
8
|
-
createS3Client: (params: S3ClientConfig) => Pick<S3Client, "send">;
|
|
9
|
-
createCognitoIdentityProviderClient(input: CognitoIdentityProviderClientConfig): Pick<CognitoIdentityProvider, "send">;
|
|
10
|
-
}
|
|
11
|
-
export declare const createWorkerHandler: (params: IWorkerHandlerParams) => import("@webiny/handler-aws/raw/index.js").HandlerCallable<any, import("aws-lambda").APIGatewayProxyResult>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { createHandler } from "@webiny/handler-aws/raw/index.js";
|
|
2
|
-
import { createEventHandlerPlugin } from "./handler/eventHandler.js";
|
|
3
|
-
import { PluginsContainer } from "@webiny/plugins/PluginsContainer.js";
|
|
4
|
-
import { createCopyFileAction } from "./actions/copyFile/copyFileAction.js";
|
|
5
|
-
import { createDeleteFileAction } from "./actions/deleteFile/deleteFileAction.js";
|
|
6
|
-
import { createCreateUserAction } from "./actions/createUser/createUserAction.js";
|
|
7
|
-
import { createUpdateUserAction } from "./actions/updateUser/updateUserAction.js";
|
|
8
|
-
import { createDeleteUserAction } from "./actions/deleteUser/deleteUserAction.js";
|
|
9
|
-
export const createWorkerHandler = params => {
|
|
10
|
-
const {
|
|
11
|
-
createS3Client,
|
|
12
|
-
createCognitoIdentityProviderClient
|
|
13
|
-
} = params;
|
|
14
|
-
const plugins = new PluginsContainer(params.plugins || []);
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Default action plugins are registered here.
|
|
18
|
-
*/
|
|
19
|
-
plugins.register(createCopyFileAction({
|
|
20
|
-
createS3Client
|
|
21
|
-
}));
|
|
22
|
-
plugins.register(createDeleteFileAction({
|
|
23
|
-
createS3Client
|
|
24
|
-
}));
|
|
25
|
-
plugins.register(createCreateUserAction({
|
|
26
|
-
createCognitoProvider: createCognitoIdentityProviderClient
|
|
27
|
-
}));
|
|
28
|
-
plugins.register(createUpdateUserAction({
|
|
29
|
-
createCognitoProvider: createCognitoIdentityProviderClient
|
|
30
|
-
}));
|
|
31
|
-
plugins.register(createDeleteUserAction({
|
|
32
|
-
createCognitoProvider: createCognitoIdentityProviderClient
|
|
33
|
-
}));
|
|
34
|
-
plugins.register(createEventHandlerPlugin());
|
|
35
|
-
return createHandler({
|
|
36
|
-
...params,
|
|
37
|
-
plugins
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
//# sourceMappingURL=createWorkerHandler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createHandler","createEventHandlerPlugin","PluginsContainer","createCopyFileAction","createDeleteFileAction","createCreateUserAction","createUpdateUserAction","createDeleteUserAction","createWorkerHandler","params","createS3Client","createCognitoIdentityProviderClient","plugins","register","createCognitoProvider"],"sources":["createWorkerHandler.ts"],"sourcesContent":["import type { CreateHandlerParams } from \"@webiny/handler-aws/raw/index.js\";\nimport { createHandler } from \"@webiny/handler-aws/raw/index.js\";\nimport { createEventHandlerPlugin } from \"./handler/eventHandler.js\";\nimport { PluginsContainer } from \"@webiny/plugins/PluginsContainer.js\";\nimport type { Plugin } from \"@webiny/plugins/types.js\";\nimport { createCopyFileAction } from \"~/worker/actions/copyFile/copyFileAction.js\";\nimport { createDeleteFileAction } from \"~/worker/actions/deleteFile/deleteFileAction.js\";\nimport type { S3Client, S3ClientConfig } from \"@webiny/aws-sdk/client-s3/index.js\";\nimport { createCreateUserAction } from \"~/worker/actions/createUser/createUserAction.js\";\nimport { createUpdateUserAction } from \"~/worker/actions/updateUser/updateUserAction.js\";\nimport {\n type CognitoIdentityProvider,\n type CognitoIdentityProviderClientConfig\n} from \"@webiny/aws-sdk/client-cognito-identity-provider/index.js\";\nimport { createDeleteUserAction } from \"~/worker/actions/deleteUser/deleteUserAction.js\";\n\nexport type IAllowedWorkerHandlerPlugins = Plugin[];\n\nexport interface IWorkerHandlerParams extends Omit<CreateHandlerParams, \"plugins\"> {\n plugins?: IAllowedWorkerHandlerPlugins[];\n createS3Client: (params: S3ClientConfig) => Pick<S3Client, \"send\">;\n createCognitoIdentityProviderClient(\n input: CognitoIdentityProviderClientConfig\n ): Pick<CognitoIdentityProvider, \"send\">;\n}\n\nexport const createWorkerHandler = (params: IWorkerHandlerParams) => {\n const { createS3Client, createCognitoIdentityProviderClient } = params;\n const plugins = new PluginsContainer(params.plugins || []);\n\n /**\n * Default action plugins are registered here.\n */\n plugins.register(\n createCopyFileAction({\n createS3Client\n })\n );\n plugins.register(\n createDeleteFileAction({\n createS3Client\n })\n );\n plugins.register(\n createCreateUserAction({\n createCognitoProvider: createCognitoIdentityProviderClient\n })\n );\n plugins.register(\n createUpdateUserAction({\n createCognitoProvider: createCognitoIdentityProviderClient\n })\n );\n plugins.register(\n createDeleteUserAction({\n createCognitoProvider: createCognitoIdentityProviderClient\n })\n );\n\n plugins.register(createEventHandlerPlugin());\n return createHandler({\n ...params,\n plugins\n });\n};\n"],"mappings":"AACA,SAASA,aAAa,QAAQ,kCAAkC;AAChE,SAASC,wBAAwB;AACjC,SAASC,gBAAgB,QAAQ,qCAAqC;AAEtE,SAASC,oBAAoB;AAC7B,SAASC,sBAAsB;AAE/B,SAASC,sBAAsB;AAC/B,SAASC,sBAAsB;AAK/B,SAASC,sBAAsB;AAY/B,OAAO,MAAMC,mBAAmB,GAAIC,MAA4B,IAAK;EACjE,MAAM;IAAEC,cAAc;IAAEC;EAAoC,CAAC,GAAGF,MAAM;EACtE,MAAMG,OAAO,GAAG,IAAIV,gBAAgB,CAACO,MAAM,CAACG,OAAO,IAAI,EAAE,CAAC;;EAE1D;AACJ;AACA;EACIA,OAAO,CAACC,QAAQ,CACZV,oBAAoB,CAAC;IACjBO;EACJ,CAAC,CACL,CAAC;EACDE,OAAO,CAACC,QAAQ,CACZT,sBAAsB,CAAC;IACnBM;EACJ,CAAC,CACL,CAAC;EACDE,OAAO,CAACC,QAAQ,CACZR,sBAAsB,CAAC;IACnBS,qBAAqB,EAAEH;EAC3B,CAAC,CACL,CAAC;EACDC,OAAO,CAACC,QAAQ,CACZP,sBAAsB,CAAC;IACnBQ,qBAAqB,EAAEH;EAC3B,CAAC,CACL,CAAC;EACDC,OAAO,CAACC,QAAQ,CACZN,sBAAsB,CAAC;IACnBO,qBAAqB,EAAEH;EAC3B,CAAC,CACL,CAAC;EAEDC,OAAO,CAACC,QAAQ,CAACZ,wBAAwB,CAAC,CAAC,CAAC;EAC5C,OAAOD,aAAa,CAAC;IACjB,GAAGS,MAAM;IACTG;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const createEventHandlerPlugin: () => import("@webiny/handler-aws/raw/index.js").RawEventHandler<unknown, import("@webiny/handler/types.js").Context, any>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { convertException } from "@webiny/utils";
|
|
2
|
-
import { WorkerActionHandler } from "./WorkerActionHandler.js";
|
|
3
|
-
import { createEventHandler } from "@webiny/handler-aws/raw/index.js";
|
|
4
|
-
import { WorkerActionPlugin } from "../plugins/WorkerActionPlugin.js";
|
|
5
|
-
export const createEventHandlerPlugin = () => {
|
|
6
|
-
const plugin = createEventHandler(async ({
|
|
7
|
-
payload,
|
|
8
|
-
context
|
|
9
|
-
}) => {
|
|
10
|
-
const handler = new WorkerActionHandler({
|
|
11
|
-
plugins: context.plugins.byType(WorkerActionPlugin.type)
|
|
12
|
-
});
|
|
13
|
-
try {
|
|
14
|
-
await handler.handle(payload);
|
|
15
|
-
} catch (ex) {
|
|
16
|
-
console.error("Error while handling action.");
|
|
17
|
-
console.log(convertException(ex));
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
plugin.name = `sync.worker.eventHandler`;
|
|
21
|
-
return plugin;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
//# sourceMappingURL=eventHandler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["convertException","WorkerActionHandler","createEventHandler","WorkerActionPlugin","createEventHandlerPlugin","plugin","payload","context","handler","plugins","byType","type","handle","ex","console","error","log","name"],"sources":["eventHandler.ts"],"sourcesContent":["import { convertException } from \"@webiny/utils\";\nimport { WorkerActionHandler } from \"./WorkerActionHandler.js\";\nimport { createEventHandler } from \"@webiny/handler-aws/raw/index.js\";\nimport { WorkerActionPlugin } from \"../plugins/WorkerActionPlugin.js\";\n\nexport const createEventHandlerPlugin = () => {\n const plugin = createEventHandler<unknown>(async ({ payload, context }) => {\n const handler = new WorkerActionHandler({\n plugins: context.plugins.byType<WorkerActionPlugin>(WorkerActionPlugin.type)\n });\n\n try {\n await handler.handle(payload);\n } catch (ex) {\n console.error(\"Error while handling action.\");\n console.log(convertException(ex));\n }\n });\n\n plugin.name = `sync.worker.eventHandler`;\n\n return plugin;\n};\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,eAAe;AAChD,SAASC,mBAAmB;AAC5B,SAASC,kBAAkB,QAAQ,kCAAkC;AACrE,SAASC,kBAAkB;AAE3B,OAAO,MAAMC,wBAAwB,GAAGA,CAAA,KAAM;EAC1C,MAAMC,MAAM,GAAGH,kBAAkB,CAAU,OAAO;IAAEI,OAAO;IAAEC;EAAQ,CAAC,KAAK;IACvE,MAAMC,OAAO,GAAG,IAAIP,mBAAmB,CAAC;MACpCQ,OAAO,EAAEF,OAAO,CAACE,OAAO,CAACC,MAAM,CAAqBP,kBAAkB,CAACQ,IAAI;IAC/E,CAAC,CAAC;IAEF,IAAI;MACA,MAAMH,OAAO,CAACI,MAAM,CAACN,OAAO,CAAC;IACjC,CAAC,CAAC,OAAOO,EAAE,EAAE;MACTC,OAAO,CAACC,KAAK,CAAC,8BAA8B,CAAC;MAC7CD,OAAO,CAACE,GAAG,CAAChB,gBAAgB,CAACa,EAAE,CAAC,CAAC;IACrC;EACJ,CAAC,CAAC;EAEFR,MAAM,CAACY,IAAI,GAAG,0BAA0B;EAExC,OAAOZ,MAAM;AACjB,CAAC","ignoreList":[]}
|
package/worker/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface IWorkerActionHandleParams<T> {\n data: T;\n}\n\nexport interface IWorkerAction<T = unknown> {\n name: string;\n parse(input: unknown): T | undefined;\n handle(params: IWorkerActionHandleParams<T>): Promise<void>;\n}\n\nexport interface IActionHandlerHandleParams<T = unknown> {\n data: T;\n}\n\nexport interface IActionHandler {\n handle<T>(params: IActionHandlerHandleParams<T>): Promise<void>;\n}\n"],"mappings":"","ignoreList":[]}
|