@purpleschool/gptbot 0.14.1-stage-2 → 0.14.2-stage-2
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/index.ts +1 -0
- package/api/controllers/http/model-page.ts +39 -0
- package/api/routes.ts +51 -0
- package/build/api/controllers/http/index.js +1 -0
- package/build/api/controllers/http/model-page.js +34 -0
- package/build/api/routes.js +32 -0
- package/build/commands/index.js +1 -0
- package/build/commands/model-page/base/create-model-page.command.js +13 -0
- package/build/commands/model-page/base/delete-model-page.command.js +9 -0
- package/build/commands/model-page/base/find-model-page-admin.command.js +13 -0
- package/build/commands/model-page/base/find-model-pages-admin.command.js +22 -0
- package/build/commands/model-page/base/index.js +21 -0
- package/build/commands/model-page/base/update-model-page.command.js +63 -0
- package/build/commands/model-page/common.schemas.js +62 -0
- package/build/commands/model-page/index.js +21 -0
- package/build/commands/model-page/public/find-model-page-answer-detail.command.js +14 -0
- package/build/commands/model-page/public/find-model-page-detail.command.js +12 -0
- package/build/commands/model-page/public/find-model-page-hub.command.js +19 -0
- package/build/commands/model-page/public/find-model-page-question-type.command.js +13 -0
- package/build/commands/model-page/public/index.js +20 -0
- package/build/commands/model-page/question/create-model-page-question.command.js +16 -0
- package/build/commands/model-page/question/delete-model-page-question.command.js +9 -0
- package/build/commands/model-page/question/find-model-page-question-admin.command.js +13 -0
- package/build/commands/model-page/question/find-model-page-questions-admin.command.js +21 -0
- package/build/commands/model-page/question/index.js +21 -0
- package/build/commands/model-page/question/update-model-page-question.command.js +18 -0
- package/build/commands/model-page/question-translation/create-model-page-question-translation.command.js +17 -0
- package/build/commands/model-page/question-translation/delete-model-page-question-translation.command.js +9 -0
- package/build/commands/model-page/question-translation/find-model-page-question-translation.command.js +13 -0
- package/build/commands/model-page/question-translation/find-model-page-question-translations.command.js +13 -0
- package/build/commands/model-page/question-translation/index.js +21 -0
- package/build/commands/model-page/question-translation/update-model-page-question-translation.command.js +16 -0
- package/build/commands/model-page/translation/create-model-page-translation.command.js +18 -0
- package/build/commands/model-page/translation/delete-model-page-translation.command.js +9 -0
- package/build/commands/model-page/translation/find-model-page-translation.command.js +13 -0
- package/build/commands/model-page/translation/find-model-page-translations.command.js +13 -0
- package/build/commands/model-page/translation/index.js +21 -0
- package/build/commands/model-page/translation/update-model-page-translation.command.js +17 -0
- package/build/commands/question/create-question.command.js +15 -4
- package/build/commands/question/update-question.command.js +12 -7
- package/build/constants/index.js +1 -0
- package/build/constants/model-page/enums/index.js +19 -0
- package/build/constants/model-page/enums/model-page-question-type.enum.js +13 -0
- package/build/constants/model-page/enums/model-page-sort-by.enum.js +8 -0
- package/build/constants/model-page/enums/model-page-type.enum.js +12 -0
- package/build/constants/model-page/index.js +17 -0
- package/build/models/index.js +1 -0
- package/build/models/model-page/index.js +22 -0
- package/build/models/model-page/model-page-public.schema.js +63 -0
- package/build/models/model-page/model-page-question-translation.schema.js +13 -0
- package/build/models/model-page/model-page-question.schema.js +13 -0
- package/build/models/model-page/model-page-technical-model.schema.js +80 -0
- package/build/models/model-page/model-page-translation.schema.js +14 -0
- package/build/models/model-page/model-page.schema.js +15 -0
- package/build/models/question.schema.js +2 -1
- package/commands/index.ts +1 -0
- package/commands/model-page/base/create-model-page.command.ts +15 -0
- package/commands/model-page/base/delete-model-page.command.ts +10 -0
- package/commands/model-page/base/find-model-page-admin.command.ts +14 -0
- package/commands/model-page/base/find-model-pages-admin.command.ts +24 -0
- package/commands/model-page/base/index.ts +5 -0
- package/commands/model-page/base/update-model-page.command.ts +69 -0
- package/commands/model-page/common.schemas.ts +64 -0
- package/commands/model-page/index.ts +5 -0
- package/commands/model-page/public/find-model-page-answer-detail.command.ts +15 -0
- package/commands/model-page/public/find-model-page-detail.command.ts +13 -0
- package/commands/model-page/public/find-model-page-hub.command.ts +20 -0
- package/commands/model-page/public/find-model-page-question-type.command.ts +14 -0
- package/commands/model-page/public/index.ts +4 -0
- package/commands/model-page/question/create-model-page-question.command.ts +18 -0
- package/commands/model-page/question/delete-model-page-question.command.ts +10 -0
- package/commands/model-page/question/find-model-page-question-admin.command.ts +14 -0
- package/commands/model-page/question/find-model-page-questions-admin.command.ts +23 -0
- package/commands/model-page/question/index.ts +5 -0
- package/commands/model-page/question/update-model-page-question.command.ts +22 -0
- package/commands/model-page/question-translation/create-model-page-question-translation.command.ts +21 -0
- package/commands/model-page/question-translation/delete-model-page-question-translation.command.ts +10 -0
- package/commands/model-page/question-translation/find-model-page-question-translation.command.ts +14 -0
- package/commands/model-page/question-translation/find-model-page-question-translations.command.ts +14 -0
- package/commands/model-page/question-translation/index.ts +5 -0
- package/commands/model-page/question-translation/update-model-page-question-translation.command.ts +20 -0
- package/commands/model-page/translation/create-model-page-translation.command.ts +22 -0
- package/commands/model-page/translation/delete-model-page-translation.command.ts +10 -0
- package/commands/model-page/translation/find-model-page-translation.command.ts +14 -0
- package/commands/model-page/translation/find-model-page-translations.command.ts +14 -0
- package/commands/model-page/translation/index.ts +5 -0
- package/commands/model-page/translation/update-model-page-translation.command.ts +21 -0
- package/commands/question/create-question.command.ts +17 -3
- package/commands/question/update-question.command.ts +14 -7
- package/constants/index.ts +1 -0
- package/constants/model-page/enums/index.ts +3 -0
- package/constants/model-page/enums/model-page-question-type.enum.ts +9 -0
- package/constants/model-page/enums/model-page-sort-by.enum.ts +4 -0
- package/constants/model-page/enums/model-page-type.enum.ts +8 -0
- package/constants/model-page/index.ts +1 -0
- package/models/index.ts +1 -0
- package/models/model-page/index.ts +6 -0
- package/models/model-page/model-page-public.schema.ts +94 -0
- package/models/model-page/model-page-question-translation.schema.ts +13 -0
- package/models/model-page/model-page-question.schema.ts +13 -0
- package/models/model-page/model-page-technical-model.schema.ts +109 -0
- package/models/model-page/model-page-translation.schema.ts +14 -0
- package/models/model-page/model-page.schema.ts +15 -0
- package/models/question.schema.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export const MODEL_PAGE_CONTROLLER = 'model-pages' as const;
|
|
2
|
+
export const MODEL_PAGE_ADMIN_CONTROLLER = 'model-pages/admin' as const;
|
|
3
|
+
export const MODEL_PAGE_QUESTION_CONTROLLER = 'model-page-questions' as const;
|
|
4
|
+
export const MODEL_PAGE_QUESTION_ADMIN_CONTROLLER = 'model-page-questions/admin' as const;
|
|
5
|
+
|
|
6
|
+
export const MODEL_PAGE_ROUTES = {
|
|
7
|
+
FIND_ALL: '',
|
|
8
|
+
CREATE: '',
|
|
9
|
+
FIND_BY_SLUG: (slug: string) => `${slug}`,
|
|
10
|
+
FIND_BY_UUID: (uuid: string) => `${uuid}`,
|
|
11
|
+
PATCH: (uuid: string) => `${uuid}`,
|
|
12
|
+
DELETE: (uuid: string) => `${uuid}`,
|
|
13
|
+
CREATE_TRANSLATION: (uuid: string) => `${uuid}/translations`,
|
|
14
|
+
FIND_TRANSLATIONS: (uuid: string) => `${uuid}/translations`,
|
|
15
|
+
FIND_TRANSLATION: (uuid: string, translationUuid: string) =>
|
|
16
|
+
`${uuid}/translations/${translationUuid}`,
|
|
17
|
+
PATCH_TRANSLATION: (uuid: string, translationUuid: string) =>
|
|
18
|
+
`${uuid}/translations/${translationUuid}`,
|
|
19
|
+
DELETE_TRANSLATION: (uuid: string, translationUuid: string) =>
|
|
20
|
+
`${uuid}/translations/${translationUuid}`,
|
|
21
|
+
} as const;
|
|
22
|
+
|
|
23
|
+
export const MODEL_PAGE_QUESTION_ROUTES = {
|
|
24
|
+
FIND_BY_TYPE: (questionType: string) => `${questionType}`,
|
|
25
|
+
FIND_BY_TYPE_AND_SLUG: (questionType: string, slug: string) => `${questionType}/${slug}`,
|
|
26
|
+
FIND_ALL: '',
|
|
27
|
+
CREATE: '',
|
|
28
|
+
FIND_BY_UUID: (uuid: string) => `${uuid}`,
|
|
29
|
+
PATCH: (uuid: string) => `${uuid}`,
|
|
30
|
+
DELETE: (uuid: string) => `${uuid}`,
|
|
31
|
+
CREATE_TRANSLATION: (uuid: string) => `${uuid}/translations`,
|
|
32
|
+
FIND_TRANSLATIONS: (uuid: string) => `${uuid}/translations`,
|
|
33
|
+
FIND_TRANSLATION: (uuid: string, translationUuid: string) =>
|
|
34
|
+
`${uuid}/translations/${translationUuid}`,
|
|
35
|
+
PATCH_TRANSLATION: (uuid: string, translationUuid: string) =>
|
|
36
|
+
`${uuid}/translations/${translationUuid}`,
|
|
37
|
+
DELETE_TRANSLATION: (uuid: string, translationUuid: string) =>
|
|
38
|
+
`${uuid}/translations/${translationUuid}`,
|
|
39
|
+
} as const;
|
package/api/routes.ts
CHANGED
|
@@ -66,6 +66,57 @@ export const REST_API = {
|
|
|
66
66
|
FIND_BY_CRITERIA_WITH_RELATIONS: `${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.FIND_BY_CRITERIA_WITH_RELATIONS}`,
|
|
67
67
|
MODEL_PAGES: `${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.MODEL_PAGES}`,
|
|
68
68
|
},
|
|
69
|
+
MODEL_PAGE_PUBLIC: {
|
|
70
|
+
HUB: `${ROOT}/${CONTROLLERS.MODEL_PAGE_CONTROLLER}`,
|
|
71
|
+
GET_BY_SLUG: (slug: string) =>
|
|
72
|
+
`${ROOT}/${CONTROLLERS.MODEL_PAGE_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_ROUTES.FIND_BY_SLUG(slug)}`,
|
|
73
|
+
},
|
|
74
|
+
MODEL_PAGE_ADMIN: {
|
|
75
|
+
CREATE: `${ROOT}/${CONTROLLERS.MODEL_PAGE_ADMIN_CONTROLLER}`,
|
|
76
|
+
GET_ALL: `${ROOT}/${CONTROLLERS.MODEL_PAGE_ADMIN_CONTROLLER}`,
|
|
77
|
+
GET_BY_UUID: (uuid: string) =>
|
|
78
|
+
`${ROOT}/${CONTROLLERS.MODEL_PAGE_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
79
|
+
PATCH: (uuid: string) =>
|
|
80
|
+
`${ROOT}/${CONTROLLERS.MODEL_PAGE_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_ROUTES.PATCH(uuid)}`,
|
|
81
|
+
DELETE: (uuid: string) =>
|
|
82
|
+
`${ROOT}/${CONTROLLERS.MODEL_PAGE_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_ROUTES.DELETE(uuid)}`,
|
|
83
|
+
CREATE_TRANSLATION: (uuid: string) =>
|
|
84
|
+
`${ROOT}/${CONTROLLERS.MODEL_PAGE_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_ROUTES.CREATE_TRANSLATION(uuid)}`,
|
|
85
|
+
GET_ALL_TRANSLATIONS: (uuid: string) =>
|
|
86
|
+
`${ROOT}/${CONTROLLERS.MODEL_PAGE_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_ROUTES.FIND_TRANSLATIONS(uuid)}`,
|
|
87
|
+
GET_TRANSLATION: (uuid: string, translationUuid: string) =>
|
|
88
|
+
`${ROOT}/${CONTROLLERS.MODEL_PAGE_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_ROUTES.FIND_TRANSLATION(uuid, translationUuid)}`,
|
|
89
|
+
UPDATE_TRANSLATION: (uuid: string, translationUuid: string) =>
|
|
90
|
+
`${ROOT}/${CONTROLLERS.MODEL_PAGE_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_ROUTES.PATCH_TRANSLATION(uuid, translationUuid)}`,
|
|
91
|
+
DELETE_TRANSLATION: (uuid: string, translationUuid: string) =>
|
|
92
|
+
`${ROOT}/${CONTROLLERS.MODEL_PAGE_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_ROUTES.DELETE_TRANSLATION(uuid, translationUuid)}`,
|
|
93
|
+
},
|
|
94
|
+
MODEL_PAGE_QUESTION_PUBLIC: {
|
|
95
|
+
GET_BY_TYPE: (questionType: string) =>
|
|
96
|
+
`${ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_QUESTION_ROUTES.FIND_BY_TYPE(questionType)}`,
|
|
97
|
+
GET_BY_TYPE_AND_SLUG: (questionType: string, slug: string) =>
|
|
98
|
+
`${ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_QUESTION_ROUTES.FIND_BY_TYPE_AND_SLUG(questionType, slug)}`,
|
|
99
|
+
},
|
|
100
|
+
MODEL_PAGE_QUESTION_ADMIN: {
|
|
101
|
+
CREATE: `${ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER}`,
|
|
102
|
+
GET_ALL: `${ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER}`,
|
|
103
|
+
GET_BY_UUID: (uuid: string) =>
|
|
104
|
+
`${ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_QUESTION_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
105
|
+
PATCH: (uuid: string) =>
|
|
106
|
+
`${ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_QUESTION_ROUTES.PATCH(uuid)}`,
|
|
107
|
+
DELETE: (uuid: string) =>
|
|
108
|
+
`${ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_QUESTION_ROUTES.DELETE(uuid)}`,
|
|
109
|
+
CREATE_TRANSLATION: (uuid: string) =>
|
|
110
|
+
`${ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_QUESTION_ROUTES.CREATE_TRANSLATION(uuid)}`,
|
|
111
|
+
GET_ALL_TRANSLATIONS: (uuid: string) =>
|
|
112
|
+
`${ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_QUESTION_ROUTES.FIND_TRANSLATIONS(uuid)}`,
|
|
113
|
+
GET_TRANSLATION: (uuid: string, translationUuid: string) =>
|
|
114
|
+
`${ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_QUESTION_ROUTES.FIND_TRANSLATION(uuid, translationUuid)}`,
|
|
115
|
+
UPDATE_TRANSLATION: (uuid: string, translationUuid: string) =>
|
|
116
|
+
`${ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_QUESTION_ROUTES.PATCH_TRANSLATION(uuid, translationUuid)}`,
|
|
117
|
+
DELETE_TRANSLATION: (uuid: string, translationUuid: string) =>
|
|
118
|
+
`${ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_QUESTION_ROUTES.DELETE_TRANSLATION(uuid, translationUuid)}`,
|
|
119
|
+
},
|
|
69
120
|
CATEGORY: {
|
|
70
121
|
GET: `${ROOT}/${CONTROLLERS.CATEGORY_CONTROLLER}/${CONTROLLERS.CATEGORY_ROUTES.GET_ALL}`,
|
|
71
122
|
PATCH: (uuid: string) => `${ROOT}/${CONTROLLERS.CATEGORY_CONTROLLER}/${uuid}`,
|
|
@@ -37,6 +37,7 @@ __exportStar(require("./form-submission"), exports);
|
|
|
37
37
|
__exportStar(require("./key-value"), exports);
|
|
38
38
|
__exportStar(require("./referral"), exports);
|
|
39
39
|
__exportStar(require("./message"), exports);
|
|
40
|
+
__exportStar(require("./model-page"), exports);
|
|
40
41
|
__exportStar(require("./page"), exports);
|
|
41
42
|
__exportStar(require("./payment"), exports);
|
|
42
43
|
__exportStar(require("./presentation"), exports);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MODEL_PAGE_QUESTION_ROUTES = exports.MODEL_PAGE_ROUTES = exports.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER = exports.MODEL_PAGE_QUESTION_CONTROLLER = exports.MODEL_PAGE_ADMIN_CONTROLLER = exports.MODEL_PAGE_CONTROLLER = void 0;
|
|
4
|
+
exports.MODEL_PAGE_CONTROLLER = 'model-pages';
|
|
5
|
+
exports.MODEL_PAGE_ADMIN_CONTROLLER = 'model-pages/admin';
|
|
6
|
+
exports.MODEL_PAGE_QUESTION_CONTROLLER = 'model-page-questions';
|
|
7
|
+
exports.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER = 'model-page-questions/admin';
|
|
8
|
+
exports.MODEL_PAGE_ROUTES = {
|
|
9
|
+
FIND_ALL: '',
|
|
10
|
+
CREATE: '',
|
|
11
|
+
FIND_BY_SLUG: (slug) => `${slug}`,
|
|
12
|
+
FIND_BY_UUID: (uuid) => `${uuid}`,
|
|
13
|
+
PATCH: (uuid) => `${uuid}`,
|
|
14
|
+
DELETE: (uuid) => `${uuid}`,
|
|
15
|
+
CREATE_TRANSLATION: (uuid) => `${uuid}/translations`,
|
|
16
|
+
FIND_TRANSLATIONS: (uuid) => `${uuid}/translations`,
|
|
17
|
+
FIND_TRANSLATION: (uuid, translationUuid) => `${uuid}/translations/${translationUuid}`,
|
|
18
|
+
PATCH_TRANSLATION: (uuid, translationUuid) => `${uuid}/translations/${translationUuid}`,
|
|
19
|
+
DELETE_TRANSLATION: (uuid, translationUuid) => `${uuid}/translations/${translationUuid}`,
|
|
20
|
+
};
|
|
21
|
+
exports.MODEL_PAGE_QUESTION_ROUTES = {
|
|
22
|
+
FIND_BY_TYPE: (questionType) => `${questionType}`,
|
|
23
|
+
FIND_BY_TYPE_AND_SLUG: (questionType, slug) => `${questionType}/${slug}`,
|
|
24
|
+
FIND_ALL: '',
|
|
25
|
+
CREATE: '',
|
|
26
|
+
FIND_BY_UUID: (uuid) => `${uuid}`,
|
|
27
|
+
PATCH: (uuid) => `${uuid}`,
|
|
28
|
+
DELETE: (uuid) => `${uuid}`,
|
|
29
|
+
CREATE_TRANSLATION: (uuid) => `${uuid}/translations`,
|
|
30
|
+
FIND_TRANSLATIONS: (uuid) => `${uuid}/translations`,
|
|
31
|
+
FIND_TRANSLATION: (uuid, translationUuid) => `${uuid}/translations/${translationUuid}`,
|
|
32
|
+
PATCH_TRANSLATION: (uuid, translationUuid) => `${uuid}/translations/${translationUuid}`,
|
|
33
|
+
DELETE_TRANSLATION: (uuid, translationUuid) => `${uuid}/translations/${translationUuid}`,
|
|
34
|
+
};
|
package/build/api/routes.js
CHANGED
|
@@ -88,6 +88,38 @@ exports.REST_API = {
|
|
|
88
88
|
FIND_BY_CRITERIA_WITH_RELATIONS: `${exports.ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.FIND_BY_CRITERIA_WITH_RELATIONS}`,
|
|
89
89
|
MODEL_PAGES: `${exports.ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.MODEL_PAGES}`,
|
|
90
90
|
},
|
|
91
|
+
MODEL_PAGE_PUBLIC: {
|
|
92
|
+
HUB: `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_CONTROLLER}`,
|
|
93
|
+
GET_BY_SLUG: (slug) => `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_ROUTES.FIND_BY_SLUG(slug)}`,
|
|
94
|
+
},
|
|
95
|
+
MODEL_PAGE_ADMIN: {
|
|
96
|
+
CREATE: `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_ADMIN_CONTROLLER}`,
|
|
97
|
+
GET_ALL: `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_ADMIN_CONTROLLER}`,
|
|
98
|
+
GET_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
99
|
+
PATCH: (uuid) => `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_ROUTES.PATCH(uuid)}`,
|
|
100
|
+
DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_ROUTES.DELETE(uuid)}`,
|
|
101
|
+
CREATE_TRANSLATION: (uuid) => `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_ROUTES.CREATE_TRANSLATION(uuid)}`,
|
|
102
|
+
GET_ALL_TRANSLATIONS: (uuid) => `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_ROUTES.FIND_TRANSLATIONS(uuid)}`,
|
|
103
|
+
GET_TRANSLATION: (uuid, translationUuid) => `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_ROUTES.FIND_TRANSLATION(uuid, translationUuid)}`,
|
|
104
|
+
UPDATE_TRANSLATION: (uuid, translationUuid) => `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_ROUTES.PATCH_TRANSLATION(uuid, translationUuid)}`,
|
|
105
|
+
DELETE_TRANSLATION: (uuid, translationUuid) => `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_ROUTES.DELETE_TRANSLATION(uuid, translationUuid)}`,
|
|
106
|
+
},
|
|
107
|
+
MODEL_PAGE_QUESTION_PUBLIC: {
|
|
108
|
+
GET_BY_TYPE: (questionType) => `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_QUESTION_ROUTES.FIND_BY_TYPE(questionType)}`,
|
|
109
|
+
GET_BY_TYPE_AND_SLUG: (questionType, slug) => `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_QUESTION_ROUTES.FIND_BY_TYPE_AND_SLUG(questionType, slug)}`,
|
|
110
|
+
},
|
|
111
|
+
MODEL_PAGE_QUESTION_ADMIN: {
|
|
112
|
+
CREATE: `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER}`,
|
|
113
|
+
GET_ALL: `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER}`,
|
|
114
|
+
GET_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_QUESTION_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
115
|
+
PATCH: (uuid) => `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_QUESTION_ROUTES.PATCH(uuid)}`,
|
|
116
|
+
DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_QUESTION_ROUTES.DELETE(uuid)}`,
|
|
117
|
+
CREATE_TRANSLATION: (uuid) => `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_QUESTION_ROUTES.CREATE_TRANSLATION(uuid)}`,
|
|
118
|
+
GET_ALL_TRANSLATIONS: (uuid) => `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_QUESTION_ROUTES.FIND_TRANSLATIONS(uuid)}`,
|
|
119
|
+
GET_TRANSLATION: (uuid, translationUuid) => `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_QUESTION_ROUTES.FIND_TRANSLATION(uuid, translationUuid)}`,
|
|
120
|
+
UPDATE_TRANSLATION: (uuid, translationUuid) => `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_QUESTION_ROUTES.PATCH_TRANSLATION(uuid, translationUuid)}`,
|
|
121
|
+
DELETE_TRANSLATION: (uuid, translationUuid) => `${exports.ROOT}/${CONTROLLERS.MODEL_PAGE_QUESTION_ADMIN_CONTROLLER}/${CONTROLLERS.MODEL_PAGE_QUESTION_ROUTES.DELETE_TRANSLATION(uuid, translationUuid)}`,
|
|
122
|
+
},
|
|
91
123
|
CATEGORY: {
|
|
92
124
|
GET: `${exports.ROOT}/${CONTROLLERS.CATEGORY_CONTROLLER}/${CONTROLLERS.CATEGORY_ROUTES.GET_ALL}`,
|
|
93
125
|
PATCH: (uuid) => `${exports.ROOT}/${CONTROLLERS.CATEGORY_CONTROLLER}/${uuid}`,
|
package/build/commands/index.js
CHANGED
|
@@ -34,6 +34,7 @@ __exportStar(require("./form-submission"), exports);
|
|
|
34
34
|
__exportStar(require("./key-value"), exports);
|
|
35
35
|
__exportStar(require("./message"), exports);
|
|
36
36
|
__exportStar(require("./midjourney"), exports);
|
|
37
|
+
__exportStar(require("./model-page"), exports);
|
|
37
38
|
__exportStar(require("./page"), exports);
|
|
38
39
|
__exportStar(require("./order"), exports);
|
|
39
40
|
__exportStar(require("./payment"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateModelPageCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
const common_schemas_1 = require("../common.schemas");
|
|
7
|
+
var CreateModelPageCommand;
|
|
8
|
+
(function (CreateModelPageCommand) {
|
|
9
|
+
CreateModelPageCommand.RequestSchema = common_schemas_1.ModelPageSourceCreateSchema;
|
|
10
|
+
CreateModelPageCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: models_1.ModelPageSchema,
|
|
12
|
+
});
|
|
13
|
+
})(CreateModelPageCommand || (exports.CreateModelPageCommand = CreateModelPageCommand = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteModelPageCommand = void 0;
|
|
4
|
+
const common_schemas_1 = require("../common.schemas");
|
|
5
|
+
var DeleteModelPageCommand;
|
|
6
|
+
(function (DeleteModelPageCommand) {
|
|
7
|
+
DeleteModelPageCommand.RequestParamSchema = common_schemas_1.ModelPageUuidParamSchema;
|
|
8
|
+
DeleteModelPageCommand.ResponseSchema = common_schemas_1.ModelPageDeleteResponseSchema;
|
|
9
|
+
})(DeleteModelPageCommand || (exports.DeleteModelPageCommand = DeleteModelPageCommand = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindModelPageAdminCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
const common_schemas_1 = require("../common.schemas");
|
|
7
|
+
var FindModelPageAdminCommand;
|
|
8
|
+
(function (FindModelPageAdminCommand) {
|
|
9
|
+
FindModelPageAdminCommand.RequestParamSchema = common_schemas_1.ModelPageUuidParamSchema;
|
|
10
|
+
FindModelPageAdminCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: models_1.ModelPageSchema,
|
|
12
|
+
});
|
|
13
|
+
})(FindModelPageAdminCommand || (exports.FindModelPageAdminCommand = FindModelPageAdminCommand = {}));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindModelPagesAdminCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../../constants");
|
|
6
|
+
const models_1 = require("../../../models");
|
|
7
|
+
const common_schemas_1 = require("../common.schemas");
|
|
8
|
+
var FindModelPagesAdminCommand;
|
|
9
|
+
(function (FindModelPagesAdminCommand) {
|
|
10
|
+
FindModelPagesAdminCommand.RequestQuerySchema = zod_1.z.object({
|
|
11
|
+
vendorIds: (0, common_schemas_1.OptionalQueryArraySchema)(zod_1.z.string().uuid()),
|
|
12
|
+
types: (0, common_schemas_1.OptionalQueryArraySchema)(zod_1.z.nativeEnum(constants_1.MODEL_PAGE_TYPE)),
|
|
13
|
+
slug: zod_1.z.string().optional(),
|
|
14
|
+
limit: zod_1.z.coerce.number().int().min(1).max(100).optional().default(20),
|
|
15
|
+
offset: zod_1.z.coerce.number().int().min(0).optional().default(0),
|
|
16
|
+
});
|
|
17
|
+
FindModelPagesAdminCommand.ResponseSchema = zod_1.z.object({
|
|
18
|
+
data: zod_1.z.array(models_1.ModelPageSchema),
|
|
19
|
+
page: zod_1.z.number(),
|
|
20
|
+
totalPages: zod_1.z.number(),
|
|
21
|
+
});
|
|
22
|
+
})(FindModelPagesAdminCommand || (exports.FindModelPagesAdminCommand = FindModelPagesAdminCommand = {}));
|
|
@@ -0,0 +1,21 @@
|
|
|
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("./create-model-page.command"), exports);
|
|
18
|
+
__exportStar(require("./delete-model-page.command"), exports);
|
|
19
|
+
__exportStar(require("./find-model-page-admin.command"), exports);
|
|
20
|
+
__exportStar(require("./find-model-pages-admin.command"), exports);
|
|
21
|
+
__exportStar(require("./update-model-page.command"), exports);
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateModelPageCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../../constants");
|
|
6
|
+
const models_1 = require("../../../models");
|
|
7
|
+
const common_schemas_1 = require("../common.schemas");
|
|
8
|
+
var UpdateModelPageCommand;
|
|
9
|
+
(function (UpdateModelPageCommand) {
|
|
10
|
+
UpdateModelPageCommand.RequestParamSchema = common_schemas_1.ModelPageUuidParamSchema;
|
|
11
|
+
UpdateModelPageCommand.RequestSchema = zod_1.z
|
|
12
|
+
.object({
|
|
13
|
+
slug: zod_1.z.string().min(1).optional(),
|
|
14
|
+
type: zod_1.z.nativeEnum(constants_1.MODEL_PAGE_TYPE).optional(),
|
|
15
|
+
vendorId: zod_1.z.string().uuid().optional(),
|
|
16
|
+
aiModelId: zod_1.z.string().uuid().nullable().optional(),
|
|
17
|
+
toolModelId: zod_1.z.string().uuid().nullable().optional(),
|
|
18
|
+
})
|
|
19
|
+
.superRefine((value, context) => {
|
|
20
|
+
if (value.aiModelId && value.toolModelId) {
|
|
21
|
+
context.addIssue({
|
|
22
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
23
|
+
message: 'aiModelId and toolModelId cannot both be set',
|
|
24
|
+
path: ['toolModelId'],
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
if (value.type === constants_1.MODEL_PAGE_TYPE.TEXT) {
|
|
28
|
+
if (value.aiModelId === null) {
|
|
29
|
+
context.addIssue({
|
|
30
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
31
|
+
message: 'aiModelId cannot be null for TEXT',
|
|
32
|
+
path: ['aiModelId'],
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
if (value.toolModelId) {
|
|
36
|
+
context.addIssue({
|
|
37
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
38
|
+
message: 'toolModelId cannot be set for TEXT',
|
|
39
|
+
path: ['toolModelId'],
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (value.type && value.type !== constants_1.MODEL_PAGE_TYPE.TEXT) {
|
|
44
|
+
if (value.aiModelId) {
|
|
45
|
+
context.addIssue({
|
|
46
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
47
|
+
message: 'aiModelId cannot be set for a non-text model page',
|
|
48
|
+
path: ['aiModelId'],
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (value.toolModelId === null) {
|
|
52
|
+
context.addIssue({
|
|
53
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
54
|
+
message: 'toolModelId cannot be null for a non-text model page',
|
|
55
|
+
path: ['toolModelId'],
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
UpdateModelPageCommand.ResponseSchema = zod_1.z.object({
|
|
61
|
+
data: models_1.ModelPageSchema,
|
|
62
|
+
});
|
|
63
|
+
})(UpdateModelPageCommand || (exports.UpdateModelPageCommand = UpdateModelPageCommand = {}));
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModelPageSourceCreateSchema = exports.OptionalQueryArraySchema = exports.ModelPageDeleteResponseSchema = exports.ModelPageTranslationParamSchema = exports.ModelPageUuidParamSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
exports.ModelPageUuidParamSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.string().uuid(),
|
|
8
|
+
});
|
|
9
|
+
exports.ModelPageTranslationParamSchema = exports.ModelPageUuidParamSchema.extend({
|
|
10
|
+
translationUuid: zod_1.z.string().uuid(),
|
|
11
|
+
});
|
|
12
|
+
exports.ModelPageDeleteResponseSchema = zod_1.z.object({
|
|
13
|
+
isDeleted: zod_1.z.boolean(),
|
|
14
|
+
});
|
|
15
|
+
const OptionalQueryArraySchema = (schema) => zod_1.z
|
|
16
|
+
.preprocess((value) => {
|
|
17
|
+
if (value === undefined || value === null || value === '') {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
return Array.isArray(value) ? value : [value];
|
|
21
|
+
}, zod_1.z.array(schema))
|
|
22
|
+
.optional();
|
|
23
|
+
exports.OptionalQueryArraySchema = OptionalQueryArraySchema;
|
|
24
|
+
exports.ModelPageSourceCreateSchema = zod_1.z
|
|
25
|
+
.object({
|
|
26
|
+
slug: zod_1.z.string().min(1),
|
|
27
|
+
type: zod_1.z.nativeEnum(constants_1.MODEL_PAGE_TYPE),
|
|
28
|
+
vendorId: zod_1.z.string().uuid(),
|
|
29
|
+
aiModelId: zod_1.z.string().uuid().nullable().optional(),
|
|
30
|
+
toolModelId: zod_1.z.string().uuid().nullable().optional(),
|
|
31
|
+
})
|
|
32
|
+
.superRefine((value, context) => {
|
|
33
|
+
const isText = value.type === constants_1.MODEL_PAGE_TYPE.TEXT;
|
|
34
|
+
if (isText && !value.aiModelId) {
|
|
35
|
+
context.addIssue({
|
|
36
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
37
|
+
message: 'aiModelId is required for TEXT',
|
|
38
|
+
path: ['aiModelId'],
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (isText && value.toolModelId) {
|
|
42
|
+
context.addIssue({
|
|
43
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
44
|
+
message: 'toolModelId cannot be set for TEXT',
|
|
45
|
+
path: ['toolModelId'],
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (!isText && value.aiModelId) {
|
|
49
|
+
context.addIssue({
|
|
50
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
51
|
+
message: 'aiModelId cannot be set for a non-text model page',
|
|
52
|
+
path: ['aiModelId'],
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if (!isText && !value.toolModelId) {
|
|
56
|
+
context.addIssue({
|
|
57
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
58
|
+
message: 'toolModelId is required for a non-text model page',
|
|
59
|
+
path: ['toolModelId'],
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
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("./base"), exports);
|
|
18
|
+
__exportStar(require("./public"), exports);
|
|
19
|
+
__exportStar(require("./question"), exports);
|
|
20
|
+
__exportStar(require("./question-translation"), exports);
|
|
21
|
+
__exportStar(require("./translation"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindModelPageAnswerDetailCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../../constants");
|
|
6
|
+
const models_1 = require("../../../models");
|
|
7
|
+
var FindModelPageAnswerDetailCommand;
|
|
8
|
+
(function (FindModelPageAnswerDetailCommand) {
|
|
9
|
+
FindModelPageAnswerDetailCommand.RequestParamSchema = zod_1.z.object({
|
|
10
|
+
questionType: zod_1.z.nativeEnum(constants_1.MODEL_PAGE_QUESTION_TYPE),
|
|
11
|
+
slug: zod_1.z.string(),
|
|
12
|
+
});
|
|
13
|
+
FindModelPageAnswerDetailCommand.ResponseSchema = models_1.ModelPageAnswerDetailSchema;
|
|
14
|
+
})(FindModelPageAnswerDetailCommand || (exports.FindModelPageAnswerDetailCommand = FindModelPageAnswerDetailCommand = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindModelPageDetailCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var FindModelPageDetailCommand;
|
|
7
|
+
(function (FindModelPageDetailCommand) {
|
|
8
|
+
FindModelPageDetailCommand.RequestParamSchema = zod_1.z.object({
|
|
9
|
+
slug: zod_1.z.string(),
|
|
10
|
+
});
|
|
11
|
+
FindModelPageDetailCommand.ResponseSchema = models_1.ModelPageDetailSchema;
|
|
12
|
+
})(FindModelPageDetailCommand || (exports.FindModelPageDetailCommand = FindModelPageDetailCommand = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindModelPageHubCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../../constants");
|
|
6
|
+
const models_1 = require("../../../models");
|
|
7
|
+
const common_schemas_1 = require("../common.schemas");
|
|
8
|
+
var FindModelPageHubCommand;
|
|
9
|
+
(function (FindModelPageHubCommand) {
|
|
10
|
+
FindModelPageHubCommand.RequestQuerySchema = zod_1.z.object({
|
|
11
|
+
vendorIds: (0, common_schemas_1.OptionalQueryArraySchema)(zod_1.z.string().uuid()),
|
|
12
|
+
types: (0, common_schemas_1.OptionalQueryArraySchema)(zod_1.z.nativeEnum(constants_1.MODEL_PAGE_TYPE)),
|
|
13
|
+
sortBy: zod_1.z.nativeEnum(constants_1.MODEL_PAGE_SORT_BY).optional().default(constants_1.MODEL_PAGE_SORT_BY.ORDER),
|
|
14
|
+
sortDir: zod_1.z.nativeEnum(constants_1.SORT_ORDER).optional().default(constants_1.SORT_ORDER.ASC),
|
|
15
|
+
page: zod_1.z.coerce.number().int().min(1).optional().default(1),
|
|
16
|
+
limit: zod_1.z.coerce.number().int().min(1).max(100).optional().default(20),
|
|
17
|
+
});
|
|
18
|
+
FindModelPageHubCommand.ResponseSchema = models_1.ModelPageHubSchema;
|
|
19
|
+
})(FindModelPageHubCommand || (exports.FindModelPageHubCommand = FindModelPageHubCommand = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindModelPageQuestionTypeCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../../constants");
|
|
6
|
+
const models_1 = require("../../../models");
|
|
7
|
+
var FindModelPageQuestionTypeCommand;
|
|
8
|
+
(function (FindModelPageQuestionTypeCommand) {
|
|
9
|
+
FindModelPageQuestionTypeCommand.RequestParamSchema = zod_1.z.object({
|
|
10
|
+
questionType: zod_1.z.nativeEnum(constants_1.MODEL_PAGE_QUESTION_TYPE),
|
|
11
|
+
});
|
|
12
|
+
FindModelPageQuestionTypeCommand.ResponseSchema = models_1.ModelPageQuestionTypeListSchema;
|
|
13
|
+
})(FindModelPageQuestionTypeCommand || (exports.FindModelPageQuestionTypeCommand = FindModelPageQuestionTypeCommand = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
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-model-page-answer-detail.command"), exports);
|
|
18
|
+
__exportStar(require("./find-model-page-detail.command"), exports);
|
|
19
|
+
__exportStar(require("./find-model-page-hub.command"), exports);
|
|
20
|
+
__exportStar(require("./find-model-page-question-type.command"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateModelPageQuestionCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var CreateModelPageQuestionCommand;
|
|
7
|
+
(function (CreateModelPageQuestionCommand) {
|
|
8
|
+
CreateModelPageQuestionCommand.RequestSchema = models_1.ModelPageQuestionSchema.pick({
|
|
9
|
+
modelPageId: true,
|
|
10
|
+
questionType: true,
|
|
11
|
+
slug: true,
|
|
12
|
+
});
|
|
13
|
+
CreateModelPageQuestionCommand.ResponseSchema = zod_1.z.object({
|
|
14
|
+
data: models_1.ModelPageQuestionSchema,
|
|
15
|
+
});
|
|
16
|
+
})(CreateModelPageQuestionCommand || (exports.CreateModelPageQuestionCommand = CreateModelPageQuestionCommand = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteModelPageQuestionCommand = void 0;
|
|
4
|
+
const common_schemas_1 = require("../common.schemas");
|
|
5
|
+
var DeleteModelPageQuestionCommand;
|
|
6
|
+
(function (DeleteModelPageQuestionCommand) {
|
|
7
|
+
DeleteModelPageQuestionCommand.RequestParamSchema = common_schemas_1.ModelPageUuidParamSchema;
|
|
8
|
+
DeleteModelPageQuestionCommand.ResponseSchema = common_schemas_1.ModelPageDeleteResponseSchema;
|
|
9
|
+
})(DeleteModelPageQuestionCommand || (exports.DeleteModelPageQuestionCommand = DeleteModelPageQuestionCommand = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindModelPageQuestionAdminCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
const common_schemas_1 = require("../common.schemas");
|
|
7
|
+
var FindModelPageQuestionAdminCommand;
|
|
8
|
+
(function (FindModelPageQuestionAdminCommand) {
|
|
9
|
+
FindModelPageQuestionAdminCommand.RequestParamSchema = common_schemas_1.ModelPageUuidParamSchema;
|
|
10
|
+
FindModelPageQuestionAdminCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: models_1.ModelPageQuestionSchema,
|
|
12
|
+
});
|
|
13
|
+
})(FindModelPageQuestionAdminCommand || (exports.FindModelPageQuestionAdminCommand = FindModelPageQuestionAdminCommand = {}));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindModelPageQuestionsAdminCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../../constants");
|
|
6
|
+
const models_1 = require("../../../models");
|
|
7
|
+
var FindModelPageQuestionsAdminCommand;
|
|
8
|
+
(function (FindModelPageQuestionsAdminCommand) {
|
|
9
|
+
FindModelPageQuestionsAdminCommand.RequestQuerySchema = zod_1.z.object({
|
|
10
|
+
modelPageId: zod_1.z.string().uuid().optional(),
|
|
11
|
+
questionType: zod_1.z.nativeEnum(constants_1.MODEL_PAGE_QUESTION_TYPE).optional(),
|
|
12
|
+
slug: zod_1.z.string().optional(),
|
|
13
|
+
limit: zod_1.z.coerce.number().int().min(1).max(100).optional().default(20),
|
|
14
|
+
offset: zod_1.z.coerce.number().int().min(0).optional().default(0),
|
|
15
|
+
});
|
|
16
|
+
FindModelPageQuestionsAdminCommand.ResponseSchema = zod_1.z.object({
|
|
17
|
+
data: zod_1.z.array(models_1.ModelPageQuestionSchema),
|
|
18
|
+
page: zod_1.z.number(),
|
|
19
|
+
totalPages: zod_1.z.number(),
|
|
20
|
+
});
|
|
21
|
+
})(FindModelPageQuestionsAdminCommand || (exports.FindModelPageQuestionsAdminCommand = FindModelPageQuestionsAdminCommand = {}));
|
|
@@ -0,0 +1,21 @@
|
|
|
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("./create-model-page-question.command"), exports);
|
|
18
|
+
__exportStar(require("./delete-model-page-question.command"), exports);
|
|
19
|
+
__exportStar(require("./find-model-page-question-admin.command"), exports);
|
|
20
|
+
__exportStar(require("./find-model-page-questions-admin.command"), exports);
|
|
21
|
+
__exportStar(require("./update-model-page-question.command"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateModelPageQuestionCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
const common_schemas_1 = require("../common.schemas");
|
|
7
|
+
var UpdateModelPageQuestionCommand;
|
|
8
|
+
(function (UpdateModelPageQuestionCommand) {
|
|
9
|
+
UpdateModelPageQuestionCommand.RequestParamSchema = common_schemas_1.ModelPageUuidParamSchema;
|
|
10
|
+
UpdateModelPageQuestionCommand.RequestSchema = models_1.ModelPageQuestionSchema.pick({
|
|
11
|
+
modelPageId: true,
|
|
12
|
+
questionType: true,
|
|
13
|
+
slug: true,
|
|
14
|
+
}).partial();
|
|
15
|
+
UpdateModelPageQuestionCommand.ResponseSchema = zod_1.z.object({
|
|
16
|
+
data: models_1.ModelPageQuestionSchema,
|
|
17
|
+
});
|
|
18
|
+
})(UpdateModelPageQuestionCommand || (exports.UpdateModelPageQuestionCommand = UpdateModelPageQuestionCommand = {}));
|