├── .eslintrc.cjs ├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.yaml │ ├── config.yml │ ├── docs-bug.yaml │ └── feature-request.yaml └── workflows │ ├── codeql.yml │ └── tests.yml ├── .gitignore ├── .husky ├── commit-msg └── pre-commit ├── .prettierignore ├── .prettierrc ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── commitlint.config.cjs ├── lerna.json ├── logo.png ├── package.json ├── packages ├── redis-smq-common │ ├── .codecov.yml │ ├── .npmignore │ ├── CHANGELOG.md │ ├── README.md │ ├── bin │ │ └── cli.ts │ ├── docs │ │ ├── README.md │ │ ├── api │ │ │ ├── README.md │ │ │ ├── classes │ │ │ │ ├── AbortError.md │ │ │ │ ├── AsyncCallbackTimeoutError.md │ │ │ │ ├── CallbackEmptyReplyError.md │ │ │ │ ├── CallbackInvalidReplyError.md │ │ │ │ ├── ConsoleLogger.md │ │ │ │ ├── EventBus.md │ │ │ │ ├── EventBusError.md │ │ │ │ ├── EventBusInstanceLockError.md │ │ │ │ ├── EventBusNotConnectedError.md │ │ │ │ ├── EventBusRedis.md │ │ │ │ ├── EventBusRedisFactory.md │ │ │ │ ├── EventEmitter.md │ │ │ │ ├── FileLock.md │ │ │ │ ├── InstanceLockError.md │ │ │ │ ├── LockAcquireError.md │ │ │ │ ├── LockError.md │ │ │ │ ├── LockExtendError.md │ │ │ │ ├── LockMethodNotAllowedError.md │ │ │ │ ├── LockNotAcquiredError.md │ │ │ │ ├── LoggerError.md │ │ │ │ ├── PanicError.md │ │ │ │ ├── PowerSwitch.md │ │ │ │ ├── RedisClientError.md │ │ │ │ ├── RedisClientFactory.md │ │ │ │ ├── RedisLock.md │ │ │ │ ├── RedisSMQError.md │ │ │ │ ├── RedisServer.md │ │ │ │ ├── RedisServerBinaryNotFoundError.md │ │ │ │ ├── RedisServerError.md │ │ │ │ ├── RedisServerUnsupportedPlatformError.md │ │ │ │ ├── Runnable.md │ │ │ │ ├── Timer.md │ │ │ │ ├── TimerError.md │ │ │ │ ├── WatchedKeysChangedError.md │ │ │ │ ├── WorkerAlreadyDownError.md │ │ │ │ ├── WorkerAlreadyRunningError.md │ │ │ │ ├── WorkerCallable.md │ │ │ │ ├── WorkerError.md │ │ │ │ ├── WorkerPayloadRequiredError.md │ │ │ │ ├── WorkerResourceGroup.md │ │ │ │ ├── WorkerRunnable.md │ │ │ │ └── WorkerThreadError.md │ │ │ ├── enums │ │ │ │ ├── EConsoleLoggerLevel.md │ │ │ │ ├── ERedisConfigClient.md │ │ │ │ ├── EWorkerThreadChildExecutionCode.md │ │ │ │ ├── EWorkerThreadChildExitCode.md │ │ │ │ ├── EWorkerThreadParentMessage.md │ │ │ │ └── EWorkerType.md │ │ │ └── interfaces │ │ │ │ ├── ICallback.md │ │ │ │ ├── IConsoleLoggerOptions.md │ │ │ │ ├── IEventBus.md │ │ │ │ ├── IEventEmitter.md │ │ │ │ ├── ILogger.md │ │ │ │ ├── ILoggerConfig.md │ │ │ │ ├── IRedisClient.md │ │ │ │ ├── IRedisConfig.md │ │ │ │ ├── IRedisTransaction.md │ │ │ │ ├── IWorkerCallable.md │ │ │ │ ├── IWorkerRunnable.md │ │ │ │ └── IWorkerThreadData.md │ │ ├── logger.md │ │ ├── redis-client.md │ │ └── redis-server.md │ ├── index.ts │ ├── package.json │ ├── scripts │ │ └── build.sh │ ├── src │ │ ├── archive │ │ │ ├── extract-rpm.ts │ │ │ ├── extract-tgz.ts │ │ │ └── index.ts │ │ ├── async │ │ │ ├── async.ts │ │ │ ├── each-in.ts │ │ │ ├── each-of.ts │ │ │ ├── each.ts │ │ │ ├── errors │ │ │ │ ├── async-callback-timeout.error.ts │ │ │ │ └── index.ts │ │ │ ├── exec.ts │ │ │ ├── index.ts │ │ │ ├── map.ts │ │ │ ├── parallel.ts │ │ │ ├── series.ts │ │ │ ├── types │ │ │ │ ├── callback.ts │ │ │ │ ├── function.ts │ │ │ │ └── index.ts │ │ │ ├── waterfall.ts │ │ │ ├── with-callback-list.ts │ │ │ ├── with-callback.ts │ │ │ ├── with-retry.ts │ │ │ └── with-timeout.ts │ │ ├── env │ │ │ ├── cache-dir.ts │ │ │ ├── current-dir.ts │ │ │ ├── filesystem.ts │ │ │ └── index.ts │ │ ├── errors │ │ │ ├── abort.error.ts │ │ │ ├── callback-empty-reply.error.ts │ │ │ ├── callback-invalid-reply.error.ts │ │ │ ├── index.ts │ │ │ ├── panic.error.ts │ │ │ └── redis-smq.error.ts │ │ ├── event-bus │ │ │ ├── errors │ │ │ │ ├── event-bus-instance-lock.error.ts │ │ │ │ ├── event-bus-not-connected.error.ts │ │ │ │ ├── event-bus.error.ts │ │ │ │ └── index.ts │ │ │ ├── event-bus-redis-factory.ts │ │ │ ├── event-bus-redis.ts │ │ │ ├── event-bus.ts │ │ │ ├── index.ts │ │ │ ├── types │ │ │ │ ├── event-bus.ts │ │ │ │ └── index.ts │ │ │ └── with-event-bus.ts │ │ ├── event │ │ │ ├── event-emitter.ts │ │ │ ├── index.ts │ │ │ └── types │ │ │ │ ├── event-emitter.ts │ │ │ │ └── index.ts │ │ ├── file-lock │ │ │ ├── errors │ │ │ │ ├── file-lock-attempts-exhausted.error.ts │ │ │ │ ├── file-lock.error.ts │ │ │ │ └── index.ts │ │ │ ├── file-lock.ts │ │ │ └── index.ts │ │ ├── logger │ │ │ ├── console-logger │ │ │ │ ├── console-logger.ts │ │ │ │ ├── console-message-formatter.ts │ │ │ │ ├── index.ts │ │ │ │ └── types │ │ │ │ │ ├── console-logger.ts │ │ │ │ │ └── index.ts │ │ │ ├── errors │ │ │ │ ├── index.ts │ │ │ │ └── logger.error.ts │ │ │ ├── index.ts │ │ │ ├── logger.ts │ │ │ └── types │ │ │ │ ├── index.ts │ │ │ │ └── logger.ts │ │ ├── net │ │ │ └── index.ts │ │ ├── power-switch │ │ │ ├── index.ts │ │ │ └── power-switch.ts │ │ ├── redis-client │ │ │ ├── clients │ │ │ │ ├── ioredis │ │ │ │ │ ├── ioredis-client-multi.ts │ │ │ │ │ └── ioredis-client.ts │ │ │ │ ├── node-redis │ │ │ │ │ ├── node-redis-client-multi.ts │ │ │ │ │ └── node-redis-client.ts │ │ │ │ └── redis-client-abstract.ts │ │ │ ├── create-redis-client.ts │ │ │ ├── errors │ │ │ │ ├── index.ts │ │ │ │ ├── instance-lock.error.ts │ │ │ │ ├── redis-client.error.ts │ │ │ │ └── watched-keys-changed.error.ts │ │ │ ├── index.ts │ │ │ ├── lua-scripts │ │ │ │ ├── lpoprpush.lua │ │ │ │ └── zpoprpush.lua │ │ │ ├── redis-client-factory.ts │ │ │ ├── types │ │ │ │ ├── config.ts │ │ │ │ ├── index.ts │ │ │ │ └── redis-client.ts │ │ │ └── with-redis-client.ts │ │ ├── redis-lock │ │ │ ├── errors │ │ │ │ ├── index.ts │ │ │ │ ├── lock-acquire.error.ts │ │ │ │ ├── lock-extend.error.ts │ │ │ │ ├── lock-method-not-allowed.error.ts │ │ │ │ ├── lock-not-acquired.error.ts │ │ │ │ └── lock.error.ts │ │ │ ├── index.ts │ │ │ ├── lua-scripts │ │ │ │ ├── extend-lock.lua │ │ │ │ └── release-lock.lua │ │ │ └── redis-lock.ts │ │ ├── redis-server │ │ │ ├── build-redis.ts │ │ │ ├── constants.ts │ │ │ ├── errors │ │ │ │ ├── index.ts │ │ │ │ ├── redis-server-binary-not-found.error.ts │ │ │ │ ├── redis-server-unsupported-platform.error.ts │ │ │ │ └── redis-server.error.ts │ │ │ ├── get-supported-platform.ts │ │ │ ├── index.ts │ │ │ ├── redis-binary.ts │ │ │ └── redis-server.ts │ │ ├── runnable │ │ │ ├── index.ts │ │ │ └── runnable.ts │ │ ├── timer │ │ │ ├── errors │ │ │ │ ├── index.ts │ │ │ │ └── timer.error.ts │ │ │ ├── index.ts │ │ │ ├── timer.ts │ │ │ └── types │ │ │ │ ├── index.ts │ │ │ │ └── timer.ts │ │ └── worker │ │ │ ├── errors │ │ │ ├── index.ts │ │ │ ├── worker-already-down.error.ts │ │ │ ├── worker-already-running.error.ts │ │ │ ├── worker-error.ts │ │ │ ├── worker-payload-required.error.ts │ │ │ └── worker-thread.error.ts │ │ │ ├── index.ts │ │ │ ├── types │ │ │ ├── index.ts │ │ │ ├── worker-thread.ts │ │ │ └── worker.ts │ │ │ ├── worker-callable.ts │ │ │ ├── worker-resource-group.ts │ │ │ ├── worker-runnable.ts │ │ │ ├── worker-thread │ │ │ ├── worker-thread-callable.ts │ │ │ ├── worker-thread-message.ts │ │ │ ├── worker-thread-runnable.ts │ │ │ └── worker-thread.ts │ │ │ └── worker.ts │ ├── tests │ │ ├── async │ │ │ ├── test00001.test.ts │ │ │ ├── test00002.test.ts │ │ │ ├── test00003.test.ts │ │ │ ├── test00004.test.ts │ │ │ ├── test00005.test.ts │ │ │ ├── test00006.test.ts │ │ │ ├── test00007.test.ts │ │ │ ├── test00008.test.ts │ │ │ ├── test00009.test.ts │ │ │ ├── test00010.test.ts │ │ │ ├── test00011.test.ts │ │ │ ├── test00012.test.ts │ │ │ ├── test00013.test.ts │ │ │ ├── test00014.test.ts │ │ │ ├── test00015.test.ts │ │ │ └── test00016.test.ts │ │ ├── common.ts │ │ ├── config.ts │ │ ├── event │ │ │ ├── test00001.test.ts │ │ │ ├── test00002.test.ts │ │ │ └── test00003.test.ts │ │ ├── file-lock │ │ │ ├── test00001.test.ts │ │ │ ├── test00002.test.ts │ │ │ ├── test00003.test.ts │ │ │ ├── test00004.test.ts │ │ │ ├── test00005.test.ts │ │ │ └── test00006.test.ts │ │ ├── logger │ │ │ └── test00001.test.ts │ │ ├── mock-woker-thread.ts │ │ ├── power-switch │ │ │ └── test00002.test.ts │ │ ├── redis-client │ │ │ ├── common.ts │ │ │ ├── lua-scripts │ │ │ │ └── test_script.lua │ │ │ ├── test00001.test.ts │ │ │ └── test00003.test.ts │ │ ├── redis-lock │ │ │ ├── common.ts │ │ │ ├── test00001.test.ts │ │ │ ├── test00002.test.ts │ │ │ ├── test00003.test.ts │ │ │ ├── test00004.test.ts │ │ │ └── test00005.test.ts │ │ ├── redis-server.ts │ │ ├── redis-server │ │ │ ├── common.ts │ │ │ ├── test00001.test.ts │ │ │ ├── test00002.test.ts │ │ │ ├── test00003.test.ts │ │ │ └── test00005.test.ts │ │ ├── setup.ts │ │ ├── timer │ │ │ ├── test00001.test.ts │ │ │ ├── test00002.test.ts │ │ │ ├── test00003.test.ts │ │ │ └── test00004.test.ts │ │ └── worker │ │ │ ├── mock-worker-thread.ts │ │ │ ├── test00001.test.ts │ │ │ ├── test00002.test.ts │ │ │ ├── test00003.test.ts │ │ │ ├── test00004.test.ts │ │ │ ├── test00005.test.ts │ │ │ ├── test00006.test.ts │ │ │ ├── test00007.test.ts │ │ │ ├── test00008.test.ts │ │ │ ├── test00009.test.ts │ │ │ ├── test00010.test.ts │ │ │ ├── test00011.test.ts │ │ │ ├── test00012.test.ts │ │ │ ├── test00013.test.ts │ │ │ └── workers │ │ │ ├── runnable │ │ │ ├── runnable1.worker.ts │ │ │ └── runnable2.worker.ts │ │ │ ├── worker-error.worker.ts │ │ │ ├── worker-exception.worker.ts │ │ │ ├── worker-faulty-exit.worker.ts │ │ │ ├── worker-faulty.worker.ts │ │ │ └── worker-ok.worker.ts │ ├── tsconfig.cjs.json │ └── tsconfig.json ├── redis-smq-rest-api │ ├── .eslintrc.cjs │ ├── .npmignore │ ├── CHANGELOG.md │ ├── README.md │ ├── index.ts │ ├── package.json │ ├── scripts │ │ ├── build.sh │ │ └── schema-gen.sh │ ├── src │ │ ├── app │ │ │ ├── container │ │ │ │ ├── Container.ts │ │ │ │ └── types │ │ │ │ │ └── container.ts │ │ │ ├── controllers │ │ │ │ ├── consumer-groups │ │ │ │ │ ├── countConsumerGroupPendingMessagesController.test.ts │ │ │ │ │ ├── countConsumerGroupPendingMessagesController.ts │ │ │ │ │ ├── deleteConsumerGroupController.test.ts │ │ │ │ │ ├── deleteConsumerGroupController.ts │ │ │ │ │ ├── getConsumerGroupPendingMessagesController.test.ts │ │ │ │ │ ├── getConsumerGroupPendingMessagesController.ts │ │ │ │ │ ├── getConsumerGroupsController.test.ts │ │ │ │ │ ├── getConsumerGroupsController.ts │ │ │ │ │ ├── purgeConsumerGroupPendingMessagesController.test.ts │ │ │ │ │ ├── purgeConsumerGroupPendingMessagesController.ts │ │ │ │ │ ├── saveConsumerGroupController.test.ts │ │ │ │ │ └── saveConsumerGroupController.ts │ │ │ │ ├── exchange-fan-out │ │ │ │ │ ├── bindQueueController.test.ts │ │ │ │ │ ├── bindQueueController.ts │ │ │ │ │ ├── getAllExchangesController.test.ts │ │ │ │ │ ├── getAllExchangesController.ts │ │ │ │ │ ├── getQueuesController.test.ts │ │ │ │ │ ├── getQueuesController.ts │ │ │ │ │ ├── saveExchangeController.test.ts │ │ │ │ │ └── saveExchangeController.ts │ │ │ │ ├── message │ │ │ │ │ ├── deleteMessageByIdController.test.ts │ │ │ │ │ ├── deleteMessageByIdController.ts │ │ │ │ │ ├── deleteMessagesByIdsController.test.ts │ │ │ │ │ ├── deleteMessagesByIdsController.ts │ │ │ │ │ ├── getMessageByIdController.test.ts │ │ │ │ │ ├── getMessageByIdController.ts │ │ │ │ │ ├── getMessageStatusController.test.ts │ │ │ │ │ ├── getMessageStatusController.ts │ │ │ │ │ ├── getMessagesByIdsController.test.ts │ │ │ │ │ ├── getMessagesByIdsController.ts │ │ │ │ │ ├── publishMessageController.test.ts │ │ │ │ │ ├── publishMessageController.ts │ │ │ │ │ ├── requeueMessageByIdController.test.ts │ │ │ │ │ └── requeueMessageByIdController.ts │ │ │ │ ├── namespace │ │ │ │ │ ├── deleteNamespaceController.test.ts │ │ │ │ │ ├── deleteNamespaceController.ts │ │ │ │ │ ├── getNamespaceQueuesController.test.ts │ │ │ │ │ ├── getNamespaceQueuesController.ts │ │ │ │ │ ├── getNamespacesController.test.ts │ │ │ │ │ └── getNamespacesController.ts │ │ │ │ ├── queue-acknowledged-messages │ │ │ │ │ ├── countQueueAcknowledgedMessagesController.test.ts │ │ │ │ │ ├── countQueueAcknowledgedMessagesController.ts │ │ │ │ │ ├── getQueueAcknowledgedMessagesController.test.ts │ │ │ │ │ ├── getQueueAcknowledgedMessagesController.ts │ │ │ │ │ ├── purgeQueueAcknowledgedMessagesController.test.ts │ │ │ │ │ └── purgeQueueAcknowledgedMessagesController.ts │ │ │ │ ├── queue-dead-lettered-messages │ │ │ │ │ ├── countQueueDeadLetteredMessagesController.test.ts │ │ │ │ │ ├── countQueueDeadLetteredMessagesController.ts │ │ │ │ │ ├── getQueueDeadLetteredMessagesController.test.ts │ │ │ │ │ ├── getQueueDeadLetteredMessagesController.ts │ │ │ │ │ ├── purgeQueueDeadLetteredMessagesController.test.ts │ │ │ │ │ └── purgeQueueDeadLetteredMessagesController.ts │ │ │ │ ├── queue-messages │ │ │ │ │ ├── countQueueMessagesByStatusController.test.ts │ │ │ │ │ ├── countQueueMessagesByStatusController.ts │ │ │ │ │ ├── countQueueMessagesController.test.ts │ │ │ │ │ ├── countQueueMessagesController.ts │ │ │ │ │ ├── getQueueMessagesController.test.ts │ │ │ │ │ └── getQueueMessagesController.ts │ │ │ │ ├── queue-pending-messages │ │ │ │ │ ├── countQueuePendingMessagesController.test.ts │ │ │ │ │ ├── countQueuePendingMessagesController.ts │ │ │ │ │ ├── getQueuePendingMessagesController.test.ts │ │ │ │ │ ├── getQueuePendingMessagesController.ts │ │ │ │ │ ├── purgeQueuePendingMessagesController.test.ts │ │ │ │ │ └── purgeQueuePendingMessagesController.ts │ │ │ │ ├── queue-rate-limit │ │ │ │ │ ├── clearQueueRateLimitController.test.ts │ │ │ │ │ ├── clearQueueRateLimitController.ts │ │ │ │ │ ├── getQueueRateLimitController.test.ts │ │ │ │ │ ├── getQueueRateLimitController.ts │ │ │ │ │ ├── setQueueRateLimitController.test.ts │ │ │ │ │ └── setQueueRateLimitController.ts │ │ │ │ ├── queue-scheduled-messages │ │ │ │ │ ├── countQueueScheduledMessagesController.test.ts │ │ │ │ │ ├── countQueueScheduledMessagesController.ts │ │ │ │ │ ├── getQueueScheduledMessagesController.test.ts │ │ │ │ │ ├── getQueueScheduledMessagesController.ts │ │ │ │ │ ├── purgeQueueScheduledMessagesController.test.ts │ │ │ │ │ └── purgeQueueScheduledMessagesController.ts │ │ │ │ └── queue │ │ │ │ │ ├── createQueueController.test.ts │ │ │ │ │ ├── createQueueController.ts │ │ │ │ │ ├── deleteQueueController.test.ts │ │ │ │ │ ├── deleteQueueController.ts │ │ │ │ │ ├── getAllQueuesController.test.ts │ │ │ │ │ ├── getAllQueuesController.ts │ │ │ │ │ ├── getQueuePropertiesController.test.ts │ │ │ │ │ ├── getQueuePropertiesController.ts │ │ │ │ │ ├── queueExistsController.test.ts │ │ │ │ │ └── queueExistsController.ts │ │ │ ├── dto │ │ │ │ └── controllers │ │ │ │ │ ├── consumer-groups │ │ │ │ │ ├── CountConsumerGroupPendingMessagesControllerRequestPathDTO.ts │ │ │ │ │ ├── CountConsumerGroupPendingMessagesControllerResponseDTO.ts │ │ │ │ │ ├── DeleteConsumerGroupControllerRequestPathDTO.ts │ │ │ │ │ ├── DeleteConsumerGroupControllerResponseDTO.ts │ │ │ │ │ ├── GetConsumerGroupPendingMessagesControllerRequestPathDTO.ts │ │ │ │ │ ├── GetConsumerGroupPendingMessagesControllerRequestQueryDTO.ts │ │ │ │ │ ├── GetConsumerGroupPendingMessagesControllerResponseDTO.ts │ │ │ │ │ ├── GetConsumerGroupsControllerRequestPathDTO.ts │ │ │ │ │ ├── GetConsumerGroupsControllerResponseDTO.ts │ │ │ │ │ ├── PurgeConsumerGroupPendingMessagesControllerRequestPathDTO.ts │ │ │ │ │ ├── PurgeConsumerGroupPendingMessagesControllerResponseDTO.ts │ │ │ │ │ ├── SaveConsumerGroupControllerRequestBodyDTO.ts │ │ │ │ │ ├── SaveConsumerGroupControllerRequestPathDTO.ts │ │ │ │ │ └── SaveConsumerGroupControllerResponseDTO.ts │ │ │ │ │ ├── exchange-fan-out │ │ │ │ │ ├── BindQueueControllerRequestBodyDTO.ts │ │ │ │ │ ├── BindQueueControllerRequestPathDTO.ts │ │ │ │ │ ├── BindQueueControllerResponseDTO.ts │ │ │ │ │ ├── GetAllExchangesControllerRequestQueryDTO.ts │ │ │ │ │ ├── GetAllExchangesControllerResponseDTO.ts │ │ │ │ │ ├── GetQueuesControllerRequestPathDTO.ts │ │ │ │ │ ├── GetQueuesControllerResponseDTO.ts │ │ │ │ │ ├── SaveExchangeControllerRequestBodyDTO.ts │ │ │ │ │ └── SaveExchangeControllerResponseDTO.ts │ │ │ │ │ ├── messages │ │ │ │ │ ├── DeleteMessageByIdControllerRequestPathDTO.ts │ │ │ │ │ ├── DeleteMessageByIdControllerResponseDTO.ts │ │ │ │ │ ├── DeleteMessagesByIdsControllerRequestQueryDTO.ts │ │ │ │ │ ├── DeleteMessagesByIdsControllerResponseDTO.ts │ │ │ │ │ ├── GetMessageByIdControllerRequestPathDTO.ts │ │ │ │ │ ├── GetMessageByIdControllerResponseDTO.ts │ │ │ │ │ ├── GetMessageStatusControllerRequestPathDTO.ts │ │ │ │ │ ├── GetMessageStatusControllerResponseDTO.ts │ │ │ │ │ ├── GetMessagesByIdsControllerRequestQueryDTO.ts │ │ │ │ │ ├── GetMessagesByIdsControllerResponseDTO.ts │ │ │ │ │ ├── PublishMessageControllerRequestBodyDTO.ts │ │ │ │ │ ├── PublishMessageControllerResponseDTO.ts │ │ │ │ │ ├── RequeueMessageByIdControllerRequestPathDTO.ts │ │ │ │ │ └── RequeueMessageByIdControllerResponseDTO.ts │ │ │ │ │ ├── namespaces │ │ │ │ │ ├── DeleteNamespaceControllerRequestPathDTO.ts │ │ │ │ │ ├── DeleteNamespaceControllerResponseDTO.ts │ │ │ │ │ ├── GetNamespaceQueuesControllerRequestPathDTO.ts │ │ │ │ │ ├── GetNamespaceQueuesControllerResponseDTO.ts │ │ │ │ │ ├── GetNamespacesControllerRequestDTO.ts │ │ │ │ │ └── GetNamespacesControllerResponseDTO.ts │ │ │ │ │ ├── queue-acknowledged-messages │ │ │ │ │ ├── CountQueueAcknowledgedMessagesControllerRequestPathDTO.ts │ │ │ │ │ ├── CountQueueAcknowledgedMessagesControllerResponseDTO.ts │ │ │ │ │ ├── GetQueueAcknowledgedMessagesControllerRequestPathDTO.ts │ │ │ │ │ ├── GetQueueAcknowledgedMessagesControllerRequestQueryDTO.ts │ │ │ │ │ ├── GetQueueAcknowledgedMessagesControllerResponseDTO.ts │ │ │ │ │ ├── PurgeQueueAcknowledgedMessagesControllerRequestPathDTO.ts │ │ │ │ │ └── PurgeQueueAcknowledgedMessagesControllerResponseDTO.ts │ │ │ │ │ ├── queue-dead-lettered-messages │ │ │ │ │ ├── CountQueueDeadLetteredMessagesControllerRequestPathDTO.ts │ │ │ │ │ ├── CountQueueDeadLetteredMessagesControllerResponseDTO.ts │ │ │ │ │ ├── GetQueueDeadLetteredMessagesControllerRequestPathDTO.ts │ │ │ │ │ ├── GetQueueDeadLetteredMessagesControllerRequestQueryDTO.ts │ │ │ │ │ ├── GetQueueDeadLetteredMessagesControllerResponseDTO.ts │ │ │ │ │ ├── PurgeQueueDeadLetteredMessagesControllerRequestPathDTO.ts │ │ │ │ │ └── PurgeQueueDeadLetteredMessagesControllerResponseDTO.ts │ │ │ │ │ ├── queue-messages │ │ │ │ │ ├── CountQueueMessagesByStatusControllerRequestPathDTO.ts │ │ │ │ │ ├── CountQueueMessagesByStatusControllerResponseDTO.ts │ │ │ │ │ ├── CountQueueMessagesControllerRequestPathDTO.ts │ │ │ │ │ ├── CountQueueMessagesControllerResponseDTO.ts │ │ │ │ │ ├── GetQueueMessagesControllerRequestPathDTO.ts │ │ │ │ │ ├── GetQueueMessagesControllerRequestQueryDTO.ts │ │ │ │ │ └── GetQueueMessagesControllerResponseDTO.ts │ │ │ │ │ ├── queue-pending-messages │ │ │ │ │ ├── CountQueuePendingMessagesControllerRequestPathDTO.ts │ │ │ │ │ ├── CountQueuePendingMessagesControllerResponseDTO.ts │ │ │ │ │ ├── GetQueuePendingMessagesControllerRequestPathDTO.ts │ │ │ │ │ ├── GetQueuePendingMessagesControllerRequestQueryDTO.ts │ │ │ │ │ ├── GetQueuePendingMessagesControllerResponseDTO.ts │ │ │ │ │ ├── PurgeQueuePendingMessagesControllerRequestPathDTO.ts │ │ │ │ │ └── PurgeQueuePendingMessagesControllerResponseDTO.ts │ │ │ │ │ ├── queue-rate-limit │ │ │ │ │ ├── ClearQueueRateLimitControllerRequestPathDTO.ts │ │ │ │ │ ├── ClearQueueRateLimitControllerResponseDTO.ts │ │ │ │ │ ├── GetQueueRateLimitControllerRequestPathDTO.ts │ │ │ │ │ ├── GetQueueRateLimitControllerResponseDTO.ts │ │ │ │ │ ├── SetQueueRateLimitControllerRequestBodyDTO.ts │ │ │ │ │ ├── SetQueueRateLimitControllerRequestPathDTO.ts │ │ │ │ │ └── SetQueueRateLimitControllerResponseDTO.ts │ │ │ │ │ ├── queue-scheduled-messages │ │ │ │ │ ├── CountQueueScheduledMessagesControllerRequestPathDTO.ts │ │ │ │ │ ├── CountQueueScheduledMessagesControllerResponseDTO.ts │ │ │ │ │ ├── GetQueueScheduledMessagesControllerRequestPathDTO.ts │ │ │ │ │ ├── GetQueueScheduledMessagesControllerRequestQueryDTO.ts │ │ │ │ │ ├── GetQueueScheduledMessagesControllerResponseDTO.ts │ │ │ │ │ ├── PurgeQueueScheduledMessagesControllerRequestPathDTO.ts │ │ │ │ │ └── PurgeQueueScheduledMessagesControllerResponseDTO.ts │ │ │ │ │ └── queues │ │ │ │ │ ├── CreateQueueControllerRequestBodyDTO.ts │ │ │ │ │ ├── CreateQueueControllerResponseDTO.ts │ │ │ │ │ ├── DeleteQueueControllerRequestPathDTO.ts │ │ │ │ │ ├── DeleteQueueControllerResponseDTO.ts │ │ │ │ │ ├── GetAllQueuesControllerResponseDTO.ts │ │ │ │ │ ├── GetQueuePropertiesControllerRequestPathDTO.ts │ │ │ │ │ ├── GetQueuePropertiesControllerResponseDTO.ts │ │ │ │ │ ├── QueueExistsControllerRequestPathDTO.ts │ │ │ │ │ └── QueueExistsControllerResponseDTO.ts │ │ │ ├── errors │ │ │ │ ├── errors.ts │ │ │ │ ├── errors │ │ │ │ │ ├── consumerErrors.ts │ │ │ │ │ ├── consumerGroupsErrors.ts │ │ │ │ │ ├── exchangeErrors.ts │ │ │ │ │ ├── messageErrors.ts │ │ │ │ │ ├── namespaceErrors.ts │ │ │ │ │ ├── producerErrors.ts │ │ │ │ │ ├── queueErrors.ts │ │ │ │ │ ├── queueMessagesErrors.ts │ │ │ │ │ ├── queueRateErrors.ts │ │ │ │ │ └── routerErrors.ts │ │ │ │ ├── getErrorResponseParams.ts │ │ │ │ └── types │ │ │ │ │ └── index.ts │ │ │ ├── router │ │ │ │ └── resource-map.ts │ │ │ └── services │ │ │ │ ├── ConsumerGroupsService.ts │ │ │ │ ├── ExchangeFanOutService.ts │ │ │ │ ├── MessagesService.ts │ │ │ │ ├── NamespacesService.ts │ │ │ │ ├── QueueAcknowledgedMessagesService.ts │ │ │ │ ├── QueueDeadLetteredMessagesService.ts │ │ │ │ ├── QueueMessagesService.ts │ │ │ │ ├── QueuePendingMessagesService.ts │ │ │ │ ├── QueueRateLimitService.ts │ │ │ │ ├── QueueScheduledMessagesService.ts │ │ │ │ └── QueuesService.ts │ │ ├── config │ │ │ ├── constants.ts │ │ │ ├── errors │ │ │ │ ├── ConfigError.ts │ │ │ │ └── ConfigInvalidApiServerParamsError.ts │ │ │ ├── parseConfig.ts │ │ │ └── types │ │ │ │ └── index.ts │ │ └── lib │ │ │ ├── application │ │ │ └── types │ │ │ │ └── index.ts │ │ │ ├── controller │ │ │ └── types │ │ │ │ └── index.ts │ │ │ ├── errors │ │ │ ├── errors │ │ │ │ ├── RedisSmqRestApiError.ts │ │ │ │ └── ValidationError.ts │ │ │ └── middlewares │ │ │ │ └── errorHandlerMiddleware.ts │ │ │ ├── openapi-spec │ │ │ ├── adaptor.ts │ │ │ ├── builder.ts │ │ │ └── types │ │ │ │ └── index.ts │ │ │ ├── router │ │ │ ├── errors │ │ │ │ ├── RouterRequestValidationError.ts │ │ │ │ ├── RouterResponseValidationError.ts │ │ │ │ └── RouterResponseValidatorNotFoundError.ts │ │ │ ├── index.ts │ │ │ ├── middlewares │ │ │ │ ├── ValidateRequestMiddleware.ts │ │ │ │ └── ValidateResponseMiddleware.ts │ │ │ ├── parser.ts │ │ │ └── types │ │ │ │ └── index.ts │ │ │ └── validator │ │ │ ├── schema-generator.ts │ │ │ ├── types │ │ │ └── index.ts │ │ │ └── validator.ts │ ├── tests │ │ ├── common │ │ │ ├── bind-queue.ts │ │ │ ├── config.ts │ │ │ ├── create-fan-out-exchange.ts │ │ │ ├── create-queue.ts │ │ │ ├── delete-consumer-group.ts │ │ │ ├── publish-and-acknowledge-message.ts │ │ │ ├── publish-and-dead-letter-message.ts │ │ │ ├── publish-message.ts │ │ │ ├── redis-client.ts │ │ │ ├── save-consumer-group.ts │ │ │ ├── schedule-message.ts │ │ │ ├── set-rate-limit.ts │ │ │ ├── start-api-server.ts │ │ │ └── start-redis-server.ts │ │ ├── setup.ts │ │ └── types │ │ │ └── index.ts │ ├── tsconfig.cjs.json │ ├── tsconfig.json │ └── tsconfig.schema.json ├── redis-smq-web-ui │ └── README.md └── redis-smq │ ├── .codecov.yml │ ├── .npmignore │ ├── CHANGELOG.md │ ├── README.md │ ├── docs │ ├── README.md │ ├── api │ │ ├── README.md │ │ ├── classes │ │ │ ├── Configuration.md │ │ │ ├── ConfigurationError.md │ │ │ ├── ConfigurationMessageQueueSizeError.md │ │ │ ├── ConfigurationMessageStoreExpireError.md │ │ │ ├── ConfigurationNamespaceError.md │ │ │ ├── Consumer.md │ │ │ ├── ConsumerConsumeMessageHandlerAlreadyExistsError.md │ │ │ ├── ConsumerConsumerGroupIdNotSupportedError.md │ │ │ ├── ConsumerConsumerGroupIdRequiredError.md │ │ │ ├── ConsumerError.md │ │ │ ├── ConsumerGroups.md │ │ │ ├── ConsumerGroupsConsumerGroupNotEmptyError.md │ │ │ ├── ConsumerGroupsConsumerGroupsNotSupportedError.md │ │ │ ├── ConsumerGroupsError.md │ │ │ ├── ConsumerGroupsInvalidGroupIdError.md │ │ │ ├── ConsumerGroupsQueueNotFoundError.md │ │ │ ├── EventBus.md │ │ │ ├── ExchangeDirect.md │ │ │ ├── ExchangeError.md │ │ │ ├── ExchangeFanOut.md │ │ │ ├── ExchangeFanOutError.md │ │ │ ├── ExchangeFanOutExchangeHasBoundQueuesError.md │ │ │ ├── ExchangeFanOutQueueTypeError.md │ │ │ ├── ExchangeInvalidFanOutParamsError.md │ │ │ ├── ExchangeInvalidQueueParamsError.md │ │ │ ├── ExchangeInvalidTopicParamsError.md │ │ │ ├── ExchangeQueueIsNotBoundToExchangeError.md │ │ │ ├── ExchangeTopic.md │ │ │ ├── Message.md │ │ │ ├── MessageDestinationQueueAlreadySetError.md │ │ │ ├── MessageDestinationQueueRequiredError.md │ │ │ ├── MessageError.md │ │ │ ├── MessageInvalidParametersError.md │ │ │ ├── MessageMessageExchangeRequiredError.md │ │ │ ├── MessageMessageInProcessError.md │ │ │ ├── MessageMessageNotDeletedError.md │ │ │ ├── MessageMessageNotFoundError.md │ │ │ ├── MessageMessageNotRequeuableError.md │ │ │ ├── MessageMessagePropertyError.md │ │ │ ├── Namespace.md │ │ │ ├── NamespaceError.md │ │ │ ├── NamespaceInvalidNamespaceError.md │ │ │ ├── NamespaceNotFoundError.md │ │ │ ├── Producer.md │ │ │ ├── ProducerError.md │ │ │ ├── ProducerExchangeNoMatchedQueueError.md │ │ │ ├── ProducerInstanceNotRunningError.md │ │ │ ├── ProducerMessageExchangeRequiredError.md │ │ │ ├── ProducerMessagePriorityRequiredError.md │ │ │ ├── ProducerPriorityQueuingNotEnabledError.md │ │ │ ├── ProducerQueueMissingConsumerGroupsError.md │ │ │ ├── ProducerQueueNotFoundError.md │ │ │ ├── ProducerScheduleInvalidParametersError.md │ │ │ ├── ProducerUnknownQueueTypeError.md │ │ │ ├── ProducibleMessage.md │ │ │ ├── Queue.md │ │ │ ├── QueueAcknowledgedMessages.md │ │ │ ├── QueueDeadLetteredMessages.md │ │ │ ├── QueueError.md │ │ │ ├── QueueInvalidQueueParameterError.md │ │ │ ├── QueueMessages.md │ │ │ ├── QueueMessagesConsumerGroupIdNotSupportedError.md │ │ │ ├── QueueMessagesConsumerGroupIdRequiredError.md │ │ │ ├── QueueMessagesError.md │ │ │ ├── QueuePendingMessages.md │ │ │ ├── QueueQueueExistsError.md │ │ │ ├── QueueQueueHasRunningConsumersError.md │ │ │ ├── QueueQueueNotEmptyError.md │ │ │ ├── QueueQueueNotFoundError.md │ │ │ ├── QueueRateLimit.md │ │ │ ├── QueueRateLimitError.md │ │ │ ├── QueueRateLimitInvalidIntervalError.md │ │ │ ├── QueueRateLimitInvalidLimitError.md │ │ │ ├── QueueRateLimitQueueNotFoundError.md │ │ │ └── QueueScheduledMessages.md │ │ ├── enums │ │ │ ├── EExchangeType.md │ │ │ ├── EMessagePriority.md │ │ │ ├── EMessageProperty.md │ │ │ ├── EMessagePropertyStatus.md │ │ │ ├── EMessageUnacknowledgementAction.md │ │ │ ├── EMessageUnacknowledgementDeadLetterReason.md │ │ │ ├── EMessageUnacknowledgementReason.md │ │ │ ├── EQueueDeliveryModel.md │ │ │ ├── EQueueProperty.md │ │ │ └── EQueueType.md │ │ └── interfaces │ │ │ ├── IConsumerHeartbeat.md │ │ │ ├── IConsumerHeartbeatPayload.md │ │ │ ├── IConsumerMessageHandlerArgs.md │ │ │ ├── IEventBusConfig.md │ │ │ ├── IExchange.md │ │ │ ├── IMessageDeleteResponse.md │ │ │ ├── IMessageParams.md │ │ │ ├── IMessageStateTransferable.md │ │ │ ├── IMessageTransferable.md │ │ │ ├── IMessagesConfig.md │ │ │ ├── IMessagesConfigStorage.md │ │ │ ├── IMessagesConfigStorageOptions.md │ │ │ ├── IMessagesConfigStorageOptionsRequired.md │ │ │ ├── IMessagesConfigStorageRequired.md │ │ │ ├── IQueueConsumerGroupParams.md │ │ │ ├── IQueueGroupConsumersPendingCount.md │ │ │ ├── IQueueMessageManager.md │ │ │ ├── IQueueMessagesCount.md │ │ │ ├── IQueueMessagesPage.md │ │ │ ├── IQueueParams.md │ │ │ ├── IQueueParsedParams.md │ │ │ ├── IQueueProperties.md │ │ │ ├── IQueueRateLimit.md │ │ │ ├── IRedisSMQConfig.md │ │ │ ├── IRedisSMQConfigRequired.md │ │ │ └── ITopicParams.md │ ├── configuration.md │ ├── consuming-messages.md │ ├── esm-cjs-modules.md │ ├── event-bus.md │ ├── exchanges-and-delivery-models.md │ ├── faqs │ │ ├── README.md │ │ ├── comparing-redissmq-to-other-libraries.md │ │ ├── getting-started.md │ │ ├── handling-errors-and-exceptions.md │ │ └── release-v8-changes.md │ ├── graceful-shutdown.md │ ├── message-exchanges.md │ ├── message-handler-worker-threads.md │ ├── message-storage.md │ ├── message-storage.png │ ├── messages.md │ ├── multiplexing.md │ ├── performance.md │ ├── producing-messages.md │ ├── queue-delivery-models.md │ ├── queue-rate-limiting.md │ ├── queues.md │ ├── redis-smq-architecture-overview.png │ ├── redis-smq-architecture.md │ ├── redis-smq-direct-exchange.png │ ├── redis-smq-exchanges-and-delivery-models.png │ ├── redis-smq-fanout-exchange.png │ ├── redis-smq-fifo-queuing.png │ ├── redis-smq-lifo-queuing.png │ ├── redis-smq-multi-queue-consumers-producers.png │ ├── redis-smq-point-2-point-delivery-model.png │ ├── redis-smq-priority-queuing.png │ ├── redis-smq-pubsub-delivery-model-highlevel-view.png │ ├── redis-smq-pubsub-delivery-model.png │ ├── redis-smq-topic-exchange.png │ ├── scheduling-messages.md │ └── version-compatibility.md │ ├── index.ts │ ├── package.json │ ├── scripts │ └── build.sh │ ├── src │ ├── common │ │ ├── event-bus │ │ │ └── event-bus.ts │ │ ├── index.ts │ │ ├── redis-client │ │ │ ├── errors │ │ │ │ └── redis-client-instance-lock.error.ts │ │ │ ├── redis-client.ts │ │ │ └── scripts │ │ │ │ ├── lua │ │ │ │ ├── acknowledge-message.lua │ │ │ │ ├── create-queue.lua │ │ │ │ ├── delete-consumer-group.lua │ │ │ │ ├── delete-message.lua │ │ │ │ ├── fetch-message-for-processing.lua │ │ │ │ ├── handle-processing-queue.lua │ │ │ │ ├── has-queue-rate-exceeded.lua │ │ │ │ ├── init-consumer-queue.lua │ │ │ │ ├── publish-message.lua │ │ │ │ ├── publish-scheduled-message.lua │ │ │ │ ├── requeue-message.lua │ │ │ │ ├── schedule-message.lua │ │ │ │ └── set-queue-rate-limit.lua │ │ │ │ └── scripts.ts │ │ ├── redis-keys │ │ │ ├── errors │ │ │ │ ├── index.ts │ │ │ │ ├── redis-keys-invalid-key.error.ts │ │ │ │ └── redis-keys.error.ts │ │ │ └── redis-keys.ts │ │ └── types │ │ │ ├── event.ts │ │ │ └── index.ts │ ├── config │ │ ├── configuration.ts │ │ ├── errors │ │ │ ├── configuration-message-queue-size.error.ts │ │ │ ├── configuration-message-store-expire.error.ts │ │ │ ├── configuration-namespace.error.ts │ │ │ ├── configuration.error.ts │ │ │ └── index.ts │ │ ├── event-bus.ts │ │ ├── index.ts │ │ ├── logger.ts │ │ ├── messages │ │ │ ├── messages.ts │ │ │ └── store.ts │ │ ├── namespace.ts │ │ ├── redis.ts │ │ └── types │ │ │ ├── config.ts │ │ │ └── index.ts │ └── lib │ │ ├── consumer-groups │ │ ├── _ │ │ │ ├── _delete-consumer-group.ts │ │ │ ├── _get-consumer-groups.ts │ │ │ └── _save-consumer-group.ts │ │ ├── consumer-groups.ts │ │ ├── errors │ │ │ ├── consumer-groups-consumer-group-not-empty.error.ts │ │ │ ├── consumer-groups-consumer-groups-not-supported.error.ts │ │ │ ├── consumer-groups-invalid-group-id.error.ts │ │ │ ├── consumer-groups-queue-not-found.error.ts │ │ │ ├── consumer-groups.error.ts │ │ │ └── index.ts │ │ └── index.ts │ │ ├── consumer │ │ ├── consumer-heartbeat │ │ │ ├── consumer-heartbeat.ts │ │ │ └── event-bus-publisher.ts │ │ ├── consumer │ │ │ ├── _ │ │ │ │ └── _get-consumer-queues.ts │ │ │ ├── consumer.ts │ │ │ └── event-bus-publisher.ts │ │ ├── errors │ │ │ ├── consumer-consume-message-handler-already-exists.error.ts │ │ │ ├── consumer-consumer-group-id-not-supported.error.ts │ │ │ ├── consumer-consumer-group-id-required.error.ts │ │ │ ├── consumer.error.ts │ │ │ └── index.ts │ │ ├── index.ts │ │ ├── message-handler-runner │ │ │ ├── event-bus-publisher.ts │ │ │ ├── message-handler-runner.ts │ │ │ └── multiplexed-message-handler-runner.ts │ │ ├── message-handler │ │ │ ├── errors │ │ │ │ ├── consumer-message-handler-file.error.ts │ │ │ │ ├── consumer-message-handler-filename-extension.error.ts │ │ │ │ ├── consumer-message-handler.error.ts │ │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ └── message-handler │ │ │ │ ├── consume-message │ │ │ │ ├── consume-message.ts │ │ │ │ ├── event-bus-publisher.ts │ │ │ │ ├── message-unacknowledgement.ts │ │ │ │ ├── processing-queue.ts │ │ │ │ └── types │ │ │ │ │ ├── index.ts │ │ │ │ │ └── message-unacknowledgement.ts │ │ │ │ ├── dequeue-message │ │ │ │ ├── dequeue-message.ts │ │ │ │ └── event-bus-publisher.ts │ │ │ │ ├── even-bus-publisher.ts │ │ │ │ ├── message-handler.ts │ │ │ │ └── multiplexed-message-handler.ts │ │ ├── types │ │ │ ├── consumer-heartbeat.ts │ │ │ ├── index.ts │ │ │ └── message-handler.ts │ │ └── workers │ │ │ ├── delay-unacknowledged.worker.ts │ │ │ ├── publish-scheduled.worker.ts │ │ │ ├── requeue-unacknowledged.worker.ts │ │ │ ├── watch-consumers.worker.ts │ │ │ └── worker.ts │ │ ├── exchange │ │ ├── _ │ │ │ └── _get-exchange-queues.ts │ │ ├── errors │ │ │ ├── exchange-fan-out-exchange-has-bound-queues.error.ts │ │ │ ├── exchange-fan-out-queue-type.error.ts │ │ │ ├── exchange-fan-out.error.ts │ │ │ ├── exchange-invalid-fan-out-params.error.ts │ │ │ ├── exchange-invalid-queue-params.error.ts │ │ │ ├── exchange-invalid-topic-params.error.ts │ │ │ ├── exchange-queue-is-not-bound-to-exchange.error.ts │ │ │ ├── exchange.error.ts │ │ │ └── index.ts │ │ ├── exchange-abstract.ts │ │ ├── exchange-direct │ │ │ ├── _ │ │ │ │ ├── _get-exchange-direct-transferable.ts │ │ │ │ └── _validate-exchange-direct-params.ts │ │ │ ├── exchange-direct.ts │ │ │ └── index.ts │ │ ├── exchange-fan-out │ │ │ ├── _ │ │ │ │ ├── _get-exchange-fanout-transferable.ts │ │ │ │ ├── _get-fan-out-exchange-queues.ts │ │ │ │ ├── _get-queue-fan-out-exchange.ts │ │ │ │ └── _validate-exchange-fan-out-params.ts │ │ │ ├── exchange-fan-out.ts │ │ │ └── index.ts │ │ ├── exchange-topic │ │ │ ├── _ │ │ │ │ ├── _get-exchange-topic-transferable.ts │ │ │ │ ├── _get-topic-exchange-params.ts │ │ │ │ ├── _get-topic-exchange-queues.ts │ │ │ │ └── _validate-exchange-topic-params.ts │ │ │ ├── exchange-topic.ts │ │ │ └── index.ts │ │ ├── index.ts │ │ └── types │ │ │ ├── exchange.ts │ │ │ └── index.ts │ │ ├── index.ts │ │ ├── message │ │ ├── _ │ │ │ ├── _delete-message.ts │ │ │ ├── _from-message.ts │ │ │ ├── _get-message-state.ts │ │ │ ├── _get-message-status.ts │ │ │ ├── _get-message.ts │ │ │ └── _requeue-message.ts │ │ ├── errors │ │ │ ├── index.ts │ │ │ ├── message-destination-queue-already-set.error.ts │ │ │ ├── message-destination-queue-required.error.ts │ │ │ ├── message-invalid-parameters.error.ts │ │ │ ├── message-message-exchange-required.error.ts │ │ │ ├── message-message-in-process.error.ts │ │ │ ├── message-message-not-deleted.error.ts │ │ │ ├── message-message-not-found.error.ts │ │ │ ├── message-message-not-requeuable.error.ts │ │ │ ├── message-message-property.error.ts │ │ │ └── message.error.ts │ │ ├── index.ts │ │ ├── message-envelope.ts │ │ ├── message-state.ts │ │ ├── message.ts │ │ ├── producible-message.ts │ │ └── types │ │ │ ├── config.ts │ │ │ ├── delete-message.ts │ │ │ ├── index.ts │ │ │ ├── message-state.ts │ │ │ └── message.ts │ │ ├── namespace │ │ ├── errors │ │ │ ├── index.ts │ │ │ ├── namespace-invalid-namespace.error.ts │ │ │ ├── namespace-not-found.error.ts │ │ │ └── namespace.error.ts │ │ ├── index.ts │ │ └── namespace.ts │ │ ├── producer │ │ ├── _ │ │ │ └── _schedule-message.ts │ │ ├── errors │ │ │ ├── index.ts │ │ │ ├── producer-exchange-no-matched-queue.error.ts │ │ │ ├── producer-instance-not-running.error.ts │ │ │ ├── producer-message-exchange-required.error.ts │ │ │ ├── producer-message-priority-required.error.ts │ │ │ ├── producer-priority-queuing-not-enabled.error.ts │ │ │ ├── producer-queue-missing-consumer-groups.error.ts │ │ │ ├── producer-queue-not-found.error.ts │ │ │ ├── producer-schedule-invalid-parameters.error.ts │ │ │ ├── producer-unknown-queue-type.error.ts │ │ │ └── producer.error.ts │ │ ├── event-bus-publisher.ts │ │ ├── index.ts │ │ ├── producer.ts │ │ └── queue-consumer-groups-cache.ts │ │ ├── queue-messages │ │ ├── _ │ │ │ └── _validate-queue-extended-params.ts │ │ ├── errors │ │ │ ├── index.ts │ │ │ ├── queue-messages-consumer-group-id-not-supported.error.ts │ │ │ ├── queue-messages-consumer-group-id-required.error.ts │ │ │ └── queue-messages.error.ts │ │ ├── index.ts │ │ ├── queue-messages-manager │ │ │ └── queue-messages-manager-abstract.ts │ │ ├── queue-messages-storage │ │ │ ├── queue-messages-storage-list.ts │ │ │ ├── queue-messages-storage-set.ts │ │ │ ├── queue-messages-storage-sorted-set.ts │ │ │ └── queue-messages-storage.ts │ │ ├── queue-messages │ │ │ ├── queue-acknowledged-messages.ts │ │ │ ├── queue-dead-lettered-messages.ts │ │ │ ├── queue-messages.ts │ │ │ ├── queue-pending-messages │ │ │ │ ├── index.ts │ │ │ │ ├── priority-queue-pending-messages.ts │ │ │ │ ├── queue-pending-messages.ts │ │ │ │ └── sequential-queue-pending-messages.ts │ │ │ └── queue-scheduled-messages.ts │ │ └── types │ │ │ └── index.ts │ │ ├── queue-rate-limit │ │ ├── _ │ │ │ └── _has-rate-limit-exceeded.ts │ │ ├── errors │ │ │ ├── index.ts │ │ │ ├── queue-rate-limit-invalid-interval.error.ts │ │ │ ├── queue-rate-limit-invalid-limit.error.ts │ │ │ ├── queue-rate-limit-queue-not-found.error.ts │ │ │ └── queue-rate-limit.error.ts │ │ ├── index.ts │ │ └── queue-rate-limit.ts │ │ └── queue │ │ ├── _ │ │ ├── _delete-queue.ts │ │ ├── _get-queue-consumer-ids.ts │ │ ├── _get-queue-consumers.ts │ │ ├── _get-queue-properties.ts │ │ ├── _get-queues.ts │ │ ├── _parse-queue-extended-params.ts │ │ ├── _parse-queue-params-and-validate.ts │ │ ├── _parse-queue-params.ts │ │ └── _queue-exists.ts │ │ ├── errors │ │ ├── index.ts │ │ ├── queue-invalid-queue-parameter.error.ts │ │ ├── queue-queue-exists.error.ts │ │ ├── queue-queue-has-running-consumers.error.ts │ │ ├── queue-queue-not-empty.error.ts │ │ ├── queue-queue-not-found.error.ts │ │ └── queue.error.ts │ │ ├── index.ts │ │ ├── queue.ts │ │ └── types │ │ ├── index.ts │ │ ├── queue-consumer.ts │ │ └── queue.ts │ ├── tests │ ├── common │ │ ├── base-instance.ts │ │ ├── config.ts │ │ ├── consumer-thread.ts │ │ ├── consumer.ts │ │ ├── event-bus-redis.ts │ │ ├── events.ts │ │ ├── exchange.ts │ │ ├── logger.ts │ │ ├── message-handler-worker-acks.ts │ │ ├── message-handler-worker-faulty-exit.ts │ │ ├── message-handler-worker-faulty.ts │ │ ├── message-handler-worker-unacks-exception.ts │ │ ├── message-handler-worker-unacks.ts │ │ ├── message-producing-consuming.ts │ │ ├── message.ts │ │ ├── namespace.ts │ │ ├── producer.ts │ │ ├── queue-acknowledged-messages.ts │ │ ├── queue-dead-lettered-messages.ts │ │ ├── queue-messages.ts │ │ ├── queue-pending-messages.ts │ │ ├── queue-rate-limit.ts │ │ ├── queue-scheduled-messages.ts │ │ ├── queue.ts │ │ ├── redis.ts │ │ ├── schedule-worker.ts │ │ ├── shut-down.ts │ │ ├── start-redis-server.ts │ │ ├── start-up.ts │ │ ├── utils.ts │ │ └── validate-time.ts │ ├── setup.ts │ └── tests │ │ ├── consume-message-worker │ │ ├── test00001.test.ts │ │ ├── test00002.test.ts │ │ └── test00003.test.ts │ │ ├── consuming-messages │ │ ├── test00001.test.ts │ │ ├── test00002.test.ts │ │ ├── test00003.test.ts │ │ ├── test00004.test.ts │ │ ├── test00005.test.ts │ │ ├── test00006.test.ts │ │ ├── test00007.test.ts │ │ ├── test00008.test.ts │ │ ├── test00009.test.ts │ │ ├── test00010.test.ts │ │ ├── test00011.test.ts │ │ ├── test00012.test.ts │ │ ├── test00013.test.ts │ │ ├── test00014.test.ts │ │ ├── test00015.test.ts │ │ ├── test00016.test.ts │ │ ├── test00017.test.ts │ │ ├── test00019.test.ts │ │ ├── test00020.test.ts │ │ ├── test00021.test.ts │ │ ├── test00022.test.ts │ │ ├── test00023.test.ts │ │ ├── test00024.test.ts │ │ ├── test00025.test.ts │ │ ├── test00026.test.ts │ │ ├── test00027.test.ts │ │ ├── test00032.test.ts │ │ ├── test00033.test.ts │ │ ├── test00034.test.ts │ │ ├── test00035.test.ts │ │ ├── test00036.test.ts │ │ └── test00038.test.ts │ │ ├── deleting-messages │ │ ├── test00001.test.ts │ │ ├── test00002.test.ts │ │ ├── test00003.test.ts │ │ ├── test00004.test.ts │ │ ├── test00005.test.ts │ │ ├── test00006.test.ts │ │ ├── test00007.test.ts │ │ ├── test00008.test.ts │ │ ├── test00009.test.ts │ │ ├── test00010.test.ts │ │ └── test00011.test.ts │ │ ├── event-bus │ │ ├── test00001.test.ts │ │ └── test00002.test.ts │ │ ├── exchanges │ │ ├── direct-exchange │ │ │ ├── test00001.test.ts │ │ │ └── test00002.test.ts │ │ ├── fanout-exchange │ │ │ ├── test00001.test.ts │ │ │ ├── test00002.test.ts │ │ │ ├── test00003.test.ts │ │ │ ├── test00006.test.ts │ │ │ ├── test00007.test.ts │ │ │ └── test00008.test.ts │ │ └── topic-exchange │ │ │ ├── test00001.test.ts │ │ │ ├── test00002.test.ts │ │ │ ├── test00003.test.ts │ │ │ ├── test00005.test.ts │ │ │ └── test00007.test.ts │ │ ├── health-check │ │ ├── test00001.test.ts │ │ ├── test00002.test.ts │ │ ├── test00003.test.ts │ │ ├── test00004.test.ts │ │ ├── test00005.test.ts │ │ └── test00006.test.ts │ │ ├── message-status │ │ ├── test00001.test.ts │ │ ├── test00002.test.ts │ │ ├── test00003.test.ts │ │ └── test00004.test.ts │ │ ├── misc │ │ ├── test00001.test.ts │ │ ├── test00003.test.ts │ │ ├── test00004.test.ts │ │ ├── test00014.test.ts │ │ ├── test00019.test.ts │ │ └── test00020.test.ts │ │ ├── namespace │ │ └── test00001.test.ts │ │ ├── priority-queuing │ │ ├── test00001.test.ts │ │ └── test00002.test.ts │ │ ├── producer │ │ └── test00001.test.ts │ │ ├── purging-queues │ │ ├── test00001.test.ts │ │ ├── test00002.test.ts │ │ ├── test00003.test.ts │ │ ├── test00004.test.ts │ │ ├── test00005.test.ts │ │ ├── test00006.test.ts │ │ ├── test00007.test.ts │ │ ├── test00008.test.ts │ │ ├── test00009.test.ts │ │ ├── test00010.test.ts │ │ ├── test00011.test.ts │ │ ├── test00012.test.ts │ │ ├── test00013.test.ts │ │ └── test00014.test.ts │ │ ├── queue-acknowledged-messages │ │ └── test00001.test.ts │ │ ├── queue-consumer-groups │ │ ├── test00001.test.ts │ │ ├── test00002.test.ts │ │ ├── test00003.test.ts │ │ ├── test00004.test.ts │ │ ├── test00005.test.ts │ │ ├── test00006.test.ts │ │ ├── test00007.test.ts │ │ └── test00008.test.ts │ │ ├── queue-dead-lettered-messages │ │ └── test00001.test.ts │ │ ├── queue-message-storage-list │ │ ├── test00001.test.ts │ │ ├── test00002.test.ts │ │ ├── test00003.test.ts │ │ ├── test00004.test.ts │ │ ├── test00005.test.ts │ │ └── test00006.test.ts │ │ ├── queue-message-storage-set │ │ ├── test00001.test.ts │ │ ├── test00002.test.ts │ │ ├── test00003.test.ts │ │ ├── test00004.test.ts │ │ ├── test00005.test.ts │ │ └── test00006.test.ts │ │ ├── queue-message-storage-sorted-set │ │ ├── test00001.test.ts │ │ ├── test00002.test.ts │ │ ├── test00003.test.ts │ │ ├── test00004.test.ts │ │ ├── test00005.test.ts │ │ └── test00006.test.ts │ │ ├── queue-pending-messages │ │ └── test00001.test.ts │ │ ├── queue-rate-limit │ │ ├── test00028.test.ts │ │ ├── test00029.test.ts │ │ ├── test00030.test.ts │ │ ├── test00031.test.ts │ │ └── test00032.test.ts │ │ ├── queue-scheduled-messages │ │ ├── test00001.test.ts │ │ ├── test00002.test.ts │ │ ├── test00003.test.ts │ │ ├── test00004.test.ts │ │ ├── test00005.test.ts │ │ ├── test00006.test.ts │ │ ├── test00007.test.ts │ │ ├── test00008.test.ts │ │ └── test00010.test.ts │ │ ├── requeuing-messages │ │ ├── test00001.test.ts │ │ ├── test00002.test.ts │ │ └── test00003.test.ts │ │ └── workers │ │ ├── test00001.test.ts │ │ ├── test00002.test.ts │ │ └── test00003.test.ts │ ├── tsconfig.cjs.json │ └── tsconfig.json ├── pnpm-lock.yaml ├── pnpm-workspace.yaml ├── release-notes └── release-v8.md ├── scripts ├── build.sh ├── redis.sh ├── test.sh └── test_workspace_esm.sh ├── tsconfig.cjs.json ├── tsconfig.json └── vitest.config.js /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: "❓ Question" 4 | url: https://github.com/weyoss/redis-smq/discussions/new?category=q-a 5 | about: "Ask questions about usage, configuration, or best practices and get help from the community" 6 | 7 | - name: "🆘 Support Request" 8 | url: https://github.com/weyoss/redis-smq/discussions/new?category=q-a 9 | about: "Need help with implementation or troubleshooting? Post your support requests here" 10 | 11 | - name: "📚 Documentation" 12 | url: https://github.com/weyoss/redis-smq/tree/master/packages/redis-smq/docs/README.md 13 | about: "Consult our comprehensive documentation for guides, API references, and examples before reporting issues" -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .npmrc 3 | dist 4 | **/dist 5 | node_modules 6 | **/node_modules 7 | coverage 8 | **/coverage 9 | data 10 | **/scripts/document.sh 11 | **/scripts/release.sh 12 | **/scripts/benchmark.sh 13 | .husky/_ 14 | lerna-debug.log 15 | *.sqlite -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | commitlint --edit $1 3 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | lint-staged -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | **/dist/* 2 | **/node_modules/* -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all" 4 | } 5 | -------------------------------------------------------------------------------- /commitlint.config.cjs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | module.exports = { extends: ['@commitlint/config-conventional'] }; 11 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weyoss/redis-smq/2f37b0f236ed61024802f3476800b7989d6bf8fc/logo.png -------------------------------------------------------------------------------- /packages/redis-smq-common/.codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | patch: 4 | default: 5 | target: 80% 6 | -------------------------------------------------------------------------------- /packages/redis-smq-common/.npmignore: -------------------------------------------------------------------------------- 1 | # Ignore everything 2 | * 3 | 4 | # Except the dist directory 5 | !dist/cjs/src/** 6 | !dist/cjs/index.d.ts 7 | !dist/cjs/index.d.ts.map 8 | !dist/cjs/index.js 9 | !dist/cjs/index.js.map 10 | !dist/cjs/package.json 11 | !dist/esm/src/** 12 | !dist/esm/index.d.ts 13 | !dist/esm/index.d.ts.map 14 | !dist/esm/index.js 15 | !dist/esm/index.js.map 16 | !LICENSE 17 | !CHANGELOG.md 18 | !package.json -------------------------------------------------------------------------------- /packages/redis-smq-common/docs/api/enums/ERedisConfigClient.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ Common Library](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / ERedisConfigClient 2 | 3 | # Enumeration: ERedisConfigClient 4 | 5 | ## Table of contents 6 | 7 | ### Enumeration Members 8 | 9 | - [IOREDIS](ERedisConfigClient.md#ioredis) 10 | - [REDIS](ERedisConfigClient.md#redis) 11 | 12 | ## Enumeration Members 13 | 14 | ### IOREDIS 15 | 16 | • **IOREDIS** = ``"ioredis"`` 17 | 18 | ___ 19 | 20 | ### REDIS 21 | 22 | • **REDIS** = ``"redis"`` 23 | -------------------------------------------------------------------------------- /packages/redis-smq-common/docs/api/enums/EWorkerThreadParentMessage.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ Common Library](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / EWorkerThreadParentMessage 2 | 3 | # Enumeration: EWorkerThreadParentMessage 4 | 5 | ## Table of contents 6 | 7 | ### Enumeration Members 8 | 9 | - [CALL](EWorkerThreadParentMessage.md#call) 10 | - [RUN](EWorkerThreadParentMessage.md#run) 11 | - [SHUTDOWN](EWorkerThreadParentMessage.md#shutdown) 12 | 13 | ## Enumeration Members 14 | 15 | ### CALL 16 | 17 | • **CALL** = ``0`` 18 | 19 | ___ 20 | 21 | ### RUN 22 | 23 | • **RUN** = ``1`` 24 | 25 | ___ 26 | 27 | ### SHUTDOWN 28 | 29 | • **SHUTDOWN** = ``2`` 30 | -------------------------------------------------------------------------------- /packages/redis-smq-common/docs/api/enums/EWorkerType.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ Common Library](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / EWorkerType 2 | 3 | # Enumeration: EWorkerType 4 | 5 | ## Table of contents 6 | 7 | ### Enumeration Members 8 | 9 | - [CALLABLE](EWorkerType.md#callable) 10 | - [RUNNABLE](EWorkerType.md#runnable) 11 | 12 | ## Enumeration Members 13 | 14 | ### CALLABLE 15 | 16 | • **CALLABLE** = ``0`` 17 | 18 | ___ 19 | 20 | ### RUNNABLE 21 | 22 | • **RUNNABLE** = ``1`` 23 | -------------------------------------------------------------------------------- /packages/redis-smq-common/docs/api/interfaces/IWorkerThreadData.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ Common Library](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / IWorkerThreadData 2 | 3 | # Interface: IWorkerThreadData 4 | 5 | ## Table of contents 6 | 7 | ### Properties 8 | 9 | - [filename](IWorkerThreadData.md#filename) 10 | - [initialPayload](IWorkerThreadData.md#initialpayload) 11 | - [type](IWorkerThreadData.md#type) 12 | 13 | ## Properties 14 | 15 | ### filename 16 | 17 | • **filename**: `string` 18 | 19 | ___ 20 | 21 | ### initialPayload 22 | 23 | • **initialPayload**: `unknown` 24 | 25 | ___ 26 | 27 | ### type 28 | 29 | • **type**: [`EWorkerType`](../enums/EWorkerType.md) 30 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/archive/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { extractTgz } from './extract-tgz.js'; 11 | import { extractRpm } from './extract-rpm.js'; 12 | 13 | export const archive = { 14 | extractTgz, 15 | extractRpm, 16 | }; 17 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/async/errors/async-callback-timeout.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from '../../errors/index.js'; 11 | 12 | export class AsyncCallbackTimeoutError extends RedisSMQError { 13 | constructor() { 14 | super('Async callback timed out'); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/async/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './async-callback-timeout.error.js'; 11 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/async/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './types/index.js'; 11 | export * from './errors/index.js'; 12 | export * from './async.js'; 13 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/async/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './callback.js'; 11 | export * from './function.js'; 12 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/env/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import * as cacheDir from './cache-dir.js'; 11 | import * as currentDir from './current-dir.js'; 12 | import * as filesystem from './filesystem.js'; 13 | 14 | export const env = { 15 | ...cacheDir, 16 | ...currentDir, 17 | ...filesystem, 18 | }; 19 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/errors/abort.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from './redis-smq.error.js'; 11 | 12 | export class AbortError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/errors/callback-empty-reply.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { PanicError } from './panic.error.js'; 11 | 12 | export class CallbackEmptyReplyError extends PanicError { 13 | constructor() { 14 | super(`Expected a non-empty reply`); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/errors/callback-invalid-reply.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { PanicError } from './panic.error.js'; 11 | 12 | export class CallbackInvalidReplyError extends PanicError { 13 | constructor() { 14 | super(`Invalid reply type`); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export { CallbackEmptyReplyError } from './callback-empty-reply.error.js'; 11 | export { CallbackInvalidReplyError } from './callback-invalid-reply.error.js'; 12 | export { PanicError } from './panic.error.js'; 13 | export { RedisSMQError } from './redis-smq.error.js'; 14 | export { AbortError } from './abort.error.js'; 15 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/errors/panic.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from './redis-smq.error.js'; 11 | 12 | export class PanicError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/errors/redis-smq.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export abstract class RedisSMQError extends Error { 11 | constructor(message?: string) { 12 | super(message); 13 | } 14 | 15 | override get name(): string { 16 | return this.constructor.name; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/event-bus/errors/event-bus-instance-lock.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { EventBusError } from './event-bus.error.js'; 11 | 12 | export class EventBusInstanceLockError extends EventBusError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/event-bus/errors/event-bus-not-connected.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { EventBusError } from './event-bus.error.js'; 11 | 12 | export class EventBusNotConnectedError extends EventBusError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/event-bus/errors/event-bus.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from '../../errors/index.js'; 11 | 12 | export class EventBusError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/event-bus/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './event-bus.error.js'; 11 | export * from './event-bus-not-connected.error.js'; 12 | export * from './event-bus-instance-lock.error.js'; 13 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/event-bus/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './errors/index.js'; 11 | export * from './types/index.js'; 12 | export * from './event-bus.js'; 13 | export * from './event-bus-redis.js'; 14 | export * from './event-bus-redis-factory.js'; 15 | export * from './with-event-bus.js'; 16 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/event-bus/types/event-bus.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ICallback } from '../../async/index.js'; 11 | import { IEventEmitter, TEventEmitterEvent } from '../../event/index.js'; 12 | 13 | export type TEventBusEvent = TEventEmitterEvent & { 14 | error: (err: Error) => void; 15 | }; 16 | 17 | export interface IEventBus 18 | extends IEventEmitter { 19 | shutdown(cb: ICallback): void; 20 | } 21 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/event-bus/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './event-bus.js'; 11 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/event/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './event-emitter.js'; 11 | export * from './types/index.js'; 12 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/event/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './event-emitter.js'; 11 | export * from '../../event-bus/types/event-bus.js'; 12 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/file-lock/errors/file-lock-attempts-exhausted.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { FileLockError } from './file-lock.error.js'; 11 | 12 | export class FileLockAttemptsExhaustedError extends FileLockError { 13 | constructor(lockFile: string, retries: number) { 14 | super(`Failed to acquire lock on ${lockFile} after ${retries} attempts`); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/file-lock/errors/file-lock.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from '../../errors/index.js'; 11 | 12 | export class FileLockError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/file-lock/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './file-lock-attempts-exhausted.error.js'; 11 | export * from './file-lock.error.js'; 12 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/file-lock/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './file-lock.js'; 11 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/logger/console-logger/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './console-logger.js'; 11 | export * from './types/index.js'; 12 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/logger/console-logger/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './console-logger.js'; 11 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/logger/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export { LoggerError } from './logger.error.js'; 11 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/logger/errors/logger.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from '../../errors/index.js'; 11 | 12 | export class LoggerError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/logger/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './types/index.js'; 11 | export * from './errors/index.js'; 12 | export * from './logger.js'; 13 | export * from './console-logger/index.js'; 14 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/logger/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './logger.js'; 11 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/power-switch/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './power-switch.js'; 11 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-client/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export { RedisClientError } from './redis-client.error.js'; 11 | export { WatchedKeysChangedError } from './watched-keys-changed.error.js'; 12 | export { InstanceLockError } from './instance-lock.error.js'; 13 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-client/errors/instance-lock.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from '../../errors/index.js'; 11 | 12 | export class InstanceLockError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-client/errors/redis-client.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from '../../errors/index.js'; 11 | 12 | export class RedisClientError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-client/errors/watched-keys-changed.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisClientError } from './redis-client.error.js'; 11 | 12 | export class WatchedKeysChangedError extends RedisClientError { 13 | constructor(msg = 'One (or more) of the watched keys has been changed') { 14 | super(msg); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-client/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './types/index.js'; 11 | export * from './errors/index.js'; 12 | export * from './create-redis-client.js'; 13 | export * from './with-redis-client.js'; 14 | export * from './redis-client-factory.js'; 15 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-client/lua-scripts/lpoprpush.lua: -------------------------------------------------------------------------------- 1 | --- 2 | --- Copyright (c) 3 | --- Weyoss 4 | --- https://github.com/weyoss 5 | --- 6 | --- This source code is licensed under the MIT license found in the LICENSE file 7 | --- in the root directory of this source tree. 8 | --- 9 | 10 | --- KEYS[1] source list key 11 | --- KEYS[2] destination list key 12 | if redis.call("EXISTS", KEYS[1]) == 1 then 13 | local result = redis.call("LRANGE", KEYS[1], 0, 0) 14 | if #(result) then 15 | local message = result[1] 16 | redis.call("LREM", KEYS[1], 1, message) 17 | redis.call("RPUSH", KEYS[2], message) 18 | return message 19 | end 20 | end 21 | return nil -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-client/lua-scripts/zpoprpush.lua: -------------------------------------------------------------------------------- 1 | --- 2 | --- Copyright (c) 3 | --- Weyoss 4 | --- https://github.com/weyoss 5 | --- 6 | --- This source code is licensed under the MIT license found in the LICENSE file 7 | --- in the root directory of this source tree. 8 | --- 9 | 10 | local keySortedSet = KEYS[1] 11 | local keyList = KEYS[2] 12 | 13 | if redis.call("EXISTS", keySortedSet) == 1 then 14 | local result = redis.call("ZRANGE", keySortedSet, 0, 0) 15 | if #(result) then 16 | local messageId = result[1] 17 | redis.call("ZREM", keySortedSet, messageId) 18 | redis.call("RPUSH", keyList, messageId) 19 | return messageId 20 | end 21 | end 22 | return nil -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-client/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './config.js'; 11 | export * from './redis-client.js'; 12 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-lock/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export { LockError } from './lock.error.js'; 11 | export { LockAcquireError } from './lock-acquire.error.js'; 12 | export { LockExtendError } from './lock-extend.error.js'; 13 | export { LockMethodNotAllowedError } from './lock-method-not-allowed.error.js'; 14 | export { LockNotAcquiredError } from './lock-not-acquired.error.js'; 15 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-lock/errors/lock-acquire.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { LockError } from './lock.error.js'; 11 | 12 | export class LockAcquireError extends LockError { 13 | constructor(message = `Could not acquire a lock`) { 14 | super(message); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-lock/errors/lock-extend.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { LockError } from './lock.error.js'; 11 | 12 | export class LockExtendError extends LockError { 13 | constructor(message = `Acquired lock could not be extended`) { 14 | super(message); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-lock/errors/lock-method-not-allowed.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { LockError } from './lock.error.js'; 11 | 12 | export class LockMethodNotAllowedError extends LockError { 13 | constructor( 14 | message = `This method can not be used when autoExtend is enabled`, 15 | ) { 16 | super(message); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-lock/errors/lock-not-acquired.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { LockError } from './lock.error.js'; 11 | 12 | export class LockNotAcquiredError extends LockError { 13 | constructor( 14 | message = `Can not extend a lock which has not been yet acquired. Maybe a pending operation is in progress.`, 15 | ) { 16 | super(message); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-lock/errors/lock.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from '../../errors/index.js'; 11 | 12 | export class LockError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-lock/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './errors/index.js'; 11 | export * from './redis-lock.js'; 12 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-lock/lua-scripts/extend-lock.lua: -------------------------------------------------------------------------------- 1 | --- 2 | --- Copyright (c) 3 | --- Weyoss 4 | --- https://github.com/weyoss 5 | --- 6 | --- This source code is licensed under the MIT license found in the LICENSE file 7 | --- in the root directory of this source tree. 8 | --- 9 | 10 | --- KEYS[1] lock_key 11 | --- ARGV[1] lock_id 12 | --- ARGV[2] ttl 13 | if redis.call("get",KEYS[1]) == ARGV[1] then 14 | return redis.call("PEXPIRE", KEYS[1], ARGV[2]) 15 | end 16 | return 0 17 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-lock/lua-scripts/release-lock.lua: -------------------------------------------------------------------------------- 1 | --- 2 | --- Copyright (c) 3 | --- Weyoss 4 | --- https://github.com/weyoss 5 | --- 6 | --- This source code is licensed under the MIT license found in the LICENSE file 7 | --- in the root directory of this source tree. 8 | --- 9 | 10 | --- KEYS[1] keyLock 11 | --- ARGV[1] lockId 12 | if redis.call("get",KEYS[1]) == ARGV[1] then 13 | return redis.call("del",KEYS[1]) 14 | end 15 | return 0 16 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-server/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './redis-server-binary-not-found.error.js'; 11 | export * from './redis-server.error.js'; 12 | export * from './redis-server-unsupported-platform.error.js'; 13 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-server/errors/redis-server-binary-not-found.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisServerError } from './redis-server.error.js'; 11 | 12 | export class RedisServerBinaryNotFoundError extends RedisServerError { 13 | constructor() { 14 | super( 15 | `A Redis server binary could not be found. Please set up Redis server first.`, 16 | ); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-server/errors/redis-server-unsupported-platform.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisServerError } from './redis-server.error.js'; 11 | 12 | export class RedisServerUnsupportedPlatformError extends RedisServerError { 13 | constructor() { 14 | super(`Unsupported platform/architecture`); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-server/errors/redis-server.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | import { RedisSMQError } from '../../errors/index.js'; 10 | 11 | export class RedisServerError extends RedisSMQError {} 12 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/redis-server/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './redis-server.js'; 11 | export * from './errors/index.js'; 12 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/runnable/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './runnable.js'; 11 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/timer/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export { TimerError } from './timer.error.js'; 11 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/timer/errors/timer.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from '../../errors/index.js'; 11 | 12 | export class TimerError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/timer/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './errors/index.js'; 11 | export * from './types/index.js'; 12 | export * from './timer.js'; 13 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/timer/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './timer.js'; 11 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/timer/types/timer.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TFunction } from '../../async/index.js'; 11 | 12 | export type TTimerEvent = { 13 | error: (err: Error) => void; 14 | }; 15 | 16 | export type TTimer = { 17 | timer: NodeJS.Timeout; 18 | periodic: boolean; 19 | fn: TFunction; 20 | }; 21 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/worker/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export { WorkerError } from './worker-error.js'; 11 | export { WorkerThreadError } from './worker-thread.error.js'; 12 | export { WorkerPayloadRequiredError } from './worker-payload-required.error.js'; 13 | export { WorkerAlreadyRunningError } from './worker-already-running.error.js'; 14 | export { WorkerAlreadyDownError } from './worker-already-down.error.js'; 15 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/worker/errors/worker-already-down.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { WorkerError } from './worker-error.js'; 11 | 12 | export class WorkerAlreadyDownError extends WorkerError { 13 | constructor() { 14 | super(`Worker is going/already down`); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/worker/errors/worker-already-running.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { WorkerError } from './worker-error.js'; 11 | 12 | export class WorkerAlreadyRunningError extends WorkerError { 13 | constructor() { 14 | super(`Worker is going/already up`); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/worker/errors/worker-error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from '../../errors/index.js'; 11 | 12 | export class WorkerError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/worker/errors/worker-payload-required.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { WorkerError } from './worker-error.js'; 11 | 12 | export class WorkerPayloadRequiredError extends WorkerError { 13 | constructor() { 14 | super(`Worker payload is required`); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/worker/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './types/index.js'; 11 | export * from './errors/index.js'; 12 | export * from './worker-callable.js'; 13 | export * from './worker-runnable.js'; 14 | export * from './worker-resource-group.js'; 15 | -------------------------------------------------------------------------------- /packages/redis-smq-common/src/worker/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './worker.js'; 11 | export * from './worker-thread.js'; 12 | -------------------------------------------------------------------------------- /packages/redis-smq-common/tests/async/test00004.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { it } from 'vitest'; 11 | import { async } from '../../src/async/async.js'; 12 | 13 | it('async.waterfall: case 4', async () => { 14 | await new Promise((resolve) => { 15 | async.waterfall([], () => resolve()); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/redis-smq-common/tests/config.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ERedisConfigClient, IRedisConfig } from '../src/redis-client/index.js'; 11 | 12 | const redisHost = process.env.REDIS_HOST || '127.0.0.1'; 13 | 14 | export const redisConfig: IRedisConfig = { 15 | client: ERedisConfigClient.IOREDIS, 16 | options: { 17 | host: redisHost, 18 | port: 0, 19 | db: 0, 20 | showFriendlyErrorStack: true, 21 | }, 22 | }; 23 | -------------------------------------------------------------------------------- /packages/redis-smq-common/tests/redis-client/lua-scripts/test_script.lua: -------------------------------------------------------------------------------- 1 | return 1 -------------------------------------------------------------------------------- /packages/redis-smq-common/tests/redis-server/test00001.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { expect, it } from 'vitest'; 11 | import { RedisServer } from '../../src/redis-server/index.js'; 12 | 13 | it('should start and shut down Redis server', async () => { 14 | const server = new RedisServer(); 15 | const port = await server.start(); 16 | expect(port).toBeGreaterThan(0); 17 | await server.shutdown(); 18 | }); 19 | -------------------------------------------------------------------------------- /packages/redis-smq-common/tests/timer/test00003.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { expect, it } from 'vitest'; 11 | import { Timer } from '../../src/timer/timer.js'; 12 | 13 | it('Timer.setInterval() always blocks Timer.setTimeout()', async () => { 14 | const ticker = new Timer(); 15 | const r = ticker.setInterval(() => void 0, 5000); 16 | expect(r).toBe(true); 17 | 18 | const r2 = ticker.setTimeout(() => void 0, 1000); 19 | expect(r2).toBe(false); 20 | 21 | ticker.reset(); 22 | }); 23 | -------------------------------------------------------------------------------- /packages/redis-smq-common/tests/worker/workers/worker-error.worker.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ICallback } from '../../../src/async/index.js'; 11 | 12 | export default function myWorkerCallable(msg: string, cb: ICallback) { 13 | cb(new Error('MY_ERROR')); 14 | } 15 | -------------------------------------------------------------------------------- /packages/redis-smq-common/tests/worker/workers/worker-exception.worker.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export default function myWorkerCallable() { 11 | throw new Error('THROW_ERROR'); 12 | } 13 | -------------------------------------------------------------------------------- /packages/redis-smq-common/tests/worker/workers/worker-faulty-exit.worker.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export const myWorkerCallable = 6; 11 | 12 | process.exit(333); 13 | -------------------------------------------------------------------------------- /packages/redis-smq-common/tests/worker/workers/worker-faulty.worker.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export const myWorkerCallable = 6; 11 | -------------------------------------------------------------------------------- /packages/redis-smq-common/tests/worker/workers/worker-ok.worker.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ICallback } from '../../../src/async/index.js'; 11 | 12 | export default function myWorkerCallable(args: string, cb: ICallback) { 13 | setTimeout(() => cb(null, args), 5000); 14 | } 15 | -------------------------------------------------------------------------------- /packages/redis-smq-common/tsconfig.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.cjs.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/cjs" 5 | }, 6 | "include": ["."] 7 | } 8 | -------------------------------------------------------------------------------- /packages/redis-smq-common/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": ".", 5 | "outDir": "./dist/esm" 6 | }, 7 | "include": ["."] 8 | } 9 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | const { resolve } = require('path'); 11 | const { env } = require('redis-smq-common'); 12 | const dir = env.getCurrentDir(); 13 | module.exports = { 14 | extends: [resolve(dir, '../../.eslintrc.cjs')], 15 | rules: { '@typescript-eslint/no-empty-object-type': 'off' }, 16 | }; 17 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/.npmignore: -------------------------------------------------------------------------------- 1 | # Ignore everything 2 | * 3 | 4 | # Except the dist directory 5 | !dist/cjs/src/** 6 | !dist/cjs/index.d.ts 7 | !dist/cjs/index.d.ts.map 8 | !dist/cjs/index.js 9 | !dist/cjs/index.js.map 10 | !dist/cjs/package.json 11 | !dist/esm/src/** 12 | !dist/esm/index.d.ts 13 | !dist/esm/index.d.ts.map 14 | !dist/esm/index.js 15 | !dist/esm/index.js.map 16 | !dist/schema.json 17 | !LICENSE 18 | !CHANGELOG.md 19 | !package.json -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/scripts/build.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 3 | # Weyoss 4 | # https://github.com/weyoss 5 | # 6 | # This source code is licensed under the MIT license found in the LICENSE file 7 | # in the root directory of this source tree. 8 | # 9 | 10 | set -x 11 | set -e 12 | 13 | rm -rf dist 14 | 15 | # esm 16 | tsc -p ./tsconfig.json 17 | 18 | # cjs 19 | tsc -p ./tsconfig.cjs.json 20 | cat >dist/cjs/package.json < 4 | # https://github.com/weyoss 5 | # 6 | # This source code is licensed under the MIT license found in the LICENSE file 7 | # in the root directory of this source tree. 8 | # 9 | set -x 10 | set -e 11 | 12 | typescript-json-schema "tsconfig.schema.json" "*" --out "dist/schema.json" --refs false --required true -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/consumer-groups/CountConsumerGroupPendingMessagesControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface CountConsumerGroupPendingMessagesControllerRequestPathDTO 13 | extends IQueueParams { 14 | consumerGroupId: string; 15 | } 16 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/consumer-groups/CountConsumerGroupPendingMessagesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type CountConsumerGroupPendingMessagesControllerResponseDTO = 13 | | readonly [200, number] 14 | | TErrors['QueueInvalidQueueParameterError'] 15 | | TErrors['QueueMessagesConsumerGroupIdNotSupportedError']; 16 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/consumer-groups/DeleteConsumerGroupControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface DeleteConsumerGroupControllerRequestPathDTO 13 | extends IQueueParams { 14 | consumerGroupId: string; 15 | } 16 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/consumer-groups/DeleteConsumerGroupControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type DeleteConsumerGroupControllerResponseDTO = 13 | | readonly [204, null] 14 | | TErrors['ConsumerGroupsQueueNotFoundError'] 15 | | TErrors['ConsumerGroupsConsumerGroupNotEmptyError'] 16 | | TErrors['QueueInvalidQueueParameterError']; 17 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/consumer-groups/GetConsumerGroupPendingMessagesControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface GetConsumerGroupPendingMessagesControllerRequestPathDTO 13 | extends IQueueParams { 14 | consumerGroupId: string; 15 | } 16 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/consumer-groups/GetConsumerGroupPendingMessagesControllerRequestQueryDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface GetConsumerGroupPendingMessagesControllerRequestQueryDTO { 11 | cursor: number; 12 | pageSize: number; 13 | } 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/consumer-groups/GetConsumerGroupPendingMessagesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IMessageTransferable, IQueueMessagesPage } from 'redis-smq'; 11 | import { TErrors } from '../../../errors/types/index.js'; 12 | 13 | export type GetConsumerGroupPendingMessagesControllerResponseDTO = 14 | | readonly [200, IQueueMessagesPage] 15 | | TErrors['QueueInvalidQueueParameterError'] 16 | | TErrors['QueueMessagesConsumerGroupIdNotSupportedError']; 17 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/consumer-groups/GetConsumerGroupsControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface GetConsumerGroupsControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/consumer-groups/GetConsumerGroupsControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type GetConsumerGroupsControllerResponseDTO = 13 | | readonly [200, string[]] 14 | | TErrors['QueueInvalidQueueParameterError']; 15 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/consumer-groups/PurgeConsumerGroupPendingMessagesControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface PurgeConsumerGroupPendingMessagesControllerRequestPathDTO 13 | extends IQueueParams { 14 | consumerGroupId: string; 15 | } 16 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/consumer-groups/PurgeConsumerGroupPendingMessagesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type PurgeConsumerGroupPendingMessagesControllerResponseDTO = 13 | | readonly [204, null] 14 | | TErrors['QueueInvalidQueueParameterError'] 15 | | TErrors['QueueMessagesConsumerGroupIdNotSupportedError']; 16 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/consumer-groups/SaveConsumerGroupControllerRequestBodyDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface SaveConsumerGroupControllerRequestBodyDTO { 11 | consumerGroupId: string; 12 | } 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/consumer-groups/SaveConsumerGroupControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface SaveConsumerGroupControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/consumer-groups/SaveConsumerGroupControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type SaveConsumerGroupControllerResponseDTO = 13 | | readonly [204, null] 14 | | TErrors['QueueInvalidQueueParameterError'] 15 | | TErrors['QueueQueueNotFoundError'] 16 | | TErrors['ConsumerGroupsConsumerGroupsNotSupportedError']; 17 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/exchange-fan-out/BindQueueControllerRequestBodyDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface BindQueueControllerRequestBodyDTO { 13 | queue: IQueueParams; 14 | } 15 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/exchange-fan-out/BindQueueControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface BindQueueControllerRequestPathDTO { 11 | fanOutName: string; 12 | } 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/exchange-fan-out/BindQueueControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type BindQueueControllerResponseDTO = 13 | | readonly [204, null] 14 | | TErrors['QueueInvalidQueueParameterError'] 15 | | TErrors['ExchangeInvalidFanOutParamsError'] 16 | | TErrors['QueueQueueNotFoundError'] 17 | | TErrors['ExchangeFanOutQueueTypeError']; 18 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/exchange-fan-out/GetAllExchangesControllerRequestQueryDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export type GetAllExchangesControllerRequestQueryDTO = 13 | | IQueueParams 14 | | Record; 15 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/exchange-fan-out/GetAllExchangesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export type GetAllExchangesControllerResponseDTO = readonly [200, string[]]; 11 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/exchange-fan-out/GetQueuesControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface GetQueuesControllerRequestPathDTO { 11 | fanOutName: string; 12 | } 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/exchange-fan-out/GetQueuesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | import { TErrors } from '../../../errors/types/index.js'; 12 | 13 | export type GetQueuesControllerResponseDTO = 14 | | readonly [200, IQueueParams[]] 15 | | TErrors['ExchangeInvalidFanOutParamsError']; 16 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/exchange-fan-out/SaveExchangeControllerRequestBodyDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface SaveExchangeControllerRequestBodyDTO { 11 | fanOutName: string; 12 | } 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/exchange-fan-out/SaveExchangeControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type SaveExchangeControllerResponseDTO = 13 | | readonly [204, null] 14 | | TErrors['ExchangeInvalidFanOutParamsError']; 15 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/messages/DeleteMessageByIdControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface DeleteMessageByIdControllerRequestPathDTO { 11 | id: string; 12 | } 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/messages/DeleteMessageByIdControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type DeleteMessageByIdControllerResponseDTO = 13 | | readonly [204, null] 14 | | TErrors['MessageMessageNotFoundError'] 15 | | TErrors['MessageMessageInProcessError'] 16 | | TErrors['MessageMessageNotDeletedError'] 17 | | TErrors['MessageInvalidParametersError']; 18 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/messages/DeleteMessagesByIdsControllerRequestQueryDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface DeleteMessagesByIdsControllerRequestQueryDTO { 11 | ids: string[]; 12 | } 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/messages/DeleteMessagesByIdsControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type DeleteMessagesByIdsControllerResponseDTO = 13 | | readonly [204, null] 14 | | TErrors['MessageMessageNotFoundError'] 15 | | TErrors['MessageMessageInProcessError'] 16 | | TErrors['MessageMessageNotDeletedError'] 17 | | TErrors['MessageInvalidParametersError']; 18 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/messages/GetMessageByIdControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface GetMessageByIdControllerRequestPathDTO { 11 | id: string; 12 | } 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/messages/GetMessageByIdControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IMessageTransferable } from 'redis-smq'; 11 | import { TErrors } from '../../../errors/types/index.js'; 12 | 13 | export type GetMessageByIdControllerResponseDTO = 14 | | readonly [200, IMessageTransferable] 15 | | TErrors['MessageMessageNotFoundError']; 16 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/messages/GetMessageStatusControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface GetMessageStatusControllerRequestPathDTO { 11 | id: string; 12 | } 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/messages/GetMessageStatusControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { EMessagePropertyStatus } from 'redis-smq'; 11 | import { TErrors } from '../../../errors/types/index.js'; 12 | 13 | export type GetMessageStatusControllerResponseDTO = 14 | | readonly [200, EMessagePropertyStatus] 15 | | TErrors['MessageMessageNotFoundError']; 16 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/messages/GetMessagesByIdsControllerRequestQueryDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface GetMessagesByIdsControllerRequestQueryDTO { 11 | ids: string[]; 12 | } 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/messages/GetMessagesByIdsControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IMessageTransferable } from 'redis-smq'; 11 | import { TErrors } from '../../../errors/types/index.js'; 12 | 13 | export type GetMessagesByIdsControllerResponseDTO = 14 | | readonly [200, IMessageTransferable[]] 15 | | TErrors['MessageMessageNotFoundError']; 16 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/messages/RequeueMessageByIdControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface RequeueMessageByIdControllerRequestPathDTO { 11 | id: string; 12 | } 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/messages/RequeueMessageByIdControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type RequeueMessageByIdControllerResponseDTO = 13 | | readonly [204, null] 14 | | TErrors['MessageMessageNotFoundError'] 15 | | TErrors['MessageMessageNotRequeuableError'] 16 | | TErrors['MessageInvalidParametersError']; 17 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/namespaces/DeleteNamespaceControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface DeleteNamespaceControllerRequestPathDTO { 11 | ns: string; 12 | } 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/namespaces/DeleteNamespaceControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type DeleteNamespaceControllerResponseDTO = 13 | | readonly [204, null] 14 | | TErrors['NamespaceInvalidNamespaceError'] 15 | | TErrors['NamespaceNotFoundError'] 16 | | TErrors['QueueQueueHasRunningConsumersError']; 17 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/namespaces/GetNamespaceQueuesControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface GetNamespaceQueuesControllerRequestPathDTO { 11 | ns: string; 12 | } 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/namespaces/GetNamespaceQueuesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | import { TErrors } from '../../../errors/types/index.js'; 12 | 13 | export type GetNamespaceQueuesControllerResponseDTO = 14 | | readonly [200, IQueueParams[]] 15 | | TErrors['NamespaceInvalidNamespaceError'] 16 | | TErrors['NamespaceNotFoundError']; 17 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/namespaces/GetNamespacesControllerRequestDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface GetNamespacesControllerRequestDTO {} 11 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/namespaces/GetNamespacesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export type GetNamespacesControllerResponseDTO = readonly [200, string[]]; 11 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-acknowledged-messages/CountQueueAcknowledgedMessagesControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface CountQueueAcknowledgedMessagesControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-acknowledged-messages/CountQueueAcknowledgedMessagesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type CountQueueAcknowledgedMessagesControllerResponseDTO = 13 | | readonly [200, number] 14 | | TErrors['QueueInvalidQueueParameterError'] 15 | | TErrors['QueueQueueNotFoundError']; 16 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-acknowledged-messages/GetQueueAcknowledgedMessagesControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface GetQueueAcknowledgedMessagesControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-acknowledged-messages/GetQueueAcknowledgedMessagesControllerRequestQueryDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface GetQueueAcknowledgedMessagesControllerRequestQueryDTO { 11 | cursor: number; 12 | pageSize: number; 13 | } 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-acknowledged-messages/GetQueueAcknowledgedMessagesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IMessageTransferable, IQueueMessagesPage } from 'redis-smq'; 11 | import { TErrors } from '../../../errors/types/index.js'; 12 | 13 | export type GetQueueAcknowledgedMessagesControllerResponseDTO = 14 | | readonly [200, IQueueMessagesPage] 15 | | TErrors['QueueInvalidQueueParameterError'] 16 | | TErrors['QueueQueueNotFoundError']; 17 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-acknowledged-messages/PurgeQueueAcknowledgedMessagesControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface PurgeQueueAcknowledgedMessagesControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-acknowledged-messages/PurgeQueueAcknowledgedMessagesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type PurgeQueueAcknowledgedMessagesControllerResponseDTO = 13 | | readonly [204, null] 14 | | TErrors['QueueInvalidQueueParameterError'] 15 | | TErrors['QueueQueueNotFoundError']; 16 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-dead-lettered-messages/CountQueueDeadLetteredMessagesControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface CountQueueDeadLetteredMessagesControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-dead-lettered-messages/CountQueueDeadLetteredMessagesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type CountQueueDeadLetteredMessagesControllerResponseDTO = 13 | | readonly [200, number] 14 | | TErrors['QueueInvalidQueueParameterError'] 15 | | TErrors['QueueQueueNotFoundError']; 16 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-dead-lettered-messages/GetQueueDeadLetteredMessagesControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface GetQueueDeadLetteredMessagesControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-dead-lettered-messages/GetQueueDeadLetteredMessagesControllerRequestQueryDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface GetQueueDeadLetteredMessagesControllerRequestQueryDTO { 11 | cursor: number; 12 | pageSize: number; 13 | } 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-dead-lettered-messages/GetQueueDeadLetteredMessagesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IMessageTransferable, IQueueMessagesPage } from 'redis-smq'; 11 | import { TErrors } from '../../../errors/types/index.js'; 12 | 13 | export type GetQueueDeadLetteredMessagesControllerResponseDTO = 14 | | readonly [200, IQueueMessagesPage] 15 | | TErrors['QueueInvalidQueueParameterError'] 16 | | TErrors['QueueQueueNotFoundError']; 17 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-dead-lettered-messages/PurgeQueueDeadLetteredMessagesControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface PurgeQueueDeadLetteredMessagesControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-dead-lettered-messages/PurgeQueueDeadLetteredMessagesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type PurgeQueueDeadLetteredMessagesControllerResponseDTO = 13 | | readonly [204, null] 14 | | TErrors['QueueInvalidQueueParameterError'] 15 | | TErrors['QueueQueueNotFoundError']; 16 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-messages/CountQueueMessagesByStatusControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface CountQueueMessagesByStatusControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-messages/CountQueueMessagesByStatusControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueMessagesCount } from 'redis-smq'; 11 | import { TErrors } from '../../../errors/types/index.js'; 12 | 13 | export type CountQueueMessagesByStatusControllerResponseDTO = 14 | | readonly [200, IQueueMessagesCount] 15 | | TErrors['QueueInvalidQueueParameterError'] 16 | | TErrors['QueueQueueNotFoundError']; 17 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-messages/CountQueueMessagesControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface CountQueueMessagesControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-messages/CountQueueMessagesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type CountQueueMessagesControllerResponseDTO = 13 | | readonly [200, number] 14 | | TErrors['QueueInvalidQueueParameterError'] 15 | | TErrors['QueueQueueNotFoundError']; 16 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-messages/GetQueueMessagesControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface GetQueueMessagesControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-messages/GetQueueMessagesControllerRequestQueryDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface GetQueueMessagesControllerRequestQueryDTO { 11 | cursor: number; 12 | pageSize: number; 13 | } 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-messages/GetQueueMessagesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IMessageTransferable, IQueueMessagesPage } from 'redis-smq'; 11 | import { TErrors } from '../../../errors/types/index.js'; 12 | 13 | export type GetQueueMessagesControllerResponseDTO = 14 | | readonly [200, IQueueMessagesPage] 15 | | TErrors['QueueInvalidQueueParameterError'] 16 | | TErrors['QueueQueueNotFoundError']; 17 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-pending-messages/CountQueuePendingMessagesControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface CountQueuePendingMessagesControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-pending-messages/CountQueuePendingMessagesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type CountQueuePendingMessagesControllerResponseDTO = 13 | | readonly [200, number] 14 | | TErrors['QueueInvalidQueueParameterError'] 15 | | TErrors['QueueQueueNotFoundError'] 16 | | TErrors['QueueMessagesConsumerGroupIdNotSupportedError'] 17 | | TErrors['QueueMessagesConsumerGroupIdRequiredError']; 18 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-pending-messages/GetQueuePendingMessagesControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface GetQueuePendingMessagesControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-pending-messages/GetQueuePendingMessagesControllerRequestQueryDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface GetQueuePendingMessagesControllerRequestQueryDTO { 11 | cursor: number; 12 | pageSize: number; 13 | } 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-pending-messages/PurgeQueuePendingMessagesControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface PurgeQueuePendingMessagesControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-rate-limit/ClearQueueRateLimitControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface ClearQueueRateLimitControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-rate-limit/ClearQueueRateLimitControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type ClearQueueRateLimitControllerResponseDTO = 13 | | readonly [204, null] 14 | | TErrors['QueueQueueNotFoundError']; 15 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-rate-limit/GetQueueRateLimitControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface GetQueueRateLimitControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-rate-limit/GetQueueRateLimitControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueRateLimit } from 'redis-smq'; 11 | import { TErrors } from '../../../errors/types/index.js'; 12 | 13 | export type GetQueueRateLimitControllerResponseDTO = 14 | | readonly [200, IQueueRateLimit | null] 15 | | TErrors['QueueQueueNotFoundError']; 16 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-rate-limit/SetQueueRateLimitControllerRequestBodyDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueRateLimit } from 'redis-smq'; 11 | 12 | export interface SetQueueRateLimitControllerRequestBodyDTO 13 | extends IQueueRateLimit {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-rate-limit/SetQueueRateLimitControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface SetQueueRateLimitControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-rate-limit/SetQueueRateLimitControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueRateLimit } from 'redis-smq'; 11 | import { TErrors } from '../../../errors/types/index.js'; 12 | 13 | export type SetQueueRateLimitControllerResponseDTO = 14 | | readonly [200, IQueueRateLimit] 15 | | TErrors['QueueQueueNotFoundError'] 16 | | TErrors['QueueRateLimitQueueNotFoundError']; 17 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-scheduled-messages/CountQueueScheduledMessagesControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface CountQueueScheduledMessagesControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-scheduled-messages/CountQueueScheduledMessagesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type CountQueueScheduledMessagesControllerResponseDTO = 13 | | readonly [200, number] 14 | | TErrors['QueueInvalidQueueParameterError'] 15 | | TErrors['QueueQueueNotFoundError']; 16 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-scheduled-messages/GetQueueScheduledMessagesControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface GetQueueScheduledMessagesControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-scheduled-messages/GetQueueScheduledMessagesControllerRequestQueryDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface GetQueueScheduledMessagesControllerRequestQueryDTO { 11 | cursor: number; 12 | pageSize: number; 13 | } 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-scheduled-messages/GetQueueScheduledMessagesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IMessageTransferable, IQueueMessagesPage } from 'redis-smq'; 11 | import { TErrors } from '../../../errors/types/index.js'; 12 | 13 | export type GetQueueScheduledMessagesControllerResponseDTO = 14 | | readonly [200, IQueueMessagesPage] 15 | | TErrors['QueueInvalidQueueParameterError'] 16 | | TErrors['QueueQueueNotFoundError']; 17 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-scheduled-messages/PurgeQueueScheduledMessagesControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface PurgeQueueScheduledMessagesControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queue-scheduled-messages/PurgeQueueScheduledMessagesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type PurgeQueueScheduledMessagesControllerResponseDTO = 13 | | readonly [204, null] 14 | | TErrors['QueueInvalidQueueParameterError'] 15 | | TErrors['QueueQueueNotFoundError']; 16 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queues/CreateQueueControllerRequestBodyDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { EQueueDeliveryModel, EQueueType, IQueueParams } from 'redis-smq'; 11 | 12 | export type CreateQueueControllerRequestBodyDTO = { 13 | queue: IQueueParams; 14 | queueType: EQueueType; 15 | queueDeliveryModel: EQueueDeliveryModel; 16 | }; 17 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queues/DeleteQueueControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface DeleteQueueControllerRequestPathDTO extends IQueueParams {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queues/DeleteQueueControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type DeleteQueueControllerResponseDTO = 13 | | readonly [204, null] 14 | | TErrors['QueueInvalidQueueParameterError'] 15 | | TErrors['QueueQueueNotFoundError'] 16 | | TErrors['QueueQueueNotEmptyError'] 17 | | TErrors['QueueQueueHasRunningConsumersError']; 18 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queues/GetAllQueuesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export type GetAllQueuesControllerResponseDTO = readonly [200, IQueueParams[]]; 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queues/GetQueuePropertiesControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface GetQueuePropertiesControllerRequestPathDTO 13 | extends IQueueParams {} 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queues/GetQueuePropertiesControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueProperties } from 'redis-smq'; 11 | import { TErrors } from '../../../errors/types/index.js'; 12 | 13 | export type GetQueuePropertiesControllerResponseDTO = 14 | | readonly [200, IQueueProperties] 15 | | TErrors['QueueInvalidQueueParameterError'] 16 | | TErrors['QueueQueueNotFoundError']; 17 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queues/QueueExistsControllerRequestPathDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IQueueParams } from 'redis-smq'; 11 | 12 | export interface QueueExistsControllerRequestPathDTO extends IQueueParams {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/dto/controllers/queues/QueueExistsControllerResponseDTO.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { TErrors } from '../../../errors/types/index.js'; 11 | 12 | export type QueueExistsControllerResponseDTO = 13 | | readonly [200, boolean] 14 | | TErrors['QueueInvalidQueueParameterError']; 15 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/errors/errors/consumerErrors.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export const consumerErrors = { 11 | ConsumerConsumeMessageHandlerAlreadyExistsError: [ 12 | 400, 13 | 'ConsumerConsumeMessageHandlerAlreadyExistsError', 14 | ], 15 | ConsumerConsumerGroupIdNotSupportedError: [ 16 | 400, 17 | 'ConsumerConsumerGroupIdNotSupportedError', 18 | ], 19 | ConsumerConsumerGroupIdRequiredError: [ 20 | 400, 21 | 'ConsumerConsumerGroupIdRequiredError', 22 | ], 23 | } as const; 24 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/errors/errors/namespaceErrors.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export const namespaceErrors = { 11 | NamespaceNotFoundError: [404, 'NamespaceNotFoundError'], 12 | NamespaceInvalidNamespaceError: [400, 'NamespaceInvalidNamespaceError'], 13 | } as const; 14 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/errors/errors/queueErrors.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export const queueErrors = { 11 | QueueInvalidQueueParameterError: [400, 'QueueInvalidQueueParameterError'], 12 | QueueQueueExistsError: [400, 'QueueQueueExistsError'], 13 | QueueQueueHasRunningConsumersError: [ 14 | 403, 15 | 'QueueQueueHasRunningConsumersError', 16 | ], 17 | QueueQueueNotEmptyError: [403, 'QueueQueueNotEmptyError'], 18 | QueueQueueNotFoundError: [404, 'QueueQueueNotFoundError'], 19 | } as const; 20 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/errors/errors/queueMessagesErrors.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export const queueMessagesErrors = { 11 | QueueMessagesConsumerGroupIdRequiredError: [ 12 | 400, 13 | 'QueueMessagesConsumerGroupIdRequiredError', 14 | ], 15 | QueueMessagesConsumerGroupIdNotSupportedError: [ 16 | 400, 17 | 'QueueMessagesConsumerGroupIdNotSupportedError', 18 | ], 19 | } as const; 20 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/errors/errors/queueRateErrors.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export const queueRateErrors = { 11 | QueueRateLimitInvalidIntervalError: [ 12 | 400, 13 | 'QueueRateLimitInvalidIntervalError', 14 | ], 15 | QueueRateLimitInvalidLimitError: [400, 'QueueRateLimitInvalidLimitError'], 16 | QueueRateLimitQueueNotFoundError: [400, 'QueueRateLimitQueueNotFoundError'], 17 | } as const; 18 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/errors/errors/routerErrors.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export const routerErrors = { 11 | RouterRequestValidationError: [422, 'RouterRequestValidationError'], 12 | RouterResponseValidatorNotFoundError: [ 13 | 500, 14 | 'RouterResponseValidatorNotFoundError', 15 | ], 16 | RouterResponseValidationError: [500, 'RouterResponseValidationError'], 17 | } as const; 18 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/errors/getErrorResponseParams.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from 'redis-smq-common'; 11 | import { errors } from './errors.js'; 12 | 13 | export function getErrorResponseParams( 14 | error: RedisSMQError | (new () => RedisSMQError), 15 | ) { 16 | const className = error.name; 17 | const errs: Record = errors; 18 | return errs[className] ?? [500, 'InternalServerError']; 19 | } 20 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/app/errors/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { errors } from '../errors.js'; 11 | 12 | export type TErrors = typeof errors; 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/config/errors/ConfigError.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSmqRestApiError } from '../../lib/errors/errors/RedisSmqRestApiError.js'; 11 | 12 | export class ConfigError extends RedisSmqRestApiError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/config/errors/ConfigInvalidApiServerParamsError.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ConfigError } from './ConfigError.js'; 11 | 12 | export class ConfigInvalidApiServerParamsError extends ConfigError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/config/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { IRedisSMQConfig } from 'redis-smq'; 11 | 12 | export type THttpApiConfig = { 13 | port?: number; 14 | hostname?: string; 15 | basePath?: string; 16 | }; 17 | 18 | export interface IRedisSMQHttpApiConfig extends IRedisSMQConfig { 19 | apiServer?: THttpApiConfig; 20 | } 21 | export type IRedisSMQHttpApiParsedConfig = Omit< 22 | IRedisSMQHttpApiConfig, 23 | 'apiServer' 24 | > & { 25 | apiServer: Required; 26 | }; 27 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/lib/errors/errors/RedisSmqRestApiError.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from 'redis-smq-common'; 11 | 12 | export class RedisSmqRestApiError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/lib/errors/errors/ValidationError.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ErrorObject } from 'ajv'; 11 | import { RedisSmqRestApiError } from './RedisSmqRestApiError.js'; 12 | 13 | export class ValidationError extends RedisSmqRestApiError { 14 | readonly errorObjects; 15 | 16 | constructor(errorObjects: Partial[]) { 17 | super(); 18 | this.errorObjects = errorObjects; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/lib/router/errors/RouterRequestValidationError.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ValidationError } from '../../errors/errors/ValidationError.js'; 11 | 12 | export class RouterRequestValidationError extends ValidationError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/lib/router/errors/RouterResponseValidationError.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ValidationError } from '../../errors/errors/ValidationError.js'; 11 | 12 | export class RouterResponseValidationError extends ValidationError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/lib/router/errors/RouterResponseValidatorNotFoundError.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSmqRestApiError } from '../../errors/errors/RedisSmqRestApiError.js'; 11 | 12 | export class RouterResponseValidatorNotFoundError extends RedisSmqRestApiError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/lib/validator/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { JSONSchema7 } from 'json-schema'; 11 | 12 | export type TResponseSchemaMapItem = { 13 | schema: JSONSchema7; 14 | responseCode: number; 15 | }; 16 | 17 | export type TResponseSchemaMap = Map; 18 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/src/lib/validator/validator.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { Ajv } from 'ajv'; 11 | 12 | export const ajv = new Ajv({ coerceTypes: true }); 13 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/tests/common/bind-queue.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import bluebird from 'bluebird'; 11 | import { ExchangeFanOut, IQueueParams } from 'redis-smq'; 12 | 13 | const { promisifyAll } = bluebird; 14 | 15 | export async function bindQueue(queue: IQueueParams, fanOut: string) { 16 | const exchange = promisifyAll(new ExchangeFanOut()); 17 | await exchange.bindQueueAsync(queue, fanOut); 18 | await exchange.shutdownAsync(); 19 | } 20 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/tests/common/create-fan-out-exchange.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import bluebird from 'bluebird'; 11 | import { ExchangeFanOut } from 'redis-smq'; 12 | 13 | const { promisifyAll } = bluebird; 14 | 15 | export async function createFanOutExchange(name: string) { 16 | const exchangeFanOut = promisifyAll(new ExchangeFanOut()); 17 | await exchangeFanOut.saveExchangeAsync(name); 18 | await exchangeFanOut.shutdownAsync(); 19 | return name; 20 | } 21 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/tests/common/delete-consumer-group.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import bluebird from 'bluebird'; 11 | import { ConsumerGroups, IQueueParams } from 'redis-smq'; 12 | 13 | const { promisifyAll } = bluebird; 14 | 15 | export async function deleteConsumerGroup( 16 | queue: IQueueParams, 17 | consumerGroup: string, 18 | ) { 19 | const c = promisifyAll(new ConsumerGroups()); 20 | await c.deleteConsumerGroupAsync(queue, consumerGroup); 21 | await c.shutdownAsync(); 22 | } 23 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/tests/common/save-consumer-group.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import bluebird from 'bluebird'; 11 | import { ConsumerGroups, IQueueParams } from 'redis-smq'; 12 | 13 | const { promisifyAll } = bluebird; 14 | 15 | export async function saveConsumerGroup( 16 | queue: IQueueParams, 17 | consumerGroup: string, 18 | ) { 19 | const c = promisifyAll(new ConsumerGroups()); 20 | await c.saveConsumerGroupAsync(queue, consumerGroup); 21 | await c.shutdownAsync(); 22 | return consumerGroup; 23 | } 24 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/tests/common/set-rate-limit.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import bluebird from 'bluebird'; 11 | import { IQueueParams, IQueueRateLimit, QueueRateLimit } from 'redis-smq'; 12 | 13 | const { promisifyAll } = bluebird; 14 | 15 | export async function setRateLimit( 16 | queue: IQueueParams, 17 | rateLimit: IQueueRateLimit, 18 | ) { 19 | const r = promisifyAll(new QueueRateLimit()); 20 | await r.setAsync(queue, rateLimit); 21 | await r.shutdownAsync(); 22 | return rateLimit; 23 | } 24 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/tests/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export type TResponse = { 11 | status: number; 12 | body: null | { 13 | data?: Data extends readonly [200 | 201, unknown] ? Data[1] : never; 14 | error?: { 15 | code: number; 16 | message: string; 17 | details: Record; 18 | }; 19 | }; 20 | }; 21 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/tsconfig.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.cjs.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/cjs" 5 | }, 6 | "include": ["."] 7 | } 8 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/esm", 5 | "allowSyntheticDefaultImports": false 6 | }, 7 | "include": ["."] 8 | } 9 | -------------------------------------------------------------------------------- /packages/redis-smq-rest-api/tsconfig.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "types": [] 5 | }, 6 | "include": ["./src/app/dto"] 7 | } 8 | -------------------------------------------------------------------------------- /packages/redis-smq/.codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | patch: 4 | default: 5 | target: 80% 6 | -------------------------------------------------------------------------------- /packages/redis-smq/.npmignore: -------------------------------------------------------------------------------- 1 | # Ignore everything 2 | * 3 | 4 | # Except the dist directory 5 | !dist/cjs/src/** 6 | !dist/cjs/index.d.ts 7 | !dist/cjs/index.d.ts.map 8 | !dist/cjs/index.js 9 | !dist/cjs/index.js.map 10 | !dist/cjs/package.json 11 | !dist/esm/src/** 12 | !dist/esm/index.d.ts 13 | !dist/esm/index.d.ts.map 14 | !dist/esm/index.js 15 | !dist/esm/index.js.map 16 | !LICENSE 17 | !CHANGELOG.md 18 | !package.json -------------------------------------------------------------------------------- /packages/redis-smq/docs/api/enums/EExchangeType.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / EExchangeType 2 | 3 | # Enumeration: EExchangeType 4 | 5 | ## Table of contents 6 | 7 | ### Enumeration Members 8 | 9 | - [DIRECT](EExchangeType.md#direct) 10 | - [FANOUT](EExchangeType.md#fanout) 11 | - [TOPIC](EExchangeType.md#topic) 12 | 13 | ## Enumeration Members 14 | 15 | ### DIRECT 16 | 17 | • **DIRECT** = ``0`` 18 | 19 | ___ 20 | 21 | ### FANOUT 22 | 23 | • **FANOUT** = ``1`` 24 | 25 | ___ 26 | 27 | ### TOPIC 28 | 29 | • **TOPIC** = ``2`` 30 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/api/enums/EMessageProperty.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / EMessageProperty 2 | 3 | # Enumeration: EMessageProperty 4 | 5 | ## Table of contents 6 | 7 | ### Enumeration Members 8 | 9 | - [ID](EMessageProperty.md#id) 10 | - [MESSAGE](EMessageProperty.md#message) 11 | - [STATE](EMessageProperty.md#state) 12 | - [STATUS](EMessageProperty.md#status) 13 | 14 | ## Enumeration Members 15 | 16 | ### ID 17 | 18 | • **ID** = ``0`` 19 | 20 | ___ 21 | 22 | ### MESSAGE 23 | 24 | • **MESSAGE** = ``3`` 25 | 26 | ___ 27 | 28 | ### STATE 29 | 30 | • **STATE** = ``2`` 31 | 32 | ___ 33 | 34 | ### STATUS 35 | 36 | • **STATUS** = ``1`` 37 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/api/enums/EMessageUnacknowledgementAction.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / EMessageUnacknowledgementAction 2 | 3 | # Enumeration: EMessageUnacknowledgementAction 4 | 5 | ## Table of contents 6 | 7 | ### Enumeration Members 8 | 9 | - [DEAD\_LETTER](EMessageUnacknowledgementAction.md#dead_letter) 10 | - [DELAY](EMessageUnacknowledgementAction.md#delay) 11 | - [REQUEUE](EMessageUnacknowledgementAction.md#requeue) 12 | 13 | ## Enumeration Members 14 | 15 | ### DEAD\_LETTER 16 | 17 | • **DEAD\_LETTER** = ``0`` 18 | 19 | ___ 20 | 21 | ### DELAY 22 | 23 | • **DELAY** = ``2`` 24 | 25 | ___ 26 | 27 | ### REQUEUE 28 | 29 | • **REQUEUE** = ``1`` 30 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/api/enums/EQueueDeliveryModel.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / EQueueDeliveryModel 2 | 3 | # Enumeration: EQueueDeliveryModel 4 | 5 | ## Table of contents 6 | 7 | ### Enumeration Members 8 | 9 | - [POINT\_TO\_POINT](EQueueDeliveryModel.md#point_to_point) 10 | - [PUB\_SUB](EQueueDeliveryModel.md#pub_sub) 11 | 12 | ## Enumeration Members 13 | 14 | ### POINT\_TO\_POINT 15 | 16 | • **POINT\_TO\_POINT** = ``0`` 17 | 18 | ___ 19 | 20 | ### PUB\_SUB 21 | 22 | • **PUB\_SUB** = ``1`` 23 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/api/enums/EQueueType.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / EQueueType 2 | 3 | # Enumeration: EQueueType 4 | 5 | ## Table of contents 6 | 7 | ### Enumeration Members 8 | 9 | - [FIFO\_QUEUE](EQueueType.md#fifo_queue) 10 | - [LIFO\_QUEUE](EQueueType.md#lifo_queue) 11 | - [PRIORITY\_QUEUE](EQueueType.md#priority_queue) 12 | 13 | ## Enumeration Members 14 | 15 | ### FIFO\_QUEUE 16 | 17 | • **FIFO\_QUEUE** = ``1`` 18 | 19 | ___ 20 | 21 | ### LIFO\_QUEUE 22 | 23 | • **LIFO\_QUEUE** = ``0`` 24 | 25 | ___ 26 | 27 | ### PRIORITY\_QUEUE 28 | 29 | • **PRIORITY\_QUEUE** = ``2`` 30 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/api/interfaces/IConsumerHeartbeat.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / IConsumerHeartbeat 2 | 3 | # Interface: IConsumerHeartbeat 4 | 5 | ## Table of contents 6 | 7 | ### Properties 8 | 9 | - [data](IConsumerHeartbeat.md#data) 10 | - [timestamp](IConsumerHeartbeat.md#timestamp) 11 | 12 | ## Properties 13 | 14 | ### data 15 | 16 | • **data**: [`IConsumerHeartbeatPayload`](IConsumerHeartbeatPayload.md) 17 | 18 | ___ 19 | 20 | ### timestamp 21 | 22 | • **timestamp**: `number` 23 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/api/interfaces/IConsumerMessageHandlerArgs.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / IConsumerMessageHandlerArgs 2 | 3 | # Interface: IConsumerMessageHandlerArgs 4 | 5 | ## Table of contents 6 | 7 | ### Properties 8 | 9 | - [messageHandler](IConsumerMessageHandlerArgs.md#messagehandler) 10 | - [queue](IConsumerMessageHandlerArgs.md#queue) 11 | 12 | ## Properties 13 | 14 | ### messageHandler 15 | 16 | • **messageHandler**: [`TConsumerMessageHandler`](../README.md#tconsumermessagehandler) 17 | 18 | ___ 19 | 20 | ### queue 21 | 22 | • **queue**: [`IQueueParsedParams`](IQueueParsedParams.md) 23 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/api/interfaces/IEventBusConfig.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / IEventBusConfig 2 | 3 | # Interface: IEventBusConfig 4 | 5 | ## Table of contents 6 | 7 | ### Properties 8 | 9 | - [enabled](IEventBusConfig.md#enabled) 10 | 11 | ## Properties 12 | 13 | ### enabled 14 | 15 | • `Optional` **enabled**: `boolean` 16 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/api/interfaces/IExchange.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / IExchange 2 | 3 | # Interface: IExchange\ 4 | 5 | ## Type parameters 6 | 7 | | Name | 8 | | :------ | 9 | | `ExchangeParams` | 10 | 11 | ## Table of contents 12 | 13 | ### Methods 14 | 15 | - [getQueues](IExchange.md#getqueues) 16 | 17 | ## Methods 18 | 19 | ### getQueues 20 | 21 | ▸ **getQueues**(`exchangeParams`, `cb`): `void` 22 | 23 | #### Parameters 24 | 25 | | Name | Type | 26 | | :------ | :------ | 27 | | `exchangeParams` | `ExchangeParams` | 28 | | `cb` | `ICallback`\<[`IQueueParams`](IQueueParams.md)[]\> | 29 | 30 | #### Returns 31 | 32 | `void` 33 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/api/interfaces/IMessagesConfig.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / IMessagesConfig 2 | 3 | # Interface: IMessagesConfig 4 | 5 | ## Table of contents 6 | 7 | ### Properties 8 | 9 | - [store](IMessagesConfig.md#store) 10 | 11 | ## Properties 12 | 13 | ### store 14 | 15 | • `Optional` **store**: `boolean` \| [`IMessagesConfigStorage`](IMessagesConfigStorage.md) 16 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/api/interfaces/IMessagesConfigStorage.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / IMessagesConfigStorage 2 | 3 | # Interface: IMessagesConfigStorage 4 | 5 | ## Table of contents 6 | 7 | ### Properties 8 | 9 | - [acknowledged](IMessagesConfigStorage.md#acknowledged) 10 | - [deadLettered](IMessagesConfigStorage.md#deadlettered) 11 | 12 | ## Properties 13 | 14 | ### acknowledged 15 | 16 | • `Optional` **acknowledged**: `boolean` \| [`IMessagesConfigStorageOptions`](IMessagesConfigStorageOptions.md) 17 | 18 | ___ 19 | 20 | ### deadLettered 21 | 22 | • `Optional` **deadLettered**: `boolean` \| [`IMessagesConfigStorageOptions`](IMessagesConfigStorageOptions.md) 23 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/api/interfaces/IMessagesConfigStorageOptions.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / IMessagesConfigStorageOptions 2 | 3 | # Interface: IMessagesConfigStorageOptions 4 | 5 | ## Table of contents 6 | 7 | ### Properties 8 | 9 | - [expire](IMessagesConfigStorageOptions.md#expire) 10 | - [queueSize](IMessagesConfigStorageOptions.md#queuesize) 11 | 12 | ## Properties 13 | 14 | ### expire 15 | 16 | • `Optional` **expire**: `number` 17 | 18 | ___ 19 | 20 | ### queueSize 21 | 22 | • `Optional` **queueSize**: `number` 23 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/api/interfaces/IMessagesConfigStorageRequired.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / IMessagesConfigStorageRequired 2 | 3 | # Interface: IMessagesConfigStorageRequired 4 | 5 | ## Table of contents 6 | 7 | ### Properties 8 | 9 | - [acknowledged](IMessagesConfigStorageRequired.md#acknowledged) 10 | - [deadLettered](IMessagesConfigStorageRequired.md#deadlettered) 11 | 12 | ## Properties 13 | 14 | ### acknowledged 15 | 16 | • **acknowledged**: [`IMessagesConfigStorageOptionsRequired`](IMessagesConfigStorageOptionsRequired.md) 17 | 18 | ___ 19 | 20 | ### deadLettered 21 | 22 | • **deadLettered**: [`IMessagesConfigStorageOptionsRequired`](IMessagesConfigStorageOptionsRequired.md) 23 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/api/interfaces/IQueueConsumerGroupParams.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / IQueueConsumerGroupParams 2 | 3 | # Interface: IQueueConsumerGroupParams 4 | 5 | ## Table of contents 6 | 7 | ### Properties 8 | 9 | - [groupId](IQueueConsumerGroupParams.md#groupid) 10 | - [queue](IQueueConsumerGroupParams.md#queue) 11 | 12 | ## Properties 13 | 14 | ### groupId 15 | 16 | • **groupId**: ``null`` \| `string` 17 | 18 | ___ 19 | 20 | ### queue 21 | 22 | • **queue**: `string` \| [`IQueueParams`](IQueueParams.md) 23 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/api/interfaces/IQueueGroupConsumersPendingCount.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / IQueueGroupConsumersPendingCount 2 | 3 | # Interface: IQueueGroupConsumersPendingCount 4 | 5 | ## Indexable 6 | 7 | ▪ [key: `string`]: `number` 8 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/api/interfaces/IQueueMessagesPage.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / IQueueMessagesPage 2 | 3 | # Interface: IQueueMessagesPage\ 4 | 5 | ## Type parameters 6 | 7 | | Name | 8 | | :------ | 9 | | `T` | 10 | 11 | ## Table of contents 12 | 13 | ### Properties 14 | 15 | - [cursor](IQueueMessagesPage.md#cursor) 16 | - [items](IQueueMessagesPage.md#items) 17 | - [totalItems](IQueueMessagesPage.md#totalitems) 18 | 19 | ## Properties 20 | 21 | ### cursor 22 | 23 | • **cursor**: `number` 24 | 25 | ___ 26 | 27 | ### items 28 | 29 | • **items**: `T`[] 30 | 31 | ___ 32 | 33 | ### totalItems 34 | 35 | • **totalItems**: `number` 36 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/api/interfaces/IQueueParams.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / IQueueParams 2 | 3 | # Interface: IQueueParams 4 | 5 | ## Table of contents 6 | 7 | ### Properties 8 | 9 | - [name](IQueueParams.md#name) 10 | - [ns](IQueueParams.md#ns) 11 | 12 | ## Properties 13 | 14 | ### name 15 | 16 | • **name**: `string` 17 | 18 | ___ 19 | 20 | ### ns 21 | 22 | • **ns**: `string` 23 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/api/interfaces/IQueueParsedParams.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / IQueueParsedParams 2 | 3 | # Interface: IQueueParsedParams 4 | 5 | ## Table of contents 6 | 7 | ### Properties 8 | 9 | - [groupId](IQueueParsedParams.md#groupid) 10 | - [queueParams](IQueueParsedParams.md#queueparams) 11 | 12 | ## Properties 13 | 14 | ### groupId 15 | 16 | • **groupId**: ``null`` \| `string` 17 | 18 | ___ 19 | 20 | ### queueParams 21 | 22 | • **queueParams**: [`IQueueParams`](IQueueParams.md) 23 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/api/interfaces/IQueueRateLimit.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / IQueueRateLimit 2 | 3 | # Interface: IQueueRateLimit 4 | 5 | ## Table of contents 6 | 7 | ### Properties 8 | 9 | - [interval](IQueueRateLimit.md#interval) 10 | - [limit](IQueueRateLimit.md#limit) 11 | 12 | ## Properties 13 | 14 | ### interval 15 | 16 | • **interval**: `number` 17 | 18 | The time window over which the rate limit is applied. In milliseconds. 19 | 20 | ___ 21 | 22 | ### limit 23 | 24 | • **limit**: `number` 25 | 26 | The maximum number of messages that can be processed per unit of time. 27 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/api/interfaces/ITopicParams.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / ITopicParams 2 | 3 | # Interface: ITopicParams 4 | 5 | ## Table of contents 6 | 7 | ### Properties 8 | 9 | - [ns](ITopicParams.md#ns) 10 | - [topic](ITopicParams.md#topic) 11 | 12 | ## Properties 13 | 14 | ### ns 15 | 16 | • **ns**: `string` 17 | 18 | ___ 19 | 20 | ### topic 21 | 22 | • **topic**: `string` 23 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/faqs/README.md: -------------------------------------------------------------------------------- 1 | [RedisSMQ](../README.md) / [Docs](README.md) / FAQs 2 | 3 | # Frequently Asked Questions 4 | 5 | - [What are the key features of RedisSMQ and how do they differ from other messaging libraries?](./comparing-redissmq-to-other-libraries.md) 6 | - [What is the recommended way to set up and configure RedisSMQ for a new project?](./getting-started.md) 7 | - [How do I handle errors and exceptions when using RedisSMQ\'s classes and methods?](./handling-errors-and-exceptions.md) 8 | - [What are the most important features and changes that RedisSMQ v8 introduces?](./release-v8-changes.md) 9 | -------------------------------------------------------------------------------- /packages/redis-smq/docs/message-storage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weyoss/redis-smq/2f37b0f236ed61024802f3476800b7989d6bf8fc/packages/redis-smq/docs/message-storage.png -------------------------------------------------------------------------------- /packages/redis-smq/docs/redis-smq-architecture-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weyoss/redis-smq/2f37b0f236ed61024802f3476800b7989d6bf8fc/packages/redis-smq/docs/redis-smq-architecture-overview.png -------------------------------------------------------------------------------- /packages/redis-smq/docs/redis-smq-direct-exchange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weyoss/redis-smq/2f37b0f236ed61024802f3476800b7989d6bf8fc/packages/redis-smq/docs/redis-smq-direct-exchange.png -------------------------------------------------------------------------------- /packages/redis-smq/docs/redis-smq-exchanges-and-delivery-models.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weyoss/redis-smq/2f37b0f236ed61024802f3476800b7989d6bf8fc/packages/redis-smq/docs/redis-smq-exchanges-and-delivery-models.png -------------------------------------------------------------------------------- /packages/redis-smq/docs/redis-smq-fanout-exchange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weyoss/redis-smq/2f37b0f236ed61024802f3476800b7989d6bf8fc/packages/redis-smq/docs/redis-smq-fanout-exchange.png -------------------------------------------------------------------------------- /packages/redis-smq/docs/redis-smq-fifo-queuing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weyoss/redis-smq/2f37b0f236ed61024802f3476800b7989d6bf8fc/packages/redis-smq/docs/redis-smq-fifo-queuing.png -------------------------------------------------------------------------------- /packages/redis-smq/docs/redis-smq-lifo-queuing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weyoss/redis-smq/2f37b0f236ed61024802f3476800b7989d6bf8fc/packages/redis-smq/docs/redis-smq-lifo-queuing.png -------------------------------------------------------------------------------- /packages/redis-smq/docs/redis-smq-multi-queue-consumers-producers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weyoss/redis-smq/2f37b0f236ed61024802f3476800b7989d6bf8fc/packages/redis-smq/docs/redis-smq-multi-queue-consumers-producers.png -------------------------------------------------------------------------------- /packages/redis-smq/docs/redis-smq-point-2-point-delivery-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weyoss/redis-smq/2f37b0f236ed61024802f3476800b7989d6bf8fc/packages/redis-smq/docs/redis-smq-point-2-point-delivery-model.png -------------------------------------------------------------------------------- /packages/redis-smq/docs/redis-smq-priority-queuing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weyoss/redis-smq/2f37b0f236ed61024802f3476800b7989d6bf8fc/packages/redis-smq/docs/redis-smq-priority-queuing.png -------------------------------------------------------------------------------- /packages/redis-smq/docs/redis-smq-pubsub-delivery-model-highlevel-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weyoss/redis-smq/2f37b0f236ed61024802f3476800b7989d6bf8fc/packages/redis-smq/docs/redis-smq-pubsub-delivery-model-highlevel-view.png -------------------------------------------------------------------------------- /packages/redis-smq/docs/redis-smq-pubsub-delivery-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weyoss/redis-smq/2f37b0f236ed61024802f3476800b7989d6bf8fc/packages/redis-smq/docs/redis-smq-pubsub-delivery-model.png -------------------------------------------------------------------------------- /packages/redis-smq/docs/redis-smq-topic-exchange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weyoss/redis-smq/2f37b0f236ed61024802f3476800b7989d6bf8fc/packages/redis-smq/docs/redis-smq-topic-exchange.png -------------------------------------------------------------------------------- /packages/redis-smq/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './src/common/index.js'; 11 | export * from './src/config/index.js'; 12 | export * from './src/lib/index.js'; 13 | -------------------------------------------------------------------------------- /packages/redis-smq/scripts/build.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 3 | # Weyoss 4 | # https://github.com/weyoss 5 | # 6 | # This source code is licensed under the MIT license found in the LICENSE file 7 | # in the root directory of this source tree. 8 | # 9 | 10 | set -x 11 | set -e 12 | 13 | rm -rf dist 14 | 15 | # esm 16 | tsc -p ./tsconfig.json 17 | cp -r src/common/redis-client/scripts/lua dist/esm/src/common/redis-client/scripts/ 18 | 19 | # cjs 20 | tsc -p ./tsconfig.cjs.json 21 | cat >dist/cjs/package.json < 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { EventBusRedisFactory } from 'redis-smq-common'; 11 | import { Configuration } from '../../config/index.js'; 12 | import { TRedisSMQEvent } from '../types/index.js'; 13 | 14 | export class EventBus extends EventBusRedisFactory { 15 | constructor() { 16 | const config = Configuration.getSetConfig(); 17 | super(config.redis); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/redis-smq/src/common/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './types/index.js'; 11 | export * from './event-bus/event-bus.js'; 12 | -------------------------------------------------------------------------------- /packages/redis-smq/src/common/redis-client/errors/redis-client-instance-lock.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from 'redis-smq-common'; 11 | 12 | export class RedisClientInstanceLockError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/common/redis-client/scripts/lua/set-queue-rate-limit.lua: -------------------------------------------------------------------------------- 1 | local keyQueueProperties = KEYS[1] 2 | 3 | local EQueuePropertyRateLimit = ARGV[1] 4 | local rateLimit = ARGV[2] 5 | 6 | -- Early return if queue doesn't exist 7 | if redis.call("EXISTS", keyQueueProperties) == 0 then 8 | return 'QUEUE_NOT_FOUND' 9 | end 10 | 11 | -- Set the rate limit property 12 | redis.call("HSET", keyQueueProperties, EQueuePropertyRateLimit, rateLimit) 13 | return 'OK' -------------------------------------------------------------------------------- /packages/redis-smq/src/common/redis-keys/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export { RedisKeysInvalidKeyError } from './redis-keys-invalid-key.error.js'; 11 | export { RedisKeysError } from './redis-keys.error.js'; 12 | -------------------------------------------------------------------------------- /packages/redis-smq/src/common/redis-keys/errors/redis-keys-invalid-key.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisKeysError } from './redis-keys.error.js'; 11 | 12 | export class RedisKeysInvalidKeyError extends RedisKeysError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/common/redis-keys/errors/redis-keys.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from 'redis-smq-common'; 11 | 12 | export class RedisKeysError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/common/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './event.js'; 11 | -------------------------------------------------------------------------------- /packages/redis-smq/src/config/errors/configuration-message-queue-size.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ConfigurationError } from './configuration.error.js'; 11 | 12 | export class ConfigurationMessageQueueSizeError extends ConfigurationError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/config/errors/configuration-message-store-expire.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ConfigurationError } from './configuration.error.js'; 11 | 12 | export class ConfigurationMessageStoreExpireError extends ConfigurationError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/config/errors/configuration-namespace.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ConfigurationError } from './configuration.error.js'; 11 | 12 | export class ConfigurationNamespaceError extends ConfigurationError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/config/errors/configuration.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from 'redis-smq-common'; 11 | 12 | export class ConfigurationError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/config/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export { ConfigurationError } from './configuration.error.js'; 11 | export { ConfigurationMessageStoreExpireError } from './configuration-message-store-expire.error.js'; 12 | export { ConfigurationMessageQueueSizeError } from './configuration-message-queue-size.error.js'; 13 | export { ConfigurationNamespaceError } from './configuration-namespace.error.js'; 14 | -------------------------------------------------------------------------------- /packages/redis-smq/src/config/event-bus.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import _ from 'lodash'; 11 | import { IRedisSMQConfig, IRedisSMQConfigRequired } from './types/index.js'; 12 | 13 | const defaultConfig: IRedisSMQConfigRequired['eventBus'] = { 14 | enabled: false, 15 | }; 16 | 17 | export default function EventBus( 18 | userConfig: IRedisSMQConfig, 19 | ): IRedisSMQConfigRequired['eventBus'] { 20 | return _.merge({}, defaultConfig, userConfig.eventBus ?? {}); 21 | } 22 | -------------------------------------------------------------------------------- /packages/redis-smq/src/config/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './errors/index.js'; 11 | export * from './types/index.js'; 12 | export * from './configuration.js'; 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/config/logger.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import _ from 'lodash'; 11 | import { IRedisSMQConfig, IRedisSMQConfigRequired } from './types/index.js'; 12 | 13 | const defaultConfig: IRedisSMQConfigRequired['logger'] = { 14 | enabled: false, 15 | }; 16 | 17 | export default function Logger( 18 | userConfig: IRedisSMQConfig, 19 | ): IRedisSMQConfigRequired['logger'] { 20 | return _.merge({}, defaultConfig, userConfig.logger ?? {}); 21 | } 22 | -------------------------------------------------------------------------------- /packages/redis-smq/src/config/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './config.js'; 11 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/consumer-groups/errors/consumer-groups-consumer-group-not-empty.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ConsumerGroupsError } from './consumer-groups.error.js'; 11 | 12 | export class ConsumerGroupsConsumerGroupNotEmptyError extends ConsumerGroupsError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/consumer-groups/errors/consumer-groups-consumer-groups-not-supported.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ConsumerGroupsError } from './consumer-groups.error.js'; 11 | 12 | export class ConsumerGroupsConsumerGroupsNotSupportedError extends ConsumerGroupsError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/consumer-groups/errors/consumer-groups-invalid-group-id.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ConsumerGroupsError } from './consumer-groups.error.js'; 11 | 12 | export class ConsumerGroupsInvalidGroupIdError extends ConsumerGroupsError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/consumer-groups/errors/consumer-groups-queue-not-found.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ConsumerGroupsError } from './consumer-groups.error.js'; 11 | 12 | export class ConsumerGroupsQueueNotFoundError extends ConsumerGroupsError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/consumer-groups/errors/consumer-groups.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from 'redis-smq-common'; 11 | 12 | export class ConsumerGroupsError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/consumer-groups/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './consumer-groups.js'; 11 | export * from './errors/index.js'; 12 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/consumer/errors/consumer-consume-message-handler-already-exists.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ConsumerError } from './consumer.error.js'; 11 | 12 | export class ConsumerConsumeMessageHandlerAlreadyExistsError extends ConsumerError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/consumer/errors/consumer-consumer-group-id-not-supported.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ConsumerError } from './consumer.error.js'; 11 | 12 | export class ConsumerConsumerGroupIdNotSupportedError extends ConsumerError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/consumer/errors/consumer-consumer-group-id-required.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ConsumerError } from './consumer.error.js'; 11 | 12 | export class ConsumerConsumerGroupIdRequiredError extends ConsumerError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/consumer/errors/consumer.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from 'redis-smq-common'; 11 | 12 | export class ConsumerError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/consumer/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export { ConsumerError } from './consumer.error.js'; 11 | export { ConsumerConsumeMessageHandlerAlreadyExistsError } from './consumer-consume-message-handler-already-exists.error.js'; 12 | export { ConsumerConsumerGroupIdNotSupportedError } from './consumer-consumer-group-id-not-supported.error.js'; 13 | export { ConsumerConsumerGroupIdRequiredError } from './consumer-consumer-group-id-required.error.js'; 14 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/consumer/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './errors/index.js'; 11 | export * from './types/index.js'; 12 | export * from './consumer/consumer.js'; 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/consumer/message-handler/errors/consumer-message-handler-file.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ConsumerMessageHandlerError } from './consumer-message-handler.error.js'; 11 | 12 | export class ConsumerMessageHandlerFileError extends ConsumerMessageHandlerError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/consumer/message-handler/errors/consumer-message-handler-filename-extension.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ConsumerMessageHandlerError } from './consumer-message-handler.error.js'; 11 | 12 | export class ConsumerMessageHandlerFilenameExtensionError extends ConsumerMessageHandlerError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/consumer/message-handler/errors/consumer-message-handler.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ConsumerError } from '../../errors/index.js'; 11 | 12 | export class ConsumerMessageHandlerError extends ConsumerError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/consumer/message-handler/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export { ConsumerMessageHandlerError } from './consumer-message-handler.error.js'; 11 | export { ConsumerMessageHandlerFilenameExtensionError } from './consumer-message-handler-filename-extension.error.js'; 12 | export { ConsumerMessageHandlerFileError } from './consumer-message-handler-file.error.js'; 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/consumer/message-handler/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/consumer/message-handler/message-handler/consume-message/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './message-unacknowledgement.js'; 11 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/consumer/types/consumer-heartbeat.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface IConsumerHeartbeat { 11 | timestamp: number; 12 | data: IConsumerHeartbeatPayload; 13 | } 14 | 15 | export interface IConsumerHeartbeatPayload { 16 | ram: { usage: NodeJS.MemoryUsage; free: number; total: number }; 17 | cpu: { user: number; system: number; percentage: string }; 18 | } 19 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/consumer/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './message-handler.js'; 11 | export * from './consumer-heartbeat.js'; 12 | export * from '../message-handler/message-handler/consume-message/types/index.js'; 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/exchange/errors/exchange-fan-out-exchange-has-bound-queues.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ExchangeError } from './exchange.error.js'; 11 | 12 | export class ExchangeFanOutExchangeHasBoundQueuesError extends ExchangeError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/exchange/errors/exchange-fan-out-queue-type.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ExchangeFanOutError } from './exchange-fan-out.error.js'; 11 | 12 | export class ExchangeFanOutQueueTypeError extends ExchangeFanOutError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/exchange/errors/exchange-fan-out.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ExchangeError } from './exchange.error.js'; 11 | 12 | export class ExchangeFanOutError extends ExchangeError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/exchange/errors/exchange-invalid-fan-out-params.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ExchangeError } from './exchange.error.js'; 11 | 12 | export class ExchangeInvalidFanOutParamsError extends ExchangeError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/exchange/errors/exchange-invalid-queue-params.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ExchangeError } from './exchange.error.js'; 11 | 12 | export class ExchangeInvalidQueueParamsError extends ExchangeError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/exchange/errors/exchange-invalid-topic-params.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ExchangeError } from './exchange.error.js'; 11 | 12 | export class ExchangeInvalidTopicParamsError extends ExchangeError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/exchange/errors/exchange-queue-is-not-bound-to-exchange.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ExchangeError } from './exchange.error.js'; 11 | 12 | export class ExchangeQueueIsNotBoundToExchangeError extends ExchangeError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/exchange/errors/exchange.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from 'redis-smq-common'; 11 | 12 | export class ExchangeError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/exchange/exchange-direct/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './exchange-direct.js'; 11 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/exchange/exchange-fan-out/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './exchange-fan-out.js'; 11 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/exchange/exchange-topic/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './exchange-topic.js'; 11 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/exchange/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './errors/index.js'; 11 | export * from './types/index.js'; 12 | export * from './exchange-direct/index.js'; 13 | export * from './exchange-topic/index.js'; 14 | export * from './exchange-fan-out/index.js'; 15 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/exchange/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './exchange.js'; 11 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './consumer/index.js'; 11 | export * from './consumer-groups/index.js'; 12 | export * from './exchange/index.js'; 13 | export * from './message/index.js'; 14 | export * from './namespace/index.js'; 15 | export * from './producer/index.js'; 16 | export * from './queue/index.js'; 17 | export * from './queue-messages/index.js'; 18 | export * from './queue-rate-limit/index.js'; 19 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/message/errors/message-destination-queue-already-set.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { MessageError } from './message.error.js'; 11 | 12 | export class MessageDestinationQueueAlreadySetError extends MessageError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/message/errors/message-destination-queue-required.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { MessageError } from './message.error.js'; 11 | 12 | export class MessageDestinationQueueRequiredError extends MessageError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/message/errors/message-invalid-parameters.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { MessageError } from './message.error.js'; 11 | 12 | export class MessageInvalidParametersError extends MessageError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/message/errors/message-message-exchange-required.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { MessageError } from './message.error.js'; 11 | 12 | export class MessageMessageExchangeRequiredError extends MessageError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/message/errors/message-message-in-process.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from 'redis-smq-common'; 11 | 12 | export class MessageMessageInProcessError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/message/errors/message-message-not-deleted.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { MessageError } from './message.error.js'; 11 | 12 | export class MessageMessageNotDeletedError extends MessageError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/message/errors/message-message-not-found.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { MessageError } from './message.error.js'; 11 | 12 | export class MessageMessageNotFoundError extends MessageError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/message/errors/message-message-not-requeuable.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { MessageError } from './message.error.js'; 11 | 12 | export class MessageMessageNotRequeuableError extends MessageError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/message/errors/message-message-property.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { MessageError } from './message.error.js'; 11 | 12 | export class MessageMessagePropertyError extends MessageError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/message/errors/message.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from 'redis-smq-common'; 11 | 12 | export class MessageError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/message/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './errors/index.js'; 11 | export * from './types/index.js'; 12 | export * from './producible-message.js'; 13 | export * from './message.js'; 14 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/message/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './config.js'; 11 | export * from './message-state.js'; 12 | export * from './message.js'; 13 | export * from './delete-message.js'; 14 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/message/types/message-state.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export interface IMessageStateTransferable { 11 | uuid: string; 12 | publishedAt: number | null; 13 | scheduledAt: number | null; 14 | lastScheduledAt: number | null; 15 | scheduledCronFired: boolean; 16 | attempts: number; 17 | scheduledRepeatCount: number; 18 | expired: boolean; 19 | nextScheduledDelay: number; 20 | nextRetryDelay: number; 21 | scheduledTimes: number; 22 | scheduledMessageId: string | null; 23 | } 24 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/namespace/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export { NamespaceNotFoundError } from './namespace-not-found.error.js'; 11 | export { NamespaceError } from './namespace.error.js'; 12 | export { NamespaceInvalidNamespaceError } from './namespace-invalid-namespace.error.js'; 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/namespace/errors/namespace-invalid-namespace.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { NamespaceError } from './namespace.error.js'; 11 | 12 | export class NamespaceInvalidNamespaceError extends NamespaceError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/namespace/errors/namespace-not-found.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { NamespaceError } from './namespace.error.js'; 11 | 12 | export class NamespaceNotFoundError extends NamespaceError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/namespace/errors/namespace.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from 'redis-smq-common'; 11 | 12 | export class NamespaceError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/namespace/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './errors/index.js'; 11 | export * from './namespace.js'; 12 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/producer/errors/producer-exchange-no-matched-queue.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ProducerError } from './producer.error.js'; 11 | 12 | export class ProducerExchangeNoMatchedQueueError extends ProducerError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/producer/errors/producer-instance-not-running.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ProducerError } from './producer.error.js'; 11 | 12 | export class ProducerInstanceNotRunningError extends ProducerError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/producer/errors/producer-message-exchange-required.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ProducerError } from './producer.error.js'; 11 | 12 | export class ProducerMessageExchangeRequiredError extends ProducerError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/producer/errors/producer-message-priority-required.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ProducerError } from './producer.error.js'; 11 | 12 | export class ProducerMessagePriorityRequiredError extends ProducerError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/producer/errors/producer-priority-queuing-not-enabled.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ProducerError } from './producer.error.js'; 11 | 12 | export class ProducerPriorityQueuingNotEnabledError extends ProducerError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/producer/errors/producer-queue-missing-consumer-groups.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ProducerError } from './producer.error.js'; 11 | 12 | export class ProducerQueueMissingConsumerGroupsError extends ProducerError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/producer/errors/producer-queue-not-found.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ProducerError } from './producer.error.js'; 11 | 12 | export class ProducerQueueNotFoundError extends ProducerError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/producer/errors/producer-schedule-invalid-parameters.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ProducerError } from './producer.error.js'; 11 | 12 | export class ProducerScheduleInvalidParametersError extends ProducerError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/producer/errors/producer-unknown-queue-type.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ProducerError } from './producer.error.js'; 11 | 12 | export class ProducerUnknownQueueTypeError extends ProducerError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/producer/errors/producer.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from 'redis-smq-common'; 11 | 12 | export class ProducerError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/producer/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './errors/index.js'; 11 | export * from './producer.js'; 12 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue-messages/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export { QueueMessagesError } from './queue-messages.error.js'; 11 | export { QueueMessagesConsumerGroupIdRequiredError } from './queue-messages-consumer-group-id-required.error.js'; 12 | export { QueueMessagesConsumerGroupIdNotSupportedError } from './queue-messages-consumer-group-id-not-supported.error.js'; 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue-messages/errors/queue-messages-consumer-group-id-not-supported.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { QueueMessagesError } from './queue-messages.error.js'; 11 | 12 | export class QueueMessagesConsumerGroupIdNotSupportedError extends QueueMessagesError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue-messages/errors/queue-messages-consumer-group-id-required.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { QueueMessagesError } from './queue-messages.error.js'; 11 | 12 | export class QueueMessagesConsumerGroupIdRequiredError extends QueueMessagesError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue-messages/errors/queue-messages.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from 'redis-smq-common'; 11 | 12 | export class QueueMessagesError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue-messages/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './errors/index.js'; 11 | export * from './types/index.js'; 12 | export * from './queue-messages/queue-messages.js'; 13 | export * from './queue-messages/queue-acknowledged-messages.js'; 14 | export * from './queue-messages/queue-dead-lettered-messages.js'; 15 | export * from './queue-messages/queue-scheduled-messages.js'; 16 | export * from './queue-messages/queue-pending-messages/index.js'; 17 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue-messages/queue-messages/queue-pending-messages/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './queue-pending-messages.js'; 11 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue-rate-limit/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export { QueueRateLimitError } from './queue-rate-limit.error.js'; 11 | export { QueueRateLimitInvalidIntervalError } from './queue-rate-limit-invalid-interval.error.js'; 12 | export { QueueRateLimitInvalidLimitError } from './queue-rate-limit-invalid-limit.error.js'; 13 | export { QueueRateLimitQueueNotFoundError } from './queue-rate-limit-queue-not-found.error.js'; 14 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue-rate-limit/errors/queue-rate-limit-invalid-interval.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { QueueRateLimitError } from './queue-rate-limit.error.js'; 11 | 12 | export class QueueRateLimitInvalidIntervalError extends QueueRateLimitError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue-rate-limit/errors/queue-rate-limit-invalid-limit.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { QueueRateLimitError } from './queue-rate-limit.error.js'; 11 | 12 | export class QueueRateLimitInvalidLimitError extends QueueRateLimitError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue-rate-limit/errors/queue-rate-limit-queue-not-found.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { QueueRateLimitError } from './queue-rate-limit.error.js'; 11 | 12 | export class QueueRateLimitQueueNotFoundError extends QueueRateLimitError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue-rate-limit/errors/queue-rate-limit.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from 'redis-smq-common'; 11 | 12 | export class QueueRateLimitError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue-rate-limit/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './errors/index.js'; 11 | export * from './queue-rate-limit.js'; 12 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue/errors/queue-invalid-queue-parameter.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { QueueError } from './queue.error.js'; 11 | 12 | export class QueueInvalidQueueParameterError extends QueueError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue/errors/queue-queue-exists.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { QueueError } from './queue.error.js'; 11 | 12 | export class QueueQueueExistsError extends QueueError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue/errors/queue-queue-has-running-consumers.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { QueueError } from './queue.error.js'; 11 | 12 | export class QueueQueueHasRunningConsumersError extends QueueError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue/errors/queue-queue-not-empty.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { QueueError } from './queue.error.js'; 11 | 12 | export class QueueQueueNotEmptyError extends QueueError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue/errors/queue-queue-not-found.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { QueueError } from './queue.error.js'; 11 | 12 | export class QueueQueueNotFoundError extends QueueError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue/errors/queue.error.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { RedisSMQError } from 'redis-smq-common'; 11 | 12 | export class QueueError extends RedisSMQError {} 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './errors/index.js'; 11 | export * from './types/index.js'; 12 | export * from './queue.js'; 13 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export * from './queue.js'; 11 | export * from './queue-consumer.js'; 12 | -------------------------------------------------------------------------------- /packages/redis-smq/src/lib/queue/types/queue-consumer.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export type TQueueConsumer = { 11 | ipAddress: string[]; 12 | hostname: string; 13 | pid: number; 14 | createdAt: number; 15 | }; 16 | -------------------------------------------------------------------------------- /packages/redis-smq/tests/common/logger.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { logger as factory } from 'redis-smq-common'; 11 | import { Configuration } from '../../src/config/index.js'; 12 | 13 | export const logger = factory.getLogger(Configuration.getSetConfig().logger); 14 | -------------------------------------------------------------------------------- /packages/redis-smq/tests/common/message-handler-worker-acks.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ICallback } from 'redis-smq-common'; 11 | import { IMessageParams } from '../../src/lib/index.js'; 12 | 13 | export default function myHandler(msg: IMessageParams, cb: ICallback) { 14 | cb(); 15 | } 16 | -------------------------------------------------------------------------------- /packages/redis-smq/tests/common/message-handler-worker-faulty-exit.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export const a = 6; 11 | 12 | process.exit(333); 13 | -------------------------------------------------------------------------------- /packages/redis-smq/tests/common/message-handler-worker-faulty.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export const a = 6; 11 | -------------------------------------------------------------------------------- /packages/redis-smq/tests/common/message-handler-worker-unacks-exception.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export default function myHandler() { 11 | throw new Error('THROW_ERROR'); 12 | } 13 | -------------------------------------------------------------------------------- /packages/redis-smq/tests/common/message-handler-worker-unacks.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import { ICallback } from 'redis-smq-common'; 11 | import { IMessageParams } from '../../src/lib/index.js'; 12 | 13 | export default function myHandler(msg: IMessageParams, cb: ICallback) { 14 | cb(new Error('MY_ERROR')); 15 | } 16 | -------------------------------------------------------------------------------- /packages/redis-smq/tests/common/message.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import bluebird from 'bluebird'; 11 | import { Message } from '../../src/lib/index.js'; 12 | 13 | const instances: Message[] = []; 14 | 15 | export async function getMessage() { 16 | const instance = new Message(); 17 | instances.push(instance); 18 | return bluebird.promisifyAll(instance); 19 | } 20 | 21 | export async function shutDownMessage() { 22 | for (const i of instances) { 23 | await bluebird.promisifyAll(i).shutdownAsync(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/redis-smq/tests/common/queue.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import bluebird from 'bluebird'; 11 | import { Queue } from '../../src/lib/index.js'; 12 | 13 | const instances: Queue[] = []; 14 | 15 | export async function getQueue() { 16 | const instance = new Queue(); 17 | instances.push(instance); 18 | return bluebird.promisifyAll(instance); 19 | } 20 | 21 | export async function shutDownQueue() { 22 | for (const i of instances) { 23 | await bluebird.promisifyAll(i).shutdownAsync(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/redis-smq/tests/common/utils.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | import _ from 'lodash'; 11 | 12 | export const isEqual = (a: unknown[], b: unknown[]) => 13 | _.isMatch([a], [b]) && _.isMatch([b], [a]); 14 | -------------------------------------------------------------------------------- /packages/redis-smq/tests/common/validate-time.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 3 | * Weyoss 4 | * https://github.com/weyoss 5 | * 6 | * This source code is licensed under the MIT license found in the LICENSE file 7 | * in the root directory of this source tree. 8 | */ 9 | 10 | export function validateTime( 11 | actualTime: number, 12 | expectedTime: number, 13 | driftTolerance = 3000, 14 | ): boolean { 15 | return ( 16 | actualTime >= expectedTime - driftTolerance && 17 | actualTime <= expectedTime + driftTolerance 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /packages/redis-smq/tsconfig.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.cjs.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/cjs" 5 | }, 6 | "include": ["."] 7 | } 8 | -------------------------------------------------------------------------------- /packages/redis-smq/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/esm" 5 | }, 6 | "include": ["."] 7 | } 8 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - 'packages/*' 3 | -------------------------------------------------------------------------------- /scripts/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 5 | # Weyoss 6 | # https://github.com/weyoss 7 | # 8 | # This source code is licensed under the MIT license found in the LICENSE file 9 | # in the root directory of this source tree. 10 | # 11 | 12 | pnpm build:ca 13 | pnpm -r test 14 | -------------------------------------------------------------------------------- /tsconfig.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "lib": ["es6"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "moduleResolution": "node" 8 | } 9 | } 10 | --------------------------------------------------------------------------------