Skip to content

Commit

Permalink
refactor: shorten imports
Browse files Browse the repository at this point in the history
  • Loading branch information
weyoss committed Mar 29, 2024
1 parent 98910dc commit 3bfb8f1
Show file tree
Hide file tree
Showing 24 changed files with 23 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/lib/consumer-groups/consumer-groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
import { TRedisSMQEvent } from '../../common/index.js';
import { RedisClientInstance } from '../../common/redis-client/redis-client-instance.js';
import { Configuration } from '../../config/index.js';
import { EventBusRedisInstance } from '../event-bus/event-bus-redis-instance.js';
import { EventBusRedisInstance } from '../event-bus/index.js';
import { IQueueParams } from '../queue/index.js';
import { _parseQueueParams } from '../queue/_/_parse-queue-params.js';
import { _deleteConsumerGroup } from './_/_delete-consumer-group.js';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/consumer/consumer-heartbeat/consumer-heartbeat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
import { TConsumerHeartbeatEvent } from '../../../common/index.js';
import { RedisClientFactory } from '../../../common/redis-client/redis-client-factory.js';
import { redisKeys } from '../../../common/redis-keys/redis-keys.js';
import { Configuration } from '../../../config/configuration.js';
import { Configuration } from '../../../config/index.js';
import { EventBusRedisFactory } from '../../event-bus/event-bus-redis-factory.js';
import { Consumer } from '../consumer/consumer.js';
import { IConsumerHeartbeat } from '../types/index.js';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/consumer/consumer-heartbeat/event-bus-publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { ILogger } from 'redis-smq-common';
import { TConsumerHeartbeatEvent } from '../../../common/types/event.js';
import { TConsumerHeartbeatEvent } from '../../../common/index.js';
import { EventBusRedisFactory } from '../../event-bus/event-bus-redis-factory.js';
import { ConsumerHeartbeat } from './consumer-heartbeat.js';

Expand Down
2 changes: 1 addition & 1 deletion src/lib/consumer/consumer/event-bus-publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { ILogger } from 'redis-smq-common';
import { TConsumerEvent } from '../../../common/types/event.js';
import { TConsumerEvent } from '../../../common/index.js';
import { EventBusRedisFactory } from '../../event-bus/event-bus-redis-factory.js';
import { Consumer } from './consumer.js';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { ILogger } from 'redis-smq-common';
import { TConsumerMessageHandlerRunnerEvent } from '../../../common/types/event.js';
import { TConsumerMessageHandlerRunnerEvent } from '../../../common/index.js';
import { EventBusRedisFactory } from '../../event-bus/event-bus-redis-factory.js';
import { MessageHandlerRunner } from './message-handler-runner.js';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { async, ICallback, ILogger, Runnable } from 'redis-smq-common';
import { TConsumerMessageHandlerRunnerEvent } from '../../../common/index.js';
import { Configuration } from '../../../config/configuration.js';
import { Configuration } from '../../../config/index.js';
import { IQueueParsedParams } from '../../queue/index.js';
import { Consumer } from '../consumer/consumer.js';
import { ConsumerMessageHandlerAlreadyExistsError } from '../errors/index.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { ILogger } from 'redis-smq-common';
import { TConsumerConsumeMessageEvent } from '../../../../common/types/event.js';
import { TConsumerConsumeMessageEvent } from '../../../../common/index.js';
import { EventBusRedisFactory } from '../../../event-bus/event-bus-redis-factory.js';
import { ConsumeMessage } from './consume-message.js';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { TConsumerDequeueMessageEvent } from '../../../../common/index.js';
import { RedisClientInstance } from '../../../../common/redis-client/redis-client-instance.js';
import { ELuaScriptName } from '../../../../common/redis-client/scripts/scripts.js';
import { redisKeys } from '../../../../common/redis-keys/redis-keys.js';
import { Configuration } from '../../../../config/configuration.js';
import { Configuration } from '../../../../config/index.js';
import { _saveConsumerGroup } from '../../../consumer-groups/_/_save-consumer-group.js';
import { EventBusRedisFactory } from '../../../event-bus/event-bus-redis-factory.js';
import { _hasRateLimitExceeded } from '../../../queue-rate-limit/_/_has-rate-limit-exceeded.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { ILogger } from 'redis-smq-common';
import { TConsumerDequeueMessageEvent } from '../../../../common/types/event.js';
import { TConsumerDequeueMessageEvent } from '../../../../common/index.js';
import { EventBusRedisFactory } from '../../../event-bus/event-bus-redis-factory.js';
import { DequeueMessage } from './dequeue-message.js';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { ILogger } from 'redis-smq-common';
import { TConsumerMessageHandlerEvent } from '../../../../common/types/event.js';
import { TConsumerMessageHandlerEvent } from '../../../../common/index.js';
import { EventBusRedisFactory } from '../../../event-bus/event-bus-redis-factory.js';
import { MessageHandler } from './message-handler.js';

