@purpleschool/gptbot-tools 0.0.55 → 0.0.56-presentation
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/build/common/errors/errors.js +399 -2
- package/build/index.js +6 -0
- package/build/music/commands/convert-to-wav.command.js +15 -0
- package/build/music/commands/delete-all-music-jobs.command.js +13 -0
- package/build/music/commands/delete-music-job-by-uuid.command.js +14 -0
- package/build/music/commands/generate-lyrics.command.js +18 -0
- package/build/music/commands/generate-music.command.js +18 -0
- package/build/music/commands/index.js +24 -0
- package/build/music/commands/retry-music-job.command.js +16 -0
- package/build/music/commands/set-reaction-to-music-job.command.js +17 -0
- package/build/music/commands/update-music-job-title.command.js +16 -0
- package/build/music/enums/index.js +22 -0
- package/build/music/enums/music-action-type.enum.js +7 -0
- package/build/music/enums/music-pricing-rule-type.enum.js +7 -0
- package/build/music/enums/music-strategy.enum.js +7 -0
- package/build/music/enums/music-vocal-gender.enum.js +8 -0
- package/build/music/enums/suno-mode-type.enum.js +10 -0
- package/build/music/enums/suno-model-type.enum.js +10 -0
- package/build/music/index.js +22 -0
- package/build/music/models/index.js +20 -0
- package/build/music/models/music-config.schema.js +8 -0
- package/build/music/models/music-job.schema.js +54 -0
- package/build/music/models/music-model.schema.js +35 -0
- package/build/music/models/music-track.schema.js +17 -0
- package/build/music/queries/find-music-job-by-id.query.js +10 -0
- package/build/music/queries/find-music-jobs.query.js +28 -0
- package/build/music/queries/get-music-config.query.js +9 -0
- package/build/music/queries/index.js +19 -0
- package/build/music/routes/index.js +17 -0
- package/build/music/routes/music.amqp.routes.js +16 -0
- package/build/music/utils/calculate-music-generation-price.util.js +7 -0
- package/build/music/utils/index.js +17 -0
- package/build/presentation/commands/build-blank-slide.command.js +15 -0
- package/build/presentation/commands/generate-and-insert-slide.command.js +22 -0
- package/build/presentation/commands/index.js +7 -0
- package/build/presentation/commands/presentation-generate-report.command.js +18 -0
- package/build/presentation/commands/presentation-paraphrase.command.js +19 -0
- package/build/presentation/commands/update-presentation-slides.command.js +16 -0
- package/build/presentation/commands/update-slide-image-slot.command.js +34 -0
- package/build/presentation/commands/update-slide.command.js +17 -0
- package/build/presentation/enums/index.js +4 -0
- package/build/presentation/enums/presentation-ai-action-call-status.enum.js +9 -0
- package/build/presentation/enums/presentation-ai-action-pricing-type.enum.js +8 -0
- package/build/presentation/enums/presentation-ai-action-type.enum.js +8 -0
- package/build/presentation/enums/slide-image-slot-action.enum.js +8 -0
- package/build/presentation/index.js +1 -0
- package/build/presentation/models/index.js +1 -0
- package/build/presentation/models/presentation-ai-action.schema.js +27 -0
- package/build/presentation/models/presentation-config.schema.js +3 -0
- package/build/presentation/models/presentation.schema.js +4 -1
- package/build/presentation/models/slide-content-edit.schema.js +135 -0
- package/build/presentation/models/slide-content.schema.js +5 -1
- package/build/presentation/models/slide.schema.js +39 -1
- package/build/presentation/routes/presentation.routes.js +7 -0
- package/build/presentation/utils/calculate-presentation-ai-action-price.util.js +16 -0
- package/build/presentation/utils/index.js +17 -0
- package/build/tools/enums/tool-type.enum.js +4 -0
- package/build/video/enums/video-strategy.enum.js +2 -0
- package/build/video/routes/video.http.routes.js +1 -0
- package/build/video-editor/commands/delete-all-video-editor-jobs.command.js +13 -0
- package/build/video-editor/commands/delete-video-editor-job-by-uuid.command.js +14 -0
- package/build/video-editor/commands/edit-video.command.js +19 -0
- package/build/video-editor/commands/index.js +22 -0
- package/build/video-editor/commands/retry-video-editor-job.command.js +16 -0
- package/build/video-editor/commands/set-reaction-to-video-editor-job.command.js +17 -0
- package/build/video-editor/commands/update-video-editor-job-title.command.js +16 -0
- package/build/video-editor/enums/index.js +17 -0
- package/build/video-editor/enums/video-editor-model-strategy.enum.js +10 -0
- package/build/video-editor/index.js +22 -0
- package/build/video-editor/models/index.js +19 -0
- package/build/video-editor/models/video-editor-config.schema.js +11 -0
- package/build/video-editor/models/video-editor-job.schema.js +27 -0
- package/build/video-editor/models/video-editor-model.schema.js +24 -0
- package/build/video-editor/queries/find-video-editor-job-by-id.query.js +19 -0
- package/build/video-editor/queries/find-video-editor-jobs.query.js +28 -0
- package/build/video-editor/queries/get-video-editor-config.query.js +11 -0
- package/build/video-editor/queries/index.js +19 -0
- package/build/video-editor/routes/index.js +18 -0
- package/build/video-editor/routes/video-editor.amqp.routes.js +14 -0
- package/build/video-editor/routes/video-editor.http.routes.js +8 -0
- package/build/video-editor/utils/calculate-video-editing-price.js +10 -0
- package/build/video-editor/utils/index.js +17 -0
- package/build/writer/commands/generate-document-contents.command.js +1 -0
- package/build/writer/enums/index.js +1 -0
- package/build/writer/enums/writer-content-generation-strategy.enum.js +8 -0
- package/build/writer/index.js +1 -0
- package/build/writer/models/index.js +1 -0
- package/build/writer/models/writer-config.schema.js +2 -0
- package/build/writer/models/writer-document-type.schema.js +1 -0
- package/build/writer/models/writer-document.schema.js +1 -0
- package/build/writer/models/writer-model.schema.js +21 -0
- package/build/writer/utils/calculate-writer-content-generation-price.util.js +2 -2
- package/common/errors/errors.ts +408 -3
- package/index.ts +6 -0
- package/music/commands/convert-to-wav.command.ts +15 -0
- package/music/commands/delete-all-music-jobs.command.ts +13 -0
- package/music/commands/delete-music-job-by-uuid.command.ts +14 -0
- package/music/commands/generate-lyrics.command.ts +20 -0
- package/music/commands/generate-music.command.ts +18 -0
- package/music/commands/index.ts +8 -0
- package/music/commands/retry-music-job.command.ts +16 -0
- package/music/commands/set-reaction-to-music-job.command.ts +17 -0
- package/music/commands/update-music-job-title.command.ts +16 -0
- package/music/enums/index.ts +6 -0
- package/music/enums/music-action-type.enum.ts +3 -0
- package/music/enums/music-pricing-rule-type.enum.ts +3 -0
- package/music/enums/music-strategy.enum.ts +3 -0
- package/music/enums/music-vocal-gender.enum.ts +4 -0
- package/music/enums/suno-mode-type.enum.ts +6 -0
- package/music/enums/suno-model-type.enum.ts +6 -0
- package/music/index.ts +6 -0
- package/music/models/index.ts +4 -0
- package/music/models/music-config.schema.ts +8 -0
- package/music/models/music-job.schema.ts +57 -0
- package/music/models/music-model.schema.ts +40 -0
- package/music/models/music-track.schema.ts +19 -0
- package/music/queries/find-music-job-by-id.query.ts +11 -0
- package/music/queries/find-music-jobs.query.ts +33 -0
- package/music/queries/get-music-config.query.ts +8 -0
- package/music/queries/index.ts +3 -0
- package/music/routes/index.ts +1 -0
- package/music/routes/music.amqp.routes.ts +13 -0
- package/music/utils/calculate-music-generation-price.util.ts +5 -0
- package/music/utils/index.ts +1 -0
- package/package.json +1 -1
- package/presentation/commands/build-blank-slide.command.ts +15 -0
- package/presentation/commands/generate-and-insert-slide.command.ts +22 -0
- package/presentation/commands/index.ts +7 -0
- package/presentation/commands/presentation-generate-report.command.ts +20 -0
- package/presentation/commands/presentation-paraphrase.command.ts +21 -0
- package/presentation/commands/update-presentation-slides.command.ts +16 -0
- package/presentation/commands/update-slide-image-slot.command.ts +39 -0
- package/presentation/commands/update-slide.command.ts +17 -0
- package/presentation/enums/index.ts +4 -0
- package/presentation/enums/presentation-ai-action-call-status.enum.ts +5 -0
- package/presentation/enums/presentation-ai-action-pricing-type.enum.ts +4 -0
- package/presentation/enums/presentation-ai-action-type.enum.ts +4 -0
- package/presentation/enums/slide-image-slot-action.enum.ts +4 -0
- package/presentation/index.ts +1 -0
- package/presentation/models/index.ts +1 -0
- package/presentation/models/presentation-ai-action.schema.ts +30 -0
- package/presentation/models/presentation-config.schema.ts +3 -0
- package/presentation/models/presentation.schema.ts +4 -1
- package/presentation/models/slide-content-edit.schema.ts +160 -0
- package/presentation/models/slide-content.schema.ts +104 -11
- package/presentation/models/slide-image-slot.schema.ts +1 -0
- package/presentation/models/slide.schema.ts +47 -0
- package/presentation/routes/presentation.routes.ts +7 -0
- package/presentation/utils/calculate-presentation-ai-action-price.util.ts +20 -0
- package/presentation/utils/index.ts +1 -0
- package/tools/enums/tool-type.enum.ts +4 -0
- package/video/enums/video-strategy.enum.ts +2 -0
- package/video/routes/video.http.routes.ts +1 -0
- package/video-editor/commands/delete-all-video-editor-jobs.command.ts +13 -0
- package/video-editor/commands/delete-video-editor-job-by-uuid.command.ts +14 -0
- package/video-editor/commands/edit-video.command.ts +19 -0
- package/video-editor/commands/index.ts +6 -0
- package/video-editor/commands/retry-video-editor-job.command.ts +16 -0
- package/video-editor/commands/set-reaction-to-video-editor-job.command.ts +17 -0
- package/video-editor/commands/update-video-editor-job-title.command.ts +16 -0
- package/video-editor/enums/index.ts +1 -0
- package/video-editor/enums/video-editor-model-strategy.enum.ts +6 -0
- package/video-editor/index.ts +6 -0
- package/video-editor/models/index.ts +3 -0
- package/video-editor/models/video-editor-config.schema.ts +7 -0
- package/video-editor/models/video-editor-job.schema.ts +27 -0
- package/video-editor/models/video-editor-model.schema.ts +23 -0
- package/video-editor/queries/find-video-editor-job-by-id.query.ts +19 -0
- package/video-editor/queries/find-video-editor-jobs.query.ts +33 -0
- package/video-editor/queries/get-video-editor-config.query.ts +11 -0
- package/video-editor/queries/index.ts +3 -0
- package/video-editor/routes/index.ts +2 -0
- package/video-editor/routes/video-editor.amqp.routes.ts +11 -0
- package/video-editor/routes/video-editor.http.routes.ts +6 -0
- package/video-editor/utils/calculate-video-editing-price.ts +12 -0
- package/video-editor/utils/index.ts +1 -0
- package/writer/commands/generate-document-contents.command.ts +1 -0
- package/writer/enums/index.ts +1 -0
- package/writer/enums/writer-content-generation-strategy.enum.ts +4 -0
- package/writer/index.ts +1 -0
- package/writer/models/index.ts +1 -0
- package/writer/models/writer-config.schema.ts +2 -0
- package/writer/models/writer-document-type.schema.ts +1 -0
- package/writer/models/writer-document.schema.ts +1 -0
- package/writer/models/writer-model.schema.ts +21 -0
- package/writer/utils/calculate-writer-content-generation-price.util.ts +4 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetVideoEditorConfigQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const command_response_schema_1 = require("../../common/models/command-response.schema");
|
|
6
|
+
const models_1 = require("../models");
|
|
7
|
+
var GetVideoEditorConfigQuery;
|
|
8
|
+
(function (GetVideoEditorConfigQuery) {
|
|
9
|
+
GetVideoEditorConfigQuery.RequestSchema = zod_1.z.object({});
|
|
10
|
+
GetVideoEditorConfigQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.VideoEditorConfigSchema);
|
|
11
|
+
})(GetVideoEditorConfigQuery || (exports.GetVideoEditorConfigQuery = GetVideoEditorConfigQuery = {}));
|
|
@@ -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("./find-video-editor-job-by-id.query"), exports);
|
|
18
|
+
__exportStar(require("./find-video-editor-jobs.query"), exports);
|
|
19
|
+
__exportStar(require("./get-video-editor-config.query"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./video-editor.amqp.routes"), exports);
|
|
18
|
+
__exportStar(require("./video-editor.http.routes"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VIDEO_EDITOR_AMQP_ROUTES = void 0;
|
|
4
|
+
exports.VIDEO_EDITOR_AMQP_ROUTES = {
|
|
5
|
+
EXECUTE: 'tools.video-editor.execute.rpc',
|
|
6
|
+
CONFIG: 'tools.video-editor.config.rpc',
|
|
7
|
+
GET_JOB: 'tools.video-editor.jobs.get.rpc',
|
|
8
|
+
LIST_JOBS: 'tools.video-editor.jobs.list.rpc',
|
|
9
|
+
SET_REACTION: 'tools.video-editor.jobs.set-reaction.rpc',
|
|
10
|
+
UPDATE_TITLE: 'tools.video-editor.jobs.update-title.rpc',
|
|
11
|
+
SOFT_DELETE: 'tools.video-editor.jobs.soft-delete.rpc',
|
|
12
|
+
SOFT_DELETE_ALL: 'tools.video-editor.jobs.soft-delete-all.rpc',
|
|
13
|
+
RETRY: 'tools.video-editor.jobs.retry.rpc',
|
|
14
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VIDEO_EDITOR_ROUTES = exports.VIDEO_EDITOR_CONTROLLER = void 0;
|
|
4
|
+
exports.VIDEO_EDITOR_CONTROLLER = 'video-editor';
|
|
5
|
+
exports.VIDEO_EDITOR_ROUTES = {
|
|
6
|
+
KIE_ALEPH_CALLBACK: 'kie/aleph/callback',
|
|
7
|
+
KIE_LUMA_CALLBACK: 'kie/luma/callback',
|
|
8
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculateVideoEditingPrice = calculateVideoEditingPrice;
|
|
4
|
+
function calculateVideoEditingPrice({ duration, pricePerSecond, }) {
|
|
5
|
+
if (duration <= 0)
|
|
6
|
+
throw new Error('Duration must be positive');
|
|
7
|
+
if (pricePerSecond < 0)
|
|
8
|
+
throw new Error('Price per second cannot be negative');
|
|
9
|
+
return Math.ceil(duration * pricePerSecond);
|
|
10
|
+
}
|
|
@@ -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("./calculate-video-editing-price"), exports);
|
|
@@ -11,6 +11,7 @@ var GenerateWriterDocumentContentsCommand;
|
|
|
11
11
|
userId: zod_1.z.string().uuid().nullable().optional(),
|
|
12
12
|
unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
|
|
13
13
|
userBalance: zod_1.z.number(),
|
|
14
|
+
modelId: zod_1.z.string(),
|
|
14
15
|
});
|
|
15
16
|
GenerateWriterDocumentContentsCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.WriterDocumentSchema);
|
|
16
17
|
})(GenerateWriterDocumentContentsCommand || (exports.GenerateWriterDocumentContentsCommand = GenerateWriterDocumentContentsCommand = {}));
|
|
@@ -19,3 +19,4 @@ __exportStar(require("./writer-ai-action-pricing-type.enum"), exports);
|
|
|
19
19
|
__exportStar(require("./writer-ai-action-type.enum"), exports);
|
|
20
20
|
__exportStar(require("./writer-document-section-type.enum"), exports);
|
|
21
21
|
__exportStar(require("./writer-document-stage.enum"), exports);
|
|
22
|
+
__exportStar(require("./writer-content-generation-strategy.enum"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WRITER_CONTENT_GENERATION_STRATEGY = void 0;
|
|
4
|
+
var WRITER_CONTENT_GENERATION_STRATEGY;
|
|
5
|
+
(function (WRITER_CONTENT_GENERATION_STRATEGY) {
|
|
6
|
+
WRITER_CONTENT_GENERATION_STRATEGY["OPENAI"] = "openai";
|
|
7
|
+
WRITER_CONTENT_GENERATION_STRATEGY["PERPLEXITY"] = "perplexity";
|
|
8
|
+
})(WRITER_CONTENT_GENERATION_STRATEGY || (exports.WRITER_CONTENT_GENERATION_STRATEGY = WRITER_CONTENT_GENERATION_STRATEGY = {}));
|
package/build/writer/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./writer-model.schema"), exports);
|
|
17
18
|
__exportStar(require("./writer-config.schema"), exports);
|
|
18
19
|
__exportStar(require("./writer-ai-action.schema"), exports);
|
|
19
20
|
__exportStar(require("./writer-document-outline.schema"), exports);
|
|
@@ -4,8 +4,10 @@ exports.WriterConfigSchema = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const writer_document_type_schema_1 = require("./writer-document-type.schema");
|
|
6
6
|
const writer_ai_action_schema_1 = require("./writer-ai-action.schema");
|
|
7
|
+
const writer_model_schema_1 = require("./writer-model.schema");
|
|
7
8
|
exports.WriterConfigSchema = zod_1.z.object({
|
|
8
9
|
maxPromptLength: zod_1.z.number(),
|
|
9
10
|
documentTypes: zod_1.z.array(writer_document_type_schema_1.WriterDocumentTypeSchema),
|
|
10
11
|
aiActions: zod_1.z.array(writer_ai_action_schema_1.WriterAiActionSchema),
|
|
12
|
+
models: zod_1.z.array(writer_model_schema_1.WriterModelSchema),
|
|
11
13
|
});
|
|
@@ -12,6 +12,7 @@ exports.WriterDocumentTypeSchema = zod_1.z.object({
|
|
|
12
12
|
maxPages: zod_1.z.number(),
|
|
13
13
|
pageRange: zod_1.z.array(zod_1.z.number()),
|
|
14
14
|
needsTableOfContents: zod_1.z.boolean(),
|
|
15
|
+
needsCitations: zod_1.z.boolean(),
|
|
15
16
|
createdAt: zod_1.z.date(),
|
|
16
17
|
updatedAt: zod_1.z.date(),
|
|
17
18
|
});
|
|
@@ -16,6 +16,7 @@ exports.WriterDocumentSchema = zod_1.z.object({
|
|
|
16
16
|
finalMd: zod_1.z.string().nullable(),
|
|
17
17
|
userId: zod_1.z.string().nullable(),
|
|
18
18
|
unregisteredUserId: zod_1.z.string().nullable(),
|
|
19
|
+
modelId: zod_1.z.string().nullable(),
|
|
19
20
|
reaction: zod_1.z.nativeEnum(common_1.USER_REACTION).nullable(),
|
|
20
21
|
pages: zod_1.z.number(),
|
|
21
22
|
isDeleted: zod_1.z.boolean(),
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WriterModelSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const common_1 = require("../../common");
|
|
6
|
+
const common_2 = require("../../common");
|
|
7
|
+
const writer_content_generation_strategy_enum_1 = require("../enums/writer-content-generation-strategy.enum");
|
|
8
|
+
exports.WriterModelSchema = zod_1.z.object({
|
|
9
|
+
uuid: zod_1.z.string(),
|
|
10
|
+
title: zod_1.z.string(),
|
|
11
|
+
description: zod_1.z.string(),
|
|
12
|
+
aiModel: zod_1.z.string(),
|
|
13
|
+
pricePerPage: zod_1.z.number(),
|
|
14
|
+
order: zod_1.z.number(),
|
|
15
|
+
status: zod_1.z.nativeEnum(common_1.TOOL_MODEL_STATUS),
|
|
16
|
+
icons: common_2.IconVariantsSchema,
|
|
17
|
+
strategy: zod_1.z.nativeEnum(writer_content_generation_strategy_enum_1.WRITER_CONTENT_GENERATION_STRATEGY),
|
|
18
|
+
maxInputLength: zod_1.z.number(),
|
|
19
|
+
createdAt: zod_1.z.date(),
|
|
20
|
+
updatedAt: zod_1.z.date(),
|
|
21
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.calculateWriterContentGenerationPrice = calculateWriterContentGenerationPrice;
|
|
4
|
-
function calculateWriterContentGenerationPrice(pages) {
|
|
5
|
-
return Math.max(1, pages);
|
|
4
|
+
function calculateWriterContentGenerationPrice(pages, model) {
|
|
5
|
+
return Math.max(1, pages * model.pricePerPage);
|
|
6
6
|
}
|