diff --git a/package-lock.json b/package-lock.json index 2221692544..9f7814ddfa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1196,9 +1196,9 @@ } }, "node_modules/@types/better-sqlite3": { - "version": "7.6.9", - "resolved": "https://registry.npmjs.org/@types/better-sqlite3/-/better-sqlite3-7.6.9.tgz", - "integrity": "sha512-FvktcujPDj9XKMJQWFcl2vVl7OdRIqsSRX9b0acWwTmwLK9CF2eqo/FRcmMLNpugKoX/avA6pb7TorDLmpgTnQ==", + "version": "7.6.11", + "resolved": "https://registry.npmjs.org/@types/better-sqlite3/-/better-sqlite3-7.6.11.tgz", + "integrity": "sha512-i8KcD3PgGtGBLl3+mMYA8PdKkButvPyARxA7IQAd6qeslht13qxb1zzO8dRCtE7U3IoJS782zDBAeoKiM695kg==", "dev": true, "dependencies": { "@types/node": "*" @@ -1404,9 +1404,9 @@ "dev": true }, "node_modules/@types/ini": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@types/ini/-/ini-4.1.0.tgz", - "integrity": "sha512-mTehMtc+xtnWBBvqizcqYCktKDBH2WChvx1GU3Sfe4PysFDXiNe+1YwtpVX1MDtCa4NQrSPw2+3HmvXHY3gt1w==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@types/ini/-/ini-4.1.1.tgz", + "integrity": "sha512-MIyNUZipBTbyUNnhvuXJTY7B6qNI78meck9Jbv3wk0OgNwRyOOVEKDutAkOs1snB/tx0FafyR6/SN4Ps0hZPeg==", "dev": true }, "node_modules/@types/jasmine": { @@ -1416,9 +1416,9 @@ "dev": true }, "node_modules/@types/jsdom": { - "version": "21.1.6", - "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.6.tgz", - "integrity": "sha512-/7kkMsC+/kMs7gAYmmBR9P0vGTnOoLhQhyhQJSlXGI5bzTHp6xdo0TtKWQAsz6pmSAeVqKSbqeyP6hytqr9FDw==", + "version": "21.1.7", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.7.tgz", + "integrity": "sha512-yOriVnggzrnQ3a9OKOCxaVuSug3w3/SbOj5i7VwXWZEyUNl3bLF9V3MfxGbZKuwqJOQyRfqXyROBB1CoZLFWzA==", "dev": true, "dependencies": { "@types/node": "*", @@ -1527,9 +1527,9 @@ } }, "node_modules/@types/node": { - "version": "20.11.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.19.tgz", - "integrity": "sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==", + "version": "20.14.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz", + "integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==", "dependencies": { "undici-types": "~5.26.4" } @@ -1748,9 +1748,9 @@ "optional": true }, "node_modules/@types/ws": { - "version": "8.5.10", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", - "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==", + "version": "8.5.11", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.11.tgz", + "integrity": "sha512-4+q7P5h3SpJxaBft0Dzpbr6lmMaqh0Jr2tbhJZ/luAwvD7ohSCniYkwz/pLxuT2h0EOa6QADgJj1Ko+TzRfZ+w==", "dev": true, "dependencies": { "@types/node": "*" @@ -5948,9 +5948,9 @@ } }, "node_modules/electron/node_modules/@types/node": { - "version": "18.19.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.17.tgz", - "integrity": "sha512-SzyGKgwPzuWp2SHhlpXKzCX0pIOfcI4V2eF37nNBJOhwlegQ83omtVQ1XxZpDE06V/d6AQvfQdPfnw0tRC//Ng==", + "version": "18.19.39", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.39.tgz", + "integrity": "sha512-nPwTRDKUctxw3di5b4TfT3I0sWDiWoPQCZjXhvdkINntwr8lcoVCKsTgnXeRubKIlfnV+eN/HYk6Jb40tbcEAQ==", "dependencies": { "undici-types": "~5.26.4" } @@ -12490,9 +12490,9 @@ } }, "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" }, "node_modules/tsscmp": { "version": "1.0.6", @@ -12564,9 +12564,9 @@ } }, "node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", + "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -14252,9 +14252,9 @@ } }, "@types/better-sqlite3": { - "version": "7.6.9", - "resolved": "https://registry.npmjs.org/@types/better-sqlite3/-/better-sqlite3-7.6.9.tgz", - "integrity": "sha512-FvktcujPDj9XKMJQWFcl2vVl7OdRIqsSRX9b0acWwTmwLK9CF2eqo/FRcmMLNpugKoX/avA6pb7TorDLmpgTnQ==", + "version": "7.6.11", + "resolved": "https://registry.npmjs.org/@types/better-sqlite3/-/better-sqlite3-7.6.11.tgz", + "integrity": "sha512-i8KcD3PgGtGBLl3+mMYA8PdKkButvPyARxA7IQAd6qeslht13qxb1zzO8dRCtE7U3IoJS782zDBAeoKiM695kg==", "dev": true, "requires": { "@types/node": "*" @@ -14460,9 +14460,9 @@ "dev": true }, "@types/ini": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@types/ini/-/ini-4.1.0.tgz", - "integrity": "sha512-mTehMtc+xtnWBBvqizcqYCktKDBH2WChvx1GU3Sfe4PysFDXiNe+1YwtpVX1MDtCa4NQrSPw2+3HmvXHY3gt1w==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@types/ini/-/ini-4.1.1.tgz", + "integrity": "sha512-MIyNUZipBTbyUNnhvuXJTY7B6qNI78meck9Jbv3wk0OgNwRyOOVEKDutAkOs1snB/tx0FafyR6/SN4Ps0hZPeg==", "dev": true }, "@types/jasmine": { @@ -14472,9 +14472,9 @@ "dev": true }, "@types/jsdom": { - "version": "21.1.6", - "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.6.tgz", - "integrity": "sha512-/7kkMsC+/kMs7gAYmmBR9P0vGTnOoLhQhyhQJSlXGI5bzTHp6xdo0TtKWQAsz6pmSAeVqKSbqeyP6hytqr9FDw==", + "version": "21.1.7", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.7.tgz", + "integrity": "sha512-yOriVnggzrnQ3a9OKOCxaVuSug3w3/SbOj5i7VwXWZEyUNl3bLF9V3MfxGbZKuwqJOQyRfqXyROBB1CoZLFWzA==", "dev": true, "requires": { "@types/node": "*", @@ -14576,9 +14576,9 @@ } }, "@types/node": { - "version": "20.11.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.19.tgz", - "integrity": "sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==", + "version": "20.14.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz", + "integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==", "requires": { "undici-types": "~5.26.4" } @@ -14774,9 +14774,9 @@ "optional": true }, "@types/ws": { - "version": "8.5.10", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", - "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==", + "version": "8.5.11", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.11.tgz", + "integrity": "sha512-4+q7P5h3SpJxaBft0Dzpbr6lmMaqh0Jr2tbhJZ/luAwvD7ohSCniYkwz/pLxuT2h0EOa6QADgJj1Ko+TzRfZ+w==", "dev": true, "requires": { "@types/node": "*" @@ -17431,9 +17431,9 @@ }, "dependencies": { "@types/node": { - "version": "18.19.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.17.tgz", - "integrity": "sha512-SzyGKgwPzuWp2SHhlpXKzCX0pIOfcI4V2eF37nNBJOhwlegQ83omtVQ1XxZpDE06V/d6AQvfQdPfnw0tRC//Ng==", + "version": "18.19.39", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.39.tgz", + "integrity": "sha512-nPwTRDKUctxw3di5b4TfT3I0sWDiWoPQCZjXhvdkINntwr8lcoVCKsTgnXeRubKIlfnV+eN/HYk6Jb40tbcEAQ==", "requires": { "undici-types": "~5.26.4" } @@ -22904,9 +22904,9 @@ } }, "tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" }, "tsscmp": { "version": "1.0.6", @@ -22963,9 +22963,9 @@ } }, "typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", + "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", "dev": true }, "uc.micro": { diff --git a/src/etapi/attachments.ts b/src/etapi/attachments.ts index 8e76d27e87..802e9975f6 100644 --- a/src/etapi/attachments.ts +++ b/src/etapi/attachments.ts @@ -5,6 +5,7 @@ import v = require('./validators'); import utils = require('../services/utils'); import { Router } from 'express'; import { AttachmentRow } from '../becca/entities/rows'; +import { ValidatorMap } from './etapi-interface'; function register(router: Router) { const ALLOWED_PROPERTIES_FOR_CREATE_ATTACHMENT: ValidatorMap = { diff --git a/src/etapi/attributes.ts b/src/etapi/attributes.ts index d5b407fb3a..59865da62d 100644 --- a/src/etapi/attributes.ts +++ b/src/etapi/attributes.ts @@ -5,6 +5,7 @@ import attributeService = require('../services/attributes'); import v = require('./validators'); import { Router } from 'express'; import { AttributeRow } from '../becca/entities/rows'; +import { ValidatorMap } from './etapi-interface'; function register(router: Router) { eu.route(router, 'get', '/etapi/attributes/:attributeId', (req, res, next) => { diff --git a/src/etapi/etapi-interface.ts b/src/etapi/etapi-interface.ts index c0b6d3f042..c0bfef6d9c 100644 --- a/src/etapi/etapi-interface.ts +++ b/src/etapi/etapi-interface.ts @@ -1,3 +1,3 @@ -type ValidatorFunc = (obj: unknown) => (string | undefined); +export type ValidatorFunc = (obj: unknown) => (string | undefined); -type ValidatorMap = Record; \ No newline at end of file +export type ValidatorMap = Record; \ No newline at end of file diff --git a/src/etapi/etapi_utils.ts b/src/etapi/etapi_utils.ts index 3498a8257f..9799deef0f 100644 --- a/src/etapi/etapi_utils.ts +++ b/src/etapi/etapi_utils.ts @@ -6,6 +6,7 @@ import etapiTokenService = require('../services/etapi_tokens'); import config = require('../services/config'); import { NextFunction, Request, RequestHandler, Response, Router } from 'express'; import { AppRequest, AppRequestHandler } from '../routes/route-interface'; +import { ValidatorMap } from './etapi-interface'; const GENERIC_CODE = "GENERIC"; type HttpMethod = "all" | "get" | "post" | "put" | "delete" | "patch" | "options" | "head"; diff --git a/src/etapi/notes.ts b/src/etapi/notes.ts index 620e9f3d8a..62263983f9 100644 --- a/src/etapi/notes.ts +++ b/src/etapi/notes.ts @@ -15,6 +15,7 @@ import { ParsedQs } from 'qs'; import { NoteParams } from '../services/note-interface'; import BNote = require('../becca/entities/bnote'); import { SearchParams } from '../services/search/services/types'; +import { ValidatorMap } from './etapi-interface'; function register(router: Router) { eu.route(router, 'get', '/etapi/notes', (req, res, next) => { diff --git a/src/share/shaca/entities/rows.ts b/src/share/shaca/entities/rows.ts index d8b8ec84e4..ed20fea1fc 100644 --- a/src/share/shaca/entities/rows.ts +++ b/src/share/shaca/entities/rows.ts @@ -1,4 +1,4 @@ -type SNoteRow = [ string, string, string, string, string, string, boolean ]; -type SBranchRow = [ string, string, string, string, string, boolean ]; -type SAttributeRow = [ string, string, string, string, string, boolean, number ]; -type SAttachmentRow = [ string, string, string, string, string, string, string ]; +export type SNoteRow = [ string, string, string, string, string, string, boolean ]; +export type SBranchRow = [ string, string, string, string, string, boolean ]; +export type SAttributeRow = [ string, string, string, string, string, boolean, number ]; +export type SAttachmentRow = [ string, string, string, string, string, string, string ]; diff --git a/src/share/shaca/entities/sattachment.ts b/src/share/shaca/entities/sattachment.ts index 1e9565ce3a..7951fe0818 100644 --- a/src/share/shaca/entities/sattachment.ts +++ b/src/share/shaca/entities/sattachment.ts @@ -5,6 +5,7 @@ import utils = require('../../../services/utils'); import AbstractShacaEntity = require('./abstract_shaca_entity'); import SNote = require('./snote'); import { Blob } from '../../../services/blob-interface'; +import { SAttachmentRow } from './rows'; class SAttachment extends AbstractShacaEntity { private attachmentId: string; diff --git a/src/share/shaca/entities/sattribute.ts b/src/share/shaca/entities/sattribute.ts index 390a85b8cc..6bd8418b1a 100644 --- a/src/share/shaca/entities/sattribute.ts +++ b/src/share/shaca/entities/sattribute.ts @@ -1,5 +1,6 @@ "use strict"; +import { SAttributeRow } from "./rows"; import SNote = require("./snote"); const AbstractShacaEntity = require('./abstract_shaca_entity'); diff --git a/src/share/shaca/entities/sbranch.ts b/src/share/shaca/entities/sbranch.ts index 0ff3569220..b4ff9a73b9 100644 --- a/src/share/shaca/entities/sbranch.ts +++ b/src/share/shaca/entities/sbranch.ts @@ -1,6 +1,7 @@ "use strict"; import AbstractShacaEntity = require('./abstract_shaca_entity'); +import { SBranchRow } from './rows'; import SNote = require('./snote'); class SBranch extends AbstractShacaEntity { diff --git a/src/share/shaca/entities/snote.ts b/src/share/shaca/entities/snote.ts index bae6108868..18182f1d44 100644 --- a/src/share/shaca/entities/snote.ts +++ b/src/share/shaca/entities/snote.ts @@ -8,6 +8,7 @@ import { Blob } from '../../../services/blob-interface'; import SAttachment = require('./sattachment'); import SAttribute = require('./sattribute'); import SBranch = require('./sbranch'); +import { SNoteRow } from './rows'; const LABEL = 'label'; const RELATION = 'relation'; diff --git a/src/share/shaca/shaca_loader.ts b/src/share/shaca/shaca_loader.ts index c6a3fc4daa..050e5e886d 100644 --- a/src/share/shaca/shaca_loader.ts +++ b/src/share/shaca/shaca_loader.ts @@ -9,6 +9,7 @@ import SAttribute = require('./entities/sattribute'); import SAttachment = require('./entities/sattachment'); import shareRoot = require('../share_root'); import eventService = require('../../services/events'); +import { SAttachmentRow, SAttributeRow, SBranchRow, SNoteRow } from './entities/rows'; function load() { const start = Date.now(); diff --git a/tsconfig.json b/tsconfig.json index 55f0090c83..d9bbf43785 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,8 @@ { "compilerOptions": { - "moduleResolution": "Node", + "moduleResolution": "Node16", + "module": "Node16", + "target": "ES2018", "declaration": false, "sourceMap": true, "outDir": "./build",