@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,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateModelPageQuestionTranslationCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
const common_schemas_1 = require("../common.schemas");
|
|
7
|
+
var CreateModelPageQuestionTranslationCommand;
|
|
8
|
+
(function (CreateModelPageQuestionTranslationCommand) {
|
|
9
|
+
CreateModelPageQuestionTranslationCommand.RequestParamSchema = common_schemas_1.ModelPageUuidParamSchema;
|
|
10
|
+
CreateModelPageQuestionTranslationCommand.RequestSchema = models_1.ModelPageQuestionTranslationSchema.pick({
|
|
11
|
+
locale: true,
|
|
12
|
+
answer: true,
|
|
13
|
+
});
|
|
14
|
+
CreateModelPageQuestionTranslationCommand.ResponseSchema = zod_1.z.object({
|
|
15
|
+
data: models_1.ModelPageQuestionTranslationSchema,
|
|
16
|
+
});
|
|
17
|
+
})(CreateModelPageQuestionTranslationCommand || (exports.CreateModelPageQuestionTranslationCommand = CreateModelPageQuestionTranslationCommand = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteModelPageQuestionTranslationCommand = void 0;
|
|
4
|
+
const common_schemas_1 = require("../common.schemas");
|
|
5
|
+
var DeleteModelPageQuestionTranslationCommand;
|
|
6
|
+
(function (DeleteModelPageQuestionTranslationCommand) {
|
|
7
|
+
DeleteModelPageQuestionTranslationCommand.RequestParamSchema = common_schemas_1.ModelPageTranslationParamSchema;
|
|
8
|
+
DeleteModelPageQuestionTranslationCommand.ResponseSchema = common_schemas_1.ModelPageDeleteResponseSchema;
|
|
9
|
+
})(DeleteModelPageQuestionTranslationCommand || (exports.DeleteModelPageQuestionTranslationCommand = DeleteModelPageQuestionTranslationCommand = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindModelPageQuestionTranslationCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
const common_schemas_1 = require("../common.schemas");
|
|
7
|
+
var FindModelPageQuestionTranslationCommand;
|
|
8
|
+
(function (FindModelPageQuestionTranslationCommand) {
|
|
9
|
+
FindModelPageQuestionTranslationCommand.RequestParamSchema = common_schemas_1.ModelPageTranslationParamSchema;
|
|
10
|
+
FindModelPageQuestionTranslationCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: models_1.ModelPageQuestionTranslationSchema,
|
|
12
|
+
});
|
|
13
|
+
})(FindModelPageQuestionTranslationCommand || (exports.FindModelPageQuestionTranslationCommand = FindModelPageQuestionTranslationCommand = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindModelPageQuestionTranslationsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
const common_schemas_1 = require("../common.schemas");
|
|
7
|
+
var FindModelPageQuestionTranslationsCommand;
|
|
8
|
+
(function (FindModelPageQuestionTranslationsCommand) {
|
|
9
|
+
FindModelPageQuestionTranslationsCommand.RequestParamSchema = common_schemas_1.ModelPageUuidParamSchema;
|
|
10
|
+
FindModelPageQuestionTranslationsCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: zod_1.z.array(models_1.ModelPageQuestionTranslationSchema),
|
|
12
|
+
});
|
|
13
|
+
})(FindModelPageQuestionTranslationsCommand || (exports.FindModelPageQuestionTranslationsCommand = FindModelPageQuestionTranslationsCommand = {}));
|
|
@@ -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-translation.command"), exports);
|
|
18
|
+
__exportStar(require("./delete-model-page-question-translation.command"), exports);
|
|
19
|
+
__exportStar(require("./find-model-page-question-translation.command"), exports);
|
|
20
|
+
__exportStar(require("./find-model-page-question-translations.command"), exports);
|
|
21
|
+
__exportStar(require("./update-model-page-question-translation.command"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateModelPageQuestionTranslationCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
const common_schemas_1 = require("../common.schemas");
|
|
7
|
+
var UpdateModelPageQuestionTranslationCommand;
|
|
8
|
+
(function (UpdateModelPageQuestionTranslationCommand) {
|
|
9
|
+
UpdateModelPageQuestionTranslationCommand.RequestParamSchema = common_schemas_1.ModelPageTranslationParamSchema;
|
|
10
|
+
UpdateModelPageQuestionTranslationCommand.RequestSchema = models_1.ModelPageQuestionTranslationSchema.pick({
|
|
11
|
+
answer: true,
|
|
12
|
+
}).partial();
|
|
13
|
+
UpdateModelPageQuestionTranslationCommand.ResponseSchema = zod_1.z.object({
|
|
14
|
+
data: models_1.ModelPageQuestionTranslationSchema,
|
|
15
|
+
});
|
|
16
|
+
})(UpdateModelPageQuestionTranslationCommand || (exports.UpdateModelPageQuestionTranslationCommand = UpdateModelPageQuestionTranslationCommand = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateModelPageTranslationCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
const common_schemas_1 = require("../common.schemas");
|
|
7
|
+
var CreateModelPageTranslationCommand;
|
|
8
|
+
(function (CreateModelPageTranslationCommand) {
|
|
9
|
+
CreateModelPageTranslationCommand.RequestParamSchema = common_schemas_1.ModelPageUuidParamSchema;
|
|
10
|
+
CreateModelPageTranslationCommand.RequestSchema = models_1.ModelPageTranslationSchema.pick({
|
|
11
|
+
locale: true,
|
|
12
|
+
description: true,
|
|
13
|
+
documentation: true,
|
|
14
|
+
});
|
|
15
|
+
CreateModelPageTranslationCommand.ResponseSchema = zod_1.z.object({
|
|
16
|
+
data: models_1.ModelPageTranslationSchema,
|
|
17
|
+
});
|
|
18
|
+
})(CreateModelPageTranslationCommand || (exports.CreateModelPageTranslationCommand = CreateModelPageTranslationCommand = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteModelPageTranslationCommand = void 0;
|
|
4
|
+
const common_schemas_1 = require("../common.schemas");
|
|
5
|
+
var DeleteModelPageTranslationCommand;
|
|
6
|
+
(function (DeleteModelPageTranslationCommand) {
|
|
7
|
+
DeleteModelPageTranslationCommand.RequestParamSchema = common_schemas_1.ModelPageTranslationParamSchema;
|
|
8
|
+
DeleteModelPageTranslationCommand.ResponseSchema = common_schemas_1.ModelPageDeleteResponseSchema;
|
|
9
|
+
})(DeleteModelPageTranslationCommand || (exports.DeleteModelPageTranslationCommand = DeleteModelPageTranslationCommand = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindModelPageTranslationCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
const common_schemas_1 = require("../common.schemas");
|
|
7
|
+
var FindModelPageTranslationCommand;
|
|
8
|
+
(function (FindModelPageTranslationCommand) {
|
|
9
|
+
FindModelPageTranslationCommand.RequestParamSchema = common_schemas_1.ModelPageTranslationParamSchema;
|
|
10
|
+
FindModelPageTranslationCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: models_1.ModelPageTranslationSchema,
|
|
12
|
+
});
|
|
13
|
+
})(FindModelPageTranslationCommand || (exports.FindModelPageTranslationCommand = FindModelPageTranslationCommand = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindModelPageTranslationsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
const common_schemas_1 = require("../common.schemas");
|
|
7
|
+
var FindModelPageTranslationsCommand;
|
|
8
|
+
(function (FindModelPageTranslationsCommand) {
|
|
9
|
+
FindModelPageTranslationsCommand.RequestParamSchema = common_schemas_1.ModelPageUuidParamSchema;
|
|
10
|
+
FindModelPageTranslationsCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: zod_1.z.array(models_1.ModelPageTranslationSchema),
|
|
12
|
+
});
|
|
13
|
+
})(FindModelPageTranslationsCommand || (exports.FindModelPageTranslationsCommand = FindModelPageTranslationsCommand = {}));
|
|
@@ -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-translation.command"), exports);
|
|
18
|
+
__exportStar(require("./delete-model-page-translation.command"), exports);
|
|
19
|
+
__exportStar(require("./find-model-page-translation.command"), exports);
|
|
20
|
+
__exportStar(require("./find-model-page-translations.command"), exports);
|
|
21
|
+
__exportStar(require("./update-model-page-translation.command"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateModelPageTranslationCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
const common_schemas_1 = require("../common.schemas");
|
|
7
|
+
var UpdateModelPageTranslationCommand;
|
|
8
|
+
(function (UpdateModelPageTranslationCommand) {
|
|
9
|
+
UpdateModelPageTranslationCommand.RequestParamSchema = common_schemas_1.ModelPageTranslationParamSchema;
|
|
10
|
+
UpdateModelPageTranslationCommand.RequestSchema = models_1.ModelPageTranslationSchema.pick({
|
|
11
|
+
description: true,
|
|
12
|
+
documentation: true,
|
|
13
|
+
}).partial();
|
|
14
|
+
UpdateModelPageTranslationCommand.ResponseSchema = zod_1.z.object({
|
|
15
|
+
data: models_1.ModelPageTranslationSchema,
|
|
16
|
+
});
|
|
17
|
+
})(UpdateModelPageTranslationCommand || (exports.UpdateModelPageTranslationCommand = UpdateModelPageTranslationCommand = {}));
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CreateQuestionCommand = void 0;
|
|
3
|
+
exports.CreateQuestionCommand = exports.QuestionParentSchema = exports.QuestionParentBaseSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const models_1 = require("../../models");
|
|
6
|
+
const hasParent = (value) => value !== undefined && value !== null;
|
|
7
|
+
exports.QuestionParentBaseSchema = zod_1.z.object({
|
|
8
|
+
pageId: models_1.QuestionSchema.shape.pageId.optional(),
|
|
9
|
+
modelPageId: models_1.QuestionSchema.shape.modelPageId.optional(),
|
|
10
|
+
});
|
|
11
|
+
exports.QuestionParentSchema = exports.QuestionParentBaseSchema.superRefine((value, ctx) => {
|
|
12
|
+
if (Number(hasParent(value.pageId)) + Number(hasParent(value.modelPageId)) !== 1) {
|
|
13
|
+
ctx.addIssue({
|
|
14
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
15
|
+
message: 'Укажите ровно одного родителя вопроса: pageId или modelPageId',
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
6
19
|
var CreateQuestionCommand;
|
|
7
20
|
(function (CreateQuestionCommand) {
|
|
8
|
-
CreateQuestionCommand.RequestSchema =
|
|
9
|
-
pageId: true,
|
|
10
|
-
});
|
|
21
|
+
CreateQuestionCommand.RequestSchema = exports.QuestionParentSchema;
|
|
11
22
|
CreateQuestionCommand.ResponseSchema = zod_1.z.object({
|
|
12
23
|
data: models_1.QuestionSchema,
|
|
13
24
|
});
|
|
@@ -3,15 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.UpdateQuestionCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const models_1 = require("../../models");
|
|
6
|
+
const create_question_command_1 = require("./create-question.command");
|
|
6
7
|
var UpdateQuestionCommand;
|
|
7
8
|
(function (UpdateQuestionCommand) {
|
|
8
|
-
UpdateQuestionCommand.RequestSchema =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
UpdateQuestionCommand.RequestSchema = create_question_command_1.QuestionParentBaseSchema.partial().superRefine((value, ctx) => {
|
|
10
|
+
if (value.pageId !== undefined &&
|
|
11
|
+
value.modelPageId !== undefined &&
|
|
12
|
+
((value.pageId !== null && value.modelPageId !== null) ||
|
|
13
|
+
(value.pageId === null && value.modelPageId === null))) {
|
|
14
|
+
ctx.addIssue({
|
|
15
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
16
|
+
message: 'Вопрос должен иметь ровно одного родителя: pageId или modelPageId',
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
15
20
|
UpdateQuestionCommand.RequestParamSchema = zod_1.z.object({
|
|
16
21
|
uuid: zod_1.z.string().uuid(),
|
|
17
22
|
});
|
package/build/constants/index.js
CHANGED
|
@@ -31,6 +31,7 @@ __exportStar(require("./form-submission"), exports);
|
|
|
31
31
|
__exportStar(require("./form-submission"), exports);
|
|
32
32
|
__exportStar(require("./message"), exports);
|
|
33
33
|
__exportStar(require("./midjourney"), exports);
|
|
34
|
+
__exportStar(require("./model-page"), exports);
|
|
34
35
|
__exportStar(require("./order"), exports);
|
|
35
36
|
__exportStar(require("./page"), exports);
|
|
36
37
|
__exportStar(require("./payment"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./model-page-question-type.enum"), exports);
|
|
18
|
+
__exportStar(require("./model-page-sort-by.enum"), exports);
|
|
19
|
+
__exportStar(require("./model-page-type.enum"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MODEL_PAGE_QUESTION_TYPE = void 0;
|
|
4
|
+
var MODEL_PAGE_QUESTION_TYPE;
|
|
5
|
+
(function (MODEL_PAGE_QUESTION_TYPE) {
|
|
6
|
+
MODEL_PAGE_QUESTION_TYPE["PRICING"] = "pricing";
|
|
7
|
+
MODEL_PAGE_QUESTION_TYPE["API_ACCESS"] = "api_access";
|
|
8
|
+
MODEL_PAGE_QUESTION_TYPE["CONTEXT_WINDOW"] = "context_window";
|
|
9
|
+
MODEL_PAGE_QUESTION_TYPE["BILLING"] = "billing";
|
|
10
|
+
MODEL_PAGE_QUESTION_TYPE["INTEGRATION"] = "integration";
|
|
11
|
+
MODEL_PAGE_QUESTION_TYPE["REGIONS"] = "regions";
|
|
12
|
+
MODEL_PAGE_QUESTION_TYPE["USAGE_LIMITS"] = "usage_limits";
|
|
13
|
+
})(MODEL_PAGE_QUESTION_TYPE || (exports.MODEL_PAGE_QUESTION_TYPE = MODEL_PAGE_QUESTION_TYPE = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MODEL_PAGE_SORT_BY = void 0;
|
|
4
|
+
var MODEL_PAGE_SORT_BY;
|
|
5
|
+
(function (MODEL_PAGE_SORT_BY) {
|
|
6
|
+
MODEL_PAGE_SORT_BY["ORDER"] = "ORDER";
|
|
7
|
+
MODEL_PAGE_SORT_BY["NAME"] = "NAME";
|
|
8
|
+
})(MODEL_PAGE_SORT_BY || (exports.MODEL_PAGE_SORT_BY = MODEL_PAGE_SORT_BY = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MODEL_PAGE_TYPE = void 0;
|
|
4
|
+
var MODEL_PAGE_TYPE;
|
|
5
|
+
(function (MODEL_PAGE_TYPE) {
|
|
6
|
+
MODEL_PAGE_TYPE["TEXT"] = "TEXT";
|
|
7
|
+
MODEL_PAGE_TYPE["IMAGE_GENERATION"] = "IMAGE_GENERATION";
|
|
8
|
+
MODEL_PAGE_TYPE["VIDEO"] = "VIDEO";
|
|
9
|
+
MODEL_PAGE_TYPE["MUSIC"] = "MUSIC";
|
|
10
|
+
MODEL_PAGE_TYPE["STT"] = "STT";
|
|
11
|
+
MODEL_PAGE_TYPE["TTS"] = "TTS";
|
|
12
|
+
})(MODEL_PAGE_TYPE || (exports.MODEL_PAGE_TYPE = MODEL_PAGE_TYPE = {}));
|
|
@@ -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("./enums"), exports);
|
package/build/models/index.js
CHANGED
|
@@ -42,6 +42,7 @@ __exportStar(require("./lesson.schema"), exports);
|
|
|
42
42
|
__exportStar(require("./lesson-translation.schema"), exports);
|
|
43
43
|
__exportStar(require("./message.schema"), exports);
|
|
44
44
|
__exportStar(require("./midjourney-job.schema"), exports);
|
|
45
|
+
__exportStar(require("./model-page"), exports);
|
|
45
46
|
__exportStar(require("./order.schema"), exports);
|
|
46
47
|
__exportStar(require("./page.schema"), exports);
|
|
47
48
|
__exportStar(require("./page-translation.schema"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
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("./model-page-public.schema"), exports);
|
|
18
|
+
__exportStar(require("./model-page-question-translation.schema"), exports);
|
|
19
|
+
__exportStar(require("./model-page-question.schema"), exports);
|
|
20
|
+
__exportStar(require("./model-page-technical-model.schema"), exports);
|
|
21
|
+
__exportStar(require("./model-page-translation.schema"), exports);
|
|
22
|
+
__exportStar(require("./model-page.schema"), exports);
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModelPageAnswerDetailSchema = exports.ModelPageQuestionTypeListSchema = exports.ModelPageDetailSchema = exports.ModelPageHubSchema = exports.ModelPageFaqSchema = exports.ModelPageSimilarModelSchema = exports.ModelPageCodeExampleSchema = exports.ModelPageCodeSnippetSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
const model_page_technical_model_schema_1 = require("./model-page-technical-model.schema");
|
|
7
|
+
exports.ModelPageCodeSnippetSchema = zod_1.z.object({
|
|
8
|
+
language: zod_1.z.string(),
|
|
9
|
+
code: zod_1.z.string(),
|
|
10
|
+
});
|
|
11
|
+
exports.ModelPageCodeExampleSchema = zod_1.z.object({
|
|
12
|
+
provider: zod_1.z.string(),
|
|
13
|
+
snippets: zod_1.z.array(exports.ModelPageCodeSnippetSchema),
|
|
14
|
+
});
|
|
15
|
+
exports.ModelPageSimilarModelSchema = zod_1.z.object({
|
|
16
|
+
uuid: zod_1.z.string().uuid(),
|
|
17
|
+
slug: zod_1.z.string(),
|
|
18
|
+
name: zod_1.z.string(),
|
|
19
|
+
type: zod_1.z.nativeEnum(constants_1.MODEL_PAGE_TYPE),
|
|
20
|
+
});
|
|
21
|
+
exports.ModelPageFaqSchema = zod_1.z.object({
|
|
22
|
+
uuid: zod_1.z.string().uuid(),
|
|
23
|
+
question: zod_1.z.string(),
|
|
24
|
+
answer: zod_1.z.string(),
|
|
25
|
+
});
|
|
26
|
+
exports.ModelPageHubSchema = zod_1.z.object({
|
|
27
|
+
pages: zod_1.z.array(zod_1.z.object({
|
|
28
|
+
type: zod_1.z.nativeEnum(constants_1.MODEL_PAGE_TYPE),
|
|
29
|
+
aiModels: zod_1.z.array(model_page_technical_model_schema_1.ModelPageCardSchema),
|
|
30
|
+
})),
|
|
31
|
+
total: zod_1.z.number().int().min(0),
|
|
32
|
+
page: zod_1.z.number().int().min(1),
|
|
33
|
+
limit: zod_1.z.number().int().min(1),
|
|
34
|
+
});
|
|
35
|
+
exports.ModelPageDetailSchema = zod_1.z.object({
|
|
36
|
+
uuid: zod_1.z.string().uuid(),
|
|
37
|
+
slug: zod_1.z.string(),
|
|
38
|
+
description: zod_1.z.string(),
|
|
39
|
+
documentation: zod_1.z.string(),
|
|
40
|
+
codeExamples: zod_1.z.array(exports.ModelPageCodeExampleSchema),
|
|
41
|
+
aiModel: model_page_technical_model_schema_1.ModelPageTechnicalModelSchema,
|
|
42
|
+
similarModels: zod_1.z.array(exports.ModelPageSimilarModelSchema),
|
|
43
|
+
questions: zod_1.z.array(exports.ModelPageFaqSchema),
|
|
44
|
+
});
|
|
45
|
+
exports.ModelPageQuestionTypeListSchema = zod_1.z.object({
|
|
46
|
+
questionType: zod_1.z.nativeEnum(constants_1.MODEL_PAGE_QUESTION_TYPE),
|
|
47
|
+
vendors: zod_1.z.array(zod_1.z.object({
|
|
48
|
+
vendor: model_page_technical_model_schema_1.ModelPageVendorSchema,
|
|
49
|
+
models: zod_1.z.array(zod_1.z.object({
|
|
50
|
+
name: zod_1.z.string(),
|
|
51
|
+
slug: zod_1.z.string(),
|
|
52
|
+
})),
|
|
53
|
+
})),
|
|
54
|
+
});
|
|
55
|
+
exports.ModelPageAnswerDetailSchema = zod_1.z.object({
|
|
56
|
+
uuid: zod_1.z.string().uuid(),
|
|
57
|
+
slug: zod_1.z.string(),
|
|
58
|
+
questionType: zod_1.z.nativeEnum(constants_1.MODEL_PAGE_QUESTION_TYPE),
|
|
59
|
+
answer: zod_1.z.string(),
|
|
60
|
+
codeExamples: zod_1.z.array(exports.ModelPageCodeExampleSchema),
|
|
61
|
+
aiModel: model_page_technical_model_schema_1.ModelPageTechnicalModelSchema,
|
|
62
|
+
similarModels: zod_1.z.array(exports.ModelPageSimilarModelSchema),
|
|
63
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModelPageQuestionTranslationSchema = void 0;
|
|
4
|
+
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
exports.ModelPageQuestionTranslationSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.string().uuid(),
|
|
8
|
+
modelPageQuestionId: zod_1.z.string().uuid(),
|
|
9
|
+
locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
|
|
10
|
+
answer: zod_1.z.string(),
|
|
11
|
+
createdAt: zod_1.z.date(),
|
|
12
|
+
updatedAt: zod_1.z.date(),
|
|
13
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModelPageQuestionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
exports.ModelPageQuestionSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.string().uuid(),
|
|
8
|
+
modelPageId: zod_1.z.string().uuid(),
|
|
9
|
+
questionType: zod_1.z.nativeEnum(constants_1.MODEL_PAGE_QUESTION_TYPE),
|
|
10
|
+
slug: zod_1.z.string(),
|
|
11
|
+
createdAt: zod_1.z.date(),
|
|
12
|
+
updatedAt: zod_1.z.date(),
|
|
13
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModelPageCardSchema = exports.ModelPageTechnicalModelSchema = exports.ModelPageTtsTechnicalModelSchema = exports.ModelPageSttTechnicalModelSchema = exports.ModelPageMusicTechnicalModelSchema = exports.ModelPageVideoTechnicalModelSchema = exports.ModelPageImageGenerationTechnicalModelSchema = exports.ModelPageTextTechnicalModelSchema = exports.ModelPageVendorSchema = void 0;
|
|
4
|
+
const tools_1 = require("../tools");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
const icon_variants_schema_1 = require("../icon-variants.schema");
|
|
8
|
+
exports.ModelPageVendorSchema = zod_1.z.object({
|
|
9
|
+
uuid: zod_1.z.string().uuid(),
|
|
10
|
+
name: zod_1.z.string(),
|
|
11
|
+
});
|
|
12
|
+
const ModelPageTechnicalModelBaseSchema = zod_1.z.object({
|
|
13
|
+
uuid: zod_1.z.string().uuid(),
|
|
14
|
+
title: zod_1.z.string(),
|
|
15
|
+
model: zod_1.z.string(),
|
|
16
|
+
vendor: exports.ModelPageVendorSchema,
|
|
17
|
+
icons: icon_variants_schema_1.IconVariantsSchema,
|
|
18
|
+
order: zod_1.z.number(),
|
|
19
|
+
});
|
|
20
|
+
exports.ModelPageTextTechnicalModelSchema = ModelPageTechnicalModelBaseSchema.extend({
|
|
21
|
+
type: zod_1.z.literal(constants_1.MODEL_PAGE_TYPE.TEXT),
|
|
22
|
+
inputPrice: zod_1.z.number(),
|
|
23
|
+
outputPrice: zod_1.z.number(),
|
|
24
|
+
cacheReadPrice: zod_1.z.number(),
|
|
25
|
+
cacheWritePrice: zod_1.z.number(),
|
|
26
|
+
maxPromptLength: zod_1.z.number(),
|
|
27
|
+
maxPromptTokens: zod_1.z.number(),
|
|
28
|
+
maxContextCharacters: zod_1.z.number(),
|
|
29
|
+
features: zod_1.z.array(zod_1.z.nativeEnum(constants_1.AI_MODEL_FEATURE)),
|
|
30
|
+
});
|
|
31
|
+
exports.ModelPageImageGenerationTechnicalModelSchema = ModelPageTechnicalModelBaseSchema.extend({
|
|
32
|
+
type: zod_1.z.literal(constants_1.MODEL_PAGE_TYPE.IMAGE_GENERATION),
|
|
33
|
+
price: zod_1.z.number(),
|
|
34
|
+
isNew: zod_1.z.boolean(),
|
|
35
|
+
maxPromptLength: zod_1.z.number(),
|
|
36
|
+
supportsImageAttachment: zod_1.z.boolean(),
|
|
37
|
+
maxAttachedImages: zod_1.z.number(),
|
|
38
|
+
params: tools_1.ImageGenerationModelParamsSchema,
|
|
39
|
+
pricingRules: tools_1.ImageModelPricingRulesSchema,
|
|
40
|
+
});
|
|
41
|
+
exports.ModelPageVideoTechnicalModelSchema = ModelPageTechnicalModelBaseSchema.extend({
|
|
42
|
+
type: zod_1.z.literal(constants_1.MODEL_PAGE_TYPE.VIDEO),
|
|
43
|
+
pricePerSecond: zod_1.z.number(),
|
|
44
|
+
maxInputLength: zod_1.z.number(),
|
|
45
|
+
params: tools_1.VideoModelParamsSchema,
|
|
46
|
+
limitations: zod_1.z.array(zod_1.z.nativeEnum(constants_1.VIDEO_GENERATION_MODEL_LIMITATION)),
|
|
47
|
+
pricingRules: tools_1.VideoModelPricingRulesSchema,
|
|
48
|
+
});
|
|
49
|
+
exports.ModelPageMusicTechnicalModelSchema = ModelPageTechnicalModelBaseSchema.extend({
|
|
50
|
+
type: zod_1.z.literal(constants_1.MODEL_PAGE_TYPE.MUSIC),
|
|
51
|
+
pricePerTrack: zod_1.z.number(),
|
|
52
|
+
maxPromptLength: zod_1.z.number(),
|
|
53
|
+
maxLyricsLength: zod_1.z.number(),
|
|
54
|
+
params: tools_1.MusicModelParamsSchema,
|
|
55
|
+
pricingRules: tools_1.MusicModelPricingRulesSchema,
|
|
56
|
+
});
|
|
57
|
+
exports.ModelPageSttTechnicalModelSchema = ModelPageTechnicalModelBaseSchema.extend({
|
|
58
|
+
type: zod_1.z.literal(constants_1.MODEL_PAGE_TYPE.STT),
|
|
59
|
+
pricePerSecond: zod_1.z.number(),
|
|
60
|
+
maxDurationSeconds: zod_1.z.number(),
|
|
61
|
+
maxSizeMB: zod_1.z.number(),
|
|
62
|
+
});
|
|
63
|
+
exports.ModelPageTtsTechnicalModelSchema = ModelPageTechnicalModelBaseSchema.extend({
|
|
64
|
+
type: zod_1.z.literal(constants_1.MODEL_PAGE_TYPE.TTS),
|
|
65
|
+
pricePerSymbol: zod_1.z.number(),
|
|
66
|
+
maxInputLength: zod_1.z.number(),
|
|
67
|
+
params: tools_1.TTSModelParams,
|
|
68
|
+
voices: zod_1.z.array(tools_1.TTSVoiceSchema),
|
|
69
|
+
});
|
|
70
|
+
exports.ModelPageTechnicalModelSchema = zod_1.z.discriminatedUnion('type', [
|
|
71
|
+
exports.ModelPageTextTechnicalModelSchema,
|
|
72
|
+
exports.ModelPageImageGenerationTechnicalModelSchema,
|
|
73
|
+
exports.ModelPageVideoTechnicalModelSchema,
|
|
74
|
+
exports.ModelPageMusicTechnicalModelSchema,
|
|
75
|
+
exports.ModelPageSttTechnicalModelSchema,
|
|
76
|
+
exports.ModelPageTtsTechnicalModelSchema,
|
|
77
|
+
]);
|
|
78
|
+
exports.ModelPageCardSchema = exports.ModelPageTechnicalModelSchema.and(zod_1.z.object({
|
|
79
|
+
slug: zod_1.z.string(),
|
|
80
|
+
}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModelPageTranslationSchema = void 0;
|
|
4
|
+
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
exports.ModelPageTranslationSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.string().uuid(),
|
|
8
|
+
modelPageId: zod_1.z.string().uuid(),
|
|
9
|
+
locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
|
|
10
|
+
description: zod_1.z.string(),
|
|
11
|
+
documentation: zod_1.z.string(),
|
|
12
|
+
createdAt: zod_1.z.date(),
|
|
13
|
+
updatedAt: zod_1.z.date(),
|
|
14
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModelPageSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
exports.ModelPageSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.string().uuid(),
|
|
8
|
+
slug: zod_1.z.string(),
|
|
9
|
+
type: zod_1.z.nativeEnum(constants_1.MODEL_PAGE_TYPE),
|
|
10
|
+
vendorId: zod_1.z.string().uuid(),
|
|
11
|
+
aiModelId: zod_1.z.string().uuid().nullable(),
|
|
12
|
+
toolModelId: zod_1.z.string().uuid().nullable(),
|
|
13
|
+
createdAt: zod_1.z.date(),
|
|
14
|
+
updatedAt: zod_1.z.date(),
|
|
15
|
+
});
|
|
@@ -6,7 +6,8 @@ exports.QuestionSchema = zod_1.z.object({
|
|
|
6
6
|
uuid: zod_1.z.string().uuid(),
|
|
7
7
|
question: zod_1.z.string().min(3).max(16384),
|
|
8
8
|
answer: zod_1.z.string().min(3).max(16384),
|
|
9
|
-
pageId: zod_1.z.string().uuid(),
|
|
9
|
+
pageId: zod_1.z.string().uuid().nullable(),
|
|
10
|
+
modelPageId: zod_1.z.string().uuid().nullable(),
|
|
10
11
|
createdAt: zod_1.z.date(),
|
|
11
12
|
updatedAt: zod_1.z.date(),
|
|
12
13
|
});
|
package/commands/index.ts
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ModelPageSchema } from '../../../models';
|
|
3
|
+
import { ModelPageSourceCreateSchema } from '../common.schemas';
|
|
4
|
+
|
|
5
|
+
export namespace CreateModelPageCommand {
|
|
6
|
+
export const RequestSchema = ModelPageSourceCreateSchema;
|
|
7
|
+
|
|
8
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
9
|
+
|
|
10
|
+
export const ResponseSchema = z.object({
|
|
11
|
+
data: ModelPageSchema,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ModelPageDeleteResponseSchema, ModelPageUuidParamSchema } from '../common.schemas';
|
|
3
|
+
|
|
4
|
+
export namespace DeleteModelPageCommand {
|
|
5
|
+
export const RequestParamSchema = ModelPageUuidParamSchema;
|
|
6
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
7
|
+
|
|
8
|
+
export const ResponseSchema = ModelPageDeleteResponseSchema;
|
|
9
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
10
|
+
}
|