@cloudkata/common 1.0.17 → 1.0.19

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.
@@ -13,6 +13,16 @@ export declare const ProblemExampleSchema: z.ZodObject<{
13
13
  output: string;
14
14
  explanation?: string | undefined;
15
15
  }>;
16
+ export declare const TestCaseSchema: z.ZodObject<{
17
+ name: z.ZodString;
18
+ script: z.ZodString;
19
+ }, "strip", z.ZodTypeAny, {
20
+ name: string;
21
+ script: string;
22
+ }, {
23
+ name: string;
24
+ script: string;
25
+ }>;
16
26
  export declare const CreateProblemSchema: z.ZodObject<{
17
27
  title: z.ZodString;
18
28
  description: z.ZodString;
@@ -37,6 +47,16 @@ export declare const CreateProblemSchema: z.ZodObject<{
37
47
  companies: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
38
48
  hints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
39
49
  starterCode: z.ZodString;
50
+ testCases: z.ZodArray<z.ZodObject<{
51
+ name: z.ZodString;
52
+ script: z.ZodString;
53
+ }, "strip", z.ZodTypeAny, {
54
+ name: string;
55
+ script: string;
56
+ }, {
57
+ name: string;
58
+ script: string;
59
+ }>, "many">;
40
60
  }, "strip", z.ZodTypeAny, {
41
61
  type: ProblemType;
42
62
  title: string;
@@ -50,6 +70,10 @@ export declare const CreateProblemSchema: z.ZodObject<{
50
70
  tags: string[];
51
71
  companies: string[];
52
72
  starterCode: string;
73
+ testCases: {
74
+ name: string;
75
+ script: string;
76
+ }[];
53
77
  constraints?: string[] | undefined;
54
78
  followUp?: string | undefined;
55
79
  hints?: string[] | undefined;
@@ -64,6 +88,10 @@ export declare const CreateProblemSchema: z.ZodObject<{
64
88
  }[];
65
89
  difficulty: Difficulty;
66
90
  starterCode: string;
91
+ testCases: {
92
+ name: string;
93
+ script: string;
94
+ }[];
67
95
  constraints?: string[] | undefined;
68
96
  followUp?: string | undefined;
69
97
  tags?: string[] | undefined;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreateProblemSchema = exports.ProblemExampleSchema = void 0;
3
+ exports.CreateProblemSchema = exports.TestCaseSchema = exports.ProblemExampleSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const enums_1 = require("../../enums");
6
6
  exports.ProblemExampleSchema = zod_1.z.object({
@@ -8,6 +8,10 @@ exports.ProblemExampleSchema = zod_1.z.object({
8
8
  output: zod_1.z.string(),
9
9
  explanation: zod_1.z.string().optional(),
10
10
  });
11
+ exports.TestCaseSchema = zod_1.z.object({
12
+ name: zod_1.z.string(),
13
+ script: zod_1.z.string(),
14
+ });
11
15
  exports.CreateProblemSchema = zod_1.z.object({
12
16
  title: zod_1.z.string().min(5).max(100),
13
17
  description: zod_1.z.string().min(20),
@@ -20,5 +24,6 @@ exports.CreateProblemSchema = zod_1.z.object({
20
24
  companies: zod_1.z.array(zod_1.z.string()).default([]),
21
25
  hints: zod_1.z.array(zod_1.z.string()).optional(),
22
26
  starterCode: zod_1.z.string().min(1),
27
+ testCases: zod_1.z.array(exports.TestCaseSchema).min(1),
23
28
  });
24
29
  //# sourceMappingURL=create-problem.dto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-problem.dto.js","sourceRoot":"","sources":["../../../src/dtos/problem/create-problem.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,uCAAsD;AAEzC,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GA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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.19",
4
4
  "description": "Shared contracts, interfaces, DTOs and enums for CloudKata",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",