@purpleschool/gptbot 0.13.30 → 0.13.32

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.
@@ -0,0 +1,5 @@
1
+ export const CANVAS_CRON_PRIVATE_CONTROLLER = 'private/canvas/cron' as const;
2
+
3
+ export const CANVAS_CRON_ROUTES = {
4
+ RECOVER_STALE_NODES: 'recover-stale-nodes',
5
+ } as const;
@@ -4,6 +4,7 @@ export const FILE_PUBLIC_CONTROLLER = 'public/file' as const;
4
4
  export const FILE_ROUTES = {
5
5
  DELETE: (uuid: string) => `${uuid}`,
6
6
  UPLOAD: 'upload',
7
+ UPLOAD_PUBLIC: 'upload-public',
7
8
  UPLOAD_FILE: 'upload-file',
8
9
  UPLOAD_IMAGE: 'upload-image',
9
10
  CALCULATE_TEXT_FILE_COST: (uuid: string) => `cost/text/${uuid}`,
@@ -6,6 +6,7 @@ export * from './ai-vendor';
6
6
  export * from './auth';
7
7
  export * from './blog';
8
8
  export * from './canvas';
9
+ export * from './canvas-cron';
9
10
  export * from './canvas-node-definition';
10
11
  export * from './canvas-node';
11
12
  export * from './canvas-edge';
package/api/routes.ts CHANGED
@@ -580,6 +580,9 @@ export const REST_API = {
580
580
  DELETE: (uuid: string) =>
581
581
  `${ROOT}/${CONTROLLERS.CANVAS_PRIVATE_CONTROLLER}/${CONTROLLERS.CANVAS_ROUTES.DELETE(uuid)}`,
582
582
  },
583
+ CANVAS_CRON: {
584
+ RECOVER_STALE_NODES: `${ROOT}/${CONTROLLERS.CANVAS_CRON_PRIVATE_CONTROLLER}/${CONTROLLERS.CANVAS_CRON_ROUTES.RECOVER_STALE_NODES}`,
585
+ },
583
586
  USER_TO_PRODUCT: {
584
587
  FIND_BY_UUID: (uuid: string) =>
585
588
  `${ROOT}/${CONTROLLERS.USER_TO_PRODUCT_CONTROLLER}/${CONTROLLERS.USER_TO_PRODUCT_ROUTES.FIND_BY_UUID(uuid)}`,
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CANVAS_CRON_ROUTES = exports.CANVAS_CRON_PRIVATE_CONTROLLER = void 0;
4
+ exports.CANVAS_CRON_PRIVATE_CONTROLLER = 'private/canvas/cron';
5
+ exports.CANVAS_CRON_ROUTES = {
6
+ RECOVER_STALE_NODES: 'recover-stale-nodes',
7
+ };
@@ -6,6 +6,7 @@ exports.FILE_PUBLIC_CONTROLLER = 'public/file';
6
6
  exports.FILE_ROUTES = {
7
7
  DELETE: (uuid) => `${uuid}`,
8
8
  UPLOAD: 'upload',
9
+ UPLOAD_PUBLIC: 'upload-public',
9
10
  UPLOAD_FILE: 'upload-file',
10
11
  UPLOAD_IMAGE: 'upload-image',
11
12
  CALCULATE_TEXT_FILE_COST: (uuid) => `cost/text/${uuid}`,
@@ -22,6 +22,7 @@ __exportStar(require("./ai-vendor"), exports);
22
22
  __exportStar(require("./auth"), exports);
23
23
  __exportStar(require("./blog"), exports);
24
24
  __exportStar(require("./canvas"), exports);
25
+ __exportStar(require("./canvas-cron"), exports);
25
26
  __exportStar(require("./canvas-node-definition"), exports);
26
27
  __exportStar(require("./canvas-node"), exports);
27
28
  __exportStar(require("./canvas-edge"), exports);
@@ -454,6 +454,9 @@ exports.REST_API = {
454
454
  UPDATE: (uuid) => `${exports.ROOT}/${CONTROLLERS.CANVAS_PRIVATE_CONTROLLER}/${CONTROLLERS.CANVAS_ROUTES.UPDATE(uuid)}`,
455
455
  DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.CANVAS_PRIVATE_CONTROLLER}/${CONTROLLERS.CANVAS_ROUTES.DELETE(uuid)}`,
456
456
  },
457
+ CANVAS_CRON: {
458
+ RECOVER_STALE_NODES: `${exports.ROOT}/${CONTROLLERS.CANVAS_CRON_PRIVATE_CONTROLLER}/${CONTROLLERS.CANVAS_CRON_ROUTES.RECOVER_STALE_NODES}`,
459
+ },
457
460
  USER_TO_PRODUCT: {
458
461
  FIND_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_TO_PRODUCT_CONTROLLER}/${CONTROLLERS.USER_TO_PRODUCT_ROUTES.FIND_BY_UUID(uuid)}`,
459
462
  UPDATE: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_TO_PRODUCT_CONTROLLER}/${CONTROLLERS.USER_TO_PRODUCT_ROUTES.UPDATE(uuid)}`,
@@ -22,4 +22,5 @@ __exportStar(require("./agent-tool-status.enum"), exports);
22
22
  __exportStar(require("./agent-document-status.enum"), exports);
23
23
  __exportStar(require("./dialog-status.enum"), exports);
24
24
  __exportStar(require("./message-sender-type.enum"), exports);
25
+ __exportStar(require("./message-file-type.enum"), exports);
25
26
  __exportStar(require("./url-ingestion-strategy.enum"), exports);
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MESSAGE_FILE_TYPE = void 0;
4
+ var MESSAGE_FILE_TYPE;
5
+ (function (MESSAGE_FILE_TYPE) {
6
+ MESSAGE_FILE_TYPE["IMAGE"] = "image";
7
+ MESSAGE_FILE_TYPE["DOCUMENT"] = "document";
8
+ MESSAGE_FILE_TYPE["TEXT"] = "text";
9
+ MESSAGE_FILE_TYPE["AUDIO"] = "audio";
10
+ MESSAGE_FILE_TYPE["VIDEO"] = "video";
11
+ MESSAGE_FILE_TYPE["OTHER"] = "other";
12
+ })(MESSAGE_FILE_TYPE || (exports.MESSAGE_FILE_TYPE = MESSAGE_FILE_TYPE = {}));
@@ -16,12 +16,12 @@ exports.FREE_SUBSCRIPTION_DATA = {
16
16
  plan: enums_1.SUBSCRIPTION_PLAN.mock,
17
17
  icons: {
18
18
  light: {
19
- svg: 'https://rugpt.hb.bizmrg.com/images/images/81b60ce5-b687-43ff-85dd-e4e47c8e81e9.svg',
20
- png: 'https://rugpt.hb.bizmrg.com/images/images/e1bb1acd-a387-4596-8fd5-0159f692ff11.png',
19
+ svg: 'https://rugpt.storage.rugpt.io/images/images/81b60ce5-b687-43ff-85dd-e4e47c8e81e9.svg',
20
+ png: 'https://rugpt.storage.rugpt.io/images/images/e1bb1acd-a387-4596-8fd5-0159f692ff11.png',
21
21
  },
22
22
  dark: {
23
- svg: 'https://rugpt.hb.bizmrg.com/images/images/ac095d48-a66b-4862-82c7-eb120b5bd467.svg',
24
- png: 'https://rugpt.hb.bizmrg.com/images/images/e2208949-a73a-4137-b5bd-760599a70691.png',
23
+ svg: 'https://rugpt.storage.rugpt.io/images/images/ac095d48-a66b-4862-82c7-eb120b5bd467.svg',
24
+ png: 'https://rugpt.storage.rugpt.io/images/images/e2208949-a73a-4137-b5bd-760599a70691.png',
25
25
  },
26
26
  },
27
27
  interval: '',
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AgentDialogMessageFileSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const message_file_type_enum_1 = require("../../constants/agents/enums/message-file-type.enum");
6
+ exports.AgentDialogMessageFileSchema = zod_1.z.object({
7
+ id: zod_1.z.string().uuid(),
8
+ url: zod_1.z.string(),
9
+ mimeType: zod_1.z.string(),
10
+ type: zod_1.z.nativeEnum(message_file_type_enum_1.MESSAGE_FILE_TYPE),
11
+ name: zod_1.z.string(),
12
+ originalName: zod_1.z.string().nullable(),
13
+ size: zod_1.z.number().int().nonnegative(),
14
+ });
@@ -3,11 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AgentDialogMessageSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const message_sender_type_enum_1 = require("../../constants/agents/enums/message-sender-type.enum");
6
+ const agent_dialog_message_file_schema_1 = require("./agent-dialog-message-file.schema");
6
7
  exports.AgentDialogMessageSchema = zod_1.z.object({
7
8
  id: zod_1.z.string().uuid(),
8
9
  text: zod_1.z.string().optional(),
9
10
  images: zod_1.z.array(zod_1.z.string()),
10
- attachments: zod_1.z.array(zod_1.z.string()),
11
+ files: zod_1.z.array(agent_dialog_message_file_schema_1.AgentDialogMessageFileSchema),
11
12
  tokensUsed: zod_1.z.number().optional(),
12
13
  senderType: zod_1.z.nativeEnum(message_sender_type_enum_1.MESSAGE_SENDER_TYPE),
13
14
  createdAt: zod_1.z.date(),
@@ -22,6 +22,7 @@ __exportStar(require("./agent-lead-form.schema"), exports);
22
22
  __exportStar(require("./agent-lead.schema"), exports);
23
23
  __exportStar(require("./agent-lead-find-result.schema"), exports);
24
24
  __exportStar(require("./agent-dialog-lead.schema"), exports);
25
+ __exportStar(require("./agent-dialog-message-file.schema"), exports);
25
26
  __exportStar(require("./agent-dialog-message.schema"), exports);
26
27
  __exportStar(require("./dialog-find-result.schema"), exports);
27
28
  __exportStar(require("./dialog-with-messages.schema"), exports);
@@ -6,4 +6,5 @@ export * from './agent-tool-status.enum';
6
6
  export * from './agent-document-status.enum';
7
7
  export * from './dialog-status.enum';
8
8
  export * from './message-sender-type.enum';
9
+ export * from './message-file-type.enum';
9
10
  export * from './url-ingestion-strategy.enum';
@@ -0,0 +1,8 @@
1
+ export enum MESSAGE_FILE_TYPE {
2
+ IMAGE = 'image',
3
+ DOCUMENT = 'document',
4
+ TEXT = 'text',
5
+ AUDIO = 'audio',
6
+ VIDEO = 'video',
7
+ OTHER = 'other',
8
+ }
@@ -19,12 +19,12 @@ export const FREE_SUBSCRIPTION_DATA = {
19
19
  plan: SUBSCRIPTION_PLAN.mock,
20
20
  icons: {
21
21
  light: {
22
- svg: 'https://rugpt.hb.bizmrg.com/images/images/81b60ce5-b687-43ff-85dd-e4e47c8e81e9.svg',
23
- png: 'https://rugpt.hb.bizmrg.com/images/images/e1bb1acd-a387-4596-8fd5-0159f692ff11.png',
22
+ svg: 'https://rugpt.storage.rugpt.io/images/images/81b60ce5-b687-43ff-85dd-e4e47c8e81e9.svg',
23
+ png: 'https://rugpt.storage.rugpt.io/images/images/e1bb1acd-a387-4596-8fd5-0159f692ff11.png',
24
24
  },
25
25
  dark: {
26
- svg: 'https://rugpt.hb.bizmrg.com/images/images/ac095d48-a66b-4862-82c7-eb120b5bd467.svg',
27
- png: 'https://rugpt.hb.bizmrg.com/images/images/e2208949-a73a-4137-b5bd-760599a70691.png',
26
+ svg: 'https://rugpt.storage.rugpt.io/images/images/ac095d48-a66b-4862-82c7-eb120b5bd467.svg',
27
+ png: 'https://rugpt.storage.rugpt.io/images/images/e2208949-a73a-4137-b5bd-760599a70691.png',
28
28
  },
29
29
  },
30
30
  interval: '',
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { MESSAGE_FILE_TYPE } from '../../constants/agents/enums/message-file-type.enum';
3
+
4
+ export const AgentDialogMessageFileSchema = z.object({
5
+ id: z.string().uuid(),
6
+ url: z.string(),
7
+ mimeType: z.string(),
8
+ type: z.nativeEnum(MESSAGE_FILE_TYPE),
9
+ name: z.string(),
10
+ originalName: z.string().nullable(),
11
+ size: z.number().int().nonnegative(),
12
+ });
13
+
14
+ export type AgentDialogMessageFile = z.infer<typeof AgentDialogMessageFileSchema>;
@@ -1,11 +1,12 @@
1
1
  import { z } from 'zod';
2
2
  import { MESSAGE_SENDER_TYPE } from '../../constants/agents/enums/message-sender-type.enum';
3
+ import { AgentDialogMessageFileSchema } from './agent-dialog-message-file.schema';
3
4
 
4
5
  export const AgentDialogMessageSchema = z.object({
5
6
  id: z.string().uuid(),
6
7
  text: z.string().optional(),
7
8
  images: z.array(z.string()),
8
- attachments: z.array(z.string()),
9
+ files: z.array(AgentDialogMessageFileSchema),
9
10
  tokensUsed: z.number().optional(),
10
11
  senderType: z.nativeEnum(MESSAGE_SENDER_TYPE),
11
12
  createdAt: z.date(),
@@ -6,6 +6,7 @@ export * from './agent-lead-form.schema';
6
6
  export * from './agent-lead.schema';
7
7
  export * from './agent-lead-find-result.schema';
8
8
  export * from './agent-dialog-lead.schema';
9
+ export * from './agent-dialog-message-file.schema';
9
10
  export * from './agent-dialog-message.schema';
10
11
  export * from './dialog-find-result.schema';
11
12
  export * from './dialog-with-messages.schema';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.13.30",
3
+ "version": "0.13.32",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",