@mavenmachines/event-handler-lib 1.5.0-es-manifest-command-processor-4 → 1.5.0-es-manifest-command-processor-5
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/package.json +1 -1
- package/dist/config/default.d.ts +0 -62
- package/dist/config/default.js +0 -83
- package/dist/config/default.js.map +0 -1
- package/dist/package.json +0 -100
- package/dist/src/app.module.d.ts +0 -19
- package/dist/src/app.module.js +0 -60
- package/dist/src/app.module.js.map +0 -1
- package/dist/src/clients/amqp/amqpClient.d.ts +0 -28
- package/dist/src/clients/amqp/amqpClient.js +0 -146
- package/dist/src/clients/amqp/amqpClient.js.map +0 -1
- package/dist/src/clients/amqp/amqpListener.d.ts +0 -21
- package/dist/src/clients/amqp/amqpListener.js +0 -95
- package/dist/src/clients/amqp/amqpListener.js.map +0 -1
- package/dist/src/clients/amqp/amqpPublisher.d.ts +0 -11
- package/dist/src/clients/amqp/amqpPublisher.js +0 -33
- package/dist/src/clients/amqp/amqpPublisher.js.map +0 -1
- package/dist/src/clients/amqp/errors.d.ts +0 -9
- package/dist/src/clients/amqp/errors.js +0 -22
- package/dist/src/clients/amqp/errors.js.map +0 -1
- package/dist/src/clients/amqp/helperTypes.d.ts +0 -2
- package/dist/src/clients/amqp/helperTypes.js +0 -3
- package/dist/src/clients/amqp/helperTypes.js.map +0 -1
- package/dist/src/clients/eventLogService.d.ts +0 -9
- package/dist/src/clients/eventLogService.js +0 -31
- package/dist/src/clients/eventLogService.js.map +0 -1
- package/dist/src/clients/kafka/kafkaAdminClient.d.ts +0 -21
- package/dist/src/clients/kafka/kafkaAdminClient.js +0 -86
- package/dist/src/clients/kafka/kafkaAdminClient.js.map +0 -1
- package/dist/src/clients/kafka/kafkaConsumer.d.ts +0 -23
- package/dist/src/clients/kafka/kafkaConsumer.js +0 -154
- package/dist/src/clients/kafka/kafkaConsumer.js.map +0 -1
- package/dist/src/clients/kafka/kafkaCredentials.d.ts +0 -15
- package/dist/src/clients/kafka/kafkaCredentials.js +0 -69
- package/dist/src/clients/kafka/kafkaCredentials.js.map +0 -1
- package/dist/src/clients/kafka/kafkaEventConsumer.d.ts +0 -22
- package/dist/src/clients/kafka/kafkaEventConsumer.js +0 -181
- package/dist/src/clients/kafka/kafkaEventConsumer.js.map +0 -1
- package/dist/src/clients/kafka/kafkaPartitionConfig.d.ts +0 -4
- package/dist/src/clients/kafka/kafkaPartitionConfig.js +0 -3
- package/dist/src/clients/kafka/kafkaPartitionConfig.js.map +0 -1
- package/dist/src/clients/kafka/kafkaProducer.d.ts +0 -17
- package/dist/src/clients/kafka/kafkaProducer.js +0 -79
- package/dist/src/clients/kafka/kafkaProducer.js.map +0 -1
- package/dist/src/clients/kafka/kafkaTopicManager.d.ts +0 -24
- package/dist/src/clients/kafka/kafkaTopicManager.js +0 -117
- package/dist/src/clients/kafka/kafkaTopicManager.js.map +0 -1
- package/dist/src/clients/mysqlClient.d.ts +0 -44
- package/dist/src/clients/mysqlClient.js +0 -186
- package/dist/src/clients/mysqlClient.js.map +0 -1
- package/dist/src/clients/openSearch/errors.d.ts +0 -13
- package/dist/src/clients/openSearch/errors.js +0 -23
- package/dist/src/clients/openSearch/errors.js.map +0 -1
- package/dist/src/clients/openSearch/mappings.d.ts +0 -10
- package/dist/src/clients/openSearch/mappings.js +0 -77
- package/dist/src/clients/openSearch/mappings.js.map +0 -1
- package/dist/src/clients/openSearch/openSearchClient.d.ts +0 -71
- package/dist/src/clients/openSearch/openSearchClient.js +0 -518
- package/dist/src/clients/openSearch/openSearchClient.js.map +0 -1
- package/dist/src/clients/redisClient.d.ts +0 -53
- package/dist/src/clients/redisClient.js +0 -193
- package/dist/src/clients/redisClient.js.map +0 -1
- package/dist/src/configs/companyConfiguration.d.ts +0 -22
- package/dist/src/configs/companyConfiguration.js +0 -85
- package/dist/src/configs/companyConfiguration.js.map +0 -1
- package/dist/src/configs/dynamoDb.config.d.ts +0 -9
- package/dist/src/configs/dynamoDb.config.js +0 -66
- package/dist/src/configs/dynamoDb.config.js.map +0 -1
- package/dist/src/configs/environment.d.ts +0 -1
- package/dist/src/configs/environment.js +0 -31
- package/dist/src/configs/environment.js.map +0 -1
- package/dist/src/configs/eventHandlerConfig.d.ts +0 -24
- package/dist/src/configs/eventHandlerConfig.js +0 -26
- package/dist/src/configs/eventHandlerConfig.js.map +0 -1
- package/dist/src/configs/firestore.config.d.ts +0 -9
- package/dist/src/configs/firestore.config.js +0 -38
- package/dist/src/configs/firestore.config.js.map +0 -1
- package/dist/src/configs/inversifyConfig.d.ts +0 -53
- package/dist/src/configs/inversifyConfig.js +0 -275
- package/dist/src/configs/inversifyConfig.js.map +0 -1
- package/dist/src/configs/kafka.config.d.ts +0 -9
- package/dist/src/configs/kafka.config.js +0 -78
- package/dist/src/configs/kafka.config.js.map +0 -1
- package/dist/src/configs/launchDarkly.d.ts +0 -2
- package/dist/src/configs/launchDarkly.js +0 -20
- package/dist/src/configs/launchDarkly.js.map +0 -1
- package/dist/src/configs/mysql.d.ts +0 -13
- package/dist/src/configs/mysql.js +0 -68
- package/dist/src/configs/mysql.js.map +0 -1
- package/dist/src/configs/node_envs.d.ts +0 -1
- package/dist/src/configs/node_envs.js +0 -3
- package/dist/src/configs/node_envs.js.map +0 -1
- package/dist/src/configs/opensearch.config.d.ts +0 -8
- package/dist/src/configs/opensearch.config.js +0 -53
- package/dist/src/configs/opensearch.config.js.map +0 -1
- package/dist/src/configs/redis.config.d.ts +0 -9
- package/dist/src/configs/redis.config.js +0 -32
- package/dist/src/configs/redis.config.js.map +0 -1
- package/dist/src/dependencies/dependencyTypes.d.ts +0 -20
- package/dist/src/dependencies/dependencyTypes.js +0 -24
- package/dist/src/dependencies/dependencyTypes.js.map +0 -1
- package/dist/src/dependencies/inversify.config.d.ts +0 -3
- package/dist/src/dependencies/inversify.config.js +0 -18
- package/dist/src/dependencies/inversify.config.js.map +0 -1
- package/dist/src/exports/clients.d.ts +0 -15
- package/dist/src/exports/clients.js +0 -37
- package/dist/src/exports/clients.js.map +0 -1
- package/dist/src/exports/configs.d.ts +0 -8
- package/dist/src/exports/configs.js +0 -18
- package/dist/src/exports/configs.js.map +0 -1
- package/dist/src/exports/errors.d.ts +0 -6
- package/dist/src/exports/errors.js +0 -21
- package/dist/src/exports/errors.js.map +0 -1
- package/dist/src/exports/index.d.ts +0 -11
- package/dist/src/exports/index.js +0 -28
- package/dist/src/exports/index.js.map +0 -1
- package/dist/src/exports/infrastructure.d.ts +0 -10
- package/dist/src/exports/infrastructure.js +0 -21
- package/dist/src/exports/infrastructure.js.map +0 -1
- package/dist/src/exports/plugins.d.ts +0 -3
- package/dist/src/exports/plugins.js +0 -12
- package/dist/src/exports/plugins.js.map +0 -1
- package/dist/src/exports/rpc.d.ts +0 -6
- package/dist/src/exports/rpc.js +0 -26
- package/dist/src/exports/rpc.js.map +0 -1
- package/dist/src/exports/services.d.ts +0 -7
- package/dist/src/exports/services.js +0 -18
- package/dist/src/exports/services.js.map +0 -1
- package/dist/src/exports/sourcing.d.ts +0 -17
- package/dist/src/exports/sourcing.js +0 -53
- package/dist/src/exports/sourcing.js.map +0 -1
- package/dist/src/exports/testing.d.ts +0 -7
- package/dist/src/exports/testing.js +0 -24
- package/dist/src/exports/testing.js.map +0 -1
- package/dist/src/exports/types.d.ts +0 -9
- package/dist/src/exports/types.js +0 -19
- package/dist/src/exports/types.js.map +0 -1
- package/dist/src/exports/utils.d.ts +0 -12
- package/dist/src/exports/utils.js +0 -43
- package/dist/src/exports/utils.js.map +0 -1
- package/dist/src/handlers/baseHandler.d.ts +0 -78
- package/dist/src/handlers/baseHandler.js +0 -332
- package/dist/src/handlers/baseHandler.js.map +0 -1
- package/dist/src/handlers/commandHandlers/baseCommandHandler.d.ts +0 -38
- package/dist/src/handlers/commandHandlers/baseCommandHandler.js +0 -99
- package/dist/src/handlers/commandHandlers/baseCommandHandler.js.map +0 -1
- package/dist/src/handlers/commandHandlers/commandHandlingModule.d.ts +0 -13
- package/dist/src/handlers/commandHandlers/commandHandlingModule.js +0 -72
- package/dist/src/handlers/commandHandlers/commandHandlingModule.js.map +0 -1
- package/dist/src/handlers/crud/baseHandlers.d.ts +0 -26
- package/dist/src/handlers/crud/baseHandlers.js +0 -129
- package/dist/src/handlers/crud/baseHandlers.js.map +0 -1
- package/dist/src/handlers/crud/createProjectionHandler.d.ts +0 -10
- package/dist/src/handlers/crud/createProjectionHandler.js +0 -73
- package/dist/src/handlers/crud/createProjectionHandler.js.map +0 -1
- package/dist/src/handlers/crud/createUpdateProjectionHandler.d.ts +0 -10
- package/dist/src/handlers/crud/createUpdateProjectionHandler.js +0 -65
- package/dist/src/handlers/crud/createUpdateProjectionHandler.js.map +0 -1
- package/dist/src/handlers/crud/decorators.d.ts +0 -9
- package/dist/src/handlers/crud/decorators.js +0 -11
- package/dist/src/handlers/crud/decorators.js.map +0 -1
- package/dist/src/handlers/crud/deleteProjectionHandler.d.ts +0 -9
- package/dist/src/handlers/crud/deleteProjectionHandler.js +0 -43
- package/dist/src/handlers/crud/deleteProjectionHandler.js.map +0 -1
- package/dist/src/handlers/crud/getProjectionHandler.d.ts +0 -12
- package/dist/src/handlers/crud/getProjectionHandler.js +0 -58
- package/dist/src/handlers/crud/getProjectionHandler.js.map +0 -1
- package/dist/src/handlers/crud/getProjectionsHandler.d.ts +0 -11
- package/dist/src/handlers/crud/getProjectionsHandler.js +0 -76
- package/dist/src/handlers/crud/getProjectionsHandler.js.map +0 -1
- package/dist/src/handlers/crud/helpers.d.ts +0 -36
- package/dist/src/handlers/crud/helpers.js +0 -233
- package/dist/src/handlers/crud/helpers.js.map +0 -1
- package/dist/src/handlers/crud/index.d.ts +0 -33
- package/dist/src/handlers/crud/index.js +0 -108
- package/dist/src/handlers/crud/index.js.map +0 -1
- package/dist/src/handlers/crud/schemaHandler.d.ts +0 -24
- package/dist/src/handlers/crud/schemaHandler.js +0 -158
- package/dist/src/handlers/crud/schemaHandler.js.map +0 -1
- package/dist/src/handlers/crud/searchProjectionsHandler.d.ts +0 -10
- package/dist/src/handlers/crud/searchProjectionsHandler.js +0 -226
- package/dist/src/handlers/crud/searchProjectionsHandler.js.map +0 -1
- package/dist/src/handlers/crud/types.d.ts +0 -49
- package/dist/src/handlers/crud/types.js +0 -42
- package/dist/src/handlers/crud/types.js.map +0 -1
- package/dist/src/handlers/eventHandlers/baseEventHandler.d.ts +0 -39
- package/dist/src/handlers/eventHandlers/baseEventHandler.js +0 -124
- package/dist/src/handlers/eventHandlers/baseEventHandler.js.map +0 -1
- package/dist/src/handlers/eventHandlers/eventHandlingModule.d.ts +0 -28
- package/dist/src/handlers/eventHandlers/eventHandlingModule.js +0 -112
- package/dist/src/handlers/eventHandlers/eventHandlingModule.js.map +0 -1
- package/dist/src/handlers/eventHandlers/syncFirestoreEvents.d.ts +0 -24
- package/dist/src/handlers/eventHandlers/syncFirestoreEvents.js +0 -116
- package/dist/src/handlers/eventHandlers/syncFirestoreEvents.js.map +0 -1
- package/dist/src/helpers/app.helpers.d.ts +0 -17
- package/dist/src/helpers/app.helpers.js +0 -82
- package/dist/src/helpers/app.helpers.js.map +0 -1
- package/dist/src/helpers/async.helpers.d.ts +0 -30
- package/dist/src/helpers/async.helpers.js +0 -94
- package/dist/src/helpers/async.helpers.js.map +0 -1
- package/dist/src/helpers/asyncDebugContext.d.ts +0 -6
- package/dist/src/helpers/asyncDebugContext.js +0 -15
- package/dist/src/helpers/asyncDebugContext.js.map +0 -1
- package/dist/src/helpers/classConverter.d.ts +0 -21
- package/dist/src/helpers/classConverter.js +0 -100
- package/dist/src/helpers/classConverter.js.map +0 -1
- package/dist/src/helpers/dataStructure.helpers.d.ts +0 -28
- package/dist/src/helpers/dataStructure.helpers.js +0 -170
- package/dist/src/helpers/dataStructure.helpers.js.map +0 -1
- package/dist/src/helpers/dynamoDB.client.d.ts +0 -20
- package/dist/src/helpers/dynamoDB.client.js +0 -152
- package/dist/src/helpers/dynamoDB.client.js.map +0 -1
- package/dist/src/helpers/index.d.ts +0 -8
- package/dist/src/helpers/index.js +0 -40
- package/dist/src/helpers/index.js.map +0 -1
- package/dist/src/helpers/plugins/projectionModifierPlugin.d.ts +0 -24
- package/dist/src/helpers/plugins/projectionModifierPlugin.js +0 -157
- package/dist/src/helpers/plugins/projectionModifierPlugin.js.map +0 -1
- package/dist/src/helpers/plugins/syncFirestore.d.ts +0 -40
- package/dist/src/helpers/plugins/syncFirestore.js +0 -174
- package/dist/src/helpers/plugins/syncFirestore.js.map +0 -1
- package/dist/src/helpers/plugins/syncOpensearchIndex.d.ts +0 -19
- package/dist/src/helpers/plugins/syncOpensearchIndex.js +0 -131
- package/dist/src/helpers/plugins/syncOpensearchIndex.js.map +0 -1
- package/dist/src/helpers/plugins/syncProjectionBlurb.d.ts +0 -38
- package/dist/src/helpers/plugins/syncProjectionBlurb.js +0 -211
- package/dist/src/helpers/plugins/syncProjectionBlurb.js.map +0 -1
- package/dist/src/helpers/projectionModifier.d.ts +0 -33
- package/dist/src/helpers/projectionModifier.js +0 -158
- package/dist/src/helpers/projectionModifier.js.map +0 -1
- package/dist/src/helpers/referenceIdGenerator.d.ts +0 -5
- package/dist/src/helpers/referenceIdGenerator.js +0 -43
- package/dist/src/helpers/referenceIdGenerator.js.map +0 -1
- package/dist/src/helpers/routingKeyGenerator.d.ts +0 -4
- package/dist/src/helpers/routingKeyGenerator.js +0 -23
- package/dist/src/helpers/routingKeyGenerator.js.map +0 -1
- package/dist/src/helpers/string.helpers.d.ts +0 -4
- package/dist/src/helpers/string.helpers.js +0 -38
- package/dist/src/helpers/string.helpers.js.map +0 -1
- package/dist/src/helpers/tcp.helpers.d.ts +0 -1
- package/dist/src/helpers/tcp.helpers.js +0 -31
- package/dist/src/helpers/tcp.helpers.js.map +0 -1
- package/dist/src/helpers/typeManipulation/classValidation.d.ts +0 -7
- package/dist/src/helpers/typeManipulation/classValidation.js +0 -30
- package/dist/src/helpers/typeManipulation/classValidation.js.map +0 -1
- package/dist/src/helpers/typeManipulation/decorators.d.ts +0 -16
- package/dist/src/helpers/typeManipulation/decorators.js +0 -144
- package/dist/src/helpers/typeManipulation/decorators.js.map +0 -1
- package/dist/src/helpers/typeManipulation/dynamicClasses.d.ts +0 -7
- package/dist/src/helpers/typeManipulation/dynamicClasses.js +0 -54
- package/dist/src/helpers/typeManipulation/dynamicClasses.js.map +0 -1
- package/dist/src/helpers/typeManipulation/index.d.ts +0 -3
- package/dist/src/helpers/typeManipulation/index.js +0 -20
- package/dist/src/helpers/typeManipulation/index.js.map +0 -1
- package/dist/src/helpers/version.d.ts +0 -1
- package/dist/src/helpers/version.js +0 -39
- package/dist/src/helpers/version.js.map +0 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.js +0 -18
- package/dist/src/index.js.map +0 -1
- package/dist/src/initializers/featureflag.interface.d.ts +0 -6
- package/dist/src/initializers/featureflag.interface.js +0 -3
- package/dist/src/initializers/featureflag.interface.js.map +0 -1
- package/dist/src/initializers/featureflag.service.d.ts +0 -13
- package/dist/src/initializers/featureflag.service.js +0 -64
- package/dist/src/initializers/featureflag.service.js.map +0 -1
- package/dist/src/initializers/logger.service.d.ts +0 -29
- package/dist/src/initializers/logger.service.js +0 -198
- package/dist/src/initializers/logger.service.js.map +0 -1
- package/dist/src/initializers/metrics.d.ts +0 -20
- package/dist/src/initializers/metrics.js +0 -94
- package/dist/src/initializers/metrics.js.map +0 -1
- package/dist/src/initializers/monitoring.service.d.ts +0 -31
- package/dist/src/initializers/monitoring.service.js +0 -117
- package/dist/src/initializers/monitoring.service.js.map +0 -1
- package/dist/src/initializers/queue-manager.interface.d.ts +0 -10
- package/dist/src/initializers/queue-manager.interface.js +0 -3
- package/dist/src/initializers/queue-manager.interface.js.map +0 -1
- package/dist/src/initializers/queue-manager.service.d.ts +0 -18
- package/dist/src/initializers/queue-manager.service.js +0 -104
- package/dist/src/initializers/queue-manager.service.js.map +0 -1
- package/dist/src/initializers/secretManager.service.d.ts +0 -7
- package/dist/src/initializers/secretManager.service.js +0 -46
- package/dist/src/initializers/secretManager.service.js.map +0 -1
- package/dist/src/libs/firestore/firestore.client.d.ts +0 -28
- package/dist/src/libs/firestore/firestore.client.js +0 -248
- package/dist/src/libs/firestore/firestore.client.js.map +0 -1
- package/dist/src/libs/firestore/firestore.helpers.d.ts +0 -8
- package/dist/src/libs/firestore/firestore.helpers.js +0 -61
- package/dist/src/libs/firestore/firestore.helpers.js.map +0 -1
- package/dist/src/libs/firestore/firestore.types.d.ts +0 -32
- package/dist/src/libs/firestore/firestore.types.js +0 -30
- package/dist/src/libs/firestore/firestore.types.js.map +0 -1
- package/dist/src/repositories/baseDynamoRepository.d.ts +0 -28
- package/dist/src/repositories/baseDynamoRepository.js +0 -99
- package/dist/src/repositories/baseDynamoRepository.js.map +0 -1
- package/dist/src/repositories/baseFirestoreRepository.d.ts +0 -29
- package/dist/src/repositories/baseFirestoreRepository.js +0 -144
- package/dist/src/repositories/baseFirestoreRepository.js.map +0 -1
- package/dist/src/repositories/eventLogRepository.d.ts +0 -13
- package/dist/src/repositories/eventLogRepository.js +0 -64
- package/dist/src/repositories/eventLogRepository.js.map +0 -1
- package/dist/src/repositories/projectionRepository.d.ts +0 -39
- package/dist/src/repositories/projectionRepository.js +0 -209
- package/dist/src/repositories/projectionRepository.js.map +0 -1
- package/dist/src/repositories/stateRepository.d.ts +0 -51
- package/dist/src/repositories/stateRepository.js +0 -204
- package/dist/src/repositories/stateRepository.js.map +0 -1
- package/dist/src/rpc/abstractRpcClient.d.ts +0 -83
- package/dist/src/rpc/abstractRpcClient.js +0 -255
- package/dist/src/rpc/abstractRpcClient.js.map +0 -1
- package/dist/src/rpc/abstractRpcHandler.d.ts +0 -26
- package/dist/src/rpc/abstractRpcHandler.js +0 -97
- package/dist/src/rpc/abstractRpcHandler.js.map +0 -1
- package/dist/src/rpc/directoryService.rpc.d.ts +0 -18
- package/dist/src/rpc/directoryService.rpc.js +0 -58
- package/dist/src/rpc/directoryService.rpc.js.map +0 -1
- package/dist/src/rpc/returnEventService.rpc.d.ts +0 -7
- package/dist/src/rpc/returnEventService.rpc.js +0 -31
- package/dist/src/rpc/returnEventService.rpc.js.map +0 -1
- package/dist/src/rpc/rpcModule.d.ts +0 -10
- package/dist/src/rpc/rpcModule.js +0 -43
- package/dist/src/rpc/rpcModule.js.map +0 -1
- package/dist/src/rpc/rpcProtocols.d.ts +0 -89
- package/dist/src/rpc/rpcProtocols.js +0 -223
- package/dist/src/rpc/rpcProtocols.js.map +0 -1
- package/dist/src/testUtils/bootstrapDatabase.d.ts +0 -9
- package/dist/src/testUtils/bootstrapDatabase.js +0 -99
- package/dist/src/testUtils/bootstrapDatabase.js.map +0 -1
- package/dist/src/testUtils/index.d.ts +0 -1
- package/dist/src/testUtils/index.js +0 -7
- package/dist/src/testUtils/index.js.map +0 -1
- package/dist/src/testUtils/mocks/directoryServiceClient.mock.d.ts +0 -10
- package/dist/src/testUtils/mocks/directoryServiceClient.mock.js +0 -58
- package/dist/src/testUtils/mocks/directoryServiceClient.mock.js.map +0 -1
- package/dist/src/testUtils/mocks/esReferencesStoreClient.mock.d.ts +0 -9
- package/dist/src/testUtils/mocks/esReferencesStoreClient.mock.js +0 -64
- package/dist/src/testUtils/mocks/esReferencesStoreClient.mock.js.map +0 -1
- package/dist/src/testUtils/mocks/featureFlagClient.mock.d.ts +0 -9
- package/dist/src/testUtils/mocks/featureFlagClient.mock.js +0 -32
- package/dist/src/testUtils/mocks/featureFlagClient.mock.js.map +0 -1
- package/dist/src/testUtils/mocks/kafkajs.mock.d.ts +0 -3
- package/dist/src/testUtils/mocks/kafkajs.mock.js +0 -132
- package/dist/src/testUtils/mocks/kafkajs.mock.js.map +0 -1
- package/dist/src/testUtils/mocks/monitoring-service.mock.d.ts +0 -6
- package/dist/src/testUtils/mocks/monitoring-service.mock.js +0 -43
- package/dist/src/testUtils/mocks/monitoring-service.mock.js.map +0 -1
- package/dist/src/testUtils/mocks/openSearch.client.mock.d.ts +0 -102
- package/dist/src/testUtils/mocks/openSearch.client.mock.js +0 -405
- package/dist/src/testUtils/mocks/openSearch.client.mock.js.map +0 -1
- package/dist/src/testUtils/testDependencies.d.ts +0 -101
- package/dist/src/testUtils/testDependencies.js +0 -249
- package/dist/src/testUtils/testDependencies.js.map +0 -1
- package/dist/src/types/commandHandler.d.ts +0 -16
- package/dist/src/types/commandHandler.js +0 -3
- package/dist/src/types/commandHandler.js.map +0 -1
- package/dist/src/types/enums/events.d.ts +0 -7
- package/dist/src/types/enums/events.js +0 -12
- package/dist/src/types/enums/events.js.map +0 -1
- package/dist/src/types/enums/rpc-error-keys.enum.d.ts +0 -6
- package/dist/src/types/enums/rpc-error-keys.enum.js +0 -11
- package/dist/src/types/enums/rpc-error-keys.enum.js.map +0 -1
- package/dist/src/types/enums/rpc-response-status.enum.d.ts +0 -4
- package/dist/src/types/enums/rpc-response-status.enum.js +0 -9
- package/dist/src/types/enums/rpc-response-status.enum.js.map +0 -1
- package/dist/src/types/eventHandler.d.ts +0 -6
- package/dist/src/types/eventHandler.js +0 -3
- package/dist/src/types/eventHandler.js.map +0 -1
- package/dist/src/types/eventSourcedEvent.type.d.ts +0 -26
- package/dist/src/types/eventSourcedEvent.type.js +0 -22
- package/dist/src/types/eventSourcedEvent.type.js.map +0 -1
- package/dist/src/types/eventSourcedProjection.type.d.ts +0 -41
- package/dist/src/types/eventSourcedProjection.type.js +0 -10
- package/dist/src/types/eventSourcedProjection.type.js.map +0 -1
- package/dist/src/types/generic.types.d.ts +0 -25
- package/dist/src/types/generic.types.js +0 -13
- package/dist/src/types/generic.types.js.map +0 -1
- package/dist/src/types/referenceIds.type.d.ts +0 -1
- package/dist/src/types/referenceIds.type.js +0 -3
- package/dist/src/types/referenceIds.type.js.map +0 -1
- package/dist/src/types/rpc/returnEvent.types.d.ts +0 -7
- package/dist/src/types/rpc/returnEvent.types.js +0 -3
- package/dist/src/types/rpc/returnEvent.types.js.map +0 -1
- package/dist/src/types/rpc.d.ts +0 -7
- package/dist/src/types/rpc.js +0 -3
- package/dist/src/types/rpc.js.map +0 -1
- package/dist/test/testImplementations/testCommandHandler.d.ts +0 -22
- package/dist/test/testImplementations/testCommandHandler.js +0 -75
- package/dist/test/testImplementations/testCommandHandler.js.map +0 -1
- package/dist/test/testImplementations/testCrud.d.ts +0 -48
- package/dist/test/testImplementations/testCrud.js +0 -233
- package/dist/test/testImplementations/testCrud.js.map +0 -1
- package/dist/test/testImplementations/testEventHandler.d.ts +0 -20
- package/dist/test/testImplementations/testEventHandler.js +0 -115
- package/dist/test/testImplementations/testEventHandler.js.map +0 -1
- package/dist/test/testImplementations/testFirestoreEventSync.d.ts +0 -19
- package/dist/test/testImplementations/testFirestoreEventSync.js +0 -34
- package/dist/test/testImplementations/testFirestoreEventSync.js.map +0 -1
- package/dist/test/testImplementations/testFirestoreSync.d.ts +0 -32
- package/dist/test/testImplementations/testFirestoreSync.js +0 -96
- package/dist/test/testImplementations/testFirestoreSync.js.map +0 -1
- package/dist/test/testImplementations/testProjectionBlurbSync.d.ts +0 -21
- package/dist/test/testImplementations/testProjectionBlurbSync.js +0 -51
- package/dist/test/testImplementations/testProjectionBlurbSync.js.map +0 -1
- package/dist/test/tests/clients/amqp.client.spec.d.ts +0 -1
- package/dist/test/tests/clients/amqp.client.spec.js +0 -68
- package/dist/test/tests/clients/amqp.client.spec.js.map +0 -1
- package/dist/test/tests/clients/companyConfiguration.spec.d.ts +0 -1
- package/dist/test/tests/clients/companyConfiguration.spec.js +0 -70
- package/dist/test/tests/clients/companyConfiguration.spec.js.map +0 -1
- package/dist/test/tests/clients/kafkaEventConsumer.spec.d.ts +0 -1
- package/dist/test/tests/clients/kafkaEventConsumer.spec.js +0 -70
- package/dist/test/tests/clients/kafkaEventConsumer.spec.js.map +0 -1
- package/dist/test/tests/clients/mysql.client.spec.d.ts +0 -1
- package/dist/test/tests/clients/mysql.client.spec.js +0 -143
- package/dist/test/tests/clients/mysql.client.spec.js.map +0 -1
- package/dist/test/tests/clients/opensearch.client.spec.d.ts +0 -1
- package/dist/test/tests/clients/opensearch.client.spec.js +0 -63
- package/dist/test/tests/clients/opensearch.client.spec.js.map +0 -1
- package/dist/test/tests/clients/redis.client.spec.d.ts +0 -1
- package/dist/test/tests/clients/redis.client.spec.js +0 -110
- package/dist/test/tests/clients/redis.client.spec.js.map +0 -1
- package/dist/test/tests/common.d.ts +0 -5
- package/dist/test/tests/common.js +0 -105
- package/dist/test/tests/common.js.map +0 -1
- package/dist/test/tests/eventHandlers/baseCommandHandler.spec.d.ts +0 -1
- package/dist/test/tests/eventHandlers/baseCommandHandler.spec.js +0 -127
- package/dist/test/tests/eventHandlers/baseCommandHandler.spec.js.map +0 -1
- package/dist/test/tests/eventHandlers/baseEventHandler.spec.d.ts +0 -1
- package/dist/test/tests/eventHandlers/baseEventHandler.spec.js +0 -247
- package/dist/test/tests/eventHandlers/baseEventHandler.spec.js.map +0 -1
- package/dist/test/tests/eventHandlers/crudHandlers.spec.d.ts +0 -1
- package/dist/test/tests/eventHandlers/crudHandlers.spec.js +0 -691
- package/dist/test/tests/eventHandlers/crudHandlers.spec.js.map +0 -1
- package/dist/test/tests/eventHandlers/firestoreEventSyncHandler.spec.d.ts +0 -1
- package/dist/test/tests/eventHandlers/firestoreEventSyncHandler.spec.js +0 -65
- package/dist/test/tests/eventHandlers/firestoreEventSyncHandler.spec.js.map +0 -1
- package/dist/test/tests/helpers/classConverter.spec.d.ts +0 -1
- package/dist/test/tests/helpers/classConverter.spec.js +0 -82
- package/dist/test/tests/helpers/classConverter.spec.js.map +0 -1
- package/dist/test/tests/helpers/dataStructure.helpers.spec.d.ts +0 -1
- package/dist/test/tests/helpers/dataStructure.helpers.spec.js +0 -375
- package/dist/test/tests/helpers/dataStructure.helpers.spec.js.map +0 -1
- package/dist/test/tests/helpers/decorators.spec.d.ts +0 -1
- package/dist/test/tests/helpers/decorators.spec.js +0 -109
- package/dist/test/tests/helpers/decorators.spec.js.map +0 -1
- package/dist/test/tests/helpers/eventHandlerVersion.spec.d.ts +0 -1
- package/dist/test/tests/helpers/eventHandlerVersion.spec.js +0 -11
- package/dist/test/tests/helpers/eventHandlerVersion.spec.js.map +0 -1
- package/dist/test/tests/helpers/projectionModifier.spec.d.ts +0 -1
- package/dist/test/tests/helpers/projectionModifier.spec.js +0 -164
- package/dist/test/tests/helpers/projectionModifier.spec.js.map +0 -1
- package/dist/test/tests/helpers/referenceIdGenerator.spec.d.ts +0 -1
- package/dist/test/tests/helpers/referenceIdGenerator.spec.js +0 -39
- package/dist/test/tests/helpers/referenceIdGenerator.spec.js.map +0 -1
- package/dist/test/tests/helpers/syncFirestore.spec.d.ts +0 -1
- package/dist/test/tests/helpers/syncFirestore.spec.js +0 -383
- package/dist/test/tests/helpers/syncFirestore.spec.js.map +0 -1
- package/dist/test/tests/helpers/syncOpensearch.spec.d.ts +0 -1
- package/dist/test/tests/helpers/syncOpensearch.spec.js +0 -168
- package/dist/test/tests/helpers/syncOpensearch.spec.js.map +0 -1
- package/dist/test/tests/helpers/syncProjectionBlurbs.spec.d.ts +0 -1
- package/dist/test/tests/helpers/syncProjectionBlurbs.spec.js +0 -161
- package/dist/test/tests/helpers/syncProjectionBlurbs.spec.js.map +0 -1
- package/dist/test/tests/helpers/tcp.helpers.spec.d.ts +0 -1
- package/dist/test/tests/helpers/tcp.helpers.spec.js +0 -69
- package/dist/test/tests/helpers/tcp.helpers.spec.js.map +0 -1
- package/dist/test/tests/repositories/projectionRepository.spec.d.ts +0 -1
- package/dist/test/tests/repositories/projectionRepository.spec.js +0 -261
- package/dist/test/tests/repositories/projectionRepository.spec.js.map +0 -1
- package/dist/test/tests/repositories/stateRepository.spec.d.ts +0 -1
- package/dist/test/tests/repositories/stateRepository.spec.js +0 -244
- package/dist/test/tests/repositories/stateRepository.spec.js.map +0 -1
|
@@ -1,691 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const class_validator_1 = require("class-validator");
|
|
7
|
-
const class_transformer_1 = require("class-transformer");
|
|
8
|
-
const crypto_1 = require("crypto");
|
|
9
|
-
const chai_1 = require("chai");
|
|
10
|
-
const lodash_1 = require("lodash");
|
|
11
|
-
const exports_1 = require("../../../src/exports");
|
|
12
|
-
const testCrud_1 = require("../../testImplementations/testCrud");
|
|
13
|
-
const common_1 = require("../common");
|
|
14
|
-
const assert_1 = require("assert");
|
|
15
|
-
const createProjectionHandler_1 = require("../../../src/handlers/crud/createProjectionHandler");
|
|
16
|
-
const createUpdateProjectionHandler_1 = require("../../../src/handlers/crud/createUpdateProjectionHandler");
|
|
17
|
-
const errors_1 = require("../../../src/clients/openSearch/errors");
|
|
18
|
-
const haversine_distance_1 = __importDefault(require("haversine-distance"));
|
|
19
|
-
function doValidate(e, type, expectedError) {
|
|
20
|
-
const instance = (0, class_transformer_1.plainToInstance)(type, e);
|
|
21
|
-
const errors = (0, class_validator_1.validateSync)(instance);
|
|
22
|
-
if (expectedError) {
|
|
23
|
-
(0, chai_1.expect)(errors.join(", ")).to.include(expectedError);
|
|
24
|
-
}
|
|
25
|
-
else if (errors.length) {
|
|
26
|
-
throw new Error(errors.join(", "));
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
class CreateExampleRequest extends (0, createProjectionHandler_1.createCreateRequest)(testCrud_1.ExampleProjection) {
|
|
30
|
-
}
|
|
31
|
-
class UpdateExampleRequest extends (0, createUpdateProjectionHandler_1.createUpdateRequest)(testCrud_1.ExampleProjection) {
|
|
32
|
-
}
|
|
33
|
-
describe("Abstract CRUD handler", () => {
|
|
34
|
-
let appContainer;
|
|
35
|
-
let deps;
|
|
36
|
-
before(async () => {
|
|
37
|
-
appContainer = await (0, common_1.getTestAppContainer)();
|
|
38
|
-
deps = await (0, exports_1.getTestDependencies)(appContainer);
|
|
39
|
-
});
|
|
40
|
-
(0, exports_1.registerTestHooks)(() => deps);
|
|
41
|
-
describe("Type Validation", () => {
|
|
42
|
-
it("Should properly handle a create request", async () => {
|
|
43
|
-
doValidate({ companyId: deps.companyId, ...(0, lodash_1.omit)(testCrud_1.exampleProjection, "id") }, CreateExampleRequest);
|
|
44
|
-
});
|
|
45
|
-
it("Should properly handle an update request", async () => {
|
|
46
|
-
doValidate({
|
|
47
|
-
companyId: deps.companyId,
|
|
48
|
-
id: (0, crypto_1.randomUUID)(),
|
|
49
|
-
optionalEditableObject: {
|
|
50
|
-
optionalEditableNumber: 9,
|
|
51
|
-
},
|
|
52
|
-
}, UpdateExampleRequest);
|
|
53
|
-
});
|
|
54
|
-
it("Should fail update request for invalid types", async () => {
|
|
55
|
-
doValidate({
|
|
56
|
-
companyId: deps.companyId,
|
|
57
|
-
id: (0, crypto_1.randomUUID)(),
|
|
58
|
-
optionalEditableNumber: "string",
|
|
59
|
-
}, CreateExampleRequest, "property optionalEditableNumber has failed the following constraints: isNumber");
|
|
60
|
-
});
|
|
61
|
-
it("Should fail update of nested field", async () => {
|
|
62
|
-
doValidate({
|
|
63
|
-
companyId: deps.companyId,
|
|
64
|
-
id: (0, crypto_1.randomUUID)(),
|
|
65
|
-
optionalEditableObject: {
|
|
66
|
-
optionalEditableNumber: "9",
|
|
67
|
-
},
|
|
68
|
-
}, CreateExampleRequest, "property optionalEditableObject.optionalEditableNumber has failed the following constraints: isNumber");
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
describe("createProjectionHandler", () => {
|
|
72
|
-
it("Should create a new projection", async () => {
|
|
73
|
-
const { id } = await deps.rpc("createExampleProjection", {
|
|
74
|
-
...testCrud_1.exampleProjection,
|
|
75
|
-
companyId: deps.companyId,
|
|
76
|
-
});
|
|
77
|
-
const loaded = await deps.projectionRepository.loadItem({
|
|
78
|
-
companyId: deps.companyId,
|
|
79
|
-
projectionType: "exampleProjection",
|
|
80
|
-
entityId: id,
|
|
81
|
-
});
|
|
82
|
-
(0, chai_1.expect)(loaded.payload).to.deep.equal({
|
|
83
|
-
companyId: deps.companyId,
|
|
84
|
-
...testCrud_1.exampleProjection,
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
it("Should allow a custom creationRequest", async () => {
|
|
88
|
-
const creationRequestEntityId = (0, crypto_1.randomUUID)();
|
|
89
|
-
const creationRequestProjection = await deps.projectionRepository.putItem({
|
|
90
|
-
companyId: deps.companyId,
|
|
91
|
-
projectionType: "creationRequestProjection",
|
|
92
|
-
entityId: creationRequestEntityId,
|
|
93
|
-
payload: {
|
|
94
|
-
companyId: deps.companyId,
|
|
95
|
-
id: creationRequestEntityId,
|
|
96
|
-
name: "Requested Projection Name",
|
|
97
|
-
},
|
|
98
|
-
});
|
|
99
|
-
const { id } = await deps.rpc("createCreationRequestProjection", {
|
|
100
|
-
companyId: deps.companyId,
|
|
101
|
-
requestedId: creationRequestEntityId,
|
|
102
|
-
});
|
|
103
|
-
const projection = await deps.projectionRepository.loadItem({
|
|
104
|
-
companyId: deps.companyId,
|
|
105
|
-
projectionType: "creationRequestProjection",
|
|
106
|
-
entityId: id,
|
|
107
|
-
});
|
|
108
|
-
(0, chai_1.expect)(projection.payload).to.deep.equal(creationRequestProjection.payload);
|
|
109
|
-
});
|
|
110
|
-
it("Should allow a nested custom creationRequest", async () => {
|
|
111
|
-
const creationRequestEntityId = (0, crypto_1.randomUUID)();
|
|
112
|
-
const creationRequestProjection = await deps.projectionRepository.putItem({
|
|
113
|
-
companyId: deps.companyId,
|
|
114
|
-
projectionType: "creationRequestProjection",
|
|
115
|
-
entityId: creationRequestEntityId,
|
|
116
|
-
payload: {
|
|
117
|
-
companyId: deps.companyId,
|
|
118
|
-
id: creationRequestEntityId,
|
|
119
|
-
name: "Requested Projection Name",
|
|
120
|
-
},
|
|
121
|
-
});
|
|
122
|
-
const { id } = await deps.rpc("createCreationRequestProjectionEnvelope", {
|
|
123
|
-
companyId: deps.companyId,
|
|
124
|
-
projection: {
|
|
125
|
-
companyId: deps.companyId,
|
|
126
|
-
requestedId: creationRequestEntityId,
|
|
127
|
-
},
|
|
128
|
-
});
|
|
129
|
-
const projection = await deps.projectionRepository.loadItem({
|
|
130
|
-
companyId: deps.companyId,
|
|
131
|
-
projectionType: "creationRequestProjectionEnvelope",
|
|
132
|
-
entityId: id,
|
|
133
|
-
});
|
|
134
|
-
(0, chai_1.expect)(projection.payload).to.deep.equal({
|
|
135
|
-
companyId: deps.companyId,
|
|
136
|
-
id,
|
|
137
|
-
projection: creationRequestProjection.payload,
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
it("Should allow an array of creationRequests", async () => {
|
|
141
|
-
const projections = [];
|
|
142
|
-
for (let i = 0; i < 5; i++) {
|
|
143
|
-
const entityId = (0, crypto_1.randomUUID)();
|
|
144
|
-
const projection = await deps.projectionRepository.putItem({
|
|
145
|
-
companyId: deps.companyId,
|
|
146
|
-
projectionType: "creationRequestProjection",
|
|
147
|
-
entityId,
|
|
148
|
-
payload: {
|
|
149
|
-
companyId: deps.companyId,
|
|
150
|
-
id: entityId,
|
|
151
|
-
name: "Requested Projection Name",
|
|
152
|
-
},
|
|
153
|
-
});
|
|
154
|
-
projections.push(projection.payload);
|
|
155
|
-
}
|
|
156
|
-
const { id } = await deps.rpc("createCreationRequestArray", {
|
|
157
|
-
companyId: deps.companyId,
|
|
158
|
-
projections: projections.map(({ id }) => ({
|
|
159
|
-
companyId: deps.companyId,
|
|
160
|
-
requestedId: id,
|
|
161
|
-
})),
|
|
162
|
-
});
|
|
163
|
-
const projection = await deps.projectionRepository.loadItem({
|
|
164
|
-
companyId: deps.companyId,
|
|
165
|
-
projectionType: "creationRequestArray",
|
|
166
|
-
entityId: id,
|
|
167
|
-
});
|
|
168
|
-
(0, chai_1.expect)(projection.payload).to.deep.equal({
|
|
169
|
-
companyId: deps.companyId,
|
|
170
|
-
id,
|
|
171
|
-
projections,
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
});
|
|
175
|
-
describe("updateProjectionHandler", () => {
|
|
176
|
-
let entityId;
|
|
177
|
-
beforeEach(async () => {
|
|
178
|
-
entityId = (0, crypto_1.randomUUID)();
|
|
179
|
-
await deps.projectionRepository.putItem({
|
|
180
|
-
companyId: deps.companyId,
|
|
181
|
-
projectionType: "exampleProjection",
|
|
182
|
-
entityId,
|
|
183
|
-
payload: testCrud_1.exampleProjection,
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
it("Should fail without a companyId", async () => {
|
|
187
|
-
const result = await deps.rpc("updateExampleProjection", {
|
|
188
|
-
id: entityId,
|
|
189
|
-
mandatoryEditableObject: {
|
|
190
|
-
optionalEditableNumber: 1000,
|
|
191
|
-
},
|
|
192
|
-
}, exports_1.RpcResponseStatus.Error);
|
|
193
|
-
(0, chai_1.expect)(result.errorKey).to.equal(exports_1.RpcErrorKey.ERROR_INVALID_FORMAT);
|
|
194
|
-
});
|
|
195
|
-
it("Should update legal fields in a projection", async () => {
|
|
196
|
-
const { modified } = await deps.rpc("updateExampleProjection", {
|
|
197
|
-
companyId: deps.companyId,
|
|
198
|
-
id: entityId,
|
|
199
|
-
mandatoryEditableObject: {
|
|
200
|
-
optionalEditableNumber: 1000,
|
|
201
|
-
},
|
|
202
|
-
mandatoryEditableNumber: 50,
|
|
203
|
-
});
|
|
204
|
-
(0, chai_1.expect)(modified).to.be.true;
|
|
205
|
-
const projection = await deps.projectionRepository.loadItem({
|
|
206
|
-
companyId: deps.companyId,
|
|
207
|
-
projectionType: "exampleProjection",
|
|
208
|
-
entityId,
|
|
209
|
-
});
|
|
210
|
-
(0, chai_1.expect)(projection.payload).to.deep.equal({
|
|
211
|
-
...testCrud_1.exampleProjection,
|
|
212
|
-
mandatoryEditableNumber: 50,
|
|
213
|
-
mandatoryEditableObject: {
|
|
214
|
-
...testCrud_1.exampleProjection.mandatoryEditableObject,
|
|
215
|
-
optionalEditableNumber: 1000,
|
|
216
|
-
},
|
|
217
|
-
});
|
|
218
|
-
});
|
|
219
|
-
it("Should fail updating illegal fields in a projection", async () => {
|
|
220
|
-
const { errorMessage } = await deps.rpc("updateExampleProjection", {
|
|
221
|
-
companyId: deps.companyId,
|
|
222
|
-
id: entityId,
|
|
223
|
-
mandatoryEditableObject: {
|
|
224
|
-
mandatoryNumber: 100,
|
|
225
|
-
},
|
|
226
|
-
}, exports_1.RpcResponseStatus.Error);
|
|
227
|
-
(0, chai_1.expect)(errorMessage).to.contain(".mandatoryNumber");
|
|
228
|
-
const projection = await deps.projectionRepository.loadItem({
|
|
229
|
-
companyId: deps.companyId,
|
|
230
|
-
projectionType: "exampleProjection",
|
|
231
|
-
entityId,
|
|
232
|
-
});
|
|
233
|
-
(0, chai_1.expect)(projection.payload).to.deep.equal(testCrud_1.exampleProjection);
|
|
234
|
-
});
|
|
235
|
-
it("Should allow un-editable fields to be provided if they don't change", async () => {
|
|
236
|
-
const { modified } = await deps.rpc("updateExampleProjection", {
|
|
237
|
-
...testCrud_1.exampleProjection,
|
|
238
|
-
companyId: deps.companyId,
|
|
239
|
-
id: entityId,
|
|
240
|
-
mandatoryEditableObject: {
|
|
241
|
-
optionalEditableNumber: 10000,
|
|
242
|
-
},
|
|
243
|
-
});
|
|
244
|
-
(0, chai_1.expect)(modified).to.be.true;
|
|
245
|
-
const projection = await deps.projectionRepository.loadItem({
|
|
246
|
-
companyId: deps.companyId,
|
|
247
|
-
projectionType: "exampleProjection",
|
|
248
|
-
entityId,
|
|
249
|
-
});
|
|
250
|
-
(0, chai_1.expect)(projection.payload).to.deep.equal({
|
|
251
|
-
...testCrud_1.exampleProjection,
|
|
252
|
-
mandatoryEditableObject: {
|
|
253
|
-
...testCrud_1.exampleProjection.mandatoryEditableObject,
|
|
254
|
-
optionalEditableNumber: 10000,
|
|
255
|
-
},
|
|
256
|
-
});
|
|
257
|
-
});
|
|
258
|
-
});
|
|
259
|
-
describe("deleteProjectionHandler", () => {
|
|
260
|
-
it("Should delete a projection", async () => {
|
|
261
|
-
const entityId = (0, crypto_1.randomUUID)();
|
|
262
|
-
await deps.projectionRepository.putItem({
|
|
263
|
-
companyId: deps.companyId,
|
|
264
|
-
projectionType: "exampleProjection",
|
|
265
|
-
entityId,
|
|
266
|
-
payload: testCrud_1.exampleProjection,
|
|
267
|
-
});
|
|
268
|
-
await deps.rpc("deleteExampleProjection", {
|
|
269
|
-
companyId: deps.companyId,
|
|
270
|
-
id: entityId,
|
|
271
|
-
});
|
|
272
|
-
try {
|
|
273
|
-
await deps.projectionRepository.loadItem({
|
|
274
|
-
companyId: deps.companyId,
|
|
275
|
-
projectionType: "exampleProjection",
|
|
276
|
-
entityId,
|
|
277
|
-
});
|
|
278
|
-
(0, assert_1.fail)();
|
|
279
|
-
}
|
|
280
|
-
catch (err) {
|
|
281
|
-
(0, chai_1.expect)(err).to.be.instanceOf(exports_1.ItemDeleted);
|
|
282
|
-
}
|
|
283
|
-
});
|
|
284
|
-
it("Should return NOT_FOUND when deleting a non-existent projection", async () => {
|
|
285
|
-
const { errorKey } = await deps.rpc("deleteExampleProjection", { companyId: deps.companyId, id: (0, crypto_1.randomUUID)() }, exports_1.RpcResponseStatus.Error);
|
|
286
|
-
(0, chai_1.expect)(errorKey).to.equal("NOT_FOUND");
|
|
287
|
-
});
|
|
288
|
-
});
|
|
289
|
-
describe("searchProjectionHandler", () => {
|
|
290
|
-
let entityIds;
|
|
291
|
-
let projections;
|
|
292
|
-
const lat0 = 75.0;
|
|
293
|
-
const lon0 = 40.71;
|
|
294
|
-
function getPoint(i) {
|
|
295
|
-
return [lat0 + i / 1000, lon0 + i / 1000];
|
|
296
|
-
}
|
|
297
|
-
async function putProjection(i) {
|
|
298
|
-
const entityId = (0, crypto_1.randomUUID)();
|
|
299
|
-
entityIds.push(entityId);
|
|
300
|
-
const [lat, lon] = getPoint(i);
|
|
301
|
-
const projection = await deps.projectionRepository.putItem({
|
|
302
|
-
companyId: deps.companyId,
|
|
303
|
-
projectionType: "exampleProjection",
|
|
304
|
-
entityId,
|
|
305
|
-
payload: {
|
|
306
|
-
id: entityId,
|
|
307
|
-
latLon: `${lat},${lon}`,
|
|
308
|
-
latLonObject: { lat, lon },
|
|
309
|
-
mandatoryEditableObject: {
|
|
310
|
-
optionalEditableString: `sorting by ${(0, crypto_1.randomInt)(1000)}`,
|
|
311
|
-
mandatoryEditableString: `test value ${i}`,
|
|
312
|
-
mandatoryEditableNumber: i * 100,
|
|
313
|
-
mandatoryString: `testMandatoryString${i}`,
|
|
314
|
-
mandatoryNumber: i * 100 + 1,
|
|
315
|
-
},
|
|
316
|
-
mandatoryObject: {
|
|
317
|
-
mandatoryEditableString: `TestEditable${i % 2}`,
|
|
318
|
-
mandatoryEditableNumber: i * 100 + 2,
|
|
319
|
-
mandatoryString: "",
|
|
320
|
-
mandatoryNumber: i * 100 + 3,
|
|
321
|
-
},
|
|
322
|
-
mandatoryEditableString: "",
|
|
323
|
-
mandatoryEditableNumber: i * 100 + 4,
|
|
324
|
-
mandatoryString: "",
|
|
325
|
-
mandatoryNumber: i * 100 + 5,
|
|
326
|
-
},
|
|
327
|
-
});
|
|
328
|
-
await deps.openSearch.indexProjection(projection);
|
|
329
|
-
return projection;
|
|
330
|
-
}
|
|
331
|
-
function sortBy(projections, key, direction) {
|
|
332
|
-
if (direction === "asc") {
|
|
333
|
-
return projections.sort((a, b) => key(a).localeCompare(key(b)));
|
|
334
|
-
}
|
|
335
|
-
else {
|
|
336
|
-
return projections.sort((a, b) => key(b).localeCompare(key(a)));
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
function sortById(projections, direction = "asc") {
|
|
340
|
-
return sortBy(projections, (p) => p.id, direction);
|
|
341
|
-
}
|
|
342
|
-
function sortByQuery(projections, direction = "desc") {
|
|
343
|
-
return sortBy(projections, (p) => p.mandatoryEditableObject.optionalEditableString, direction);
|
|
344
|
-
}
|
|
345
|
-
function getExpectedResults(projections) {
|
|
346
|
-
return projections
|
|
347
|
-
.filter((_, i) => i % 2 === 0)
|
|
348
|
-
.map(({ payload }) => payload);
|
|
349
|
-
}
|
|
350
|
-
const query = {
|
|
351
|
-
mandatoryObject: {
|
|
352
|
-
mandatoryEditableString: "TestEditable0",
|
|
353
|
-
},
|
|
354
|
-
};
|
|
355
|
-
const sort = {
|
|
356
|
-
mandatoryEditableObject: {
|
|
357
|
-
optionalEditableString: "desc",
|
|
358
|
-
},
|
|
359
|
-
};
|
|
360
|
-
function doSearch(args, expectError) {
|
|
361
|
-
if (expectError) {
|
|
362
|
-
return deps.rpc("searchExampleProjections", {
|
|
363
|
-
companyId: deps.companyId,
|
|
364
|
-
...args,
|
|
365
|
-
}, exports_1.RpcResponseStatus.Error);
|
|
366
|
-
}
|
|
367
|
-
else {
|
|
368
|
-
return deps.rpc("searchExampleProjections", {
|
|
369
|
-
companyId: deps.companyId,
|
|
370
|
-
...args,
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
beforeEach(async () => {
|
|
375
|
-
entityIds = [];
|
|
376
|
-
projections = [];
|
|
377
|
-
for (let i = 0; i < 10; i++) {
|
|
378
|
-
projections.push(await putProjection(i));
|
|
379
|
-
}
|
|
380
|
-
});
|
|
381
|
-
it("Should find a nested string match", async () => {
|
|
382
|
-
const { results } = await doSearch({
|
|
383
|
-
query: {
|
|
384
|
-
mandatoryEditableObject: {
|
|
385
|
-
mandatoryEditableString: "test value 4",
|
|
386
|
-
},
|
|
387
|
-
},
|
|
388
|
-
});
|
|
389
|
-
(0, chai_1.expect)(results).to.deep.equal([projections[4].payload]);
|
|
390
|
-
});
|
|
391
|
-
it("Should limit queries when requested", async () => {
|
|
392
|
-
const { results, continuationToken } = await doSearch({
|
|
393
|
-
query,
|
|
394
|
-
limit: 2,
|
|
395
|
-
});
|
|
396
|
-
(0, chai_1.expect)(results.length).to.equal(2);
|
|
397
|
-
(0, chai_1.expect)(continuationToken).to.not.be.empty;
|
|
398
|
-
});
|
|
399
|
-
it("Should properly paginate queries", async () => {
|
|
400
|
-
const results = [];
|
|
401
|
-
let continuationToken;
|
|
402
|
-
do {
|
|
403
|
-
const response = await doSearch({
|
|
404
|
-
query,
|
|
405
|
-
continuationToken,
|
|
406
|
-
limit: 2,
|
|
407
|
-
});
|
|
408
|
-
results.push(...response.results);
|
|
409
|
-
continuationToken = response.continuationToken;
|
|
410
|
-
} while (continuationToken);
|
|
411
|
-
(0, chai_1.expect)(sortById(results)).to.deep.equal(sortById(getExpectedResults(projections)));
|
|
412
|
-
});
|
|
413
|
-
it("Should properly sort an individual query", async () => {
|
|
414
|
-
const { results, continuationToken } = await doSearch({
|
|
415
|
-
query,
|
|
416
|
-
sort,
|
|
417
|
-
});
|
|
418
|
-
(0, chai_1.expect)(continuationToken).to.be.undefined;
|
|
419
|
-
(0, chai_1.expect)(results).to.deep.equal(sortByQuery(getExpectedResults(projections)));
|
|
420
|
-
});
|
|
421
|
-
it("Should properly sort a paginated query", async () => {
|
|
422
|
-
const results = [];
|
|
423
|
-
let continuationToken;
|
|
424
|
-
do {
|
|
425
|
-
const response = await doSearch({
|
|
426
|
-
query,
|
|
427
|
-
sort,
|
|
428
|
-
continuationToken,
|
|
429
|
-
limit: 2,
|
|
430
|
-
});
|
|
431
|
-
results.push(...response.results);
|
|
432
|
-
continuationToken = response.continuationToken;
|
|
433
|
-
} while (continuationToken);
|
|
434
|
-
(0, chai_1.expect)(results).to.deep.equal(sortByQuery(getExpectedResults(projections)));
|
|
435
|
-
});
|
|
436
|
-
it("Should paginate over a point-in-time snapshot", async function () {
|
|
437
|
-
if (deps.openSearch.isFakeClient) {
|
|
438
|
-
this.skip();
|
|
439
|
-
}
|
|
440
|
-
const results = [];
|
|
441
|
-
let continuationToken;
|
|
442
|
-
let i = 10;
|
|
443
|
-
do {
|
|
444
|
-
const response = await doSearch({
|
|
445
|
-
query,
|
|
446
|
-
continuationToken,
|
|
447
|
-
limit: 2,
|
|
448
|
-
});
|
|
449
|
-
results.push(...response.results);
|
|
450
|
-
continuationToken = response.continuationToken;
|
|
451
|
-
for (let j = 0; j < 4; j++) {
|
|
452
|
-
await putProjection(i++);
|
|
453
|
-
}
|
|
454
|
-
} while (continuationToken);
|
|
455
|
-
(0, chai_1.expect)(sortById(results)).to.deep.equal(sortById(getExpectedResults(projections)));
|
|
456
|
-
});
|
|
457
|
-
it("Should delete the point-in-time search when results are exhausted", async function () {
|
|
458
|
-
if (deps.openSearch.isFakeClient) {
|
|
459
|
-
this.skip();
|
|
460
|
-
}
|
|
461
|
-
let firstContinuationToken;
|
|
462
|
-
let continuationToken;
|
|
463
|
-
do {
|
|
464
|
-
const response = await doSearch({
|
|
465
|
-
query,
|
|
466
|
-
continuationToken,
|
|
467
|
-
limit: 2,
|
|
468
|
-
});
|
|
469
|
-
continuationToken = response.continuationToken;
|
|
470
|
-
if (continuationToken) {
|
|
471
|
-
if (!firstContinuationToken) {
|
|
472
|
-
firstContinuationToken = continuationToken;
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
else {
|
|
476
|
-
if (!firstContinuationToken) {
|
|
477
|
-
(0, assert_1.fail)("unexpected");
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
} while (continuationToken);
|
|
481
|
-
try {
|
|
482
|
-
await deps.openSearch.searchProjections(deps.companyId, "exampleProjection", {
|
|
483
|
-
mandatoryObject: { mandatoryEditableString: "TestEditable0" },
|
|
484
|
-
}, undefined, undefined, undefined, firstContinuationToken);
|
|
485
|
-
(0, assert_1.fail)();
|
|
486
|
-
}
|
|
487
|
-
catch (err) {
|
|
488
|
-
(0, chai_1.expect)(err).to.be.instanceOf(errors_1.ExpiredPointInTime);
|
|
489
|
-
}
|
|
490
|
-
});
|
|
491
|
-
it("Should successfully handle an expired point-in-time id", async () => {
|
|
492
|
-
const results = [];
|
|
493
|
-
const adminClient = await appContainer.getAsync(exports_1.OpensearchAdminClient);
|
|
494
|
-
let continuationToken;
|
|
495
|
-
do {
|
|
496
|
-
const response = await doSearch({
|
|
497
|
-
query,
|
|
498
|
-
continuationToken,
|
|
499
|
-
limit: 2,
|
|
500
|
-
});
|
|
501
|
-
results.push(...response.results);
|
|
502
|
-
continuationToken = response.continuationToken;
|
|
503
|
-
if (continuationToken) {
|
|
504
|
-
const [pit_id] = continuationToken.split(":");
|
|
505
|
-
await adminClient.expirePointInTime(pit_id);
|
|
506
|
-
}
|
|
507
|
-
} while (continuationToken);
|
|
508
|
-
(0, chai_1.expect)(sortById(results)).to.deep.equal(sortById(getExpectedResults(projections)));
|
|
509
|
-
});
|
|
510
|
-
it("Should allow queries with point-in-time explicitly disabled", async () => {
|
|
511
|
-
const results = [];
|
|
512
|
-
let continuationToken;
|
|
513
|
-
do {
|
|
514
|
-
const response = await doSearch({
|
|
515
|
-
query,
|
|
516
|
-
continuationToken,
|
|
517
|
-
limit: 2,
|
|
518
|
-
pointInTime: false,
|
|
519
|
-
});
|
|
520
|
-
results.push(...response.results);
|
|
521
|
-
continuationToken = response.continuationToken;
|
|
522
|
-
} while (continuationToken);
|
|
523
|
-
(0, chai_1.expect)(sortById(results)).to.deep.equal(sortById(getExpectedResults(projections)));
|
|
524
|
-
});
|
|
525
|
-
describe("Geospatial", async () => {
|
|
526
|
-
it("Should find entries by distance", async () => {
|
|
527
|
-
const fourthDistance = (0, haversine_distance_1.default)({ lat: lat0, lon: lon0 }, { lat: getPoint(3)[0], lon: getPoint(3)[1] });
|
|
528
|
-
const fifthDistance = (0, haversine_distance_1.default)({ lat: lat0, lon: lon0 }, { lat: getPoint(4)[0], lon: getPoint(4)[1] });
|
|
529
|
-
const maxDistance = (fourthDistance + fifthDistance) / 2;
|
|
530
|
-
const units = "meters";
|
|
531
|
-
const { results } = await doSearch({
|
|
532
|
-
query: {
|
|
533
|
-
latLonObject: {
|
|
534
|
-
distance: maxDistance,
|
|
535
|
-
units,
|
|
536
|
-
lat: lat0,
|
|
537
|
-
lon: lon0,
|
|
538
|
-
},
|
|
539
|
-
},
|
|
540
|
-
limit: 5,
|
|
541
|
-
});
|
|
542
|
-
(0, chai_1.expect)(results.length).to.equal(4);
|
|
543
|
-
for (const result of results) {
|
|
544
|
-
const distance = (0, haversine_distance_1.default)({ lat: lat0, lon: lon0 }, result.latLonObject);
|
|
545
|
-
(0, chai_1.expect)(distance).to.be.lessThan(maxDistance);
|
|
546
|
-
}
|
|
547
|
-
});
|
|
548
|
-
it("Should find entries by bounding box", async () => {
|
|
549
|
-
const { results } = await doSearch({
|
|
550
|
-
query: {
|
|
551
|
-
latLonObject: {
|
|
552
|
-
top: lat0 + 1.2,
|
|
553
|
-
left: lon0,
|
|
554
|
-
bottom: lat0,
|
|
555
|
-
right: lon0 + 1.5,
|
|
556
|
-
},
|
|
557
|
-
},
|
|
558
|
-
});
|
|
559
|
-
(0, chai_1.expect)(results).to.not.be.empty;
|
|
560
|
-
for (const result of results) {
|
|
561
|
-
(0, chai_1.expect)(result.latLonObject.lat).to.be.greaterThanOrEqual(lat0);
|
|
562
|
-
(0, chai_1.expect)(result.latLonObject.lat).to.be.lessThanOrEqual(lat0 + 1.5);
|
|
563
|
-
(0, chai_1.expect)(result.latLonObject.lon).to.be.greaterThanOrEqual(lon0);
|
|
564
|
-
(0, chai_1.expect)(result.latLonObject.lon).to.be.lessThanOrEqual(lon0 + 1.5);
|
|
565
|
-
}
|
|
566
|
-
});
|
|
567
|
-
});
|
|
568
|
-
});
|
|
569
|
-
describe("getProjectionHandler", async () => {
|
|
570
|
-
function getProjection(id) {
|
|
571
|
-
return deps.rpc("getExampleProjection", {
|
|
572
|
-
companyId: deps.companyId,
|
|
573
|
-
id,
|
|
574
|
-
});
|
|
575
|
-
}
|
|
576
|
-
it("Should find an entity by id", async () => {
|
|
577
|
-
const entityId = (0, crypto_1.randomUUID)();
|
|
578
|
-
await deps.projectionRepository.putItem({
|
|
579
|
-
companyId: deps.companyId,
|
|
580
|
-
projectionType: "exampleProjection",
|
|
581
|
-
entityId,
|
|
582
|
-
payload: testCrud_1.exampleProjection,
|
|
583
|
-
});
|
|
584
|
-
const result = await deps.rpc("getExampleProjection", {
|
|
585
|
-
companyId: deps.companyId,
|
|
586
|
-
id: entityId,
|
|
587
|
-
});
|
|
588
|
-
(0, chai_1.expect)(result.projection).to.deep.equal(testCrud_1.exampleProjection);
|
|
589
|
-
});
|
|
590
|
-
it("Should return undefined if the id does not exist", async () => {
|
|
591
|
-
const result = await deps.rpc("getExampleProjection", {
|
|
592
|
-
companyId: deps.companyId,
|
|
593
|
-
id: (0, crypto_1.randomUUID)(),
|
|
594
|
-
});
|
|
595
|
-
(0, chai_1.expect)(result).to.deep.equal({});
|
|
596
|
-
});
|
|
597
|
-
});
|
|
598
|
-
describe("getProjectionsHandler", () => {
|
|
599
|
-
let projectionStore;
|
|
600
|
-
beforeEach(async () => {
|
|
601
|
-
projectionStore = [];
|
|
602
|
-
for (let i = 0; i < 10; i++) {
|
|
603
|
-
const entityId = (0, crypto_1.randomUUID)();
|
|
604
|
-
const projection = await deps.projectionRepository.putItem({
|
|
605
|
-
companyId: deps.companyId,
|
|
606
|
-
projectionType: "exampleProjection",
|
|
607
|
-
entityId,
|
|
608
|
-
payload: {
|
|
609
|
-
id: entityId,
|
|
610
|
-
mandatoryEditableObject: {
|
|
611
|
-
mandatoryEditableString: `mandatoryEditableObject${i * 100}`,
|
|
612
|
-
mandatoryEditableNumber: i * 100 + 1,
|
|
613
|
-
mandatoryString: `mandatoryString${i * 100 + 2}`,
|
|
614
|
-
mandatoryNumber: i * 100 + 3,
|
|
615
|
-
},
|
|
616
|
-
mandatoryObject: {
|
|
617
|
-
mandatoryEditableString: `mandatoryEditableString${i * 100 + 4}`,
|
|
618
|
-
mandatoryEditableNumber: i * 100 + 5,
|
|
619
|
-
mandatoryString: `mandatoryString${i * 100 + 6}`,
|
|
620
|
-
mandatoryNumber: i * 100 + 7,
|
|
621
|
-
},
|
|
622
|
-
mandatoryEditableString: `mandatoryEditableString${i * 100 + 8}`,
|
|
623
|
-
mandatoryEditableNumber: i * 100 + 9,
|
|
624
|
-
mandatoryString: `mandatoryString${i + 100 + 10}`,
|
|
625
|
-
mandatoryNumber: i * 100 + 11,
|
|
626
|
-
},
|
|
627
|
-
}, testCrud_1.ExampleProjection);
|
|
628
|
-
projectionStore.push(projection);
|
|
629
|
-
}
|
|
630
|
-
});
|
|
631
|
-
function doRpc(ids) {
|
|
632
|
-
return deps.rpc("getExampleProjections", {
|
|
633
|
-
companyId: deps.companyId,
|
|
634
|
-
ids,
|
|
635
|
-
});
|
|
636
|
-
}
|
|
637
|
-
it("Should fetch all the requested projections if they exist", async () => {
|
|
638
|
-
const { projections, missing } = await doRpc(projectionStore.slice(3, 8).map((p) => p.entityId));
|
|
639
|
-
(0, chai_1.expect)(projections).to.deep.equal(projectionStore.slice(3, 8).map((p) => p.payload));
|
|
640
|
-
(0, chai_1.expect)(missing).to.be.empty;
|
|
641
|
-
});
|
|
642
|
-
it("Should fetch a single requested projection", async () => {
|
|
643
|
-
const { projections, missing } = await doRpc([
|
|
644
|
-
projectionStore[5].entityId,
|
|
645
|
-
]);
|
|
646
|
-
(0, chai_1.expect)(projections).to.deep.equal([projectionStore[5].payload]);
|
|
647
|
-
(0, chai_1.expect)(missing).to.be.empty;
|
|
648
|
-
});
|
|
649
|
-
it("Should return an empty array if none are requested", async () => {
|
|
650
|
-
const { projections, missing } = await doRpc([]);
|
|
651
|
-
(0, chai_1.expect)(projections).to.be.empty;
|
|
652
|
-
(0, chai_1.expect)(missing).to.be.empty;
|
|
653
|
-
});
|
|
654
|
-
it("Should return an empty array if none are found", async () => {
|
|
655
|
-
const ids = [];
|
|
656
|
-
for (let i = 0; i < 10; i++) {
|
|
657
|
-
ids.push((0, crypto_1.randomUUID)());
|
|
658
|
-
}
|
|
659
|
-
const { projections, missing } = await doRpc(ids);
|
|
660
|
-
(0, chai_1.expect)(projections).to.be.empty;
|
|
661
|
-
(0, chai_1.expect)(missing).to.deep.equal(ids);
|
|
662
|
-
});
|
|
663
|
-
});
|
|
664
|
-
describe("SchemaHandler", () => {
|
|
665
|
-
[
|
|
666
|
-
["get", "getExampleProjectionSchema"],
|
|
667
|
-
["get-multiple", "getExampleProjectionsSchema"],
|
|
668
|
-
["create", "createExampleProjectionSchema"],
|
|
669
|
-
["update", "updateExampleProjectionSchema"],
|
|
670
|
-
["delete", "deleteExampleProjectionSchema"],
|
|
671
|
-
["search", "searchExampleProjectionsSchema"],
|
|
672
|
-
["create-with-request", "createCreationRequestProjectionSchema"],
|
|
673
|
-
[
|
|
674
|
-
"create-with-nested-request",
|
|
675
|
-
"createCreationRequestProjectionEnvelopeSchema",
|
|
676
|
-
],
|
|
677
|
-
].forEach(([action, routingKey]) => {
|
|
678
|
-
it(`Should fetch the ${action} schema for a projection`, async () => {
|
|
679
|
-
const { requestSchema, responseSchema } = await deps.rpc(routingKey, {});
|
|
680
|
-
console.log("----");
|
|
681
|
-
console.log("requestSchema");
|
|
682
|
-
console.log(requestSchema);
|
|
683
|
-
console.log("----");
|
|
684
|
-
console.log("responseSchema");
|
|
685
|
-
console.log(responseSchema);
|
|
686
|
-
console.log("----");
|
|
687
|
-
});
|
|
688
|
-
});
|
|
689
|
-
});
|
|
690
|
-
});
|
|
691
|
-
//# sourceMappingURL=crudHandlers.spec.js.map
|