diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 9eb082ae2..000000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,34 +0,0 @@ - -/* eslint-disable */ -module.exports = { - 'extends': [ - 'codex/ts', - ], - 'plugins': [ 'vitest' ], - 'parserOptions': { - 'project': 'tsconfig.json', - 'tsconfigRootDir': __dirname, - 'sourceType': 'module', - }, - 'overrides': [{ - 'files': ['*.test.ts'], - 'rules': { - '@typescript-eslint/no-magic-numbers': 'off' - } - }], - 'rules': { - '@typescript-eslint/naming-convention': [ - 'error', - { - 'selector': 'property', - 'format': ['camelCase', 'PascalCase'], - 'filter': { - // Allow "2xx" as a property name, used in the API response schema - 'regex': '^(2xx|2\d{2}|application\/json)$', - 'match': false, - }, - }, - ], - 'jsdoc/require-returns-type': "off" - }, -}; diff --git a/.gitignore b/.gitignore index c3b727a87..eff1b9b21 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ app-config.local.yaml .idea dist database -s3 # Logs logs diff --git a/.nvmrc b/.nvmrc index 9a2a0e219..379b25d1c 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v20 +v22.1.0 diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 000000000..46aff33f8 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,98 @@ +import CodeX from 'eslint-config-codex'; +import { plugin as TsPlugin, parser as TsParser } from 'typescript-eslint'; +/** + * @todo connect architecture config + */ +export default [ + ...CodeX, + /** + * Override only for config files + */ + { + name: 'codex/codestyle/configs', + files: ['eslint.config.mjs', 'vitest.config.js'], + rules: { + 'n/no-unpublished-import': ['off'], + '@typescript-eslint/naming-convention': ['off'], + }, + }, + /** + * Override for dev files that are not in source code (logically) + */ + { + name: 'codex/codestyle/dev-files', + files: ['src/tests/**/*', '**/*.test.ts'], + languageOptions: { + parser: TsParser, + parserOptions: { + project: 'tsconfig.test.json', + tsconfigRootDir: './', + sourceType: 'module', + }, + }, + rules: { + /** + * Current eslint version (9.2.0) has no alias resolver so this error is unfixable + */ + 'n/no-missing-import': ['off'], + 'n/no-unpublished-import': ['error', { + allowModules: ['vitest', 'postgres-migrations', '@testcontainers/localstack'], + ignoreTypeImport: true, + }], + /** + * @todo get rid of this rule ignores and solve all eslint errors occured + */ + '@typescript-eslint/no-unsafe-member-access': ['off'], + '@typescript-eslint/no-unsafe-call': ['off'], + '@typescript-eslint/no-unsafe-assignment': ['off'], + '@typescript-eslint/no-magic-numbers': ['off'], + '@typescript-eslint/no-unsafe-return': ['off'], + '@typescript-eslint/restrict-template-expressions': ['off'], + 'jsdoc/require-jsdoc': ['off'], + }, + }, + /** + * Override for sourve code files + */ + { + name: 'notex.api', + ignores: ['vitest.config.js', 'eslint.config.mjs', 'src/tests/**/*', '**/*.test.ts'], + plugins: { + '@typescript-eslint': TsPlugin, + }, + languageOptions: { + parser: TsParser, + parserOptions: { + project: 'tsconfig.eslint.json', + tsconfigRootDir: './', + sourceType: 'module', + }, + }, + rules: { + /** + * Current eslint version (9.2.0) has no alias resolver so this error is unfixable + */ + 'n/no-missing-import': ['off'], + 'n/no-unpublished-import': ['error'], + 'n/no-unsupported-features/es-builtins': ['error', { + version: '>=22.1.0', + }], + '@typescript-eslint/naming-convention': ['error', { + selector: 'property', + format: ['camelCase', 'PascalCase'], + + filter: { + regex: '^(?!(2xx|2[0-9][0-9]|application/json)$).*', + match: true, + }, + }], + /** + * @todo get rid of this rule ignores and solve all eslint errors occured + */ + '@typescript-eslint/no-misused-promises': ['off'], + 'jsdoc/require-jsdoc': ['off'], + 'jsdoc/informative-docs': ['off'], + 'jsdoc/require-returns-description': ['off'], + }, + }, +]; diff --git a/package.json b/package.json index 32effa0b6..2b4259bb9 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "start": "node dist/index.js -c app-config.yaml -c app-config.local.yaml", "start:dev": "yarn build && node dist/index.js -c app-config.yaml -c app-config.local.yaml", "migrate": "node --loader ts-node/esm ./src/repository/storage/postgres/migrations/index.ts -c app-config.yaml -c app-config.local.yaml", - "lint": "eslint . --ext .ts", - "lint:fix": "eslint . --ext .ts --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "test:dev": "vitest", "test": "vitest run", "coverage": "vitest run --coverage", @@ -25,8 +25,9 @@ "@types/node": "^20.2.3", "@types/pg": "^8.10.2", "@vitest/coverage-v8": "^0.34.5", - "eslint": "^8.41.0", - "eslint-config-codex": "^1.9.2", + "eslint": "^9.2.0", + "eslint-config-codex": "^2.0.0", + "eslint-import-resolver-alias": "1.1.2", "eslint-plugin-vitest": "^0.3.1", "nodemon": "^2.0.22", "pino-pretty": "^10.0.0", @@ -34,6 +35,7 @@ "ts-node": "^10.9.1", "tsc-alias": "^1.8.6", "typescript": "^5.0.4", + "typescript-eslint": "^7.6.0", "vitest": "^1.4.0" }, "dependencies": { diff --git a/src/domain/entities/editorTools.ts b/src/domain/entities/editorTools.ts index 7674b83ca..a6ebce773 100644 --- a/src/domain/entities/editorTools.ts +++ b/src/domain/entities/editorTools.ts @@ -43,7 +43,7 @@ export default interface EditorTool { * Tool URL in content delivery network */ cdn?: string; - } + }; } /** diff --git a/src/domain/entities/file.ts b/src/domain/entities/file.ts index d524817e1..4d0601286 100644 --- a/src/domain/entities/file.ts +++ b/src/domain/entities/file.ts @@ -14,7 +14,7 @@ export enum FileType { /** * File is a part of note */ - NoteAttachment = 1, + NoteAttachment = 1 } /** @@ -36,7 +36,7 @@ export type TestFileLocation = Record; * File location, when it is a part of note */ export type NoteAttachmentFileLocation = { - noteId: NoteInternalId, + noteId: NoteInternalId; }; /** @@ -48,8 +48,8 @@ export type FileLocation = TestFileLocation | NoteAttachmentFileLocation; * File location type, wich depends on file type */ export interface FileLocationByType { - [FileType.Test]: TestFileLocation, - [FileType.NoteAttachment]: NoteAttachmentFileLocation, + [FileType.Test]: TestFileLocation; + [FileType.NoteAttachment]: NoteAttachmentFileLocation; } /** diff --git a/src/domain/entities/note.ts b/src/domain/entities/note.ts index 9dadc4c34..dde466632 100644 --- a/src/domain/entities/note.ts +++ b/src/domain/entities/note.ts @@ -18,12 +18,12 @@ export type ToolUsedInNoteContent = { /** * Name of certain editor tool */ - name: EditorTool['name'], + name: EditorTool['name']; /** * Id of certain editor tool (nanoid) */ - id: EditorTool['id'] + id: EditorTool['id']; }; /** @@ -48,8 +48,8 @@ export interface Note { id: string; type: string; data: unknown; - tunes?: {[name: string]: unknown} - }> + tunes?: { [name: string]: unknown }; + }>; }; /** @@ -73,7 +73,6 @@ export interface Note { tools: ToolUsedInNoteContent[]; } - /** * Part of note entity used to create new note */ diff --git a/src/domain/entities/noteList.ts b/src/domain/entities/noteList.ts index 83c5ce95e..66d8722a5 100644 --- a/src/domain/entities/noteList.ts +++ b/src/domain/entities/noteList.ts @@ -1,7 +1,6 @@ import type { Note } from '@domain/entities/note.js'; import type { NotePublic } from '@domain/entities/notePublic.js'; - /** * Note list entity. * An object with the "items" property containing a list of all existing notes created by the user @@ -17,4 +16,3 @@ export type NoteList = { export type NoteListPublic = { items: NotePublic[]; }; - diff --git a/src/domain/entities/notePublic.ts b/src/domain/entities/notePublic.ts index 2db593400..ee254c4c0 100644 --- a/src/domain/entities/notePublic.ts +++ b/src/domain/entities/notePublic.ts @@ -1,6 +1,6 @@ import type { Note } from '@domain/entities/note.js'; -type NotePublicProperties = 'content' | 'createdAt' | 'updatedAt'| 'creatorId'; +type NotePublicProperties = 'content' | 'createdAt' | 'updatedAt' | 'creatorId'; export interface NotePublic extends Pick { /** @@ -11,7 +11,6 @@ export interface NotePublic extends Pick { /** *Change Note to NotePublic - * * @param note - Note data to compose a public note */ export function definePublicNote(note: Note): NotePublic { diff --git a/src/domain/entities/noteSettings.ts b/src/domain/entities/noteSettings.ts index 5be5261b7..97efef963 100644 --- a/src/domain/entities/noteSettings.ts +++ b/src/domain/entities/noteSettings.ts @@ -1,6 +1,5 @@ import type { Team } from './team.js'; - /** * Invitation hash. It's used to invite users to team */ @@ -55,7 +54,6 @@ export interface NoteSettingsPublic extends Pick; +type NoteSettingsCreationAttributes = Omit; export type { NoteSettingsCreationAttributes diff --git a/src/domain/entities/noteVisit.ts b/src/domain/entities/noteVisit.ts index 5c8f7996f..39c68d7e0 100644 --- a/src/domain/entities/noteVisit.ts +++ b/src/domain/entities/noteVisit.ts @@ -8,20 +8,20 @@ export default interface NoteVisit { /** * Unique property identifier */ - id: number, + id: number; /** * Internal id of the note */ - noteId: NoteInternalId, + noteId: NoteInternalId; /** * Id of the user */ - userId: User['id'], + userId: User['id']; /** * Time when note was visited for the last time (timestamp with timezone) */ - visitedAt: string, -} \ No newline at end of file + visitedAt: string; +} diff --git a/src/domain/entities/team.ts b/src/domain/entities/team.ts index a79fd8f67..82415efdf 100644 --- a/src/domain/entities/team.ts +++ b/src/domain/entities/team.ts @@ -10,7 +10,7 @@ export enum MemberRole { /** * Team member can read and write notes */ - Write = 1, + Write = 1 } /** diff --git a/src/domain/index.ts b/src/domain/index.ts index 0ea527e71..87fcc82c4 100644 --- a/src/domain/index.ts +++ b/src/domain/index.ts @@ -16,37 +16,37 @@ export interface DomainServices { /** * Note service instance */ - noteService: NoteService, + noteService: NoteService; /** * Note settings service instance */ - noteSettingsService: NoteSettingsService, + noteSettingsService: NoteSettingsService; /** * Auth service instance */ - authService: AuthService, + authService: AuthService; /** * User service instance */ - userService: UserService, + userService: UserService; /** * AI service instance */ - aiService: AIService + aiService: AIService; /** * Editor tools service instance */ - editorToolsService: EditorToolsService, + editorToolsService: EditorToolsService; /** * File uploader service instance */ - fileUploaderService: FileUploaderService, + fileUploaderService: FileUploaderService; /** * Note visits service instance @@ -56,7 +56,6 @@ export interface DomainServices { /** * Initiate services - * * @param repositories - repositories * @param appConfig - app config */ diff --git a/src/domain/service/ai.ts b/src/domain/service/ai.ts index ce1a03ddb..ec5a9e048 100644 --- a/src/domain/service/ai.ts +++ b/src/domain/service/ai.ts @@ -6,15 +6,12 @@ import type AIRepository from '@repository/ai.repository.js'; export default class AIService { /** * Constructs AI service instance - * * @param repository - AI repository instance */ constructor(private readonly repository: AIRepository) {} - /** * Returns predicted completion based on specified string content - * * @param content - content to complete */ public async getCompletion(content: string): Promise { diff --git a/src/domain/service/auth.ts b/src/domain/service/auth.ts index 594dc4379..6cb86597e 100644 --- a/src/domain/service/auth.ts +++ b/src/domain/service/auth.ts @@ -30,7 +30,6 @@ export default class AuthService { /** * Creates jwt service instance - * * @param accessSecret - access token secret key * @param accessTokenExpiresIn - access token expiration time * @param refreshTokenExpiresIn - refresh token expiration time @@ -45,9 +44,8 @@ export default class AuthService { /** * Generates access token - * * @param payload - payload to sign - * @returns {string} access token + * @returns access token */ public signAccessToken(payload: AuthPayload): string { return jwt.sign(payload, this.accessSecret, { @@ -57,9 +55,8 @@ export default class AuthService { /** * Verifies access token - * * @param token - access token - * @returns {AuthPayload} payload + * @returns payload */ public verifyAccessToken(token: string): AuthPayload { return jwt.verify(token, this.accessSecret, { complete: false }) as AuthPayload; @@ -67,9 +64,8 @@ export default class AuthService { /** * Generates refresh token - * * @param userId - user to sign refresh token for - * @returns {Promise} refresh token + * @returns refresh token */ public async signRefreshToken(userId: number): Promise { const tokenSize = 10; @@ -86,9 +82,8 @@ export default class AuthService { /** * Check if refresh token is valid - * * @param token - refresh token to check - * @returns {Promise} user session if session is valid + * @returns user session if session is valid */ public async verifyRefreshToken(token: string): Promise { const session = await this.userSessionRepository.getUserSessionByRefreshToken(token); @@ -114,7 +109,6 @@ export default class AuthService { /** * Removes session by refresh token - * * @param token - refresh token */ public async removeSessionByRefreshToken(token: string): Promise { diff --git a/src/domain/service/editorTools.ts b/src/domain/service/editorTools.ts index c04625ac4..f4cd10f68 100644 --- a/src/domain/service/editorTools.ts +++ b/src/domain/service/editorTools.ts @@ -15,7 +15,6 @@ export default class EditorToolsService implements EditorToolsServiceSharedMetho /** * Editor tools service constructor - * * @param repository - user repository instance */ constructor(repository: EditorToolsRepository) { @@ -23,7 +22,7 @@ export default class EditorToolsService implements EditorToolsServiceSharedMetho } /** - * @returns {Promise} all available editor tools + * @returns all available editor tools */ public async getTools(): Promise { return await this.repository.getTools(); @@ -31,7 +30,6 @@ export default class EditorToolsService implements EditorToolsServiceSharedMetho /** * Get bunch of editor tools by their ids - * * @param editorToolIds - tool ids */ public async getToolsByIds(editorToolIds: EditorTool['id'][]): Promise { @@ -40,7 +38,6 @@ export default class EditorToolsService implements EditorToolsServiceSharedMetho /** * Get tool by it's identifier - * * @param editorToolId - unique tool identifier */ public async getToolById(editorToolId: EditorTool['id']): Promise { @@ -56,10 +53,9 @@ export default class EditorToolsService implements EditorToolsServiceSharedMetho /** * Adding custom editor tool - * * @param editorTool - all data about the editor plugin * @param userId - user identifier - * @returns {Promise} editor tool data + * @returns editor tool data */ public async addTool(editorTool: Omit, userId: User['id']): Promise { return await this.repository.addTool({ diff --git a/src/domain/service/fileUploader.service.ts b/src/domain/service/fileUploader.service.ts index 280dd9770..066ba1cc4 100644 --- a/src/domain/service/fileUploader.service.ts +++ b/src/domain/service/fileUploader.service.ts @@ -41,7 +41,6 @@ export default class FileUploaderService { /** * File uploader service constructor - * * @param objectRepository - repository for objects * @param fileRepository - repository for files data */ @@ -52,7 +51,6 @@ export default class FileUploaderService { /** * Upload file - * * @param fileData - file data, including file data, name and mimetype * @param location - file location depending on type * @param metadata - file metadata, including user id who uploaded the file @@ -103,7 +101,6 @@ export default class FileUploaderService { /** * Get file location by key and type * Returns null if where is no such file - * * @param type - file type * @param key - file unique key */ @@ -113,7 +110,6 @@ export default class FileUploaderService { /** * Get file data by key - * * @param objectKey - unique file key in object storage * @param location - file location */ @@ -147,10 +143,8 @@ export default class FileUploaderService { return fileData; } - /** * Define file type by location - * * @param location - file location */ private defineFileType(location: FileLocation): FileType { @@ -163,7 +157,6 @@ export default class FileUploaderService { /** * Check if file location is note attachemnt - * * @param location - to check */ private isNoteAttachemntFileLocation(location: FileLocation): location is NoteAttachmentFileLocation { @@ -172,7 +165,6 @@ export default class FileUploaderService { /** * Define bucket name by file type - * * @param fileType - file type */ private defineBucketByFileType(fileType: FileType): string { diff --git a/src/domain/service/note.ts b/src/domain/service/note.ts index ccaf32805..ee42141ec 100644 --- a/src/domain/service/note.ts +++ b/src/domain/service/note.ts @@ -40,7 +40,6 @@ export default class NoteService { /** * Note service constructor - * * @param noteRepository - note repository * @param noteRelationsRepository - note relationship repository * @param noteVisitsRepository - note visits repository @@ -55,12 +54,11 @@ export default class NoteService { /** * Adds note - * * @param content - note content * @param creatorId - note creator * @param parentPublicId - parent note if exist * @param tools - editor tools that were used in a note content - * @returns { Note } added note object + * @returns added note object */ public async addNote(content: Note['content'], creatorId: Note['creatorId'], parentPublicId: Note['publicId'] | undefined, tools: Note['tools']): Promise { const note = await this.noteRepository.addNote({ @@ -88,7 +86,6 @@ export default class NoteService { */ /** * Deletes note by id - * * @param id - note internal id */ public async deleteNoteById(id: NoteInternalId): Promise { @@ -117,7 +114,6 @@ export default class NoteService { /** * Updates a note - * * @param id - note internal id * @param content - new content * @param noteTools - tools which are used in note @@ -134,7 +130,6 @@ export default class NoteService { /** * Unlink parent note from the current note - * * @param noteId - id of note to unlink parent */ public async unlinkParent(noteId: NoteInternalId): Promise { @@ -143,7 +138,6 @@ export default class NoteService { /** * Returns note by id - * * @param id - note internal id */ public async getNoteById(id: NoteInternalId): Promise { @@ -158,7 +152,6 @@ export default class NoteService { /** * Returns note by public id - * * @param publicId - note public id */ public async getNoteByPublicId(publicId: NotePublicId): Promise { @@ -173,9 +166,8 @@ export default class NoteService { /** * Gets note by custom hostname - * * @param hostname - hostname - * @returns { Promise } note + * @returns note */ public async getNoteByHostname(hostname: string): Promise { return await this.noteRepository.getNoteByHostname(hostname); @@ -183,7 +175,6 @@ export default class NoteService { /** * Get parent note id by note id - * * @param noteId - id of the current note */ public async getParentNoteIdByNoteId(noteId: NoteInternalId): Promise { @@ -192,7 +183,6 @@ export default class NoteService { /** * Returns note list by creator id - * * @param userId - id of the user * @param page - number of current page * @returns list of the notes ordered by time of last visit @@ -207,7 +197,6 @@ export default class NoteService { /** * Update note relation - * * @param noteId - id of the current note * @param parentPublicId - id of the new parent note */ @@ -236,12 +225,11 @@ export default class NoteService { /** * Raise domain error if tools, that are in note content are not specified in tools array - * * @param tools - editor tools that were used in a note content * @param content - content of the note * @todo validate tool ids */ - public async validateNoteTools(tools : Note['tools'], content: Note['content'] | Record): Promise { + public async validateNoteTools(tools: Note['tools'], content: Note['content'] | Record): Promise { /** * Set of the tools that are used in note */ diff --git a/src/domain/service/noteSettings.ts b/src/domain/service/noteSettings.ts index 5832bf223..b43efc4bb 100644 --- a/src/domain/service/noteSettings.ts +++ b/src/domain/service/noteSettings.ts @@ -23,7 +23,6 @@ export default class NoteSettingsService { /** * Note Settings service constructor - * * @param noteSettingsRepository - note settings repository * @param teamRepository - team repository * @param shared - shared domain methods @@ -35,7 +34,6 @@ export default class NoteSettingsService { /** * Add user to the team by invitation hash - * * @param invitationHash - hash for joining to the team * @param userId - user to add */ @@ -68,7 +66,6 @@ export default class NoteSettingsService { /** * Returns settings for a note with all team members - * * @param id - note internal id */ public async getNoteSettingsByNoteId(id: NoteInternalId): Promise { @@ -85,7 +82,6 @@ export default class NoteSettingsService { /** * Adds note settings - * * @param noteId - note id * @param isPublic - is note public * @returns added note settings @@ -100,7 +96,6 @@ export default class NoteSettingsService { /** * Partially updates note settings - * * @param noteId - note internal id * @param data - note settings data with new values * @returns updated note settings @@ -118,7 +113,6 @@ export default class NoteSettingsService { /** * Get user role in team by user id and note id * If user is not a member of note, return null - * * @param userId - user id to check his role * @param noteId - note id where user should have role */ @@ -130,7 +124,6 @@ export default class NoteSettingsService { /** * Get all team members by note id - * * @param noteId - note id to get all team members * @returns team members */ @@ -152,7 +145,6 @@ export default class NoteSettingsService { /** * Remove team member by userId and noteId - * * @param userId - id of team member * @param noteId - note internal id * @returns returns userId if team member was deleted and undefined overwise @@ -163,7 +155,6 @@ export default class NoteSettingsService { /** * Creates team member - * * @param team - data for team member creation * @returns created team member */ @@ -173,7 +164,6 @@ export default class NoteSettingsService { /** * Updates invitation hash in note settings - * * @param noteId - note internal id * @returns updated note settings */ @@ -194,7 +184,6 @@ export default class NoteSettingsService { /** * Patch team member role by user and note id - * * @param id - userId of team member * @param noteId - note internal id * @param role - new team member role diff --git a/src/domain/service/noteVisits.ts b/src/domain/service/noteVisits.ts index 3794a1868..398c51e84 100644 --- a/src/domain/service/noteVisits.ts +++ b/src/domain/service/noteVisits.ts @@ -15,7 +15,6 @@ export default class NoteVisitsService { /** * NoteVisits service constructor - * * @param noteVisitRepository - note Visits repository */ constructor(noteVisitRepository: NoteVisitsRepository) { @@ -24,7 +23,6 @@ export default class NoteVisitsService { /** * Updates existing noteVisit's visitedAt or creates new record if user opens note for the first time - * * @param noteId - note internal id * @param userId - id of the user */ @@ -34,10 +32,9 @@ export default class NoteVisitsService { /** * Deletes all visits of the note when a note is deleted - * * @param noteId - note internal id */ public async deleteNoteVisits(noteId: NoteInternalId): Promise { return await this.noteVisitsRepository.deleteNoteVisits(noteId); } -} \ No newline at end of file +} diff --git a/src/domain/service/shared/editorTools.ts b/src/domain/service/shared/editorTools.ts index 4e15cbdee..6a0712a90 100644 --- a/src/domain/service/shared/editorTools.ts +++ b/src/domain/service/shared/editorTools.ts @@ -4,7 +4,7 @@ import type EditorTool from '@domain/entities/editorTools.js'; * Which methods of Domain can be used by other domains * Uses to decouple domains from each other */ -export default interface EditorToolsServiceSharedMethods { +export default interface EditorToolsServiceSharedMethods { /** * Return tools that are available at Editor by default */ @@ -12,14 +12,12 @@ export default interface EditorToolsServiceSharedMethods { /** * Get bunch of editor tools by their ids - * * @param ids - tool ids to resolve */ getToolsByIds(ids: EditorTool['id'][]): Promise; /** * Get tool by it's identifier - * * @param id - unique tool identifier */ getToolById(id: EditorTool['id']): Promise; diff --git a/src/domain/service/shared/note.ts b/src/domain/service/shared/note.ts index f4e0640fe..0c0acff42 100644 --- a/src/domain/service/shared/note.ts +++ b/src/domain/service/shared/note.ts @@ -8,8 +8,7 @@ import type { NoteInternalId } from '@domain/entities/note.js'; export default interface NoteServiceSharedMethods { /** * Get parent note id by note id - * * @param noteId - id of the current note */ getParentNoteIdByNoteId(noteId: NoteInternalId): Promise; -} \ No newline at end of file +} diff --git a/src/domain/service/user.ts b/src/domain/service/user.ts index 60910bb99..0624b3b06 100644 --- a/src/domain/service/user.ts +++ b/src/domain/service/user.ts @@ -20,7 +20,6 @@ export default class UserService { /** * User service constructor - * * @param repository - user repository instance * @param shared - shared domain methods */ @@ -30,9 +29,8 @@ export default class UserService { /** * Get user by it's identifier - * * @param userId - unique user identifier - * @returns { Promise } found user + * @returns found user */ public async getUserById(userId: User['id']): Promise { return await this.repository.getUserById(userId); @@ -40,10 +38,9 @@ export default class UserService { /** * Get user by provider - * * @param accessToken - provider access token * @param provider - provider - * @returns { Promise } found user + * @returns found user */ public async getUserByProvider(accessToken: string, provider: Provider): Promise { return await this.repository.getOrCreateUserByProvider(accessToken, provider); @@ -51,7 +48,6 @@ export default class UserService { /** * Get user editor tools ids - * * @param userId - user unique identifier */ public async getUserEditorTools(userId: User['id']): Promise { @@ -68,7 +64,6 @@ export default class UserService { /** * Combine user tools and default tools - * * @todo load tools in notes service */ return [...userTools, ...uniqueDefaultEditorTools]; @@ -76,17 +71,16 @@ export default class UserService { /** * Adds editor tool to user settings by its id - * * @param options - user id & editor tool */ public async addUserEditorTool({ userId, toolId, }: { - userId: User['id'], - toolId: EditorTool['id'], + userId: User['id']; + toolId: EditorTool['id']; }): Promise { - const toolToAdd = await this.shared.editorTools.getToolById(toolId); + const toolToAdd = await this.shared.editorTools.getToolById(toolId); if (toolToAdd === null) { throw new DomainError('Editor tool not found'); @@ -102,15 +96,14 @@ export default class UserService { /** * Removes editor tool from user settings by its id - * * @param options - user id & editor tool */ public async removeUserEditorTool({ userId, toolId, }: { - userId: User['id'], - toolId: EditorTool['id'], + userId: User['id']; + toolId: EditorTool['id']; }): Promise { return await this.repository.removeUserEditorTool({ userId, diff --git a/src/index.ts b/src/index.ts index 4a6ebff77..5a0cffac5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,6 +4,7 @@ import API from '@presentation/index.js'; import runMetricsServer from '@infrastructure/metrics/index.js'; import { init as initDomainServices } from '@domain/index.js'; import { initORM, init as initRepositories } from '@repository/index.js'; +import process from 'process'; /** * Application entry point @@ -24,7 +25,8 @@ const start = async (): Promise => { logger.info('Application launched successfully'); } catch (err) { - logger.fatal('Failed to start application ' + err); + logger.fatal('Failed to start application ' + (err as Error).toString()); + /* eslint-disable-next-line n/no-process-exit */ process.exit(1); } }; @@ -32,7 +34,7 @@ const start = async (): Promise => { try { await start(); } catch (err) { - logger.fatal('Failed to start application ' + err); + logger.fatal('Failed to start application ' + (err as Error).toString()); + /* eslint-disable-next-line n/no-process-exit */ process.exit(1); } - diff --git a/src/infrastructure/config/index.ts b/src/infrastructure/config/index.ts index b78ff57e3..cfd565f62 100644 --- a/src/infrastructure/config/index.ts +++ b/src/infrastructure/config/index.ts @@ -175,12 +175,12 @@ const defaultConfig: AppConfig = { }; const args = arg({ /* eslint-disable @typescript-eslint/naming-convention */ - '--config': [ String ], + '--config': [String], '-c': '--config', }); const cwd = process.cwd(); -const paths = (args['--config'] || [ './app-config.yaml' ]).map((configPath) => { +const paths = (args['--config'] || ['./app-config.yaml']).map((configPath) => { if (path.isAbsolute(configPath)) { return configPath; } diff --git a/src/infrastructure/logging/index.ts b/src/infrastructure/logging/index.ts index 7a64f6df2..df06d6b0d 100644 --- a/src/infrastructure/logging/index.ts +++ b/src/infrastructure/logging/index.ts @@ -6,19 +6,18 @@ import appConfig from '../config/index.js'; const loggerConfig = process.env['NODE_ENV'] === 'production' ? {} : { - transport: { - target: 'pino-pretty', - options: { - colorize: true, + transport: { + target: 'pino-pretty', + options: { + colorize: true, + }, }, - }, - }; + }; const rootLogger = pino(loggerConfig); /** * Creates child logger and returns it. - * * @param moduleName - name of the module that is logging */ export function getLogger(moduleName: keyof LoggingConfig): pino.Logger { diff --git a/src/infrastructure/metrics/index.ts b/src/infrastructure/metrics/index.ts index 0450cc676..3fa0f36e3 100644 --- a/src/infrastructure/metrics/index.ts +++ b/src/infrastructure/metrics/index.ts @@ -3,6 +3,7 @@ import promClient from 'prom-client'; import { getLogger } from '@infrastructure/logging/index.js'; import config from '@infrastructure/config/index.js'; import { StatusCodes } from 'http-status-codes'; +import process from 'process'; const collectDefaultMetrics = promClient.collectDefaultMetrics; const Registry = promClient.Registry; diff --git a/src/infrastructure/utils/empty.ts b/src/infrastructure/utils/empty.ts index a579d5ece..7ef1313f8 100644 --- a/src/infrastructure/utils/empty.ts +++ b/src/infrastructure/utils/empty.ts @@ -1,6 +1,5 @@ /** * True if passed variable is not null/undefined/''/{} - * * @param v value to check */ export function notEmpty(v: T | undefined | null | object): v is T { @@ -9,7 +8,6 @@ export function notEmpty(v: T | undefined | null | object): v is T { /** * True if passed variable is null/undefined/''/{} - * * @param v value to check */ export function isEmpty(v: unknown): v is null | undefined | '' | Record { diff --git a/src/infrastructure/utils/hasProperty.ts b/src/infrastructure/utils/hasProperty.ts index 9530d2453..d58999d29 100644 --- a/src/infrastructure/utils/hasProperty.ts +++ b/src/infrastructure/utils/hasProperty.ts @@ -1,9 +1,8 @@ /** * Checks if passed variable is an object and has a property with passed name - * * @param obj - object to check * @param name - property name */ export default function hasProperty(obj: Obj, name: Name): obj is Obj & Record { return typeof obj === 'object' && obj !== null && name in obj; -} \ No newline at end of file +} diff --git a/src/infrastructure/utils/id.ts b/src/infrastructure/utils/id.ts index dd8677bfe..8111c3a59 100644 --- a/src/infrastructure/utils/id.ts +++ b/src/infrastructure/utils/id.ts @@ -3,7 +3,6 @@ import { nanoid } from 'nanoid'; /** * Creates public id visible for users * Used to access a Note via API - * * @param length - length of public id */ export function createPublicId(length: number = 10): string { @@ -13,7 +12,6 @@ export function createPublicId(length: number = 10): string { /** * Create unique identifier for editor tools * Used in editor tools and user settings - * * @param length - id length */ export function createEditorToolId(length: number = 8): string { @@ -22,7 +20,6 @@ export function createEditorToolId(length: number = 8): string { /** * Create unique identifier for file - * * @param length - id length */ export function createFileId(length: number = 8): string { diff --git a/src/infrastructure/utils/invitationHash.ts b/src/infrastructure/utils/invitationHash.ts index d2d52d4d6..c76f344e8 100644 --- a/src/infrastructure/utils/invitationHash.ts +++ b/src/infrastructure/utils/invitationHash.ts @@ -3,7 +3,6 @@ import { nanoid } from 'nanoid'; /** * Create invitation hash * Used to invite users to team - * * @param length - length of invitation hash */ export function createInvitationHash(length: number = 10): string { diff --git a/src/presentation/api.interface.ts b/src/presentation/api.interface.ts index 6db440cc7..064ff8e6b 100644 --- a/src/presentation/api.interface.ts +++ b/src/presentation/api.interface.ts @@ -1,5 +1,6 @@ import type { DomainServices } from '@domain/index.js'; import type * as http from 'http'; +import type { Buffer } from 'buffer'; /** * API interface @@ -8,7 +9,6 @@ export default interface Api { /** * Initializes http server - * * @param domainServices - instances of domain services */ init(domainServices: DomainServices): Promise; @@ -21,13 +21,11 @@ export default interface Api { /** * Makes fake request to API. * Used for API testing - * * @param params - request params */ fakeRequest(params: RequestParams): Promise; } - /** * Fake request params */ @@ -35,31 +33,29 @@ export interface RequestParams { /** * Request method */ - method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH', + method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH'; /** * Request url */ - url: string, + url: string; /** * Request headers */ - headers?: http.IncomingHttpHeaders | http.OutgoingHttpHeaders, + headers?: http.IncomingHttpHeaders | http.OutgoingHttpHeaders; /** * Request body */ - /* eslint-disable-next-line no-undef */ - body?: string | object | Buffer | NodeJS.ReadableStream, + body?: string | object | Buffer | NodeJS.ReadableStream; /** * Request cookies */ - cookies?: { [k: string]: string } + cookies?: { [k: string]: string }; } - /** * Fake request response structure */ @@ -67,21 +63,21 @@ export interface Response { /** * Response status code */ - statusCode: number, + statusCode: number; /** * Response body */ - body: string, + body: string; /** * Response headers */ - headers: http.OutgoingHttpHeaders, + headers: http.OutgoingHttpHeaders; /** * Converts body to json */ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ - json: () => T + json: () => T; } diff --git a/src/presentation/http/decorators/domainError.ts b/src/presentation/http/decorators/domainError.ts index 05df3ff57..1c825b2fa 100644 --- a/src/presentation/http/decorators/domainError.ts +++ b/src/presentation/http/decorators/domainError.ts @@ -5,7 +5,6 @@ import type { FastifyReply } from 'fastify'; * Custom method for replying with information that business logic dismissed the request for some reason * * Send this error when a domain-level error is thrown - * * @example * * try { @@ -17,7 +16,6 @@ import type { FastifyReply } from 'fastify'; * } * throw error; * } - * * @param message - Optional message to send. If not specified, default message will be sent */ export default async function domainError(this: FastifyReply, message = 'Domain level error'): Promise { @@ -27,4 +25,4 @@ export default async function domainError(this: FastifyReply, message = 'Domain .send({ message, }); -} \ No newline at end of file +} diff --git a/src/presentation/http/decorators/forbidden.ts b/src/presentation/http/decorators/forbidden.ts index e67a0f0d4..76f0606fd 100644 --- a/src/presentation/http/decorators/forbidden.ts +++ b/src/presentation/http/decorators/forbidden.ts @@ -5,13 +5,11 @@ import type { FastifyReply } from 'fastify'; * Custom method for sending 403 error * * Send this error when USER IS AUTHENTICATED, but he doesn't have access to the resource - * * @example * * if (note.creatorId !== userId) { * return reply.forbidden('You don\'t have access to this note'); * } - * * @param message - custom message */ export default async function forbidden(this: FastifyReply, message = 'Permission denied'): Promise { diff --git a/src/presentation/http/decorators/notAcceptable.ts b/src/presentation/http/decorators/notAcceptable.ts index b13c21769..f7a71843f 100644 --- a/src/presentation/http/decorators/notAcceptable.ts +++ b/src/presentation/http/decorators/notAcceptable.ts @@ -5,13 +5,11 @@ import type { FastifyReply } from 'fastify'; * "406 Not Acceptable" helper * * This response is sent when the web server, after performing server-driven content negotiation, doesn't find any content following the criteria given by the user agent. - * * @example * * if (note === null) { * return reply.notAcceptable('Note not found'); * } - * * @param message - custom message */ export default async function notAcceptable(this: FastifyReply, message = 'Resource not found'): Promise { diff --git a/src/presentation/http/decorators/notFound.ts b/src/presentation/http/decorators/notFound.ts index 055414026..7db601419 100644 --- a/src/presentation/http/decorators/notFound.ts +++ b/src/presentation/http/decorators/notFound.ts @@ -3,13 +3,11 @@ import type { FastifyReply } from 'fastify'; /** * Custom method for sending 404 error - * * @example * * if (note === null) { * return reply.notFound('Note not found'); * } - * * @param message - custom message */ export default async function notFound(this: FastifyReply, message = 'Not found'): Promise { diff --git a/src/presentation/http/decorators/unauthorized.ts b/src/presentation/http/decorators/unauthorized.ts index 4263a7f07..1bd595d27 100644 --- a/src/presentation/http/decorators/unauthorized.ts +++ b/src/presentation/http/decorators/unauthorized.ts @@ -5,13 +5,11 @@ import type { FastifyReply } from 'fastify'; * Custom method for sending 401 error * * Send this error when USER IS NOT AUTHENTICATED and he doesn't have access to the resource because of that - * * @example * * if (userId === null) { * return reply.unauthorized('You must be authenticated to access this resource'); * } - * * @param message - custom message */ export default async function unauthorized(this: FastifyReply, message = 'You must be authenticated to access this resource'): Promise { diff --git a/src/presentation/http/fastify.d.ts b/src/presentation/http/fastify.d.ts index c2cd047d4..db57f9463 100644 --- a/src/presentation/http/fastify.d.ts +++ b/src/presentation/http/fastify.d.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */ +/* eslint-disable @typescript-eslint/no-unused-vars */ import type * as fastify from 'fastify'; import type * as http from 'http'; import type { pino } from 'pino'; @@ -14,7 +14,7 @@ declare module 'fastify' { RawRequest extends fastify.RawRequestDefaultExpression = fastify.RawRequestDefaultExpression, RawReply extends fastify.RawReplyDefaultExpression = fastify.RawReplyDefaultExpression, Logger extends fastify.FastifyBaseLogger = fastify.FastifyBaseLogger, - TypeProvider extends fastify.FastifyTypeProvider = fastify.FastifyTypeProviderDefault, + TypeProvider extends fastify.FastifyTypeProvider = fastify.FastifyTypeProviderDefault > { // put here your custom properties and methods of fastify server instance added by decorators } @@ -29,7 +29,6 @@ declare module 'fastify' { export interface FastifyContextConfig { /** * Policy names to apply to the route - * * @example * * fastify.post('/note', { @@ -81,13 +80,11 @@ declare module 'fastify' { export interface FastifyReply { /** * Custom method for sending 404 error - * * @example * * if (note === null) { * return reply.notFound('Note not found'); * } - * * @param message - Optional message to send. If not specified, default message will be sent */ notFound: (message?: string) => Promise; @@ -96,13 +93,11 @@ declare module 'fastify' { * Custom method for sending 403 error * * Send this error when USER IS AUTHENTICATED, but he doesn't have access to the resource - * * @example * * if (note.creatorId !== userId) { * return reply.forbidden('You don\'t have access to this note'); * } - * * @param message - Optional message to send. If not specified, default message will be sent */ forbidden: (message?: string) => Promise; @@ -111,13 +106,11 @@ declare module 'fastify' { * Custom method for sending 401 error * * Send this error when USER IS NOT AUTHENTICATED and he doesn't have access to the resource because of that - * * @example * * if (userId === null) { * return reply.unauthorized('You must be authenticated to access this resource'); * } - * * @param message - Optional message to send. If not specified, default message will be sent */ unauthorized: (message?: string) => Promise; @@ -126,13 +119,11 @@ declare module 'fastify' { * Custom method for sending 406 error * * This response is sent when the web server, after performing server-driven content negotiation, doesn't find any content following the criteria given by the user agent. - * * @example * * if (note === null) { * return reply.notAcceptable('Note not found'); * } - * * @param message - Optional message to send. If not specified, default message will be sent */ notAcceptable: (message?: string) => Promise; @@ -141,7 +132,6 @@ declare module 'fastify' { * Custom method for replying with information that business logic dismissed the request for some reason * * Send this error when a domain-level error is thrown - * * @example * * try { @@ -153,7 +143,6 @@ declare module 'fastify' { * } * throw error; * } - * * @param message - Optional message to send. If not specified, default message will be sent */ domainError: (message?: string) => Promise; diff --git a/src/presentation/http/http-api.ts b/src/presentation/http/http-api.ts index 6a5f72cf0..1e7fbb784 100644 --- a/src/presentation/http/http-api.ts +++ b/src/presentation/http/http-api.ts @@ -33,7 +33,6 @@ import UploadRouter from './router/upload.js'; import { ajvFilePlugin } from '@fastify/multipart'; import { UploadSchema } from './schema/Upload.js'; - const appServerLogger = getLogger('appServer'); /** @@ -47,14 +46,12 @@ export default class HttpApi implements Api { /** * Constructs the instance - * * @param config - http server config */ constructor(private readonly config: HttpApiConfig) { } /** * Initializes http server - * * @param domainServices - instances of domain services */ public async init(domainServices: DomainServices): Promise { @@ -72,12 +69,11 @@ export default class HttpApi implements Api { * To guarantee consistent and predictable behavior, * it's highly recommended to always load plugins in order as shown below: * - * └── plugins (from the Fastify ecosystem) - * └── your plugins (your custom plugins) - * └── decorators - * └── hooks - * └── your services - * + * └── plugins (from the Fastify ecosystem) + * └── your plugins (your custom plugins) + * └── decorators + * └── hooks + * └── your services * @see https://fastify.dev/docs/latest/Guides/Getting-Started#loading-order-of-your-plugins */ this.domainErrorHandler(); @@ -97,7 +93,6 @@ export default class HttpApi implements Api { await this.addApiRoutes(domainServices); } - /** * Runs http server */ @@ -115,11 +110,10 @@ export default class HttpApi implements Api { /** * Performs fake request to API routes. * Used for API testing - * * @param params - request options */ public async fakeRequest(params: RequestParams): Promise { - const response = await this.server?.inject(params); + const response = await this.server?.inject(params); if (response === undefined) { return; @@ -145,13 +139,13 @@ export default class HttpApi implements Api { description: 'Fastify REST API', version: '0.1.0', }, - servers: [ { + servers: [{ url: 'http://localhost:1337', description: 'Localhost environment', }, { url: 'https://api.notex.so', description: 'Production environment', - } ], + }], components: { securitySchemes: { oAuthGoogle: { @@ -161,7 +155,7 @@ export default class HttpApi implements Api { authorizationCode: { authorizationUrl: 'https://api.notex.so/oauth/google/login', scopes: { - 'notesManagement': 'Create, read, update and delete notes', + notesManagement: 'Create, read, update and delete notes', }, tokenUrl: 'https://api.notex.so/oauth/google/callback', }, @@ -198,7 +192,6 @@ export default class HttpApi implements Api { /** * Registers all routers - * * @param domainServices - instances of domain services */ private async addApiRoutes(domainServices: DomainServices): Promise { @@ -319,7 +312,6 @@ export default class HttpApi implements Api { /** * Add middlewares - * * @param domainServices - instances of domain services */ private addCommonMiddlewares(domainServices: DomainServices): void { @@ -332,7 +324,6 @@ export default class HttpApi implements Api { /** * Add "onRoute" hook that will add "preHandler" checking policies passed through the route config - * * @param domainServices - instances of domain services */ private addPoliciesCheckHook(domainServices: DomainServices): void { @@ -348,14 +339,13 @@ export default class HttpApi implements Api { */ if (routeOptions.preHandler === undefined) { routeOptions.preHandler = []; - } else if (!Array.isArray(routeOptions.preHandler) ) { - routeOptions.preHandler = [ routeOptions.preHandler ]; + } else if (!Array.isArray(routeOptions.preHandler)) { + routeOptions.preHandler = [routeOptions.preHandler]; } routeOptions.preHandler.push(async (request, reply) => { for (const policy of policies) { - await Policies[policy]({ - request, + await Policies[policy]({ request, reply, domainServices }); } diff --git a/src/presentation/http/middlewares/common/userIdResolver.ts b/src/presentation/http/middlewares/common/userIdResolver.ts index a3771b764..941a05284 100644 --- a/src/presentation/http/middlewares/common/userIdResolver.ts +++ b/src/presentation/http/middlewares/common/userIdResolver.ts @@ -5,12 +5,11 @@ import { notEmpty } from '@infrastructure/utils/empty.js'; /** * Add middleware for resolve userId from Access Token and add it to request - * * @param server - fastify instance * @param authService - auth domain service * @param logger - logger instance */ -export default function addUserIdResolver(server: FastifyInstance, authService: AuthService, logger: typeof Logger ): void { +export default function addUserIdResolver(server: FastifyInstance, authService: AuthService, logger: typeof Logger): void { /** * Default userId value — null */ diff --git a/src/presentation/http/middlewares/note/useNoteResolver.ts b/src/presentation/http/middlewares/note/useNoteResolver.ts index 02d9a877c..73ae1da35 100644 --- a/src/presentation/http/middlewares/note/useNoteResolver.ts +++ b/src/presentation/http/middlewares/note/useNoteResolver.ts @@ -8,7 +8,6 @@ import type { Note, NotePublicId } from '@domain/entities/note.js'; /** * Add middleware for resolve Note by public id and add it to request - * * @param noteService - note domain service */ export default function useNoteResolver(noteService: NoteService): { @@ -26,10 +25,9 @@ export default function useNoteResolver(noteService: NoteService): { /** * Search for Note by public id in passed payload and resolves a note by it - * * @param requestData - fastify request data. Can be query, params or body */ - async function resolveNoteByPublicId(requestData: FastifyRequest['query'] | FastifyRequest['body'] | FastifyRequest['params']): Promise { + async function resolveNoteByPublicId(requestData: FastifyRequest['query']): Promise { /** * Request params validation */ diff --git a/src/presentation/http/middlewares/noteSettings/useMemberRoleResolver.ts b/src/presentation/http/middlewares/noteSettings/useMemberRoleResolver.ts index 932c88bd1..8e8df4a3c 100644 --- a/src/presentation/http/middlewares/noteSettings/useMemberRoleResolver.ts +++ b/src/presentation/http/middlewares/noteSettings/useMemberRoleResolver.ts @@ -6,16 +6,15 @@ import { isEmpty } from '@infrastructure/utils/empty.js'; /** * Add middleware to resolve Member's role in a team by user id and note id and add it to request - * * @param noteSettingsService - note settings domain service */ export default function useMemberRoleResolver(noteSettingsService: NoteSettingsService): { - /** - * Resolve Member's role in a team by user id and note id and add it to request - * - * Use this middleware as "preHandler" hook with a particular route - */ - memberRoleResolver: preHandlerHookHandler; + /** + * Resolve Member's role in a team by user id and note id and add it to request + * + * Use this middleware as "preHandler" hook with a particular route + */ + memberRoleResolver: preHandlerHookHandler; } { /** * Get logger instance diff --git a/src/presentation/http/middlewares/noteSettings/useNoteSettingsResolver.ts b/src/presentation/http/middlewares/noteSettings/useNoteSettingsResolver.ts index 07e637004..287933dda 100644 --- a/src/presentation/http/middlewares/noteSettings/useNoteSettingsResolver.ts +++ b/src/presentation/http/middlewares/noteSettings/useNoteSettingsResolver.ts @@ -5,16 +5,15 @@ import type NoteSettings from '@domain/entities/noteSettings.js'; /** * Add middleware for resolve Note settings and add it to request - * * @param noteSettingsService - note settings domain service */ export default function useNoteSettingsResolver(noteSettingsService: NoteSettingsService): { - /** - * Resolve Note settings by note and add it to request - * - * Use this middleware as "preHandler" hook with a particular route - */ - noteSettingsResolver: preHandlerHookHandler; + /** + * Resolve Note settings by note and add it to request + * + * Use this middleware as "preHandler" hook with a particular route + */ + noteSettingsResolver: preHandlerHookHandler; } { /** * Get logger instance diff --git a/src/presentation/http/policies/authRequired.ts b/src/presentation/http/policies/authRequired.ts index 6c3823365..785fe2068 100644 --- a/src/presentation/http/policies/authRequired.ts +++ b/src/presentation/http/policies/authRequired.ts @@ -2,7 +2,6 @@ import type { PolicyContext } from '@presentation/http/types/PolicyContext.js'; /** * Policy to enforce user to be logged in - * * @param context - Context object, containing Fatify request, Fastify reply and domain services */ export default async function authRequired(context: PolicyContext): Promise { diff --git a/src/presentation/http/policies/notePublicOrUserInTeam.ts b/src/presentation/http/policies/notePublicOrUserInTeam.ts index d88146a8b..8ece52ee5 100644 --- a/src/presentation/http/policies/notePublicOrUserInTeam.ts +++ b/src/presentation/http/policies/notePublicOrUserInTeam.ts @@ -4,7 +4,6 @@ import type { PolicyContext } from '@presentation/http/types/PolicyContext.js'; /** * Policy to check does user have permission to access note - * * @param context - Context, object containing Fatify request, Fastify reply and domain services */ export default async function notePublicOrUserInTeam(context: PolicyContext): Promise { diff --git a/src/presentation/http/policies/userCanEdit.ts b/src/presentation/http/policies/userCanEdit.ts index 1259a3f6a..93b6e800a 100644 --- a/src/presentation/http/policies/userCanEdit.ts +++ b/src/presentation/http/policies/userCanEdit.ts @@ -4,7 +4,6 @@ import type { PolicyContext } from '@presentation/http/types/PolicyContext.js'; /** * Policy to check whether a user has permission to edit the note - * * @param context - Context object, containing Fatify request, Fastify reply and domain services */ export default async function userCanEdit(context: PolicyContext): Promise { diff --git a/src/presentation/http/router/ai.ts b/src/presentation/http/router/ai.ts index addb94763..98d204e85 100644 --- a/src/presentation/http/router/ai.ts +++ b/src/presentation/http/router/ai.ts @@ -8,19 +8,18 @@ interface AIRouterOptions { /** * AI service instance */ - aiService: AIService + aiService: AIService; } /** * Get completion request params */ interface GetCompletionOptions { - content: string + content: string; } /** * Ai Router plugin - * * @param fastify - fastify instance * @param opts - router options * @param done - done callback diff --git a/src/presentation/http/router/auth.test.ts b/src/presentation/http/router/auth.test.ts index 6fdcc7934..c04a49e61 100644 --- a/src/presentation/http/router/auth.test.ts +++ b/src/presentation/http/router/auth.test.ts @@ -58,14 +58,14 @@ describe('Auth API', () => { const response = await global.api?.fakeRequest({ method: 'POST', url: '/auth', - body:{ token: outdatedToken }, + body: { token: outdatedToken }, }); expect(response?.statusCode).toBe(401); const body = await response?.json(); - expect(body).toStrictEqual({ message:'Session is not valid' }); + expect(body).toStrictEqual({ message: 'Session is not valid' }); }); }); }); diff --git a/src/presentation/http/router/auth.ts b/src/presentation/http/router/auth.ts index 724ef80d0..48c816ad2 100644 --- a/src/presentation/http/router/auth.ts +++ b/src/presentation/http/router/auth.ts @@ -22,12 +22,11 @@ interface AuthRouterOptions { /** * Auth service instance */ - authService: AuthService, + authService: AuthService; } /** * Auth router plugin - * * @param fastify - fastify instance * @param opts - router options * @param done - callback @@ -43,7 +42,7 @@ const AuthRouter: FastifyPluginCallback = (fastify, opts, don { schema: { body: { - required: [ 'token' ], + required: ['token'], properties: { token: { type: 'string', @@ -93,7 +92,7 @@ const AuthRouter: FastifyPluginCallback = (fastify, opts, don */ fastify.delete<{ Body: AuthOptions; - Reply: { ok: boolean } + Reply: { ok: boolean }; }>('/', { schema: { body: { @@ -107,7 +106,7 @@ const AuthRouter: FastifyPluginCallback = (fastify, opts, don description: 'Check for successful deletion of the token', content: { 'application/json': { - schema:{ + schema: { ok: { type: 'boolean', }, diff --git a/src/presentation/http/router/editorTools.ts b/src/presentation/http/router/editorTools.ts index 63878165e..5d2bd9479 100644 --- a/src/presentation/http/router/editorTools.ts +++ b/src/presentation/http/router/editorTools.ts @@ -9,13 +9,11 @@ interface EditorToolsRouterOptions { /** * Editor tools service instance */ - editorToolsService: EditorToolsService, + editorToolsService: EditorToolsService; } - /** * Manages user - * * @param fastify - fastify instance * @param opts - empty options * @param done - callback @@ -61,7 +59,7 @@ const EditorToolsRouter: FastifyPluginCallback = (fast * Add editor tool to the library of all tools */ fastify.post<{ - Body: EditorTool + Body: EditorTool; }>('/add-tool', { config: { /** diff --git a/src/presentation/http/router/join.test.ts b/src/presentation/http/router/join.test.ts index fd1e5f1ca..ee2579e8f 100644 --- a/src/presentation/http/router/join.test.ts +++ b/src/presentation/http/router/join.test.ts @@ -87,7 +87,6 @@ describe('Join API', () => { const randomGuy = await global.db.insertUser(); - /** create test note for created user */ const note = await global.db.insertNote({ creatorId: creator.id, diff --git a/src/presentation/http/router/join.ts b/src/presentation/http/router/join.ts index f42518038..3c51c3369 100644 --- a/src/presentation/http/router/join.ts +++ b/src/presentation/http/router/join.ts @@ -9,12 +9,11 @@ interface JoinRouterOptions { /** * Note settings service instance */ - noteSettings: NoteSettingsService + noteSettings: NoteSettingsService; } /** * Join Router plugin - * * @todo use different replies for different errors in post route * @todo add check for write permission in route * @param fastify - fastify instance @@ -26,8 +25,8 @@ const JoinRouter: FastifyPluginCallback = (fastify, opts, don fastify.post<{ Params: { - hash: string - } + hash: string; + }; }>('/:hash', { schema: { params: { diff --git a/src/presentation/http/router/note.test.ts b/src/presentation/http/router/note.test.ts index 395175475..38550f121 100644 --- a/src/presentation/http/router/note.test.ts +++ b/src/presentation/http/router/note.test.ts @@ -35,7 +35,7 @@ describe('Note API', () => { id: '3', isDefault: true, name: 'list', - source:{ + source: { cdn: 'https://cdn.jsdelivr.net/npm/@editorjs/list@1.9.0/dist/list.umd.min.js', }, title: 'List', @@ -79,11 +79,11 @@ describe('Note API', () => { tools: [ { name: headerTool.name, - id : headerTool.id, + id: headerTool.id, }, { name: paragraphTool.name, - id : paragraphTool.id, + id: paragraphTool.id, }, ], }); @@ -185,11 +185,11 @@ describe('Note API', () => { tools: [ { name: headerTool.name, - id : headerTool.id, + id: headerTool.id, }, { name: paragraphTool.name, - id : paragraphTool.id, + id: paragraphTool.id, }, ], }); @@ -228,11 +228,11 @@ describe('Note API', () => { if (expectedStatusCode === 200) { expect(response?.json()).toMatchObject({ - 'note': { - 'id': note.publicId, + note: { + id: note.publicId, }, - 'accessRights': { - 'canEdit': canEdit, + accessRights: { + canEdit: canEdit, }, tools: [headerTool, paragraphTool], }); @@ -364,7 +364,7 @@ describe('Note API', () => { const canEdit = (intermidiateTeamDefined === true && roleInIntermidiateTeam === MemberRole.Write) || (intermidiateTeamDefined === false && roleInRootTeam === MemberRole.Write); - const accessToken = await global.auth(randomGuy.id); + const accessToken = global.auth(randomGuy.id); const response = await global.api?.fakeRequest({ method: 'GET', @@ -379,13 +379,12 @@ describe('Note API', () => { if (expectedMessage !== undefined) { expect(response?.json().message).toStrictEqual(expectedMessage); } else { - expect(response?.json()).toMatchObject({ 'note': { - 'id': note.publicId, - }, - 'accessRights': { - 'canEdit': canEdit, + expect(response?.json()).toMatchObject({ note: { + id: note.publicId, }, - }); + accessRights: { + canEdit: canEdit, + } }); } }); @@ -423,16 +422,16 @@ describe('Note API', () => { expect(response?.statusCode).toBe(200); expect(response?.json()).toMatchObject({ - 'note': { - 'id': childNote.publicId, - 'content': childNote.content, + note: { + id: childNote.publicId, + content: childNote.content, }, - 'parentNote': { - 'id': parentNote.publicId, - 'content': parentNote.content, + parentNote: { + id: parentNote.publicId, + content: parentNote.content, }, - 'accessRights': { - 'canEdit': false, + accessRights: { + canEdit: false, }, }); }); @@ -703,12 +702,12 @@ describe('Note API', () => { { noteTools: [ { - name : headerTool.name, - id : headerTool.id, + name: headerTool.name, + id: headerTool.id, }, { - name : listTool.name, - id : listTool.id, + name: listTool.name, + id: listTool.id, }, ], noteContent: { @@ -1269,7 +1268,7 @@ describe('Note API', () => { }); test('Return 406 when there is no note with that public id', async () => { - /* id of non-existent note*/ + /* id of non-existent note */ const nonExistentId = 'ishvm5qH84'; const response = await global.api?.fakeRequest({ @@ -1312,7 +1311,7 @@ describe('Note API', () => { creatorId: user.id, }); - /* create note settings for child note*/ + /* create note settings for child note */ await global.db.insertNoteSetting({ noteId: childNote.id, isPublic: true, @@ -1351,17 +1350,17 @@ describe('Note API', () => { }); test('Returns 400 when parent is the same as child', async () => { - /* create test child note*/ + /* create test child note */ const childNote = await global.db.insertNote({ creatorId: user.id, }); - /* create test parent note*/ + /* create test parent note */ const parentNote = await global.db.insertNote({ creatorId: user.id, }); - /* create test note relation*/ + /* create test note relation */ await global.db.insertNoteRelation({ noteId: childNote.id, parentId: parentNote.id, @@ -1386,7 +1385,7 @@ describe('Note API', () => { test('Return 400 when parent note does not exist', async () => { const nonExistentParentId = '47L43yY7dp'; - const childNote= await global.db.insertNote({ + const childNote = await global.db.insertNote({ creatorId: user.id, }); @@ -1437,7 +1436,7 @@ describe('Note API', () => { }); }); - describe('PATCH /note/:notePublicId', async () => { + describe('PATCH /note/:notePublicId', () => { const tools = [headerTool, listTool]; test.each([ @@ -1469,12 +1468,12 @@ describe('Note API', () => { { noteTools: [ { - name : headerTool.name, - id : headerTool.id, + name: headerTool.name, + id: headerTool.id, }, { - name : listTool.name, - id : listTool.id, + name: listTool.name, + id: listTool.id, }, ], noteContent: DEFAULT_NOTE_CONTENT, @@ -1526,7 +1525,7 @@ describe('Note API', () => { ('Should patch note tools on note update', async ({ noteTools, noteContent, expectedStatusCode, expectedMessage }) => { const user = await global.db.insertUser(); - const accessToken = await global.auth(user.id); + const accessToken = global.auth(user.id); const note = await global.db.insertNote({ creatorId: user.id }); diff --git a/src/presentation/http/router/note.ts b/src/presentation/http/router/note.ts index d8e17c09f..64cd933a7 100644 --- a/src/presentation/http/router/note.ts +++ b/src/presentation/http/router/note.ts @@ -19,12 +19,12 @@ interface NoteRouterOptions { /** * Note service instance */ - noteService: NoteService, + noteService: NoteService; /** * Note Settings service instance */ - noteSettingsService: NoteSettingsService, + noteSettingsService: NoteSettingsService; /** * Note visits service instance @@ -39,7 +39,6 @@ interface NoteRouterOptions { /** * Note router plugin - * * @param fastify - fastify instance * @param opts - empty options * @param done - callback @@ -77,15 +76,15 @@ const NoteRouter: FastifyPluginCallback = (fastify, opts, don fastify.get<{ Params: { notePublicId: NotePublicId; - }, + }; Reply: { - note: NotePublic, - parentNote?: NotePublic | undefined, + note: NotePublic; + parentNote?: NotePublic | undefined; accessRights: { - canEdit: boolean, - }, - tools: EditorTool[], - }| ErrorResponse, + canEdit: boolean; + }; + tools: EditorTool[]; + } | ErrorResponse; }>('/:notePublicId', { config: { policy: [ @@ -147,7 +146,6 @@ const NoteRouter: FastifyPluginCallback = (fastify, opts, don /** * Check if user is authorized - * * @todo use event bus to save note visits */ if (userId !== null) { @@ -165,7 +163,7 @@ const NoteRouter: FastifyPluginCallback = (fastify, opts, don /** * Get all tools used in the note */ - const noteToolsIds : EditorTool['id'][] = note.tools.map((tool) => tool.id); + const noteToolsIds: EditorTool['id'][] = note.tools.map(tool => tool.id); const noteTools = await editorToolsService.getToolsByIds(noteToolsIds); /** @@ -187,10 +185,10 @@ const NoteRouter: FastifyPluginCallback = (fastify, opts, don fastify.delete<{ Params: { notePublicId: NotePublicId; - }, + }; Reply: { - isDeleted: boolean - }, + isDeleted: boolean; + }; }>('/:notePublicId', { schema: { params: { @@ -226,7 +224,7 @@ const NoteRouter: FastifyPluginCallback = (fastify, opts, don /** * Check if note does not exist */ - return reply.send({ isDeleted : isDeleted }); + return reply.send({ isDeleted: isDeleted }); }); /** @@ -238,10 +236,10 @@ const NoteRouter: FastifyPluginCallback = (fastify, opts, don content: JSON; parentId?: NotePublicId; tools: Note['tools']; - }, + }; Reply: { - id: NotePublicId, - }, + id: NotePublicId; + }; }>('/', { config: { policy: [ @@ -261,7 +259,7 @@ const NoteRouter: FastifyPluginCallback = (fastify, opts, don '2xx': { description: 'Note fields response', content: { - 'application/json':{ + 'application/json': { schema: { id: { $ref: 'NoteSchema#/properties/id', @@ -287,7 +285,6 @@ const NoteRouter: FastifyPluginCallback = (fastify, opts, don /** * Save note visit when note created - * * @todo use even bus to save noteVisit */ @@ -317,15 +314,15 @@ const NoteRouter: FastifyPluginCallback = (fastify, opts, don */ fastify.patch<{ Params: { - notePublicId: NotePublicId, - }, + notePublicId: NotePublicId; + }; Body: { - content: Note['content'], - tools: Note['tools'], - }, + content: Note['content']; + tools: Note['tools']; + }; Reply: { - updatedAt: Note['updatedAt'], - } + updatedAt: Note['updatedAt']; + }; }>('/:notePublicId', { config: { policy: [ @@ -380,14 +377,14 @@ const NoteRouter: FastifyPluginCallback = (fastify, opts, don */ fastify.patch<{ Params: { - notePublicId: NotePublicId, - }, + notePublicId: NotePublicId; + }; Body: { - parentNoteId: NotePublicId, - }, + parentNoteId: NotePublicId; + }; Reply: { - isUpdated: boolean, - } + isUpdated: boolean; + }; }>('/:notePublicId/relation', { schema: { params: { @@ -425,7 +422,7 @@ const NoteRouter: FastifyPluginCallback = (fastify, opts, don const noteId = request.note?.id as number; const parentNoteId = request.body.parentNoteId; - const isUpdated = await noteService.updateNoteRelation(noteId, parentNoteId); + const isUpdated = await noteService.updateNoteRelation(noteId, parentNoteId); return reply.send({ isUpdated }); }); @@ -435,11 +432,11 @@ const NoteRouter: FastifyPluginCallback = (fastify, opts, don */ fastify.delete<{ Params: { - notePublicId: NotePublicId, - }, + notePublicId: NotePublicId; + }; Reply: { - isDeleted: boolean, - } + isDeleted: boolean; + }; }>('/:notePublicId/relation', { schema: { params: { @@ -474,7 +471,6 @@ const NoteRouter: FastifyPluginCallback = (fastify, opts, don /** * Delete all visits of the note - * * @todo use event bus to delete note visits */ await noteVisitsService.deleteNoteVisits(noteId); @@ -498,14 +494,14 @@ const NoteRouter: FastifyPluginCallback = (fastify, opts, don * Custom Hostname to search note by */ hostname: string; - }, + }; Reply: { - note: NotePublic, + note: NotePublic; accessRights: { - canEdit: boolean, - }, - tools: EditorTool[], - }| ErrorResponse, + canEdit: boolean; + }; + tools: EditorTool[]; + } | ErrorResponse; }>('/resolve-hostname/:hostname', { schema: { params: { @@ -554,7 +550,6 @@ const NoteRouter: FastifyPluginCallback = (fastify, opts, don /** * Save note visit if user is authorized - * * @todo use event bus to save note visits */ if (userId !== null) { @@ -586,8 +581,7 @@ const NoteRouter: FastifyPluginCallback = (fastify, opts, don /** * Get all tools used in the note */ - const noteToolsIds : EditorTool['id'][] = note.tools.map((tool) => tool.id); - + const noteToolsIds: EditorTool['id'][] = note.tools.map(tool => tool.id); const noteTools = await editorToolsService.getToolsByIds(noteToolsIds); diff --git a/src/presentation/http/router/noteList.test.ts b/src/presentation/http/router/noteList.test.ts index 52fb99359..a8ae38797 100644 --- a/src/presentation/http/router/noteList.test.ts +++ b/src/presentation/http/router/noteList.test.ts @@ -4,7 +4,6 @@ beforeEach(async () => { /** * Truncate all tables, which are needed * Restart autoincrement sequences for data to start with id 1 - * * @todo get rid of restarting database data in tests (move to beforeEach) */ await global.db.truncateTables(); @@ -102,7 +101,7 @@ describe('GET /notes?page', () => { const randomGuy = await global.db.insertUser(); if (isAuthorized) { - accessToken = await global.auth(randomGuy.id); + accessToken = global.auth(randomGuy.id); } for (let i = 0; i < portionSize; i++) { @@ -138,4 +137,4 @@ describe('GET /notes?page', () => { expect(body.items).toHaveLength(expectedLength); } }); -}); \ No newline at end of file +}); diff --git a/src/presentation/http/router/noteList.ts b/src/presentation/http/router/noteList.ts index 1540b57c7..49507d2f3 100644 --- a/src/presentation/http/router/noteList.ts +++ b/src/presentation/http/router/noteList.ts @@ -10,13 +10,12 @@ interface NoteListRouterOptions { /** * Note service instance */ - noteService: NoteService, + noteService: NoteService; } /** * Note list router plugin - * * @param fastify - fastify instance * @param opts - empty options * @param done - callback @@ -30,7 +29,7 @@ const NoteListRouter: FastifyPluginCallback = (fastify, o fastify.get<{ Querystring: { page: number; - }, + }; }>('/', { config: { policy: [ @@ -47,7 +46,7 @@ const NoteListRouter: FastifyPluginCallback = (fastify, o }, response: { - '2xx':{ + '2xx': { description: 'Query notelist', properties: { items: { @@ -81,4 +80,4 @@ const NoteListRouter: FastifyPluginCallback = (fastify, o done(); }; -export default NoteListRouter; \ No newline at end of file +export default NoteListRouter; diff --git a/src/presentation/http/router/noteSettings.test.ts b/src/presentation/http/router/noteSettings.test.ts index 395e74353..68418c9c4 100644 --- a/src/presentation/http/router/noteSettings.test.ts +++ b/src/presentation/http/router/noteSettings.test.ts @@ -221,7 +221,7 @@ describe('NoteSettings API', () => { }); } - /** specify team for intermidiateNote if randomGuy is not in it*/ + /** specify team for intermidiateNote if randomGuy is not in it */ if (intermidiateTeamDefined && roleInIntermidiateTeam === undefined) { await global.db.insertNoteTeam({ noteId: intermidiateNote.id, @@ -230,7 +230,7 @@ describe('NoteSettings API', () => { }); } - /** specify team for intermidiateNote if randomGuy is in it*/ + /** specify team for intermidiateNote if randomGuy is in it */ if (intermidiateTeamDefined && roleInIntermidiateTeam !== undefined) { await global.db.insertNoteTeam({ noteId: intermidiateNote.id, @@ -239,7 +239,7 @@ describe('NoteSettings API', () => { }); } - const accessToken = await global.auth(randomGuy.id); + const accessToken = global.auth(randomGuy.id); const response = await global.api?.fakeRequest({ method: 'GET', @@ -390,7 +390,7 @@ describe('NoteSettings API', () => { noteId: note.id, role: MemberRole.Write, userId: user.id, - } ]); + }]); } else { expect(response?.json()).toStrictEqual( { @@ -504,7 +504,7 @@ describe('NoteSettings API', () => { authorization: `Bearer ${accessToken}`, }, body: { - 'isPublic': false, + isPublic: false, }, url: `/note-settings/${note.publicId}`, }); @@ -621,7 +621,7 @@ describe('NoteSettings API', () => { authorization: `Bearer ${accessToken}`, }, body: { - 'isPublic': false, + isPublic: false, }, url: `/note-settings/${note.publicId}/invitation-hash`, }); @@ -766,7 +766,7 @@ describe('NoteSettings API', () => { role: MemberRole.Write, }); - const accessToken = await global.auth(user.id); + const accessToken = global.auth(user.id); const response = await global.api?.fakeRequest({ method: 'PATCH', @@ -791,7 +791,7 @@ describe('NoteSettings API', () => { creatorId: creator.id, }); - const accessToker = await global.auth(creator.id); + const accessToker = global.auth(creator.id); const response = await global.api?.fakeRequest({ method: 'PATCH', @@ -841,7 +841,7 @@ describe('NoteSettings API', () => { expectedStatusCode: 401, }, ]) - ('Delete user from the team', async ( { role, isAuthorized, expectedStatusCode } ) => { + ('Delete user from the team', async ({ role, isAuthorized, expectedStatusCode }) => { const creator = await global.db.insertUser(); const user = await global.db.insertUser(); @@ -901,14 +901,14 @@ describe('NoteSettings API', () => { expect(response?.json()).toMatchObject([ { - 'noteId': note.id, - 'userId': creator.id, - 'role': MemberRole.Write, + noteId: note.id, + userId: creator.id, + role: MemberRole.Write, }, { - 'noteId': note.id, - 'userId': user.id, - 'role': role, + noteId: note.id, + userId: user.id, + role: role, }, ]); } @@ -923,7 +923,7 @@ describe('NoteSettings API', () => { creatorId: creator.id, }); - const accessToken = await global.auth(creator.id); + const accessToken = global.auth(creator.id); const response = await global.api?.fakeRequest({ method: 'DELETE', @@ -961,7 +961,7 @@ describe('NoteSettings API', () => { role: MemberRole.Write, }); - const accessToken = await global.auth(creator.id); + const accessToken = global.auth(creator.id); let response = await global.api?.fakeRequest({ method: 'DELETE', @@ -988,9 +988,9 @@ describe('NoteSettings API', () => { expect(response?.json()).toMatchObject([ { - 'noteId': note.id, - 'userId': creator.id, - 'role': 1, + noteId: note.id, + userId: creator.id, + role: 1, }, ]); }); @@ -1002,7 +1002,7 @@ describe('NoteSettings API', () => { creatorId: creator.id, }); - const accessToken = await global.auth(creator.id); + const accessToken = global.auth(creator.id); const response = await global.api?.fakeRequest({ method: 'DELETE', diff --git a/src/presentation/http/router/noteSettings.ts b/src/presentation/http/router/noteSettings.ts index 107193843..f9160d36a 100644 --- a/src/presentation/http/router/noteSettings.ts +++ b/src/presentation/http/router/noteSettings.ts @@ -27,7 +27,6 @@ interface NoteSettingsRouterOptions { /** * Note Settings router plugin - * * @param fastify - fastify instance * @param opts - empty options * @param done - callback @@ -57,8 +56,8 @@ const NoteSettingsRouter: FastifyPluginCallback = (fa fastify.get<{ Params: { notePublicId: NotePublicId; - }, - Reply: NoteSettingsPublic, + }; + Reply: NoteSettingsPublic; }>('/:notePublicId', { config: { policy: [ @@ -97,13 +96,13 @@ const NoteSettingsRouter: FastifyPluginCallback = (fa */ fastify.patch<{ Params: { - notePublicId: NotePublicId, - }, + notePublicId: NotePublicId; + }; Body: { - userId: User['id'], - newRole: MemberRole, - }, - Reply: MemberRole, + userId: User['id']; + newRole: MemberRole; + }; + Reply: MemberRole; }>('/:notePublicId/team', { config: { policy: [ @@ -122,7 +121,7 @@ const NoteSettingsRouter: FastifyPluginCallback = (fa userId: { $ref: 'UserSchema#/properties/id', }, - newRole:{ + newRole: { $ref: 'NoteSettingsSchema#/properties/team/items/properties/role', }, }, @@ -155,7 +154,6 @@ const NoteSettingsRouter: FastifyPluginCallback = (fa return reply.notFound('User does not belong to Note\'s team'); } - return reply.send(newRole); }); @@ -164,12 +162,12 @@ const NoteSettingsRouter: FastifyPluginCallback = (fa */ fastify.delete<{ Params: { - notePublicId: NotePublicId, - }, + notePublicId: NotePublicId; + }; Body: { - userId: User['id'], - }, - Reply: User['id'] + userId: User['id']; + }; + Reply: User['id']; }>('/:notePublicId/team', { config: { policy: [ @@ -218,11 +216,11 @@ const NoteSettingsRouter: FastifyPluginCallback = (fa * Patch noteSettings by note id */ fastify.patch<{ - Body: Pick, + Body: Pick; Params: { notePublicId: NotePublicId; - }, - Reply: NoteSettingsPublic, + }; + Reply: NoteSettingsPublic; }>('/:notePublicId', { config: { policy: [ @@ -283,9 +281,9 @@ const NoteSettingsRouter: FastifyPluginCallback = (fa */ fastify.get<{ Params: { - notePublicId: NotePublicId, - }, - Reply: Team, + notePublicId: NotePublicId; + }; + Reply: Team; }>('/:notePublicId/team', { config: { policy: [ @@ -330,10 +328,10 @@ const NoteSettingsRouter: FastifyPluginCallback = (fa fastify.patch<{ Params: { notePublicId: NotePublicId; - }, + }; Reply: { invitationHash: InvitationHash; - }, + }; }>('/:notePublicId/invitation-hash', { config: { policy: [ diff --git a/src/presentation/http/router/oauth.ts b/src/presentation/http/router/oauth.ts index 23f56822f..2dc01160c 100644 --- a/src/presentation/http/router/oauth.ts +++ b/src/presentation/http/router/oauth.ts @@ -10,22 +10,21 @@ interface OauthRouterOptions { /** * User service instance */ - userService: UserService, + userService: UserService; /** * Auth service instance */ - authService: AuthService, + authService: AuthService; /** * Cookie domain for refresh and access tokens */ - cookieDomain: string, + cookieDomain: string; } /** * OAuth router plugin - * * @param fastify - fastify instance * @param opts - router options * @param done - callback diff --git a/src/presentation/http/router/upload.ts b/src/presentation/http/router/upload.ts index 64049157a..615b72836 100644 --- a/src/presentation/http/router/upload.ts +++ b/src/presentation/http/router/upload.ts @@ -65,7 +65,7 @@ const UploadRouter: FastifyPluginCallback = async (fastify, * File to upload */ file: MultipartFile; - } + }; }>('/:notePublicId', { config: { policy: [ @@ -74,7 +74,7 @@ const UploadRouter: FastifyPluginCallback = async (fastify, ], }, schema: { - consumes: [ 'multipart/form-data' ], + consumes: ['multipart/form-data'], params: { notePublicId: { $ref: 'NoteSchema#/properties/id', @@ -82,7 +82,7 @@ const UploadRouter: FastifyPluginCallback = async (fastify, }, body: { type: 'object', - required: [ 'file' ], + required: ['file'], properties: { file: { isFile: true }, }, @@ -100,11 +100,15 @@ const UploadRouter: FastifyPluginCallback = async (fastify, }, }, attachValidation: true, +<<<<<<< HEAD preHandler:[ noteResolver, noteSettingsResolver, memberRoleResolver, ], +======= + preHandler: [noteResolver], +>>>>>>> 9615a41936a09f160c2b27571457d4c3dd7f2afa }, async (request, reply) => { /** * @todo solve trouble with crashing app, when validations is not passed @@ -115,7 +119,7 @@ const UploadRouter: FastifyPluginCallback = async (fastify, const { userId } = request; const location: NoteAttachmentFileLocation = { - noteId: request.note!.id as number, + noteId: request.note!.id, }; const uploadedFileKey = await fileUploaderService.uploadFile( @@ -138,26 +142,24 @@ const UploadRouter: FastifyPluginCallback = async (fastify, fastify.get<{ Params: { key: string; - } - }>('/:notePublicId/:key', { - config: { - policy: [ - 'notePublicOrUserInTeam', - ], - }, - schema: { - params: { - key: { - $ref: 'UploadSchema#/properties/key', - }, + }; + }>('/:notePublicId/:key', { + config: { + policy: [ + 'notePublicOrUserInTeam', + ], + }, + schema: { + params: { + key: { + $ref: 'UploadSchema#/properties/key', }, - - response: { - '2xx': { - description: 'Generated buffer', - properties: { - fileData: { type: 'string' }, - }, + }, + response: { + '2xx': { + description: 'Generated buffer', + properties: { + fileData: { type: 'string' }, }, }, }, @@ -166,18 +168,18 @@ const UploadRouter: FastifyPluginCallback = async (fastify, noteSettingsResolver, memberRoleResolver, ], - }, async (request, reply) => { + } + }, async (request, reply) => { const fileLocation: NoteAttachmentFileLocation = { noteId: request.note!.id as number, }; - const fileData = await fileUploaderService.getFileData(request.params.key, fileLocation); + const fileData = await fileUploaderService.getFileData(request.params.key, fileLocation); - return reply.send(fileData); - }); + return reply.send(fileData); + }); done(); }; export default UploadRouter; - diff --git a/src/presentation/http/router/user.test.ts b/src/presentation/http/router/user.test.ts index 9a19e7698..2f4d4ee63 100644 --- a/src/presentation/http/router/user.test.ts +++ b/src/presentation/http/router/user.test.ts @@ -1,13 +1,11 @@ import { describe, test, expect } from 'vitest'; - describe('User API', () => { describe('GET /user/myself', () => { test('Returns user with status code 200 if user exists', async () => { /** * Truncate all tables, which are needed * Restart autoincrement sequences for data to start with id 1 - * * @todo get rid of restarting database data in tests (move to beforeEach) */ await global.db.truncateTables(); @@ -73,7 +71,7 @@ describe('User API', () => { }, url: '/user/editor-tools', body: { - 'toolId': addedToolId, + toolId: addedToolId, }, }); @@ -82,7 +80,7 @@ describe('User API', () => { const body = response?.json(); expect(body).toStrictEqual({ - addedTool :{ + addedTool: { id: addedToolId, name: 'code', title: 'Code Tool', diff --git a/src/presentation/http/router/user.ts b/src/presentation/http/router/user.ts index 5e48306c8..d1fe3369c 100644 --- a/src/presentation/http/router/user.ts +++ b/src/presentation/http/router/user.ts @@ -10,17 +10,16 @@ interface UserRouterOptions { /** * User service instance */ - userService: UserService, + userService: UserService; /** * Service editor tool */ - editorToolsService: EditorToolsService, + editorToolsService: EditorToolsService; } /** * Manages user - * * @param fastify - fastify instance * @param opts - empty options * @param done - callback @@ -35,7 +34,7 @@ const UserRouter: FastifyPluginCallback = (fastify, opts, don * Get user by session */ fastify.get<{ - Reply: Pick, + Reply: Pick; }>('/myself', { config: { policy: [ @@ -105,7 +104,7 @@ const UserRouter: FastifyPluginCallback = (fastify, opts, don * Tool is linked by it's id. */ fastify.post<{ - Body: { toolId: string } + Body: { toolId: string }; }>('/editor-tools', { config: { policy: [ @@ -151,7 +150,7 @@ const UserRouter: FastifyPluginCallback = (fastify, opts, don * Remove editor tool from user extensions */ fastify.delete<{ - Body: { toolId: string } + Body: { toolId: string }; }>('/editor-tools', { config: { policy: [ diff --git a/src/presentation/http/schema/EditorTool.ts b/src/presentation/http/schema/EditorTool.ts index c69921e5d..f350f23c1 100644 --- a/src/presentation/http/schema/EditorTool.ts +++ b/src/presentation/http/schema/EditorTool.ts @@ -45,4 +45,3 @@ export const EditorToolSchema = { }, }, }; - diff --git a/src/presentation/http/schema/Join.ts b/src/presentation/http/schema/Join.ts index ad0d1249c..ebdfcbd15 100644 --- a/src/presentation/http/schema/Join.ts +++ b/src/presentation/http/schema/Join.ts @@ -1,7 +1,7 @@ export const JoinSchemaParams = { $id: 'JoinSchemaParams', type: 'object', - required: [ 'hash' ], + required: ['hash'], properties: { hash: { type: 'string', diff --git a/src/presentation/http/schema/OauthSchema.ts b/src/presentation/http/schema/OauthSchema.ts index 69958fca5..c87475ec7 100644 --- a/src/presentation/http/schema/OauthSchema.ts +++ b/src/presentation/http/schema/OauthSchema.ts @@ -1,4 +1,3 @@ - export const OauthSchema = { $id: 'OauthSchema', type: 'object', @@ -27,4 +26,4 @@ export const OauthSchema = { description: 'The returned refreshtoken from Google', }, }, -}; \ No newline at end of file +}; diff --git a/src/presentation/http/types/PolicyContext.ts b/src/presentation/http/types/PolicyContext.ts index 97aa9bac4..4f914faeb 100644 --- a/src/presentation/http/types/PolicyContext.ts +++ b/src/presentation/http/types/PolicyContext.ts @@ -17,4 +17,4 @@ export interface PolicyContext { * Instances of domain services */ domainServices: DomainServices; -} \ No newline at end of file +} diff --git a/src/repository/ai.repository.ts b/src/repository/ai.repository.ts index 5e3f2e7a6..e5540f5dd 100644 --- a/src/repository/ai.repository.ts +++ b/src/repository/ai.repository.ts @@ -8,14 +8,12 @@ import type { GetCompletionResponsePayload } from './transport/openai-api/types/ export default class AIRepository { /** * Constructs repository instance - * * @param openaiTransport - openai transport */ constructor(private readonly openaiTransport: OpenAIApi) { } /** * Returns predicted completion based on specified string content - * * @param content - content to complete */ public async getCompletion(content: string): Promise { @@ -35,6 +33,6 @@ export default class AIRepository { return response.choices[0].message.content; } - return ''; + return ''; } } diff --git a/src/repository/editorTools.repository.ts b/src/repository/editorTools.repository.ts index c04d1251b..529677a45 100644 --- a/src/repository/editorTools.repository.ts +++ b/src/repository/editorTools.repository.ts @@ -26,7 +26,6 @@ export default class EditorToolsRepository { /** * Get tool by it's identifier - * * @param editorToolId - unique tool identifier */ public async getToolById(editorToolId: EditorTool['id']): Promise { @@ -35,7 +34,6 @@ export default class EditorToolsRepository { /** * Get bunch of tools by their ids - * * @param editorToolIds - unique tool ids */ public async getToolsByIds(editorToolIds: EditorTool['id'][]): Promise { diff --git a/src/repository/file.repository.ts b/src/repository/file.repository.ts index 2d1636f6c..21ece7e9e 100644 --- a/src/repository/file.repository.ts +++ b/src/repository/file.repository.ts @@ -10,7 +10,6 @@ export default class FileRepository { /** * File repository constructor - * * @param storage - file storage with methods to access file data */ constructor(storage: FileStorage) { @@ -19,7 +18,6 @@ export default class FileRepository { /** * Get file data by key - * * @param objectKey - unique file key in storage */ public async getByKey(objectKey: string): Promise { @@ -28,7 +26,6 @@ export default class FileRepository { /** * Inserts file data - * * @param fileData - file data */ public async insert(fileData: FileCreationAttributes): Promise { @@ -37,7 +34,6 @@ export default class FileRepository { /** * Get file location by key and type, files with different types have different locations - * * @param type - file type * @param key - file unique key */ diff --git a/src/repository/index.ts b/src/repository/index.ts index 3a02628ca..41adf981f 100644 --- a/src/repository/index.ts +++ b/src/repository/index.ts @@ -31,62 +31,61 @@ export interface Repositories { /** * Note repository instance */ - noteRepository: NoteRepository, + noteRepository: NoteRepository; /** * Note settings repository instance */ - noteSettingsRepository: NoteSettingsRepository, + noteSettingsRepository: NoteSettingsRepository; /** * Note relationship repository instance */ - noteRelationsRepository: NoteRelationsRepository, + noteRelationsRepository: NoteRelationsRepository; /** * User session repository instance */ - userSessionRepository: UserSessionRepository, + userSessionRepository: UserSessionRepository; /** * User repository instance */ - userRepository: UserRepository, + userRepository: UserRepository; /** * AI repository instance */ - aiRepository: AIRepository + aiRepository: AIRepository; /** * Editor tools repository instance */ - editorToolsRepository: EditorToolsRepository, + editorToolsRepository: EditorToolsRepository; /** * Team repository instance */ - teamRepository: TeamRepository, + teamRepository: TeamRepository; /** * File repository instance */ - fileRepository: FileRepository, + fileRepository: FileRepository; /** * Object repository instance */ - objectStorageRepository: ObjectStorageRepository, + objectStorageRepository: ObjectStorageRepository; /** * Note Visits repository instance */ - noteVisitsRepository: NoteVisitsRepository, + noteVisitsRepository: NoteVisitsRepository; } /** * Initiate ORM - * * @param databaseConfig - database config */ export async function initORM(databaseConfig: DatabaseConfig): Promise { @@ -102,7 +101,6 @@ export async function initORM(databaseConfig: DatabaseConfig): Promise { /** * Initiate repositories - * * @param orm - ORM instance * @param s3Config - S3 storage config */ @@ -145,7 +143,6 @@ export async function init(orm: Orm, s3Config: S3StorageConfig): Promise } added note + * @returns added note */ public async addNote(options: NoteCreationAttributes): Promise { return await this.storage.createNote(options); @@ -31,7 +29,6 @@ export default class NoteRepository { /** * Update note content in a store - * * @param id - note internal id * @param content - new content * @param noteTools - tools which are used in note @@ -43,9 +40,8 @@ export default class NoteRepository { /** * Gets note by internal id - * * @param id - note id - * @returns { Promise } found note + * @returns found note */ public async getNoteById(id: NoteInternalId): Promise { return await this.storage.getNoteById(id); @@ -53,7 +49,6 @@ export default class NoteRepository { /** * Deletes note by id - * * @param id - note id */ public async deleteNoteById(id: NoteInternalId): Promise { @@ -62,9 +57,8 @@ export default class NoteRepository { /** * Gets note by hostname - * * @param hostname - custom hostname - * @returns { Promise } found note + * @returns found note */ public async getNoteByHostname(hostname: string): Promise { return await this.storage.getNoteByHostname(hostname); @@ -72,7 +66,6 @@ export default class NoteRepository { /** * Returns note by public id. Null if note does not exist. - * * @param publicId - public id */ public async getNoteByPublicId(publicId: NotePublicId): Promise { @@ -81,7 +74,6 @@ export default class NoteRepository { /** * Gets note list by creator id - * * @param id - note creator id * @param offset - number of skipped notes * @param limit - number of notes to get diff --git a/src/repository/noteRelations.repository.ts b/src/repository/noteRelations.repository.ts index 7969aa872..f31c1a4e1 100644 --- a/src/repository/noteRelations.repository.ts +++ b/src/repository/noteRelations.repository.ts @@ -12,7 +12,6 @@ export default class NoteRelationsRepository { /** * Note relationship repository constructor - * * @param storage - storage for note relationship */ constructor(storage: NoteRelationshipStorage) { @@ -21,7 +20,6 @@ export default class NoteRelationsRepository { /** * Add note relation - * * @param noteId - id of the current note * @param parentId - id of the parent note */ @@ -31,7 +29,6 @@ export default class NoteRelationsRepository { /** * Update note relation - * * @param noteId - id of the current note * @param parentId - id of the parent note */ @@ -41,7 +38,6 @@ export default class NoteRelationsRepository { /** * Get parent note id by note id - * * @param noteId - id of the current note */ public async getParentNoteIdByNoteId(noteId: NoteInternalId): Promise { @@ -50,7 +46,6 @@ export default class NoteRelationsRepository { /** * Delete all note ralations contains noteId - * * @param noteId - id of the current note */ public async deleteNoteRelationsByNoteId(noteId: NoteInternalId): Promise { @@ -59,7 +54,6 @@ export default class NoteRelationsRepository { /** * Unlink parent note from the current note - * * @param noteId - id of note to unlink parent */ public async unlinkParent(noteId: NoteInternalId): Promise { @@ -68,7 +62,6 @@ export default class NoteRelationsRepository { /** * Checks if the note has any connection - * * @param noteId - id of the current note */ public async hasRelation(noteId: NoteInternalId): Promise { diff --git a/src/repository/noteSettings.repository.ts b/src/repository/noteSettings.repository.ts index 232856655..ff16d08d4 100644 --- a/src/repository/noteSettings.repository.ts +++ b/src/repository/noteSettings.repository.ts @@ -14,7 +14,6 @@ export default class NoteSettingsRepository { /** * Note Settings repository constructor - * * @param storage - storage for note */ constructor(storage: NoteSettingsStorage) { @@ -23,7 +22,6 @@ export default class NoteSettingsRepository { /** * Gets note settings by id - * * @param id - note id * @returns found note */ @@ -33,9 +31,8 @@ export default class NoteSettingsRepository { /** * Get note settings by invitation hash - * * @param invitationHash - hash for inviting to the note team - * @returns { Promise } - found note settings + * @returns - found note settings */ public async getNoteSettingsByInvitationHash(invitationHash: InvitationHash): Promise { return await this.storage.getNoteSettingsByInvitationHash(invitationHash); @@ -43,7 +40,6 @@ export default class NoteSettingsRepository { /** * Get note settings by note id - * * @param id - note id * @returns found note settings */ @@ -53,7 +49,6 @@ export default class NoteSettingsRepository { /** * Add note settings - * * @param settings - note settings */ public async addNoteSettings(settings: NoteSettingsCreationAttributes): Promise { @@ -62,7 +57,6 @@ export default class NoteSettingsRepository { /** * Patch note settings - * * @param id - note settings id * @param data - note settings new values * @returns patched note settings diff --git a/src/repository/noteVisits.repository.ts b/src/repository/noteVisits.repository.ts index 74896f189..d21ea4c8b 100644 --- a/src/repository/noteVisits.repository.ts +++ b/src/repository/noteVisits.repository.ts @@ -11,15 +11,14 @@ export default class NoteVisitsRepository { /** * Note Visits repository constructor - * * @param storage - storage for note Visits */ constructor(storage: NoteVisitsStorage) { this.storage = storage; } + /** * Updates existing noteVisit's vizitedAt or creates new record if user opens note for the first time - * * @param noteId - note internal id * @param userId - id of the user * @returns updated or created NoteVisit @@ -30,10 +29,9 @@ export default class NoteVisitsRepository { /** * Deletes all visits of the note when a note is deleted - * * @param noteId - note internal id */ public async deleteNoteVisits(noteId: NoteInternalId): Promise { return await this.storage.deleteNoteVisits(noteId); } -} \ No newline at end of file +} diff --git a/src/repository/object.repository.ts b/src/repository/object.repository.ts index 1c84f1f7e..c732a2fbd 100644 --- a/src/repository/object.repository.ts +++ b/src/repository/object.repository.ts @@ -12,7 +12,6 @@ export default class ObjectStorageRepository { /** * Object repository constructor - * * @param storage - s3 storage */ constructor(storage: S3Storage) { @@ -21,7 +20,6 @@ export default class ObjectStorageRepository { /** * Get object data by key - * * @param key - object key * @param bucket - bucket name */ @@ -31,7 +29,6 @@ export default class ObjectStorageRepository { /** * Inserts object data - * * @param objectData - object data * @param key - object key * @param bucket - bucket name diff --git a/src/repository/storage/editorTools.storage.ts b/src/repository/storage/editorTools.storage.ts index a22f31955..d3cfb0922 100644 --- a/src/repository/storage/editorTools.storage.ts +++ b/src/repository/storage/editorTools.storage.ts @@ -4,5 +4,3 @@ import EditorToolsSequelizeStorage from '@repository/storage/postgres/orm/sequel * Editor tools storage */ export default EditorToolsSequelizeStorage; - - diff --git a/src/repository/storage/postgres/migrations/index.ts b/src/repository/storage/postgres/migrations/index.ts index 21eb42cd5..a7bbebc89 100644 --- a/src/repository/storage/postgres/migrations/index.ts +++ b/src/repository/storage/postgres/migrations/index.ts @@ -1,6 +1,7 @@ import path from 'path'; import config from './../../../../infrastructure/config/index.js'; import { runTenantMigrations } from './migrate.js'; +import process from 'process'; /** * Path to migration files diff --git a/src/repository/storage/postgres/migrations/migrate.ts b/src/repository/storage/postgres/migrations/migrate.ts index 6227356c2..5c936b4c5 100644 --- a/src/repository/storage/postgres/migrations/migrate.ts +++ b/src/repository/storage/postgres/migrations/migrate.ts @@ -1,18 +1,17 @@ import pg, { type ClientConfig } from 'pg'; +/* eslint-disable-next-line n/no-unpublished-import */ import { migrate } from 'postgres-migrations'; import logger from './../../../../infrastructure/logging/index.js'; - /** * Connects to the database and runs migrations - * * @param migrationsPath - path to migrations files * @param dsn - database connection string */ -export async function runTenantMigrations(migrationsPath: string, dsn: string ): Promise { +export async function runTenantMigrations(migrationsPath: string, dsn: string): Promise { logger.info('🚚 Running migrations...'); - const dbConfig: ClientConfig = { + const dbConfig: ClientConfig = { connectionString: dsn, connectionTimeoutMillis: 10_000, options: '-c search_path=public', diff --git a/src/repository/storage/postgres/orm/sequelize/editorTools.ts b/src/repository/storage/postgres/orm/sequelize/editorTools.ts index 88c07327f..8536f9552 100644 --- a/src/repository/storage/postgres/orm/sequelize/editorTools.ts +++ b/src/repository/storage/postgres/orm/sequelize/editorTools.ts @@ -66,7 +66,6 @@ export default class UserSequelizeStorage { /** * Constructor for the storage - * * @param ormInstance - ORM instance */ constructor({ connection }: Orm) { @@ -141,7 +140,6 @@ export default class UserSequelizeStorage { /** * Get bunch of tools by their ids - * * @param editorToolIds - tool ids */ public async getToolsByIds(editorToolIds: EditorTool['id'][]): Promise { @@ -156,7 +154,6 @@ export default class UserSequelizeStorage { /** * Get tool by it's identifier - * * @param editorToolId - unique tool identifier */ public async getToolById(editorToolId: EditorTool['id']): Promise { diff --git a/src/repository/storage/postgres/orm/sequelize/file.ts b/src/repository/storage/postgres/orm/sequelize/file.ts index 46225a536..130c856d1 100644 --- a/src/repository/storage/postgres/orm/sequelize/file.ts +++ b/src/repository/storage/postgres/orm/sequelize/file.ts @@ -75,7 +75,6 @@ export default class FileSequelizeStorage { /** * Constructor for file storage - * * @param ormInstance - ORM instance */ constructor({ connection }: Orm) { @@ -125,7 +124,6 @@ export default class FileSequelizeStorage { /** * Inserts file data into database - * * @param fileData - File data */ public async insertFile(fileData: FileCreationAttributes): Promise { @@ -134,7 +132,6 @@ export default class FileSequelizeStorage { /** * Get file data by key - * * @param key - File key */ public getFileDataByKey(key: string): Promise { @@ -147,7 +144,6 @@ export default class FileSequelizeStorage { /** * Get file location by key and type - * * @param type - file type * @param key - file unique key */ diff --git a/src/repository/storage/postgres/orm/sequelize/index.ts b/src/repository/storage/postgres/orm/sequelize/index.ts index f8a2c9eb9..1d45ce293 100644 --- a/src/repository/storage/postgres/orm/sequelize/index.ts +++ b/src/repository/storage/postgres/orm/sequelize/index.ts @@ -20,7 +20,6 @@ export default class SequelizeOrm { /** * Constructor for class - * * @param databaseConfig - database config */ constructor(databaseConfig: DatabaseConfig) { @@ -55,7 +54,7 @@ export default class SequelizeOrm { /** * Get database connection */ - public get connection(): Sequelize { + public get connection(): Sequelize { return this.conn; } } diff --git a/src/repository/storage/postgres/orm/sequelize/note.ts b/src/repository/storage/postgres/orm/sequelize/note.ts index d61b34ca2..6fccf233e 100644 --- a/src/repository/storage/postgres/orm/sequelize/note.ts +++ b/src/repository/storage/postgres/orm/sequelize/note.ts @@ -46,7 +46,6 @@ export class NoteModel extends Model, InferCreationAt public declare tools: Note['tools']; } - /** * Class representing a table storing Notes */ @@ -78,7 +77,6 @@ export default class NoteSequelizeStorage { /** * Constructor for note storage - * * @param ormInstance - ORM instance */ constructor({ connection }: Orm) { @@ -117,7 +115,6 @@ export default class NoteSequelizeStorage { /** * Creates association with note settings model - * * @param model - initialized note settings model */ public createAssociationWithNoteSettingsModel(model: ModelStatic): void { @@ -134,7 +131,6 @@ export default class NoteSequelizeStorage { /** * create association with note cisits model - * * @param model - initialized note visits model */ public createAssociationWithNoteVisitsModel(model: ModelStatic): void { @@ -151,9 +147,8 @@ export default class NoteSequelizeStorage { /** * Insert note to database - * * @param options - note creation options - * @returns { Note } - created note + * @returns - created note */ public async createNote(options: NoteCreationAttributes): Promise { return await this.model.create({ @@ -166,7 +161,6 @@ export default class NoteSequelizeStorage { /** * Update note content by id - * * @param id - note internal id * @param content - new content * @param tools - tools which are used in note @@ -192,7 +186,6 @@ export default class NoteSequelizeStorage { /** * Gets note by id - * * @param id - internal id */ public async getNoteById(id: NoteInternalId): Promise { @@ -205,12 +198,11 @@ export default class NoteSequelizeStorage { /** * Deletes note by id - * * @param id - internal id */ public async deleteNoteById(id: NoteInternalId): Promise { const affectedRows = await this.model.destroy({ - where:{ + where: { id, }, }); @@ -223,7 +215,6 @@ export default class NoteSequelizeStorage { /** * Gets note list by creator id - * * @param userId - id of certain user * @param offset - number of skipped notes * @param limit - number of notes to get @@ -240,30 +231,28 @@ export default class NoteSequelizeStorage { where: { '$noteVisits.user_id$': userId, }, - order: [ [ + order: [[ { model: this.visitsModel, as: 'noteVisits', }, 'visited_at', 'DESC', - ] ], - include: [ { + ]], + include: [{ model: this.visitsModel, as: 'noteVisits', duplicating: false, - } ], + }], }); return reply; } - /** * Gets note by id - * * @param hostname - custom hostname - * @returns { Promise } found note + * @returns found note */ public async getNoteByHostname(hostname: string): Promise { if (!this.settingsModel) { @@ -288,9 +277,8 @@ export default class NoteSequelizeStorage { /** * Gets note by public id - * * @param publicId - note public id - * @returns { Promise } found note + * @returns found note */ public async getNoteByPublicId(publicId: NotePublicId): Promise { return await this.model.findOne({ diff --git a/src/repository/storage/postgres/orm/sequelize/noteRelations.ts b/src/repository/storage/postgres/orm/sequelize/noteRelations.ts index c430ba8f8..879ddb986 100644 --- a/src/repository/storage/postgres/orm/sequelize/noteRelations.ts +++ b/src/repository/storage/postgres/orm/sequelize/noteRelations.ts @@ -52,7 +52,6 @@ export default class NoteRelationsSequelizeStorage { /** * Constructor for note relatinship storage - * * @param ormInstance - ORM instance */ constructor({ connection }: Orm) { @@ -92,7 +91,6 @@ export default class NoteRelationsSequelizeStorage { /** * Insert note relation to database - * * @param noteId - id of the current note * @param parentId - id of the parent note */ @@ -107,7 +105,6 @@ export default class NoteRelationsSequelizeStorage { /** * Gets parent note id by note id - * * @param noteId - note id */ public async getParentNoteIdByNoteId(noteId: NoteInternalId): Promise { @@ -123,13 +120,12 @@ export default class NoteRelationsSequelizeStorage { /** * Update note content by id - * * @param noteId - id of the current note * @param parentId - parent note id * @returns Note on success, null on failure */ public async updateNoteRelationById(noteId: NoteInternalId, parentId: NoteInternalId): Promise { - const [ affectedRowsCount ] = await this.model.update({ + const [affectedRowsCount] = await this.model.update({ parentId, }, { where: { @@ -143,17 +139,16 @@ export default class NoteRelationsSequelizeStorage { /** * Delete all note relations contains noteId - * * @param noteId - id of the current note */ public async deleteNoteRelationsByNoteId(noteId: NoteInternalId): Promise { const affectedRows = await this.model.destroy({ where: { - [Op.or]: [ { + [Op.or]: [{ noteId: noteId, }, { parentId: noteId, - } ], + }], }, }); @@ -165,7 +160,6 @@ export default class NoteRelationsSequelizeStorage { /** * Unlink parent note from the current note - * * @param noteId - id of note to unlink parent */ public async unlinkParent(noteId: NoteInternalId): Promise { @@ -183,7 +177,6 @@ export default class NoteRelationsSequelizeStorage { /** * Creates association with note model to make joins - * * @param model - initialized note model */ public createAssociationWithNoteModel(model: ModelStatic): void { @@ -201,17 +194,16 @@ export default class NoteRelationsSequelizeStorage { /** * Checks if the note has any relation - * * @param noteId - id of the current note */ public async hasRelation(noteId: NoteInternalId): Promise { const foundNote = await this.model.findOne ({ where: { - [Op.or]: [ { + [Op.or]: [{ noteId: noteId, }, { parentId: noteId, - } ], + }], }, }); diff --git a/src/repository/storage/postgres/orm/sequelize/noteSettings.ts b/src/repository/storage/postgres/orm/sequelize/noteSettings.ts index 750f4b6c8..50beb6bbd 100644 --- a/src/repository/storage/postgres/orm/sequelize/noteSettings.ts +++ b/src/repository/storage/postgres/orm/sequelize/noteSettings.ts @@ -66,7 +66,6 @@ export default class NoteSettingsSequelizeStorage { /** * Constructor for note storage - * * @param ormInstance - ORM instance */ constructor({ connection }: Orm) { @@ -115,9 +114,8 @@ export default class NoteSettingsSequelizeStorage { /** * Gets note settings by id - * * @param id - note id - * @returns { Promise } found note + * @returns found note */ public async getNoteSettingsById(id: NoteSettings['id']): Promise { const noteSettings = await this.model.findOne({ @@ -138,9 +136,8 @@ export default class NoteSettingsSequelizeStorage { /** * Get note settings by invitation hash - * * @param invitationHash - hash for inviting to the note team - * @returns { Promise } - found note settings + * @returns - found note settings */ public async getNoteSettingsByInvitationHash(invitationHash: InvitationHash): Promise { return await this.model.findOne({ @@ -152,9 +149,8 @@ export default class NoteSettingsSequelizeStorage { /** * Get note settings - * * @param noteId - note id - * @returns { Promise } - note settings + * @returns - note settings */ public async getNoteSettingsByNoteId(noteId: NoteSettings['noteId']): Promise { const settings = await this.model.findOne({ @@ -173,7 +169,6 @@ export default class NoteSettingsSequelizeStorage { /** * Creates association with note model to make joins - * * @param model - initialized note model */ public createAssociationWithNoteModel(model: ModelStatic): void { @@ -191,9 +186,8 @@ export default class NoteSettingsSequelizeStorage { /** * Insert note settings - * * @param options - note settings options - * @returns { Promise } - inserted note settings + * @returns - inserted note settings */ public async insertNoteSettings({ noteId, @@ -214,7 +208,6 @@ export default class NoteSettingsSequelizeStorage { /** * Update note settings - * * @param id - note settings id * @param data - note settings new data */ diff --git a/src/repository/storage/postgres/orm/sequelize/noteVisits.ts b/src/repository/storage/postgres/orm/sequelize/noteVisits.ts index 6bc9ad21f..beff2bf57 100644 --- a/src/repository/storage/postgres/orm/sequelize/noteVisits.ts +++ b/src/repository/storage/postgres/orm/sequelize/noteVisits.ts @@ -80,7 +80,6 @@ export default class NoteVisitsSequelizeStorage { /** * Creates association with user model - * * @param model - initialized note settings model */ public createAssociationWithUserModel(model: ModelStatic): void { @@ -94,7 +93,6 @@ export default class NoteVisitsSequelizeStorage { /** * Creates association with note model - * * @param model - initialized note model */ public createAssociationWithNoteModel(model: ModelStatic): void { @@ -108,7 +106,6 @@ export default class NoteVisitsSequelizeStorage { /** * Updates existing noteVisit's visitedAt or creates new record if user opens note for the first time - * * @param noteId - note internal id * @param userId - id of the user * @returns created or updated NoteVisit @@ -156,7 +153,6 @@ export default class NoteVisitsSequelizeStorage { /** * Deletes all visits of the note when a note is deleted - * * @param noteId - note internal id */ public async deleteNoteVisits(noteId: NoteInternalId): Promise { @@ -172,4 +168,4 @@ export default class NoteVisitsSequelizeStorage { return false; } -} \ No newline at end of file +} diff --git a/src/repository/storage/postgres/orm/sequelize/teams.ts b/src/repository/storage/postgres/orm/sequelize/teams.ts index c4a6161df..ba5997608 100644 --- a/src/repository/storage/postgres/orm/sequelize/teams.ts +++ b/src/repository/storage/postgres/orm/sequelize/teams.ts @@ -65,7 +65,6 @@ export default class TeamsSequelizeStorage { /** * Constructor for note storage - * * @param ormInstance - ORM instance */ constructor({ connection }: Orm) { @@ -110,7 +109,6 @@ export default class TeamsSequelizeStorage { /** * Creates association with note model to make joins - * * @param model - initialized note model */ public createAssociationWithNoteModel(model: ModelStatic): void { @@ -128,7 +126,6 @@ export default class TeamsSequelizeStorage { /** * Creates association with user model to make joins - * * @param model - initialized user model */ public createAssociationWithUserModel(model: ModelStatic): void { @@ -146,7 +143,6 @@ export default class TeamsSequelizeStorage { /** * Create new team member membership - * * @param data - team membership data */ public async createTeamMembership(data: TeamMemberCreationAttributes): Promise { @@ -159,10 +155,9 @@ export default class TeamsSequelizeStorage { /** * Check if user is note team member - * * @param userId - user id to check * @param noteId - note id to identify team - * @returns { Promise } returns true if user is team member + * @returns returns true if user is team member */ public async isUserInTeam(userId: User['id'], noteId: NoteInternalId): Promise { const teamMemberShip = await this.model.findOne({ @@ -177,7 +172,6 @@ export default class TeamsSequelizeStorage { /** * Get all team members by note id - * * @param noteId - note id to get all team members * @returns team relations */ @@ -191,7 +185,6 @@ export default class TeamsSequelizeStorage { /** * Get all team members by note id with info about users - * * @param noteId - note id to get all team members * @returns team with additional info */ @@ -214,7 +207,6 @@ export default class TeamsSequelizeStorage { /** * Remove team member by id - * * @param userId - id of team member * @param noteId - note internal id * @returns returns userId if team member was deleted and undefined overwise @@ -232,7 +224,6 @@ export default class TeamsSequelizeStorage { /** * Patch team member role by user and note id - * * @param userId - id of team member * @param noteId - note internal id * @param role - new team member role diff --git a/src/repository/storage/postgres/orm/sequelize/user.ts b/src/repository/storage/postgres/orm/sequelize/user.ts index 490fca582..0f7909674 100644 --- a/src/repository/storage/postgres/orm/sequelize/user.ts +++ b/src/repository/storage/postgres/orm/sequelize/user.ts @@ -39,7 +39,7 @@ interface InsertUserOptions { /** * User editor tools */ - editorTools: EditorTool['id'][]; + editorTools: EditorTool['id'][]; } /** @@ -72,8 +72,6 @@ interface RemoveUserEditorTool { toolId: EditorTool['id']; } -/* eslint-disable @typescript-eslint/naming-convention */ - /** * Class representing a user model in database */ @@ -130,7 +128,6 @@ export default class UserSequelizeStorage { /** * Constructor for user storage - * * @param ormInstance - ORM instance */ constructor({ connection }: Orm) { @@ -173,7 +170,6 @@ export default class UserSequelizeStorage { /** * Link tool with user to use it in the editor - * * @param options - userId & editor credentials to link it to user */ public async addUserEditorTool({ @@ -197,7 +193,6 @@ export default class UserSequelizeStorage { /** * Remove tool from the list of tools of the current user - * * @param options - identifiers to remove a link between a user and a tool */ public async removeUserEditorTool({ @@ -215,9 +210,8 @@ export default class UserSequelizeStorage { /** * Insert user - * * @param options - options to insert user - * @returns { Promise } inserted user + * @returns inserted user */ public async insertUser({ email, @@ -236,9 +230,8 @@ export default class UserSequelizeStorage { /** * Get user by id or email - * * @param options - query options - * @returns { Promise } found user + * @returns found user */ public async getUserByIdOrEmail({ id, diff --git a/src/repository/storage/postgres/orm/sequelize/userSession.ts b/src/repository/storage/postgres/orm/sequelize/userSession.ts index e602b0061..de5c224cb 100644 --- a/src/repository/storage/postgres/orm/sequelize/userSession.ts +++ b/src/repository/storage/postgres/orm/sequelize/userSession.ts @@ -4,8 +4,6 @@ import type Orm from '@repository/storage/postgres/orm/sequelize/index.js'; import { UserModel } from '@repository/storage/postgres/orm/sequelize/user.js'; import type UserSession from '@domain/entities/userSession.js'; -/* eslint-disable @typescript-eslint/naming-convention */ - /** * Class representing a user sessions model in database */ @@ -31,7 +29,6 @@ class UserSessionModel extends Model, InferCre public declare refreshTokenExpiresAt: Date; } - /** * Class representing a table storing user sessions */ @@ -53,7 +50,6 @@ export default class UserSessionSequelizeStorage { /** * Constructor for user sessions storage - * * @param ormInstance - ORM instance */ constructor({ connection }: Orm) { @@ -94,11 +90,10 @@ export default class UserSessionSequelizeStorage { /** * Creates user session - * * @param userId - user id * @param refreshToken - refresh token * @param refreshTokenExpiresAt - refresh token expiration date - * @returns { UserSession } created user session + * @returns created user session */ public async create(userId: number, refreshToken: string, refreshTokenExpiresAt: Date): Promise { return await this.model.create({ @@ -110,9 +105,8 @@ export default class UserSessionSequelizeStorage { /** * Finds user session by refresh token - * * @param token - refresh token - * @returns { UserSession | null } found user session + * @returns found user session */ public async findByToken(token: string): Promise { return await this.model.findOne({ @@ -122,9 +116,8 @@ export default class UserSessionSequelizeStorage { /** * Removes user session by refresh token - * * @param refreshToken - refresh token - * @returns { void } + * @returns */ public async removeByRefreshToken(refreshToken: string): Promise { await this.model.destroy({ diff --git a/src/repository/storage/s3/index.ts b/src/repository/storage/s3/index.ts index 8e078453a..f52e77bcd 100644 --- a/src/repository/storage/s3/index.ts +++ b/src/repository/storage/s3/index.ts @@ -15,7 +15,6 @@ export class S3Storage { /** * Constructor for S3Bucket - * * @param accessKeyId - AWS access key * @param secretAccessKey - AWS secret access key * @param region - AWS region @@ -35,7 +34,6 @@ export class S3Storage { /** * Method to upload a file to S3 - * * @param bucket - S3 bucket name * @param key - Key to store the file in S3 * @param file - file data to upload @@ -66,7 +64,6 @@ export class S3Storage { /** * Method to get a file from S3 - * * @param bucket - S3 bucket name * @param key - Key of the file in S3 */ @@ -89,7 +86,6 @@ export class S3Storage { /** * Method to create bucket in object storage, return its location - * * @param name - bucket name */ public async createBucket(name: string): Promise { diff --git a/src/repository/storage/team.storage.ts b/src/repository/storage/team.storage.ts index 4e02b0997..a280978bf 100644 --- a/src/repository/storage/team.storage.ts +++ b/src/repository/storage/team.storage.ts @@ -3,4 +3,4 @@ import TeamSequelizeStorage from './postgres/orm/sequelize/teams.js'; /** * Current team storage */ -export default TeamSequelizeStorage; \ No newline at end of file +export default TeamSequelizeStorage; diff --git a/src/repository/team.repository.ts b/src/repository/team.repository.ts index 77ecc335e..a3a231418 100644 --- a/src/repository/team.repository.ts +++ b/src/repository/team.repository.ts @@ -14,7 +14,6 @@ export default class TeamRepository { /** * Team repository constructor - * * @param storage - storage for note */ constructor(storage: TeamStorage) { @@ -23,7 +22,6 @@ export default class TeamRepository { /** * Creates team member membership - * * @param teamMembershipData - data for team membership creation * @returns created team membership */ @@ -33,10 +31,9 @@ export default class TeamRepository { /** * Check if user is note team member - * * @param userId - user id to check * @param noteId - note id to identify team - * @returns { Promise } returns true if user is team member + * @returns returns true if user is team member */ public async isUserInTeam(userId: User['id'], noteId: NoteInternalId): Promise { return await this.storage.isUserInTeam(userId, noteId); @@ -44,7 +41,6 @@ export default class TeamRepository { /** * Get all team members by note id - * * @param noteId - note id to get all team members * @returns team relations */ @@ -54,17 +50,15 @@ export default class TeamRepository { /** * Get all team members by note id with info about users - * * @param noteId - note id to get all team members * @returns team with additional info */ public async getTeamMembersByNoteId(noteId: NoteInternalId): Promise { - return await this.storage.getTeamMembersWithUserInfoByNoteId(noteId); + return await this.storage.getTeamMembersWithUserInfoByNoteId(noteId); }; /** * Remove team member by id - * * @param userId - id of the team member * @param noteId - note internal id * @returns returns userId if team member was deleted and undefined overwise @@ -72,15 +66,15 @@ export default class TeamRepository { public async removeTeamMemberByUserIdAndNoteId(userId: TeamMember['id'], noteId: NoteInternalId): Promise { return await this.storage.removeTeamMemberByUserIdAndNoteId(userId, noteId); } + /** * Patch team member role by user and note id - * * @param id - id of team member * @param noteId - note internal id * @param role - team member new role * @returns returns 1 if the role has been changed and 0 otherwise */ - public async patchMemberRoleByUserId(id: TeamMember['id'], noteId: NoteInternalId, role : MemberRole): Promise { + public async patchMemberRoleByUserId(id: TeamMember['id'], noteId: NoteInternalId, role: MemberRole): Promise { return await this.storage.patchMemberRoleById(id, noteId, role); } } diff --git a/src/repository/transport/fetch.transport.ts b/src/repository/transport/fetch.transport.ts index 27ee5f263..ca937417e 100644 --- a/src/repository/transport/fetch.transport.ts +++ b/src/repository/transport/fetch.transport.ts @@ -4,7 +4,6 @@ export default class FetchTransport { /** * Fetch constructor - * * @param baseUrl - Base URL */ constructor(private readonly baseUrl: string) { @@ -12,14 +11,12 @@ export default class FetchTransport { /** * Make GET request - * * @template Response - Response data type * @param endpoint - API endpoint * @param headers - Request headers - * @returns { Promise } - Response data + * @returns - Response data */ public async get(endpoint: string, headers?: Record): Promise { - // eslint-disable-next-line no-undef const response = await fetch(this.baseUrl + endpoint, { method: 'GET', headers, @@ -30,13 +27,11 @@ export default class FetchTransport { /** * Make POST request - * * @param endpoint - API endpoint * @param headers - request headers * @param data - request body data */ public async post(endpoint: string, headers?: Record, data?: FormData | string): Promise { - // eslint-disable-next-line no-undef const response = await fetch(this.baseUrl + endpoint, { method: 'POST', headers, diff --git a/src/repository/transport/google-api/index.ts b/src/repository/transport/google-api/index.ts index 0dab35117..7a7845b1b 100644 --- a/src/repository/transport/google-api/index.ts +++ b/src/repository/transport/google-api/index.ts @@ -7,7 +7,6 @@ import type { ApiResponse } from '@repository/transport/google-api/types/ApiResp export default class GoogleApiTransport extends Transport { /** * Constructor for Google api transport - * * @param baseUrl - Base URL of Google api */ constructor(baseUrl = 'https://www.googleapis.com/oauth2/v2') { @@ -16,7 +15,6 @@ export default class GoogleApiTransport extends Transport { /** * Make GET request with authorization to Google API - * * @param endpoint - API endpoint * @param accessToken - access token for authorization to Google API */ diff --git a/src/repository/transport/google-api/types/ApiResponse.ts b/src/repository/transport/google-api/types/ApiResponse.ts index c70c8f14b..e1f589252 100644 --- a/src/repository/transport/google-api/types/ApiResponse.ts +++ b/src/repository/transport/google-api/types/ApiResponse.ts @@ -11,7 +11,7 @@ interface ApiErrorResponse { * Error message */ message: string; - } + }; } export type ApiResponse = Payload | ApiErrorResponse; diff --git a/src/repository/transport/google-api/types/GetUserInfoResponsePayload.ts b/src/repository/transport/google-api/types/GetUserInfoResponsePayload.ts index 90bae8bc6..f39aa7613 100644 --- a/src/repository/transport/google-api/types/GetUserInfoResponsePayload.ts +++ b/src/repository/transport/google-api/types/GetUserInfoResponsePayload.ts @@ -23,4 +23,3 @@ export default interface GetUserInfoResponsePayload { */ picture: string; } - diff --git a/src/repository/transport/openai-api/index.ts b/src/repository/transport/openai-api/index.ts index 818b10dd4..73224f93d 100644 --- a/src/repository/transport/openai-api/index.ts +++ b/src/repository/transport/openai-api/index.ts @@ -8,7 +8,6 @@ import type { ApiResponse } from '../google-api/types/ApiResponse.js'; export default class OpenAIApi extends Transport { /** * Constructs OpenAI api tranport instance - * * @param baseUrl - Base url for the api */ constructor(baseUrl: string = 'https://api.openai.com/v1') { @@ -17,7 +16,6 @@ export default class OpenAIApi extends Transport { /** * Make GET request with authorization to OpenAI API - * * @param endpoint - api endpoint * @param data - form-data or text to request ChatGPT */ diff --git a/src/repository/transport/openai-api/types/GetCompletionResponsePayload.ts b/src/repository/transport/openai-api/types/GetCompletionResponsePayload.ts index 1229b4c80..148abfc39 100644 --- a/src/repository/transport/openai-api/types/GetCompletionResponsePayload.ts +++ b/src/repository/transport/openai-api/types/GetCompletionResponsePayload.ts @@ -29,6 +29,6 @@ export type GetCompletionResponsePayload = { message: { role: string; content: string; - } - }> + }; + }>; }; diff --git a/src/repository/user.repository.ts b/src/repository/user.repository.ts index 5c24a278b..b8efe68ce 100644 --- a/src/repository/user.repository.ts +++ b/src/repository/user.repository.ts @@ -12,7 +12,7 @@ export enum Provider { /** * Google provider */ - GOOGLE = 'google', + GOOGLE = 'google' } /** @@ -46,7 +46,6 @@ export default class UserRepository { /** * User repository constructor - * * @param storage - storage for user * @param googleApiTransport - google api transport */ @@ -57,9 +56,8 @@ export default class UserRepository { /** * Get all user information by it's identifier - * * @param userId - unique user numeric identifier - * @returns { Promise } found user + * @returns found user */ public async getUserById(userId: User['id']): Promise { return this.storage.getUserByIdOrEmail({ @@ -69,10 +67,9 @@ export default class UserRepository { /** * Get user data from oauth provider, create user if not exists - * * @param accessToken - provider access token * @param provider - provider - * @returns { Promise } found user + * @returns found user */ public async getOrCreateUserByProvider(accessToken: string, provider: Provider): Promise { let res: GetUserInfoResponsePayload | null; @@ -125,7 +122,6 @@ export default class UserRepository { /** * Adding link between user and tool - * * @param options - identifiers of user and tool */ public async addUserEditorTool({ userId, toolId }: AddUserToolOptions): Promise { @@ -137,7 +133,6 @@ export default class UserRepository { /** * Removing link between user and tool - * * @param options - identifiers of user and tool */ public async removeUserEditorTool({ userId, toolId }: RemoveUserEditorToolOptions): Promise { diff --git a/src/repository/userSession.repository.ts b/src/repository/userSession.repository.ts index d03d3ff03..fd7eca7fe 100644 --- a/src/repository/userSession.repository.ts +++ b/src/repository/userSession.repository.ts @@ -12,7 +12,6 @@ export default class UserSessionRepository { /** * User session repository constructor - * * @param storage - storage for user session */ constructor(storage: UserSessionsStorage) { @@ -21,11 +20,10 @@ export default class UserSessionRepository { /** * Add user session - * * @param userId - user id * @param refreshToken - refresh token * @param refreshTokenExpiresAt - refresh token expiration date - * @returns { Promise } added user session + * @returns added user session */ public async addUserSession(userId: number, refreshToken: string, refreshTokenExpiresAt: Date): Promise { /** @@ -36,9 +34,8 @@ export default class UserSessionRepository { /** * Gets user session by refresh token - * * @param token - refresh token - * @returns { Promise } found user session + * @returns found user session */ public async getUserSessionByRefreshToken(token: string): Promise { return await this.storage.findByToken(token); @@ -46,9 +43,8 @@ export default class UserSessionRepository { /** * Removes user session by refresh token - * * @param refreshToken - refresh token - * @returns { Promise } + * @returns */ public async removeUserSessionByRefreshToken(refreshToken: string): Promise { await this.storage.removeByRefreshToken(refreshToken); diff --git a/src/tests/utils/database-helpers.ts b/src/tests/utils/database-helpers.ts index 9d70fb674..ea44c3b24 100644 --- a/src/tests/utils/database-helpers.ts +++ b/src/tests/utils/database-helpers.ts @@ -37,38 +37,38 @@ const DEFAULT_NOTE_CONTENT = { * default type for note mock creation attributes */ type NoteMockCreationAttributes = { - creatorId: Note['creatorId'], - content?: Note['content'], - publicId?: Note['publicId'], - tools?: Note['tools'], + creatorId: Note['creatorId']; + content?: Note['content']; + publicId?: Note['publicId']; + tools?: Note['tools']; }; /** * default type for user mock creation attributes */ type UserMockCreationAttributes = { - email?: User['email'], - name?: User['name'], - editorTools?: User['editorTools'], + email?: User['email']; + name?: User['name']; + editorTools?: User['editorTools']; }; /** * default type for user session mock creation attributes */ type UserSessionMockCreationAttributes = { - userId: UserSession['userId'], - refreshToker?: UserSession['refreshToken'], - refreshTokenExpiresAt?: UserSession['refreshTokenExpiresAt'], + userId: UserSession['userId']; + refreshToker?: UserSession['refreshToken']; + refreshTokenExpiresAt?: UserSession['refreshTokenExpiresAt']; }; /** * default type for note settings mock creation attributes */ type NoteSettingsMockCreationAttributes = { - noteId: NoteSettings['noteId'], - customHostname?: NoteSettings['customHostname'], - isPublic: NoteSettings['isPublic'], - invitationHash?: NoteSettings['invitationHash'], + noteId: NoteSettings['noteId']; + customHostname?: NoteSettings['customHostname']; + isPublic: NoteSettings['isPublic']; + invitationHash?: NoteSettings['invitationHash']; }; /** @@ -80,8 +80,8 @@ type NoteTeamMockCreationAttributes = Omit; * default type for note relation mock creation attributes */ type NoteRelationMockCreationAttributes = { - noteId: Note['id'], - parentId: Note['id'], + noteId: Note['id']; + parentId: Note['id']; }; /** @@ -93,9 +93,9 @@ type EditorToolMockCreationAttributes = Omit; * default type for note visit mock creation attributes */ type NoteVisitCreationAttributes = { - noteId: NoteVisit['noteId'], - userId: NoteVisit['userId'], - visitedAt?: NoteVisit['visitedAt'], + noteId: NoteVisit['noteId']; + userId: NoteVisit['userId']; + visitedAt?: NoteVisit['visitedAt']; }; /** @@ -116,7 +116,6 @@ export default class DatabaseHelpers { /** * Executes specified sql query in test DB. * Might be used in tests to perform some specific database operations - * * @param sqlString - string containing sql to executein test DB */ public async query(sqlString: string): Promise { @@ -126,7 +125,6 @@ export default class DatabaseHelpers { /** * Inserts note mock to then db * Automatically adds note creator to note team - * * @param note - note object which contain all info about note * * If content is not passed, it's value in database would be {} @@ -158,7 +156,6 @@ export default class DatabaseHelpers { /** * Inserts user mock to then db - * * @param user - user object which contain all info about user * * If name is not passed, it's value in database would be 'CodeX' @@ -186,7 +183,6 @@ export default class DatabaseHelpers { /** * Inserts user session mock to the db - * * @param userSession - userSession object which contain all info about userSession (some info is optional) * * refreshTokenExpiresAt should be given as Postgres DATE string (e.g. `CURRENT_DATE + INTERVAL '1 day'`) @@ -203,7 +199,6 @@ export default class DatabaseHelpers { /** * Inserts note settings mock to then db - * * @param noteSettings - noteSettings object which contain all info about noteSettings (some info is optional * * If customHostname is not passed, it's value in database would be null @@ -222,7 +217,6 @@ export default class DatabaseHelpers { /** * Inserts note team mock to then db - * * @param noteTeam - object that contains all info about noteTeam */ public async insertNoteTeam(noteTeam: NoteTeamMockCreationAttributes): Promise { @@ -233,7 +227,6 @@ export default class DatabaseHelpers { /** * Inserts note relation mock to then db - * * @param noteRelation object which contain all info about noteRelation */ public async insertNoteRelation(noteRelation: NoteRelationMockCreationAttributes): Promise { @@ -244,7 +237,6 @@ export default class DatabaseHelpers { /** * Inserts editor tool mock to then db - * * @param editorTool object which contain all info about editorTool (some info is optional) * * if no isDefault passed, then is_default would be false in database @@ -252,7 +244,6 @@ export default class DatabaseHelpers { public async insertEditorTool(editorTool: EditorToolMockCreationAttributes): Promise { const isDefault = editorTool.isDefault ?? false; - const [result, _] = await this.orm.connection.query(`INSERT INTO public.editor_tools ("name", "title", "export_name", "source", "is_default") VALUES ('${editorTool.name}', '${editorTool.title}', '${editorTool.exportName}', '${JSON.stringify(editorTool.source)}', ${isDefault}) RETURNING "id"`); @@ -264,7 +255,6 @@ export default class DatabaseHelpers { /** * Inserts note visit mock into db - * * @param visit object which contain all info about noteVisit (visitedAt is optional) * * if no visitedAt passed, then visited_at would have CLOCK_TIMESTAMP() value @@ -272,7 +262,6 @@ export default class DatabaseHelpers { public async insertNoteVisit(visit: NoteVisitCreationAttributes): Promise { const visitedAt = visit.visitedAt ?? 'CLOCK_TIMESTAMP()'; - const [results, _] = await this.orm.connection.query(`INSERT INTO public.note_visits ("user_id", "note_id", "visited_at") VALUES (${visit.userId}, ${visit.noteId}, ${visitedAt}) RETURNING "user_id" AS "userId", "note_id" AS "noteId", "visited_at" AS "visitedAt"`, @@ -318,7 +307,6 @@ export default class DatabaseHelpers { END LOOP; END $$ LANGUAGE plpgsql;`); - /** Insert default tools */ await this.orm.connection.query(` INSERT INTO public.editor_tools (name, title, export_name, source, is_default) diff --git a/src/tests/utils/s3-helpers.ts b/src/tests/utils/s3-helpers.ts index 605c824bb..94547e4a9 100644 --- a/src/tests/utils/s3-helpers.ts +++ b/src/tests/utils/s3-helpers.ts @@ -16,12 +16,12 @@ export default class S3Helpers { /** * Constructor for s3 helpers - * * @param s3 - s3 client instance */ constructor(s3: S3Storage) { this.s3 = s3; } + /** * Create buckets in s3 storage for testing */ diff --git a/src/tests/utils/setup.ts b/src/tests/utils/setup.ts index 425fe609a..3a9a7baec 100644 --- a/src/tests/utils/setup.ts +++ b/src/tests/utils/setup.ts @@ -16,6 +16,7 @@ import type Api from '@presentation/api.interface.js'; import DatabaseHelpers from './database-helpers.js'; import { S3Storage } from '@repository/storage/s3/index.js'; import S3Helpers from './s3-helpers.js'; +import process from 'process'; /** * Tests setup maximum duration. @@ -28,13 +29,12 @@ declare global { * Globally exposed variable, containing reference to http server object. * Is accessed as 'global.server' in tests */ - /* eslint-disable-next-line no-var */ + var api: Api | undefined; /** * Globally exposed method for creating accessToken using id * Is accessed as 'global.server' in tests - * * @param userId - id of the user that will be considered the author of the request * @returns accessToken for authorization */ @@ -43,13 +43,13 @@ declare global { /** * DatabaseHelpers class that contains methods for work with database */ - /* eslint-disable-next-line no-var */ + var db: DatabaseHelpers; /** * S3Helpers class that contains methods for work with s3 */ - /* eslint-disable-next-line no-var */ + var s3: S3Helpers; } @@ -81,7 +81,7 @@ beforeAll(async () => { global.api = api; global.auth = (userId: number) => { - return domainServices.authService.signAccessToken({ id : userId }); + return domainServices.authService.signAccessToken({ id: userId }); }; global.db = new DatabaseHelpers(orm); diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json new file mode 100644 index 000000000..72273ca32 --- /dev/null +++ b/tsconfig.eslint.json @@ -0,0 +1,8 @@ + { + "extends": "./tsconfig.json", + "include": [ + "src/**/*.ts", + "eslint.config.mjs", + "vitest.config.js", + ], + } diff --git a/tsconfig.json b/tsconfig.json index 3c6ba432c..3fffa75c6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,12 +19,6 @@ "@tests/*": ["tests/*"] }, }, - "include": [ - "src/**/*.ts", - "vitest.config.js", - ".eslintrc.cjs", - "fastify.d.ts", - ], "ts-node": { // Tell ts-node CLI to install the --loader automatically "esm": true diff --git a/tsconfig.test.json b/tsconfig.test.json new file mode 100644 index 000000000..13bd3761c --- /dev/null +++ b/tsconfig.test.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "include": [ + "src/tests/**/*", + "**/*.test.ts", + ], +} diff --git a/vitest.config.js b/vitest.config.js index bdbbeb9d9..056415014 100644 --- a/vitest.config.js +++ b/vitest.config.js @@ -1,7 +1,5 @@ import { defineConfig } from 'vitest/config'; -/* eslint-disable @typescript-eslint/naming-convention */ - export default defineConfig({ test: { pool: 'forks', @@ -10,7 +8,7 @@ export default defineConfig({ singleFork: true, }, }, - setupFiles: [ 'src/tests/utils/setup.ts' ], + setupFiles: ['src/tests/utils/setup.ts'], coverage: { reporter: ['text', 'json-summary', 'json'], reportOnFailure: true, diff --git a/yarn.lock b/yarn.lock index a1f67cbde..f5da17495 100644 --- a/yarn.lock +++ b/yarn.lock @@ -56,14 +56,14 @@ __metadata: languageName: node linkType: hard -"@es-joy/jsdoccomment@npm:~0.41.0": - version: 0.41.0 - resolution: "@es-joy/jsdoccomment@npm:0.41.0" +"@es-joy/jsdoccomment@npm:~0.42.0": + version: 0.42.0 + resolution: "@es-joy/jsdoccomment@npm:0.42.0" dependencies: comment-parser: 1.4.1 esquery: ^1.5.0 jsdoc-type-pratt-parser: ~4.0.0 - checksum: cfe0714027ff8fa82dad8c84f75af3f6df9d6797d60c289b8d3c259c5375c134bd5ca630beba0daed3adceef01a74f19e05052018f6b66ad6a4f483adf599c39 + checksum: ea0b56ca8d7470cac4694669807e4b4bbf25389c220af483ea14455c31d4a9e0f6ef0b08f45b92eb8c401bb3d6f662b4b14da51f222b85d78b2b757372072652 languageName: node linkType: hard @@ -239,34 +239,41 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.5.1, @eslint-community/regexpp@npm:^4.6.0, @eslint-community/regexpp@npm:^4.6.1": +"@eslint-community/regexpp@npm:^4.10.0": + version: 4.10.0 + resolution: "@eslint-community/regexpp@npm:4.10.0" + checksum: 2a6e345429ea8382aaaf3a61f865cae16ed44d31ca917910033c02dc00d505d939f10b81e079fa14d43b51499c640138e153b7e40743c4c094d9df97d4e56f7b + languageName: node + linkType: hard + +"@eslint-community/regexpp@npm:^4.6.0, @eslint-community/regexpp@npm:^4.6.1": version: 4.9.1 resolution: "@eslint-community/regexpp@npm:4.9.1" checksum: 06fb839e9c756f6375cc545c2f2e05a0a64576bd6370e8e3c07983fd29a3d6e164ef4aa48a361f7d27e6713ab79c83053ff6a2ccb78748bc955e344279c4a3b6 languageName: node linkType: hard -"@eslint/eslintrc@npm:^2.1.2": - version: 2.1.2 - resolution: "@eslint/eslintrc@npm:2.1.2" +"@eslint/eslintrc@npm:^3.0.2": + version: 3.0.2 + resolution: "@eslint/eslintrc@npm:3.0.2" dependencies: ajv: ^6.12.4 debug: ^4.3.2 - espree: ^9.6.0 - globals: ^13.19.0 + espree: ^10.0.1 + globals: ^14.0.0 ignore: ^5.2.0 import-fresh: ^3.2.1 js-yaml: ^4.1.0 minimatch: ^3.1.2 strip-json-comments: ^3.1.1 - checksum: bc742a1e3b361f06fedb4afb6bf32cbd27171292ef7924f61c62f2aed73048367bcc7ac68f98c06d4245cd3fabc43270f844e3c1699936d4734b3ac5398814a7 + checksum: 05bf516b60fbb1c1bdc264e081118b2172c5feb071cd665976482c5614b8e7950991175fea3ca6b1f482ced7cb0d0aa34ceab3a508d6bf1ff17b4efc0911e293 languageName: node linkType: hard -"@eslint/js@npm:8.51.0": - version: 8.51.0 - resolution: "@eslint/js@npm:8.51.0" - checksum: 0228bf1e1e0414843e56d9ff362a2a72d579c078f93174666f29315690e9e30a8633ad72c923297f7fd7182381b5a476805ff04dac8debe638953eb1ded3ac73 +"@eslint/js@npm:9.2.0, @eslint/js@npm:^9.1.1": + version: 9.2.0 + resolution: "@eslint/js@npm:9.2.0" + checksum: b5617fd35bd4d9521c6b21c1dc6692b29b65be54d35905f2ed529f02e4014b9ad9d1fcdbd3dfea589636a98c8396489625c94f5dd05ce3c35ca5ac5537904764 languageName: node linkType: hard @@ -490,14 +497,14 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/config-array@npm:^0.11.11": - version: 0.11.13 - resolution: "@humanwhocodes/config-array@npm:0.11.13" +"@humanwhocodes/config-array@npm:^0.13.0": + version: 0.13.0 + resolution: "@humanwhocodes/config-array@npm:0.13.0" dependencies: - "@humanwhocodes/object-schema": ^2.0.1 - debug: ^4.1.1 + "@humanwhocodes/object-schema": ^2.0.3 + debug: ^4.3.1 minimatch: ^3.0.5 - checksum: f8ea57b0d7ed7f2d64cd3944654976829d9da91c04d9c860e18804729a33f7681f78166ef4c761850b8c324d362f7d53f14c5c44907a6b38b32c703ff85e4805 + checksum: eae69ff9134025dd2924f0b430eb324981494be26f0fddd267a33c28711c4db643242cf9fddf7dadb9d16c96b54b2d2c073e60a56477df86e0173149313bd5d6 languageName: node linkType: hard @@ -508,10 +515,17 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/object-schema@npm:^2.0.1": - version: 2.0.1 - resolution: "@humanwhocodes/object-schema@npm:2.0.1" - checksum: 24929487b1ed48795d2f08346a0116cc5ee4634848bce64161fb947109352c562310fd159fc64dda0e8b853307f5794605191a9547f7341158559ca3c8262a45 +"@humanwhocodes/object-schema@npm:^2.0.3": + version: 2.0.3 + resolution: "@humanwhocodes/object-schema@npm:2.0.3" + checksum: d3b78f6c5831888c6ecc899df0d03bcc25d46f3ad26a11d7ea52944dc36a35ef543fad965322174238d677a43d5c694434f6607532cff7077062513ad7022631 + languageName: node + linkType: hard + +"@humanwhocodes/retry@npm:^0.2.3": + version: 0.2.4 + resolution: "@humanwhocodes/retry@npm:0.2.4" + checksum: a40bd0a86e985b84b4ebc14e4e44c0433afc71e0ac0ac62ffe7b3fc19a56943101dc0492d1f819283c363203ff9d1ead641b405a34f7a29b9b39297c920d9296 languageName: node linkType: hard @@ -775,6 +789,75 @@ __metadata: languageName: node linkType: hard +"@stylistic/eslint-plugin-js@npm:1.8.1, @stylistic/eslint-plugin-js@npm:^1.8.1": + version: 1.8.1 + resolution: "@stylistic/eslint-plugin-js@npm:1.8.1" + dependencies: + "@types/eslint": ^8.56.10 + acorn: ^8.11.3 + escape-string-regexp: ^4.0.0 + eslint-visitor-keys: ^3.4.3 + espree: ^9.6.1 + peerDependencies: + eslint: ">=8.40.0" + checksum: b0f71b2194ca9a525029615ef7c981d9457d266d7fd93d5a194b1f10d1a87f3bd99b46319f73058504c9706a2c79f747a2876693296077d875b72a40368fd4b4 + languageName: node + linkType: hard + +"@stylistic/eslint-plugin-jsx@npm:1.8.1": + version: 1.8.1 + resolution: "@stylistic/eslint-plugin-jsx@npm:1.8.1" + dependencies: + "@stylistic/eslint-plugin-js": ^1.8.1 + "@types/eslint": ^8.56.10 + estraverse: ^5.3.0 + picomatch: ^4.0.2 + peerDependencies: + eslint: ">=8.40.0" + checksum: 41b5ab07aec9b4dfb646a1d0ee448ccc820bdc2e8a47e32c3affc1ef6586e0cf825c757a9445ff1c8eb69bed4698bd76826bd5eebcd6969b78326573c3097373 + languageName: node + linkType: hard + +"@stylistic/eslint-plugin-plus@npm:1.8.1": + version: 1.8.1 + resolution: "@stylistic/eslint-plugin-plus@npm:1.8.1" + dependencies: + "@types/eslint": ^8.56.10 + "@typescript-eslint/utils": ^6.21.0 + peerDependencies: + eslint: "*" + checksum: 034d37d8af531e6b2e260fe91cc4703e4461a8b9a74e799e3ca9bcdeb3d5bda55a5ce0a0c48a98d863612ef5affbe950b77869de83eab94ebd90451d06526cac + languageName: node + linkType: hard + +"@stylistic/eslint-plugin-ts@npm:1.8.1": + version: 1.8.1 + resolution: "@stylistic/eslint-plugin-ts@npm:1.8.1" + dependencies: + "@stylistic/eslint-plugin-js": 1.8.1 + "@types/eslint": ^8.56.10 + "@typescript-eslint/utils": ^6.21.0 + peerDependencies: + eslint: ">=8.40.0" + checksum: 851e9c028d2146cf8ed0ee3a60bddbff413cd6a5594aac1921e845f560cd2808c25aee456a4862facae419c896e2b1c43a58720ebd72b60b25190a9a56e39af5 + languageName: node + linkType: hard + +"@stylistic/eslint-plugin@npm:^1.7.0": + version: 1.8.1 + resolution: "@stylistic/eslint-plugin@npm:1.8.1" + dependencies: + "@stylistic/eslint-plugin-js": 1.8.1 + "@stylistic/eslint-plugin-jsx": 1.8.1 + "@stylistic/eslint-plugin-plus": 1.8.1 + "@stylistic/eslint-plugin-ts": 1.8.1 + "@types/eslint": ^8.56.10 + peerDependencies: + eslint: ">=8.40.0" + checksum: 32e6648f873a0c4fcaa7b76d50b35bf5eb5e3763a2a0ad007f5d6637f061566dcfcd05eed6d22b7991f0c2aa290c5d4bd1c3d7c57cd5c9f71f64481894f7e683 + languageName: node + linkType: hard + "@testcontainers/localstack@npm:^10.9.0": version: 10.9.0 resolution: "@testcontainers/localstack@npm:10.9.0" @@ -858,7 +941,17 @@ __metadata: languageName: node linkType: hard -"@types/estree@npm:1.0.5, @types/estree@npm:^1.0.0": +"@types/eslint@npm:^8.56.10": + version: 8.56.10 + resolution: "@types/eslint@npm:8.56.10" + dependencies: + "@types/estree": "*" + "@types/json-schema": "*" + checksum: fb7137dd263ce1130b42d14452bdd0266ef81f52cb55ba1a5e9750e65da1f0596dc598c88bffc7e415458b6cb611a876dcc132bcf40ea48701c6d05b40c57be5 + languageName: node + linkType: hard + +"@types/estree@npm:*, @types/estree@npm:1.0.5, @types/estree@npm:^1.0.0": version: 1.0.5 resolution: "@types/estree@npm:1.0.5" checksum: dd8b5bed28e6213b7acd0fb665a84e693554d850b0df423ac8076cc3ad5823a6bc26b0251d080bdc545af83179ede51dd3f6fa78cad2c46ed1f29624ddf3e41a @@ -872,6 +965,13 @@ __metadata: languageName: node linkType: hard +"@types/json-schema@npm:*": + version: 7.0.15 + resolution: "@types/json-schema@npm:7.0.15" + checksum: 97ed0cb44d4070aecea772b7b2e2ed971e10c81ec87dd4ecc160322ffa55ff330dace1793489540e3e318d90942064bb697cc0f8989391797792d919737b3b98 + languageName: node + linkType: hard + "@types/json-schema@npm:^7.0.12": version: 7.0.14 resolution: "@types/json-schema@npm:7.0.14" @@ -973,46 +1073,44 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^6.2.0": - version: 6.21.0 - resolution: "@typescript-eslint/eslint-plugin@npm:6.21.0" +"@typescript-eslint/eslint-plugin@npm:7.9.0": + version: 7.9.0 + resolution: "@typescript-eslint/eslint-plugin@npm:7.9.0" dependencies: - "@eslint-community/regexpp": ^4.5.1 - "@typescript-eslint/scope-manager": 6.21.0 - "@typescript-eslint/type-utils": 6.21.0 - "@typescript-eslint/utils": 6.21.0 - "@typescript-eslint/visitor-keys": 6.21.0 - debug: ^4.3.4 + "@eslint-community/regexpp": ^4.10.0 + "@typescript-eslint/scope-manager": 7.9.0 + "@typescript-eslint/type-utils": 7.9.0 + "@typescript-eslint/utils": 7.9.0 + "@typescript-eslint/visitor-keys": 7.9.0 graphemer: ^1.4.0 - ignore: ^5.2.4 + ignore: ^5.3.1 natural-compare: ^1.4.0 - semver: ^7.5.4 - ts-api-utils: ^1.0.1 + ts-api-utils: ^1.3.0 peerDependencies: - "@typescript-eslint/parser": ^6.0.0 || ^6.0.0-alpha - eslint: ^7.0.0 || ^8.0.0 + "@typescript-eslint/parser": ^7.0.0 + eslint: ^8.56.0 peerDependenciesMeta: typescript: optional: true - checksum: 5ef2c502255e643e98051e87eb682c2a257e87afd8ec3b9f6274277615e1c2caf3131b352244cfb1987b8b2c415645eeacb9113fa841fc4c9b2ac46e8aed6efd + checksum: 0437d3d7a9adbd519e614a90633cd35fad4c9433d6b8902fd0f989907a3e0f05afc3a50ca35a8a02764e7333b92f5378088f657882f28c14a4d7e2433fea2766 languageName: node linkType: hard -"@typescript-eslint/parser@npm:^6.2.0": - version: 6.21.0 - resolution: "@typescript-eslint/parser@npm:6.21.0" +"@typescript-eslint/parser@npm:7.9.0": + version: 7.9.0 + resolution: "@typescript-eslint/parser@npm:7.9.0" dependencies: - "@typescript-eslint/scope-manager": 6.21.0 - "@typescript-eslint/types": 6.21.0 - "@typescript-eslint/typescript-estree": 6.21.0 - "@typescript-eslint/visitor-keys": 6.21.0 + "@typescript-eslint/scope-manager": 7.9.0 + "@typescript-eslint/types": 7.9.0 + "@typescript-eslint/typescript-estree": 7.9.0 + "@typescript-eslint/visitor-keys": 7.9.0 debug: ^4.3.4 peerDependencies: - eslint: ^7.0.0 || ^8.0.0 + eslint: ^8.56.0 peerDependenciesMeta: typescript: optional: true - checksum: 162fe3a867eeeffda7328bce32dae45b52283c68c8cb23258fb9f44971f761991af61f71b8c9fe1aa389e93dfe6386f8509c1273d870736c507d76dd40647b68 + checksum: df80976afba65cf09583874a4330e7e275ff7b599863124ae911fa52f1f097948cc04bcea711da44688ee6beb2713f1c377604224a965869e527ad7e3f30ca72 languageName: node linkType: hard @@ -1036,20 +1134,30 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:6.21.0": - version: 6.21.0 - resolution: "@typescript-eslint/type-utils@npm:6.21.0" +"@typescript-eslint/scope-manager@npm:7.9.0": + version: 7.9.0 + resolution: "@typescript-eslint/scope-manager@npm:7.9.0" dependencies: - "@typescript-eslint/typescript-estree": 6.21.0 - "@typescript-eslint/utils": 6.21.0 + "@typescript-eslint/types": 7.9.0 + "@typescript-eslint/visitor-keys": 7.9.0 + checksum: d63f140e6112df6a4902b670c4c1ad02e9dcbe46c85c859f098e43f2543102138874bfc4a31c61a466e7e526d280c09d6fddc33dea84c946db43a24d52108724 + languageName: node + linkType: hard + +"@typescript-eslint/type-utils@npm:7.9.0": + version: 7.9.0 + resolution: "@typescript-eslint/type-utils@npm:7.9.0" + dependencies: + "@typescript-eslint/typescript-estree": 7.9.0 + "@typescript-eslint/utils": 7.9.0 debug: ^4.3.4 - ts-api-utils: ^1.0.1 + ts-api-utils: ^1.3.0 peerDependencies: - eslint: ^7.0.0 || ^8.0.0 + eslint: ^8.56.0 peerDependenciesMeta: typescript: optional: true - checksum: 77025473f4d80acf1fafcce99c5c283e557686a61861febeba9c9913331f8a41e930bf5cd8b7a54db502a57b6eb8ea6d155cbd4f41349ed00e3d7aeb1f477ddc + checksum: 0e87d4d7ee38cf2f1fb899b6a466d9c6637a917bd7534dab9f58a709a5dbe72d98486187e900d553f2f9140799217d290402f4fdaf141253f56078019034ab3a languageName: node linkType: hard @@ -1067,6 +1175,13 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/types@npm:7.9.0": + version: 7.9.0 + resolution: "@typescript-eslint/types@npm:7.9.0" + checksum: 84c7e28b55a079dcd358aa6c20092819a20c20b167de4b04d86399e2ea1a0e28df92ee518c3b9236b7cd2cd72da81fc93e4bece48346e4a382723f4c857623ac + languageName: node + linkType: hard + "@typescript-eslint/typescript-estree@npm:6.21.0": version: 6.21.0 resolution: "@typescript-eslint/typescript-estree@npm:6.21.0" @@ -1104,7 +1219,40 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:6.21.0": +"@typescript-eslint/typescript-estree@npm:7.9.0": + version: 7.9.0 + resolution: "@typescript-eslint/typescript-estree@npm:7.9.0" + dependencies: + "@typescript-eslint/types": 7.9.0 + "@typescript-eslint/visitor-keys": 7.9.0 + debug: ^4.3.4 + globby: ^11.1.0 + is-glob: ^4.0.3 + minimatch: ^9.0.4 + semver: ^7.6.0 + ts-api-utils: ^1.3.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: 45da640ca585bf89b896a06a71889be2cdf25e5efa5ebf1d3196bf7d3ce256f0432d4caa4a04a0d877f2db504c5c3a50a37310f56b2c84af49704cea3d0a596b + languageName: node + linkType: hard + +"@typescript-eslint/utils@npm:7.9.0": + version: 7.9.0 + resolution: "@typescript-eslint/utils@npm:7.9.0" + dependencies: + "@eslint-community/eslint-utils": ^4.4.0 + "@typescript-eslint/scope-manager": 7.9.0 + "@typescript-eslint/types": 7.9.0 + "@typescript-eslint/typescript-estree": 7.9.0 + peerDependencies: + eslint: ^8.56.0 + checksum: bec0bb97ec430247534e0eb60f0ba86f739968351d73fda57a1e7b70417057f3eec438d3f1014336fcb35e2c18de1eb444a0cb59de78de0921d10d5066907356 + languageName: node + linkType: hard + +"@typescript-eslint/utils@npm:^6.21.0": version: 6.21.0 resolution: "@typescript-eslint/utils@npm:6.21.0" dependencies: @@ -1158,6 +1306,16 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/visitor-keys@npm:7.9.0": + version: 7.9.0 + resolution: "@typescript-eslint/visitor-keys@npm:7.9.0" + dependencies: + "@typescript-eslint/types": 7.9.0 + eslint-visitor-keys: ^3.4.3 + checksum: 29ed6af19f8e00110ccf2e0526ef8e4162ac18b2ca81a26f34b28719b2723faa028ff3485722bfa64864b23428e8d29453a7593f082d593326c21fd94f1499d9 + languageName: node + linkType: hard + "@vitest/coverage-v8@npm:^0.34.5": version: 0.34.6 resolution: "@vitest/coverage-v8@npm:0.34.6" @@ -1523,16 +1681,27 @@ __metadata: languageName: node linkType: hard -"array-includes@npm:^3.1.6": - version: 3.1.7 - resolution: "array-includes@npm:3.1.7" +"array-buffer-byte-length@npm:^1.0.1": + version: 1.0.1 + resolution: "array-buffer-byte-length@npm:1.0.1" dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.22.1 - get-intrinsic: ^1.2.1 + call-bind: ^1.0.5 + is-array-buffer: ^3.0.4 + checksum: 53524e08f40867f6a9f35318fafe467c32e45e9c682ba67b11943e167344d2febc0f6977a17e699b05699e805c3e8f073d876f8bbf1b559ed494ad2cd0fae09e + languageName: node + linkType: hard + +"array-includes@npm:^3.1.7": + version: 3.1.8 + resolution: "array-includes@npm:3.1.8" + dependencies: + call-bind: ^1.0.7 + define-properties: ^1.2.1 + es-abstract: ^1.23.2 + es-object-atoms: ^1.0.0 + get-intrinsic: ^1.2.4 is-string: ^1.0.7 - checksum: 06f9e4598fac12a919f7c59a3f04f010ea07f0b7f0585465ed12ef528a60e45f374e79d1bddbb34cdd4338357d00023ddbd0ac18b0be36964f5e726e8965d7fc + checksum: eb39ba5530f64e4d8acab39297c11c1c5be2a4ea188ab2b34aba5fb7224d918f77717a9d57a3e2900caaa8440e59431bdaf5c974d5212ef65d97f132e38e2d91 languageName: node linkType: hard @@ -1543,20 +1712,21 @@ __metadata: languageName: node linkType: hard -"array.prototype.findlastindex@npm:^1.2.2": - version: 1.2.3 - resolution: "array.prototype.findlastindex@npm:1.2.3" +"array.prototype.findlastindex@npm:^1.2.3": + version: 1.2.5 + resolution: "array.prototype.findlastindex@npm:1.2.5" dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.22.1 - es-shim-unscopables: ^1.0.0 - get-intrinsic: ^1.2.1 - checksum: 31f35d7b370c84db56484618132041a9af401b338f51899c2e78ef7690fbba5909ee7ca3c59a7192085b328cc0c68c6fd1f6d1553db01a689a589ae510f3966e + call-bind: ^1.0.7 + define-properties: ^1.2.1 + es-abstract: ^1.23.2 + es-errors: ^1.3.0 + es-object-atoms: ^1.0.0 + es-shim-unscopables: ^1.0.2 + checksum: 2c81cff2a75deb95bf1ed89b6f5f2bfbfb882211e3b7cc59c3d6b87df774cd9d6b36949a8ae39ac476e092c1d4a4905f5ee11a86a456abb10f35f8211ae4e710 languageName: node linkType: hard -"array.prototype.flat@npm:^1.3.1": +"array.prototype.flat@npm:^1.3.2": version: 1.3.2 resolution: "array.prototype.flat@npm:1.3.2" dependencies: @@ -1568,7 +1738,7 @@ __metadata: languageName: node linkType: hard -"array.prototype.flatmap@npm:^1.3.1": +"array.prototype.flatmap@npm:^1.3.2": version: 1.3.2 resolution: "array.prototype.flatmap@npm:1.3.2" dependencies: @@ -1595,6 +1765,22 @@ __metadata: languageName: node linkType: hard +"arraybuffer.prototype.slice@npm:^1.0.3": + version: 1.0.3 + resolution: "arraybuffer.prototype.slice@npm:1.0.3" + dependencies: + array-buffer-byte-length: ^1.0.1 + call-bind: ^1.0.5 + define-properties: ^1.2.1 + es-abstract: ^1.22.3 + es-errors: ^1.2.1 + get-intrinsic: ^1.2.3 + is-array-buffer: ^3.0.4 + is-shared-array-buffer: ^1.0.2 + checksum: 352259cba534dcdd969c92ab002efd2ba5025b2e3b9bead3973150edbdf0696c629d7f4b3f061c5931511e8207bdc2306da614703c820b45dabce39e3daf7e3e + languageName: node + linkType: hard + "asn1@npm:^0.2.6": version: 0.2.6 resolution: "asn1@npm:0.2.6" @@ -1646,7 +1832,7 @@ __metadata: languageName: node linkType: hard -"available-typed-arrays@npm:^1.0.6": +"available-typed-arrays@npm:^1.0.6, available-typed-arrays@npm:^1.0.7": version: 1.0.7 resolution: "available-typed-arrays@npm:1.0.7" dependencies: @@ -1782,6 +1968,13 @@ __metadata: languageName: node linkType: hard +"boolbase@npm:^1.0.0": + version: 1.0.0 + resolution: "boolbase@npm:1.0.0" + checksum: 3e25c80ef626c3a3487c73dbfc70ac322ec830666c9ad915d11b701142fab25ec1e63eff2c450c74347acfd2de854ccde865cd79ef4db1683f7c7b046ea43bb0 + languageName: node + linkType: hard + "brace-expansion@npm:^1.1.7": version: 1.1.11 resolution: "brace-expansion@npm:1.1.11" @@ -1876,15 +2069,6 @@ __metadata: languageName: node linkType: hard -"builtins@npm:^5.0.1": - version: 5.0.1 - resolution: "builtins@npm:5.0.1" - dependencies: - semver: ^7.0.0 - checksum: 66d204657fe36522822a95b288943ad11b58f5eaede235b11d8c4edaa28ce4800087d44a2681524c340494aadb120a0068011acabe99d30e8f11a7d826d83515 - languageName: node - linkType: hard - "byline@npm:^5.0.0": version: 5.0.0 resolution: "byline@npm:5.0.0" @@ -1930,7 +2114,7 @@ __metadata: languageName: node linkType: hard -"call-bind@npm:^1.0.5": +"call-bind@npm:^1.0.5, call-bind@npm:^1.0.6, call-bind@npm:^1.0.7": version: 1.0.7 resolution: "call-bind@npm:1.0.7" dependencies: @@ -2174,6 +2358,48 @@ __metadata: languageName: node linkType: hard +"cssesc@npm:^3.0.0": + version: 3.0.0 + resolution: "cssesc@npm:3.0.0" + bin: + cssesc: bin/cssesc + checksum: f8c4ababffbc5e2ddf2fa9957dda1ee4af6048e22aeda1869d0d00843223c1b13ad3f5d88b51caa46c994225eacb636b764eb807a8883e2fb6f99b4f4e8c48b2 + languageName: node + linkType: hard + +"data-view-buffer@npm:^1.0.1": + version: 1.0.1 + resolution: "data-view-buffer@npm:1.0.1" + dependencies: + call-bind: ^1.0.6 + es-errors: ^1.3.0 + is-data-view: ^1.0.1 + checksum: ce24348f3c6231223b216da92e7e6a57a12b4af81a23f27eff8feabdf06acfb16c00639c8b705ca4d167f761cfc756e27e5f065d0a1f840c10b907fdaf8b988c + languageName: node + linkType: hard + +"data-view-byte-length@npm:^1.0.1": + version: 1.0.1 + resolution: "data-view-byte-length@npm:1.0.1" + dependencies: + call-bind: ^1.0.7 + es-errors: ^1.3.0 + is-data-view: ^1.0.1 + checksum: dbb3200edcb7c1ef0d68979834f81d64fd8cab2f7691b3a4c6b97e67f22182f3ec2c8602efd7b76997b55af6ff8bce485829c1feda4fa2165a6b71fb7baa4269 + languageName: node + linkType: hard + +"data-view-byte-offset@npm:^1.0.0": + version: 1.0.0 + resolution: "data-view-byte-offset@npm:1.0.0" + dependencies: + call-bind: ^1.0.6 + es-errors: ^1.3.0 + is-data-view: ^1.0.1 + checksum: 7f0bf8720b7414ca719eedf1846aeec392f2054d7af707c5dc9a753cc77eb8625f067fa901e0b5127e831f9da9056138d894b9c2be79c27a21f6db5824f009c2 + languageName: node + linkType: hard + "dateformat@npm:^4.6.3": version: 4.6.3 resolution: "dateformat@npm:4.6.3" @@ -2181,7 +2407,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.1.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": +"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": version: 4.3.4 resolution: "debug@npm:4.3.4" dependencies: @@ -2229,7 +2455,7 @@ __metadata: languageName: node linkType: hard -"define-data-property@npm:^1.1.2": +"define-data-property@npm:^1.1.2, define-data-property@npm:^1.1.4": version: 1.1.4 resolution: "define-data-property@npm:1.1.4" dependencies: @@ -2240,7 +2466,7 @@ __metadata: languageName: node linkType: hard -"define-properties@npm:^1.1.3, define-properties@npm:^1.1.4, define-properties@npm:^1.2.0": +"define-properties@npm:^1.1.3, define-properties@npm:^1.1.4, define-properties@npm:^1.2.0, define-properties@npm:^1.2.1": version: 1.2.1 resolution: "define-properties@npm:1.2.1" dependencies: @@ -2338,15 +2564,6 @@ __metadata: languageName: node linkType: hard -"doctrine@npm:^3.0.0": - version: 3.0.0 - resolution: "doctrine@npm:3.0.0" - dependencies: - esutils: ^2.0.2 - checksum: fd7673ca77fe26cd5cba38d816bc72d641f500f1f9b25b83e8ce28827fe2da7ad583a8da26ab6af85f834138cf8dae9f69b0cd6ab925f52ddab1754db44d99ce - languageName: node - linkType: hard - "dottie@npm:^2.0.6": version: 2.0.6 resolution: "dottie@npm:2.0.6" @@ -2402,6 +2619,16 @@ __metadata: languageName: node linkType: hard +"enhanced-resolve@npm:^5.15.0": + version: 5.16.0 + resolution: "enhanced-resolve@npm:5.16.0" + dependencies: + graceful-fs: ^4.2.4 + tapable: ^2.2.0 + checksum: ccfd01850ecf2aa51e8554d539973319ff7d8a539ef1e0ba3460a0ccad6223c4ef6e19165ee64161b459cd8a48df10f52af4434c60023c65fde6afa32d475f7e + languageName: node + linkType: hard + "env-paths@npm:^2.2.0": version: 2.2.1 resolution: "env-paths@npm:2.2.1" @@ -2463,6 +2690,60 @@ __metadata: languageName: node linkType: hard +"es-abstract@npm:^1.22.3, es-abstract@npm:^1.23.0, es-abstract@npm:^1.23.2": + version: 1.23.3 + resolution: "es-abstract@npm:1.23.3" + dependencies: + array-buffer-byte-length: ^1.0.1 + arraybuffer.prototype.slice: ^1.0.3 + available-typed-arrays: ^1.0.7 + call-bind: ^1.0.7 + data-view-buffer: ^1.0.1 + data-view-byte-length: ^1.0.1 + data-view-byte-offset: ^1.0.0 + es-define-property: ^1.0.0 + es-errors: ^1.3.0 + es-object-atoms: ^1.0.0 + es-set-tostringtag: ^2.0.3 + es-to-primitive: ^1.2.1 + function.prototype.name: ^1.1.6 + get-intrinsic: ^1.2.4 + get-symbol-description: ^1.0.2 + globalthis: ^1.0.3 + gopd: ^1.0.1 + has-property-descriptors: ^1.0.2 + has-proto: ^1.0.3 + has-symbols: ^1.0.3 + hasown: ^2.0.2 + internal-slot: ^1.0.7 + is-array-buffer: ^3.0.4 + is-callable: ^1.2.7 + is-data-view: ^1.0.1 + is-negative-zero: ^2.0.3 + is-regex: ^1.1.4 + is-shared-array-buffer: ^1.0.3 + is-string: ^1.0.7 + is-typed-array: ^1.1.13 + is-weakref: ^1.0.2 + object-inspect: ^1.13.1 + object-keys: ^1.1.1 + object.assign: ^4.1.5 + regexp.prototype.flags: ^1.5.2 + safe-array-concat: ^1.1.2 + safe-regex-test: ^1.0.3 + string.prototype.trim: ^1.2.9 + string.prototype.trimend: ^1.0.8 + string.prototype.trimstart: ^1.0.8 + typed-array-buffer: ^1.0.2 + typed-array-byte-length: ^1.0.1 + typed-array-byte-offset: ^1.0.2 + typed-array-length: ^1.0.6 + unbox-primitive: ^1.0.2 + which-typed-array: ^1.1.15 + checksum: f840cf161224252512f9527306b57117192696571e07920f777cb893454e32999206198b4f075516112af6459daca282826d1735c450528470356d09eff3a9ae + languageName: node + linkType: hard + "es-define-property@npm:^1.0.0": version: 1.0.0 resolution: "es-define-property@npm:1.0.0" @@ -2472,13 +2753,22 @@ __metadata: languageName: node linkType: hard -"es-errors@npm:^1.3.0": +"es-errors@npm:^1.2.1, es-errors@npm:^1.3.0": version: 1.3.0 resolution: "es-errors@npm:1.3.0" checksum: ec1414527a0ccacd7f15f4a3bc66e215f04f595ba23ca75cdae0927af099b5ec865f9f4d33e9d7e86f512f252876ac77d4281a7871531a50678132429b1271b5 languageName: node linkType: hard +"es-object-atoms@npm:^1.0.0": + version: 1.0.0 + resolution: "es-object-atoms@npm:1.0.0" + dependencies: + es-errors: ^1.3.0 + checksum: 26f0ff78ab93b63394e8403c353842b2272836968de4eafe97656adfb8a7c84b9099bf0fe96ed58f4a4cddc860f6e34c77f91649a58a5daa4a9c40b902744e3c + languageName: node + linkType: hard + "es-set-tostringtag@npm:^2.0.1": version: 2.0.1 resolution: "es-set-tostringtag@npm:2.0.1" @@ -2490,6 +2780,17 @@ __metadata: languageName: node linkType: hard +"es-set-tostringtag@npm:^2.0.3": + version: 2.0.3 + resolution: "es-set-tostringtag@npm:2.0.3" + dependencies: + get-intrinsic: ^1.2.4 + has-tostringtag: ^1.0.2 + hasown: ^2.0.1 + checksum: 7227fa48a41c0ce83e0377b11130d324ac797390688135b8da5c28994c0165be8b252e15cd1de41e1325e5a5412511586960213e88f9ab4a5e7d028895db5129 + languageName: node + linkType: hard + "es-shim-unscopables@npm:^1.0.0": version: 1.0.0 resolution: "es-shim-unscopables@npm:1.0.0" @@ -2499,6 +2800,15 @@ __metadata: languageName: node linkType: hard +"es-shim-unscopables@npm:^1.0.2": + version: 1.0.2 + resolution: "es-shim-unscopables@npm:1.0.2" + dependencies: + hasown: ^2.0.0 + checksum: 432bd527c62065da09ed1d37a3f8e623c423683285e6188108286f4a1e8e164a5bcbfbc0051557c7d14633cd2a41ce24c7048e6bbb66a985413fd32f1be72626 + languageName: node + linkType: hard + "es-to-primitive@npm:^1.2.1": version: 1.2.1 resolution: "es-to-primitive@npm:1.2.1" @@ -2615,21 +2925,36 @@ __metadata: languageName: node linkType: hard -"eslint-config-codex@npm:^1.9.2": - version: 1.9.2 - resolution: "eslint-config-codex@npm:1.9.2" +"eslint-config-codex@npm:^2.0.0": + version: 2.0.0 + resolution: "eslint-config-codex@npm:2.0.0" dependencies: - "@typescript-eslint/eslint-plugin": ^6.2.0 - "@typescript-eslint/parser": ^6.2.0 + "@eslint/js": ^9.1.1 + "@stylistic/eslint-plugin": ^1.7.0 + eslint-config-flat-gitignore: ^0.1.5 eslint-config-standard: 17.1.0 - eslint-plugin-import: 2.28.0 - eslint-plugin-jsdoc: ^46.4.5 - eslint-plugin-n: ^16.0.1 + eslint-flat-config-utils: ^0.2.3 + eslint-plugin-import: 2.29.1 + eslint-plugin-jsdoc: ^48.2.3 + eslint-plugin-n: ^17.2.0 eslint-plugin-promise: 6.1.1 eslint-plugin-standard: 5.0.0 + eslint-plugin-vue: ^9.25.0 + globals: ^15.0.0 + vue-eslint-parser: ^9.4.2 peerDependencies: - eslint: ">= 5.3.0" - checksum: 603b085b2a3a1c778c21fe54fe5c13d6b954844e86bdde083b98558dc16c5c2eee769dab2e0fb52dec4202472106be99210c6d54f2febb0e7e5372d277104f91 + eslint: ">= 9.0.0" + checksum: b9024cb687e2c856c44ddcc7c17818ec4a1d28c9a56b8d3af657cbc141654cb6dda27e5bc21a794cea7415b9c84ee7b8578180f59582b964b8de2358a1f052f1 + languageName: node + linkType: hard + +"eslint-config-flat-gitignore@npm:^0.1.5": + version: 0.1.5 + resolution: "eslint-config-flat-gitignore@npm:0.1.5" + dependencies: + find-up: ^7.0.0 + parse-gitignore: ^2.0.0 + checksum: 1dbf7017513f7504d24cba763fd88020e832c0679bd4897eae8866fd3d1b19c155041fbf5f9c452c7a624894b45438e63da2856cbdb76cbffa535fc495821540 languageName: node linkType: hard @@ -2645,7 +2970,26 @@ __metadata: languageName: node linkType: hard -"eslint-import-resolver-node@npm:^0.3.7": +"eslint-flat-config-utils@npm:^0.2.3": + version: 0.2.4 + resolution: "eslint-flat-config-utils@npm:0.2.4" + dependencies: + "@types/eslint": ^8.56.10 + pathe: ^1.1.2 + checksum: 3cbe1c56fc531b5f579e37fa3aa7433f4679df413c5102677b9322bbdc5a06f9d311bb66900ee89edb8c6296b1c4638b4e1bff0f421ed99a6bbdea040c07110a + languageName: node + linkType: hard + +"eslint-import-resolver-alias@npm:1.1.2": + version: 1.1.2 + resolution: "eslint-import-resolver-alias@npm:1.1.2" + peerDependencies: + eslint-plugin-import: ">=1.4.0" + checksum: 3fbb9aeda98335060bb438ed8446a060d282f80a365838a82edb1f8743b1d54c89303009c7717e3c915d5d722e57148082c5ada4455e811acdc8ed3a65059fa1 + languageName: node + linkType: hard + +"eslint-import-resolver-node@npm:^0.3.9": version: 0.3.9 resolution: "eslint-import-resolver-node@npm:0.3.9" dependencies: @@ -2681,71 +3025,67 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-import@npm:2.28.0": - version: 2.28.0 - resolution: "eslint-plugin-import@npm:2.28.0" +"eslint-plugin-import@npm:2.29.1": + version: 2.29.1 + resolution: "eslint-plugin-import@npm:2.29.1" dependencies: - array-includes: ^3.1.6 - array.prototype.findlastindex: ^1.2.2 - array.prototype.flat: ^1.3.1 - array.prototype.flatmap: ^1.3.1 + array-includes: ^3.1.7 + array.prototype.findlastindex: ^1.2.3 + array.prototype.flat: ^1.3.2 + array.prototype.flatmap: ^1.3.2 debug: ^3.2.7 doctrine: ^2.1.0 - eslint-import-resolver-node: ^0.3.7 + eslint-import-resolver-node: ^0.3.9 eslint-module-utils: ^2.8.0 - has: ^1.0.3 - is-core-module: ^2.12.1 + hasown: ^2.0.0 + is-core-module: ^2.13.1 is-glob: ^4.0.3 minimatch: ^3.1.2 - object.fromentries: ^2.0.6 - object.groupby: ^1.0.0 - object.values: ^1.1.6 - resolve: ^1.22.3 + object.fromentries: ^2.0.7 + object.groupby: ^1.0.1 + object.values: ^1.1.7 semver: ^6.3.1 - tsconfig-paths: ^3.14.2 + tsconfig-paths: ^3.15.0 peerDependencies: eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 - checksum: f9eba311b93ca1bb89311856b1f7285bd79e0181d7eb70fe115053ff77e2235fea749b30f538b78927dc65769340b5be61f4c9581d1c82bcdcccb2061f440ad1 + checksum: e65159aef808136d26d029b71c8c6e4cb5c628e65e5de77f1eb4c13a379315ae55c9c3afa847f43f4ff9df7e54515c77ffc6489c6a6f81f7dd7359267577468c languageName: node linkType: hard -"eslint-plugin-jsdoc@npm:^46.4.5": - version: 46.10.1 - resolution: "eslint-plugin-jsdoc@npm:46.10.1" +"eslint-plugin-jsdoc@npm:^48.2.3": + version: 48.2.3 + resolution: "eslint-plugin-jsdoc@npm:48.2.3" dependencies: - "@es-joy/jsdoccomment": ~0.41.0 + "@es-joy/jsdoccomment": ~0.42.0 are-docs-informative: ^0.0.2 comment-parser: 1.4.1 debug: ^4.3.4 escape-string-regexp: ^4.0.0 esquery: ^1.5.0 is-builtin-module: ^3.2.1 - semver: ^7.5.4 + semver: ^7.6.0 spdx-expression-parse: ^4.0.0 peerDependencies: eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 - checksum: e3a658f72de9ac1c6d98fc1e406e4f1295f3f2a64da9ea977ba8bbb9ea93890945d0d4230dd50a1436ac8a935c4b3a49a02a5dae170810ba7fe6d46522dd17eb + checksum: 07307b43af441f51282b39953737674db3b4749c261d08af9dc25e9ab780f14d7608ff117313bedb4ae3dd8a53ff1c16ece6e22ef299901e7ce1fbef5bb8a734 languageName: node linkType: hard -"eslint-plugin-n@npm:^16.0.1": - version: 16.6.2 - resolution: "eslint-plugin-n@npm:16.6.2" +"eslint-plugin-n@npm:^17.2.0": + version: 17.4.0 + resolution: "eslint-plugin-n@npm:17.4.0" dependencies: "@eslint-community/eslint-utils": ^4.4.0 - builtins: ^5.0.1 + enhanced-resolve: ^5.15.0 eslint-plugin-es-x: ^7.5.0 get-tsconfig: ^4.7.0 - globals: ^13.24.0 + globals: ^15.0.0 ignore: ^5.2.4 - is-builtin-module: ^3.2.1 - is-core-module: ^2.12.1 - minimatch: ^3.1.2 - resolve: ^1.22.2 + minimatch: ^9.0.0 semver: ^7.5.3 peerDependencies: - eslint: ">=7.0.0" - checksum: 3b468da0038cf25af582608983491b33ac2d481b6a94a0ff2e715d3b85e1ff8cb93df4cd67b689d520bea1bfb8f2b717f01606bf6b2ea19fe8f9c0999ea7057d + eslint: ">=8.23.0" + checksum: e36279911ea967994c1546e412d02ab48a5d8a4182c43844a975b7dd97c61afad5ee124abb1ac9da0e1e195fc95559c4c914215d4e41fba55ddf47bfb4fc017b languageName: node linkType: hard @@ -2782,7 +3122,25 @@ __metadata: languageName: node linkType: hard -"eslint-scope@npm:^7.2.2": +"eslint-plugin-vue@npm:^9.25.0": + version: 9.25.0 + resolution: "eslint-plugin-vue@npm:9.25.0" + dependencies: + "@eslint-community/eslint-utils": ^4.4.0 + globals: ^13.24.0 + natural-compare: ^1.4.0 + nth-check: ^2.1.1 + postcss-selector-parser: ^6.0.15 + semver: ^7.6.0 + vue-eslint-parser: ^9.4.2 + xml-name-validator: ^4.0.0 + peerDependencies: + eslint: ^6.2.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 + checksum: 4685ea8b3feaa4dd9bf81edf4bd15493504a67ef5ba83b095ed41117bc816d21c111f4c39b6a82024f7d5c6950a7f13457bada26453a3835989221ff68e34ad1 + languageName: node + linkType: hard + +"eslint-scope@npm:^7.1.1": version: 7.2.2 resolution: "eslint-scope@npm:7.2.2" dependencies: @@ -2792,6 +3150,16 @@ __metadata: languageName: node linkType: hard +"eslint-scope@npm:^8.0.1": + version: 8.0.1 + resolution: "eslint-scope@npm:8.0.1" + dependencies: + esrecurse: ^4.3.0 + estraverse: ^5.2.0 + checksum: 67a5a39312dadb8c9a677df0f2e8add8daf15280b08bfe07f898d5347ee2d7cd2a1f5c2760f34e46e8f5f13f7192f47c2c10abe676bfa4173ae5539365551940 + languageName: node + linkType: hard + "eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3": version: 3.4.3 resolution: "eslint-visitor-keys@npm:3.4.3" @@ -2799,39 +3167,43 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.41.0": - version: 8.51.0 - resolution: "eslint@npm:8.51.0" +"eslint-visitor-keys@npm:^4.0.0": + version: 4.0.0 + resolution: "eslint-visitor-keys@npm:4.0.0" + checksum: 5c09f89cf29d87cdbfbac38802a880d3c2e65f8cb61c689888346758f1e24a4c7f6caefeac9474dfa52058a99920623599bdb00516976a30134abeba91275aa2 + languageName: node + linkType: hard + +"eslint@npm:^9.2.0": + version: 9.2.0 + resolution: "eslint@npm:9.2.0" dependencies: "@eslint-community/eslint-utils": ^4.2.0 "@eslint-community/regexpp": ^4.6.1 - "@eslint/eslintrc": ^2.1.2 - "@eslint/js": 8.51.0 - "@humanwhocodes/config-array": ^0.11.11 + "@eslint/eslintrc": ^3.0.2 + "@eslint/js": 9.2.0 + "@humanwhocodes/config-array": ^0.13.0 "@humanwhocodes/module-importer": ^1.0.1 + "@humanwhocodes/retry": ^0.2.3 "@nodelib/fs.walk": ^1.2.8 ajv: ^6.12.4 chalk: ^4.0.0 cross-spawn: ^7.0.2 debug: ^4.3.2 - doctrine: ^3.0.0 escape-string-regexp: ^4.0.0 - eslint-scope: ^7.2.2 - eslint-visitor-keys: ^3.4.3 - espree: ^9.6.1 + eslint-scope: ^8.0.1 + eslint-visitor-keys: ^4.0.0 + espree: ^10.0.1 esquery: ^1.4.2 esutils: ^2.0.2 fast-deep-equal: ^3.1.3 - file-entry-cache: ^6.0.1 + file-entry-cache: ^8.0.0 find-up: ^5.0.0 glob-parent: ^6.0.2 - globals: ^13.19.0 - graphemer: ^1.4.0 ignore: ^5.2.0 imurmurhash: ^0.1.4 is-glob: ^4.0.0 is-path-inside: ^3.0.3 - js-yaml: ^4.1.0 json-stable-stringify-without-jsonify: ^1.0.1 levn: ^0.4.1 lodash.merge: ^4.6.2 @@ -2842,11 +3214,22 @@ __metadata: text-table: ^0.2.0 bin: eslint: bin/eslint.js - checksum: 214fa5d1fcb67af1b8992ce9584ccd85e1aa7a482f8b8ea5b96edc28fa838a18a3b69456db45fc1ed3ef95f1e9efa9714f737292dc681e572d471d02fda9649c + checksum: 692f58f3e1939efc0875641af2f9a2788ebd870adf3b6a3c516e5e5d05df7cc54288056d7148200b7cecbbabdd14c61ded880861e95a230e5a8b80c184e780b7 languageName: node linkType: hard -"espree@npm:^9.6.0, espree@npm:^9.6.1": +"espree@npm:^10.0.1": + version: 10.0.1 + resolution: "espree@npm:10.0.1" + dependencies: + acorn: ^8.11.3 + acorn-jsx: ^5.3.2 + eslint-visitor-keys: ^4.0.0 + checksum: 62c9242a84c6741cebd35ede6574131d0419be7e5559566403e384087d99c4ddb2ced44e32acd44a4c3d8a8a84997cf8d78810c4e46b3fe25a804f1a92dc6b9d + languageName: node + linkType: hard + +"espree@npm:^9.3.1, espree@npm:^9.6.1": version: 9.6.1 resolution: "espree@npm:9.6.1" dependencies: @@ -2857,7 +3240,7 @@ __metadata: languageName: node linkType: hard -"esquery@npm:^1.4.2, esquery@npm:^1.5.0": +"esquery@npm:^1.4.0, esquery@npm:^1.4.2, esquery@npm:^1.5.0": version: 1.5.0 resolution: "esquery@npm:1.5.0" dependencies: @@ -2875,7 +3258,7 @@ __metadata: languageName: node linkType: hard -"estraverse@npm:^5.1.0, estraverse@npm:^5.2.0": +"estraverse@npm:^5.1.0, estraverse@npm:^5.2.0, estraverse@npm:^5.3.0": version: 5.3.0 resolution: "estraverse@npm:5.3.0" checksum: 072780882dc8416ad144f8fe199628d2b3e7bbc9989d9ed43795d2c90309a2047e6bc5979d7e2322a341163d22cfad9e21f4110597fe487519697389497e4e2b @@ -3089,12 +3472,12 @@ __metadata: languageName: node linkType: hard -"file-entry-cache@npm:^6.0.1": - version: 6.0.1 - resolution: "file-entry-cache@npm:6.0.1" +"file-entry-cache@npm:^8.0.0": + version: 8.0.0 + resolution: "file-entry-cache@npm:8.0.0" dependencies: - flat-cache: ^3.0.4 - checksum: f49701feaa6314c8127c3c2f6173cfefff17612f5ed2daaafc6da13b5c91fd43e3b2a58fd0d63f9f94478a501b167615931e7200e31485e320f74a33885a9c74 + flat-cache: ^4.0.0 + checksum: f67802d3334809048c69b3d458f672e1b6d26daefda701761c81f203b80149c35dea04d78ea4238969dd617678e530876722a0634c43031a0957f10cc3ed190f languageName: node linkType: hard @@ -3128,14 +3511,24 @@ __metadata: languageName: node linkType: hard -"flat-cache@npm:^3.0.4": - version: 3.1.1 - resolution: "flat-cache@npm:3.1.1" +"find-up@npm:^7.0.0": + version: 7.0.0 + resolution: "find-up@npm:7.0.0" + dependencies: + locate-path: ^7.2.0 + path-exists: ^5.0.0 + unicorn-magic: ^0.1.0 + checksum: e1c63860f9c04355ab2aa19f4be51c1a6e14a7d8cfbd8090e2be6da2a36a76995907cb45337a4b582b19b164388f71d6ab118869dc7bffb2093f2c089ecb95ee + languageName: node + linkType: hard + +"flat-cache@npm:^4.0.0": + version: 4.0.1 + resolution: "flat-cache@npm:4.0.1" dependencies: flatted: ^3.2.9 - keyv: ^4.5.3 - rimraf: ^3.0.2 - checksum: 4958cfe0f46acf84953d4e16676ef5f0d38eab3a92d532a1e8d5f88f11eea8b36d5d598070ff2aeae15f1fde18f8d7d089eefaf9db10b5a587cc1c9072325c7a + keyv: ^4.5.4 + checksum: 899fc86bf6df093547d76e7bfaeb900824b869d7d457d02e9b8aae24836f0a99fbad79328cfd6415ee8908f180699bf259dc7614f793447cb14f707caf5996f6 languageName: node linkType: hard @@ -3321,6 +3714,17 @@ __metadata: languageName: node linkType: hard +"get-symbol-description@npm:^1.0.2": + version: 1.0.2 + resolution: "get-symbol-description@npm:1.0.2" + dependencies: + call-bind: ^1.0.5 + es-errors: ^1.3.0 + get-intrinsic: ^1.2.4 + checksum: e1cb53bc211f9dbe9691a4f97a46837a553c4e7caadd0488dc24ac694db8a390b93edd412b48dcdd0b4bbb4c595de1709effc75fc87c0839deedc6968f5bd973 + languageName: node + linkType: hard + "get-tsconfig@npm:^4.7.0": version: 4.7.2 resolution: "get-tsconfig@npm:4.7.2" @@ -3390,15 +3794,6 @@ __metadata: languageName: node linkType: hard -"globals@npm:^13.19.0": - version: 13.23.0 - resolution: "globals@npm:13.23.0" - dependencies: - type-fest: ^0.20.2 - checksum: 194c97cf8d1ef6ba59417234c2386549c4103b6e5f24b1ff1952de61a4753e5d2069435ba629de711a6480b1b1d114a98e2ab27f85e966d5a10c319c3bbd3dc3 - languageName: node - linkType: hard - "globals@npm:^13.24.0": version: 13.24.0 resolution: "globals@npm:13.24.0" @@ -3408,6 +3803,20 @@ __metadata: languageName: node linkType: hard +"globals@npm:^14.0.0": + version: 14.0.0 + resolution: "globals@npm:14.0.0" + checksum: 534b8216736a5425737f59f6e6a5c7f386254560c9f41d24a9227d60ee3ad4a9e82c5b85def0e212e9d92162f83a92544be4c7fd4c902cb913736c10e08237ac + languageName: node + linkType: hard + +"globals@npm:^15.0.0": + version: 15.1.0 + resolution: "globals@npm:15.1.0" + checksum: 16a714da2b3bfa283d88a91f573006e8628a345fc37a5af0b332b31ea1f6af0c66afc2a515a1064fd5f736c49112e02159c1477de0f069a228b39d2853a1ae21 + languageName: node + linkType: hard + "globalthis@npm:^1.0.3": version: 1.0.3 resolution: "globalthis@npm:1.0.3" @@ -3484,7 +3893,7 @@ __metadata: languageName: node linkType: hard -"has-property-descriptors@npm:^1.0.1": +"has-property-descriptors@npm:^1.0.1, has-property-descriptors@npm:^1.0.2": version: 1.0.2 resolution: "has-property-descriptors@npm:1.0.2" dependencies: @@ -3500,6 +3909,13 @@ __metadata: languageName: node linkType: hard +"has-proto@npm:^1.0.3": + version: 1.0.3 + resolution: "has-proto@npm:1.0.3" + checksum: fe7c3d50b33f50f3933a04413ed1f69441d21d2d2944f81036276d30635cad9279f6b43bc8f32036c31ebdfcf6e731150f46c1907ad90c669ffe9b066c3ba5c4 + languageName: node + linkType: hard + "has-symbols@npm:^1.0.2, has-symbols@npm:^1.0.3": version: 1.0.3 resolution: "has-symbols@npm:1.0.3" @@ -3516,7 +3932,7 @@ __metadata: languageName: node linkType: hard -"has-tostringtag@npm:^1.0.1": +"has-tostringtag@npm:^1.0.1, has-tostringtag@npm:^1.0.2": version: 1.0.2 resolution: "has-tostringtag@npm:1.0.2" dependencies: @@ -3548,6 +3964,15 @@ __metadata: languageName: node linkType: hard +"hasown@npm:^2.0.1, hasown@npm:^2.0.2": + version: 2.0.2 + resolution: "hasown@npm:2.0.2" + dependencies: + function-bind: ^1.1.2 + checksum: e8516f776a15149ca6c6ed2ae3110c417a00b62260e222590e54aa367cbcd6ed99122020b37b7fbdf05748df57b265e70095d7bf35a47660587619b15ffb93db + languageName: node + linkType: hard + "help-me@npm:^4.0.1": version: 4.2.0 resolution: "help-me@npm:4.2.0" @@ -3666,6 +4091,13 @@ __metadata: languageName: node linkType: hard +"ignore@npm:^5.3.1": + version: 5.3.1 + resolution: "ignore@npm:5.3.1" + checksum: 71d7bb4c1dbe020f915fd881108cbe85a0db3d636a0ea3ba911393c53946711d13a9b1143c7e70db06d571a5822c0a324a6bcde5c9904e7ca5047f01f1bf8cd3 + languageName: node + linkType: hard + "import-fresh@npm:^3.2.1": version: 3.3.0 resolution: "import-fresh@npm:3.3.0" @@ -3725,6 +4157,17 @@ __metadata: languageName: node linkType: hard +"internal-slot@npm:^1.0.7": + version: 1.0.7 + resolution: "internal-slot@npm:1.0.7" + dependencies: + es-errors: ^1.3.0 + hasown: ^2.0.0 + side-channel: ^1.0.4 + checksum: cadc5eea5d7d9bc2342e93aae9f31f04c196afebb11bde97448327049f492cd7081e18623ae71388aac9cd237b692ca3a105be9c68ac39c1dec679d7409e33eb + languageName: node + linkType: hard + "ip@npm:^2.0.0": version: 2.0.0 resolution: "ip@npm:2.0.0" @@ -3760,6 +4203,16 @@ __metadata: languageName: node linkType: hard +"is-array-buffer@npm:^3.0.4": + version: 3.0.4 + resolution: "is-array-buffer@npm:3.0.4" + dependencies: + call-bind: ^1.0.2 + get-intrinsic: ^1.2.1 + checksum: e4e3e6ef0ff2239e75371d221f74bc3c26a03564a22efb39f6bb02609b598917ddeecef4e8c877df2a25888f247a98198959842a5e73236bc7f22cabdf6351a7 + languageName: node + linkType: hard + "is-bigint@npm:^1.0.1": version: 1.0.4 resolution: "is-bigint@npm:1.0.4" @@ -3804,7 +4257,7 @@ __metadata: languageName: node linkType: hard -"is-core-module@npm:^2.12.1, is-core-module@npm:^2.13.0": +"is-core-module@npm:^2.13.0": version: 2.13.0 resolution: "is-core-module@npm:2.13.0" dependencies: @@ -3813,6 +4266,24 @@ __metadata: languageName: node linkType: hard +"is-core-module@npm:^2.13.1": + version: 2.13.1 + resolution: "is-core-module@npm:2.13.1" + dependencies: + hasown: ^2.0.0 + checksum: 256559ee8a9488af90e4bad16f5583c6d59e92f0742e9e8bb4331e758521ee86b810b93bae44f390766ffbc518a0488b18d9dab7da9a5ff997d499efc9403f7c + languageName: node + linkType: hard + +"is-data-view@npm:^1.0.1": + version: 1.0.1 + resolution: "is-data-view@npm:1.0.1" + dependencies: + is-typed-array: ^1.1.13 + checksum: 4ba4562ac2b2ec005fefe48269d6bd0152785458cd253c746154ffb8a8ab506a29d0cfb3b74af87513843776a88e4981ae25c89457bf640a33748eab1a7216b5 + languageName: node + linkType: hard + "is-date-object@npm:^1.0.1": version: 1.0.5 resolution: "is-date-object@npm:1.0.5" @@ -3868,6 +4339,13 @@ __metadata: languageName: node linkType: hard +"is-negative-zero@npm:^2.0.3": + version: 2.0.3 + resolution: "is-negative-zero@npm:2.0.3" + checksum: c1e6b23d2070c0539d7b36022d5a94407132411d01aba39ec549af824231f3804b1aea90b5e4e58e807a65d23ceb538ed6e355ce76b267bdd86edb757ffcbdcd + languageName: node + linkType: hard + "is-number-object@npm:^1.0.4": version: 1.0.7 resolution: "is-number-object@npm:1.0.7" @@ -3910,6 +4388,15 @@ __metadata: languageName: node linkType: hard +"is-shared-array-buffer@npm:^1.0.3": + version: 1.0.3 + resolution: "is-shared-array-buffer@npm:1.0.3" + dependencies: + call-bind: ^1.0.7 + checksum: a4fff602c309e64ccaa83b859255a43bb011145a42d3f56f67d9268b55bc7e6d98a5981a1d834186ad3105d6739d21547083fe7259c76c0468483fc538e716d8 + languageName: node + linkType: hard + "is-stream@npm:^3.0.0": version: 3.0.0 resolution: "is-stream@npm:3.0.0" @@ -3944,7 +4431,7 @@ __metadata: languageName: node linkType: hard -"is-typed-array@npm:^1.1.3": +"is-typed-array@npm:^1.1.13, is-typed-array@npm:^1.1.3": version: 1.1.13 resolution: "is-typed-array@npm:1.1.13" dependencies: @@ -4183,7 +4670,7 @@ __metadata: languageName: node linkType: hard -"keyv@npm:^4.5.3": +"keyv@npm:^4.5.4": version: 4.5.4 resolution: "keyv@npm:4.5.4" dependencies: @@ -4241,6 +4728,15 @@ __metadata: languageName: node linkType: hard +"locate-path@npm:^7.2.0": + version: 7.2.0 + resolution: "locate-path@npm:7.2.0" + dependencies: + p-locate: ^6.0.0 + checksum: c1b653bdf29beaecb3d307dfb7c44d98a2a98a02ebe353c9ad055d1ac45d6ed4e1142563d222df9b9efebc2bcb7d4c792b507fad9e7150a04c29530b7db570f8 + languageName: node + linkType: hard + "lodash.defaults@npm:^4.2.0": version: 4.2.0 resolution: "lodash.defaults@npm:4.2.0" @@ -4504,6 +5000,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^9.0.0, minimatch@npm:^9.0.4": + version: 9.0.4 + resolution: "minimatch@npm:9.0.4" + dependencies: + brace-expansion: ^2.0.1 + checksum: cf717f597ec3eed7dabc33153482a2e8d49f4fd3c26e58fd9c71a94c5029a0838728841b93f46bf1263b65a8010e2ee800d0dc9b004ab8ba8b6d1ec07cc115b5 + languageName: node + linkType: hard + "minimist@npm:^1.2.0, minimist@npm:^1.2.6": version: 1.2.8 resolution: "minimist@npm:1.2.8" @@ -4825,8 +5330,9 @@ __metadata: "@vitest/coverage-v8": ^0.34.5 arg: ^5.0.2 aws-sdk: ^2.1569.0 - eslint: ^8.41.0 - eslint-config-codex: ^1.9.2 + eslint: ^9.2.0 + eslint-config-codex: ^2.0.0 + eslint-import-resolver-alias: 1.1.2 eslint-plugin-vitest: ^0.3.1 fastify: ^4.17.0 http-status-codes: ^2.2.0 @@ -4845,6 +5351,7 @@ __metadata: ts-node: ^10.9.1 tsc-alias: ^1.8.6 typescript: ^5.0.4 + typescript-eslint: ^7.6.0 vitest: ^1.4.0 zod: ^3.21.4 languageName: unknown @@ -4871,7 +5378,16 @@ __metadata: languageName: node linkType: hard -"object-inspect@npm:^1.12.3, object-inspect@npm:^1.9.0": +"nth-check@npm:^2.1.1": + version: 2.1.1 + resolution: "nth-check@npm:2.1.1" + dependencies: + boolbase: ^1.0.0 + checksum: 5afc3dafcd1573b08877ca8e6148c52abd565f1d06b1eb08caf982e3fa289a82f2cae697ffb55b5021e146d60443f1590a5d6b944844e944714a5b549675bcd3 + languageName: node + linkType: hard + +"object-inspect@npm:^1.12.3, object-inspect@npm:^1.13.1, object-inspect@npm:^1.9.0": version: 1.13.1 resolution: "object-inspect@npm:1.13.1" checksum: 7d9fa9221de3311dcb5c7c307ee5dc011cdd31dc43624b7c184b3840514e118e05ef0002be5388304c416c0eb592feb46e983db12577fc47e47d5752fbbfb61f @@ -4897,37 +5413,49 @@ __metadata: languageName: node linkType: hard -"object.fromentries@npm:^2.0.6": - version: 2.0.7 - resolution: "object.fromentries@npm:2.0.7" +"object.assign@npm:^4.1.5": + version: 4.1.5 + resolution: "object.assign@npm:4.1.5" dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.22.1 - checksum: 7341ce246e248b39a431b87a9ddd331ff52a454deb79afebc95609f94b1f8238966cf21f52188f2a353f0fdf83294f32f1ebf1f7826aae915ebad21fd0678065 + call-bind: ^1.0.5 + define-properties: ^1.2.1 + has-symbols: ^1.0.3 + object-keys: ^1.1.1 + checksum: f9aeac0541661370a1fc86e6a8065eb1668d3e771f7dbb33ee54578201336c057b21ee61207a186dd42db0c62201d91aac703d20d12a79fc79c353eed44d4e25 languageName: node linkType: hard -"object.groupby@npm:^1.0.0": - version: 1.0.1 - resolution: "object.groupby@npm:1.0.1" +"object.fromentries@npm:^2.0.7": + version: 2.0.8 + resolution: "object.fromentries@npm:2.0.8" dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.22.1 - get-intrinsic: ^1.2.1 - checksum: d7959d6eaaba358b1608066fc67ac97f23ce6f573dc8fc661f68c52be165266fcb02937076aedb0e42722fdda0bdc0bbf74778196ac04868178888e9fd3b78b5 + call-bind: ^1.0.7 + define-properties: ^1.2.1 + es-abstract: ^1.23.2 + es-object-atoms: ^1.0.0 + checksum: 29b2207a2db2782d7ced83f93b3ff5d425f901945f3665ffda1821e30a7253cd1fd6b891a64279976098137ddfa883d748787a6fea53ecdb51f8df8b8cec0ae1 languageName: node linkType: hard -"object.values@npm:^1.1.6": - version: 1.1.7 - resolution: "object.values@npm:1.1.7" +"object.groupby@npm:^1.0.1": + version: 1.0.3 + resolution: "object.groupby@npm:1.0.3" dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.22.1 - checksum: f3e4ae4f21eb1cc7cebb6ce036d4c67b36e1c750428d7b7623c56a0db90edced63d08af8a316d81dfb7c41a3a5fa81b05b7cc9426e98d7da986b1682460f0777 + call-bind: ^1.0.7 + define-properties: ^1.2.1 + es-abstract: ^1.23.2 + checksum: 0d30693ca3ace29720bffd20b3130451dca7a56c612e1926c0a1a15e4306061d84410bdb1456be2656c5aca53c81b7a3661eceaa362db1bba6669c2c9b6d1982 + languageName: node + linkType: hard + +"object.values@npm:^1.1.7": + version: 1.2.0 + resolution: "object.values@npm:1.2.0" + dependencies: + call-bind: ^1.0.7 + define-properties: ^1.2.1 + es-object-atoms: ^1.0.0 + checksum: 51fef456c2a544275cb1766897f34ded968b22adfc13ba13b5e4815fdaf4304a90d42a3aee114b1f1ede048a4890381d47a5594d84296f2767c6a0364b9da8fa languageName: node linkType: hard @@ -5000,6 +5528,15 @@ __metadata: languageName: node linkType: hard +"p-limit@npm:^4.0.0": + version: 4.0.0 + resolution: "p-limit@npm:4.0.0" + dependencies: + yocto-queue: ^1.0.0 + checksum: 01d9d70695187788f984226e16c903475ec6a947ee7b21948d6f597bed788e3112cc7ec2e171c1d37125057a5f45f3da21d8653e04a3a793589e12e9e80e756b + languageName: node + linkType: hard + "p-limit@npm:^5.0.0": version: 5.0.0 resolution: "p-limit@npm:5.0.0" @@ -5018,6 +5555,15 @@ __metadata: languageName: node linkType: hard +"p-locate@npm:^6.0.0": + version: 6.0.0 + resolution: "p-locate@npm:6.0.0" + dependencies: + p-limit: ^4.0.0 + checksum: 2bfe5234efa5e7a4e74b30a5479a193fdd9236f8f6b4d2f3f69e3d286d9a7d7ab0c118a2a50142efcf4e41625def635bd9332d6cbf9cc65d85eb0718c579ab38 + languageName: node + linkType: hard + "p-map@npm:^4.0.0": version: 4.0.0 resolution: "p-map@npm:4.0.0" @@ -5043,6 +5589,13 @@ __metadata: languageName: node linkType: hard +"parse-gitignore@npm:^2.0.0": + version: 2.0.0 + resolution: "parse-gitignore@npm:2.0.0" + checksum: 81e2fc56aefe004bb1c2b70f69a4a599969c21d2e4ee66e1e9c7eb84ae30286a25cf84d3a3b09e8b1772fd0e2b028560d97998f2e2ad1c3eebb89f84cedf36ea + languageName: node + linkType: hard + "path-exists@npm:^4.0.0": version: 4.0.0 resolution: "path-exists@npm:4.0.0" @@ -5050,6 +5603,13 @@ __metadata: languageName: node linkType: hard +"path-exists@npm:^5.0.0": + version: 5.0.0 + resolution: "path-exists@npm:5.0.0" + checksum: 8ca842868cab09423994596eb2c5ec2a971c17d1a3cb36dbf060592c730c725cd524b9067d7d2a1e031fef9ba7bd2ac6dc5ec9fb92aa693265f7be3987045254 + languageName: node + linkType: hard + "path-is-absolute@npm:^1.0.0": version: 1.0.1 resolution: "path-is-absolute@npm:1.0.1" @@ -5244,6 +5804,13 @@ __metadata: languageName: node linkType: hard +"picomatch@npm:^4.0.2": + version: 4.0.2 + resolution: "picomatch@npm:4.0.2" + checksum: a7a5188c954f82c6585720e9143297ccd0e35ad8072231608086ca950bee672d51b0ef676254af0788205e59bd4e4deb4e7708769226bed725bf13370a7d1464 + languageName: node + linkType: hard + "pino-abstract-transport@npm:^1.0.0, pino-abstract-transport@npm:v1.1.0": version: 1.1.0 resolution: "pino-abstract-transport@npm:1.1.0" @@ -5333,6 +5900,16 @@ __metadata: languageName: node linkType: hard +"postcss-selector-parser@npm:^6.0.15": + version: 6.0.16 + resolution: "postcss-selector-parser@npm:6.0.16" + dependencies: + cssesc: ^3.0.0 + util-deprecate: ^1.0.2 + checksum: e1cd68e33a39e3dc1e1e5bd8717be5bbe3cc23a4cecb466c3acb2f3a77daad7a47df4d6137a76f8db74cf160d2fb16b2cfdb4ccbebdfda844690f8d545fe281d + languageName: node + linkType: hard + "postcss@npm:^8.4.36": version: 8.4.38 resolution: "postcss@npm:8.4.38" @@ -5659,6 +6236,18 @@ __metadata: languageName: node linkType: hard +"regexp.prototype.flags@npm:^1.5.2": + version: 1.5.2 + resolution: "regexp.prototype.flags@npm:1.5.2" + dependencies: + call-bind: ^1.0.6 + define-properties: ^1.2.1 + es-errors: ^1.3.0 + set-function-name: ^2.0.1 + checksum: d7f333667d5c564e2d7a97c56c3075d64c722c9bb51b2b4df6822b2e8096d623a5e63088fb4c83df919b6951ef8113841de8b47de7224872fa6838bc5d8a7d64 + languageName: node + linkType: hard + "require-from-string@npm:^2.0.2": version: 2.0.2 resolution: "require-from-string@npm:2.0.2" @@ -5680,7 +6269,7 @@ __metadata: languageName: node linkType: hard -"resolve@npm:^1.22.2, resolve@npm:^1.22.3, resolve@npm:^1.22.4": +"resolve@npm:^1.22.4": version: 1.22.8 resolution: "resolve@npm:1.22.8" dependencies: @@ -5693,7 +6282,7 @@ __metadata: languageName: node linkType: hard -"resolve@patch:resolve@^1.22.2#~builtin, resolve@patch:resolve@^1.22.3#~builtin, resolve@patch:resolve@^1.22.4#~builtin": +"resolve@patch:resolve@^1.22.4#~builtin": version: 1.22.8 resolution: "resolve@patch:resolve@npm%3A1.22.8#~builtin::version=1.22.8&hash=c3c19d" dependencies: @@ -5827,6 +6416,18 @@ __metadata: languageName: node linkType: hard +"safe-array-concat@npm:^1.1.2": + version: 1.1.2 + resolution: "safe-array-concat@npm:1.1.2" + dependencies: + call-bind: ^1.0.7 + get-intrinsic: ^1.2.4 + has-symbols: ^1.0.3 + isarray: ^2.0.5 + checksum: a3b259694754ddfb73ae0663829e396977b99ff21cbe8607f35a469655656da8e271753497e59da8a7575baa94d2e684bea3e10ddd74ba046c0c9b4418ffa0c4 + languageName: node + linkType: hard + "safe-buffer@npm:5.2.1, safe-buffer@npm:^5.0.1, safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" @@ -5852,6 +6453,17 @@ __metadata: languageName: node linkType: hard +"safe-regex-test@npm:^1.0.3": + version: 1.0.3 + resolution: "safe-regex-test@npm:1.0.3" + dependencies: + call-bind: ^1.0.6 + es-errors: ^1.3.0 + is-regex: ^1.1.4 + checksum: 6c7d392ff1ae7a3ae85273450ed02d1d131f1d2c76e177d6b03eb88e6df8fa062639070e7d311802c1615f351f18dc58f9454501c58e28d5ffd9b8f502ba6489 + languageName: node + linkType: hard + "safe-regex2@npm:^2.0.0": version: 2.0.0 resolution: "safe-regex2@npm:2.0.0" @@ -5914,7 +6526,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.0.0, semver@npm:^7.3.5, semver@npm:^7.5.3, semver@npm:^7.5.4": +"semver@npm:^7.3.5, semver@npm:^7.5.3, semver@npm:^7.5.4": version: 7.5.4 resolution: "semver@npm:7.5.4" dependencies: @@ -5925,6 +6537,17 @@ __metadata: languageName: node linkType: hard +"semver@npm:^7.3.6, semver@npm:^7.6.0": + version: 7.6.0 + resolution: "semver@npm:7.6.0" + dependencies: + lru-cache: ^6.0.0 + bin: + semver: bin/semver.js + checksum: 7427f05b70786c696640edc29fdd4bc33b2acf3bbe1740b955029044f80575fc664e1a512e4113c3af21e767154a94b4aa214bf6cd6e42a1f6dba5914e0b208c + languageName: node + linkType: hard + "semver@npm:~7.0.0": version: 7.0.0 resolution: "semver@npm:7.0.0" @@ -6035,6 +6658,18 @@ __metadata: languageName: node linkType: hard +"set-function-name@npm:^2.0.1": + version: 2.0.2 + resolution: "set-function-name@npm:2.0.2" + dependencies: + define-data-property: ^1.1.4 + es-errors: ^1.3.0 + functions-have-names: ^1.2.3 + has-property-descriptors: ^1.0.2 + checksum: d6229a71527fd0404399fc6227e0ff0652800362510822a291925c9d7b48a1ca1a468b11b281471c34cd5a2da0db4f5d7ff315a61d26655e77f6e971e6d0c80f + languageName: node + linkType: hard + "setprototypeof@npm:1.2.0": version: 1.2.0 resolution: "setprototypeof@npm:1.2.0" @@ -6342,6 +6977,18 @@ __metadata: languageName: node linkType: hard +"string.prototype.trim@npm:^1.2.9": + version: 1.2.9 + resolution: "string.prototype.trim@npm:1.2.9" + dependencies: + call-bind: ^1.0.7 + define-properties: ^1.2.1 + es-abstract: ^1.23.0 + es-object-atoms: ^1.0.0 + checksum: ea2df6ec1e914c9d4e2dc856fa08228e8b1be59b59e50b17578c94a66a176888f417264bb763d4aac638ad3b3dad56e7a03d9317086a178078d131aa293ba193 + languageName: node + linkType: hard + "string.prototype.trimend@npm:^1.0.7": version: 1.0.7 resolution: "string.prototype.trimend@npm:1.0.7" @@ -6353,6 +7000,17 @@ __metadata: languageName: node linkType: hard +"string.prototype.trimend@npm:^1.0.8": + version: 1.0.8 + resolution: "string.prototype.trimend@npm:1.0.8" + dependencies: + call-bind: ^1.0.7 + define-properties: ^1.2.1 + es-object-atoms: ^1.0.0 + checksum: cc3bd2de08d8968a28787deba9a3cb3f17ca5f9f770c91e7e8fa3e7d47f079bad70fadce16f05dda9f261788be2c6e84a942f618c3bed31e42abc5c1084f8dfd + languageName: node + linkType: hard + "string.prototype.trimstart@npm:^1.0.7": version: 1.0.7 resolution: "string.prototype.trimstart@npm:1.0.7" @@ -6364,6 +7022,17 @@ __metadata: languageName: node linkType: hard +"string.prototype.trimstart@npm:^1.0.8": + version: 1.0.8 + resolution: "string.prototype.trimstart@npm:1.0.8" + dependencies: + call-bind: ^1.0.7 + define-properties: ^1.2.1 + es-object-atoms: ^1.0.0 + checksum: df1007a7f580a49d692375d996521dc14fd103acda7f3034b3c558a60b82beeed3a64fa91e494e164581793a8ab0ae2f59578a49896a7af6583c1f20472bce96 + languageName: node + linkType: hard + "string_decoder@npm:^1.1.1, string_decoder@npm:^1.3.0": version: 1.3.0 resolution: "string_decoder@npm:1.3.0" @@ -6455,6 +7124,13 @@ __metadata: languageName: node linkType: hard +"tapable@npm:^2.2.0": + version: 2.2.1 + resolution: "tapable@npm:2.2.1" + checksum: 3b7a1b4d86fa940aad46d9e73d1e8739335efd4c48322cb37d073eb6f80f5281889bf0320c6d8ffcfa1a0dd5bfdbd0f9d037e252ef972aca595330538aac4d51 + languageName: node + linkType: hard + "tar-fs@npm:^3.0.4": version: 3.0.4 resolution: "tar-fs@npm:3.0.4" @@ -6701,6 +7377,15 @@ __metadata: languageName: node linkType: hard +"ts-api-utils@npm:^1.3.0": + version: 1.3.0 + resolution: "ts-api-utils@npm:1.3.0" + peerDependencies: + typescript: ">=4.2.0" + checksum: c746ddabfdffbf16cb0b0db32bb287236a19e583057f8649ee7c49995bb776e1d3ef384685181c11a1a480369e022ca97512cb08c517b2d2bd82c83754c97012 + languageName: node + linkType: hard + "ts-node@npm:^10.9.1": version: 10.9.1 resolution: "ts-node@npm:10.9.1" @@ -6755,15 +7440,15 @@ __metadata: languageName: node linkType: hard -"tsconfig-paths@npm:^3.14.2": - version: 3.14.2 - resolution: "tsconfig-paths@npm:3.14.2" +"tsconfig-paths@npm:^3.15.0": + version: 3.15.0 + resolution: "tsconfig-paths@npm:3.15.0" dependencies: "@types/json5": ^0.0.29 json5: ^1.0.2 minimist: ^1.2.6 strip-bom: ^3.0.0 - checksum: a6162eaa1aed680537f93621b82399c7856afd10ec299867b13a0675e981acac4e0ec00896860480efc59fc10fd0b16fdc928c0b885865b52be62cadac692447 + checksum: 59f35407a390d9482b320451f52a411a256a130ff0e7543d18c6f20afab29ac19fbe55c360a93d6476213cc335a4d76ce90f67df54c4e9037f7d240920832201 languageName: node linkType: hard @@ -6808,6 +7493,17 @@ __metadata: languageName: node linkType: hard +"typed-array-buffer@npm:^1.0.2": + version: 1.0.2 + resolution: "typed-array-buffer@npm:1.0.2" + dependencies: + call-bind: ^1.0.7 + es-errors: ^1.3.0 + is-typed-array: ^1.1.13 + checksum: 02ffc185d29c6df07968272b15d5319a1610817916ec8d4cd670ded5d1efe72901541ff2202fcc622730d8a549c76e198a2f74e312eabbfb712ed907d45cbb0b + languageName: node + linkType: hard + "typed-array-byte-length@npm:^1.0.0": version: 1.0.0 resolution: "typed-array-byte-length@npm:1.0.0" @@ -6820,6 +7516,19 @@ __metadata: languageName: node linkType: hard +"typed-array-byte-length@npm:^1.0.1": + version: 1.0.1 + resolution: "typed-array-byte-length@npm:1.0.1" + dependencies: + call-bind: ^1.0.7 + for-each: ^0.3.3 + gopd: ^1.0.1 + has-proto: ^1.0.3 + is-typed-array: ^1.1.13 + checksum: f65e5ecd1cf76b1a2d0d6f631f3ea3cdb5e08da106c6703ffe687d583e49954d570cc80434816d3746e18be889ffe53c58bf3e538081ea4077c26a41055b216d + languageName: node + linkType: hard + "typed-array-byte-offset@npm:^1.0.0": version: 1.0.0 resolution: "typed-array-byte-offset@npm:1.0.0" @@ -6833,6 +7542,20 @@ __metadata: languageName: node linkType: hard +"typed-array-byte-offset@npm:^1.0.2": + version: 1.0.2 + resolution: "typed-array-byte-offset@npm:1.0.2" + dependencies: + available-typed-arrays: ^1.0.7 + call-bind: ^1.0.7 + for-each: ^0.3.3 + gopd: ^1.0.1 + has-proto: ^1.0.3 + is-typed-array: ^1.1.13 + checksum: c8645c8794a621a0adcc142e0e2c57b1823bbfa4d590ad2c76b266aa3823895cf7afb9a893bf6685e18454ab1b0241e1a8d885a2d1340948efa4b56add4b5f67 + languageName: node + linkType: hard + "typed-array-length@npm:^1.0.4": version: 1.0.4 resolution: "typed-array-length@npm:1.0.4" @@ -6844,6 +7567,36 @@ __metadata: languageName: node linkType: hard +"typed-array-length@npm:^1.0.6": + version: 1.0.6 + resolution: "typed-array-length@npm:1.0.6" + dependencies: + call-bind: ^1.0.7 + for-each: ^0.3.3 + gopd: ^1.0.1 + has-proto: ^1.0.3 + is-typed-array: ^1.1.13 + possible-typed-array-names: ^1.0.0 + checksum: f0315e5b8f0168c29d390ff410ad13e4d511c78e6006df4a104576844812ee447fcc32daab1f3a76c9ef4f64eff808e134528b5b2439de335586b392e9750e5c + languageName: node + linkType: hard + +"typescript-eslint@npm:^7.6.0": + version: 7.9.0 + resolution: "typescript-eslint@npm:7.9.0" + dependencies: + "@typescript-eslint/eslint-plugin": 7.9.0 + "@typescript-eslint/parser": 7.9.0 + "@typescript-eslint/utils": 7.9.0 + peerDependencies: + eslint: ^8.56.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: df12902cd427b9978d1199768626b1931215ed9564794f0564434d2733c1b3a2d31c5b01529ef7b991f140d00d13be1a16df1161f15b528ad0e08a678c0b48f4 + languageName: node + linkType: hard + "typescript@npm:^5.0.4": version: 5.2.2 resolution: "typescript@npm:5.2.2" @@ -6918,6 +7671,13 @@ __metadata: languageName: node linkType: hard +"unicorn-magic@npm:^0.1.0": + version: 0.1.0 + resolution: "unicorn-magic@npm:0.1.0" + checksum: 48c5882ca3378f380318c0b4eb1d73b7e3c5b728859b060276e0a490051d4180966beeb48962d850fd0c6816543bcdfc28629dcd030bb62a286a2ae2acb5acb6 + languageName: node + linkType: hard + "unique-filename@npm:^3.0.0": version: 3.0.0 resolution: "unique-filename@npm:3.0.0" @@ -6955,7 +7715,7 @@ __metadata: languageName: node linkType: hard -"util-deprecate@npm:^1.0.1, util-deprecate@npm:~1.0.1": +"util-deprecate@npm:^1.0.1, util-deprecate@npm:^1.0.2, util-deprecate@npm:~1.0.1": version: 1.0.2 resolution: "util-deprecate@npm:1.0.2" checksum: 474acf1146cb2701fe3b074892217553dfcf9a031280919ba1b8d651a068c9b15d863b7303cb15bd00a862b498e6cf4ad7b4a08fb134edd5a6f7641681cb54a2 @@ -7123,6 +7883,23 @@ __metadata: languageName: node linkType: hard +"vue-eslint-parser@npm:^9.4.2": + version: 9.4.2 + resolution: "vue-eslint-parser@npm:9.4.2" + dependencies: + debug: ^4.3.4 + eslint-scope: ^7.1.1 + eslint-visitor-keys: ^3.3.0 + espree: ^9.3.1 + esquery: ^1.4.0 + lodash: ^4.17.21 + semver: ^7.3.6 + peerDependencies: + eslint: ">=6.0.0" + checksum: 67f14c8ea19b578077a878864a5ec438ab4c597381923c9814fac39b3772da8654ac2a543467b5880607f694131f8ff34b87bd24c10bbc5f99fa2fcac49ff2e6 + languageName: node + linkType: hard + "webidl-conversions@npm:^3.0.0": version: 3.0.1 resolution: "webidl-conversions@npm:3.0.1" @@ -7179,6 +7956,19 @@ __metadata: languageName: node linkType: hard +"which-typed-array@npm:^1.1.15": + version: 1.1.15 + resolution: "which-typed-array@npm:1.1.15" + dependencies: + available-typed-arrays: ^1.0.7 + call-bind: ^1.0.7 + for-each: ^0.3.3 + gopd: ^1.0.1 + has-tostringtag: ^1.0.2 + checksum: 65227dcbfadf5677aacc43ec84356d17b5500cb8b8753059bb4397de5cd0c2de681d24e1a7bd575633f976a95f88233abfd6549c2105ef4ebd58af8aa1807c75 + languageName: node + linkType: hard + "which@npm:^2.0.1, which@npm:^2.0.2": version: 2.0.2 resolution: "which@npm:2.0.2" @@ -7249,6 +8039,13 @@ __metadata: languageName: node linkType: hard +"xml-name-validator@npm:^4.0.0": + version: 4.0.0 + resolution: "xml-name-validator@npm:4.0.0" + checksum: af100b79c29804f05fa35aa3683e29a321db9b9685d5e5febda3fa1e40f13f85abc40f45a6b2bf7bee33f68a1dc5e8eaef4cec100a304a9db565e6061d4cb5ad + languageName: node + linkType: hard + "xml2js@npm:0.6.2": version: 0.6.2 resolution: "xml2js@npm:0.6.2"