tering-serieuze-types 3.8.1 → 3.10.0

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/.oxfmtrc.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "trailingComma": "all",
3
+ "tabWidth": 4,
4
+ "printWidth": 120,
5
+ "sortImports": {
6
+ "groups": [
7
+ "type-import",
8
+ ["value-builtin", "value-external"],
9
+ "type-internal",
10
+ "value-internal",
11
+ ["type-parent", "type-sibling", "type-index"],
12
+ ["value-parent", "value-sibling", "value-index"],
13
+ "unknown"
14
+ ],
15
+ "newlinesBetween": false
16
+ },
17
+ "ignorePatterns": ["dist/", "*.yaml", "*.yml", "package-lock.json", "*.css"]
18
+ }
package/.oxlintrc.json ADDED
@@ -0,0 +1,210 @@
1
+ {
2
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
3
+ "plugins": [
4
+ "typescript",
5
+ "unicorn",
6
+ "oxc",
7
+ "import",
8
+ "vitest",
9
+ "node",
10
+ "promise",
11
+ "jest"
12
+ ],
13
+ "categories": {
14
+ "correctness": "error",
15
+ "suspicious": "error",
16
+ "perf": "error",
17
+ "restriction": "error",
18
+ "style": "error",
19
+ "pedantic": "error",
20
+ "nursery": "error"
21
+ },
22
+ "options": {
23
+ "typeAware": true
24
+ },
25
+ "env": {
26
+ "node": true,
27
+ "es2024": true
28
+ },
29
+ "rules": {
30
+ "oxc/no-async-await": "off",
31
+ "oxc/no-barrel-file": "off",
32
+ "oxc/no-optional-chaining": "off",
33
+ "import/no-cycle": "off",
34
+ "typescript/await-thenable": "off",
35
+ "typescript/consistent-type-imports": "off",
36
+ "typescript/explicit-member-accessibility": "off",
37
+ "typescript/no-extraneous-class": "off",
38
+ "typescript/no-unsafe-argument": "off",
39
+ "typescript/no-unsafe-assignment": "off",
40
+ "typescript/no-unsafe-call": "off",
41
+ "typescript/no-unsafe-member-access": "off",
42
+ "typescript/no-unsafe-return": "off",
43
+ "typescript/no-unsafe-type-assertion": "off",
44
+ "typescript/parameter-properties": "off",
45
+ "typescript/prefer-literal-enum-member": "off",
46
+ "typescript/prefer-readonly-parameter-types": "off",
47
+ "typescript/strict-boolean-expressions": "off",
48
+ "typescript/array-type": [
49
+ "error",
50
+ {
51
+ "default": "array"
52
+ }
53
+ ],
54
+ "typescript/no-floating-promises": [
55
+ "error",
56
+ {
57
+ "ignoreVoid": true
58
+ }
59
+ ],
60
+ "eslint/arrow-body-style": "off",
61
+ "eslint/capitalized-comments": "off",
62
+ "eslint/class-methods-use-this": "off",
63
+ "eslint/func-style": "off",
64
+ "eslint/id-length": "off",
65
+ "eslint/max-classes-per-file": "off",
66
+ "eslint/max-lines-per-function": "off",
67
+ "eslint/max-params": "off",
68
+ "eslint/max-statements": "off",
69
+ "eslint/new-cap": "off",
70
+ "eslint/no-console": "off",
71
+ "eslint/no-magic-numbers": "off",
72
+ "eslint/no-ternary": "off",
73
+ "eslint/no-undefined": "off",
74
+ "eslint/no-void": "off",
75
+ "eslint/require-await": "off",
76
+ "eslint/sort-imports": "off",
77
+ "eslint/sort-keys": "off",
78
+ "eslint/no-warning-comments": "warn",
79
+ "eslint/complexity": [
80
+ "error",
81
+ {
82
+ "max": 15
83
+ }
84
+ ],
85
+ "import/consistent-type-specifier-style": "off",
86
+ "import/group-exports": "off",
87
+ "import/max-dependencies": "off",
88
+ "import/no-named-export": "off",
89
+ "import/no-nodejs-modules": "off",
90
+ "import/no-relative-parent-imports": "off",
91
+ "import/prefer-default-export": "off",
92
+ "node/no-process-env": "off",
93
+ "unicorn/no-null": "off",
94
+ "unicorn/prefer-top-level-await": "off",
95
+ "promise/avoid-new": "off",
96
+ "promise/prefer-await-to-then": "off",
97
+ "jest/consistent-test-it": "off",
98
+ "jest/max-expects": "off",
99
+ "jest/max-nested-describe": [
100
+ "error",
101
+ {
102
+ "max": 5
103
+ }
104
+ ],
105
+ "jest/no-alias-methods": "off",
106
+ "jest/no-conditional-in-test": "off",
107
+ "jest/no-confusing-set-timeout": "off",
108
+ "jest/no-deprecated-functions": "off",
109
+ "jest/no-done-callback": "off",
110
+ "jest/no-duplicate-hooks": "off",
111
+ "jest/no-hooks": "off",
112
+ "jest/no-identical-title": "off",
113
+ "jest/no-interpolation-in-snapshots": "off",
114
+ "jest/no-jasmine-globals": "off",
115
+ "jest/no-large-snapshots": "off",
116
+ "jest/no-mocks-import": "off",
117
+ "jest/no-restricted-jest-methods": "off",
118
+ "jest/no-restricted-matchers": "off",
119
+ "jest/no-test-prefixes": "off",
120
+ "jest/no-test-return-statement": "off",
121
+ "jest/no-unneeded-async-expect-function": "off",
122
+ "jest/no-untyped-mock-factory": "off",
123
+ "jest/padding-around-after-all-blocks": "off",
124
+ "jest/padding-around-test-blocks": "off",
125
+ "jest/prefer-called-with": "off",
126
+ "jest/prefer-comparison-matcher": "off",
127
+ "jest/prefer-each": "off",
128
+ "jest/prefer-ending-with-an-expect": "off",
129
+ "jest/prefer-equality-matcher": "off",
130
+ "jest/prefer-expect-resolves": "off",
131
+ "jest/prefer-hooks-in-order": "off",
132
+ "jest/prefer-hooks-on-top": "off",
133
+ "jest/prefer-importing-jest-globals": "off",
134
+ "jest/prefer-jest-mocked": "off",
135
+ "jest/prefer-lowercase-title": "off",
136
+ "jest/prefer-mock-promise-shorthand": "off",
137
+ "jest/prefer-mock-return-shorthand": "off",
138
+ "jest/prefer-spy-on": "off",
139
+ "jest/prefer-strict-equal": "off",
140
+ "jest/prefer-to-be": "off",
141
+ "jest/prefer-to-contain": "off",
142
+ "jest/prefer-to-have-been-called": "off",
143
+ "jest/prefer-to-have-been-called-times": "off",
144
+ "jest/prefer-to-have-length": "off",
145
+ "jest/prefer-todo": "off",
146
+ "jest/require-hook": "off",
147
+ "jest/require-top-level-describe": "off",
148
+ "jest/prefer-expect-assertions": "off",
149
+ "vitest/consistent-test-filename": "off",
150
+ "vitest/consistent-vitest-vi": "off",
151
+ "vitest/no-conditional-in-test": "off",
152
+ "vitest/no-import-node-test": "off",
153
+ "vitest/no-importing-vitest-globals": "off",
154
+ "vitest/prefer-called-exactly-once-with": "off",
155
+ "vitest/prefer-called-once": "off",
156
+ "vitest/prefer-called-times": "off",
157
+ "vitest/prefer-describe-function-title": "off",
158
+ "vitest/prefer-import-in-mock": "off",
159
+ "vitest/prefer-importing-vitest-globals": "off",
160
+ "vitest/prefer-strict-boolean-matchers": "off",
161
+ "vitest/prefer-to-be-falsy": "off",
162
+ "vitest/prefer-to-be-truthy": "off",
163
+ "vitest/require-test-timeout": "off",
164
+ "vitest/valid-title": "off",
165
+ "vitest/no-hooks": "off",
166
+ "vitest/prefer-expect-assertions": "off",
167
+ "vitest/max-expects": "off",
168
+ "jest/expect-expect": [
169
+ "error",
170
+ {
171
+ "assertFunctionNames": [
172
+ "expect",
173
+ "vitest.waitUntil",
174
+ "vi.waitUntil"
175
+ ]
176
+ }
177
+ ],
178
+ "jest/valid-title": [
179
+ "error",
180
+ {
181
+ "ignoreTypeOfDescribeName": true
182
+ }
183
+ ],
184
+ "eslint/no-undef": "off"
185
+ },
186
+ "overrides": [
187
+ {
188
+ "files": [
189
+ "**/*.spec.ts",
190
+ "test/**/*.ts"
191
+ ],
192
+ "rules": {
193
+ "typescript/no-non-null-assertion": "off",
194
+ "eslint/no-empty-function": "off",
195
+ "typescript/no-floating-promises": "off",
196
+ "vitest/require-mock-type-parameters": "off",
197
+ "eslint/no-loop-func": "off",
198
+ "eslint/init-declarations": "off",
199
+ "oxc/no-rest-spread-properties": "off",
200
+ "eslint/max-lines": "off"
201
+ }
202
+ }
203
+ ],
204
+ "ignorePatterns": [
205
+ "dist",
206
+ "node_modules",
207
+ "coverage",
208
+ "output"
209
+ ]
210
+ }
package/dist/index.js CHANGED
@@ -67,8 +67,8 @@ module.exports = __toCommonJS(src_exports);
67
67
 
