@purpleschool/gptbot 0.6.16 → 0.6.18
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/prompt-category.ts +2 -1
- package/api/controllers/http/prompt-topic.ts +4 -2
- package/api/controllers/http/subscription.ts +1 -0
- package/api/routes.ts +8 -2
- package/build/api/controllers/http/prompt-category.js +2 -1
- package/build/api/controllers/http/prompt-topic.js +4 -2
- package/build/api/controllers/http/subscription.js +1 -0
- package/build/api/routes.js +4 -1
- package/build/commands/prompt-category/find-prompt-category-by-uuid.command.js +14 -0
- package/build/commands/prompt-category/index.js +1 -0
- package/build/commands/prompt-topic/find-prompt-topic-by-category.command.js +2 -1
- package/build/commands/prompt-topic/find-prompt-topic-by-uuid.command.js +14 -0
- package/build/commands/prompt-topic/index.js +1 -0
- package/build/commands/subscription/index.js +1 -0
- package/build/commands/subscription/recover-past-due-subscription.command.js +13 -0
- package/build/constants/errors/errors.js +5 -0
- package/build/constants/subscription/enums/user-to-subscription-marks.enum.js +1 -0
- package/commands/prompt-category/find-prompt-category-by-uuid.command.ts +16 -0
- package/commands/prompt-category/index.ts +1 -0
- package/commands/prompt-topic/find-prompt-topic-by-category.command.ts +2 -1
- package/commands/prompt-topic/find-prompt-topic-by-uuid.command.ts +16 -0
- package/commands/prompt-topic/index.ts +1 -0
- package/commands/subscription/index.ts +1 -0
- package/commands/subscription/recover-past-due-subscription.command.ts +15 -0
- package/constants/errors/errors.ts +5 -0
- package/constants/subscription/enums/user-to-subscription-marks.enum.ts +1 -0
- package/package.json +1 -1
|
@@ -6,5 +6,6 @@ export const PROMPT_CATEGORY_ROUTES = {
|
|
|
6
6
|
UPDATE: (uuid: string) => `${uuid}`,
|
|
7
7
|
DELETE: (uuid: string) => `${uuid}`,
|
|
8
8
|
FIND_ALL: '',
|
|
9
|
-
FIND_BY_ALIAS: (alias: string) =>
|
|
9
|
+
FIND_BY_ALIAS: (alias: string) => `alias/${alias}`,
|
|
10
|
+
FIND_BY_UUID: (uuid: string) => `uuid/${uuid}`,
|
|
10
11
|
} as const;
|
|
@@ -5,7 +5,9 @@ export const PROMPT_TOPIC_ROUTES = {
|
|
|
5
5
|
CREATE: '',
|
|
6
6
|
UPDATE: (uuid: string) => `${uuid}`,
|
|
7
7
|
DELETE: (uuid: string) => `${uuid}`,
|
|
8
|
-
|
|
8
|
+
FIND_BY_CATEGORY_ALIAS: (categoryAlias: string) => `find/alias/${categoryAlias}`,
|
|
9
|
+
FIND_BY_CATEGORY_UUID: (categoryUuid: string) => `find/uuid/${categoryUuid}`,
|
|
9
10
|
FIND_ALL: '',
|
|
10
|
-
FIND_BY_ALIAS: (alias: string) =>
|
|
11
|
+
FIND_BY_ALIAS: (alias: string) => `alias/${alias}`,
|
|
12
|
+
FIND_BY_UUID: (uuid: string) => `uuid/${uuid}`,
|
|
11
13
|
} as const;
|
package/api/routes.ts
CHANGED
|
@@ -213,6 +213,8 @@ export const REST_API = {
|
|
|
213
213
|
FIND_ALL: `${ROOT}/${CONTROLLERS.PROMPT_CATEGORY_PUBLIC_CONTROLLER}/${CONTROLLERS.PROMPT_CATEGORY_ROUTES.FIND_ALL}`,
|
|
214
214
|
FIND_BY_ALIAS: (alias: string) =>
|
|
215
215
|
`${ROOT}/${CONTROLLERS.PROMPT_CATEGORY_PUBLIC_CONTROLLER}/${CONTROLLERS.PROMPT_CATEGORY_ROUTES.FIND_BY_ALIAS(alias)}`,
|
|
216
|
+
FIND_BY_UUID: (uuid: string) =>
|
|
217
|
+
`${ROOT}/${CONTROLLERS.PROMPT_CATEGORY_PUBLIC_CONTROLLER}/${CONTROLLERS.PROMPT_CATEGORY_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
216
218
|
},
|
|
217
219
|
PROMPT_TOPIC_PRIVATE: {
|
|
218
220
|
CREATE: `${ROOT}/${CONTROLLERS.PROMPT_TOPIC_PRIVATE_CONTROLLER}/${CONTROLLERS.PROMPT_TOPIC_ROUTES.CREATE}`,
|
|
@@ -222,10 +224,14 @@ export const REST_API = {
|
|
|
222
224
|
`${ROOT}/${CONTROLLERS.PROMPT_TOPIC_PRIVATE_CONTROLLER}/${CONTROLLERS.PROMPT_TOPIC_ROUTES.DELETE(uuid)}`,
|
|
223
225
|
},
|
|
224
226
|
PROMPT_TOPIC_PUBLIC: {
|
|
225
|
-
|
|
226
|
-
`${ROOT}/${CONTROLLERS.PROMPT_TOPIC_PUBLIC_CONTROLLER}/${CONTROLLERS.PROMPT_TOPIC_ROUTES.
|
|
227
|
+
FIND_BY_CATEGORY_ALIAS: (categoryAlias: string) =>
|
|
228
|
+
`${ROOT}/${CONTROLLERS.PROMPT_TOPIC_PUBLIC_CONTROLLER}/${CONTROLLERS.PROMPT_TOPIC_ROUTES.FIND_BY_CATEGORY_ALIAS(categoryAlias)}`,
|
|
229
|
+
FIND_BY_CATEGORY_UUID: (categoryUuid: string) =>
|
|
230
|
+
`${ROOT}/${CONTROLLERS.PROMPT_TOPIC_PUBLIC_CONTROLLER}/${CONTROLLERS.PROMPT_TOPIC_ROUTES.FIND_BY_CATEGORY_UUID(categoryUuid)}`,
|
|
227
231
|
FIND_BY_ALIAS: (alias: string) =>
|
|
228
232
|
`${ROOT}/${CONTROLLERS.PROMPT_TOPIC_PUBLIC_CONTROLLER}/${CONTROLLERS.PROMPT_TOPIC_ROUTES.FIND_BY_ALIAS(alias)}`,
|
|
233
|
+
FIND_BY_UUID: (uuid: string) =>
|
|
234
|
+
`${ROOT}/${CONTROLLERS.PROMPT_TOPIC_PUBLIC_CONTROLLER}/${CONTROLLERS.PROMPT_TOPIC_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
229
235
|
FIND_ALL: `${ROOT}/${CONTROLLERS.PROMPT_TOPIC_PUBLIC_CONTROLLER}/${CONTROLLERS.PROMPT_TOPIC_ROUTES.FIND_ALL}`,
|
|
230
236
|
},
|
|
231
237
|
PROMPT_PRIVATE: {
|
|
@@ -7,7 +7,9 @@ exports.PROMPT_TOPIC_ROUTES = {
|
|
|
7
7
|
CREATE: '',
|
|
8
8
|
UPDATE: (uuid) => `${uuid}`,
|
|
9
9
|
DELETE: (uuid) => `${uuid}`,
|
|
10
|
-
|
|
10
|
+
FIND_BY_CATEGORY_ALIAS: (categoryAlias) => `find/alias/${categoryAlias}`,
|
|
11
|
+
FIND_BY_CATEGORY_UUID: (categoryUuid) => `find/uuid/${categoryUuid}`,
|
|
11
12
|
FIND_ALL: '',
|
|
12
|
-
FIND_BY_ALIAS: (alias) =>
|
|
13
|
+
FIND_BY_ALIAS: (alias) => `alias/${alias}`,
|
|
14
|
+
FIND_BY_UUID: (uuid) => `uuid/${uuid}`,
|
|
13
15
|
};
|
package/build/api/routes.js
CHANGED
|
@@ -206,6 +206,7 @@ exports.REST_API = {
|
|
|
206
206
|
PROMPT_CATEGORY_PUBLIC: {
|
|
207
207
|
FIND_ALL: `${exports.ROOT}/${CONTROLLERS.PROMPT_CATEGORY_PUBLIC_CONTROLLER}/${CONTROLLERS.PROMPT_CATEGORY_ROUTES.FIND_ALL}`,
|
|
208
208
|
FIND_BY_ALIAS: (alias) => `${exports.ROOT}/${CONTROLLERS.PROMPT_CATEGORY_PUBLIC_CONTROLLER}/${CONTROLLERS.PROMPT_CATEGORY_ROUTES.FIND_BY_ALIAS(alias)}`,
|
|
209
|
+
FIND_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.PROMPT_CATEGORY_PUBLIC_CONTROLLER}/${CONTROLLERS.PROMPT_CATEGORY_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
209
210
|
},
|
|
210
211
|
PROMPT_TOPIC_PRIVATE: {
|
|
211
212
|
CREATE: `${exports.ROOT}/${CONTROLLERS.PROMPT_TOPIC_PRIVATE_CONTROLLER}/${CONTROLLERS.PROMPT_TOPIC_ROUTES.CREATE}`,
|
|
@@ -213,8 +214,10 @@ exports.REST_API = {
|
|
|
213
214
|
DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.PROMPT_TOPIC_PRIVATE_CONTROLLER}/${CONTROLLERS.PROMPT_TOPIC_ROUTES.DELETE(uuid)}`,
|
|
214
215
|
},
|
|
215
216
|
PROMPT_TOPIC_PUBLIC: {
|
|
216
|
-
|
|
217
|
+
FIND_BY_CATEGORY_ALIAS: (categoryAlias) => `${exports.ROOT}/${CONTROLLERS.PROMPT_TOPIC_PUBLIC_CONTROLLER}/${CONTROLLERS.PROMPT_TOPIC_ROUTES.FIND_BY_CATEGORY_ALIAS(categoryAlias)}`,
|
|
218
|
+
FIND_BY_CATEGORY_UUID: (categoryUuid) => `${exports.ROOT}/${CONTROLLERS.PROMPT_TOPIC_PUBLIC_CONTROLLER}/${CONTROLLERS.PROMPT_TOPIC_ROUTES.FIND_BY_CATEGORY_UUID(categoryUuid)}`,
|
|
217
219
|
FIND_BY_ALIAS: (alias) => `${exports.ROOT}/${CONTROLLERS.PROMPT_TOPIC_PUBLIC_CONTROLLER}/${CONTROLLERS.PROMPT_TOPIC_ROUTES.FIND_BY_ALIAS(alias)}`,
|
|
220
|
+
FIND_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.PROMPT_TOPIC_PUBLIC_CONTROLLER}/${CONTROLLERS.PROMPT_TOPIC_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
218
221
|
FIND_ALL: `${exports.ROOT}/${CONTROLLERS.PROMPT_TOPIC_PUBLIC_CONTROLLER}/${CONTROLLERS.PROMPT_TOPIC_ROUTES.FIND_ALL}`,
|
|
219
222
|
},
|
|
220
223
|
PROMPT_PRIVATE: {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindPromptCategoryByUuidCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var FindPromptCategoryByUuidCommand;
|
|
7
|
+
(function (FindPromptCategoryByUuidCommand) {
|
|
8
|
+
FindPromptCategoryByUuidCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
uuid: zod_1.z.string().uuid(),
|
|
10
|
+
});
|
|
11
|
+
FindPromptCategoryByUuidCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: models_1.PromptCategorySchema,
|
|
13
|
+
});
|
|
14
|
+
})(FindPromptCategoryByUuidCommand || (exports.FindPromptCategoryByUuidCommand = FindPromptCategoryByUuidCommand = {}));
|
|
@@ -19,3 +19,4 @@ __exportStar(require("./delete-prompt-category.command"), exports);
|
|
|
19
19
|
__exportStar(require("./update-prompt-category.command"), exports);
|
|
20
20
|
__exportStar(require("./find-all-prompt-categories.command"), exports);
|
|
21
21
|
__exportStar(require("./find-prompt-category-by-alias.command"), exports);
|
|
22
|
+
__exportStar(require("./find-prompt-category-by-uuid.command"), exports);
|
|
@@ -9,7 +9,8 @@ const models_1 = require("../../models");
|
|
|
9
9
|
var FindPromptTopicsByCategoryCommand;
|
|
10
10
|
(function (FindPromptTopicsByCategoryCommand) {
|
|
11
11
|
FindPromptTopicsByCategoryCommand.RequestParamSchema = zod_1.default.object({
|
|
12
|
-
categoryAlias: zod_1.default.string(),
|
|
12
|
+
categoryAlias: zod_1.default.string().optional(),
|
|
13
|
+
categoryUuid: zod_1.default.string().uuid().optional(),
|
|
13
14
|
});
|
|
14
15
|
FindPromptTopicsByCategoryCommand.RequestSchema = zod_1.default.object({
|
|
15
16
|
limit: zod_1.default.string().transform((val) => parseInt(val, 10)),
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindPromptTopicByUuidCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var FindPromptTopicByUuidCommand;
|
|
7
|
+
(function (FindPromptTopicByUuidCommand) {
|
|
8
|
+
FindPromptTopicByUuidCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
uuid: zod_1.z.string().uuid(),
|
|
10
|
+
});
|
|
11
|
+
FindPromptTopicByUuidCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: models_1.PromptTopicSchema,
|
|
13
|
+
});
|
|
14
|
+
})(FindPromptTopicByUuidCommand || (exports.FindPromptTopicByUuidCommand = FindPromptTopicByUuidCommand = {}));
|
|
@@ -20,3 +20,4 @@ __exportStar(require("./update-prompt-topic.command"), exports);
|
|
|
20
20
|
__exportStar(require("./find-prompt-topic-by-category.command"), exports);
|
|
21
21
|
__exportStar(require("./find-prompt-topic-by-alias.command"), exports);
|
|
22
22
|
__exportStar(require("./find-all-prompt-topics.command"), exports);
|
|
23
|
+
__exportStar(require("./find-prompt-topic-by-uuid.command"), exports);
|
|
@@ -23,6 +23,7 @@ __exportStar(require("./find-subscription.command"), exports);
|
|
|
23
23
|
__exportStar(require("./get-available-upgrades.command"), exports);
|
|
24
24
|
__exportStar(require("./get-free-subscription.command"), exports);
|
|
25
25
|
__exportStar(require("./get-subscriptions-summary.command"), exports);
|
|
26
|
+
__exportStar(require("./recover-past-due-subscription.command"), exports);
|
|
26
27
|
__exportStar(require("./recover-subscription.command"), exports);
|
|
27
28
|
__exportStar(require("./update-subscription.command"), exports);
|
|
28
29
|
__exportStar(require("./upgrade-subscription.command"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RecoverPastDueSubscriptionCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var RecoverPastDueSubscriptionCommand;
|
|
6
|
+
(function (RecoverPastDueSubscriptionCommand) {
|
|
7
|
+
RecoverPastDueSubscriptionCommand.RequestParamSchema = zod_1.z.object({
|
|
8
|
+
uuid: zod_1.z.string().uuid(),
|
|
9
|
+
});
|
|
10
|
+
RecoverPastDueSubscriptionCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
message: zod_1.z.string(),
|
|
12
|
+
});
|
|
13
|
+
})(RecoverPastDueSubscriptionCommand || (exports.RecoverPastDueSubscriptionCommand = RecoverPastDueSubscriptionCommand = {}));
|
|
@@ -6,4 +6,5 @@ var USER_TO_SUBSCRIPTION_MARKS;
|
|
|
6
6
|
USER_TO_SUBSCRIPTION_MARKS["WITHOUT_AUTO_RENEWAL"] = "WITHOUT_AUTO_RENEWAL";
|
|
7
7
|
USER_TO_SUBSCRIPTION_MARKS["MOCK"] = "MOCK";
|
|
8
8
|
USER_TO_SUBSCRIPTION_MARKS["SENT_RENEWAL_REMINDER"] = "SENT_RENEWAL_REMINDER";
|
|
9
|
+
USER_TO_SUBSCRIPTION_MARKS["SENT_PAST_DUE_RECOVER_REQUEST"] = "SENT_PAST_DUE_RECOVER_REQUEST";
|
|
9
10
|
})(USER_TO_SUBSCRIPTION_MARKS || (exports.USER_TO_SUBSCRIPTION_MARKS = USER_TO_SUBSCRIPTION_MARKS = {}));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PromptCategorySchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindPromptCategoryByUuidCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
uuid: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
data: PromptCategorySchema,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
}
|
|
@@ -3,7 +3,8 @@ import { PromptTopicWithPromptsSchema } from '../../models';
|
|
|
3
3
|
|
|
4
4
|
export namespace FindPromptTopicsByCategoryCommand {
|
|
5
5
|
export const RequestParamSchema = z.object({
|
|
6
|
-
categoryAlias: z.string(),
|
|
6
|
+
categoryAlias: z.string().optional(),
|
|
7
|
+
categoryUuid: z.string().uuid().optional(),
|
|
7
8
|
});
|
|
8
9
|
|
|
9
10
|
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PromptTopicSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindPromptTopicByUuidCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
uuid: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
data: PromptTopicSchema,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
}
|
|
@@ -7,6 +7,7 @@ export * from './find-subscription.command';
|
|
|
7
7
|
export * from './get-available-upgrades.command';
|
|
8
8
|
export * from './get-free-subscription.command';
|
|
9
9
|
export * from './get-subscriptions-summary.command';
|
|
10
|
+
export * from './recover-past-due-subscription.command';
|
|
10
11
|
export * from './recover-subscription.command';
|
|
11
12
|
export * from './update-subscription.command';
|
|
12
13
|
export * from './upgrade-subscription.command';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace RecoverPastDueSubscriptionCommand {
|
|
4
|
+
export const RequestParamSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
9
|
+
|
|
10
|
+
export const ResponseSchema = z.object({
|
|
11
|
+
message: z.string(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
15
|
+
}
|
|
@@ -1500,4 +1500,9 @@ export const ERRORS = {
|
|
|
1500
1500
|
message: 'Промпт тема с таким alias уже существует',
|
|
1501
1501
|
httpCode: 409,
|
|
1502
1502
|
},
|
|
1503
|
+
SUBSCRIPTION_NOT_PAST_DUE: {
|
|
1504
|
+
code: 'A320',
|
|
1505
|
+
message: 'Подписка не требует повторной оплаты',
|
|
1506
|
+
httpCode: 400,
|
|
1507
|
+
},
|
|
1503
1508
|
};
|