@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.
@@ -6,6 +6,7 @@ export const FILE_ROUTES = {
6
6
  UPLOAD: 'upload',
7
7
  UPLOAD_FILE: 'upload-file',
8
8
  UPLOAD_IMAGE: 'upload-image',
9
+ CALCULATE_TEXT_FILE_COST: (uuid: string) => `cost/text/${uuid}`,
9
10
  CRON: {
10
11
  DELETE_UNUSED: 'cron/delete-unused',
11
12
  },
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)}`,
@@ -8,6 +8,7 @@ exports.FILE_ROUTES = {
8
8
  UPLOAD: 'upload',
9
9
  UPLOAD_FILE: 'upload-file',
10
10
  UPLOAD_IMAGE: 'upload-image',
11
+ CALCULATE_TEXT_FILE_COST: (uuid) => `cost/text/${uuid}`,
11
12
  CRON: {
12
13
  DELETE_UNUSED: 'cron/delete-unused',
13
14
  },
@@ -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
+ }
@@ -1,2 +1,3 @@
1
1
  export * from './delete-user-file.command';
2
2
  export * from './upload.command';
3
+ export * from './calculate-file-cost.command';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.7.10",
3
+ "version": "0.7.11",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",