@purpleschool/gptbot 0.12.28 → 0.12.30
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/tool.ts +1 -0
- package/api/routes.ts +1 -0
- package/build/api/controllers/http/tool.js +1 -0
- package/build/api/routes.js +1 -0
- package/build/commands/tools/tool/find-grouped-tools.command.js +11 -0
- package/build/commands/tools/tool/index.js +1 -0
- package/build/commands/unregistered-user/create-unregistered-user.command.js +1 -0
- package/build/constants/team-account/enums/team-subscription-feature-key.enum.js +1 -0
- package/build/constants/tool/enums/index.js +1 -0
- package/build/constants/tool/enums/tool-group.enum.js +12 -0
- package/build/models/index.js +1 -0
- package/build/models/subscription.schema.js +0 -1
- package/build/models/tool-group.schema.js +11 -0
- package/commands/tools/tool/find-grouped-tools.command.ts +12 -0
- package/commands/tools/tool/index.ts +1 -0
- package/commands/unregistered-user/create-unregistered-user.command.ts +1 -0
- package/constants/team-account/enums/team-subscription-feature-key.enum.ts +1 -0
- package/constants/tool/enums/index.ts +1 -0
- package/constants/tool/enums/tool-group.enum.ts +8 -0
- package/models/index.ts +1 -0
- package/models/subscription.schema.ts +0 -1
- package/models/tool-group.schema.ts +9 -0
- package/package.json +1 -1
package/api/routes.ts
CHANGED
|
@@ -394,6 +394,7 @@ export const REST_API = {
|
|
|
394
394
|
TOOL: {
|
|
395
395
|
FIND_ALL: `${ROOT}/${CONTROLLERS.TOOL_CONTROLLER}/${CONTROLLERS.TOOL_ROUTES.FIND_ALL}`,
|
|
396
396
|
GET_FORMATTED: `${ROOT}/${CONTROLLERS.TOOL_CONTROLLER}/${CONTROLLERS.TOOL_ROUTES.GET_FORMATTED}`,
|
|
397
|
+
GROUP_ALL: `${ROOT}/${CONTROLLERS.TOOL_CONTROLLER}/${CONTROLLERS.TOOL_ROUTES.GROUP_ALL}`,
|
|
397
398
|
},
|
|
398
399
|
TOOL_JOB_PRIVATE: {
|
|
399
400
|
FIND_BY_UUID: (uuid: string) =>
|
package/build/api/routes.js
CHANGED
|
@@ -349,6 +349,7 @@ exports.REST_API = {
|
|
|
349
349
|
TOOL: {
|
|
350
350
|
FIND_ALL: `${exports.ROOT}/${CONTROLLERS.TOOL_CONTROLLER}/${CONTROLLERS.TOOL_ROUTES.FIND_ALL}`,
|
|
351
351
|
GET_FORMATTED: `${exports.ROOT}/${CONTROLLERS.TOOL_CONTROLLER}/${CONTROLLERS.TOOL_ROUTES.GET_FORMATTED}`,
|
|
352
|
+
GROUP_ALL: `${exports.ROOT}/${CONTROLLERS.TOOL_CONTROLLER}/${CONTROLLERS.TOOL_ROUTES.GROUP_ALL}`,
|
|
352
353
|
},
|
|
353
354
|
TOOL_JOB_PRIVATE: {
|
|
354
355
|
FIND_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.TOOL_JOB_CONTROLLER_PRIVATE}/${CONTROLLERS.TOOL_JOB_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindGroupedToolsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var FindGroupedToolsCommand;
|
|
7
|
+
(function (FindGroupedToolsCommand) {
|
|
8
|
+
FindGroupedToolsCommand.ResponseSchema = zod_1.z.object({
|
|
9
|
+
data: zod_1.z.array(models_1.ToolGroupSchema),
|
|
10
|
+
});
|
|
11
|
+
})(FindGroupedToolsCommand || (exports.FindGroupedToolsCommand = FindGroupedToolsCommand = {}));
|
|
@@ -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("./find-all-tools.command"), exports);
|
|
18
|
+
__exportStar(require("./find-grouped-tools.command"), exports);
|
|
18
19
|
__exportStar(require("./find-formatted-tools.command"), exports);
|
|
@@ -7,6 +7,7 @@ var UnregisteredUserCommand;
|
|
|
7
7
|
UnregisteredUserCommand.ResponseSchema = zod_1.z.object({
|
|
8
8
|
data: zod_1.z.object({
|
|
9
9
|
accessToken: zod_1.z.string(),
|
|
10
|
+
uuid: zod_1.z.string(),
|
|
10
11
|
}),
|
|
11
12
|
});
|
|
12
13
|
})(UnregisteredUserCommand || (exports.UnregisteredUserCommand = UnregisteredUserCommand = {}));
|
|
@@ -6,5 +6,6 @@ var TEAM_SUBSCRIPTION_FEATURE_KEY;
|
|
|
6
6
|
TEAM_SUBSCRIPTION_FEATURE_KEY["TOKENS"] = "tokens";
|
|
7
7
|
TEAM_SUBSCRIPTION_FEATURE_KEY["MAX_TEAM_MEMBERS"] = "max_team_members";
|
|
8
8
|
TEAM_SUBSCRIPTION_FEATURE_KEY["CARRYOVER_PERCENT"] = "carryover_percent";
|
|
9
|
+
TEAM_SUBSCRIPTION_FEATURE_KEY["PRODUCT_DISCOUNT_PERCENT"] = "product_discount_percent";
|
|
9
10
|
TEAM_SUBSCRIPTION_FEATURE_KEY["ALL_MODELS_ACCESS"] = "all_models_access";
|
|
10
11
|
})(TEAM_SUBSCRIPTION_FEATURE_KEY || (exports.TEAM_SUBSCRIPTION_FEATURE_KEY = TEAM_SUBSCRIPTION_FEATURE_KEY = {}));
|
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./tool-content-type.enum"), exports);
|
|
18
|
+
__exportStar(require("./tool-group.enum"), exports);
|
|
18
19
|
__exportStar(require("./tool-job-status.enum"), exports);
|
|
19
20
|
__exportStar(require("./job-request-origin.enum"), exports);
|
|
20
21
|
__exportStar(require("./tool-type.enum"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TOOL_GROUP = void 0;
|
|
4
|
+
var TOOL_GROUP;
|
|
5
|
+
(function (TOOL_GROUP) {
|
|
6
|
+
TOOL_GROUP["TEXT"] = "TEXT";
|
|
7
|
+
TOOL_GROUP["IMAGE"] = "IMAGE";
|
|
8
|
+
TOOL_GROUP["AUDIO"] = "AUDIO";
|
|
9
|
+
TOOL_GROUP["VIDEO"] = "VIDEO";
|
|
10
|
+
TOOL_GROUP["EDUCATION"] = "EDUCATION";
|
|
11
|
+
TOOL_GROUP["DESIGN"] = "DESIGN";
|
|
12
|
+
})(TOOL_GROUP || (exports.TOOL_GROUP = TOOL_GROUP = {}));
|
package/build/models/index.js
CHANGED
|
@@ -51,6 +51,7 @@ __exportStar(require("./subscription-upgrade-schema"), exports);
|
|
|
51
51
|
__exportStar(require("./subscription.schema"), exports);
|
|
52
52
|
__exportStar(require("./telegram-user-data.schema"), exports);
|
|
53
53
|
__exportStar(require("./tool-job.schema"), exports);
|
|
54
|
+
__exportStar(require("./tool-group.schema"), exports);
|
|
54
55
|
__exportStar(require("./tool.schema"), exports);
|
|
55
56
|
__exportStar(require("./unlocked-by-subscription.schema"), exports);
|
|
56
57
|
__exportStar(require("./unregistered-user.schema"), exports);
|
|
@@ -11,7 +11,6 @@ exports.SubscriptionSchema = zod_1.z.object({
|
|
|
11
11
|
name: zod_1.z.string().min(3).max(16384),
|
|
12
12
|
requests: zod_1.z.number(),
|
|
13
13
|
price: zod_1.z.number(),
|
|
14
|
-
productDiscountPercent: zod_1.z.number().optional(),
|
|
15
14
|
billingScope: zod_1.z.nativeEnum(constants_1.BILLING_SCOPE),
|
|
16
15
|
plan: zod_1.z.nativeEnum(constants_1.SUBSCRIPTION_PLAN),
|
|
17
16
|
type: zod_1.z.nativeEnum(constants_1.SUBSCRIPTION_TYPE),
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ToolGroupSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
const tool_schema_1 = require("./tool.schema");
|
|
7
|
+
exports.ToolGroupSchema = zod_1.z.object({
|
|
8
|
+
group: zod_1.z.nativeEnum(constants_1.TOOL_GROUP),
|
|
9
|
+
title: zod_1.z.string(),
|
|
10
|
+
tools: zod_1.z.array(tool_schema_1.ToolSchema),
|
|
11
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ToolGroupSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindGroupedToolsCommand {
|
|
5
|
+
export type Request = void;
|
|
6
|
+
|
|
7
|
+
export const ResponseSchema = z.object({
|
|
8
|
+
data: z.array(ToolGroupSchema),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
12
|
+
}
|
package/models/index.ts
CHANGED
|
@@ -35,6 +35,7 @@ export * from './subscription-upgrade-schema';
|
|
|
35
35
|
export * from './subscription.schema';
|
|
36
36
|
export * from './telegram-user-data.schema';
|
|
37
37
|
export * from './tool-job.schema';
|
|
38
|
+
export * from './tool-group.schema';
|
|
38
39
|
export * from './tool.schema';
|
|
39
40
|
export * from './unlocked-by-subscription.schema';
|
|
40
41
|
export * from './unregistered-user.schema';
|
|
@@ -14,7 +14,6 @@ export const SubscriptionSchema = z.object({
|
|
|
14
14
|
name: z.string().min(3).max(16384),
|
|
15
15
|
requests: z.number(),
|
|
16
16
|
price: z.number(),
|
|
17
|
-
productDiscountPercent: z.number().optional(),
|
|
18
17
|
billingScope: z.nativeEnum(BILLING_SCOPE),
|
|
19
18
|
plan: z.nativeEnum(SUBSCRIPTION_PLAN),
|
|
20
19
|
type: z.nativeEnum(SUBSCRIPTION_TYPE),
|