tering-serieuze-types 1.4.0 → 1.6.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/dist/index.js CHANGED
@@ -28,19 +28,48 @@ var __decorateClass = (decorators, target, key, kind) => {
28
28
  // src/index.ts
29
29
  var src_exports = {};
30
30
  __export(src_exports, {
31
+ AddUserDto: () => AddUserDto,
32
+ Jingle: () => Jingle,
33
+ JingleFolder: () => JingleFolder,
31
34
  PlayJingleDto: () => PlayJingleDto
32
35
  });
33
36
  module.exports = __toCommonJS(src_exports);
34
37
  var import_swagger = require("@nestjs/swagger");
35
- var PlayJingleDto = class {
38
+ var import_class_validator = require("class-validator");
39
+ var AddUserDto = class {
36
40
  };
37
41
  __decorateClass([
38
- (0, import_swagger.ApiProperty)({ type: String, example: "keeskankerkachel" })
39
- ], PlayJingleDto.prototype, "folder", 2);
42
+ (0, import_class_validator.IsEmail)(),
43
+ (0, import_swagger.ApiProperty)({ type: String, example: "info@example.com" })
44
+ ], AddUserDto.prototype, "email", 2);
45
+ var Jingle = class {
46
+ };
47
+ __decorateClass([
48
+ (0, import_swagger.ApiProperty)({ type: String, example: "internet-gekkies" })
49
+ ], Jingle.prototype, "folder", 2);
50
+ __decorateClass([
51
+ (0, import_swagger.ApiProperty)({ type: String, example: "mand.mp3" })
52
+ ], Jingle.prototype, "file", 2);
53
+ __decorateClass([
54
+ (0, import_swagger.ApiProperty)({ type: [String], examples: ["internet", "gekkies", "mand"] })
55
+ ], Jingle.prototype, "keywords", 2);
40
56
  __decorateClass([
41
- (0, import_swagger.ApiProperty)({ type: String, example: "aan.mp3" })
42
- ], PlayJingleDto.prototype, "file", 2);
57
+ (0, import_swagger.ApiProperty)({ type: String, example: "1475909a5bbe100" })
58
+ ], Jingle.prototype, "hash", 2);
59
+ var JingleFolder = class {
60
+ };
61
+ __decorateClass([
62
+ (0, import_swagger.ApiProperty)({ type: String, example: "internet-gekkies" })
63
+ ], JingleFolder.prototype, "folder", 2);
64
+ __decorateClass([
65
+ (0, import_swagger.ApiProperty)({ type: [Jingle] })
66
+ ], JingleFolder.prototype, "jingles", 2);
67
+ var PlayJingleDto = class extends (0, import_swagger.PickType)(Jingle, ["folder", "file"]) {
68
+ };
43
69
  // Annotate the CommonJS export names for ESM import in node:
44
70
  0 && (module.exports = {
71
+ AddUserDto,
72
+ Jingle,
73
+ JingleFolder,
45
74
  PlayJingleDto
46
75
  });
@@ -26,23 +26,12 @@ export interface ButtonInterface {
26
26
  [key: string]: any;
27
27
  }
28
28
 
29
- export interface JingleInterface {
30
- folder: string;
31
- file: string;
32
- keywords: string[];
33
- hash: string;
34
- }
35
-
36
29
  export interface WebsocketAction {
37
30
  serviceName: string;
38
31
  methodName: string;
39
32
  data: any;
40
33
  }
41
34
 
42
- export interface AddUserDto {
43
- email: string;
44
- }
45
-
46
35
  export interface RemoveUserDto {
47
36
  id: number;
48
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tering-serieuze-types",
3
- "version": "1.4.0",
3
+ "version": "1.6.1",
4
4
  "description": "Tering serieuze types",
5
5
  "author": "Frank",
6
6
  "repository": {
@@ -13,8 +13,11 @@
13
13
  "main": "dist/index.js",
14
14
  "types": "index.d.ts",
15
15
  "devDependencies": {
16
- "@nestjs/swagger": "^6.1.4",
17
16
  "esbuild": "^0.16.10",
18
17
  "prettier": "^2.8.0"
18
+ },
19
+ "dependencies": {
20
+ "@nestjs/swagger": "^6.1.4",
21
+ "class-validator": "^0.13.2"
19
22
  }
20
23
  }
package/src/index.ts CHANGED
@@ -1,9 +1,32 @@
1
- import { ApiProperty } from '@nestjs/swagger';
1
+ import { ApiProperty, PickType } from '@nestjs/swagger';
2
+ import { IsEmail } from 'class-validator';
2
3
 
3
- export class PlayJingleDto {
4
- @ApiProperty({ type: String, example: 'keeskankerkachel' })
4
+ export class AddUserDto {
5
+ @IsEmail()
6
+ @ApiProperty({ type: String, example: 'info@example.com' })
7
+ email: string;
8
+ }
9
+
10
+ export class Jingle {
11
+ @ApiProperty({ type: String, example: 'internet-gekkies' })
5
12
  folder: string;
6
13
 
7
- @ApiProperty({ type: String, example: 'aan.mp3' })
14
+ @ApiProperty({ type: String, example: 'mand.mp3' })
8
15
  file: string;
16
+
17
+ @ApiProperty({ type: [String], examples: ['internet', 'gekkies', 'mand'] })
18
+ keywords: string[];
19
+
20
+ @ApiProperty({ type: String, example: '1475909a5bbe100' })
21
+ hash: string;
9
22
  }
23
+
24
+ export class JingleFolder {
25
+ @ApiProperty({ type: String, example: 'internet-gekkies' })
26
+ folder: string;
27
+
28
+ @ApiProperty({ type: [Jingle] })
29
+ jingles: Jingle[];
30
+ }
31
+
32
+ export class PlayJingleDto extends PickType(Jingle, ['folder', 'file'] as const) {}