@cloudkata/common 1.0.15 → 1.0.16

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.
@@ -29,8 +29,6 @@ export declare const AuthResponseSchema: z.ZodObject<{
29
29
  avatarUrl?: string | undefined;
30
30
  }>;
31
31
  }, "strip", z.ZodTypeAny, {
32
- refreshToken: string;
33
- accessToken: string;
34
32
  user: {
35
33
  email: string;
36
34
  username: string;
@@ -40,9 +38,9 @@ export declare const AuthResponseSchema: z.ZodObject<{
40
38
  updatedAt: Date;
41
39
  avatarUrl?: string | undefined;
42
40
  };
43
- }, {
44
41
  refreshToken: string;
45
42
  accessToken: string;
43
+ }, {
46
44
  user: {
47
45
  email: string;
48
46
  username: string;
@@ -52,5 +50,7 @@ export declare const AuthResponseSchema: z.ZodObject<{
52
50
  updatedAt: Date;
53
51
  avatarUrl?: string | undefined;
54
52
  };
53
+ refreshToken: string;
54
+ accessToken: string;
55
55
  }>;
56
56
  export type AuthResponseDto = z.infer<typeof AuthResponseSchema>;
@@ -30,8 +30,6 @@ export declare const OAuthResponseSchema: z.ZodObject<{
30
30
  avatarUrl?: string | undefined;
31
31
  }>;
32
32
  }, "strip", z.ZodTypeAny, {
33
- refreshToken: string;
34
- accessToken: string;
35
33
  user: {
36
34
  email: string;
37
35
  username: string;
@@ -41,10 +39,10 @@ export declare const OAuthResponseSchema: z.ZodObject<{
41
39
  updatedAt: Date;
42
40
  avatarUrl?: string | undefined;
43
41
  };
44
- isNewUser: boolean;
45
- }, {
46
42
  refreshToken: string;
47
43
  accessToken: string;
44
+ isNewUser: boolean;
45
+ }, {
48
46
  user: {
49
47
  email: string;
50
48
  username: string;
@@ -54,6 +52,8 @@ export declare const OAuthResponseSchema: z.ZodObject<{
54
52
  updatedAt: Date;
55
53
  avatarUrl?: string | undefined;
56
54
  };
55
+ refreshToken: string;
56
+ accessToken: string;
57
57
  isNewUser: boolean;
58
58
  }>;
59
59
  export type OAuthResponseDto = z.infer<typeof OAuthResponseSchema>;
@@ -2,3 +2,4 @@ export * from './difficulty.enum';
2
2
  export * from './problem-type.enum';
3
3
  export * from './provider.enum';
4
4
  export * from './submission-status.enum';
5
+ export * from './user-role.enum';
@@ -18,4 +18,5 @@ __exportStar(require("./difficulty.enum"), exports);
18
18
  __exportStar(require("./problem-type.enum"), exports);
19
19
  __exportStar(require("./provider.enum"), exports);
20
20
  __exportStar(require("./submission-status.enum"), exports);
21
+ __exportStar(require("./user-role.enum"), exports);
21
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,sDAAoC;AACpC,kDAAgC;AAChC,2DAAyC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,sDAAoC;AACpC,kDAAgC;AAChC,2DAAyC;AACzC,mDAAiC"}
@@ -0,0 +1,4 @@
1
+ export declare enum UserRole {
2
+ USER = "user",
3
+ ADMIN = "admin"
4
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserRole = void 0;
4
+ var UserRole;
5
+ (function (UserRole) {
6
+ UserRole["USER"] = "user";
7
+ UserRole["ADMIN"] = "admin";
8
+ })(UserRole || (exports.UserRole = UserRole = {}));
9
+ //# sourceMappingURL=user-role.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-role.enum.js","sourceRoot":"","sources":["../../src/enums/user-role.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,2BAAe,CAAA;AACjB,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB"}
@@ -1,7 +1,9 @@
1
+ import { UserRole } from '../enums';
1
2
  export interface IAuthPayload {
2
3
  sub: string;
3
4
  email: string;
4
5
  username: string;
6
+ role: UserRole;
5
7
  iat?: number;
6
8
  exp?: number;
7
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudkata/common",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "Shared contracts, interfaces, DTOs and enums for CloudKata",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",