tering-serieuze-types 2.7.2 → 2.9.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/dist/index.js +34 -23
- package/interfaces/token.ts +2 -1
- package/package.json +1 -1
- package/src/application.ts +8 -2
- package/src/session.ts +4 -0
- package/src/user.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -34,6 +34,7 @@ __export(src_exports, {
|
|
|
34
34
|
BigBrotherItem: () => BigBrotherItem,
|
|
35
35
|
Button: () => Button,
|
|
36
36
|
City: () => City,
|
|
37
|
+
CustomApplicationProperties: () => CustomApplicationProperties,
|
|
37
38
|
DeletePodDto: () => DeletePodDto,
|
|
38
39
|
EmulateFireDepartmentDto: () => EmulateFireDepartmentDto,
|
|
39
40
|
Jingle: () => Jingle,
|
|
@@ -63,6 +64,8 @@ module.exports = __toCommonJS(src_exports);
|
|
|
63
64
|
var import_swagger = require("@nestjs/swagger");
|
|
64
65
|
var import_class_validator = require("class-validator");
|
|
65
66
|
var import_class_transformer = require("class-transformer");
|
|
67
|
+
var CustomApplicationProperties = class {
|
|
68
|
+
};
|
|
66
69
|
var Application = class {
|
|
67
70
|
name;
|
|
68
71
|
icon;
|
|
@@ -122,8 +125,9 @@ __decorateClass([
|
|
|
122
125
|
(0, import_class_validator.IsNumber)()
|
|
123
126
|
], Application.prototype, "y", 2);
|
|
124
127
|
__decorateClass([
|
|
125
|
-
(0, import_swagger.ApiProperty)({ type:
|
|
126
|
-
(0, import_class_validator.IsOptional)()
|
|
128
|
+
(0, import_swagger.ApiProperty)({ type: CustomApplicationProperties }),
|
|
129
|
+
(0, import_class_validator.IsOptional)(),
|
|
130
|
+
(0, import_class_transformer.Type)(() => CustomApplicationProperties)
|
|
127
131
|
], Application.prototype, "custom", 2);
|
|
128
132
|
var WindowStateApplication = class extends (0, import_swagger.OmitType)(Application, ["icon", "isAdminOnly"]) {
|
|
129
133
|
};
|
|
@@ -160,11 +164,13 @@ var import_swagger5 = require("@nestjs/swagger");
|
|
|
160
164
|
|
|
161
165
|
// src/user.ts
|
|
162
166
|
var import_swagger4 = require("@nestjs/swagger");
|
|
163
|
-
var
|
|
164
|
-
var
|
|
167
|
+
var import_class_transformer3 = require("class-transformer");
|
|
168
|
+
var import_class_validator3 = require("class-validator");
|
|
165
169
|
|
|
166
170
|
// src/session.ts
|
|
167
171
|
var import_swagger3 = require("@nestjs/swagger");
|
|
172
|
+
var import_class_transformer2 = require("class-transformer");
|
|
173
|
+
var import_class_validator2 = require("class-validator");
|
|
168
174
|
var TokenType = /* @__PURE__ */ ((TokenType2) => {
|
|
169
175
|
TokenType2[TokenType2["Refresh"] = 0] = "Refresh";
|
|
170
176
|
TokenType2[TokenType2["Access"] = 1] = "Access";
|
|
@@ -238,7 +244,9 @@ __decorateClass([
|
|
|
238
244
|
type: Date,
|
|
239
245
|
example: "2021-01-01T00:00:00.000Z",
|
|
240
246
|
description: "Timestamp of the last time the session was used"
|
|
241
|
-
})
|
|
247
|
+
}),
|
|
248
|
+
(0, import_class_validator2.IsDate)(),
|
|
249
|
+
(0, import_class_transformer2.Type)(() => Date)
|
|
242
250
|
], Session.prototype, "lastUsed", 2);
|
|
243
251
|
__decorateClass([
|
|
244
252
|
(0, import_swagger3.ApiProperty)({ type: String, example: "Chrome on Windows", description: "Name of the session" })
|
|
@@ -262,14 +270,14 @@ var User = class {
|
|
|
262
270
|
apiTokens;
|
|
263
271
|
};
|
|
264
272
|
__decorateClass([
|
|
265
|
-
(0,
|
|
273
|
+
(0, import_class_validator3.IsNumberString)(),
|
|
266
274
|
(0, import_swagger4.ApiProperty)({ type: Number })
|
|
267
275
|
], User.prototype, "id", 2);
|
|
268
276
|
__decorateClass([
|
|
269
277
|
(0, import_swagger4.ApiProperty)({ type: Number, nullable: true, default: null })
|
|
270
278
|
], User.prototype, "_id", 2);
|
|
271
279
|
__decorateClass([
|
|
272
|
-
(0,
|
|
280
|
+
(0, import_class_validator3.IsEmail)(),
|
|
273
281
|
(0, import_swagger4.ApiProperty)({ type: String })
|
|
274
282
|
], User.prototype, "email", 2);
|
|
275
283
|
__decorateClass([
|
|
@@ -290,8 +298,8 @@ __decorateClass([
|
|
|
290
298
|
], User.prototype, "isRegistering", 2);
|
|
291
299
|
__decorateClass([
|
|
292
300
|
(0, import_swagger4.ApiProperty)({ type: WindowState }),
|
|
293
|
-
(0,
|
|
294
|
-
(0,
|
|
301
|
+
(0, import_class_validator3.ValidateNested)(),
|
|
302
|
+
(0, import_class_transformer3.Type)(() => WindowState)
|
|
295
303
|
], User.prototype, "windowState", 2);
|
|
296
304
|
__decorateClass([
|
|
297
305
|
(0, import_swagger4.ApiProperty)({ type: () => [Button] })
|
|
@@ -300,7 +308,9 @@ __decorateClass([
|
|
|
300
308
|
(0, import_swagger4.ApiProperty)({ type: String, default: "" })
|
|
301
309
|
], User.prototype, "lastSeenChangelogId", 2);
|
|
302
310
|
__decorateClass([
|
|
303
|
-
(0, import_swagger4.ApiProperty)({ type: () => [Session] })
|
|
311
|
+
(0, import_swagger4.ApiProperty)({ type: () => [Session] }),
|
|
312
|
+
(0, import_class_validator3.ValidateNested)({ each: true }),
|
|
313
|
+
(0, import_class_transformer3.Type)(() => Session)
|
|
304
314
|
], User.prototype, "sessions", 2);
|
|
305
315
|
__decorateClass([
|
|
306
316
|
(0, import_swagger4.ApiProperty)({ type: () => [ApiToken] })
|
|
@@ -321,7 +331,7 @@ var AddUserDto = class {
|
|
|
321
331
|
email;
|
|
322
332
|
};
|
|
323
333
|
__decorateClass([
|
|
324
|
-
(0,
|
|
334
|
+
(0, import_class_validator3.IsEmail)(),
|
|
325
335
|
(0, import_swagger4.ApiProperty)({ type: String, example: "info@example.com" })
|
|
326
336
|
], AddUserDto.prototype, "email", 2);
|
|
327
337
|
var RemoveUserDto = class extends (0, import_swagger4.PickType)(User, ["id"]) {
|
|
@@ -399,7 +409,7 @@ __decorateClass([
|
|
|
399
409
|
], Button.prototype, "ButtonHold", 2);
|
|
400
410
|
|
|
401
411
|
// src/emulator.ts
|
|
402
|
-
var
|
|
412
|
+
var import_class_validator4 = require("class-validator");
|
|
403
413
|
var import_swagger6 = require("@nestjs/swagger");
|
|
404
414
|
var City = /* @__PURE__ */ ((City2) => {
|
|
405
415
|
City2["Waalwijk"] = "Waalwijk";
|
|
@@ -411,13 +421,13 @@ var EmulateFireDepartmentDto = class {
|
|
|
411
421
|
};
|
|
412
422
|
__decorateClass([
|
|
413
423
|
(0, import_swagger6.ApiProperty)({ enum: City }),
|
|
414
|
-
(0,
|
|
424
|
+
(0, import_class_validator4.IsEnum)(City)
|
|
415
425
|
], EmulateFireDepartmentDto.prototype, "city", 2);
|
|
416
426
|
|
|
417
427
|
// src/jingle.ts
|
|
418
428
|
var import_swagger7 = require("@nestjs/swagger");
|
|
419
|
-
var
|
|
420
|
-
var
|
|
429
|
+
var import_class_validator5 = require("class-validator");
|
|
430
|
+
var import_class_transformer4 = require("class-transformer");
|
|
421
431
|
var Jingle = class {
|
|
422
432
|
folder;
|
|
423
433
|
file;
|
|
@@ -427,13 +437,13 @@ var Jingle = class {
|
|
|
427
437
|
};
|
|
428
438
|
__decorateClass([
|
|
429
439
|
(0, import_swagger7.ApiProperty)({ type: String, example: "internet-gekkies" }),
|
|
430
|
-
(0,
|
|
431
|
-
(0,
|
|
440
|
+
(0, import_class_validator5.IsString)(),
|
|
441
|
+
(0, import_class_validator5.IsNotEmpty)()
|
|
432
442
|
], Jingle.prototype, "folder", 2);
|
|
433
443
|
__decorateClass([
|
|
434
444
|
(0, import_swagger7.ApiProperty)({ type: String, example: "mand.mp3" }),
|
|
435
|
-
(0,
|
|
436
|
-
(0,
|
|
445
|
+
(0, import_class_validator5.IsString)(),
|
|
446
|
+
(0, import_class_validator5.IsNotEmpty)()
|
|
437
447
|
], Jingle.prototype, "file", 2);
|
|
438
448
|
__decorateClass([
|
|
439
449
|
(0, import_swagger7.ApiProperty)({ type: [String], examples: ["internet", "gekkies", "mand"] })
|
|
@@ -450,13 +460,13 @@ var JingleFolder = class {
|
|
|
450
460
|
};
|
|
451
461
|
__decorateClass([
|
|
452
462
|
(0, import_swagger7.ApiProperty)({ type: String, example: "internet-gekkies" }),
|
|
453
|
-
(0,
|
|
454
|
-
(0,
|
|
463
|
+
(0, import_class_validator5.IsString)(),
|
|
464
|
+
(0, import_class_validator5.IsNotEmpty)()
|
|
455
465
|
], JingleFolder.prototype, "folder", 2);
|
|
456
466
|
__decorateClass([
|
|
457
467
|
(0, import_swagger7.ApiProperty)({ type: [Jingle] }),
|
|
458
|
-
(0,
|
|
459
|
-
(0,
|
|
468
|
+
(0, import_class_validator5.ValidateNested)({ each: true }),
|
|
469
|
+
(0, import_class_transformer4.Type)(() => Jingle)
|
|
460
470
|
], JingleFolder.prototype, "jingles", 2);
|
|
461
471
|
var PlayJingleDto = class extends (0, import_swagger7.PickType)(Jingle, ["folder", "file"]) {
|
|
462
472
|
};
|
|
@@ -527,6 +537,7 @@ var P2000Payload = class {
|
|
|
527
537
|
BigBrotherItem,
|
|
528
538
|
Button,
|
|
529
539
|
City,
|
|
540
|
+
CustomApplicationProperties,
|
|
530
541
|
DeletePodDto,
|
|
531
542
|
EmulateFireDepartmentDto,
|
|
532
543
|
Jingle,
|
package/interfaces/token.ts
CHANGED
package/package.json
CHANGED
package/src/application.ts
CHANGED
|
@@ -2,6 +2,11 @@ import { ApiProperty, OmitType } from '@nestjs/swagger';
|
|
|
2
2
|
import { IsBoolean, IsNotEmpty, IsNumber, IsOptional, IsString, ValidateNested } from 'class-validator';
|
|
3
3
|
import { Type } from 'class-transformer';
|
|
4
4
|
|
|
5
|
+
export class CustomApplicationProperties {
|
|
6
|
+
// eslint-disable-next-line no-undef
|
|
7
|
+
[key: string]: string | number | boolean | string[] | number[] | boolean[] | (number | string)[];
|
|
8
|
+
}
|
|
9
|
+
|
|
5
10
|
export class Application {
|
|
6
11
|
@ApiProperty({ type: String })
|
|
7
12
|
@IsNotEmpty()
|
|
@@ -47,9 +52,10 @@ export class Application {
|
|
|
47
52
|
@IsNumber()
|
|
48
53
|
y: number;
|
|
49
54
|
|
|
50
|
-
@ApiProperty({ type:
|
|
55
|
+
@ApiProperty({ type: CustomApplicationProperties })
|
|
51
56
|
@IsOptional()
|
|
52
|
-
|
|
57
|
+
@Type(() => CustomApplicationProperties)
|
|
58
|
+
custom: CustomApplicationProperties;
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
export class WindowStateApplication extends OmitType(Application, ['icon', 'isAdminOnly']) {}
|
package/src/session.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { Type } from 'class-transformer';
|
|
3
|
+
import { IsDate } from 'class-validator';
|
|
2
4
|
import { User } from './user';
|
|
3
5
|
|
|
4
6
|
export enum TokenType {
|
|
@@ -63,6 +65,8 @@ export class Session {
|
|
|
63
65
|
example: '2021-01-01T00:00:00.000Z',
|
|
64
66
|
description: 'Timestamp of the last time the session was used',
|
|
65
67
|
})
|
|
68
|
+
@IsDate()
|
|
69
|
+
@Type(() => Date)
|
|
66
70
|
lastUsed: Date;
|
|
67
71
|
|
|
68
72
|
@ApiProperty({ type: String, example: 'Chrome on Windows', description: 'Name of the session' })
|
package/src/user.ts
CHANGED