@purpleschool/multisite 0.0.1
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/controller/http/ai-proxy.ts +6 -0
- package/api/controller/http/auth.ts +7 -0
- package/api/controller/http/cloud-payments.ts +6 -0
- package/api/controller/http/file.ts +7 -0
- package/api/controller/http/health.ts +4 -0
- package/api/controller/http/image-generation.ts +15 -0
- package/api/controller/http/index.ts +12 -0
- package/api/controller/http/payment.ts +6 -0
- package/api/controller/http/product.ts +7 -0
- package/api/controller/http/subscription.ts +8 -0
- package/api/controller/http/transaction.ts +6 -0
- package/api/controller/http/unregistered-user.ts +1 -0
- package/api/controller/http/user.ts +5 -0
- package/api/controller/index.ts +2 -0
- package/api/index.ts +2 -0
- package/api/routes.ts +76 -0
- package/build/api/controller/http/ai-proxy.js +7 -0
- package/build/api/controller/http/auth.js +8 -0
- package/build/api/controller/http/cloud-payments.js +7 -0
- package/build/api/controller/http/file.js +8 -0
- package/build/api/controller/http/health.js +6 -0
- package/build/api/controller/http/image-generation.js +17 -0
- package/build/api/controller/http/index.js +28 -0
- package/build/api/controller/http/payment.js +7 -0
- package/build/api/controller/http/product.js +9 -0
- package/build/api/controller/http/subscription.js +9 -0
- package/build/api/controller/http/transaction.js +7 -0
- package/build/api/controller/http/unregistered-user.js +4 -0
- package/build/api/controller/http/user.js +7 -0
- package/build/api/controller/index.js +17 -0
- package/build/api/index.js +18 -0
- package/build/api/routes.js +103 -0
- package/build/commands/auth/index.js +18 -0
- package/build/commands/auth/login.command.js +17 -0
- package/build/commands/auth/register.command.js +17 -0
- package/build/commands/file/index.js +17 -0
- package/build/commands/file/upload-file.command.js +11 -0
- package/build/commands/image-generation/execute-image-generation.command.js +17 -0
- package/build/commands/image-generation/index.js +23 -0
- package/build/commands/image-generation/proxy-image-generation-callback.command.js +21 -0
- package/build/commands/image-generation/retry-image-generation-job.command.js +17 -0
- package/build/commands/image-generation/set-reaction-to-image-generation-job.command.js +26 -0
- package/build/commands/image-generation/soft-delete-image-generation-job-by-uuid.command.js +10 -0
- package/build/commands/image-generation/soft-delete-image-generation-jobs-by-criteria.command.js +10 -0
- package/build/commands/image-generation/update-image-generation-job-title.command.js +14 -0
- package/build/commands/index.js +24 -0
- package/build/commands/payment/cloud-payments.command.js +47 -0
- package/build/commands/payment/index.js +17 -0
- package/build/commands/product/buy-product.command.js +17 -0
- package/build/commands/product/index.js +17 -0
- package/build/commands/subscription/buy-subscription.command.js +17 -0
- package/build/commands/subscription/index.js +17 -0
- package/build/commands/transaction/index.js +17 -0
- package/build/commands/transaction/write-off.command.js +19 -0
- package/build/commands/unregistered-user/index.js +17 -0
- package/build/commands/unregistered-user/upsert-unregistered-user.command.js +16 -0
- package/build/constants/common/enums/index.js +17 -0
- package/build/constants/common/enums/user-reaction.enum.js +8 -0
- package/build/constants/common/index.js +17 -0
- package/build/constants/errors/errors.js +298 -0
- package/build/constants/errors/index.js +17 -0
- package/build/constants/files/enums/file-type.enum.js +7 -0
- package/build/constants/files/enums/index.js +17 -0
- package/build/constants/files/index.js +17 -0
- package/build/constants/image-generation/enums/image-generation-model-strategy.enum.js +18 -0
- package/build/constants/image-generation/enums/image-generation-resolution.enum.js +9 -0
- package/build/constants/image-generation/enums/index.js +18 -0
- package/build/constants/image-generation/index.js +17 -0
- package/build/constants/index.js +28 -0
- package/build/constants/order/enums/index.js +18 -0
- package/build/constants/order/enums/order-status.enum.js +9 -0
- package/build/constants/order/enums/order-type.enum.js +7 -0
- package/build/constants/order/index.js +17 -0
- package/build/constants/payment/enums/index.js +17 -0
- package/build/constants/payment/enums/payment-status.enum.js +7 -0
- package/build/constants/payment/index.js +17 -0
- package/build/constants/subscription/free-subscription-id.constant.js +4 -0
- package/build/constants/subscription/index.js +17 -0
- package/build/constants/tools/enums/index.js +20 -0
- package/build/constants/tools/enums/job-request-origin.enum.js +7 -0
- package/build/constants/tools/enums/job-status.enum.js +9 -0
- package/build/constants/tools/enums/tool-model-status.enum.js +8 -0
- package/build/constants/tools/enums/tool-type.enum.js +7 -0
- package/build/constants/tools/index.js +17 -0
- package/build/constants/transaction/enums/index.js +17 -0
- package/build/constants/transaction/enums/transaction-status.enum.js +9 -0
- package/build/constants/transaction/index.js +17 -0
- package/build/constants/user/enums/index.js +18 -0
- package/build/constants/user/enums/user-role.enum.js +9 -0
- package/build/constants/user/enums/user-status.enum.js +9 -0
- package/build/constants/user/index.js +17 -0
- package/build/constants/user-to-product/enums/index.js +17 -0
- package/build/constants/user-to-product/enums/user-to-product-status.enum.js +7 -0
- package/build/constants/user-to-product/index.js +17 -0
- package/build/constants/user-to-subscription/enums/index.js +17 -0
- package/build/constants/user-to-subscription/enums/user-to-subscription-status.enum.js +7 -0
- package/build/constants/user-to-subscription/index.js +17 -0
- package/build/index.js +21 -0
- package/build/models/cloud-payments-widget-data.schema.js +17 -0
- package/build/models/cloud-payments-widget.schema.js +17 -0
- package/build/models/common/attached-file.schema.js +14 -0
- package/build/models/common/icon-variants.schema.js +12 -0
- package/build/models/common/index.js +20 -0
- package/build/models/common/json-value.schema.js +6 -0
- package/build/models/common/receipt.schema.js +18 -0
- package/build/models/file.schema.js +15 -0
- package/build/models/image-generation/image-generation-config.schema.js +10 -0
- package/build/models/image-generation/image-generation-job-attempt.schema.js +11 -0
- package/build/models/image-generation/image-generation-job-params.schema.js +12 -0
- package/build/models/image-generation/image-generation-job-request-params.schema.js +11 -0
- package/build/models/image-generation/image-generation-job.schema.js +32 -0
- package/build/models/image-generation/image-generation-model-params.schema.js +20 -0
- package/build/models/image-generation/image-generation-model.schema.js +30 -0
- package/build/models/image-generation/image-generation-preset.schema.js +10 -0
- package/build/models/image-generation/image-generation-pricing-rule.schema.js +14 -0
- package/build/models/image-generation/image-generation-vendor.schema.js +9 -0
- package/build/models/image-generation/index.js +26 -0
- package/build/models/index.js +25 -0
- package/build/models/product.schema.js +12 -0
- package/build/models/subscription.schema.js +14 -0
- package/build/models/tools/index.js +17 -0
- package/build/models/tools/vendor.schema.js +11 -0
- package/build/models/user.schema.js +13 -0
- package/build/queries/file/find-files.command.js +20 -0
- package/build/queries/file/get-file.command.js +14 -0
- package/build/queries/file/index.js +18 -0
- package/build/queries/image-generation/find-image-generation-jobs.command.js +20 -0
- package/build/queries/image-generation/get-image-generation-config.command.js +11 -0
- package/build/queries/image-generation/get-image-generation-job.command.js +14 -0
- package/build/queries/image-generation/get-image-generation-price.command.js +19 -0
- package/build/queries/image-generation/index.js +20 -0
- package/build/queries/index.js +22 -0
- package/build/queries/payment/get-payment-history.command.js +18 -0
- package/build/queries/payment/index.js +17 -0
- package/build/queries/product/find-products.command.js +11 -0
- package/build/queries/product/index.js +17 -0
- package/build/queries/subscription/find-subscriptions.command.js +11 -0
- package/build/queries/subscription/index.js +17 -0
- package/build/queries/user/get-my-products.command.js +19 -0
- package/build/queries/user/get-my-subscriptions.command.js +21 -0
- package/build/queries/user/get-user.command.js +16 -0
- package/build/queries/user/index.js +19 -0
- package/commands/auth/index.ts +2 -0
- package/commands/auth/login.command.ts +18 -0
- package/commands/auth/register.command.ts +18 -0
- package/commands/file/index.ts +1 -0
- package/commands/file/upload-file.command.ts +10 -0
- package/commands/image-generation/execute-image-generation.command.ts +20 -0
- package/commands/image-generation/index.ts +7 -0
- package/commands/image-generation/proxy-image-generation-callback.command.ts +21 -0
- package/commands/image-generation/retry-image-generation-job.command.ts +20 -0
- package/commands/image-generation/set-reaction-to-image-generation-job.command.ts +29 -0
- package/commands/image-generation/soft-delete-image-generation-job-by-uuid.command.ts +10 -0
- package/commands/image-generation/soft-delete-image-generation-jobs-by-criteria.command.ts +10 -0
- package/commands/image-generation/update-image-generation-job-title.command.ts +17 -0
- package/commands/index.ts +8 -0
- package/commands/payment/cloud-payments.command.ts +53 -0
- package/commands/payment/index.ts +1 -0
- package/commands/product/buy-product.command.ts +20 -0
- package/commands/product/index.ts +1 -0
- package/commands/subscription/buy-subscription.command.ts +20 -0
- package/commands/subscription/index.ts +1 -0
- package/commands/transaction/index.ts +1 -0
- package/commands/transaction/write-off.command.ts +19 -0
- package/commands/unregistered-user/index.ts +2 -0
- package/commands/unregistered-user/upsert-unregistered-user.command.ts +17 -0
- package/constants/common/enums/index.ts +2 -0
- package/constants/common/enums/user-reaction.enum.ts +5 -0
- package/constants/common/index.ts +2 -0
- package/constants/errors/errors.ts +308 -0
- package/constants/errors/index.ts +2 -0
- package/constants/files/enums/file-type.enum.ts +4 -0
- package/constants/files/enums/index.ts +2 -0
- package/constants/files/index.ts +2 -0
- package/constants/image-generation/enums/image-generation-model-strategy.enum.ts +15 -0
- package/constants/image-generation/enums/image-generation-resolution.enum.ts +6 -0
- package/constants/image-generation/enums/index.ts +2 -0
- package/constants/image-generation/index.ts +2 -0
- package/constants/index.ts +12 -0
- package/constants/order/enums/index.ts +3 -0
- package/constants/order/enums/order-status.enum.ts +6 -0
- package/constants/order/enums/order-type.enum.ts +4 -0
- package/constants/order/index.ts +2 -0
- package/constants/payment/enums/index.ts +2 -0
- package/constants/payment/enums/payment-status.enum.ts +4 -0
- package/constants/payment/index.ts +2 -0
- package/constants/subscription/free-subscription-id.constant.ts +2 -0
- package/constants/subscription/index.ts +2 -0
- package/constants/tools/enums/index.ts +4 -0
- package/constants/tools/enums/job-request-origin.enum.ts +4 -0
- package/constants/tools/enums/job-status.enum.ts +6 -0
- package/constants/tools/enums/tool-model-status.enum.ts +5 -0
- package/constants/tools/enums/tool-type.enum.ts +4 -0
- package/constants/tools/index.ts +2 -0
- package/constants/transaction/enums/index.ts +2 -0
- package/constants/transaction/enums/transaction-status.enum.ts +6 -0
- package/constants/transaction/index.ts +2 -0
- package/constants/user/enums/index.ts +3 -0
- package/constants/user/enums/user-role.enum.ts +6 -0
- package/constants/user/enums/user-status.enum.ts +6 -0
- package/constants/user/index.ts +2 -0
- package/constants/user-to-product/enums/index.ts +2 -0
- package/constants/user-to-product/enums/user-to-product-status.enum.ts +4 -0
- package/constants/user-to-product/index.ts +2 -0
- package/constants/user-to-subscription/enums/index.ts +2 -0
- package/constants/user-to-subscription/enums/user-to-subscription-status.enum.ts +4 -0
- package/constants/user-to-subscription/index.ts +2 -0
- package/index.ts +5 -0
- package/models/cloud-payments-widget-data.schema.ts +19 -0
- package/models/cloud-payments-widget.schema.ts +15 -0
- package/models/common/attached-file.schema.ts +14 -0
- package/models/common/icon-variants.schema.ts +13 -0
- package/models/common/index.ts +4 -0
- package/models/common/json-value.schema.ts +11 -0
- package/models/common/receipt.schema.ts +20 -0
- package/models/file.schema.ts +14 -0
- package/models/image-generation/image-generation-config.schema.ts +11 -0
- package/models/image-generation/image-generation-job-attempt.schema.ts +12 -0
- package/models/image-generation/image-generation-job-params.schema.ts +11 -0
- package/models/image-generation/image-generation-job-request-params.schema.ts +11 -0
- package/models/image-generation/image-generation-job.schema.ts +30 -0
- package/models/image-generation/image-generation-model-params.schema.ts +22 -0
- package/models/image-generation/image-generation-model.schema.ts +28 -0
- package/models/image-generation/image-generation-preset.schema.ts +11 -0
- package/models/image-generation/image-generation-pricing-rule.schema.ts +20 -0
- package/models/image-generation/image-generation-vendor.schema.ts +9 -0
- package/models/image-generation/index.ts +10 -0
- package/models/index.ts +9 -0
- package/models/product.schema.ts +10 -0
- package/models/subscription.schema.ts +12 -0
- package/models/tools/index.ts +2 -0
- package/models/tools/vendor.schema.ts +12 -0
- package/models/user.schema.ts +11 -0
- package/package.json +18 -0
- package/queries/file/find-files.command.ts +21 -0
- package/queries/file/get-file.command.ts +15 -0
- package/queries/file/index.ts +3 -0
- package/queries/image-generation/find-image-generation-jobs.command.ts +21 -0
- package/queries/image-generation/get-image-generation-config.command.ts +9 -0
- package/queries/image-generation/get-image-generation-job.command.ts +15 -0
- package/queries/image-generation/get-image-generation-price.command.ts +19 -0
- package/queries/image-generation/index.ts +4 -0
- package/queries/index.ts +7 -0
- package/queries/payment/get-payment-history.command.ts +17 -0
- package/queries/payment/index.ts +2 -0
- package/queries/product/find-products.command.ts +10 -0
- package/queries/product/index.ts +2 -0
- package/queries/subscription/find-subscriptions.command.ts +10 -0
- package/queries/subscription/index.ts +2 -0
- package/queries/user/get-my-products.command.ts +19 -0
- package/queries/user/get-my-subscriptions.command.ts +21 -0
- package/queries/user/get-user.command.ts +14 -0
- package/queries/user/index.ts +3 -0
- package/tsconfig.json +104 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RetryImageGenerationJobCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var RetryImageGenerationJobCommand;
|
|
7
|
+
(function (RetryImageGenerationJobCommand) {
|
|
8
|
+
RetryImageGenerationJobCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
prompt: zod_1.z.string().min(1).max(4000).optional(),
|
|
10
|
+
modelId: zod_1.z.string().uuid().optional(),
|
|
11
|
+
presetId: zod_1.z.string().uuid().nullable().optional(),
|
|
12
|
+
params: models_1.ImageGenerationJobRequestParamsSchema.optional(),
|
|
13
|
+
});
|
|
14
|
+
RetryImageGenerationJobCommand.ResponseSchema = zod_1.z.object({
|
|
15
|
+
data: models_1.ImageGenerationJobSchema,
|
|
16
|
+
});
|
|
17
|
+
})(RetryImageGenerationJobCommand || (exports.RetryImageGenerationJobCommand = RetryImageGenerationJobCommand = {}));
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SetReactionToImageGenerationJobCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
const models_1 = require("../../models");
|
|
7
|
+
var SetReactionToImageGenerationJobCommand;
|
|
8
|
+
(function (SetReactionToImageGenerationJobCommand) {
|
|
9
|
+
SetReactionToImageGenerationJobCommand.RequestSchema = zod_1.z
|
|
10
|
+
.object({
|
|
11
|
+
reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
|
|
12
|
+
dislikeReason: zod_1.z.string().nullable().default(null),
|
|
13
|
+
})
|
|
14
|
+
.superRefine((data, ctx) => {
|
|
15
|
+
if (data.reaction !== constants_1.USER_REACTION.DISLIKE && data.dislikeReason) {
|
|
16
|
+
ctx.addIssue({
|
|
17
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
18
|
+
message: 'Dislike reason is not allowed when reaction is not dislike',
|
|
19
|
+
path: ['dislikeReason'],
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
SetReactionToImageGenerationJobCommand.ResponseSchema = zod_1.z.object({
|
|
24
|
+
data: models_1.ImageGenerationJobSchema,
|
|
25
|
+
});
|
|
26
|
+
})(SetReactionToImageGenerationJobCommand || (exports.SetReactionToImageGenerationJobCommand = SetReactionToImageGenerationJobCommand = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SoftDeleteImageGenerationJobByUuidCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var SoftDeleteImageGenerationJobByUuidCommand;
|
|
6
|
+
(function (SoftDeleteImageGenerationJobByUuidCommand) {
|
|
7
|
+
SoftDeleteImageGenerationJobByUuidCommand.ResponseSchema = zod_1.z.object({
|
|
8
|
+
data: zod_1.z.boolean(),
|
|
9
|
+
});
|
|
10
|
+
})(SoftDeleteImageGenerationJobByUuidCommand || (exports.SoftDeleteImageGenerationJobByUuidCommand = SoftDeleteImageGenerationJobByUuidCommand = {}));
|
package/build/commands/image-generation/soft-delete-image-generation-jobs-by-criteria.command.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SoftDeleteImageGenerationJobsByCriteriaCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var SoftDeleteImageGenerationJobsByCriteriaCommand;
|
|
6
|
+
(function (SoftDeleteImageGenerationJobsByCriteriaCommand) {
|
|
7
|
+
SoftDeleteImageGenerationJobsByCriteriaCommand.ResponseSchema = zod_1.z.object({
|
|
8
|
+
data: zod_1.z.boolean(),
|
|
9
|
+
});
|
|
10
|
+
})(SoftDeleteImageGenerationJobsByCriteriaCommand || (exports.SoftDeleteImageGenerationJobsByCriteriaCommand = SoftDeleteImageGenerationJobsByCriteriaCommand = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateImageGenerationJobTitleCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var UpdateImageGenerationJobTitleCommand;
|
|
7
|
+
(function (UpdateImageGenerationJobTitleCommand) {
|
|
8
|
+
UpdateImageGenerationJobTitleCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
title: zod_1.z.string().min(1).max(200),
|
|
10
|
+
});
|
|
11
|
+
UpdateImageGenerationJobTitleCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: models_1.ImageGenerationJobSchema,
|
|
13
|
+
});
|
|
14
|
+
})(UpdateImageGenerationJobTitleCommand || (exports.UpdateImageGenerationJobTitleCommand = UpdateImageGenerationJobTitleCommand = {}));
|
|
@@ -0,0 +1,24 @@
|
|
|
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("./auth"), exports);
|
|
18
|
+
__exportStar(require("./product"), exports);
|
|
19
|
+
__exportStar(require("./subscription"), exports);
|
|
20
|
+
__exportStar(require("./payment"), exports);
|
|
21
|
+
__exportStar(require("./transaction"), exports);
|
|
22
|
+
__exportStar(require("./image-generation"), exports);
|
|
23
|
+
__exportStar(require("./file"), exports);
|
|
24
|
+
__exportStar(require("./unregistered-user"), exports);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CloudPaymentsRecurrentCommand = exports.CloudPaymentsPayCommand = exports.CloudPaymentsCheckCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var CloudPaymentsCheckCommand;
|
|
7
|
+
(function (CloudPaymentsCheckCommand) {
|
|
8
|
+
CloudPaymentsCheckCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
transactionId: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(),
|
|
10
|
+
amount: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]),
|
|
11
|
+
paymentAmount: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]),
|
|
12
|
+
currency: zod_1.z.string(),
|
|
13
|
+
paymentCurrency: zod_1.z.string(),
|
|
14
|
+
invoiceId: zod_1.z.string().optional(),
|
|
15
|
+
accountId: zod_1.z.string().optional(),
|
|
16
|
+
data: zod_1.z.string().optional(),
|
|
17
|
+
});
|
|
18
|
+
CloudPaymentsCheckCommand.ResponseSchema = zod_1.z.object({
|
|
19
|
+
code: zod_1.z.number(),
|
|
20
|
+
});
|
|
21
|
+
})(CloudPaymentsCheckCommand || (exports.CloudPaymentsCheckCommand = CloudPaymentsCheckCommand = {}));
|
|
22
|
+
var CloudPaymentsPayCommand;
|
|
23
|
+
(function (CloudPaymentsPayCommand) {
|
|
24
|
+
CloudPaymentsPayCommand.RequestSchema = zod_1.z.object({
|
|
25
|
+
transactionId: zod_1.z.number().optional(),
|
|
26
|
+
amount: zod_1.z.number(),
|
|
27
|
+
currency: zod_1.z.string().optional().default('RUB'),
|
|
28
|
+
paymentAmount: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(),
|
|
29
|
+
paymentCurrency: zod_1.z.string().optional(),
|
|
30
|
+
invoiceId: zod_1.z.string().optional(),
|
|
31
|
+
accountId: zod_1.z.string(),
|
|
32
|
+
subscriptionId: zod_1.z.string().optional(),
|
|
33
|
+
data: models_1.JsonValueSchema.optional(),
|
|
34
|
+
});
|
|
35
|
+
CloudPaymentsPayCommand.ResponseSchema = zod_1.z.object({ code: zod_1.z.number() });
|
|
36
|
+
})(CloudPaymentsPayCommand || (exports.CloudPaymentsPayCommand = CloudPaymentsPayCommand = {}));
|
|
37
|
+
var CloudPaymentsRecurrentCommand;
|
|
38
|
+
(function (CloudPaymentsRecurrentCommand) {
|
|
39
|
+
CloudPaymentsRecurrentCommand.RequestSchema = zod_1.z.object({
|
|
40
|
+
id: zod_1.z.string(),
|
|
41
|
+
accountId: zod_1.z.string(),
|
|
42
|
+
status: zod_1.z.string(),
|
|
43
|
+
failedTransactionsNumber: zod_1.z.number().optional(),
|
|
44
|
+
lastTransactionDate: zod_1.z.string().optional(),
|
|
45
|
+
});
|
|
46
|
+
CloudPaymentsRecurrentCommand.ResponseSchema = zod_1.z.object({ code: zod_1.z.number() });
|
|
47
|
+
})(CloudPaymentsRecurrentCommand || (exports.CloudPaymentsRecurrentCommand = CloudPaymentsRecurrentCommand = {}));
|
|
@@ -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("./cloud-payments.command"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BuyProductCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var BuyProductCommand;
|
|
7
|
+
(function (BuyProductCommand) {
|
|
8
|
+
BuyProductCommand.RequestParamSchema = zod_1.z.object({
|
|
9
|
+
uuid: zod_1.z.string().uuid(),
|
|
10
|
+
});
|
|
11
|
+
BuyProductCommand.RequestSchema = zod_1.z.object({
|
|
12
|
+
promocode: zod_1.z.string().min(1).max(64).optional(),
|
|
13
|
+
});
|
|
14
|
+
BuyProductCommand.ResponseSchema = zod_1.z.object({
|
|
15
|
+
data: models_1.CloudPaymentsWidgetSchema,
|
|
16
|
+
});
|
|
17
|
+
})(BuyProductCommand || (exports.BuyProductCommand = BuyProductCommand = {}));
|
|
@@ -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("./buy-product.command"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BuySubscriptionCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var BuySubscriptionCommand;
|
|
7
|
+
(function (BuySubscriptionCommand) {
|
|
8
|
+
BuySubscriptionCommand.RequestParamSchema = zod_1.z.object({
|
|
9
|
+
uuid: zod_1.z.string().uuid(),
|
|
10
|
+
});
|
|
11
|
+
BuySubscriptionCommand.RequestSchema = zod_1.z.object({
|
|
12
|
+
promocode: zod_1.z.string().min(1).max(64).optional(),
|
|
13
|
+
});
|
|
14
|
+
BuySubscriptionCommand.ResponseSchema = zod_1.z.object({
|
|
15
|
+
data: models_1.CloudPaymentsWidgetSchema,
|
|
16
|
+
});
|
|
17
|
+
})(BuySubscriptionCommand || (exports.BuySubscriptionCommand = BuySubscriptionCommand = {}));
|
|
@@ -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("./buy-subscription.command"), 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("./write-off.command"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WriteOffCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
var WriteOffCommand;
|
|
7
|
+
(function (WriteOffCommand) {
|
|
8
|
+
WriteOffCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
sum: zod_1.z.number().int().positive(),
|
|
10
|
+
description: zod_1.z.string().min(1).max(500).default('Использование токенов'),
|
|
11
|
+
});
|
|
12
|
+
WriteOffCommand.ResponseSchema = zod_1.z.object({
|
|
13
|
+
data: zod_1.z.object({
|
|
14
|
+
transactionId: zod_1.z.string().uuid(),
|
|
15
|
+
status: zod_1.z.nativeEnum(constants_1.TRANSACTION_STATUS),
|
|
16
|
+
remainingSum: zod_1.z.number().int(),
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
})(WriteOffCommand || (exports.WriteOffCommand = WriteOffCommand = {}));
|
|
@@ -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("./upsert-unregistered-user.command"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpsertUnregisteredUserCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var UpsertUnregisteredUserCommand;
|
|
6
|
+
(function (UpsertUnregisteredUserCommand) {
|
|
7
|
+
UpsertUnregisteredUserCommand.RequestSchema = zod_1.z.object({});
|
|
8
|
+
UpsertUnregisteredUserCommand.ResponseSchema = zod_1.z.object({
|
|
9
|
+
data: zod_1.z.object({
|
|
10
|
+
unregisteredUserId: zod_1.z.string().uuid(),
|
|
11
|
+
accessToken: zod_1.z.string(),
|
|
12
|
+
tokenBalance: zod_1.z.number().int(),
|
|
13
|
+
expiresAt: zod_1.z.coerce.date(),
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
})(UpsertUnregisteredUserCommand || (exports.UpsertUnregisteredUserCommand = UpsertUnregisteredUserCommand = {}));
|
|
@@ -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("./user-reaction.enum"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.USER_REACTION = void 0;
|
|
4
|
+
var USER_REACTION;
|
|
5
|
+
(function (USER_REACTION) {
|
|
6
|
+
USER_REACTION["LIKE"] = "like";
|
|
7
|
+
USER_REACTION["DISLIKE"] = "dislike";
|
|
8
|
+
})(USER_REACTION || (exports.USER_REACTION = USER_REACTION = {}));
|
|
@@ -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("./enums"), exports);
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ERRORS = void 0;
|
|
4
|
+
exports.ERRORS = {
|
|
5
|
+
UNKNOWN_ERROR: {
|
|
6
|
+
message: 'Неизвестная ошибка',
|
|
7
|
+
code: 'UNKNOWN_001',
|
|
8
|
+
httpCode: 500,
|
|
9
|
+
},
|
|
10
|
+
// TENANT
|
|
11
|
+
TENANT_MISSING_SITE_ID: {
|
|
12
|
+
message: 'Missing X-Site-Id header',
|
|
13
|
+
code: 'TENANT_001',
|
|
14
|
+
httpCode: 400,
|
|
15
|
+
},
|
|
16
|
+
TENANT_UNKNOWN_SITE_ID: {
|
|
17
|
+
message: 'Unknown siteId',
|
|
18
|
+
code: 'TENANT_002',
|
|
19
|
+
httpCode: 400,
|
|
20
|
+
},
|
|
21
|
+
TENANT_MISSING_JWT_SECRET: {
|
|
22
|
+
message: 'Missing JWT secret for site',
|
|
23
|
+
code: 'TENANT_003',
|
|
24
|
+
httpCode: 500,
|
|
25
|
+
},
|
|
26
|
+
// AUTH
|
|
27
|
+
AUTH_REGISTER_CONFLICT: {
|
|
28
|
+
message: 'Пользователь с этим email уже существует',
|
|
29
|
+
code: 'AUTH_001',
|
|
30
|
+
httpCode: 409,
|
|
31
|
+
},
|
|
32
|
+
AUTH_CREATE_USER_ERROR: {
|
|
33
|
+
message: 'Ошибка при создании пользователя',
|
|
34
|
+
code: 'AUTH_002',
|
|
35
|
+
httpCode: 500,
|
|
36
|
+
},
|
|
37
|
+
AUTH_LOGIN_ERROR: {
|
|
38
|
+
message: 'Неверный email или пароль',
|
|
39
|
+
code: 'AUTH_003',
|
|
40
|
+
httpCode: 401,
|
|
41
|
+
},
|
|
42
|
+
AUTH_ACCOUNT_NOT_ACTIVE: {
|
|
43
|
+
message: 'Аккаунт не активен',
|
|
44
|
+
code: 'AUTH_004',
|
|
45
|
+
httpCode: 401,
|
|
46
|
+
},
|
|
47
|
+
// USER
|
|
48
|
+
USER_NOT_FOUND: {
|
|
49
|
+
message: 'Пользователь не найден',
|
|
50
|
+
code: 'USER_001',
|
|
51
|
+
httpCode: 404,
|
|
52
|
+
},
|
|
53
|
+
USER_NOT_ID: {
|
|
54
|
+
message: 'Пользователь не найден по ID',
|
|
55
|
+
code: 'USER_002',
|
|
56
|
+
httpCode: 404,
|
|
57
|
+
},
|
|
58
|
+
USER_NOT_EMAIL: {
|
|
59
|
+
message: 'Пользователь не найден по email',
|
|
60
|
+
code: 'USER_003',
|
|
61
|
+
httpCode: 404,
|
|
62
|
+
},
|
|
63
|
+
USER_NOT_CREATED: {
|
|
64
|
+
message: 'Ошибка при создании пользователя',
|
|
65
|
+
code: 'USER_004',
|
|
66
|
+
httpCode: 500,
|
|
67
|
+
},
|
|
68
|
+
// UNREGISTERED USER
|
|
69
|
+
UNREGISTERED_USER_NOT_FOUND: {
|
|
70
|
+
message: 'Пользователь не найден',
|
|
71
|
+
code: 'UNREGISTERED_USER_001',
|
|
72
|
+
httpCode: 404,
|
|
73
|
+
},
|
|
74
|
+
UNREGISTERED_USER_SESSION_LIMIT: {
|
|
75
|
+
message: 'Слишком много активных сессий',
|
|
76
|
+
code: 'UNREGISTERED_USER_002',
|
|
77
|
+
httpCode: 429,
|
|
78
|
+
},
|
|
79
|
+
UNREGISTERED_USER_CREATE_ERROR: {
|
|
80
|
+
message: 'Ошибка при создании пользователя',
|
|
81
|
+
code: 'UNREGISTERED_USER_003',
|
|
82
|
+
httpCode: 500,
|
|
83
|
+
},
|
|
84
|
+
UNREGISTERED_USER_UPDATE_ERROR: {
|
|
85
|
+
message: 'Ошибка при обновлении пользователя',
|
|
86
|
+
code: 'UNREGISTERED_USER_004',
|
|
87
|
+
httpCode: 500,
|
|
88
|
+
},
|
|
89
|
+
UNREGISTERED_USER_FIND_ERROR: {
|
|
90
|
+
message: 'Ошибка при поиске пользователя',
|
|
91
|
+
code: 'UNREGISTERED_USER_005',
|
|
92
|
+
httpCode: 500,
|
|
93
|
+
},
|
|
94
|
+
UNREGISTERED_USER_DELETE_ERROR: {
|
|
95
|
+
message: 'Ошибка при удалении пользователя',
|
|
96
|
+
code: 'UNREGISTERED_USER_006',
|
|
97
|
+
httpCode: 500,
|
|
98
|
+
},
|
|
99
|
+
// PRODUCT
|
|
100
|
+
PRODUCT_NOT_FOUND: {
|
|
101
|
+
message: 'Продукт не найден',
|
|
102
|
+
code: 'PRODUCT_001',
|
|
103
|
+
httpCode: 404,
|
|
104
|
+
},
|
|
105
|
+
PRODUCT_FIND_ERROR: {
|
|
106
|
+
message: 'Ошибка при поиске продуктов',
|
|
107
|
+
code: 'PRODUCT_002',
|
|
108
|
+
httpCode: 500,
|
|
109
|
+
},
|
|
110
|
+
PRODUCT_CREATE_ERROR: {
|
|
111
|
+
message: 'Ошибка при создании продукта',
|
|
112
|
+
code: 'PRODUCT_003',
|
|
113
|
+
httpCode: 500,
|
|
114
|
+
},
|
|
115
|
+
PRODUCT_BUY_ERROR: {
|
|
116
|
+
message: 'Ошибка при покупке продукта',
|
|
117
|
+
code: 'PRODUCT_004',
|
|
118
|
+
httpCode: 500,
|
|
119
|
+
},
|
|
120
|
+
// SUBSCRIPTION
|
|
121
|
+
SUBSCRIPTION_NOT_FOUND: {
|
|
122
|
+
message: 'Подписка не найдена',
|
|
123
|
+
code: 'SUBSCRIPTION_001',
|
|
124
|
+
httpCode: 404,
|
|
125
|
+
},
|
|
126
|
+
SUBSCRIPTION_FIND_ERROR: {
|
|
127
|
+
message: 'Ошибка при поиске подписок',
|
|
128
|
+
code: 'SUBSCRIPTION_002',
|
|
129
|
+
httpCode: 500,
|
|
130
|
+
},
|
|
131
|
+
SUBSCRIPTION_CREATE_ERROR: {
|
|
132
|
+
message: 'Ошибка при создании подписки',
|
|
133
|
+
code: 'SUBSCRIPTION_003',
|
|
134
|
+
httpCode: 500,
|
|
135
|
+
},
|
|
136
|
+
SUBSCRIPTION_BUY_ERROR: {
|
|
137
|
+
message: 'Ошибка при покупке подписки',
|
|
138
|
+
code: 'SUBSCRIPTION_004',
|
|
139
|
+
httpCode: 500,
|
|
140
|
+
},
|
|
141
|
+
SUBSCRIPTION_ALREADY_ACTIVE: {
|
|
142
|
+
message: 'У пользователя уже есть активная подписка',
|
|
143
|
+
code: 'SUBSCRIPTION_005',
|
|
144
|
+
httpCode: 409,
|
|
145
|
+
},
|
|
146
|
+
// ORDER
|
|
147
|
+
ORDER_NOT_FOUND: {
|
|
148
|
+
message: 'Заказ не найден',
|
|
149
|
+
code: 'ORDER_001',
|
|
150
|
+
httpCode: 404,
|
|
151
|
+
},
|
|
152
|
+
ORDER_CREATE_ERROR: {
|
|
153
|
+
message: 'Ошибка при создании заказа',
|
|
154
|
+
code: 'ORDER_002',
|
|
155
|
+
httpCode: 500,
|
|
156
|
+
},
|
|
157
|
+
ORDER_RECEIPT_ERROR: {
|
|
158
|
+
message: 'Ошибка при формировании чека',
|
|
159
|
+
code: 'ORDER_003',
|
|
160
|
+
httpCode: 500,
|
|
161
|
+
},
|
|
162
|
+
ORDER_UPDATE_ERROR: {
|
|
163
|
+
message: 'Ошибка при обновлении заказа',
|
|
164
|
+
code: 'ORDER_004',
|
|
165
|
+
httpCode: 500,
|
|
166
|
+
},
|
|
167
|
+
// PAYMENT
|
|
168
|
+
PAYMENT_HISTORY_ERROR: {
|
|
169
|
+
message: 'Ошибка при получении истории оплат',
|
|
170
|
+
code: 'PAYMENT_001',
|
|
171
|
+
httpCode: 500,
|
|
172
|
+
},
|
|
173
|
+
PAYMENT_PROCESS_ERROR: {
|
|
174
|
+
message: 'Ошибка при обработке платежа',
|
|
175
|
+
code: 'PAYMENT_002',
|
|
176
|
+
httpCode: 500,
|
|
177
|
+
},
|
|
178
|
+
// TRANSACTION
|
|
179
|
+
TRANSACTION_WRITE_OFF_ERROR: {
|
|
180
|
+
message: 'Ошибка при списании токенов',
|
|
181
|
+
code: 'TRANSACTION_001',
|
|
182
|
+
httpCode: 500,
|
|
183
|
+
},
|
|
184
|
+
// S3
|
|
185
|
+
S3_GET_FILE_STREAM_ERROR: {
|
|
186
|
+
message: 'Ошибка при получении потока файла',
|
|
187
|
+
code: 'S3_001',
|
|
188
|
+
httpCode: 500,
|
|
189
|
+
},
|
|
190
|
+
S3_UPLOAD_STREAM_ERROR: {
|
|
191
|
+
message: 'Ошибка при загрузке потока файла',
|
|
192
|
+
code: 'S3_002',
|
|
193
|
+
httpCode: 500,
|
|
194
|
+
},
|
|
195
|
+
S3_UPLOAD_ERROR: {
|
|
196
|
+
message: 'Ошибка при загрузке файла',
|
|
197
|
+
code: 'S3_003',
|
|
198
|
+
httpCode: 500,
|
|
199
|
+
},
|
|
200
|
+
S3_DELETE_OBJECTS_ERROR: {
|
|
201
|
+
message: 'Ошибка при удалении файлов',
|
|
202
|
+
code: 'S3_004',
|
|
203
|
+
httpCode: 500,
|
|
204
|
+
},
|
|
205
|
+
// IMAGE GENERATION
|
|
206
|
+
IMAGE_GENERATION_MODEL_NOT_FOUND: {
|
|
207
|
+
message: 'Модель генерации изображений не найдена',
|
|
208
|
+
code: 'IMAGE_GENERATION_001',
|
|
209
|
+
httpCode: 404,
|
|
210
|
+
},
|
|
211
|
+
IMAGE_GENERATION_MODEL_INACTIVE: {
|
|
212
|
+
message: 'Модель генерации изображений недоступна',
|
|
213
|
+
code: 'IMAGE_GENERATION_002',
|
|
214
|
+
httpCode: 400,
|
|
215
|
+
},
|
|
216
|
+
IMAGE_GENERATION_MODEL_NOT_AVAILABLE: {
|
|
217
|
+
message: 'Модель недоступна по вашей подписке',
|
|
218
|
+
code: 'IMAGE_GENERATION_009',
|
|
219
|
+
httpCode: 403,
|
|
220
|
+
},
|
|
221
|
+
IMAGE_GENERATION_NOT_ENOUGH_TOKENS: {
|
|
222
|
+
message: 'Недостаточно токенов',
|
|
223
|
+
code: 'IMAGE_GENERATION_003',
|
|
224
|
+
httpCode: 402,
|
|
225
|
+
},
|
|
226
|
+
IMAGE_GENERATION_JOB_NOT_FOUND: {
|
|
227
|
+
message: 'Задача генерации изображений не найдена',
|
|
228
|
+
code: 'IMAGE_GENERATION_004',
|
|
229
|
+
httpCode: 404,
|
|
230
|
+
},
|
|
231
|
+
IMAGE_GENERATION_JOB_NOT_IN_FAILED_STATE_TO_RETRY: {
|
|
232
|
+
message: 'Задача не в статусе FAILED',
|
|
233
|
+
code: 'IMAGE_GENERATION_008',
|
|
234
|
+
httpCode: 400,
|
|
235
|
+
},
|
|
236
|
+
IMAGE_GENERATION_CALLBACK_UNAUTHORIZED: {
|
|
237
|
+
message: 'Неверный токен коллбека',
|
|
238
|
+
code: 'IMAGE_GENERATION_005',
|
|
239
|
+
httpCode: 401,
|
|
240
|
+
},
|
|
241
|
+
IMAGE_GENERATION_PROXY_ERROR: {
|
|
242
|
+
message: 'Ошибка при запросе к AI proxy',
|
|
243
|
+
code: 'IMAGE_GENERATION_006',
|
|
244
|
+
httpCode: 500,
|
|
245
|
+
},
|
|
246
|
+
IMAGE_GENERATION_UPLOAD_ERROR: {
|
|
247
|
+
message: 'Ошибка при загрузке изображений',
|
|
248
|
+
code: 'IMAGE_GENERATION_007',
|
|
249
|
+
httpCode: 500,
|
|
250
|
+
},
|
|
251
|
+
IMAGE_GENERATION_CONFIG_BUILD_ERROR: {
|
|
252
|
+
message: 'Ошибка при формировании конфига',
|
|
253
|
+
code: 'IMAGE_GENERATION_010',
|
|
254
|
+
httpCode: 500,
|
|
255
|
+
},
|
|
256
|
+
IMAGE_GENERATION_VENDOR_FIND_ERROR: {
|
|
257
|
+
message: 'Ошибка при получении вендоров',
|
|
258
|
+
code: 'IMAGE_GENERATION_011',
|
|
259
|
+
httpCode: 500,
|
|
260
|
+
},
|
|
261
|
+
IMAGE_GENERATION_MODEL_FIND_ERROR: {
|
|
262
|
+
message: 'Ошибка при получении моделей',
|
|
263
|
+
code: 'IMAGE_GENERATION_012',
|
|
264
|
+
httpCode: 500,
|
|
265
|
+
},
|
|
266
|
+
IMAGE_GENERATION_PRESET_FIND_ERROR: {
|
|
267
|
+
message: 'Ошибка при получении пресетов',
|
|
268
|
+
code: 'IMAGE_GENERATION_013',
|
|
269
|
+
httpCode: 500,
|
|
270
|
+
},
|
|
271
|
+
// FILES
|
|
272
|
+
FILE_NOT_FOUND: {
|
|
273
|
+
message: 'Файл не найден',
|
|
274
|
+
code: 'FILE_001',
|
|
275
|
+
httpCode: 404,
|
|
276
|
+
},
|
|
277
|
+
FILE_TYPE_NOT_SUPPORTED: {
|
|
278
|
+
message: 'Тип файла не поддерживается',
|
|
279
|
+
code: 'FILE_002',
|
|
280
|
+
httpCode: 400,
|
|
281
|
+
},
|
|
282
|
+
FILE_UPLOAD_ERROR: {
|
|
283
|
+
message: 'Ошибка при загрузке файла',
|
|
284
|
+
code: 'FILE_003',
|
|
285
|
+
httpCode: 500,
|
|
286
|
+
},
|
|
287
|
+
// PROMPT MODERATION
|
|
288
|
+
PROMPT_MODERATION_ERROR: {
|
|
289
|
+
message: 'Ошибка при проверке запроса',
|
|
290
|
+
code: 'MODERATION_001',
|
|
291
|
+
httpCode: 500,
|
|
292
|
+
},
|
|
293
|
+
PROMPT_MODERATION_NOT_COMPLIANT: {
|
|
294
|
+
message: 'Запрос был отклонен модерацией',
|
|
295
|
+
code: 'MODERATION_002',
|
|
296
|
+
httpCode: 400,
|
|
297
|
+
},
|
|
298
|
+
};
|