@cloudkata/common 1.0.15 → 1.0.17

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>;
@@ -1,12 +1,12 @@
1
1
  import { z } from 'zod';
2
2
  export declare const CreateSubmissionSchema: z.ZodObject<{
3
3
  problemId: z.ZodString;
4
- answer: z.ZodString;
4
+ code: z.ZodString;
5
5
  }, "strip", z.ZodTypeAny, {
6
+ code: string;
6
7
  problemId: string;
7
- answer: string;
8
8
  }, {
9
+ code: string;
9
10
  problemId: string;
10
- answer: string;
11
11
  }>;
12
12
  export type CreateSubmissionDto = z.infer<typeof CreateSubmissionSchema>;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CreateSubmissionSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.CreateSubmissionSchema = zod_1.z.object({
6
- problemId: zod_1.z.string().uuid('Invalid problem ID'),
7
- answer: zod_1.z.string().min(1, 'Answer is required'),
6
+ problemId: zod_1.z.string().uuid(),
7
+ code: zod_1.z.string().min(1),
8
8
  });
9
9
  //# sourceMappingURL=create-submission.dto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-submission.dto.js","sourceRoot":"","sources":["../../../src/dtos/submission/create-submission.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC;IAChD,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,oBAAoB,CAAC;CAChD,CAAC,CAAC"}
1
+ {"version":3,"file":"create-submission.dto.js","sourceRoot":"","sources":["../../../src/dtos/submission/create-submission.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC5B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACxB,CAAC,CAAC"}
@@ -10,16 +10,16 @@ export declare const SubmissionResponseSchema: z.ZodObject<{
10
10
  }, "strip", z.ZodTypeAny, {
11
11
  id: string;
12
12
  problemId: string;
13
- answer: string;
14
13
  userId: string;
14
+ answer: string;
15
15
  isCorrect: boolean;
16
16
  submittedAt: Date;
17
17
  executionTime?: number | undefined;
18
18
  }, {
19
19
  id: string;
20
20
  problemId: string;
21
- answer: string;
22
21
  userId: string;
22
+ answer: string;
23
23
  isCorrect: boolean;
24
24
  submittedAt: Date;
25
25
  executionTime?: number | undefined;
@@ -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.17",
4
4
  "description": "Shared contracts, interfaces, DTOs and enums for CloudKata",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",