@webiny/api-sync-system 0.0.0-unstable.06b2ede40f → 0.0.0-unstable.0d717d18dd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -108
- package/constants.js +2 -7
- package/constants.js.map +1 -1
- package/index.d.ts +11 -3
- package/index.js +8 -40
- package/package.json +31 -26
- 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.d.ts +6 -6
- package/resolver/app/RecordHandler.js +84 -114
- package/resolver/app/RecordHandler.js.map +1 -1
- package/resolver/app/RecordsValidation.js +13 -24
- package/resolver/app/RecordsValidation.js.map +1 -1
- package/resolver/app/ResolverApplication.d.ts +1 -1
- package/resolver/app/ResolverApplication.js +27 -42
- package/resolver/app/ResolverApplication.js.map +1 -1
- package/resolver/app/abstractions/RecordHandler.d.ts +1 -1
- package/resolver/app/abstractions/RecordHandler.js +0 -7
- package/resolver/app/abstractions/RecordsValidation.d.ts +2 -2
- package/resolver/app/abstractions/RecordsValidation.js +0 -7
- package/resolver/app/abstractions/ResolverApplication.js +0 -7
- package/resolver/app/abstractions/ResolverRecord.d.ts +1 -1
- package/resolver/app/abstractions/ResolverRecord.js +0 -7
- package/resolver/app/bundler/BaseBundle.d.ts +6 -6
- package/resolver/app/bundler/BaseBundle.js +16 -22
- package/resolver/app/bundler/BaseBundle.js.map +1 -1
- package/resolver/app/bundler/Bundler.d.ts +1 -1
- package/resolver/app/bundler/Bundler.js +12 -25
- package/resolver/app/bundler/Bundler.js.map +1 -1
- package/resolver/app/bundler/Bundles.d.ts +2 -2
- package/resolver/app/bundler/Bundles.js +20 -33
- package/resolver/app/bundler/Bundles.js.map +1 -1
- package/resolver/app/bundler/CommandBundle.d.ts +1 -1
- package/resolver/app/bundler/CommandBundle.js +8 -25
- package/resolver/app/bundler/CommandBundle.js.map +1 -1
- package/resolver/app/bundler/TableBundle.d.ts +1 -1
- package/resolver/app/bundler/TableBundle.js +7 -22
- package/resolver/app/bundler/TableBundle.js.map +1 -1
- package/resolver/app/bundler/types.d.ts +2 -2
- package/resolver/app/bundler/types.js +0 -7
- package/resolver/app/commandHandler/DeleteCommandHandler.d.ts +3 -3
- package/resolver/app/commandHandler/DeleteCommandHandler.js +21 -35
- package/resolver/app/commandHandler/DeleteCommandHandler.js.map +1 -1
- package/resolver/app/commandHandler/PutCommandHandler.d.ts +4 -4
- package/resolver/app/commandHandler/PutCommandHandler.js +15 -28
- package/resolver/app/commandHandler/PutCommandHandler.js.map +1 -1
- package/resolver/app/commandHandler/delete.d.ts +1 -1
- package/resolver/app/commandHandler/delete.js +13 -21
- package/resolver/app/commandHandler/delete.js.map +1 -1
- package/resolver/app/commandHandler/put.d.ts +1 -1
- package/resolver/app/commandHandler/put.js +13 -21
- package/resolver/app/commandHandler/put.js.map +1 -1
- package/resolver/app/data/SourceDataContainer.d.ts +3 -3
- package/resolver/app/data/SourceDataContainer.js +27 -36
- package/resolver/app/data/SourceDataContainer.js.map +1 -1
- package/resolver/app/data/types.d.ts +2 -2
- package/resolver/app/data/types.js +0 -7
- package/resolver/app/fetcher/Fetcher.d.ts +3 -3
- package/resolver/app/fetcher/Fetcher.js +87 -121
- package/resolver/app/fetcher/Fetcher.js.map +1 -1
- package/resolver/app/fetcher/types.d.ts +2 -2
- package/resolver/app/fetcher/types.js +0 -7
- package/resolver/app/ingestor/Ingestor.d.ts +1 -1
- package/resolver/app/ingestor/Ingestor.js +26 -39
- package/resolver/app/ingestor/Ingestor.js.map +1 -1
- package/resolver/app/ingestor/IngestorResult.js +27 -39
- package/resolver/app/ingestor/IngestorResult.js.map +1 -1
- package/resolver/app/ingestor/types.d.ts +2 -2
- package/resolver/app/ingestor/types.js +0 -7
- package/resolver/app/storer/Storer.d.ts +3 -3
- package/resolver/app/storer/Storer.js +73 -95
- package/resolver/app/storer/Storer.js.map +1 -1
- package/resolver/app/storer/types.d.ts +2 -2
- package/resolver/app/storer/types.js +0 -7
- package/resolver/app/transform/TransformHandler.d.ts +4 -4
- package/resolver/app/transform/TransformHandler.js +46 -64
- package/resolver/app/transform/TransformHandler.js.map +1 -1
- package/resolver/app/transform/middleware.d.ts +1 -1
- package/resolver/app/transform/middleware.js +12 -25
- package/resolver/app/transform/middleware.js.map +1 -1
- package/resolver/app/utils/Retry.js +21 -32
- package/resolver/app/utils/Retry.js.map +1 -1
- package/resolver/app/utils/sleep.js +4 -12
- package/resolver/app/utils/sleep.js.map +1 -1
- package/resolver/app/validation/body.d.ts +25 -124
- package/resolver/app/validation/body.js +31 -44
- package/resolver/app/validation/body.js.map +1 -1
- package/resolver/app/validation/createJsonTransform.d.ts +1 -1
- package/resolver/app/validation/createJsonTransform.js +13 -22
- package/resolver/app/validation/createJsonTransform.js.map +1 -1
- package/resolver/app/validation/detail.d.ts +19 -72
- package/resolver/app/validation/detail.js +33 -46
- package/resolver/app/validation/detail.js.map +1 -1
- package/resolver/app/validation/event.d.ts +29 -188
- package/resolver/app/validation/event.js +21 -30
- package/resolver/app/validation/event.js.map +1 -1
- package/resolver/app/validation/numericString.d.ts +1 -1
- package/resolver/app/validation/numericString.js +9 -20
- package/resolver/app/validation/numericString.js.map +1 -1
- package/resolver/app/validation/system.d.ts +2 -14
- package/resolver/app/validation/system.js +9 -18
- package/resolver/app/validation/system.js.map +1 -1
- package/resolver/deployment/Deployment.d.ts +2 -3
- package/resolver/deployment/Deployment.js +27 -44
- package/resolver/deployment/Deployment.js.map +1 -1
- package/resolver/deployment/Deployments.js +19 -30
- package/resolver/deployment/Deployments.js.map +1 -1
- package/resolver/deployment/DeploymentsFetcher.js +82 -102
- package/resolver/deployment/DeploymentsFetcher.js.map +1 -1
- package/resolver/deployment/types.d.ts +4 -6
- package/resolver/deployment/types.js +0 -7
- package/resolver/lambda/LambdaTrigger.js +25 -34
- package/resolver/lambda/LambdaTrigger.js.map +1 -1
- package/resolver/plugins/CommandHandlerPlugin.d.ts +3 -3
- package/resolver/plugins/CommandHandlerPlugin.js +17 -24
- package/resolver/plugins/CommandHandlerPlugin.js.map +1 -1
- package/resolver/plugins/StorerAfterEachPlugin.d.ts +2 -2
- package/resolver/plugins/StorerAfterEachPlugin.js +21 -29
- package/resolver/plugins/StorerAfterEachPlugin.js.map +1 -1
- package/resolver/plugins/TransformRecordPlugin.d.ts +3 -3
- package/resolver/plugins/TransformRecordPlugin.js +20 -27
- package/resolver/plugins/TransformRecordPlugin.js.map +1 -1
- package/resolver/recordTypes/fileManager/CopyFile.js +44 -74
- package/resolver/recordTypes/fileManager/CopyFile.js.map +1 -1
- package/resolver/recordTypes/fileManager/DeleteFile.d.ts +1 -1
- package/resolver/recordTypes/fileManager/DeleteFile.js +40 -65
- package/resolver/recordTypes/fileManager/DeleteFile.js.map +1 -1
- package/resolver/recordTypes/fileManager/fileManager.d.ts +1 -1
- package/resolver/recordTypes/fileManager/fileManager.js +7 -12
- package/resolver/recordTypes/fileManager/fileManager.js.map +1 -1
- package/resolver/recordTypes/fileManager/fileManagerOnDelete.d.ts +1 -1
- package/resolver/recordTypes/fileManager/fileManagerOnDelete.js +27 -45
- package/resolver/recordTypes/fileManager/fileManagerOnDelete.js.map +1 -1
- package/resolver/recordTypes/fileManager/fileManagerOnPut.d.ts +1 -1
- package/resolver/recordTypes/fileManager/fileManagerOnPut.js +27 -45
- package/resolver/recordTypes/fileManager/fileManagerOnPut.js.map +1 -1
- package/resolver/recordTypes/fileManager/shouldBeHandled.d.ts +1 -1
- package/resolver/recordTypes/fileManager/shouldBeHandled.js +10 -34
- package/resolver/recordTypes/fileManager/shouldBeHandled.js.map +1 -1
- package/resolver/recordTypes/fileManager/types.d.ts +2 -2
- package/resolver/recordTypes/fileManager/types.js +0 -7
- package/resolver/recordTypes/users/CopyUser.d.ts +2 -2
- package/resolver/recordTypes/users/CopyUser.js +44 -61
- package/resolver/recordTypes/users/CopyUser.js.map +1 -1
- package/resolver/recordTypes/users/DeleteUser.d.ts +2 -2
- package/resolver/recordTypes/users/DeleteUser.js +40 -58
- package/resolver/recordTypes/users/DeleteUser.js.map +1 -1
- package/resolver/recordTypes/users/shouldBeHandled.d.ts +1 -1
- package/resolver/recordTypes/users/shouldBeHandled.js +10 -33
- package/resolver/recordTypes/users/shouldBeHandled.js.map +1 -1
- package/resolver/recordTypes/users/types.d.ts +1 -1
- package/resolver/recordTypes/users/types.js +0 -7
- package/resolver/recordTypes/users/users.js +7 -12
- package/resolver/recordTypes/users/users.js.map +1 -1
- package/resolver/recordTypes/users/usersOnDelete.d.ts +2 -2
- package/resolver/recordTypes/users/usersOnDelete.js +26 -44
- package/resolver/recordTypes/users/usersOnDelete.js.map +1 -1
- package/resolver/recordTypes/users/usersOnPut.d.ts +2 -2
- package/resolver/recordTypes/users/usersOnPut.js +27 -45
- package/resolver/recordTypes/users/usersOnPut.js.map +1 -1
- package/sync/ApiGatewaySyncDecorator.d.ts +14 -0
- package/sync/ApiGatewaySyncDecorator.js +49 -0
- package/sync/ApiGatewaySyncDecorator.js.map +1 -0
- package/sync/FilterOutRecord.d.ts +2 -2
- package/sync/FilterOutRecord.js +8 -24
- 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.d.ts +1 -1
- package/sync/attachToDynamoDbDocument.js +48 -75
- package/sync/attachToDynamoDbDocument.js.map +1 -1
- package/sync/createHandler.js +44 -60
- package/sync/createHandler.js.map +1 -1
- package/sync/filter/createDefaultFilterOutRecordPlugins.d.ts +1 -1
- package/sync/filter/createDefaultFilterOutRecordPlugins.js +37 -86
- package/sync/filter/createDefaultFilterOutRecordPlugins.js.map +1 -1
- package/sync/handler/Handler.d.ts +2 -2
- package/sync/handler/Handler.js +66 -86
- package/sync/handler/Handler.js.map +1 -1
- package/sync/handler/HandlerConverter.js +20 -36
- package/sync/handler/HandlerConverter.js.map +1 -1
- package/sync/handler/converter/BatchGetCommandConverter.js +13 -20
- package/sync/handler/converter/BatchGetCommandConverter.js.map +1 -1
- package/sync/handler/converter/BatchWriteCommandConverter.js +13 -20
- package/sync/handler/converter/BatchWriteCommandConverter.js.map +1 -1
- package/sync/handler/converter/DeleteCommandConverter.js +13 -20
- package/sync/handler/converter/DeleteCommandConverter.js.map +1 -1
- package/sync/handler/converter/GetCommandConverter.js +13 -20
- package/sync/handler/converter/GetCommandConverter.js.map +1 -1
- package/sync/handler/converter/PutCommandConverter.js +13 -20
- package/sync/handler/converter/PutCommandConverter.js.map +1 -1
- package/sync/handler/converter/QueryCommandConverter.js +13 -20
- package/sync/handler/converter/QueryCommandConverter.js.map +1 -1
- package/sync/handler/converter/ScanCommandConverter.js +13 -20
- package/sync/handler/converter/ScanCommandConverter.js.map +1 -1
- package/sync/handler/converter/UpdateCommandConverter.js +13 -20
- package/sync/handler/converter/UpdateCommandConverter.js.map +1 -1
- package/sync/handler/converter/commands/BatchWriteCommandValue.d.ts +2 -2
- package/sync/handler/converter/commands/BatchWriteCommandValue.js +34 -44
- package/sync/handler/converter/commands/BatchWriteCommandValue.js.map +1 -1
- package/sync/handler/converter/commands/DeleteCommandValue.d.ts +2 -2
- package/sync/handler/converter/commands/DeleteCommandValue.js +19 -23
- package/sync/handler/converter/commands/DeleteCommandValue.js.map +1 -1
- package/sync/handler/converter/commands/NullCommandValue.d.ts +1 -1
- package/sync/handler/converter/commands/NullCommandValue.js +7 -14
- package/sync/handler/converter/commands/NullCommandValue.js.map +1 -1
- package/sync/handler/converter/commands/PutCommandValue.d.ts +2 -2
- package/sync/handler/converter/commands/PutCommandValue.js +19 -23
- package/sync/handler/converter/commands/PutCommandValue.js.map +1 -1
- package/sync/handler/converter/commands/UpdateCommandValue.d.ts +2 -2
- package/sync/handler/converter/commands/UpdateCommandValue.js +19 -23
- package/sync/handler/converter/commands/UpdateCommandValue.js.map +1 -1
- package/sync/handler/types.d.ts +3 -3
- package/sync/handler/types.js +0 -7
- package/sync/plugins/FilterOutRecordPlugin.d.ts +1 -1
- package/sync/plugins/FilterOutRecordPlugin.js +18 -28
- package/sync/plugins/FilterOutRecordPlugin.js.map +1 -1
- package/sync/types.js +0 -7
- package/sync/utils/getTableType.js +11 -19
- package/sync/utils/getTableType.js.map +1 -1
- package/sync/utils/manifest.d.ts +3 -7
- package/sync/utils/manifest.js +30 -47
- package/sync/utils/manifest.js.map +1 -1
- package/sync/utils/validateSystemInput.d.ts +1 -1
- package/sync/utils/validateSystemInput.js +22 -37
- package/sync/utils/validateSystemInput.js.map +1 -1
- package/types.d.ts +1 -5
- package/types.js +6 -12
- package/types.js.map +1 -1
- package/utils/createSystemName.js +5 -10
- package/utils/createSystemName.js.map +1 -1
- package/worker/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 +185 -268
- package/worker/actions/copyFile/CopyFile.js.map +1 -1
- package/worker/actions/copyFile/copyFileAction.d.ts +1 -1
- package/worker/actions/copyFile/copyFileAction.js +30 -45
- package/worker/actions/copyFile/copyFileAction.js.map +1 -1
- package/worker/actions/copyFile/copyFileSchema.d.ts +6 -38
- package/worker/actions/copyFile/copyFileSchema.js +14 -23
- package/worker/actions/copyFile/copyFileSchema.js.map +1 -1
- package/worker/actions/copyFile/types.js +0 -7
- package/worker/actions/createUser/CreateUser.d.ts +1 -1
- package/worker/actions/createUser/CreateUser.js +53 -83
- package/worker/actions/createUser/CreateUser.js.map +1 -1
- package/worker/actions/createUser/createUserAction.d.ts +2 -2
- package/worker/actions/createUser/createUserAction.js +28 -39
- package/worker/actions/createUser/createUserAction.js.map +1 -1
- package/worker/actions/createUser/createUserSchema.d.ts +6 -38
- package/worker/actions/createUser/createUserSchema.js +14 -23
- package/worker/actions/createUser/createUserSchema.js.map +1 -1
- package/worker/actions/createUser/types.js +0 -7
- package/worker/actions/deleteFile/DeleteFile.js +52 -74
- package/worker/actions/deleteFile/DeleteFile.js.map +1 -1
- package/worker/actions/deleteFile/deleteFileAction.d.ts +1 -1
- package/worker/actions/deleteFile/deleteFileAction.js +25 -40
- package/worker/actions/deleteFile/deleteFileAction.js.map +1 -1
- package/worker/actions/deleteFile/deleteFileSchema.d.ts +6 -38
- package/worker/actions/deleteFile/deleteFileSchema.js +14 -23
- package/worker/actions/deleteFile/deleteFileSchema.js.map +1 -1
- package/worker/actions/deleteFile/types.js +0 -7
- package/worker/actions/deleteUser/DeleteUser.d.ts +2 -2
- package/worker/actions/deleteUser/DeleteUser.js +39 -60
- package/worker/actions/deleteUser/DeleteUser.js.map +1 -1
- package/worker/actions/deleteUser/deleteUserAction.d.ts +1 -1
- package/worker/actions/deleteUser/deleteUserAction.js +26 -37
- package/worker/actions/deleteUser/deleteUserAction.js.map +1 -1
- package/worker/actions/deleteUser/deleteUserSchema.d.ts +5 -23
- package/worker/actions/deleteUser/deleteUserSchema.js +13 -22
- package/worker/actions/deleteUser/deleteUserSchema.js.map +1 -1
- package/worker/actions/deleteUser/types.js +0 -7
- package/worker/actions/logValidationError.js +6 -14
- package/worker/actions/logValidationError.js.map +1 -1
- package/worker/actions/removeCognitoUserAttributes.js +9 -22
- package/worker/actions/removeCognitoUserAttributes.js.map +1 -1
- package/worker/actions/updateUser/UpdateUser.d.ts +1 -1
- package/worker/actions/updateUser/UpdateUser.js +50 -74
- package/worker/actions/updateUser/UpdateUser.js.map +1 -1
- package/worker/actions/updateUser/types.js +0 -7
- package/worker/actions/updateUser/updateUserAction.d.ts +2 -2
- package/worker/actions/updateUser/updateUserAction.js +28 -39
- package/worker/actions/updateUser/updateUserAction.js.map +1 -1
- package/worker/actions/updateUser/updateUserSchema.d.ts +6 -38
- package/worker/actions/updateUser/updateUserSchema.js +14 -23
- package/worker/actions/updateUser/updateUserSchema.js.map +1 -1
- package/worker/handler/WorkerActionHandler.d.ts +2 -2
- package/worker/handler/WorkerActionHandler.js +19 -28
- package/worker/handler/WorkerActionHandler.js.map +1 -1
- package/worker/plugins/WorkerActionPlugin.d.ts +1 -1
- package/worker/plugins/WorkerActionPlugin.js +18 -25
- package/worker/plugins/WorkerActionPlugin.js.map +1 -1
- package/worker/types.js +0 -7
- package/index.js.map +0 -1
- package/resolver/app/abstractions/RecordHandler.js.map +0 -1
- package/resolver/app/abstractions/RecordsValidation.js.map +0 -1
- package/resolver/app/abstractions/ResolverApplication.js.map +0 -1
- package/resolver/app/abstractions/ResolverRecord.js.map +0 -1
- package/resolver/app/bundler/types.js.map +0 -1
- package/resolver/app/data/types.js.map +0 -1
- package/resolver/app/fetcher/types.js.map +0 -1
- package/resolver/app/ingestor/types.js.map +0 -1
- package/resolver/app/storer/types.js.map +0 -1
- package/resolver/createEventHandlerPlugin.d.ts +0 -10
- package/resolver/createEventHandlerPlugin.js +0 -127
- package/resolver/createEventHandlerPlugin.js.map +0 -1
- package/resolver/createResolverHandler.d.ts +0 -21
- package/resolver/createResolverHandler.js +0 -79
- 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 -51
- package/sync/createSendDataToEventBridgeOnRequestEnd.js.map +0 -1
- package/sync/createSyncSystem.d.ts +0 -16
- package/sync/createSyncSystem.js +0 -42
- 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 -59
- 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 -48
- package/worker/createWorkerHandler.js.map +0 -1
- package/worker/handler/eventHandler.d.ts +0 -1
- package/worker/handler/eventHandler.js +0 -31
- package/worker/handler/eventHandler.js.map +0 -1
- package/worker/types.js.map +0 -1
|
@@ -1,142 +1,43 @@
|
|
|
1
1
|
import zod from "zod";
|
|
2
2
|
export declare const createBodyValidation: () => zod.ZodObject<{
|
|
3
|
-
version: zod.
|
|
3
|
+
version: zod.ZodPipe<zod.ZodString, zod.ZodTransform<`${number}`, string>>;
|
|
4
4
|
id: zod.ZodString;
|
|
5
|
-
"detail-type": zod.
|
|
6
|
-
source: zod.
|
|
7
|
-
account: zod.
|
|
8
|
-
time: zod.
|
|
5
|
+
"detail-type": zod.ZodPipe<zod.ZodString, zod.ZodTransform<"synchronization-input", string>>;
|
|
6
|
+
source: zod.ZodPipe<zod.ZodString, zod.ZodTransform<`webiny:${string}`, string>>;
|
|
7
|
+
account: zod.ZodPipe<zod.ZodString, zod.ZodTransform<`${number}`, string>>;
|
|
8
|
+
time: zod.ZodPipe<zod.ZodString, zod.ZodTransform<Date, string>>;
|
|
9
9
|
region: zod.ZodString;
|
|
10
|
-
resources: zod.ZodArray<zod.ZodString
|
|
10
|
+
resources: zod.ZodArray<zod.ZodString>;
|
|
11
11
|
detail: zod.ZodObject<{
|
|
12
|
-
items: zod.
|
|
12
|
+
items: zod.ZodPipe<zod.ZodArray<zod.ZodObject<{
|
|
13
13
|
PK: zod.ZodString;
|
|
14
14
|
SK: zod.ZodString;
|
|
15
15
|
tableName: zod.ZodString;
|
|
16
|
-
tableType: zod.
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
tableType: zod.ZodPipe<zod.ZodEnum<{
|
|
17
|
+
log: "log";
|
|
18
|
+
opensearch: "opensearch";
|
|
19
|
+
regular: "regular";
|
|
20
|
+
unknown: "unknown";
|
|
21
|
+
}>, zod.ZodTransform<import("../../../types.js").DynamoDBTableType, "log" | "opensearch" | "regular" | "unknown">>;
|
|
22
|
+
command: zod.ZodEnum<{
|
|
23
|
+
delete: "delete";
|
|
24
|
+
put: "put";
|
|
25
|
+
update: "update";
|
|
26
|
+
}>;
|
|
27
|
+
}, zod.core.$strip>>, zod.ZodTransform<import("@webiny/api/types.js").NonEmptyArray<import("../abstractions/ResolverRecord.js").IResolverRecordBodyItem>, {
|
|
19
28
|
PK: string;
|
|
20
29
|
SK: string;
|
|
21
30
|
tableName: string;
|
|
22
31
|
tableType: import("../../../types.js").DynamoDBTableType;
|
|
23
|
-
command: "
|
|
24
|
-
}
|
|
25
|
-
PK: string;
|
|
26
|
-
SK: string;
|
|
27
|
-
tableName: string;
|
|
28
|
-
tableType: "unknown" | "log" | "regular" | "elasticsearch";
|
|
29
|
-
command: "update" | "delete" | "put";
|
|
30
|
-
}>, "many">, {
|
|
31
|
-
PK: string;
|
|
32
|
-
SK: string;
|
|
33
|
-
tableName: string;
|
|
34
|
-
tableType: import("../../../types.js").DynamoDBTableType;
|
|
35
|
-
command: "update" | "delete" | "put";
|
|
36
|
-
}[], {
|
|
37
|
-
PK: string;
|
|
38
|
-
SK: string;
|
|
39
|
-
tableName: string;
|
|
40
|
-
tableType: "unknown" | "log" | "regular" | "elasticsearch";
|
|
41
|
-
command: "update" | "delete" | "put";
|
|
42
|
-
}[]>, import("@webiny/api/types.js").NonEmptyArray<import("../abstractions/ResolverRecord.js").IResolverRecordBodyItem>, {
|
|
43
|
-
PK: string;
|
|
44
|
-
SK: string;
|
|
45
|
-
tableName: string;
|
|
46
|
-
tableType: "unknown" | "log" | "regular" | "elasticsearch";
|
|
47
|
-
command: "update" | "delete" | "put";
|
|
48
|
-
}[]>;
|
|
32
|
+
command: "delete" | "put" | "update";
|
|
33
|
+
}[]>>;
|
|
49
34
|
source: zod.ZodObject<{
|
|
50
35
|
name: zod.ZodString;
|
|
51
36
|
env: zod.ZodString;
|
|
52
|
-
variant: zod.
|
|
37
|
+
variant: zod.ZodPipe<zod.ZodOptional<zod.ZodNullable<zod.ZodOptional<zod.ZodString>>>, zod.ZodTransform<string | undefined, string | null | undefined>>;
|
|
53
38
|
region: zod.ZodString;
|
|
54
39
|
version: zod.ZodString;
|
|
55
|
-
},
|
|
56
|
-
name: string;
|
|
57
|
-
region: string;
|
|
58
|
-
version: string;
|
|
59
|
-
env: string;
|
|
60
|
-
variant?: string | undefined;
|
|
61
|
-
}, {
|
|
62
|
-
name: string;
|
|
63
|
-
region: string;
|
|
64
|
-
version: string;
|
|
65
|
-
env: string;
|
|
66
|
-
variant?: string | null | undefined;
|
|
67
|
-
}>;
|
|
40
|
+
}, zod.core.$strip>;
|
|
68
41
|
id: zod.ZodString;
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
source: {
|
|
72
|
-
name: string;
|
|
73
|
-
region: string;
|
|
74
|
-
version: string;
|
|
75
|
-
env: string;
|
|
76
|
-
variant?: string | undefined;
|
|
77
|
-
};
|
|
78
|
-
items: import("@webiny/api/types.js").NonEmptyArray<import("../abstractions/ResolverRecord.js").IResolverRecordBodyItem>;
|
|
79
|
-
}, {
|
|
80
|
-
id: string;
|
|
81
|
-
source: {
|
|
82
|
-
name: string;
|
|
83
|
-
region: string;
|
|
84
|
-
version: string;
|
|
85
|
-
env: string;
|
|
86
|
-
variant?: string | null | undefined;
|
|
87
|
-
};
|
|
88
|
-
items: {
|
|
89
|
-
PK: string;
|
|
90
|
-
SK: string;
|
|
91
|
-
tableName: string;
|
|
92
|
-
tableType: "unknown" | "log" | "regular" | "elasticsearch";
|
|
93
|
-
command: "update" | "delete" | "put";
|
|
94
|
-
}[];
|
|
95
|
-
}>;
|
|
96
|
-
}, "strip", zod.ZodTypeAny, {
|
|
97
|
-
time: Date;
|
|
98
|
-
detail: {
|
|
99
|
-
id: string;
|
|
100
|
-
source: {
|
|
101
|
-
name: string;
|
|
102
|
-
region: string;
|
|
103
|
-
version: string;
|
|
104
|
-
env: string;
|
|
105
|
-
variant?: string | undefined;
|
|
106
|
-
};
|
|
107
|
-
items: import("@webiny/api/types.js").NonEmptyArray<import("../abstractions/ResolverRecord.js").IResolverRecordBodyItem>;
|
|
108
|
-
};
|
|
109
|
-
id: string;
|
|
110
|
-
source: `webiny:${string}`;
|
|
111
|
-
region: string;
|
|
112
|
-
"detail-type": "synchronization-input";
|
|
113
|
-
version: `${number}`;
|
|
114
|
-
account: `${number}`;
|
|
115
|
-
resources: string[];
|
|
116
|
-
}, {
|
|
117
|
-
time: string;
|
|
118
|
-
detail: {
|
|
119
|
-
id: string;
|
|
120
|
-
source: {
|
|
121
|
-
name: string;
|
|
122
|
-
region: string;
|
|
123
|
-
version: string;
|
|
124
|
-
env: string;
|
|
125
|
-
variant?: string | null | undefined;
|
|
126
|
-
};
|
|
127
|
-
items: {
|
|
128
|
-
PK: string;
|
|
129
|
-
SK: string;
|
|
130
|
-
tableName: string;
|
|
131
|
-
tableType: "unknown" | "log" | "regular" | "elasticsearch";
|
|
132
|
-
command: "update" | "delete" | "put";
|
|
133
|
-
}[];
|
|
134
|
-
};
|
|
135
|
-
id: string;
|
|
136
|
-
source: string;
|
|
137
|
-
region: string;
|
|
138
|
-
"detail-type": string;
|
|
139
|
-
version: string;
|
|
140
|
-
account: string;
|
|
141
|
-
resources: string[];
|
|
142
|
-
}>;
|
|
42
|
+
}, zod.core.$strip>;
|
|
43
|
+
}, zod.core.$strip>;
|
|
@@ -1,46 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
code: _zod.default.ZodIssueCode.custom,
|
|
33
|
-
message: `"source" must start with "webiny:".`
|
|
34
|
-
});
|
|
35
|
-
return _zod.default.NEVER;
|
|
36
|
-
}),
|
|
37
|
-
account: (0, _numericString.createNumericStringValidation)("account"),
|
|
38
|
-
time: _zod.default.string().transform(value => new Date(value)),
|
|
39
|
-
region: _zod.default.string(),
|
|
40
|
-
resources: _zod.default.array(_zod.default.string()),
|
|
41
|
-
detail: detailValidation
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
exports.createBodyValidation = createBodyValidation;
|
|
1
|
+
import zod from "zod";
|
|
2
|
+
import { createDetailValidation } from "./detail.js";
|
|
3
|
+
import { SQS_EVENT_NAME } from "../../../constants.js";
|
|
4
|
+
import { createNumericStringValidation } from "./numericString.js";
|
|
5
|
+
const detailValidation = createDetailValidation();
|
|
6
|
+
const createBodyValidation = ()=>zod.object({
|
|
7
|
+
version: createNumericStringValidation("version"),
|
|
8
|
+
id: zod.string(),
|
|
9
|
+
"detail-type": zod.string().transform((value, ctx)=>{
|
|
10
|
+
if (value === SQS_EVENT_NAME) return SQS_EVENT_NAME;
|
|
11
|
+
ctx.addIssue({
|
|
12
|
+
code: zod.ZodIssueCode.custom,
|
|
13
|
+
message: `"detail-type" must be "${SQS_EVENT_NAME}".`
|
|
14
|
+
});
|
|
15
|
+
return zod.NEVER;
|
|
16
|
+
}),
|
|
17
|
+
source: zod.string().transform((value, ctx)=>{
|
|
18
|
+
if (value.startsWith("webiny:")) return value;
|
|
19
|
+
ctx.addIssue({
|
|
20
|
+
code: zod.ZodIssueCode.custom,
|
|
21
|
+
message: '"source" must start with "webiny:".'
|
|
22
|
+
});
|
|
23
|
+
return zod.NEVER;
|
|
24
|
+
}),
|
|
25
|
+
account: createNumericStringValidation("account"),
|
|
26
|
+
time: zod.string().transform((value)=>new Date(value)),
|
|
27
|
+
region: zod.string(),
|
|
28
|
+
resources: zod.array(zod.string()),
|
|
29
|
+
detail: detailValidation
|
|
30
|
+
});
|
|
31
|
+
export { createBodyValidation };
|
|
45
32
|
|
|
46
33
|
//# sourceMappingURL=body.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"resolver/app/validation/body.js","sources":["../../../../src/resolver/app/validation/body.ts"],"sourcesContent":["import zod from \"zod\";\nimport { createDetailValidation } from \"./detail.js\";\nimport { SQS_EVENT_NAME } from \"~/constants.js\";\nimport { createNumericStringValidation } from \"~/resolver/app/validation/numericString.js\";\n\nconst detailValidation = createDetailValidation();\n\nexport const createBodyValidation = () => {\n return zod.object({\n version: createNumericStringValidation(\"version\"),\n id: zod.string(),\n \"detail-type\": zod.string().transform((value, ctx) => {\n if (value === SQS_EVENT_NAME) {\n return SQS_EVENT_NAME;\n }\n ctx.addIssue({\n code: zod.ZodIssueCode.custom,\n message: `\"detail-type\" must be \"${SQS_EVENT_NAME}\".`\n });\n return zod.NEVER;\n }),\n source: zod.string().transform((value, ctx) => {\n if (value.startsWith(\"webiny:\")) {\n return value as `webiny:${string}`;\n }\n ctx.addIssue({\n code: zod.ZodIssueCode.custom,\n message: `\"source\" must start with \"webiny:\".`\n });\n return zod.NEVER;\n }),\n account: createNumericStringValidation(\"account\"),\n time: zod.string().transform(value => new Date(value)),\n region: zod.string(),\n resources: zod.array(zod.string()),\n detail: detailValidation\n });\n};\n"],"names":["detailValidation","createDetailValidation","createBodyValidation","zod","createNumericStringValidation","value","ctx","SQS_EVENT_NAME","Date"],"mappings":";;;;AAKA,MAAMA,mBAAmBC;AAElB,MAAMC,uBAAuB,IACzBC,IAAI,MAAM,CAAC;QACd,SAASC,8BAA8B;QACvC,IAAID,IAAI,MAAM;QACd,eAAeA,IAAI,MAAM,GAAG,SAAS,CAAC,CAACE,OAAOC;YAC1C,IAAID,UAAUE,gBACV,OAAOA;YAEXD,IAAI,QAAQ,CAAC;gBACT,MAAMH,IAAI,YAAY,CAAC,MAAM;gBAC7B,SAAS,CAAC,uBAAuB,EAAEI,eAAe,EAAE,CAAC;YACzD;YACA,OAAOJ,IAAI,KAAK;QACpB;QACA,QAAQA,IAAI,MAAM,GAAG,SAAS,CAAC,CAACE,OAAOC;YACnC,IAAID,MAAM,UAAU,CAAC,YACjB,OAAOA;YAEXC,IAAI,QAAQ,CAAC;gBACT,MAAMH,IAAI,YAAY,CAAC,MAAM;gBAC7B,SAAS;YACb;YACA,OAAOA,IAAI,KAAK;QACpB;QACA,SAASC,8BAA8B;QACvC,MAAMD,IAAI,MAAM,GAAG,SAAS,CAACE,CAAAA,QAAS,IAAIG,KAAKH;QAC/C,QAAQF,IAAI,MAAM;QAClB,WAAWA,IAAI,KAAK,CAACA,IAAI,MAAM;QAC/B,QAAQH;IACZ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import zod from "zod";
|
|
2
|
-
export declare const createJsonTransform: (name: string) => zod.
|
|
2
|
+
export declare const createJsonTransform: (name: string) => zod.ZodPipe<zod.ZodString, zod.ZodTransform<any, string>>;
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
ctx.addIssue({
|
|
15
|
-
code: _zod.default.ZodIssueCode.custom,
|
|
16
|
-
message: `${name} must be a valid JSON string.`
|
|
17
|
-
});
|
|
18
|
-
return _zod.default.NEVER;
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
exports.createJsonTransform = createJsonTransform;
|
|
1
|
+
import zod from "zod";
|
|
2
|
+
const createJsonTransform = (name)=>zod.string().transform((value, ctx)=>{
|
|
3
|
+
try {
|
|
4
|
+
return JSON.parse(value);
|
|
5
|
+
} catch {
|
|
6
|
+
ctx.addIssue({
|
|
7
|
+
code: zod.ZodIssueCode.custom,
|
|
8
|
+
message: `${name} must be a valid JSON string.`
|
|
9
|
+
});
|
|
10
|
+
return zod.NEVER;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
export { createJsonTransform };
|
|
23
14
|
|
|
24
15
|
//# sourceMappingURL=createJsonTransform.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"resolver/app/validation/createJsonTransform.js","sources":["../../../../src/resolver/app/validation/createJsonTransform.ts"],"sourcesContent":["import zod from \"zod\";\n\nexport const createJsonTransform = (name: string) => {\n return zod.string().transform((value, ctx) => {\n try {\n return JSON.parse(value);\n } catch {\n ctx.addIssue({\n code: zod.ZodIssueCode.custom,\n message: `${name} must be a valid JSON string.`\n });\n return zod.NEVER;\n }\n });\n};\n"],"names":["createJsonTransform","name","zod","value","ctx","JSON"],"mappings":";AAEO,MAAMA,sBAAsB,CAACC,OACzBC,IAAI,MAAM,GAAG,SAAS,CAAC,CAACC,OAAOC;QAClC,IAAI;YACA,OAAOC,KAAK,KAAK,CAACF;QACtB,EAAE,OAAM;YACJC,IAAI,QAAQ,CAAC;gBACT,MAAMF,IAAI,YAAY,CAAC,MAAM;gBAC7B,SAAS,GAAGD,KAAK,6BAA6B,CAAC;YACnD;YACA,OAAOC,IAAI,KAAK;QACpB;IACJ"}
|
|
@@ -1,89 +1,36 @@
|
|
|
1
1
|
import zod from "zod";
|
|
2
2
|
import type { NonEmptyArray } from "@webiny/api/types.js";
|
|
3
|
-
import type { IResolverRecordBodyItem } from "
|
|
3
|
+
import type { IResolverRecordBodyItem } from "../../../resolver/app/abstractions/ResolverRecord.js";
|
|
4
4
|
import { DynamoDBTableType } from "../../../types.js";
|
|
5
5
|
export declare const createDetailValidation: () => zod.ZodObject<{
|
|
6
|
-
items: zod.
|
|
6
|
+
items: zod.ZodPipe<zod.ZodArray<zod.ZodObject<{
|
|
7
7
|
PK: zod.ZodString;
|
|
8
8
|
SK: zod.ZodString;
|
|
9
9
|
tableName: zod.ZodString;
|
|
10
|
-
tableType: zod.
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
tableType: zod.ZodPipe<zod.ZodEnum<{
|
|
11
|
+
log: "log";
|
|
12
|
+
opensearch: "opensearch";
|
|
13
|
+
regular: "regular";
|
|
14
|
+
unknown: "unknown";
|
|
15
|
+
}>, zod.ZodTransform<DynamoDBTableType, "log" | "opensearch" | "regular" | "unknown">>;
|
|
16
|
+
command: zod.ZodEnum<{
|
|
17
|
+
delete: "delete";
|
|
18
|
+
put: "put";
|
|
19
|
+
update: "update";
|
|
20
|
+
}>;
|
|
21
|
+
}, zod.core.$strip>>, zod.ZodTransform<NonEmptyArray<IResolverRecordBodyItem>, {
|
|
13
22
|
PK: string;
|
|
14
23
|
SK: string;
|
|
15
24
|
tableName: string;
|
|
16
25
|
tableType: DynamoDBTableType;
|
|
17
|
-
command: "
|
|
18
|
-
}
|
|
19
|
-
PK: string;
|
|
20
|
-
SK: string;
|
|
21
|
-
tableName: string;
|
|
22
|
-
tableType: "unknown" | "log" | "regular" | "elasticsearch";
|
|
23
|
-
command: "update" | "delete" | "put";
|
|
24
|
-
}>, "many">, {
|
|
25
|
-
PK: string;
|
|
26
|
-
SK: string;
|
|
27
|
-
tableName: string;
|
|
28
|
-
tableType: DynamoDBTableType;
|
|
29
|
-
command: "update" | "delete" | "put";
|
|
30
|
-
}[], {
|
|
31
|
-
PK: string;
|
|
32
|
-
SK: string;
|
|
33
|
-
tableName: string;
|
|
34
|
-
tableType: "unknown" | "log" | "regular" | "elasticsearch";
|
|
35
|
-
command: "update" | "delete" | "put";
|
|
36
|
-
}[]>, NonEmptyArray<IResolverRecordBodyItem>, {
|
|
37
|
-
PK: string;
|
|
38
|
-
SK: string;
|
|
39
|
-
tableName: string;
|
|
40
|
-
tableType: "unknown" | "log" | "regular" | "elasticsearch";
|
|
41
|
-
command: "update" | "delete" | "put";
|
|
42
|
-
}[]>;
|
|
26
|
+
command: "delete" | "put" | "update";
|
|
27
|
+
}[]>>;
|
|
43
28
|
source: zod.ZodObject<{
|
|
44
29
|
name: zod.ZodString;
|
|
45
30
|
env: zod.ZodString;
|
|
46
|
-
variant: zod.
|
|
31
|
+
variant: zod.ZodPipe<zod.ZodOptional<zod.ZodNullable<zod.ZodOptional<zod.ZodString>>>, zod.ZodTransform<string | undefined, string | null | undefined>>;
|
|
47
32
|
region: zod.ZodString;
|
|
48
33
|
version: zod.ZodString;
|
|
49
|
-
},
|
|
50
|
-
name: string;
|
|
51
|
-
region: string;
|
|
52
|
-
version: string;
|
|
53
|
-
env: string;
|
|
54
|
-
variant?: string | undefined;
|
|
55
|
-
}, {
|
|
56
|
-
name: string;
|
|
57
|
-
region: string;
|
|
58
|
-
version: string;
|
|
59
|
-
env: string;
|
|
60
|
-
variant?: string | null | undefined;
|
|
61
|
-
}>;
|
|
34
|
+
}, zod.core.$strip>;
|
|
62
35
|
id: zod.ZodString;
|
|
63
|
-
},
|
|
64
|
-
id: string;
|
|
65
|
-
source: {
|
|
66
|
-
name: string;
|
|
67
|
-
region: string;
|
|
68
|
-
version: string;
|
|
69
|
-
env: string;
|
|
70
|
-
variant?: string | undefined;
|
|
71
|
-
};
|
|
72
|
-
items: NonEmptyArray<IResolverRecordBodyItem>;
|
|
73
|
-
}, {
|
|
74
|
-
id: string;
|
|
75
|
-
source: {
|
|
76
|
-
name: string;
|
|
77
|
-
region: string;
|
|
78
|
-
version: string;
|
|
79
|
-
env: string;
|
|
80
|
-
variant?: string | null | undefined;
|
|
81
|
-
};
|
|
82
|
-
items: {
|
|
83
|
-
PK: string;
|
|
84
|
-
SK: string;
|
|
85
|
-
tableName: string;
|
|
86
|
-
tableType: "unknown" | "log" | "regular" | "elasticsearch";
|
|
87
|
-
command: "update" | "delete" | "put";
|
|
88
|
-
}[];
|
|
89
|
-
}>;
|
|
36
|
+
}, zod.core.$strip>;
|
|
@@ -1,50 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _types = require("../../../types.js");
|
|
11
|
-
const convert = input => {
|
|
12
|
-
/**
|
|
13
|
-
* We can safely cast as NonEmptyArray<IResolverRecordBodyItem> here because we already validated that the array is not empty.
|
|
14
|
-
*/
|
|
15
|
-
return input;
|
|
16
|
-
};
|
|
17
|
-
const transformTableType = input => {
|
|
18
|
-
const keys = Object.keys(_types.DynamoDBTableType);
|
|
19
|
-
for (const key of keys) {
|
|
20
|
-
const value = _types.DynamoDBTableType[key];
|
|
21
|
-
if (value === input) {
|
|
22
|
-
return value;
|
|
1
|
+
import zod from "zod";
|
|
2
|
+
import { createSystemValidation } from "./system.js";
|
|
3
|
+
import { DynamoDBTableType } from "../../../types.js";
|
|
4
|
+
const convert = (input)=>input;
|
|
5
|
+
const transformTableType = (input)=>{
|
|
6
|
+
const keys = Object.keys(DynamoDBTableType);
|
|
7
|
+
for (const key of keys){
|
|
8
|
+
const value = DynamoDBTableType[key];
|
|
9
|
+
if (value === input) return value;
|
|
23
10
|
}
|
|
24
|
-
|
|
25
|
-
return _types.DynamoDBTableType.UNKNOWN;
|
|
26
|
-
};
|
|
27
|
-
const createDetailValidation = () => {
|
|
28
|
-
return _zod.default.object({
|
|
29
|
-
items: _zod.default.array(_zod.default.object({
|
|
30
|
-
PK: _zod.default.string(),
|
|
31
|
-
SK: _zod.default.string(),
|
|
32
|
-
tableName: _zod.default.string(),
|
|
33
|
-
tableType: _zod.default.enum(["regular", "elasticsearch", "log", "unknown"]).transform(input => {
|
|
34
|
-
return transformTableType(input);
|
|
35
|
-
}),
|
|
36
|
-
command: _zod.default.enum(["update", "put", "delete"])
|
|
37
|
-
})).refine(values => {
|
|
38
|
-
return values.length > 0;
|
|
39
|
-
}, {
|
|
40
|
-
message: `"items" array must not be empty.`
|
|
41
|
-
}).transform(values => {
|
|
42
|
-
return convert(values);
|
|
43
|
-
}),
|
|
44
|
-
source: (0, _system.createSystemValidation)(),
|
|
45
|
-
id: _zod.default.string()
|
|
46
|
-
});
|
|
11
|
+
return DynamoDBTableType.UNKNOWN;
|
|
47
12
|
};
|
|
48
|
-
|
|
13
|
+
const createDetailValidation = ()=>zod.object({
|
|
14
|
+
items: zod.array(zod.object({
|
|
15
|
+
PK: zod.string(),
|
|
16
|
+
SK: zod.string(),
|
|
17
|
+
tableName: zod.string(),
|
|
18
|
+
tableType: zod["enum"]([
|
|
19
|
+
"regular",
|
|
20
|
+
"opensearch",
|
|
21
|
+
"log",
|
|
22
|
+
"unknown"
|
|
23
|
+
]).transform((input)=>transformTableType(input)),
|
|
24
|
+
command: zod["enum"]([
|
|
25
|
+
"update",
|
|
26
|
+
"put",
|
|
27
|
+
"delete"
|
|
28
|
+
])
|
|
29
|
+
})).refine((values)=>values.length > 0, {
|
|
30
|
+
message: '"items" array must not be empty.'
|
|
31
|
+
}).transform((values)=>convert(values)),
|
|
32
|
+
source: createSystemValidation(),
|
|
33
|
+
id: zod.string()
|
|
34
|
+
});
|
|
35
|
+
export { createDetailValidation };
|
|
49
36
|
|
|
50
37
|
//# sourceMappingURL=detail.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"resolver/app/validation/detail.js","sources":["../../../../src/resolver/app/validation/detail.ts"],"sourcesContent":["import zod from \"zod\";\nimport type { NonEmptyArray } from \"@webiny/api/types.js\";\nimport type { IResolverRecordBodyItem } from \"~/resolver/app/abstractions/ResolverRecord.js\";\nimport { createSystemValidation } from \"./system.js\";\nimport { DynamoDBTableType } from \"~/types.js\";\n\nconst convert = (input: IResolverRecordBodyItem[]) => {\n /**\n * We can safely cast as NonEmptyArray<IResolverRecordBodyItem> here because we already validated that the array is not empty.\n */\n return input as NonEmptyArray<IResolverRecordBodyItem>;\n};\n\nconst transformTableType = (input: string): DynamoDBTableType => {\n const keys = Object.keys(DynamoDBTableType) as (keyof typeof DynamoDBTableType)[];\n for (const key of keys) {\n const value = DynamoDBTableType[key];\n if (value === input) {\n return value;\n }\n }\n return DynamoDBTableType.UNKNOWN;\n};\n\nexport const createDetailValidation = () => {\n return zod.object({\n items: zod\n .array(\n zod.object({\n PK: zod.string(),\n SK: zod.string(),\n tableName: zod.string(),\n tableType: zod\n .enum([\"regular\", \"opensearch\", \"log\", \"unknown\"])\n .transform(input => {\n return transformTableType(input);\n }),\n command: zod.enum([\"update\", \"put\", \"delete\"])\n })\n )\n .refine(\n values => {\n return values.length > 0;\n },\n {\n message: `\"items\" array must not be empty.`\n }\n )\n .transform(values => {\n return convert(values);\n }),\n source: createSystemValidation(),\n id: zod.string()\n });\n};\n"],"names":["convert","input","transformTableType","keys","Object","DynamoDBTableType","key","value","createDetailValidation","zod","values","createSystemValidation"],"mappings":";;;AAMA,MAAMA,UAAU,CAACC,QAINA;AAGX,MAAMC,qBAAqB,CAACD;IACxB,MAAME,OAAOC,OAAO,IAAI,CAACC;IACzB,KAAK,MAAMC,OAAOH,KAAM;QACpB,MAAMI,QAAQF,iBAAiB,CAACC,IAAI;QACpC,IAAIC,UAAUN,OACV,OAAOM;IAEf;IACA,OAAOF,kBAAkB,OAAO;AACpC;AAEO,MAAMG,yBAAyB,IAC3BC,IAAI,MAAM,CAAC;QACd,OAAOA,IAAAA,KACG,CACFA,IAAI,MAAM,CAAC;YACP,IAAIA,IAAI,MAAM;YACd,IAAIA,IAAI,MAAM;YACd,WAAWA,IAAI,MAAM;YACrB,WAAWA,GAAG,CAAHA,OACF,CAAC;gBAAC;gBAAW;gBAAc;gBAAO;aAAU,EAChD,SAAS,CAACR,CAAAA,QACAC,mBAAmBD;YAElC,SAASQ,GAAG,CAAHA,OAAQ,CAAC;gBAAC;gBAAU;gBAAO;aAAS;QACjD,IAEH,MAAM,CACHC,CAAAA,SACWA,OAAO,MAAM,GAAG,GAE3B;YACI,SAAS;QACb,GAEH,SAAS,CAACA,CAAAA,SACAV,QAAQU;QAEvB,QAAQC;QACR,IAAIF,IAAI,MAAM;IAClB"}
|