@stamhoofd/backend-backup 2.119.0 → 2.120.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@stamhoofd/backend-backup",
3
- "version": "2.119.0",
3
+ "version": "2.120.1",
4
+ "type": "module",
4
5
  "main": "./dist/index.js",
5
6
  "exports": {
6
7
  ".": {
@@ -10,9 +11,9 @@
10
11
  "license": "UNLICENCED",
11
12
  "scripts": {
12
13
  "dev:full": "wait-on ../../shared/middleware/dist/index.js && concurrently -r 'yarn -s build --watch --preserveWatchOutput' \"wait-on ./dist/index.js && nodemon --quiet --inspect=5858 --watch dist --watch '../../../shared/*/dist/' --watch '../../shared/*/dist/' --ext .ts,.json,.sql,.js --watch .env.json --delay 1000ms --exec 'node --enable-source-maps ./dist/index.js' --signal SIGTERM\"",
13
- "build": "tsc -b",
14
+ "build": "tsc --build tsconfig.build.json",
14
15
  "build:full": "yarn -s clear && yarn -s build",
15
- "clear": "rm -rf ./dist",
16
+ "clear": "rm -rf ./dist && rm -f *.tsbuildinfo",
16
17
  "start": "yarn -s build && node --enable-source-maps ./dist/index.js",
17
18
  "lint": "eslint"
18
19
  },
@@ -24,15 +25,15 @@
24
25
  },
25
26
  "dependencies": {
26
27
  "@aws-sdk/client-s3": "^3.839.0",
27
- "@simonbackx/simple-endpoints": "1.20.1",
28
+ "@simonbackx/simple-endpoints": "1.21.0",
28
29
  "@simonbackx/simple-logging": "^1.0.1",
29
30
  "formidable": "3.5.4",
30
31
  "luxon": "3.4.4",
31
32
  "mockdate": "^3.0.2",
32
- "mysql2": "^3.14.1"
33
+ "mysql2": "^3.20.0"
33
34
  },
34
35
  "publishConfig": {
35
36
  "access": "public"
36
37
  },
37
- "gitHead": "7bcbadd31fcc4f3109efc67c4034d1382a1d0439"
38
+ "gitHead": "00f65fc28d68feb86c30789784181a8954d638d7"
38
39
  }
