@cloudkata/common 1.0.17 → 1.0.18

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.
@@ -1,27 +1,64 @@
1
1
  import { z } from 'zod';
2
+ import { SubmissionStatus } from '../../enums';
3
+ export declare const TestResultSchema: z.ZodObject<{
4
+ name: z.ZodString;
5
+ passed: z.ZodBoolean;
6
+ message: z.ZodOptional<z.ZodString>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ passed: boolean;
9
+ name: string;
10
+ message?: string | undefined;
11
+ }, {
12
+ passed: boolean;
13
+ name: string;
14
+ message?: string | undefined;
15
+ }>;
2
16
  export declare const SubmissionResponseSchema: z.ZodObject<{
3
17
  id: z.ZodString;
4
18
  userId: z.ZodString;
5
19
  problemId: z.ZodString;
6
- answer: z.ZodString;
7
- isCorrect: z.ZodBoolean;
8
- executionTime: z.ZodOptional<z.ZodNumber>;
20
+ code: z.ZodString;
21
+ status: z.ZodNativeEnum<typeof SubmissionStatus>;
22
+ testResults: z.ZodOptional<z.ZodArray<z.ZodObject<{
23
+ name: z.ZodString;
24
+ passed: z.ZodBoolean;
25
+ message: z.ZodOptional<z.ZodString>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ passed: boolean;
28
+ name: string;
29
+ message?: string | undefined;
30
+ }, {
31
+ passed: boolean;
32
+ name: string;
33
+ message?: string | undefined;
34
+ }>, "many">>;
35
+ executionTimeMs: z.ZodOptional<z.ZodNumber>;
9
36
  submittedAt: z.ZodDate;
10
37
  }, "strip", z.ZodTypeAny, {
38
+ code: string;
39
+ status: SubmissionStatus;
11
40
  id: string;
12
41
  problemId: string;
13
42
  userId: string;
14
- answer: string;
15
- isCorrect: boolean;
16
43
  submittedAt: Date;
17
- executionTime?: number | undefined;
44
+ testResults?: {
45
+ passed: boolean;
46
+ name: string;
47
+ message?: string | undefined;
48
+ }[] | undefined;
49
+ executionTimeMs?: number | undefined;
18
50
  }, {
51
+ code: string;
52
+ status: SubmissionStatus;
19
53
  id: string;
20
54
  problemId: string;
21
55
  userId: string;
22
- answer: string;
23
- isCorrect: boolean;
24
56
  submittedAt: Date;
25
- executionTime?: number | undefined;
57
+ testResults?: {
58
+ passed: boolean;
59
+ name: string;
60
+ message?: string | undefined;
61
+ }[] | undefined;
62
+ executionTimeMs?: number | undefined;
26
63
  }>;
27
64
  export type SubmissionResponseDto = z.infer<typeof SubmissionResponseSchema>;
@@ -1,14 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SubmissionResponseSchema = void 0;
3
+ exports.SubmissionResponseSchema = exports.TestResultSchema = void 0;
4
4
  const zod_1 = require("zod");
5
+ const enums_1 = require("../../enums");
6
+ exports.TestResultSchema = zod_1.z.object({
7
+ name: zod_1.z.string(),
8
+ passed: zod_1.z.boolean(),
9
+ message: zod_1.z.string().optional(),
10
+ });
5
11
  exports.SubmissionResponseSchema = zod_1.z.object({
6
12
  id: zod_1.z.string().uuid(),
7
13
  userId: zod_1.z.string().uuid(),
8
14
  problemId: zod_1.z.string().uuid(),
9
- answer: zod_1.z.string(),
10
- isCorrect: zod_1.z.boolean(),
11
- executionTime: zod_1.z.number().optional(),
15
+ code: zod_1.z.string(),
16
+ status: zod_1.z.nativeEnum(enums_1.SubmissionStatus),
17
+ testResults: zod_1.z.array(exports.TestResultSchema).optional(),
18
+ executionTimeMs: zod_1.z.number().optional(),
12
19
  submittedAt: zod_1.z.date(),
13
20
  });
14
21
  //# sourceMappingURL=submission-response.dto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"submission-response.dto.js","sourceRoot":"","sources":["../../../src/dtos/submission/submission-response.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACrB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACzB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC5B,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,SAAS,EAAE,OAAC,CAAC,OAAO,EAAE;IACtB,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,WAAW,EAAE,OAAC,CAAC,IAAI,EAAE;CACtB,CAAC,CAAC"}
1
+ {"version":3,"file":"submission-response.dto.js","sourceRoot":"","sources":["../../../src/dtos/submission/submission-response.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,uCAA+C;AAElC,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,OAAC,CAAC,OAAO,EAAE;IACnB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAEU,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACrB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACzB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC5B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,OAAC,CAAC,UAAU,CAAC,wBAAgB,CAAC;IACtC,WAAW,EAAE,OAAC,CAAC,KAAK,CAAC,wBAAgB,CAAC,CAAC,QAAQ,EAAE;IACjD,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACtC,WAAW,EAAE,OAAC,CAAC,IAAI,EAAE;CACtB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudkata/common",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "Shared contracts, interfaces, DTOs and enums for CloudKata",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",