@purpleschool/gptbot-tools 0.0.3 → 0.0.5

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/index.js CHANGED
@@ -10,10 +10,37 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
10
10
  if (k2 === undefined) k2 = k;
11
11
  o[k2] = m[k];
12
12
  }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
13
18
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
19
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
20
  };
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
16
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.ToolService = void 0;
17
40
  __exportStar(require("./common"), exports);
18
41
  __exportStar(require("./paraphrase"), exports);
19
42
  __exportStar(require("./tools"), exports);
43
+ const Common = __importStar(require("./common"));
44
+ const Paraphrase = __importStar(require("./paraphrase"));
45
+ const Tools = __importStar(require("./tools"));
46
+ exports.ToolService = Object.assign(Object.assign(Object.assign({}, Common), Paraphrase), Tools);
@@ -9,8 +9,8 @@ var ParaphraseCommand;
9
9
  (function (ParaphraseCommand) {
10
10
  ParaphraseCommand.RequestSchema = zod_1.z.object({
11
11
  jobId: zod_1.z.string().uuid(),
12
- userId: zod_1.z.string().uuid().nullable(),
13
- unregisteredUserId: zod_1.z.string().uuid().nullable(),
12
+ userId: zod_1.z.string().uuid().nullable().optional(),
13
+ unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
14
14
  prompt: zod_1.z.string(),
15
15
  modelId: zod_1.z.string().uuid(),
16
16
  styleId: zod_1.z.string().uuid(),
@@ -9,7 +9,7 @@ exports.ParaphraseJobSchema = zod_1.z.object({
9
9
  userInput: zod_1.z.string(),
10
10
  aiOutput: zod_1.z.string().nullable(),
11
11
  aiTokenUsage: zod_1.z.number().nullable(),
12
- cost: zod_1.z.number().nullable(),
12
+ price: zod_1.z.number().nullable(),
13
13
  status: zod_1.z.string(),
14
14
  modelId: zod_1.z.string().nullable(),
15
15
  styleId: zod_1.z.string().nullable(),
@@ -4,6 +4,7 @@ exports.JOB_STATUS = void 0;
4
4
  var JOB_STATUS;
5
5
  (function (JOB_STATUS) {
6
6
  JOB_STATUS["PEDNING"] = "pending";
7
+ JOB_STATUS["PROCESSING"] = "processing";
7
8
  JOB_STATUS["COMPLETED"] = "completed";
8
9
  JOB_STATUS["FAILED"] = "failed";
9
10
  })(JOB_STATUS || (exports.JOB_STATUS = JOB_STATUS = {}));
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./enums"), exports);
18
+ __exportStar(require("./interfaces"), exports);
18
19
  __exportStar(require("./routes"), 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("./tool-job-complete-payload.interface"), exports);
18
+ __exportStar(require("./tool-job-failed-payload.interface"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/index.ts CHANGED
@@ -1,3 +1,13 @@
1
1
  export * from './common';
2
2
  export * from './paraphrase';
3
3
  export * from './tools';
4
+
5
+ import * as Common from './common';
6
+ import * as Paraphrase from './paraphrase';
7
+ import * as Tools from './tools';
8
+
9
+ export const ToolService = {
10
+ ...Common,
11
+ ...Paraphrase,
12
+ ...Tools,
13
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot-tools",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "scripts": {
@@ -6,8 +6,8 @@ import { PARAPHRASING_INTENSITY } from '../enums';
6
6
  export namespace ParaphraseCommand {
7
7
  export const RequestSchema = z.object({
8
8
  jobId: z.string().uuid(),
9
- userId: z.string().uuid().nullable(),
10
- unregisteredUserId: z.string().uuid().nullable(),
9
+ userId: z.string().uuid().nullable().optional(),
10
+ unregisteredUserId: z.string().uuid().nullable().optional(),
11
11
  prompt: z.string(),
12
12
  modelId: z.string().uuid(),
13
13
  styleId: z.string().uuid(),
@@ -7,7 +7,7 @@ export const ParaphraseJobSchema = z.object({
7
7
  userInput: z.string(),
8
8
  aiOutput: z.string().nullable(),
9
9
  aiTokenUsage: z.number().nullable(),
10
- cost: z.number().nullable(),
10
+ price: z.number().nullable(),
11
11
  status: z.string(),
12
12
  modelId: z.string().nullable(),
13
13
  styleId: z.string().nullable(),
@@ -1,5 +1,6 @@
1
1
  export enum JOB_STATUS {
2
2
  PEDNING = 'pending',
3
+ PROCESSING = 'processing',
3
4
  COMPLETED = 'completed',
4
5
  FAILED = 'failed',
5
6
  }
package/tools/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './enums';
2
+ export * from './interfaces';
2
3
  export * from './routes';
@@ -0,0 +1,2 @@
1
+ export * from './tool-job-complete-payload.interface';
2
+ export * from './tool-job-failed-payload.interface';
@@ -0,0 +1,4 @@
1
+ export interface IToolJobCompletePayload {
2
+ jobId: string;
3
+ price: number;
4
+ }
@@ -0,0 +1,4 @@
1
+ export interface IToolJobFailedPayload {
2
+ jobId: string;
3
+ error: string;
4
+ }