Expand Down
12 changes: 0 additions & 12 deletions src/lib/consumer/types/config.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/lib/consumer/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@
export * from './message-handler.js';
export * from './consumer-heartbeat.js';
export * from './consume-message.js';
export * from './config.js';
2 changes: 1 addition & 1 deletion src/lib/consumer/workers/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { ICallback, ILogger, logger, Runnable, Timer } from 'redis-smq-common';
import { RedisClientInstance } from '../../../common/redis-client/redis-client-instance.js';
import { IRedisSMQConfigRequired } from '../../../config/types/config.js';
import { IRedisSMQConfigRequired } from '../../../config/index.js';

export abstract class Worker extends Runnable<Record<string, never>> {
protected redisClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { v4 } from 'uuid';
import { IQueueParams } from '../../../queue/types/queue.js';
import { IQueueParams } from '../../../queue/index.js';
import {
EExchangeType,
TExchangeDirectTransferable,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/exchange/exchange-fan-out/exchange-fan-out.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import {
IQueueParams,
IQueueProperties,
} from '../../queue/index.js';
import { ExchangeFanOutError } from '../errors/exchange-fan-out.error.js';
import { ExchangeError } from '../errors/exchange.error.js';
import { ExchangeFanOutError } from '../errors/index.js';
import { ExchangeError } from '../errors/index.js';
import { ExchangeAbstract } from '../exchange-abstract.js';
import { _getFanOutExchangeQueues } from './_/_get-fan-out-exchange-queues.js';
import { _getQueueFanOutExchange } from './_/_get-queue-fan-out-exchange.js';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/exchange/exchange-topic/exchange-topic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { CallbackEmptyReplyError, ICallback } from 'redis-smq-common';
import { IQueueParams } from '../../queue/types/queue.js';
import { IQueueParams } from '../../queue/index.js';
import { ExchangeAbstract } from '../exchange-abstract.js';
import { ITopicParams } from '../types/exchange.js';
import { _getTopicExchangeParams } from './_/_get-topic-exchange-params.js';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/producer/event-bus-publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { ILogger } from 'redis-smq-common';
import { TProducerEvent } from '../../common/types/event.js';
import { TProducerEvent } from '../../common/index.js';
import { EventBusRedisFactory } from '../event-bus/event-bus-redis-factory.js';
import { Producer } from './producer.js';

Expand Down
2 changes: 1 addition & 1 deletion src/lib/queue/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { RedisClientInstance } from '../../common/redis-client/redis-client-inst
import { ELuaScriptName } from '../../common/redis-client/scripts/scripts.js';
import { redisKeys } from '../../common/redis-keys/redis-keys.js';
import { Configuration } from '../../config/index.js';
import { EventBusRedisInstance } from '../event-bus/event-bus-redis-instance.js';
import { EventBusRedisInstance } from '../event-bus/index.js';
import { _deleteQueue } from './_/_delete-queue.js';
import { _getQueueProperties } from './_/_get-queue-properties.js';
import { _getQueues } from './_/_get-queues.js';
Expand Down
2 changes: 1 addition & 1 deletion tests/common/event-bus-redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import bluebird from 'bluebird';
import { EventBusRedisInstance } from '../../src/lib/event-bus/event-bus-redis-instance.js';
import { EventBusRedisInstance } from '../../src/lib/index.js';

const eventBus = bluebird.promisifyAll(new EventBusRedisInstance());

Expand Down
2 changes: 1 addition & 1 deletion tests/common/schedule-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import bluebird from 'bluebird';
import { Runnable } from 'redis-smq-common';
import { Configuration } from '../../src/config/configuration.js';
import { Configuration } from '../../src/config/index.js';
import PublishScheduledWorker from '../../src/lib/consumer/workers/publish-scheduled.worker.js';

let scheduleWorker: Runnable<Record<string, never>> | null = null;
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/consuming-messages/test00010.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { test, jest } from '@jest/globals';
import { ICallback } from 'redis-smq-common';
import { IMessageTransferable } from '../../../src/lib/message/types/message.js';
import { IMessageTransferable } from '../../../src/lib/index.js';
import { getConsumer } from '../../common/consumer.js';
import { untilMessageAcknowledged } from '../../common/events.js';
import {
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/workers/test00001.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { test, expect, jest } from '@jest/globals';
import bluebird from 'bluebird';
import { Configuration } from '../../../src/config/configuration.js';
import { Configuration } from '../../../src/config/index.js';
import {
IMessageParams,
IMessageTransferable,
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/workers/test00002.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { test, expect, jest } from '@jest/globals';
import bluebird from 'bluebird';
import { Configuration } from '../../../src/config/configuration.js';
import { Configuration } from '../../../src/config/index.js';
import {
IMessageParams,
IMessageTransferable,
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/workers/test00003.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { test, expect } from '@jest/globals';
import bluebird from 'bluebird';
import { Configuration } from '../../../src/config/configuration.js';
import { Configuration } from '../../../src/config/index.js';
import RequeueUnacknowledgedWorker from '../../../src/lib/consumer/workers/requeue-unacknowledged.worker.js';
import WatchConsumersWorker from '../../../src/lib/consumer/workers/watch-consumers.worker.js';
import {
Expand Down

0 comments on commit 3bfb8f1

Please sign in to comment.