68
68
  // src/application.ts
69
69
  var import_swagger = require("@nestjs/swagger");
70
- var import_class_validator = require("class-validator");
71
70
  var import_class_transformer = require("class-transformer");
71
+ var import_class_validator = require("class-validator");
72
72
  var CustomApplicationProperties = class {
73
73
  };
74
74
  var Application = class {
@@ -442,8 +442,8 @@ __decorateClass([
442
442
  ], Button.prototype, "ButtonHold", 2);
443
443
 
444
444
  // src/emulator.ts
445
- var import_class_validator5 = require("class-validator");
446
445
  var import_swagger7 = require("@nestjs/swagger");
446
+ var import_class_validator5 = require("class-validator");
447
447
  var City = /* @__PURE__ */ ((City2) => {
448
448
  City2["Waalwijk"] = "Waalwijk";
449
449
  City2["Sprang"] = "Sprang-Capelle";
@@ -459,8 +459,8 @@ __decorateClass([
459
459
 
460
460
  // src/jingle.ts
461
461
  var import_swagger8 = require("@nestjs/swagger");
462
- var import_class_validator6 = require("class-validator");
463
462
  var import_class_transformer4 = require("class-transformer");
463
+ var import_class_validator6 = require("class-validator");
464
464
  var Jingle = class {
465
465
  folder;
466
466
  file;
package/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import { City } from './src';
2
2
 
3
- export * from './interfaces';
3
+ export type * from './interfaces';
4
4
  export * from './src';
5
5
 
6
6
  export type ClickType = 'ButtonSingleClick' | 'ButtonDoubleClick' | 'ButtonHold';
7
7
 
8
- export type FlicButtonPayload = {
8
+ export interface FlicButtonPayload {
9
9
  bdAddr: string;
10
- };
10
+ }
11
11
 
12
12
  export type FlicButtonClickPayload = FlicButtonPayload & {
13
13
  clickType: ClickType;
@@ -17,9 +17,9 @@ export type FlicButtonBatteryPayload = FlicButtonPayload & {
17
17
  batteryStatus: number;
18
18
  };
19
19
 
20
- export type BrandweerPayload = {
20
+ export interface BrandweerPayload {
21
21
  city: City;
22
22
  title: string;
23
23
  description: string;
24
24
  pubDate: Date;
25
- };
25
+ }
@@ -1,8 +1,8 @@
1
- import { type ClickType } from '../index';
1
+ import type { ClickType } from "../index";
2
2
 
3
- export * from './mopidy';
4
- export * from './token';
5
- export * from './webamp';
3
+ export type * from "./mopidy";
4
+ export type * from "./token";
5
+ export type * from "./webamp";
6
6
 
7
7
  export interface RemoveButtonDto {
8
8
  bdAddr: string;
@@ -1,48 +1,48 @@
1
- import type Mopidy = require('mopidy');
1
+ import type Mopidy from "mopidy";
2
2
 
3
- type Artist = Omit<Mopidy.models.Artist, 'musicbrainz_id'>;
4
- type Album = Omit<Mopidy.models.Album, 'artists' | 'num_discs' | 'musicbrainz_id'> & {
3
+ type Artist = Omit<Mopidy.models.Artist, "musicbrainz_id">;
4
+ type Album = Omit<Mopidy.models.Album, "artists" | "num_discs" | "musicbrainz_id"> & {
5
5
  artists: Artist[];
6
6
  };
7
7
  type Track = Omit<
8
8
  Mopidy.models.Track,
9
- | 'album'
10
- | 'composers'
11
- | 'performers'
12
- | 'genre'
13
- | 'track_no'
14
- | 'disc_no'
15
- | 'date'
16
- | 'bitrate'
17
- | 'comment'
18
- | 'musicbrainz_id'
19
- | 'artists'
20
- | 'last_modified'
9
+ | "album"
10
+ | "composers"
11
+ | "performers"
12
+ | "genre"
13
+ | "track_no"
14
+ | "disc_no"
15
+ | "date"
16
+ | "bitrate"
17
+ | "comment"
18
+ | "musicbrainz_id"
19
+ | "artists"
20
+ | "last_modified"
21
21
  > & { album: Album; artists: Artist[]; isPlayable?: boolean };
22
- type TlTrack = Omit<Mopidy.models.TlTrack, 'track'> & { track: Track };
22
+ type TlTrack = Omit<Mopidy.models.TlTrack, "track"> & { track: Track };
23
23
  type Image = Mopidy.models.Image;
24
- type Playlist = Omit<Mopidy.models.Playlist, 'tracks' | 'last_modified' | 'length'>;
24
+ type Playlist = Omit<Mopidy.models.Playlist, "tracks" | "last_modified" | "length">;
25
25
 
26
- export type HasImage = { image: Image | undefined };
27
- export type TlTrackWithImage = TlTrack & HasImage;
28
- export type AlbumWithImage = Album & HasImage;
29
- export type ArtistWithImage = Artist & HasImage;
30
- export type TrackWithImage = Track & HasImage;
31
- export type PlaylistWithImage = Playlist & HasImage;
26
+ interface HasImage {
27
+ image: Image | undefined;
28
+ }
29
+ type TlTrackWithImage = TlTrack & HasImage;
30
+ type AlbumWithImage = Album & HasImage;
31
+ type ArtistWithImage = Artist & HasImage;
32
+ type TrackWithImage = Track & HasImage;
33
+ type PlaylistWithImage = Playlist & HasImage;
32
34
 
33
- type SearchResult = Omit<Mopidy.models.SearchResult, 'uri' | 'tracks' | 'albums' | 'artists'> & {
35
+ type SearchResult = Omit<Mopidy.models.SearchResult, "uri" | "tracks" | "albums" | "artists"> & {
34
36
  tracks: TrackWithImage[];
35
37
  albums: AlbumWithImage[];
36
38
  artists: ArtistWithImage[];
37
39
  playlists: PlaylistWithImage[];
38
40
  };
39
41
 
40
- export type { Track, TlTrack, Artist, Image, SearchResult, Album };
41
-
42
- export type PlaybackState = 'playing' | 'paused' | 'stopped';
43
- export type MopidyConnectionState = 'connected' | 'reconnecting' | 'offline';
42
+ type PlaybackState = "playing" | "paused" | "stopped";
43
+ type MopidyConnectionState = "connected" | "reconnecting" | "offline";
44
44
 
45
- export interface MopidyData {
45
+ interface MopidyData {
46
46
  tracklist: TlTrack[];
47
47
  volume: number;
48
48
  playRandom: boolean;
@@ -55,13 +55,32 @@ export interface MopidyData {
55
55
  connectionState: MopidyConnectionState;
56
56
  }
57
57
 
58
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
59
- export type AlarmschijfResult = {
58
+ interface AlarmschijfResult {
60
59
  playlist: Track[];
61
60
  alarmschijf?: TrackWithImage;
62
- };
61
+ }
63
62
 
64
- export type ReleaseRadarData = {
63
+ interface ReleaseRadarData {
65
64
  tracks: TrackWithImage[];
66
65
  albums: AlbumWithImage[];
66
+ }
67
+
68
+ export type {
69
+ Album,
70
+ AlarmschijfResult,
71
+ AlbumWithImage,
72
+ Artist,
73
+ ArtistWithImage,
74
+ HasImage,
75
+ Image,
76
+ MopidyConnectionState,
77
+ MopidyData,
78
+ PlaybackState,
79
+ PlaylistWithImage,
80
+ ReleaseRadarData,
81
+ SearchResult,
82
+ TlTrack,
83
+ TlTrackWithImage,
84
+ Track,
85
+ TrackWithImage,
67
86
  };
@@ -1,4 +1,4 @@
1
- import { TokenType } from '../src';
1
+ import { TokenType } from "../src";
2
2
 
3
3
  export interface TokenContent {
4
4
  email?: string;
@@ -17,6 +17,6 @@ export interface ApiTokenContent extends TokenContent {
17
17
  id: string;
18
18
  }
19
19
 
20
- export interface NewFrontendTokenContent extends Omit<FrontendTokenContent, 'iat' | 'exp'> {}
20
+ export type NewFrontendTokenContent = Omit<FrontendTokenContent, "iat" | "exp">;
21
21
 
22
- export interface NewApiTokenContent extends Omit<ApiTokenContent, 'iat' | 'exp'> {}
22
+ export type NewApiTokenContent = Omit<ApiTokenContent, "iat" | "exp">;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tering-serieuze-types",
3
- "version": "3.8.1",
3
+ "version": "3.10.0",
4
4
  "description": "Tering serieuze types",
5
5
  "author": "Frank",
6
6
  "repository": {
@@ -8,24 +8,22 @@
8
8
  "url": "git+https://gitlab.com/tering-serieuze-shit/tering-serieuze-types.git"
9
9
  },
10
10
  "scripts": {
11
- "prebuild": "npm run lint && npm run format",
11
+ "prebuild": "npm run lint && npm run format:check",
12
12
  "build": "esbuild src/index.ts --bundle --platform=node --outfile=dist/index.js --packages=external",
13
13
  "version": "npm run build && git add -A dist",
14
14
  "pub": "npm publish && git push",
15
- "lint": "eslint \"{src,interfaces}/**/*.ts\"",
16
- "format": "prettier \"src/**/*.ts\" \"interfaces/**/*.ts\" --check"
15
+ "lint": "oxlint",
16
+ "lint:fix": "oxlint --fix",
17
+ "format": "oxfmt src interfaces",
18
+ "format:check": "oxfmt --check src interfaces"
17
19
  },
18
20
  "main": "dist/index.js",
19
21
  "types": "index.d.ts",
20
22
  "devDependencies": {
21
- "@typescript-eslint/eslint-plugin": "^7.7.0",
22
- "@typescript-eslint/parser": "^7.7.0",
23
23
  "esbuild": "^0.23.1",
24
- "eslint": "^8.57.0",
25
- "eslint-config-airbnb-base": "^15.0.0",
26
- "eslint-config-prettier": "^9.1.0",
27
- "eslint-plugin-prettier": "^5.1.3",
28
- "prettier": "^3.4.2"
24
+ "oxfmt": "^0.47.0",
25
+ "oxlint": "^1.62.0",
26
+ "oxlint-tsgolint": "^0.22.1"
29
27
  },
30
28
  "dependencies": {
31
29
  "@nestjs/swagger": "^11.0.2",
@@ -1,9 +1,8 @@
1
- import { ApiProperty, OmitType } from '@nestjs/swagger';
2
- import { IsBoolean, IsNotEmpty, IsNumber, IsOptional, IsString, ValidateNested } from 'class-validator';
3
- import { Type } from 'class-transformer';
1
+ import { ApiProperty, OmitType } from "@nestjs/swagger";
2
+ import { Type } from "class-transformer";
3
+ import { IsBoolean, IsNotEmpty, IsNumber, IsOptional, IsString, ValidateNested } from "class-validator";
4
4
 
5
5
  export class CustomApplicationProperties {
6
- // eslint-disable-next-line no-undef
7
6
  [key: string]: string | number | boolean | string[] | number[] | boolean[] | (number | string)[];
8
7
  }
9
8
 
@@ -62,7 +61,7 @@ export class Application {
62
61
  custom: CustomApplicationProperties;
63
62
  }
64
63
 
65
- export class WindowStateApplication extends OmitType(Application, ['icon', 'isAdminOnly']) {}
64
+ export class WindowStateApplication extends OmitType(Application, ["icon", "isAdminOnly"]) {}
66
65
 
67
66
  export class WindowState {
68
67
  @ApiProperty({ type: [WindowStateApplication] })
package/src/arduino.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { ApiProperty } from '@nestjs/swagger';
2
- import { IsEnum } from 'class-validator';
1
+ import { ApiProperty } from "@nestjs/swagger";
2
+ import { IsEnum } from "class-validator";
3
3
 
4
4
  export enum ToggleableHardwareDeviceStateEnum {
5
- ON = 'Aan.',
6
- OFF = 'Uit.',
5
+ ON = "Aan.",
6
+ OFF = "Uit.",
7
7
  }
8
8
 
9
9
  export class ToggleableHardwareDeviceStateDto {
@@ -17,8 +17,8 @@ export class ToggleableHardwareDeviceStateDto {
17
17
  * TODO remove in next version
18
18
  */
19
19
  export enum ZwaailampStateEnum {
20
- ON = 'Aan.',
21
- OFF = 'Uit.',
20
+ ON = "Aan.",
21
+ OFF = "Uit.",
22
22
  }
23
23
 
24
24
  /**
@@ -2,16 +2,16 @@ import type {
2
2
  AuthenticatorDevice,
3
3
  CredentialDeviceType,
4
4
  PublicKeyCredentialRequestOptionsJSON,
5
- } from '@simplewebauthn/types';
6
- import { ApiProperty } from '@nestjs/swagger';
7
- import { User } from './user';
5
+ } from "@simplewebauthn/types";
6
+ import { ApiProperty } from "@nestjs/swagger";
7
+ import { User } from "./user";
8
8
 
9
9
  export type Authenticator = AuthenticatorDevice & {
10
10
  credentialDeviceType: CredentialDeviceType;
11
11
  credentialBackedUp: boolean;
12
12
  };
13
13
 
14
- export type DbAuthenticator = Omit<Authenticator, 'credentialID' | 'credentialPublicKey'> & {
14
+ export type DbAuthenticator = Omit<Authenticator, "credentialID" | "credentialPublicKey"> & {
15
15
  user: Promise<User> | User;
16
16
  credentialID: string;
17
17
  credentialPublicKey: string;
package/src/button.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { ApiProperty } from '@nestjs/swagger';
2
- import { User } from './user';
1
+ import { ApiProperty } from "@nestjs/swagger";
2
+ import { User } from "./user";
3
3
 
4
4
  export class WebsocketAction {
5
5
  @ApiProperty({ type: String })
@@ -9,7 +9,7 @@ export class WebsocketAction {
9
9
  methodName: string;
10
10
 
11
11
  @ApiProperty({ type: Object })
12
- data: any;
12
+ data: unknown;
13
13
  }
14
14
 
15
15
  export class Button {
package/src/emulator.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { IsEnum } from 'class-validator';
2
- import { ApiProperty } from '@nestjs/swagger';
1
+ import { ApiProperty } from "@nestjs/swagger";
2
+ import { IsEnum } from "class-validator";
3
3
 
4
4
  export enum City {
5
- Waalwijk = 'Waalwijk',
6
- Sprang = 'Sprang-Capelle',
5
+ Waalwijk = "Waalwijk",
6
+ Sprang = "Sprang-Capelle",
7
7
  }
8
8
 
9
9
  export class EmulateFireDepartmentDto {
package/src/index.ts CHANGED
@@ -1,18 +1,18 @@
1
- export * from './application';
2
- export * from './arduino';
3
- export * from './authenticator';
4
- export * from './button';
5
- export * from './emulator';
6
- export * from './jingle';
7
- export * from './k8s';
8
- export * from './mopidy';
9
- export * from './session';
10
- export * from './user';
1
+ export * from "./application";
2
+ export * from "./arduino";
3
+ export * from "./authenticator";
4
+ export * from "./button";
5
+ export * from "./emulator";
6
+ export * from "./jingle";
7
+ export * from "./k8s";
8
+ export * from "./mopidy";
9
+ export * from "./session";
10
+ export * from "./user";
11
11
 
12
12
  // Prevent 'Inferred type cannot be named' error
13
- export type { Type } from '@nestjs/common';
13
+ export type { Type } from "@nestjs/common";
14
14
 
15
- export interface Dto {}
15
+ export type Dto = Record<string, never>;
16
16
 
17
17
  export class P2000Payload {
18
18
  message: string;
package/src/jingle.ts CHANGED
@@ -1,30 +1,30 @@
1
- import { ApiProperty, PickType } from '@nestjs/swagger';
2
- import { IsNotEmpty, IsString, ValidateNested } from 'class-validator';
3
- import { Type } from 'class-transformer';
1
+ import { ApiProperty, PickType } from "@nestjs/swagger";
2
+ import { Type } from "class-transformer";
3
+ import { IsNotEmpty, IsString, ValidateNested } from "class-validator";
4
4
 
5
5
  export class Jingle {
6
- @ApiProperty({ type: String, example: 'internet-gekkies' })
6
+ @ApiProperty({ type: String, example: "internet-gekkies" })
7
7
  @IsString()
8
8
  @IsNotEmpty()
9
9
  folder: string;
10
10
 
11
- @ApiProperty({ type: String, example: 'mand.mp3' })
11
+ @ApiProperty({ type: String, example: "mand.mp3" })
12
12
  @IsString()
13
13
  @IsNotEmpty()
14
14
  file: string;
15
15
 
16
- @ApiProperty({ type: [String], examples: ['internet', 'gekkies', 'mand'] })
16
+ @ApiProperty({ type: [String], examples: ["internet", "gekkies", "mand"] })
17
17
  keywords: string[];
18
18
 
19
- @ApiProperty({ type: String, example: '1475909a5bbe100' })
19
+ @ApiProperty({ type: String, example: "1475909a5bbe100" })
20
20
  hash: string;
21
21
 
22
- @ApiProperty({ type: Number, example: 1599223250, description: 'Timestamp in seconds' })
22
+ @ApiProperty({ type: Number, example: 1_599_223_250, description: "Timestamp in seconds" })
23
23
  mtime: number;
24
24
  }
25
25
 
26
26
  export class JingleFolder {
27
- @ApiProperty({ type: String, example: 'internet-gekkies' })
27
+ @ApiProperty({ type: String, example: "internet-gekkies" })
28
28
  @IsString()
29
29
  @IsNotEmpty()
30
30
  folder: string;
@@ -35,15 +35,15 @@ export class JingleFolder {
35
35
  jingles: Jingle[];
36
36
  }
37
37
 
38
- export class PlayJingleDto extends PickType(Jingle, ['folder', 'file'] as const) {}
38
+ export class PlayJingleDto extends PickType(Jingle, ["folder", "file"] as const) {}
39
39
 
40
40
  export class BigBrotherItem {
41
- @ApiProperty({ type: String, example: 'internet-gekkies/mand.mp3', description: 'Path of the played jingle' })
41
+ @ApiProperty({ type: String, example: "internet-gekkies/mand.mp3", description: "Path of the played jingle" })
42
42
  data: string;
43
43
 
44
- @ApiProperty({ type: String, example: 'frank@maxserv.com', description: "User's email" })
44
+ @ApiProperty({ type: String, example: "frank@maxserv.com", description: "User's email" })
45
45
  user: string;
46
46
 
47
- @ApiProperty({ type: Number, example: 1679694523189, description: 'Timestamp in milliseconds' })
47
+ @ApiProperty({ type: Number, example: 1_679_694_523_189, description: "Timestamp in milliseconds" })
48
48
  time: number;
49
49
  }
package/src/k8s.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ApiProperty, PickType } from '@nestjs/swagger';
1
+ import { ApiProperty, PickType } from "@nestjs/swagger";
2
2
 
3
3
  export class Pod {
4
4
  @ApiProperty({ type: String })
@@ -26,4 +26,4 @@ export class Pod {
26
26
  node: string;
27
27
  }
28
28
 
29
- export class DeletePodDto extends PickType(Pod, ['name'] as const) {}
29
+ export class DeletePodDto extends PickType(Pod, ["name"] as const) {}
package/src/mopidy.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { ApiProperty } from '@nestjs/swagger';
2
- import { IsNotEmpty, IsString, Matches } from 'class-validator';
1
+ import { ApiProperty } from "@nestjs/swagger";
2
+ import { IsNotEmpty, IsString, Matches } from "class-validator";
3
3
 
4
4
  export class SetAlarmschijfDto {
5
- @ApiProperty({ description: 'URI of the track to set as alarmschijf', type: String })
5
+ @ApiProperty({ description: "URI of the track to set as alarmschijf", type: String })
6
6
  @IsString()
7
7
  @IsNotEmpty()
8
- @Matches(/^spotify:track:[a-zA-Z0-9]{22}$/, { message: 'URI must be a valid Spotify track URI' })
8
+ @Matches(/^spotify:track:[a-zA-Z0-9]{22}$/, { message: "URI must be a valid Spotify track URI" })
9
9
  uri: string;
10
10
  }
package/src/session.ts CHANGED
@@ -1,74 +1,74 @@
1
- import { ApiProperty } from '@nestjs/swagger';
2
- import { Type } from 'class-transformer';
3
- import { IsDate } from 'class-validator';
4
- import { User } from './user';
1
+ import { ApiProperty } from "@nestjs/swagger";
2
+ import { Type } from "class-transformer";
3
+ import { IsDate } from "class-validator";
4
+ import { User } from "./user";
5
5
 
6
6
  export enum TokenType {
7
- Refresh,
8
- Access,
9
- Api,
7
+ Refresh = 0,
8
+ Access = 1,
9
+ Api = 2,
10
10
  }
11
11
 
12
12
  export class ApiToken {
13
13
  @ApiProperty({
14
14
  type: String,
15
- example: 'fc532e57-66d6-4e92-9eb1-b08578d24b0b',
16
- description: 'Token ID, a random UUID',
15
+ example: "fc532e57-66d6-4e92-9eb1-b08578d24b0b",
16
+ description: "Token ID, a random UUID",
17
17
  })
18
18
  id: string;
19
19
 
20
20
  @ApiProperty({
21
21
  type: () => [User],
22
- description: 'User object',
22
+ description: "User object",
23
23
  })
24
24
  user: Promise<User> | User;
25
25
 
26
- @ApiProperty({ type: String, example: 'Token name' })
26
+ @ApiProperty({ type: String, example: "Token name" })
27
27
  name: string;
28
28
 
29
29
  @ApiProperty({
30
30
  type: Date,
31
- example: '2021-01-01T00:00:00.000Z',
32
- description: 'Timestamp of the creation of the api token',
31
+ example: "2021-01-01T00:00:00.000Z",
32
+ description: "Timestamp of the creation of the api token",
33
33
  })
34
34
  created: Date;
35
35
 
36
36
  @ApiProperty({
37
37
  type: Date,
38
- example: '2021-01-01T00:00:00.000Z',
39
- description: 'Timestamp of the last time the api token was used',
38
+ example: "2021-01-01T00:00:00.000Z",
39
+ description: "Timestamp of the last time the api token was used",
40
40
  nullable: true,
41
41
  })
42
42
  lastUsed?: Date;
43
43
  }
44
44
 
45
45
  export class Session {
46
- @ApiProperty({ type: Number, example: 123, description: 'Session ID' })
46
+ @ApiProperty({ type: Number, example: 123, description: "Session ID" })
47
47
  id: number;
48
48
 
49
49
  @ApiProperty({
50
50
  type: () => [User],
51
- description: 'User object',
51
+ description: "User object",
52
52
  })
53
53
  user: Promise<User> | User;
54
54
 
55
55
  @ApiProperty({
56
56
  type: Number,
57
57
  example: 5,
58
- description: 'Current number of the token. Updates when the refresh token is renewed.',
58
+ description: "Current number of the token. Updates when the refresh token is renewed.",
59
59
  default: 0,
60
60
  })
61
61
  lastTokenNumber: number;
62
62
 
63
63
  @ApiProperty({
64
64
  type: Date,
65
- example: '2021-01-01T00:00:00.000Z',
66
- description: 'Timestamp of the last time the session was used',
65
+ example: "2021-01-01T00:00:00.000Z",
66
+ description: "Timestamp of the last time the session was used",
67
67
  })
68
68
  @IsDate()
69
69
  @Type(() => Date)
70
70
  lastUsed: Date;
71
71
 
72
- @ApiProperty({ type: String, example: 'Chrome on Windows', description: 'Name of the session' })
72
+ @ApiProperty({ type: String, example: "Chrome on Windows", description: "Name of the session" })
73
73
  name: string;
74
74
  }
package/src/user.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { ApiProperty, PickType } from '@nestjs/swagger';
2
- import { Type } from 'class-transformer';
3
- import { IsEmail, IsNumberString, ValidateNested } from 'class-validator';
4
- import { Button } from './button';
5
- import { WindowState } from './application';
6
- import { type DbAuthenticator } from './authenticator';
7
- import { ApiToken, Session } from './session';
1
+ import { ApiProperty, PickType } from "@nestjs/swagger";
2
+ import { Type } from "class-transformer";
3
+ import { IsEmail, IsNumberString, ValidateNested } from "class-validator";
4
+ import type { DbAuthenticator } from "./authenticator";
5
+ import { WindowState } from "./application";
6
+ import { Button } from "./button";
7
+ import { ApiToken, Session } from "./session";
8
8
 
9
9
  export class User {
10
10
  @IsNumberString()
@@ -43,7 +43,7 @@ export class User {
43
43
  @ApiProperty({ type: () => [Button] })
44
44
  buttons: Button[];
45
45
 
46
- @ApiProperty({ type: String, default: '' })
46
+ @ApiProperty({ type: String, default: "" })
47
47
  lastSeenChangelogId: string;
48
48
 
49
49
  authenticators: DbAuthenticator[];
@@ -58,9 +58,9 @@ export class User {
58
58
  }
59
59
 
60
60
  export enum ToggleAbleUserPropertyEnum {
61
- isAdmin = 'isAdmin',
62
- isBanned = 'isBanned',
63
- playJinglesLocal = 'playJinglesLocal',
61
+ isAdmin = "isAdmin",
62
+ isBanned = "isBanned",
63
+ playJinglesLocal = "playJinglesLocal",
64
64
  }
65
65
 
66
66
  export class ToggleableUserProperties extends PickType(User, [
@@ -71,32 +71,32 @@ export class ToggleableUserProperties extends PickType(User, [
71
71
 
72
72
  export class AddUserDto {
73
73
  @IsEmail()
74
- @ApiProperty({ type: String, example: 'info@example.com' })
74
+ @ApiProperty({ type: String, example: "info@example.com" })
75
75
  email: string;
76
76
  }
77
77
 
78
- export class RemoveUserDto extends PickType(User, ['id'] as const) {}
78
+ export class RemoveUserDto extends PickType(User, ["id"] as const) {}
79
79
 
80
- export class SetWindowStateDto extends PickType(User, ['windowState'] as const) {}
80
+ export class SetWindowStateDto extends PickType(User, ["windowState"] as const) {}
81
81
 
82
- export class SetChangelogIdDto extends PickType(User, ['lastSeenChangelogId'] as const) {}
82
+ export class SetChangelogIdDto extends PickType(User, ["lastSeenChangelogId"] as const) {}
83
83
 
84
84
  export class ToggleBoolDto {
85
85
  @ApiProperty({
86
86
  type: String,
87
87
  nullable: true,
88
- description: 'User ID. When empty, the current user is used. Admin only param',
88
+ description: "User ID. When empty, the current user is used. Admin only param",
89
89
  })
90
90
  id?: string | null;
91
91
 
92
- @ApiProperty({ enum: ToggleAbleUserPropertyEnum, description: 'The property to toggle' })
92
+ @ApiProperty({ enum: ToggleAbleUserPropertyEnum, description: "The property to toggle" })
93
93
  field: keyof ToggleableUserProperties;
94
94
  }
95
95
 
96
96
  export class WsUpdateStoreDto {
97
97
  mutation: string;
98
98
 
99
- payload: any;
99
+ payload: unknown;
100
100
  }
101
101
 
102
102
  export class WsUpdateStoreSetAccount extends WsUpdateStoreDto {
package/tsconfig.json CHANGED
@@ -2,6 +2,7 @@
2
2
  "compilerOptions": {
3
3
  "emitDecoratorMetadata": true,
4
4
  "experimentalDecorators": true,
5
+ "module": "NodeNext",
5
6
  "target": "esnext",
6
7
  "moduleResolution": "NodeNext"
7
8
  }
package/.eslintrc.js DELETED
@@ -1,40 +0,0 @@
1
- module.exports = {
2
- parser: '@typescript-eslint/parser',
3
- parserOptions: {
4
- project: 'tsconfig.json',
5
- tsconfigRootDir: __dirname,
6
- sourceType: 'module',
7
- },
8
- plugins: ['@typescript-eslint/eslint-plugin'],
9
- extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended', 'airbnb-base'],
10
- root: true,
11
- env: {
12
- node: true,
13
- },
14
- ignorePatterns: ['.eslintrc.js'],
15
- rules: {
16
- '@typescript-eslint/interface-name-prefix': 'off',
17
- '@typescript-eslint/explicit-function-return-type': 'off',
18
- '@typescript-eslint/explicit-module-boundary-types': 'off',
19
- '@typescript-eslint/no-explicit-any': 'off',
20
- indent: ['error', 4, { SwitchCase: 1, ignoredNodes: ['PropertyDefinition'] }],
21
- 'import/prefer-default-export': 'off',
22
- 'no-useless-constructor': 'off',
23
- 'no-empty-function': 'off',
24
- 'no-unused-vars': 'off',
25
- 'import/no-unresolved': 'off',
26
- 'import/extensions': 'off',
27
- 'class-methods-use-this': 'off',
28
- 'no-param-reassign': 'off',
29
- 'no-console': 'off',
30
- 'max-len': ['error', { code: 120 }],
31
- 'no-underscore-dangle': 'off',
32
- 'no-shadow': 'off',
33
- 'object-curly-newline': 'off',
34
- 'import/no-extraneous-dependencies': 'off',
35
- 'arrow-body-style': 'off',
36
-
37
- // tering-serieuze-types specific
38
- 'max-classes-per-file': 'off',
39
- },
40
- };
package/.prettierrc DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "singleQuote": true,
3
- "trailingComma": "all",
4
- "tabWidth": 4,
5
- "printWidth": 120,
6
- }