tering-serieuze-types 1.27.1 → 2.0.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 +14 -8
- package/interfaces/index.ts +2 -2
- package/package.json +1 -1
- package/src/authenticator.ts +2 -0
- package/src/button.ts +0 -6
- package/src/session.ts +15 -5
- package/src/user.ts +4 -4
package/dist/index.js
CHANGED
|
@@ -143,6 +143,12 @@ __decorateClass([
|
|
|
143
143
|
description: "Token ID, a random UUID"
|
|
144
144
|
})
|
|
145
145
|
], ApiToken.prototype, "id", 2);
|
|
146
|
+
__decorateClass([
|
|
147
|
+
(0, import_swagger3.ApiProperty)({
|
|
148
|
+
type: User,
|
|
149
|
+
description: "User object"
|
|
150
|
+
})
|
|
151
|
+
], ApiToken.prototype, "user", 2);
|
|
146
152
|
__decorateClass([
|
|
147
153
|
(0, import_swagger3.ApiProperty)({ type: String, example: "Token name" })
|
|
148
154
|
], ApiToken.prototype, "name", 2);
|
|
@@ -164,11 +170,14 @@ __decorateClass([
|
|
|
164
170
|
var Session = class {
|
|
165
171
|
};
|
|
166
172
|
__decorateClass([
|
|
167
|
-
(0, import_swagger3.ApiProperty)({ type:
|
|
173
|
+
(0, import_swagger3.ApiProperty)({ type: Number, example: 123, description: "Session ID" })
|
|
168
174
|
], Session.prototype, "id", 2);
|
|
169
175
|
__decorateClass([
|
|
170
|
-
(0, import_swagger3.ApiProperty)({
|
|
171
|
-
|
|
176
|
+
(0, import_swagger3.ApiProperty)({
|
|
177
|
+
type: User,
|
|
178
|
+
description: "User object"
|
|
179
|
+
})
|
|
180
|
+
], Session.prototype, "user", 2);
|
|
172
181
|
__decorateClass([
|
|
173
182
|
(0, import_swagger3.ApiProperty)({
|
|
174
183
|
type: Number,
|
|
@@ -192,7 +201,7 @@ __decorateClass([
|
|
|
192
201
|
var User = class {
|
|
193
202
|
};
|
|
194
203
|
__decorateClass([
|
|
195
|
-
(0, import_swagger4.ApiProperty)({ type:
|
|
204
|
+
(0, import_swagger4.ApiProperty)({ type: Number })
|
|
196
205
|
], User.prototype, "id", 2);
|
|
197
206
|
__decorateClass([
|
|
198
207
|
(0, import_class_validator.IsEmail)(),
|
|
@@ -211,7 +220,7 @@ __decorateClass([
|
|
|
211
220
|
(0, import_swagger4.ApiProperty)({ type: [String], default: [] })
|
|
212
221
|
], User.prototype, "favoriteJingles", 2);
|
|
213
222
|
__decorateClass([
|
|
214
|
-
(0, import_swagger4.ApiProperty)({ type:
|
|
223
|
+
(0, import_swagger4.ApiProperty)({ type: Date, nullable: true }),
|
|
215
224
|
(0, import_swagger4.ApiProperty)()
|
|
216
225
|
], User.prototype, "isRegistering", 2);
|
|
217
226
|
__decorateClass([
|
|
@@ -301,9 +310,6 @@ __decorateClass([
|
|
|
301
310
|
__decorateClass([
|
|
302
311
|
(0, import_swagger5.ApiProperty)({ type: WebsocketAction, nullable: true })
|
|
303
312
|
], Button.prototype, "ButtonHold", 2);
|
|
304
|
-
__decorateClass([
|
|
305
|
-
(0, import_swagger5.ApiProperty)({ type: Number, nullable: true })
|
|
306
|
-
], Button.prototype, "batteryState", 2);
|
|
307
313
|
|
|
308
314
|
// src/emulator.ts
|
|
309
315
|
var import_swagger6 = require("@nestjs/swagger");
|
package/interfaces/index.ts
CHANGED
package/package.json
CHANGED
package/src/authenticator.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
PublicKeyCredentialRequestOptionsJSON,
|
|
5
5
|
} from '@simplewebauthn/typescript-types';
|
|
6
6
|
import { ApiProperty } from '@nestjs/swagger';
|
|
7
|
+
import { User } from './user';
|
|
7
8
|
|
|
8
9
|
export type Authenticator = AuthenticatorDevice & {
|
|
9
10
|
credentialDeviceType: CredentialDeviceType;
|
|
@@ -11,6 +12,7 @@ export type Authenticator = AuthenticatorDevice & {
|
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
export type DbAuthenticator = Omit<Authenticator, 'credentialID' | 'credentialPublicKey'> & {
|
|
15
|
+
user: User;
|
|
14
16
|
credentialID: string;
|
|
15
17
|
credentialPublicKey: string;
|
|
16
18
|
};
|
package/src/button.ts
CHANGED
|
@@ -33,10 +33,4 @@ export class Button {
|
|
|
33
33
|
|
|
34
34
|
@ApiProperty({ type: WebsocketAction, nullable: true })
|
|
35
35
|
ButtonHold?: WebsocketAction;
|
|
36
|
-
|
|
37
|
-
@ApiProperty({ type: Number, nullable: true })
|
|
38
|
-
batteryState?: number;
|
|
39
|
-
|
|
40
|
-
// eslint-disable-next-line no-undef
|
|
41
|
-
[key: string]: any;
|
|
42
36
|
}
|
package/src/session.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { User } from './user';
|
|
2
3
|
|
|
3
4
|
export enum TokenType {
|
|
4
5
|
Refresh,
|
|
@@ -7,7 +8,7 @@ export enum TokenType {
|
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export type TokenContent = {
|
|
10
|
-
sessionId:
|
|
11
|
+
sessionId: number;
|
|
11
12
|
email: string;
|
|
12
13
|
tokenNumber: number;
|
|
13
14
|
type: TokenType;
|
|
@@ -23,6 +24,12 @@ export class ApiToken {
|
|
|
23
24
|
})
|
|
24
25
|
id: string;
|
|
25
26
|
|
|
27
|
+
@ApiProperty({
|
|
28
|
+
type: User,
|
|
29
|
+
description: 'User object',
|
|
30
|
+
})
|
|
31
|
+
user: User;
|
|
32
|
+
|
|
26
33
|
@ApiProperty({ type: String, example: 'Token name' })
|
|
27
34
|
name: string;
|
|
28
35
|
|
|
@@ -43,11 +50,14 @@ export class ApiToken {
|
|
|
43
50
|
}
|
|
44
51
|
|
|
45
52
|
export class Session {
|
|
46
|
-
@ApiProperty({ type:
|
|
47
|
-
id:
|
|
53
|
+
@ApiProperty({ type: Number, example: 123, description: 'Session ID' })
|
|
54
|
+
id: number;
|
|
48
55
|
|
|
49
|
-
@ApiProperty({
|
|
50
|
-
|
|
56
|
+
@ApiProperty({
|
|
57
|
+
type: User,
|
|
58
|
+
description: 'User object',
|
|
59
|
+
})
|
|
60
|
+
user: User;
|
|
51
61
|
|
|
52
62
|
@ApiProperty({
|
|
53
63
|
type: Number,
|
package/src/user.ts
CHANGED
|
@@ -6,8 +6,8 @@ import { type DbAuthenticator } from './authenticator';
|
|
|
6
6
|
import { ApiToken, Session } from './session';
|
|
7
7
|
|
|
8
8
|
export class User {
|
|
9
|
-
@ApiProperty({ type:
|
|
10
|
-
id:
|
|
9
|
+
@ApiProperty({ type: Number })
|
|
10
|
+
id: number;
|
|
11
11
|
|
|
12
12
|
@IsEmail()
|
|
13
13
|
@ApiProperty({ type: String })
|
|
@@ -25,9 +25,9 @@ export class User {
|
|
|
25
25
|
@ApiProperty({ type: [String], default: [] })
|
|
26
26
|
favoriteJingles: string[];
|
|
27
27
|
|
|
28
|
-
@ApiProperty({ type:
|
|
28
|
+
@ApiProperty({ type: Date, nullable: true })
|
|
29
29
|
@ApiProperty()
|
|
30
|
-
isRegistering?:
|
|
30
|
+
isRegistering?: Date;
|
|
31
31
|
|
|
32
32
|
@ApiProperty({ type: WindowState })
|
|
33
33
|
windowState: WindowState;
|