Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export default [
...reactHooks.configs.recommended.rules,
"@typescript-eslint/no-unsafe-function-type": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/consistent-type-imports": "error",
"no-return-await": "error",
"semi": ["error", "always"],
"eol-last": ["error", "always"],
Expand Down
2 changes: 1 addition & 1 deletion src/domain/authentication/login/login.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { Identity } from '^/integrations/authentication';
import type { Identity } from '^/integrations/authentication';

import getCreatorByEmail from '^/domain/creator/getByEmail';
import registerCreator from '^/domain/creator/register';
Expand Down
2 changes: 1 addition & 1 deletion src/domain/comic/create/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { DataModel } from '../types';
import type { DataModel } from '../types';

type ValidationModel = Pick<DataModel, 'imageId' | 'structure'>;

Expand Down
5 changes: 3 additions & 2 deletions src/domain/comic/create/validateData.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

import validator, { ValidationSchema } from '^/integrations/validation';
import type { ValidationSchema } from '^/integrations/validation';
import validator from '^/integrations/validation';

import { requiredIdValidation } from '^/domain/definitions';

import InvalidComic from './InvalidComic';
import { ValidationModel } from './types';
import type { ValidationModel } from './types';

const schema: ValidationSchema =
{
Expand Down
3 changes: 2 additions & 1 deletion src/domain/comic/getByIdAggregated/getByIdAggregated.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import aggregate, { AggregatedData } from '../aggregate';
import type { AggregatedData } from '../aggregate';
import aggregate from '../aggregate';
import getById from '../getById';

export default async function getByIdAggregated(id: string): Promise<AggregatedData>
Expand Down
2 changes: 1 addition & 1 deletion src/domain/comment/create/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { DataModel } from '../types';
import type { DataModel } from '../types';

type ValidationModel = Pick<DataModel, 'message'>;

Expand Down
5 changes: 3 additions & 2 deletions src/domain/comment/create/validateData.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@

import validator, { ValidationSchema } from '^/integrations/validation';
import type { ValidationSchema } from '^/integrations/validation';
import validator from '^/integrations/validation';

import { MESSAGE_MAX_LENGTH } from '../definitions';
import InvalidComment from './InvalidComment';
import { ValidationModel } from './types';
import type { ValidationModel } from './types';

const schema: ValidationSchema =
{
Expand Down
5 changes: 3 additions & 2 deletions src/domain/common/validateRange/validateRange.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

import validator, { ValidationSchema } from '^/integrations/validation';
import type { ValidationSchema } from '^/integrations/validation';
import validator from '^/integrations/validation';

import { Range } from './types';
import type { Range } from './types';

import InvalidRange from './InvalidRange';

Expand Down
2 changes: 1 addition & 1 deletion src/domain/creator.metrics/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { BaseDataModel, CountOperation } from '../types';
import type { BaseDataModel, CountOperation } from '../types';

type DataModel = BaseDataModel &
{
Expand Down
4 changes: 2 additions & 2 deletions src/domain/creator/aggregate/aggregate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import getMetrics from '^/domain/creator.metrics/getByCreator';
import getImageData from '^/domain/image/getById';

import { DataModel } from '../types';
import { AggregatedData } from './types';
import type { DataModel } from '../types';
import type { AggregatedData } from './types';

export default async function aggregate(data: DataModel): Promise<AggregatedData>
{
Expand Down
2 changes: 1 addition & 1 deletion src/domain/creator/create/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { DataModel } from '../types';
import type { DataModel } from '../types';

type ValidationModel = Pick<DataModel, 'fullName' | 'email' | 'portraitId'>;

Expand Down
5 changes: 3 additions & 2 deletions src/domain/creator/create/validateData.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@

import validator, { ValidationSchema } from '^/integrations/validation';
import type { ValidationSchema } from '^/integrations/validation';
import validator from '^/integrations/validation';

import { optionalIdValidation } from '^/domain/definitions';

import InvalidCreator from '../InvalidCreator';
import { fullNameValidation } from '../definitions';
import { ValidationModel } from './types';
import type { ValidationModel } from './types';

const schema: ValidationSchema =
{
Expand Down
3 changes: 2 additions & 1 deletion src/domain/creator/definitions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

import type { Validation } from '^/integrations/validation';

import { SortOrder, SortOrders } from '../definitions';
import type { SortOrder} from '../definitions';
import { SortOrders } from '../definitions';

export const RECORD_TYPE = 'creator';
export const EVENT_CHANNEL = 'creator';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import database, { RecordSort, SortDirections } from '^/integrations/database';
import type { RecordSort} from '^/integrations/database';
import database, { SortDirections } from '^/integrations/database';

import { RECORD_TYPE } from '../definitions';
import type { DataModel } from '../types';
Expand Down
3 changes: 2 additions & 1 deletion src/domain/creator/getByIdAggregated/getByIdAggregated.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import aggregate, { AggregatedData } from '../aggregate';
import type { AggregatedData } from '../aggregate';
import aggregate from '../aggregate';
import getById from '../getById';

export default async function getByIdAggregated(id: string): Promise<AggregatedData>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import aggregate, { AggregatedData } from '../aggregate';
import type { AggregatedData } from '../aggregate';
import aggregate from '../aggregate';
import getByNickname from '../getByNickname';

export default async function getByNicknameAggregated(nickname: string): Promise<AggregatedData>
Expand Down
2 changes: 1 addition & 1 deletion src/domain/creator/getMe/getMe.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { Requester } from '^/domain/authentication';
import type { Requester } from '^/domain/authentication';

import getById from '../getById';
import type { DataModel } from '../types';
Expand Down
5 changes: 3 additions & 2 deletions src/domain/creator/getMeAggregated/getMeAggregated.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

import { Requester } from '^/domain/authentication';
import type { Requester } from '^/domain/authentication';

import aggregate, { AggregatedData } from '../aggregate';
import type { AggregatedData } from '../aggregate';
import aggregate from '../aggregate';
import getMe from '../getMe';

export default async function getMeAggregated(requester: Requester): Promise<AggregatedData>
Expand Down
6 changes: 4 additions & 2 deletions src/domain/creator/getOthers/getOthers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

import database, { QueryStatement, RecordQuery, RecordSort, SortDirections } from '^/integrations/database';
import type { QueryStatement, RecordQuery, RecordSort} from '^/integrations/database';
import database, { SortDirections } from '^/integrations/database';

import { RECORD_TYPE, SortOrder, SortOrders } from '../definitions';
import type { SortOrder} from '../definitions';
import { RECORD_TYPE, SortOrders } from '../definitions';
import type { DataModel } from '../types';

export default async function getOthers(ids: string[], order: SortOrder, limit: number, offset: number, search: string | undefined = undefined): Promise<DataModel[]>
Expand Down
2 changes: 1 addition & 1 deletion src/domain/creator/register/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import eventBroker from '^/integrations/eventbroker';
import { EVENT_CHANNEL } from '../definitions';

import { EVENT_NAME } from './definitions';
import { RegisteredPublication } from './types';
import type { RegisteredPublication } from './types';

export default async function publish(creatorId: string): Promise<void>
{
Expand Down
2 changes: 1 addition & 1 deletion src/domain/creator/register/subscribe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import eventBroker from '^/integrations/eventbroker';
import { EVENT_CHANNEL } from '../definitions';

import { EVENT_NAME } from './definitions';
import { RegisteredEventHandler, RegisteredSubscription } from './types';
import type { RegisteredEventHandler, RegisteredSubscription } from './types';

export default async function subscribe(handler: RegisteredEventHandler): Promise<void>
{
Expand Down
2 changes: 1 addition & 1 deletion src/domain/creator/register/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { Publication, Subscription } from '^/integrations/eventbroker';
import type { Publication, Subscription } from '^/integrations/eventbroker';

export type RegisteredEventData = {
creatorId: string;
Expand Down
2 changes: 1 addition & 1 deletion src/domain/creator/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { BaseDataModel, CountOperation } from '../types';
import type { BaseDataModel, CountOperation } from '../types';

type DataModel = BaseDataModel &
{
Expand Down
2 changes: 1 addition & 1 deletion src/domain/creator/updateFullName/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { DataModel } from '../types';
import type { DataModel } from '../types';

type ValidationModel = Pick<DataModel, 'fullName'>;

Expand Down
2 changes: 1 addition & 1 deletion src/domain/creator/updateFullName/updateFullName.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { Requester } from '^/domain/authentication';
import type { Requester } from '^/domain/authentication';

import update from '../update';
import validateData from './validateData';
Expand Down
5 changes: 3 additions & 2 deletions src/domain/creator/updateFullName/validateData.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@

import validator, { ValidationSchema } from '^/integrations/validation';
import type { ValidationSchema } from '^/integrations/validation';
import validator from '^/integrations/validation';

import InvalidCreator from '../InvalidCreator';
import { fullNameValidation } from '../definitions';
import { ValidationModel } from './types';
import type { ValidationModel } from './types';

const schema: ValidationSchema =
{
Expand Down
2 changes: 1 addition & 1 deletion src/domain/creator/updateNickname/updateNickname.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { Requester } from '^/domain/authentication';
import type { Requester } from '^/domain/authentication';

import cleanNickname from '../cleanNickname';
import update from '../update';
Expand Down
2 changes: 1 addition & 1 deletion src/domain/image/getById/retrieveData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import database from '^/integrations/database';

import { RECORD_TYPE } from '../definitions';
import { DataModel } from '../types';
import type { DataModel } from '../types';

export default async function retrieveData(id: string): Promise<DataModel>
{
Expand Down
5 changes: 3 additions & 2 deletions src/domain/image/save/validateData.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

import validator, { ValidationSchema } from '^/integrations/validation';
import type { ValidationSchema } from '^/integrations/validation';
import validator from '^/integrations/validation';

import { requiredStringValidation } from '../definitions';
import { DataModel } from '../types';
import type { DataModel } from '../types';
import InvalidImage from './InvalidImage';

const schema: ValidationSchema =
Expand Down
2 changes: 1 addition & 1 deletion src/domain/image/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { BaseDataModel } from '../types';
import type { BaseDataModel } from '../types';

type ImageData = {
readonly dataUrl: string;
Expand Down
3 changes: 2 additions & 1 deletion src/domain/image/validate/validate.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import validator, { ValidationSchema } from '^/integrations/validation';
import type { ValidationSchema } from '^/integrations/validation';
import validator from '^/integrations/validation';

import type { MetaData } from '../types';

Expand Down
2 changes: 1 addition & 1 deletion src/domain/notification/aggregate/aggregate.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { Requester } from '^/domain/authentication';
import type { Requester } from '^/domain/authentication';
import { default as getPostData } from '^/domain/post/getByIdAggregated';
import getRelationData from '^/domain/relation/getAggregated';

Expand Down
2 changes: 1 addition & 1 deletion src/domain/notification/aggregate/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import type { AggregatedData as AggregatedPostData } from '^/domain/post/aggregate';
import type { AggregatedData as AggregatedRelationData } from '^/domain/relation/aggregate';

import { DataModel } from '../types';
import type { DataModel } from '../types';

type AggregatedData = Pick<DataModel, 'id' | 'createdAt' | 'type'> &
{
Expand Down
2 changes: 1 addition & 1 deletion src/domain/notification/create/create.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import logger from '^/integrations/logging';

import { Type } from '../definitions';
import type { Type } from '../definitions';
import createData from './createData';
import insertData from './insertData';

Expand Down
2 changes: 1 addition & 1 deletion src/domain/notification/create/createData.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import { generateId } from '^/integrations/utilities/crypto';

import { DataModel } from '../types';
import type { DataModel } from '../types';

export default function createData(type: string, senderId: string, receiverId: string, postId: string | undefined = undefined): DataModel
{
Expand Down
2 changes: 1 addition & 1 deletion src/domain/notification/create/insertData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import database from '^/integrations/database';

import { RECORD_TYPE } from '../definitions';
import { DataModel } from '../types';
import type { DataModel } from '../types';

export default async function insertData(data: DataModel): Promise<string>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

import { Requester } from '^/domain/authentication';
import type { Requester } from '^/domain/authentication';

import aggregate, { AggregatedData } from '../aggregate';
import type { AggregatedData } from '../aggregate';
import aggregate from '../aggregate';
import getById from '../getById';

export default async function getByIdAggregated(requester: Requester, id: string): Promise<AggregatedData>
Expand Down
3 changes: 2 additions & 1 deletion src/domain/notification/getRecent/getRecent.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import database, { RecordQuery, RecordSort, SortDirections } from '^/integrations/database';
import type { RecordQuery, RecordSort} from '^/integrations/database';
import database, { SortDirections } from '^/integrations/database';

import { RECORD_TYPE } from '../definitions';
import type { DataModel } from '../types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@

import { Requester } from '^/domain/authentication';
import type { Requester } from '^/domain/authentication';
import filterResolved from '^/domain/common/filterResolved';
import validateRange, { Range } from '^/domain/common/validateRange';
import type { Range } from '^/domain/common/validateRange';
import validateRange from '^/domain/common/validateRange';

import aggregate, { AggregatedData } from '../aggregate';
import type { AggregatedData } from '../aggregate';
import aggregate from '../aggregate';
import getRecent from '../getRecent';

export default async function getRecentAggregated(requester: Requester, range: Range): Promise<AggregatedData[]>
Expand Down
2 changes: 1 addition & 1 deletion src/domain/post.metrics/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { BaseDataModel, CountOperation } from '../types';
import type { BaseDataModel, CountOperation } from '../types';

type DataModel = BaseDataModel &
{
Expand Down
2 changes: 1 addition & 1 deletion src/domain/post/aggregate/aggregate.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { Requester } from '^/domain/authentication';
import type { Requester } from '^/domain/authentication';
import getComicData from '^/domain/comic/getByIdAggregated';
import getCommentData from '^/domain/comment/getById';
import getMetrics from '^/domain/post.metrics/getByPost';
Expand Down
2 changes: 1 addition & 1 deletion src/domain/post/create/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import eventBroker from '^/integrations/eventbroker';
import { EVENT_CHANNEL } from '../definitions';

import { EVENT_NAME } from './definitions';
import { CreatedPublication } from './types';
import type { CreatedPublication } from './types';

export default async function publish(creatorId: string, postId: string, parentId?: string): Promise<void>
{
Expand Down
2 changes: 1 addition & 1 deletion src/domain/post/create/subscribe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import eventBroker from '^/integrations/eventbroker';
import { EVENT_CHANNEL } from '../definitions';

import { EVENT_NAME } from './definitions';
import { CreatedEventHandler, CreatedSubscription } from './types';
import type { CreatedEventHandler, CreatedSubscription } from './types';

export default async function subscribe(handler: CreatedEventHandler): Promise<void>
{
Expand Down
4 changes: 2 additions & 2 deletions src/domain/post/create/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import { Publication, Subscription } from '^/integrations/eventbroker';
import type { Publication, Subscription } from '^/integrations/eventbroker';

import { DataModel } from '../types';
import type { DataModel } from '../types';

export type ValidationModel = Pick<DataModel, 'creatorId' | 'comicId' | 'commentId' | 'parentId'>;

Expand Down
Loading