Skip to content

Commit

Permalink
chore: refactor file structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Benmuiruri committed Feb 17, 2025
1 parent 70bc4a6 commit 85c63f7
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 14 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import process from 'process';
import jwt from 'jsonwebtoken';
import ChtSession from '../cht-session';
import ChtSession from './cht-session';

const LOGIN_EXPIRES_AFTER_MS = 4 * 24 * 60 * 60 * 1000;
const QUEUE_SESSION_EXPIRATION = '96h';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cht-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AxiosHeaders, AxiosInstance } from 'axios';
import axiosRetry from 'axios-retry';
import * as semver from 'semver';

import { AuthErrors } from './authentication/errors/authentication-error';
import { AuthErrors } from './authentication-error';
import { AuthenticationInfo } from '../config';
import { axiosRetryConfig } from './retry-logic';
import { RemotePlace } from './remote-place-cache';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/manage-hierarchy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _ from 'lodash';
import { DateTime } from 'luxon';

import Auth from './authentication/authentication';
import Auth from './authentication';
import { ChtApi } from './cht-api';
import { ChtConfJobData } from '../worker/cht-conf-worker';
import { ContactType } from '../config';
Expand Down
2 changes: 1 addition & 1 deletion src/routes/app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FastifyInstance } from 'fastify';

import Auth from '../lib/authentication/authentication';
import Auth from '../lib/authentication';
import { ChtApi } from '../lib/cht-api';
import { Config } from '../config';
import DirectiveModel from '../services/directive-model';
Expand Down
4 changes: 2 additions & 2 deletions src/routes/authentication.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FastifyInstance, FastifyRequest, FastifyReply } from 'fastify';

import Auth from '../lib/authentication/authentication';
import { AuthError, AuthErrors } from '../lib/authentication/errors/authentication-error';
import Auth from '../lib/authentication';
import { AuthError, AuthErrors } from '../lib/authentication-error';
import { Config } from '../config';
import { version as appVersion } from '../package.json';
import ChtSession from '../lib/cht-session';
Expand Down
2 changes: 1 addition & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { FastifySSEPlugin } from 'fastify-sse-v2';
import path from 'path';
const metricsPlugin = require('fastify-metrics');

import Auth from './lib/authentication/authentication';
import Auth from './lib/authentication';
import SessionCache from './services/session-cache';
import { checkRedisConnection } from './config/config-worker';

Expand Down
2 changes: 1 addition & 1 deletion src/worker/cht-conf-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { spawn } from 'child_process';
import { Worker, Job, DelayedError, ConnectionOptions, MinimalJob } from 'bullmq';
import { DateTime } from 'luxon';

import Auth from '../lib/authentication/authentication';
import Auth from '../lib/authentication';
import { HierarchyAction } from '../lib/manage-hierarchy';

export interface ChtConfJobData {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/manage-hierarchy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import sinon from 'sinon';

import MoveLib from '../../src/lib/manage-hierarchy';

import Auth from '../../src/lib/authentication/authentication';
import Auth from '../../src/lib/authentication';
import { Config } from '../../src/config';
import { BullQueue } from '../../src/lib/queues';
import { mockChtApi, mockChtSession } from '../mocks';
Expand Down
4 changes: 2 additions & 2 deletions test/lib/authentication.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import chai from 'chai';
import chaiExclude from 'chai-exclude';
import { mockChtSession } from '../mocks';
import Auth from '../../src/lib/authentication/authentication';
import { AuthError, AuthErrors } from '../../src/lib/authentication/errors/authentication-error';
import Auth from '../../src/lib/authentication';
import { AuthError, AuthErrors } from '../../src/lib/authentication-error';

chai.use(chaiExclude);
const { expect } = chai;
Expand Down
2 changes: 1 addition & 1 deletion test/lib/cht-session.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import sinon from 'sinon';

import { AuthenticationInfo } from '../../src/config';
import { RemotePlace } from '../../src/lib/remote-place-cache';
import { AuthError } from '../../src/lib/authentication/errors/authentication-error';
import { AuthError } from '../../src/lib/authentication-error';
const ChtSession = rewire('../../src/lib/cht-session');

import chaiAsPromised from 'chai-as-promised';
Expand Down
2 changes: 1 addition & 1 deletion test/lib/manage-hierarchy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import chaiAsPromised from 'chai-as-promised';
import { DateTime } from 'luxon';
import sinon from 'sinon';

import Auth from '../../src/lib/authentication/authentication';
import Auth from '../../src/lib/authentication';
import { Config } from '../../src/config';
import { JobParams } from '../../src/lib/queues';
import ManageHierarchyLib from '../../src/lib/manage-hierarchy';
Expand Down
2 changes: 1 addition & 1 deletion test/worker/cht-conf-worker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Sinon from 'sinon';
import chaiAsPromised from 'chai-as-promised';
Chai.use(chaiAsPromised);

import Auth from '../../src/lib/authentication/authentication';
import Auth from '../../src/lib/authentication';
import { ChtConfWorker } from '../../src/worker/cht-conf-worker';
import { HierarchyAction } from '../../src/lib/manage-hierarchy';
import { mockChtSession } from '../mocks';
Expand Down

0 comments on commit 85c63f7

Please sign in to comment.