package/src/boot.ts CHANGED
@@ -22,7 +22,7 @@ const start = async () => {
22
22
  console.log('Started Backup.');
23
23
  loadLogger();
24
24
  const router = new Router();
25
- await router.loadEndpoints(__dirname + '/endpoints');
25
+ await router.loadEndpoints(import.meta.dirname + '/endpoints');
26
26
  router.endpoints.push(new CORSPreflightEndpoint());
27
27
 
28
28
  const routerServer = new RouterServer(router);
@@ -1,5 +1,6 @@
1
1
  import { AutoEncoder, field, StringDecoder } from '@simonbackx/simple-encoding';
2
- import { DecodedRequest, Endpoint, Request, Response } from '@simonbackx/simple-endpoints';
2
+ import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
3
+ import { Endpoint, Response } from '@simonbackx/simple-endpoints';
3
4
  import { SimpleError } from '@simonbackx/simple-errors';
4
5
  import { backup } from '../helpers/backup.js';
5
6
 
@@ -1,4 +1,5 @@
1
- import { DecodedRequest, Endpoint, Request, Response } from '@simonbackx/simple-endpoints';
1
+ import type { DecodedRequest, Request} from '@simonbackx/simple-endpoints';
2
+ import { Endpoint, Response } from '@simonbackx/simple-endpoints';
2
3
  import { BackupHealth, getHealth } from '../helpers/backup.js';
3
4
  import { AutoEncoder, field, StringDecoder } from '@simonbackx/simple-encoding';
4
5
  import { SimpleError } from '@simonbackx/simple-errors';
@@ -375,7 +375,7 @@ export async function backup() {
375
375
  const tmpFile = `${localBackupFolder}${getBackupBaseFileName(new Date())}`;
376
376
  const compressedFile = tmpFile + '.gz';
377
377
 
378
- const cmd = 'mysqldump -u ' + escapeShellArg(STAMHOOFD.DB_USER) + ' -p' + escapeShellArg(STAMHOOFD.DB_PASS) + ' --flush-logs --single-transaction --quick --hex-blob --default-character-set=utf8mb4 --skip-extended-insert --max_allowed_packet=1G --triggers --routines --events --lock-tables=false ' + escapeShellArg(STAMHOOFD.DB_DATABASE) + ' > ' + escapeShellArg(tmpFile);
378
+ const cmd = 'mysqldump -u ' + escapeShellArg(STAMHOOFD.DB_USER) + ' -p' + escapeShellArg(STAMHOOFD.DB_PASS) + ' --flush-logs --single-transaction --quick --hex-blob --default-character-set=utf8mb4 --max_allowed_packet=1G --triggers --routines --events --lock-tables=false ' + escapeShellArg(STAMHOOFD.DB_DATABASE) + ' > ' + escapeShellArg(tmpFile);
379
379
 
380
380
  console.log('Creating MySQL dump...');
381
381
  await execPromise(cmd);
package/stamhoofd.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import '../../../environment.d.ts';
2
+
1
3
  export {};
2
4
 
3
5
  /**
@@ -0,0 +1,17 @@
1
+ {
2
+ "extends": "../../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "rootDir": ".",
5
+ "outDir": "dist"
6
+ },
7
+ "include": [
8
+ "./index.ts",
9
+ "./migrations.ts",
10
+ "./src",
11
+ "./stamhoofd.d.ts"
12
+ ],
13
+ "exclude": [
14
+ "./src/**/*.spec.ts",
15
+ "./src/**/*.test.ts"
16
+ ]
17
+ }
package/tsconfig.json CHANGED
@@ -1,34 +1,12 @@
1
1
  {
2
- "compilerOptions": {
3
- "target": "es2022", // needs to be es2019 to support optional chaining. Node.js doesn't support optional chaining yet, so we need the transpiling
4
- "module": "commonjs",
5
- "jsx": "preserve",
6
- "importHelpers": true,
7
- "moduleResolution": "node",
8
- "experimentalDecorators": true,
9
- "esModuleInterop": true,
10
- "allowSyntheticDefaultImports": true,
11
- "sourceMap": true,
12
- "strictNullChecks": true,
13
- "declaration": true,
14
- "declarationMap": true,
15
- "outDir": "dist",
16
- "lib": [
17
- "es2022",
18
- "dom" // for puppeteer
19
- ],
20
- "types": [
21
- "node",
22
- "jest",
23
- "@stamhoofd/backend-i18n",
24
- ]
25
- },
26
- "include": [
27
- "**/*.ts",
28
- "../../../*.d.ts"
29
- ],
30
- "exclude": [
31
- "node_modules",
32
- "dist"
2
+ "extends": "../../../tsconfig.base.json",
3
+ "files": [],
4
+ "references": [
5
+ {
6
+ "path": "./tsconfig.build.json"
7
+ },
8
+ {
9
+ "path": "./tsconfig.test.json"
10
+ }
33
11
  ]
34
12
  }
@@ -0,0 +1,17 @@
1
+ {
2
+ "extends": "../../../tsconfig.test.json",
3
+ "compilerOptions": {
4
+ "rootDir": ".",
5
+ "outDir": "dist"
6
+ },
7
+ "references": [
8
+ { "path": "./tsconfig.build.json" }
9
+ ],
10
+ "include": [
11
+ "./stamhoofd.d.ts",
12
+ "../../../jest-extended.d.ts",
13
+ "./src/**/*.spec.ts",
14
+ "./src/**/*.test.ts",
15
+ "./tests"
16
+ ]
17
+ }
package/eslint.config.mjs DELETED
@@ -1,5 +0,0 @@
1
- import stamhoofdEslint from 'eslint-plugin-stamhoofd';
2
-
3
- export default [
4
- ...stamhoofdEslint.configs.backend,
5
- ];