@purpleschool/gptbot 0.5.25 → 0.5.26

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.
@@ -15,6 +15,7 @@ export * from './payment';
15
15
  export * from './product';
16
16
  export * from './question';
17
17
  export * from './subscription';
18
+ export * from './task';
18
19
  export * from './unregistered-user';
19
20
  export * from './user-to-task';
20
21
  export * from './user';
@@ -0,0 +1,5 @@
1
+ export const TASK_CONTROLLER = 'task' as const;
2
+
3
+ export const TASK_ROUTES = {
4
+ ACTIVE: 'active',
5
+ } as const;
@@ -31,6 +31,7 @@ __exportStar(require("./payment"), exports);
31
31
  __exportStar(require("./product"), exports);
32
32
  __exportStar(require("./question"), exports);
33
33
  __exportStar(require("./subscription"), exports);
34
+ __exportStar(require("./task"), exports);
34
35
  __exportStar(require("./unregistered-user"), exports);
35
36
  __exportStar(require("./user-to-task"), exports);
36
37
  __exportStar(require("./user"), exports);
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TASK_ROUTES = exports.TASK_CONTROLLER = void 0;
4
+ exports.TASK_CONTROLLER = 'task';
5
+ exports.TASK_ROUTES = {
6
+ ACTIVE: 'active',
7
+ };
@@ -28,6 +28,7 @@ __exportStar(require("./product"), exports);
28
28
  __exportStar(require("./question"), exports);
29
29
  __exportStar(require("./referral"), exports);
30
30
  __exportStar(require("./subscription"), exports);
31
+ __exportStar(require("./task"), exports);
31
32
  __exportStar(require("./unregistered-user"), exports);
32
33
  __exportStar(require("./user"), exports);
33
34
  __exportStar(require("./user-to-subscription"), exports);
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindAllActiveTasksCommand = void 0;
4
+ const models_1 = require("../../models");
5
+ const zod_1 = require("zod");
6
+ var FindAllActiveTasksCommand;
7
+ (function (FindAllActiveTasksCommand) {
8
+ FindAllActiveTasksCommand.ResponseSchema = zod_1.z.object({
9
+ data: zod_1.z.array(models_1.TaskSchema),
10
+ });
11
+ })(FindAllActiveTasksCommand || (exports.FindAllActiveTasksCommand = FindAllActiveTasksCommand = {}));
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./find-all-active-tasks.command"), exports);
@@ -34,6 +34,7 @@ __exportStar(require("./referral-bonus.schema"), exports);
34
34
  __exportStar(require("./section.schema"), exports);
35
35
  __exportStar(require("./subscription-upgrade-schema"), exports);
36
36
  __exportStar(require("./subscription.schema"), exports);
37
+ __exportStar(require("./task.schema"), exports);
37
38
  __exportStar(require("./unregistered-user.schema"), exports);
38
39
  __exportStar(require("./user-task.schema"), exports);
39
40
  __exportStar(require("./user-to-subscription.schema"), exports);
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TaskSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../constants");
6
+ exports.TaskSchema = zod_1.z.object({
7
+ uuid: zod_1.z.string().uuid(),
8
+ title: zod_1.z.string(),
9
+ icon: zod_1.z.string(),
10
+ reward: zod_1.z.number(),
11
+ type: zod_1.z.nativeEnum(constants_1.TASK_TYPE),
12
+ status: zod_1.z.nativeEnum(constants_1.TASK_STATUS),
13
+ description: zod_1.z.string(),
14
+ startAt: zod_1.z.date(),
15
+ endAt: zod_1.z.date().nullable().optional(),
16
+ });
package/commands/index.ts CHANGED
@@ -12,6 +12,7 @@ export * from './product';
12
12
  export * from './question';
13
13
  export * from './referral';
14
14
  export * from './subscription';
15
+ export * from './task';
15
16
  export * from './unregistered-user';
16
17
  export * from './user';
17
18
  export * from './user-to-subscription';
@@ -0,0 +1,10 @@
1
+ import { TaskSchema } from '../../models';
2
+ import { z } from 'zod';
3
+
4
+ export namespace FindAllActiveTasksCommand {
5
+ export const ResponseSchema = z.object({
6
+ data: z.array(TaskSchema),
7
+ });
8
+
9
+ export type Response = z.infer<typeof ResponseSchema>;
10
+ }
@@ -0,0 +1 @@
1
+ export * from './find-all-active-tasks.command';
package/models/index.ts CHANGED
@@ -18,6 +18,7 @@ export * from './referral-bonus.schema';
18
18
  export * from './section.schema';
19
19
  export * from './subscription-upgrade-schema';
20
20
  export * from './subscription.schema';
21
+ export * from './task.schema';
21
22
  export * from './unregistered-user.schema';
22
23
  export * from './user-task.schema';
23
24
  export * from './user-to-subscription.schema';
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { TASK_STATUS, TASK_TYPE } from '../constants';
3
+
4
+ export const TaskSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ title: z.string(),
7
+ icon: z.string(),
8
+ reward: z.number(),
9
+ type: z.nativeEnum(TASK_TYPE),
10
+ status: z.nativeEnum(TASK_STATUS),
11
+ description: z.string(),
12
+ startAt: z.date(),
13
+ endAt: z.date().nullable().optional(),
14
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.5.25",
3
+ "version": "0.5.26",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {