Skip to content

Commit

Permalink
chore: update dependencies (#305)
Browse files Browse the repository at this point in the history
* chore(deps): update runtime dependencies

* chore(deps): remove ts-node-dev

* chore: update imports

* chore(deps): update ESLint packages

* chore(deps): update testing deps (part 1)

* chore(deps): update @types packages

* chore(deps): update package-lock

* chore: remove recreated seed file due to rebasing

* chore(deps): remove date-fns (again)
  • Loading branch information
Yoronex authored Oct 9, 2024
1 parent a73b011 commit c435c57
Show file tree
Hide file tree
Showing 7 changed files with 1,520 additions and 899 deletions.
2,289 changes: 1,456 additions & 833 deletions package-lock.json

Large diffs are not rendered by default.

108 changes: 54 additions & 54 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"main": "out/index.js",
"scripts": {
"build": "tsc",
"watch": "ts-node-dev --poll src/index.ts",
"cron": "ts-node-dev --poll src/cron.ts",
"watch": "nodemon --watch \"src/**\" --ext \"ts,json\" --exec \"ts-node src/index.ts",
"cron": "nodemon --watch \"src/**\" --ext \"ts,json\" --exec \"ts-node src/cron.ts",
"serve": "node out/src/index.js",
"schema": "ts-node ./src/database/schema.ts",
"seed": "ts-node-dev --poll src/database/seed.ts",
"swagger": "ts-node-dev --poll src/start/swagger.ts",
"migrate": "ts-node ./src/database/migrate.ts",
"swagger:validate": "ts-node-dev --poll src/start/swagger.ts && swagger-cli validate ./out/swagger.json",
"test": "mocha -r ts-node/register --parallel --timeout 10000 --require ./test/setup.ts 'test/**/*.ts' --exit",
"schema": "ts-node src/database/schema.ts",
"seed": "ts-node src/database/seed.ts",
"swagger": "ts-node src/start/swagger.ts",
"migrate": "ts-node src/database/migrate.ts",
"swagger:validate": "ts-node src/start/swagger.ts && swagger-cli validate ./out/swagger.json",
"test": "mocha -r ts-node/register --parallel --timeout 50000 --require ./test/setup.ts 'test/**/*.ts' --exit",
"test-ci": "npm run schema && mocha -r ts-node/register --timeout 50000 --require ./test/setup.ts 'test/**/*.ts' --exit",
"test-ci-migrate": "npm run migrate && mocha -r ts-node/register --timeout 50000 --require ./test/setup.ts 'test/**/*.ts' --exit",
"test-file": "mocha -r ts-node/register --timeout 10000 --require ./test/setup.ts",
Expand All @@ -32,87 +32,87 @@
"author": "",
"license": "AGPL-3.0-or-later",
"dependencies": {
"bcrypt": "^5.1.0",
"bcrypt": "^5.1.1",
"body-parser": "^1.20.2",
"commander": "^12.1.0",
"date-fns": "^2.29.3",
"dinero.js": "^1.9.0",
"dotenv": "^16.0.3",
"express": "^4.18.2",
"express-fileupload": "^1.4.0",
"dinero.js": "^1.9.1",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"express-fileupload": "^1.5.1",
"express-jsdoc-swagger": "^1.8.0",
"gewisdb-ts-client": "github:GEWIS/gewisdb-ts-client#26575e8",
"jsonwebtoken": "^9.0.0",
"jsonwebtoken": "^9.0.2",
"ldap-escape": "^2.0.6",
"ldapts": "^4.2.4",
"ldapts": "^7.1.1",
"log4js": "^6.9.1",
"mime-types": "^2.1.35",
"mysql2": "^3.2.0",
"node-cron": "^3.0.2",
"nodemailer": "^6.9.1",
"mysql2": "^3.11.0",
"node-cron": "^3.0.3",
"nodemailer": "^6.9.14",
"pdf-generator-client": "github:GEWIS/pdf-generator#04e040b",
"reflect-metadata": "^0.1.13",
"sqlite3": "^5.1.5",
"reflect-metadata": "^0.2.2",
"sqlite3": "^5.1.7",
"stripe": "^16.1.0",
"swagger-model-validator": "^3.0.21",
"swagger-ui-express": "^5.0.0",
"typeorm": "^0.3.12",
"uuid": "^9.0.0",
"validator": "^13.9.0",
"swagger-ui-express": "^5.0.1",
"typeorm": "^0.3.20",
"uuid": "^10.0.0",
"validator": "^13.12.0",
"vitepress-theme-openapi": "^0.0.3-alpha.30"
},
"devDependencies": {
"@apidevtools/swagger-cli": "^4.0.4",
"@types/bcrypt": "^5.0.0",
"@types/body-parser": "^1.19.2",
"@types/bcrypt": "^5.0.2",
"@types/body-parser": "^1.19.5",
"@types/chai": "^4.3.4",
"@types/chai-as-promised": "^7.1.4",
"@types/chai-sorted": "^0.2.0",
"@types/deep-equal-in-any-order": "^1.0.1",
"@types/dinero.js": "^1.9.0",
"@types/express": "^4.17.17",
"@types/express-fileupload": "^1.4.1",
"@types/jsonwebtoken": "^9.0.1",
"@types/mime-types": "^2.1.1",
"@types/mocha": "^10.0.1",
"@types/node": "^18.15.2",
"@types/node-cron": "^3.0.7",
"@types/nodemailer": "^6.4.7",
"@types/sinon": "^10.0.13",
"@types/sinon-chai": "^3.2.9",
"@types/dinero.js": "^1.9.4",
"@types/express": "^4.17.21",
"@types/express-fileupload": "^1.5.1",
"@types/jsonwebtoken": "^9.0.6",
"@types/mime-types": "^2.1.4",
"@types/mocha": "^10.0.7",
"@types/node": "^20.16.3",
"@types/node-cron": "^3.0.11",
"@types/nodemailer": "^6.4.15",
"@types/sinon": "^17.0.3",
"@types/sinon-chai": "^3.2.12",
"@types/swagger-ui-express": "^4.1.6",
"@types/uuid": "^9.0.1",
"@types/validator": "^13.7.13",
"@typescript-eslint/eslint-plugin": "^5.55.0",
"@typescript-eslint/parser": "^5.55.0",
"@types/uuid": "^10.0.0",
"@types/validator": "^13.12.1",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"chai": "^4.3.7",
"chai-as-promised": "^7.1.1",
"chai-http": "^4.3.0",
"chai-sorted": "^0.2.0",
"chai-swag": "^0.1.9",
"deep-equal-in-any-order": "^2.0.5",
"eslint": "^8.36.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-plugin-chai-expect": "^3.0.0",
"eslint-plugin-chai-friendly": "^0.7.2",
"eslint": "^8.57.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-plugin-chai-expect": "^3.1.0",
"eslint-plugin-chai-friendly": "^1.0.1",
"eslint-plugin-github-commit-hash": "^1.0.3",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-import": "^2.29.1",
"jsonc-eslint-parser": "^2.4.0",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.2.0",
"mocha": "^10.7.3",
"mocha-junit-reporter": "^2.2.1",
"mocha-multi-reporters": "^1.5.1",
"node-gyp": "^9.3.1",
"node-gyp": "^10.2.0",
"node-pre-gyp": "^0.17.0",
"nyc": "^15.1.0",
"sinon": "^15.0.2",
"nodemon": "^3.1.4",
"nyc": "^17.0.0",
"sinon": "^18.0.0",
"sinon-chai": "^3.7.0",
"ts-node-dev": "^2.0.0",
"ts-node": "^10.9.2",
"typedoc": "^0.26.7",
"typedoc-plugin-markdown": "^4.2.7",
"typedoc-plugin-merge-modules": "^6.0.0",
"typedoc-vitepress-theme": "^1.0.1",
"typescript": "^4.9.5",
"typescript": "^5.5.4",
"vitepress": "^1.3.4"
}
}
4 changes: 2 additions & 2 deletions src/middleware/restriction-middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { RequestWithToken } from './token-middleware';
import { TermsOfServiceStatus } from '../entity/user/user';
import ServerSettingsStore from '../server-settings/server-settings-store';
import { ISettings } from '../entity/server-setting';
import { getLogger } from 'log4js';
import log4js from 'log4js';

export interface TokenRestrictions {
/**
Expand Down Expand Up @@ -74,7 +74,7 @@ export default class RestrictionMiddleware {
return;
}
} catch (e) {
getLogger('RestrictionMiddleware').error(e);
log4js.getLogger('RestrictionMiddleware').error(e);
res.status(500).end('Internal server error.');
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/service/stripe-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import Stripe from 'stripe';
import { Dinero } from 'dinero.js';
import { getLogger, Logger } from 'log4js';
import log4js, { Logger } from 'log4js';
import User from '../entity/user/user';
import StripeDeposit from '../entity/stripe/stripe-deposit';
import DineroTransformer from '../entity/transformer/dinero-transformer';
Expand Down Expand Up @@ -57,7 +57,7 @@ export default class StripeService extends WithManager {
this.stripe = new Stripe(process.env.STRIPE_PRIVATE_KEY, {
apiVersion: STRIPE_API_VERSION,
});
this.logger = getLogger('StripeController');
this.logger = log4js.getLogger('StripeController');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/subscriber/transaction-subscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import BalanceService from '../service/balance-service';
import Mailer from '../mailer';
import UserDebtNotification from '../mailer/messages/user-debt-notification';
import DineroTransformer from '../entity/transformer/dinero-transformer';
import { getLogger } from 'log4js';
import log4js from 'log4js';

@EventSubscriber()
export default class TransactionSubscriber implements EntitySubscriberInterface {
Expand Down Expand Up @@ -83,6 +83,6 @@ export default class TransactionSubscriber implements EntitySubscriberInterface
Mailer.getInstance().send(user, new UserDebtNotification({
balance: DineroTransformer.Instance.from(currentBalance),
url: '',
})).catch((e) => getLogger('Transaction').error(e));
})).catch((e) => log4js.getLogger('Transaction').error(e));
}
}
5 changes: 2 additions & 3 deletions test/seed/catalogue/point-of-sale-seeder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import User, { TermsOfServiceStatus, UserType } from '../../../src/entity/user/u
import PointOfSale from '../../../src/entity/point-of-sale/point-of-sale';
import ContainerRevision from '../../../src/entity/container/container-revision';
import PointOfSaleRevision from '../../../src/entity/point-of-sale/point-of-sale-revision';
import { addDays } from 'date-fns';
import ContainerSeeder from './container-seeder';

export default class PointOfSaleSeeder extends WithManager {
Expand Down Expand Up @@ -81,8 +80,8 @@ export default class PointOfSaleSeeder extends WithManager {
const revisions: PointOfSaleRevision[] = [];
// Only allow products with same owner in container.
const candidates = containerRevisions.filter((c) => c.container.owner === pointOfSale.owner);
const startDate = addDays(new Date(2020, 0, 1), 2 - (dateOffset * 2));
const endDate = addDays(new Date(2020, 0, 1), 3 - (dateOffset * 2));
const startDate = new Date(new Date(2020, 0, 1).getTime() + ((1000 * 60 * 60 * 24) * (2 - (dateOffset * 2))));
const endDate = new Date(new Date(2020, 0, 1).getTime() + ((1000 * 60 * 60 * 24) * (3 - (dateOffset * 2))));

for (let rev = 1; rev <= count; rev += 1) {
revisions.push(Object.assign(new PointOfSaleRevision(), {
Expand Down
5 changes: 2 additions & 3 deletions test/seed/ledger/invoice-seeder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import Invoice from '../../../src/entity/invoices/invoice';
import Transfer from '../../../src/entity/transactions/transfer';
import dinero from 'dinero.js';
import InvoiceStatus, { InvoiceState } from '../../../src/entity/invoices/invoice-status';
import { addDays } from 'date-fns';
import SubTransactionRow from '../../../src/entity/transactions/sub-transaction-row';

export default class InvoiceSeeder extends WithManager {
Expand Down Expand Up @@ -107,7 +106,7 @@ export default class InvoiceSeeder extends WithManager {
invoice,
changedBy: users[i],
state: InvoiceState.CREATED,
dateChanged: addDays(new Date(2020, 0, 1), 2 - (i * 2)),
dateChanged: new Date(new Date(2020, 0, 1).getTime() + ((1000 * 60 * 60 * 24) * (2 - (i * 2))) ),
});
invoice.invoiceStatus.push(status);
invoices = invoices.concat(invoice);
Expand All @@ -124,7 +123,7 @@ export default class InvoiceSeeder extends WithManager {
invoice: invoices[i],
changedBy: current,
state: [InvoiceState.SENT, InvoiceState.PAID, InvoiceState.DELETED][i % 3],
dateChanged: addDays(new Date(2020, 0, 1), 2 - (i * 2)),
dateChanged: new Date(new Date(2020, 0, 1).getTime() + ((1000 * 60 * 60 * 24) * (2 - (i * 2))) ),
});
invoices[i].invoiceStatus.push(status);
await this.manager.save(Invoice, invoices[i]);
Expand Down

0 comments on commit c435c57

Please sign in to comment.