@purpleschool/gptbot 0.5.8 → 0.5.14
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/index.ts +11 -8
- package/api/controllers/payment.ts +5 -0
- package/api/controllers/referral.ts +5 -0
- package/api/controllers/subscription.ts +3 -0
- package/build/api/controllers/index.js +11 -8
- package/build/api/controllers/payment.js +7 -0
- package/build/api/controllers/referral.js +7 -0
- package/build/api/controllers/subscription.js +3 -0
- package/build/commands/ai-model/index.js +2 -2
- package/build/commands/auth/index.js +4 -3
- package/build/commands/auth/register-user.command.js +3 -4
- package/build/commands/blog/index.js +2 -2
- package/build/commands/category/index.js +2 -2
- package/build/commands/chat/index.js +9 -8
- package/build/commands/index.js +8 -6
- package/build/commands/message/index.js +1 -1
- package/build/commands/page/index.js +3 -3
- package/build/commands/payment/get-payment-history.command.js +11 -0
- package/build/commands/payment/index.js +18 -0
- package/build/commands/product/buy-product.command.js +1 -0
- package/build/commands/product/index.js +3 -3
- package/build/commands/question/index.js +2 -2
- package/build/commands/referral/get-by-bonuses.command.js +15 -0
- package/build/commands/referral/index.js +17 -0
- package/build/commands/subscription/buy-subscription.command.js +1 -0
- package/build/commands/subscription/create-custom-subscription-plan.command.js +24 -0
- package/build/commands/subscription/find-subscription.command.js +1 -1
- package/build/commands/subscription/get-available-upgrades.command.js +13 -0
- package/build/commands/subscription/index.js +7 -3
- package/build/commands/subscription/upgrade-subscription.command.js +41 -0
- package/build/commands/user/index.js +1 -1
- package/build/constants/category/enums/index.js +1 -1
- package/build/constants/chat/enums/index.js +1 -1
- package/build/constants/domains/index.js +17 -0
- package/build/constants/email/index.js +18 -0
- package/build/constants/errors/errors.js +65 -0
- package/build/constants/index.js +13 -7
- package/build/constants/order/enums/index.js +1 -0
- package/build/constants/order/enums/order-type.enum.js +8 -0
- package/build/constants/payment/enums/index.js +1 -0
- package/build/constants/payment/enums/payment-history-item-type.enum.js +8 -0
- package/build/constants/referral/enums/index.js +17 -0
- package/build/constants/referral/enums/referral-bonus-type.enum.js +8 -0
- package/build/constants/referral/index.js +17 -0
- package/build/constants/subscription/enums/index.js +4 -0
- package/build/constants/subscription/enums/subscription-action.enum.js +10 -0
- package/build/constants/subscription/enums/subscription-plan.enum.js +8 -0
- package/build/constants/subscription/enums/subscription-status.enum.js +1 -0
- package/build/constants/subscription/enums/subscription-type.enum.js +8 -0
- package/build/constants/subscription/enums/user-to-subscription-type.enum.js +8 -0
- package/build/constants/transaction/enums/index.js +17 -0
- package/build/constants/transaction/enums/user-balance-status.enum.js +1 -0
- package/build/constants/transaction/index.js +17 -0
- package/build/constants/user/enums/index.js +17 -0
- package/build/constants/user/index.js +18 -0
- package/build/helpers/index.js +17 -0
- package/build/helpers/subscription/calc-custom-subscription-price.helper.js +19 -0
- package/build/helpers/subscription/index.js +17 -0
- package/build/index.js +3 -2
- package/build/models/index.js +11 -7
- package/build/models/message.schema.js +1 -1
- package/build/models/payment-history-item.schema.js +14 -0
- package/build/models/referral-bonus.schema.js +19 -0
- package/build/models/subscription-upgrade-schema.js +8 -0
- package/build/models/subscription.schema.js +14 -2
- package/build/models/user-to-subscription.schema.js +1 -0
- package/commands/ai-model/index.ts +2 -2
- package/commands/auth/index.ts +4 -3
- package/commands/auth/register-user.command.ts +6 -4
- package/commands/blog/index.ts +2 -2
- package/commands/category/index.ts +2 -2
- package/commands/chat/index.ts +9 -8
- package/commands/index.ts +8 -6
- package/commands/message/index.ts +1 -1
- package/commands/page/index.ts +3 -3
- package/commands/payment/get-payment-history.command.ts +10 -0
- package/commands/payment/index.ts +2 -0
- package/commands/product/buy-product.command.ts +1 -0
- package/commands/product/index.ts +3 -3
- package/commands/question/index.ts +2 -2
- package/commands/referral/get-by-bonuses.command.ts +14 -0
- package/commands/referral/index.ts +1 -0
- package/commands/subscription/buy-subscription.command.ts +1 -0
- package/commands/subscription/create-custom-subscription-plan.command.ts +26 -0
- package/commands/subscription/find-subscription.command.ts +2 -2
- package/commands/subscription/get-available-upgrades.command.ts +15 -0
- package/commands/subscription/index.ts +7 -3
- package/commands/subscription/upgrade-subscription.command.ts +46 -0
- package/commands/user/index.ts +1 -1
- package/constants/category/enums/index.ts +1 -1
- package/constants/chat/enums/index.ts +1 -1
- package/constants/domains/index.ts +1 -0
- package/constants/email/index.ts +2 -0
- package/constants/errors/errors.ts +65 -0
- package/constants/index.ts +13 -7
- package/constants/order/enums/index.ts +1 -0
- package/constants/order/enums/order-type.enum.ts +4 -0
- package/constants/payment/enums/index.ts +1 -0
- package/constants/payment/enums/payment-history-item-type.enum.ts +4 -0
- package/constants/referral/enums/index.ts +1 -0
- package/constants/referral/enums/referral-bonus-type.enum.ts +4 -0
- package/constants/referral/index.ts +1 -0
- package/constants/subscription/enums/index.ts +4 -0
- package/constants/subscription/enums/subscription-action.enum.ts +6 -0
- package/constants/subscription/enums/subscription-plan.enum.ts +4 -0
- package/constants/subscription/enums/subscription-status.enum.ts +1 -0
- package/constants/subscription/enums/subscription-type.enum.ts +4 -0
- package/constants/subscription/enums/user-to-subscription-type.enum.ts +4 -0
- package/constants/transaction/enums/index.ts +2 -0
- package/constants/transaction/enums/user-balance-status.enum.ts +1 -0
- package/constants/transaction/index.ts +1 -0
- package/constants/user/enums/index.ts +1 -0
- package/constants/user/index.ts +2 -0
- package/helpers/index.ts +1 -0
- package/helpers/subscription/calc-custom-subscription-price.helper.ts +19 -0
- package/helpers/subscription/index.ts +1 -0
- package/index.ts +3 -2
- package/models/index.ts +11 -7
- package/models/message.schema.ts +1 -1
- package/models/payment-history-item.schema.ts +12 -0
- package/models/referral-bonus.schema.ts +18 -0
- package/models/subscription-upgrade-schema.ts +9 -0
- package/models/subscription.schema.ts +21 -1
- package/models/user-to-subscription.schema.ts +1 -0
- package/package.json +1 -1
package/api/controllers/index.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
+
export * from './ai-model';
|
|
1
2
|
export * from './auth';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './page';
|
|
3
|
+
export * from './blog';
|
|
4
4
|
export * from './category';
|
|
5
|
-
export * from './question';
|
|
6
|
-
export * from './unregistered-user';
|
|
7
|
-
export * from './ai-model';
|
|
8
5
|
export * from './chat-private';
|
|
9
6
|
export * from './chat-public';
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './subscription';
|
|
7
|
+
export * from './cloud-payments';
|
|
12
8
|
export * from './files';
|
|
13
|
-
export * from './
|
|
9
|
+
export * from './referral';
|
|
14
10
|
export * from './message';
|
|
11
|
+
export * from './page';
|
|
12
|
+
export * from './payment';
|
|
13
|
+
export * from './product';
|
|
14
|
+
export * from './question';
|
|
15
|
+
export * from './subscription';
|
|
16
|
+
export * from './unregistered-user';
|
|
17
|
+
export * from './user';
|
|
@@ -14,17 +14,20 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ai-model"), exports);
|
|
17
18
|
__exportStar(require("./auth"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./page"), exports);
|
|
19
|
+
__exportStar(require("./blog"), exports);
|
|
20
20
|
__exportStar(require("./category"), exports);
|
|
21
|
-
__exportStar(require("./question"), exports);
|
|
22
|
-
__exportStar(require("./unregistered-user"), exports);
|
|
23
|
-
__exportStar(require("./ai-model"), exports);
|
|
24
21
|
__exportStar(require("./chat-private"), exports);
|
|
25
22
|
__exportStar(require("./chat-public"), exports);
|
|
26
|
-
__exportStar(require("./
|
|
27
|
-
__exportStar(require("./subscription"), exports);
|
|
23
|
+
__exportStar(require("./cloud-payments"), exports);
|
|
28
24
|
__exportStar(require("./files"), exports);
|
|
29
|
-
__exportStar(require("./
|
|
25
|
+
__exportStar(require("./referral"), exports);
|
|
30
26
|
__exportStar(require("./message"), exports);
|
|
27
|
+
__exportStar(require("./page"), exports);
|
|
28
|
+
__exportStar(require("./payment"), exports);
|
|
29
|
+
__exportStar(require("./product"), exports);
|
|
30
|
+
__exportStar(require("./question"), exports);
|
|
31
|
+
__exportStar(require("./subscription"), exports);
|
|
32
|
+
__exportStar(require("./unregistered-user"), exports);
|
|
33
|
+
__exportStar(require("./user"), exports);
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./update-ai-model.command"), exports);
|
|
18
|
-
__exportStar(require("./delete-ai-model.command"), exports);
|
|
19
17
|
__exportStar(require("./create-ai-model.command"), exports);
|
|
18
|
+
__exportStar(require("./delete-ai-model.command"), exports);
|
|
20
19
|
__exportStar(require("./find-ai-model.command"), exports);
|
|
20
|
+
__exportStar(require("./update-ai-model.command"), exports);
|
|
@@ -14,9 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./restore-password.command"), exports);
|
|
17
|
+
__exportStar(require("./create-user.command"), exports);
|
|
19
18
|
__exportStar(require("./login.command"), exports);
|
|
20
19
|
__exportStar(require("./register-user.command"), exports);
|
|
21
|
-
__exportStar(require("./
|
|
20
|
+
__exportStar(require("./reset-password.command"), exports);
|
|
21
|
+
__exportStar(require("./restore-password.command"), exports);
|
|
22
|
+
__exportStar(require("./verify-email-retry.command"), exports);
|
|
22
23
|
__exportStar(require("./verify-email.command"), exports);
|
|
@@ -5,10 +5,9 @@ const models_1 = require("../../models");
|
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
var RegisterUserCommand;
|
|
7
7
|
(function (RegisterUserCommand) {
|
|
8
|
-
RegisterUserCommand.RequestSchema = models_1.UserSchema.pick({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
});
|
|
8
|
+
RegisterUserCommand.RequestSchema = zod_1.z.intersection(models_1.UserSchema.pick({ email: true, password: true }), zod_1.z.object({
|
|
9
|
+
partnerId: zod_1.z.string().uuid().optional(),
|
|
10
|
+
}));
|
|
12
11
|
RegisterUserCommand.ResponseSchema = zod_1.z.object({
|
|
13
12
|
data: zod_1.z.object({
|
|
14
13
|
accessToken: zod_1.z.string(),
|
|
@@ -15,8 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./create-post.command"), exports);
|
|
18
|
-
__exportStar(require("./update-post.command"), exports);
|
|
19
18
|
__exportStar(require("./delete-post.command"), exports);
|
|
20
|
-
__exportStar(require("./find-post-by-uuid.command"), exports);
|
|
21
19
|
__exportStar(require("./find-post-by-alias.command"), exports);
|
|
20
|
+
__exportStar(require("./find-post-by-uuid.command"), exports);
|
|
22
21
|
__exportStar(require("./find-post.command"), exports);
|
|
22
|
+
__exportStar(require("./update-post.command"), exports);
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./update-category.command"), exports);
|
|
18
|
-
__exportStar(require("./delete-category.command"), exports);
|
|
19
17
|
__exportStar(require("./create-category.command"), exports);
|
|
18
|
+
__exportStar(require("./delete-category.command"), exports);
|
|
20
19
|
__exportStar(require("./find-category.command"), exports);
|
|
20
|
+
__exportStar(require("./update-category.command"), exports);
|
|
@@ -14,15 +14,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./delete-chat.command"), exports);
|
|
19
|
-
__exportStar(require("./create-chat.command"), exports);
|
|
20
|
-
__exportStar(require("./find-chat.command"), exports);
|
|
21
|
-
__exportStar(require("./get-my-last-active-chat.command"), exports);
|
|
17
|
+
__exportStar(require("./archive-all.command"), exports);
|
|
22
18
|
__exportStar(require("./check-limit.command"), exports);
|
|
23
19
|
__exportStar(require("./check-limit.command.v2"), exports);
|
|
24
|
-
__exportStar(require("./
|
|
20
|
+
__exportStar(require("./create-chat.command"), exports);
|
|
25
21
|
__exportStar(require("./create-chat.command.v2"), exports);
|
|
26
|
-
__exportStar(require("./
|
|
27
|
-
__exportStar(require("./archive-all.command"), exports);
|
|
22
|
+
__exportStar(require("./delete-chat.command"), exports);
|
|
28
23
|
__exportStar(require("./delete-chat.command.v2"), exports);
|
|
24
|
+
__exportStar(require("./find-chat-by-uuid.command"), exports);
|
|
25
|
+
__exportStar(require("./find-chat.command"), exports);
|
|
26
|
+
__exportStar(require("./find-chats.command"), exports);
|
|
27
|
+
__exportStar(require("./get-my-last-active-chat-command.v2"), exports);
|
|
28
|
+
__exportStar(require("./get-my-last-active-chat.command"), exports);
|
|
29
|
+
__exportStar(require("./update-chat.command"), exports);
|
package/build/commands/index.js
CHANGED
|
@@ -14,16 +14,18 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ai-model"), exports);
|
|
17
18
|
__exportStar(require("./auth"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./page"), exports);
|
|
19
|
+
__exportStar(require("./blog"), exports);
|
|
20
20
|
__exportStar(require("./category"), exports);
|
|
21
|
-
__exportStar(require("./question"), exports);
|
|
22
|
-
__exportStar(require("./unregistered-user"), exports);
|
|
23
|
-
__exportStar(require("./ai-model"), exports);
|
|
24
21
|
__exportStar(require("./chat"), exports);
|
|
25
22
|
__exportStar(require("./message"), exports);
|
|
23
|
+
__exportStar(require("./page"), exports);
|
|
24
|
+
__exportStar(require("./payment"), exports);
|
|
26
25
|
__exportStar(require("./product"), exports);
|
|
26
|
+
__exportStar(require("./question"), exports);
|
|
27
|
+
__exportStar(require("./referral"), exports);
|
|
27
28
|
__exportStar(require("./subscription"), exports);
|
|
28
|
-
__exportStar(require("./
|
|
29
|
+
__exportStar(require("./unregistered-user"), exports);
|
|
30
|
+
__exportStar(require("./user"), exports);
|
|
29
31
|
__exportStar(require("./user-to-subscription"), exports);
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./create-image-message.command"), exports);
|
|
17
18
|
__exportStar(require("./create-message.command"), exports);
|
|
18
19
|
__exportStar(require("./create-text-message.command"), exports);
|
|
19
|
-
__exportStar(require("./create-image-message.command"), exports);
|
|
20
20
|
__exportStar(require("./rate-message.command"), exports);
|
|
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./update-page.command"), exports);
|
|
18
|
-
__exportStar(require("./delete-page.command"), exports);
|
|
19
17
|
__exportStar(require("./create-page.command"), exports);
|
|
20
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./delete-page.command"), exports);
|
|
21
19
|
__exportStar(require("./find-page-by-alias.command"), exports);
|
|
20
|
+
__exportStar(require("./find-page.command"), exports);
|
|
21
|
+
__exportStar(require("./update-page.command"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetPaymentHistoryCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const payment_history_item_schema_1 = require("../../models/payment-history-item.schema");
|
|
6
|
+
var GetPaymentHistoryCommand;
|
|
7
|
+
(function (GetPaymentHistoryCommand) {
|
|
8
|
+
GetPaymentHistoryCommand.ResponseSchema = zod_1.z.object({
|
|
9
|
+
data: zod_1.z.array(payment_history_item_schema_1.PaymentHistoryItemSchema),
|
|
10
|
+
});
|
|
11
|
+
})(GetPaymentHistoryCommand || (exports.GetPaymentHistoryCommand = GetPaymentHistoryCommand = {}));
|
|
@@ -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("./get-payment-history.command"), exports);
|
|
18
|
+
__exportStar(require("./pay.command"), exports);
|
|
@@ -27,6 +27,7 @@ var BuyProductCommand;
|
|
|
27
27
|
});
|
|
28
28
|
BuyProductCommand.RequestFastSchema = zod_1.z.object({
|
|
29
29
|
email: zod_1.z.string().email(),
|
|
30
|
+
partnerId: zod_1.z.string().uuid().optional(),
|
|
30
31
|
});
|
|
31
32
|
BuyProductCommand.ResponseSchema = zod_1.z.object({
|
|
32
33
|
publicId: zod_1.z.string(),
|
|
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./delete-product.command"), exports);
|
|
17
|
+
__exportStar(require("./buy-product.command"), exports);
|
|
19
18
|
__exportStar(require("./create-product.command"), exports);
|
|
19
|
+
__exportStar(require("./delete-product.command"), exports);
|
|
20
20
|
__exportStar(require("./find-product.command"), exports);
|
|
21
|
-
__exportStar(require("./
|
|
21
|
+
__exportStar(require("./update-product.command"), exports);
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./update-question.command"), exports);
|
|
18
|
-
__exportStar(require("./delete-question.command"), exports);
|
|
19
17
|
__exportStar(require("./create-question.command"), exports);
|
|
18
|
+
__exportStar(require("./delete-question.command"), exports);
|
|
20
19
|
__exportStar(require("./find-question.command"), exports);
|
|
20
|
+
__exportStar(require("./update-question.command"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetMyBonusesCommand = void 0;
|
|
4
|
+
const models_1 = require("../../models");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
var GetMyBonusesCommand;
|
|
7
|
+
(function (GetMyBonusesCommand) {
|
|
8
|
+
GetMyBonusesCommand.ResponseSchema = zod_1.z.object({
|
|
9
|
+
data: zod_1.z.object({
|
|
10
|
+
sumTotal: zod_1.z.number(),
|
|
11
|
+
sumInitial: zod_1.z.number(),
|
|
12
|
+
statistics: zod_1.z.array(models_1.ReferralBonusStatisticsSchema),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
})(GetMyBonusesCommand || (exports.GetMyBonusesCommand = GetMyBonusesCommand = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./get-by-bonuses.command"), exports);
|
|
@@ -13,6 +13,7 @@ var BuySubscriptionCommand;
|
|
|
13
13
|
});
|
|
14
14
|
BuySubscriptionCommand.RequestFastSchema = zod_1.z.object({
|
|
15
15
|
email: zod_1.z.string().email(),
|
|
16
|
+
partnerId: zod_1.z.string().uuid().optional(),
|
|
16
17
|
});
|
|
17
18
|
const IReceiptOrderSchema = zod_1.z.object({
|
|
18
19
|
items: zod_1.z.array(zod_1.z.object({
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateCustomSubscriptionPlanCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var CreateCustomSubscriptionPlanCommand;
|
|
7
|
+
(function (CreateCustomSubscriptionPlanCommand) {
|
|
8
|
+
CreateCustomSubscriptionPlanCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
tokens: zod_1.z
|
|
10
|
+
.number()
|
|
11
|
+
.refine((val) => val % 500 === 0, {
|
|
12
|
+
message: 'tokens must be a multiple of 500',
|
|
13
|
+
})
|
|
14
|
+
.refine((val) => val > 1000, {
|
|
15
|
+
message: 'tokens must be greater than 1000',
|
|
16
|
+
})
|
|
17
|
+
.refine((val) => val <= 10000, {
|
|
18
|
+
message: 'tokens must be equal or less than 10000',
|
|
19
|
+
}),
|
|
20
|
+
});
|
|
21
|
+
CreateCustomSubscriptionPlanCommand.ResponseSchema = zod_1.z.object({
|
|
22
|
+
data: models_1.SubscriptionSchema,
|
|
23
|
+
});
|
|
24
|
+
})(CreateCustomSubscriptionPlanCommand || (exports.CreateCustomSubscriptionPlanCommand = CreateCustomSubscriptionPlanCommand = {}));
|
|
@@ -9,7 +9,7 @@ var FindSubscriptionCommand;
|
|
|
9
9
|
uuid: true,
|
|
10
10
|
});
|
|
11
11
|
FindSubscriptionCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
-
data: zod_1.z.array(models_1.
|
|
12
|
+
data: zod_1.z.array(models_1.SubscriptionWithSubTypesSchema),
|
|
13
13
|
});
|
|
14
14
|
FindSubscriptionCommand.ResponseByUUIDSchema = zod_1.z.object({
|
|
15
15
|
data: models_1.SubscriptionSchema,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetAvailableUpgradesCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
const subscription_upgrade_schema_1 = require("../../models/subscription-upgrade-schema");
|
|
7
|
+
var GetAvailableUpgradesCommand;
|
|
8
|
+
(function (GetAvailableUpgradesCommand) {
|
|
9
|
+
GetAvailableUpgradesCommand.RequestSchema = models_1.SubscriptionSchema.pick({});
|
|
10
|
+
GetAvailableUpgradesCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: zod_1.z.array(subscription_upgrade_schema_1.SubscriptionUpgradeSchema),
|
|
12
|
+
});
|
|
13
|
+
})(GetAvailableUpgradesCommand || (exports.GetAvailableUpgradesCommand = GetAvailableUpgradesCommand = {}));
|
|
@@ -14,9 +14,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./buy-subscription.command"), exports);
|
|
18
|
+
__exportStar(require("./cancel-subscription.command"), exports);
|
|
19
|
+
__exportStar(require("./create-custom-subscription-plan.command"), exports);
|
|
19
20
|
__exportStar(require("./create-subscription.command"), exports);
|
|
21
|
+
__exportStar(require("./delete-subscription.command"), exports);
|
|
20
22
|
__exportStar(require("./find-subscription.command"), exports);
|
|
21
|
-
__exportStar(require("./
|
|
23
|
+
__exportStar(require("./get-available-upgrades.command"), exports);
|
|
22
24
|
__exportStar(require("./recover-subscription.command"), exports);
|
|
25
|
+
__exportStar(require("./update-subscription.command"), exports);
|
|
26
|
+
__exportStar(require("./upgrade-subscription.command"), exports);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpgradeSubscriptionCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var UpgradeSubscriptionCommand;
|
|
7
|
+
(function (UpgradeSubscriptionCommand) {
|
|
8
|
+
UpgradeSubscriptionCommand.RequestSchema = models_1.SubscriptionSchema.pick({
|
|
9
|
+
uuid: true,
|
|
10
|
+
});
|
|
11
|
+
const IReceiptOrderSchema = zod_1.z.object({
|
|
12
|
+
items: zod_1.z.array(zod_1.z.object({
|
|
13
|
+
label: zod_1.z.string(),
|
|
14
|
+
price: zod_1.z.number(),
|
|
15
|
+
quantity: zod_1.z.number(),
|
|
16
|
+
amount: zod_1.z.number(),
|
|
17
|
+
vat: zod_1.z.number(),
|
|
18
|
+
})),
|
|
19
|
+
email: zod_1.z.string(),
|
|
20
|
+
isBso: zod_1.z.boolean(),
|
|
21
|
+
amounts: zod_1.z.object({
|
|
22
|
+
electronic: zod_1.z.number(),
|
|
23
|
+
}),
|
|
24
|
+
});
|
|
25
|
+
UpgradeSubscriptionCommand.ResponseSchema = zod_1.z.object({
|
|
26
|
+
publicId: zod_1.z.string(),
|
|
27
|
+
amount: zod_1.z.number(),
|
|
28
|
+
currency: zod_1.z.string(),
|
|
29
|
+
accountId: zod_1.z.string(),
|
|
30
|
+
description: zod_1.z.string(),
|
|
31
|
+
invoiceId: zod_1.z.string(),
|
|
32
|
+
email: zod_1.z.string(),
|
|
33
|
+
skin: zod_1.z.string(),
|
|
34
|
+
autoClose: zod_1.z.number(),
|
|
35
|
+
data: zod_1.z.object({
|
|
36
|
+
CloudPayments: zod_1.z.object({
|
|
37
|
+
CustomerReceipt: IReceiptOrderSchema,
|
|
38
|
+
}),
|
|
39
|
+
}),
|
|
40
|
+
});
|
|
41
|
+
})(UpgradeSubscriptionCommand || (exports.UpgradeSubscriptionCommand = UpgradeSubscriptionCommand = {}));
|
|
@@ -14,6 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./check-email.command"), exports);
|
|
17
18
|
__exportStar(require("./find-user.command"), exports);
|
|
18
19
|
__exportStar(require("./up-token-bonus-balance.command"), exports);
|
|
19
|
-
__exportStar(require("./check-email.command"), exports);
|
|
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./category-type.enum"), exports);
|
|
18
17
|
__exportStar(require("./category-content-type.enum"), exports);
|
|
18
|
+
__exportStar(require("./category-type.enum"), exports);
|
|
@@ -15,5 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./chat-status.enum"), exports);
|
|
18
|
-
__exportStar(require("./dalle-image-size.enum"), exports);
|
|
19
18
|
__exportStar(require("./dalle-image-format.enum"), exports);
|
|
19
|
+
__exportStar(require("./dalle-image-size.enum"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./white-list"), 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("./email-endpoint"), exports);
|
|
18
|
+
__exportStar(require("./subjects"), exports);
|
|
@@ -515,4 +515,69 @@ exports.ERRORS = {
|
|
|
515
515
|
message: 'Электронная почта уже подтверждена',
|
|
516
516
|
httpCode: 400,
|
|
517
517
|
},
|
|
518
|
+
GET_UNREGISTERED_SESSION_ERROR: {
|
|
519
|
+
code: 'A117',
|
|
520
|
+
message: 'Не удалось получить сессию с данным идентификатором',
|
|
521
|
+
httpCode: 500,
|
|
522
|
+
},
|
|
523
|
+
UNREGISTERED_USER_LIMIT_UPDATE_ERROR: {
|
|
524
|
+
code: 'A118',
|
|
525
|
+
message: 'Не удалось обновить баланс пользователя',
|
|
526
|
+
httpCode: 500,
|
|
527
|
+
},
|
|
528
|
+
PAYMENT_HISTORY_ERROR: {
|
|
529
|
+
code: 'A119',
|
|
530
|
+
message: 'Не удалось получить историю платежей',
|
|
531
|
+
httpCode: 500,
|
|
532
|
+
},
|
|
533
|
+
SUBSCRIPTION_GET_UPGRADES_ERROR: {
|
|
534
|
+
code: 'A120',
|
|
535
|
+
message: 'Не удалось получить информацию о возможных улучшениях для подписки',
|
|
536
|
+
httpCode: 500,
|
|
537
|
+
},
|
|
538
|
+
SUBSCRIPTION_UPGRADE_ERROR: {
|
|
539
|
+
code: 'A121',
|
|
540
|
+
message: 'Не удалось улучшить подписку',
|
|
541
|
+
httpCode: 500,
|
|
542
|
+
},
|
|
543
|
+
RECURRENT_UPDATE_ERROR: {
|
|
544
|
+
code: 'A122',
|
|
545
|
+
message: 'Не удалось изменить данные подписки',
|
|
546
|
+
httpCode: 500,
|
|
547
|
+
},
|
|
548
|
+
ALREADY_HAS_SUBSCRIPTION: {
|
|
549
|
+
code: 'A123',
|
|
550
|
+
message: 'На данной учетной записи уже есть подписка',
|
|
551
|
+
httpCode: 409,
|
|
552
|
+
},
|
|
553
|
+
SUBSCRIPTION_UPGRADE_INVALID: {
|
|
554
|
+
code: 'A124',
|
|
555
|
+
message: 'Невозможно улучшить подписку с данными параметрами',
|
|
556
|
+
httpCode: 400,
|
|
557
|
+
},
|
|
558
|
+
PARTNER_NOT_FOUND: {
|
|
559
|
+
code: 'A125',
|
|
560
|
+
message: 'Не удалось найти партнера по реферальной программе',
|
|
561
|
+
httpCode: 404,
|
|
562
|
+
},
|
|
563
|
+
REFERRAL_BONUSES_NOT_FOUND: {
|
|
564
|
+
code: 'A126',
|
|
565
|
+
message: 'Не удалось найти бонусы по реферальной программе',
|
|
566
|
+
httpCode: 404,
|
|
567
|
+
},
|
|
568
|
+
REFERRAL_BONUS_UPDATE_ERROR: {
|
|
569
|
+
code: 'A127',
|
|
570
|
+
message: 'Не удалось обновить бонусы по реферальной программе',
|
|
571
|
+
httpCode: 500,
|
|
572
|
+
},
|
|
573
|
+
REFERRAL_BONUS_STATS_ERROR: {
|
|
574
|
+
code: 'A128',
|
|
575
|
+
message: 'Не удалось получить статистику по бонусам по реферальной программе',
|
|
576
|
+
httpCode: 500,
|
|
577
|
+
},
|
|
578
|
+
REFERRAL_BONUS_APPLY_ERROR: {
|
|
579
|
+
code: 'A129',
|
|
580
|
+
message: 'Не удалось применить бонусы по реферальной программе',
|
|
581
|
+
httpCode: 500,
|
|
582
|
+
},
|
|
518
583
|
};
|
package/build/constants/index.js
CHANGED
|
@@ -14,13 +14,19 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ai-model"), exports);
|
|
18
|
+
__exportStar(require("./category"), exports);
|
|
19
|
+
__exportStar(require("./chat"), exports);
|
|
20
|
+
__exportStar(require("./cloud-payments"), exports);
|
|
21
|
+
__exportStar(require("./domains"), exports);
|
|
22
|
+
__exportStar(require("./email"), exports);
|
|
17
23
|
__exportStar(require("./errors"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./payment"), exports);
|
|
24
|
+
__exportStar(require("./message"), exports);
|
|
20
25
|
__exportStar(require("./order"), exports);
|
|
21
|
-
__exportStar(require("./
|
|
22
|
-
__exportStar(require("./subscription"), exports);
|
|
26
|
+
__exportStar(require("./payment"), exports);
|
|
23
27
|
__exportStar(require("./product"), exports);
|
|
24
|
-
__exportStar(require("./
|
|
25
|
-
__exportStar(require("./
|
|
26
|
-
__exportStar(require("./
|
|
28
|
+
__exportStar(require("./referral"), exports);
|
|
29
|
+
__exportStar(require("./roles"), exports);
|
|
30
|
+
__exportStar(require("./subscription"), exports);
|
|
31
|
+
__exportStar(require("./transaction"), exports);
|
|
32
|
+
__exportStar(require("./user"), exports);
|