@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.
@@ -3,5 +3,5 @@ export const CATEGORY_CONTROLLER = 'category' as const;
3
3
  export const CATEGORY_ROUTES = {
4
4
  FIND_BY_UUID: 'by/uuid',
5
5
  GET_ALL: 'all',
6
- GET_FORMATTED: 'by/formatted',
6
+ GET_FORMATTED: 'formatted',
7
7
  } as const;
@@ -3,4 +3,5 @@ export const PAGE_CONTROLLER = 'page' as const;
3
3
  export const PAGE_ROUTES = {
4
4
  FIND_BY_UUID: 'by/uuid',
5
5
  GET_ALL: 'all',
6
+ FIND_BY_ALIAS: 'by/alias',
6
7
  } as const;
@@ -5,5 +5,5 @@ exports.CATEGORY_CONTROLLER = 'category';
5
5
  exports.CATEGORY_ROUTES = {
6
6
  FIND_BY_UUID: 'by/uuid',
7
7
  GET_ALL: 'all',
8
- GET_FORMATTED: 'by/formatted',
8
+ GET_FORMATTED: 'formatted',
9
9
  };
@@ -5,4 +5,5 @@ exports.PAGE_CONTROLLER = 'page';
5
5
  exports.PAGE_ROUTES = {
6
6
  FIND_BY_UUID: 'by/uuid',
7
7
  GET_ALL: 'all',
8
+ FIND_BY_ALIAS: 'by/alias',
8
9
  };
@@ -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
+ }
@@ -2,3 +2,4 @@ export * from './update-page.command';
2
2
  export * from './delete-page.command';
3
3
  export * from './create-page.command';
4
4
  export * from './find-page.command';
5
+ export * from './find-page-by-alias.command';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {