@purpleschool/gptbot 0.0.4 → 0.0.5
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/category.ts +1 -1
- package/api/controllers/page.ts +1 -0
- package/build/api/controllers/category.js +1 -1
- package/build/api/controllers/page.js +1 -0
- package/build/commands/page/find-page-by-alias.command.js +20 -0
- package/build/commands/page/index.js +1 -0
- package/commands/page/find-page-by-alias.command.ts +25 -0
- package/commands/page/index.ts +1 -0
- package/package.json +1 -1
package/api/controllers/page.ts
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindPageByAliasCommand = void 0;
|
|
4
|
+
const models_1 = require("../../models");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
var FindPageByAliasCommand;
|
|
7
|
+
(function (FindPageByAliasCommand) {
|
|
8
|
+
FindPageByAliasCommand.RequestSchema = models_1.PageSchema.pick({
|
|
9
|
+
alias: true,
|
|
10
|
+
});
|
|
11
|
+
FindPageByAliasCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: zod_1.z.array(models_1.PageSchema),
|
|
13
|
+
});
|
|
14
|
+
FindPageByAliasCommand.ResponseByAliasSchema = zod_1.z.object({
|
|
15
|
+
data: models_1.PageSchema.extend({
|
|
16
|
+
category: models_1.CategorySchema,
|
|
17
|
+
questions: zod_1.z.array(models_1.QuestionSchema),
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
})(FindPageByAliasCommand || (exports.FindPageByAliasCommand = FindPageByAliasCommand = {}));
|
|
@@ -18,3 +18,4 @@ __exportStar(require("./update-page.command"), exports);
|
|
|
18
18
|
__exportStar(require("./delete-page.command"), exports);
|
|
19
19
|
__exportStar(require("./create-page.command"), exports);
|
|
20
20
|
__exportStar(require("./find-page.command"), exports);
|
|
21
|
+
__exportStar(require("./find-page-by-alias.command"), exports);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CategorySchema, PageSchema, QuestionSchema } from '../../models';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
export namespace FindPageByAliasCommand {
|
|
5
|
+
export const RequestSchema = PageSchema.pick({
|
|
6
|
+
alias: true,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
data: z.array(PageSchema),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
|
|
17
|
+
export const ResponseByAliasSchema = z.object({
|
|
18
|
+
data: PageSchema.extend({
|
|
19
|
+
category: CategorySchema,
|
|
20
|
+
questions: z.array(QuestionSchema),
|
|
21
|
+
}),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type ResponseByUUID = z.infer<typeof ResponseByAliasSchema>;
|
|
25
|
+
}
|
package/commands/page/index.ts
CHANGED