@purpleschool/gptbot 0.9.7 → 0.9.9
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.
- package/api/controllers/http/page.ts +2 -0
- package/api/routes.ts +2 -0
- package/build/api/controllers/http/page.js +2 -0
- package/build/api/routes.js +2 -0
- package/build/commands/page/find-pages-by-criteria.command.js +34 -0
- package/build/commands/page/index.js +1 -0
- package/build/models/tools/video-editor/video-editor-job.schema.js +12 -0
- package/commands/page/find-pages-by-criteria.command.ts +41 -0
- package/commands/page/index.ts +1 -0
- package/models/tools/video-editor/video-editor-job.schema.ts +12 -0
- package/package.json +1 -1
|
@@ -5,5 +5,7 @@ export const PAGE_ROUTES = {
|
|
|
5
5
|
GET_ALL: 'all',
|
|
6
6
|
FIND_BY_ALIAS: (alias: string) => `by/alias/${alias}`,
|
|
7
7
|
GET_ALL_WITH_RELATIONS: 'by/all',
|
|
8
|
+
FIND_BY_CRITERIA: 'criteria',
|
|
9
|
+
FIND_BY_CRITERIA_WITH_RELATIONS: 'criteria/with-relations',
|
|
8
10
|
MODEL_PAGES: 'by/type/model',
|
|
9
11
|
} as const;
|
package/api/routes.ts
CHANGED
|
@@ -52,6 +52,8 @@ export const REST_API = {
|
|
|
52
52
|
GET_BY_ALIAS: (alias: string): string =>
|
|
53
53
|
`${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.FIND_BY_ALIAS(alias)}`,
|
|
54
54
|
GET_BY_ALL_WITH_RELATIONS: `${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.GET_ALL_WITH_RELATIONS}`,
|
|
55
|
+
FIND_BY_CRITERIA: `${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.FIND_BY_CRITERIA}`,
|
|
56
|
+
FIND_BY_CRITERIA_WITH_RELATIONS: `${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.FIND_BY_CRITERIA_WITH_RELATIONS}`,
|
|
55
57
|
MODEL_PAGES: `${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.MODEL_PAGES}`,
|
|
56
58
|
},
|
|
57
59
|
CATEGORY: {
|
package/build/api/routes.js
CHANGED
|
@@ -77,6 +77,8 @@ exports.REST_API = {
|
|
|
77
77
|
GET_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
78
78
|
GET_BY_ALIAS: (alias) => `${exports.ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.FIND_BY_ALIAS(alias)}`,
|
|
79
79
|
GET_BY_ALL_WITH_RELATIONS: `${exports.ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.GET_ALL_WITH_RELATIONS}`,
|
|
80
|
+
FIND_BY_CRITERIA: `${exports.ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.FIND_BY_CRITERIA}`,
|
|
81
|
+
FIND_BY_CRITERIA_WITH_RELATIONS: `${exports.ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.FIND_BY_CRITERIA_WITH_RELATIONS}`,
|
|
80
82
|
MODEL_PAGES: `${exports.ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.MODEL_PAGES}`,
|
|
81
83
|
},
|
|
82
84
|
CATEGORY: {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindPagesByCriteriaCommand = void 0;
|
|
4
|
+
const models_1 = require("../../models");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
var FindPagesByCriteriaCommand;
|
|
8
|
+
(function (FindPagesByCriteriaCommand) {
|
|
9
|
+
FindPagesByCriteriaCommand.RequestSchema = zod_1.z.object({
|
|
10
|
+
title: zod_1.z.string().optional(),
|
|
11
|
+
type: zod_1.z.nativeEnum(constants_1.PageType).optional(),
|
|
12
|
+
toolId: zod_1.z.string().uuid().optional(),
|
|
13
|
+
toolModelId: zod_1.z.string().uuid().optional(),
|
|
14
|
+
toolTitle: zod_1.z.string().optional(),
|
|
15
|
+
limit: zod_1.z.coerce.number().min(1),
|
|
16
|
+
offset: zod_1.z.coerce.number().min(0).default(0),
|
|
17
|
+
});
|
|
18
|
+
FindPagesByCriteriaCommand.ResponseSchema = zod_1.z.object({
|
|
19
|
+
data: zod_1.z.array(models_1.PageSchema),
|
|
20
|
+
page: zod_1.z.number(),
|
|
21
|
+
totalPages: zod_1.z.number(),
|
|
22
|
+
});
|
|
23
|
+
FindPagesByCriteriaCommand.PageWithRelationsSchema = models_1.PageSchema.extend({
|
|
24
|
+
category: zod_1.z.union([models_1.CategorySchema, zod_1.z.null()]),
|
|
25
|
+
aIModel: zod_1.z.union([models_1.AiModelSchema, zod_1.z.null()]),
|
|
26
|
+
tool: models_1.ToolSchema.nullable(),
|
|
27
|
+
questions: zod_1.z.array(models_1.QuestionSchema),
|
|
28
|
+
});
|
|
29
|
+
FindPagesByCriteriaCommand.ResponseWithRelationsSchema = zod_1.z.object({
|
|
30
|
+
data: zod_1.z.array(FindPagesByCriteriaCommand.PageWithRelationsSchema),
|
|
31
|
+
page: zod_1.z.number(),
|
|
32
|
+
totalPages: zod_1.z.number(),
|
|
33
|
+
});
|
|
34
|
+
})(FindPagesByCriteriaCommand || (exports.FindPagesByCriteriaCommand = FindPagesByCriteriaCommand = {}));
|
|
@@ -17,5 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./create-page.command"), exports);
|
|
18
18
|
__exportStar(require("./delete-page.command"), exports);
|
|
19
19
|
__exportStar(require("./find-page-by-alias.command"), exports);
|
|
20
|
+
__exportStar(require("./find-pages-by-criteria.command"), exports);
|
|
20
21
|
__exportStar(require("./find-page.command"), exports);
|
|
21
22
|
__exportStar(require("./update-page.command"), exports);
|
|
@@ -11,6 +11,18 @@ exports.VideoEditorJobSchema = tool_job_schema_1.ToolJobSchema.extend({
|
|
|
11
11
|
inputVideoId: zod_1.z.string().nullable(),
|
|
12
12
|
inputVideoUrl: zod_1.z.string(),
|
|
13
13
|
outputVideoUrl: zod_1.z.string().nullable(),
|
|
14
|
+
video: zod_1.z
|
|
15
|
+
.object({
|
|
16
|
+
uuid: zod_1.z.string(),
|
|
17
|
+
url: zod_1.z.string(),
|
|
18
|
+
})
|
|
19
|
+
.nullable(),
|
|
20
|
+
preview: zod_1.z
|
|
21
|
+
.object({
|
|
22
|
+
uuid: zod_1.z.string(),
|
|
23
|
+
url: zod_1.z.string(),
|
|
24
|
+
})
|
|
25
|
+
.nullable(),
|
|
14
26
|
modelId: zod_1.z.string(),
|
|
15
27
|
isPublished: zod_1.z.boolean(),
|
|
16
28
|
postId: zod_1.z.string().nullable(),
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AiModelSchema, CategorySchema, PageSchema, QuestionSchema, ToolSchema } from '../../models';
|
|
2
|
+
import { PageType } from '../../constants';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
export namespace FindPagesByCriteriaCommand {
|
|
6
|
+
export const RequestSchema = z.object({
|
|
7
|
+
title: z.string().optional(),
|
|
8
|
+
type: z.nativeEnum(PageType).optional(),
|
|
9
|
+
toolId: z.string().uuid().optional(),
|
|
10
|
+
toolModelId: z.string().uuid().optional(),
|
|
11
|
+
toolTitle: z.string().optional(),
|
|
12
|
+
limit: z.coerce.number().min(1),
|
|
13
|
+
offset: z.coerce.number().min(0).default(0),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
17
|
+
|
|
18
|
+
export const ResponseSchema = z.object({
|
|
19
|
+
data: z.array(PageSchema),
|
|
20
|
+
page: z.number(),
|
|
21
|
+
totalPages: z.number(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
25
|
+
|
|
26
|
+
export const PageWithRelationsSchema = PageSchema.extend({
|
|
27
|
+
category: z.union([CategorySchema, z.null()]),
|
|
28
|
+
aIModel: z.union([AiModelSchema, z.null()]),
|
|
29
|
+
tool: ToolSchema.nullable(),
|
|
30
|
+
questions: z.array(QuestionSchema),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const ResponseWithRelationsSchema = z.object({
|
|
34
|
+
data: z.array(PageWithRelationsSchema),
|
|
35
|
+
page: z.number(),
|
|
36
|
+
totalPages: z.number(),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export type ResponseWithRelations = z.infer<typeof ResponseWithRelationsSchema>;
|
|
40
|
+
}
|
|
41
|
+
|
package/commands/page/index.ts
CHANGED
|
@@ -9,6 +9,18 @@ export const VideoEditorJobSchema = ToolJobSchema.extend({
|
|
|
9
9
|
inputVideoId: z.string().nullable(),
|
|
10
10
|
inputVideoUrl: z.string(),
|
|
11
11
|
outputVideoUrl: z.string().nullable(),
|
|
12
|
+
video: z
|
|
13
|
+
.object({
|
|
14
|
+
uuid: z.string(),
|
|
15
|
+
url: z.string(),
|
|
16
|
+
})
|
|
17
|
+
.nullable(),
|
|
18
|
+
preview: z
|
|
19
|
+
.object({
|
|
20
|
+
uuid: z.string(),
|
|
21
|
+
url: z.string(),
|
|
22
|
+
})
|
|
23
|
+
.nullable(),
|
|
12
24
|
modelId: z.string(),
|
|
13
25
|
isPublished: z.boolean(),
|
|
14
26
|
postId: z.string().nullable(),
|