@purpleschool/gptbot 0.7.10 → 0.7.11
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/files.ts +1 -0
- package/api/routes.ts +2 -0
- package/build/api/controllers/http/files.js +1 -0
- package/build/api/routes.js +1 -0
- package/build/commands/file/calculate-file-cost.command.js +17 -0
- package/build/commands/file/index.js +1 -0
- package/commands/file/calculate-file-cost.command.ts +22 -0
- package/commands/file/index.ts +1 -0
- package/package.json +1 -1
package/api/routes.ts
CHANGED
|
@@ -146,6 +146,8 @@ export const REST_API = {
|
|
|
146
146
|
FILES: {
|
|
147
147
|
UPLOAD_FILE: `${ROOT}/${CONTROLLERS.FILE_CONTROLLER}/${CONTROLLERS.FILE_ROUTES.UPLOAD_FILE}`,
|
|
148
148
|
UPLOAD_IMAGE: `${ROOT}/${CONTROLLERS.FILE_CONTROLLER}/${CONTROLLERS.FILE_ROUTES.UPLOAD_IMAGE}`,
|
|
149
|
+
CALCULATE_TEXT_FILE_COST: (uuid: string) =>
|
|
150
|
+
`${ROOT}/${CONTROLLERS.FILE_CONTROLLER}/${CONTROLLERS.FILE_ROUTES.CALCULATE_TEXT_FILE_COST(uuid)}`,
|
|
149
151
|
},
|
|
150
152
|
BLOG_ARTICLES: {
|
|
151
153
|
CREATE: `${ROOT}/${CONTROLLERS.BLOG_CONTROLLER(POST_TYPE.ARTICLE)}`,
|
package/build/api/routes.js
CHANGED
|
@@ -154,6 +154,7 @@ exports.REST_API = {
|
|
|
154
154
|
FILES: {
|
|
155
155
|
UPLOAD_FILE: `${exports.ROOT}/${CONTROLLERS.FILE_CONTROLLER}/${CONTROLLERS.FILE_ROUTES.UPLOAD_FILE}`,
|
|
156
156
|
UPLOAD_IMAGE: `${exports.ROOT}/${CONTROLLERS.FILE_CONTROLLER}/${CONTROLLERS.FILE_ROUTES.UPLOAD_IMAGE}`,
|
|
157
|
+
CALCULATE_TEXT_FILE_COST: (uuid) => `${exports.ROOT}/${CONTROLLERS.FILE_CONTROLLER}/${CONTROLLERS.FILE_ROUTES.CALCULATE_TEXT_FILE_COST(uuid)}`,
|
|
157
158
|
},
|
|
158
159
|
BLOG_ARTICLES: {
|
|
159
160
|
CREATE: `${exports.ROOT}/${CONTROLLERS.BLOG_CONTROLLER(constants_1.POST_TYPE.ARTICLE)}`,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CalculateFileCostCommand = void 0;
|
|
4
|
+
const models_1 = require("../../models");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
var CalculateFileCostCommand;
|
|
7
|
+
(function (CalculateFileCostCommand) {
|
|
8
|
+
CalculateFileCostCommand.RequestParamSchema = models_1.FileSchema.pick({
|
|
9
|
+
uuid: true,
|
|
10
|
+
});
|
|
11
|
+
CalculateFileCostCommand.RequestSchema = zod_1.z.object({
|
|
12
|
+
model: zod_1.z.string(),
|
|
13
|
+
});
|
|
14
|
+
CalculateFileCostCommand.ResponseSchema = zod_1.z.object({
|
|
15
|
+
data: models_1.FileSchema,
|
|
16
|
+
});
|
|
17
|
+
})(CalculateFileCostCommand || (exports.CalculateFileCostCommand = CalculateFileCostCommand = {}));
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./delete-user-file.command"), exports);
|
|
18
18
|
__exportStar(require("./upload.command"), exports);
|
|
19
|
+
__exportStar(require("./calculate-file-cost.command"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FileSchema } from '../../models';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
export namespace CalculateFileCostCommand {
|
|
5
|
+
export const RequestParamSchema = FileSchema.pick({
|
|
6
|
+
uuid: true,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
10
|
+
|
|
11
|
+
export const RequestSchema = z.object({
|
|
12
|
+
model: z.string(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
16
|
+
|
|
17
|
+
export const ResponseSchema = z.object({
|
|
18
|
+
data: FileSchema,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
22
|
+
}
|
package/commands/file/index.ts
CHANGED