@ai-grator/api 0.0.6 → 0.0.8
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/admin/endpoints/admin.ts +3 -0
- package/admin/endpoints/commands/create-admin-partner-bonus-operation.command.ts +2 -1
- package/admin/enums/admin-bonus-operation-balance-type.enum.ts +4 -0
- package/admin/enums/index.ts +1 -0
- package/admin/models/admin-bonus-operation-response.schema.ts +3 -1
- package/admin/models/admin-partner-bonus-operation-response.schema.ts +2 -1
- package/billing/endpoints/index.ts +1 -0
- package/billing/endpoints/queries/get-admin-stats.query.ts +29 -0
- package/billing/endpoints/queries/index.ts +1 -0
- package/billing/enums/index.ts +1 -0
- package/billing/enums/model-type.enum.ts +5 -0
- package/billing/index.ts +3 -0
- package/billing/models/admin-stats-response.schema.ts +29 -0
- package/billing/models/index.ts +1 -0
- package/build/admin/endpoints/admin.d.ts +1 -0
- package/build/admin/endpoints/admin.d.ts.map +1 -1
- package/build/admin/endpoints/admin.js +2 -0
- package/build/admin/endpoints/commands/create-admin-partner-bonus-operation.command.d.ts +7 -1
- package/build/admin/endpoints/commands/create-admin-partner-bonus-operation.command.d.ts.map +1 -1
- package/build/admin/endpoints/commands/create-admin-partner-bonus-operation.command.js +1 -0
- package/build/admin/endpoints/queries/get-admin-partner-bonus-operations.query.d.ts +2 -0
- package/build/admin/endpoints/queries/get-admin-partner-bonus-operations.query.d.ts.map +1 -1
- package/build/admin/enums/admin-bonus-operation-balance-type.enum.d.ts +5 -0
- package/build/admin/enums/admin-bonus-operation-balance-type.enum.d.ts.map +1 -0
- package/build/admin/enums/admin-bonus-operation-balance-type.enum.js +8 -0
- package/build/admin/enums/index.d.ts +1 -0
- package/build/admin/enums/index.d.ts.map +1 -1
- package/build/admin/enums/index.js +1 -0
- package/build/admin/models/admin-bonus-operation-response.schema.d.ts +3 -1
- package/build/admin/models/admin-bonus-operation-response.schema.d.ts.map +1 -1
- package/build/admin/models/admin-bonus-operation-response.schema.js +2 -0
- package/build/admin/models/admin-partner-bonus-operation-response.schema.d.ts +2 -1
- package/build/admin/models/admin-partner-bonus-operation-response.schema.d.ts.map +1 -1
- package/build/admin/models/admin-partner-bonus-operation-response.schema.js +1 -0
- package/build/billing/endpoints/index.d.ts +2 -0
- package/build/billing/endpoints/index.d.ts.map +1 -0
- package/build/billing/endpoints/index.js +17 -0
- package/build/billing/endpoints/queries/get-admin-stats.query.d.ts +61 -0
- package/build/billing/endpoints/queries/get-admin-stats.query.d.ts.map +1 -0
- package/build/billing/endpoints/queries/get-admin-stats.query.js +26 -0
- package/build/billing/endpoints/queries/index.d.ts +2 -0
- package/build/billing/endpoints/queries/index.d.ts.map +1 -0
- package/build/billing/endpoints/queries/index.js +17 -0
- package/build/billing/enums/index.d.ts +2 -0
- package/build/billing/enums/index.d.ts.map +1 -0
- package/build/billing/enums/index.js +17 -0
- package/build/billing/enums/model-type.enum.d.ts +6 -0
- package/build/billing/enums/model-type.enum.d.ts.map +1 -0
- package/build/billing/enums/model-type.enum.js +9 -0
- package/build/billing/index.d.ts +4 -0
- package/build/billing/index.d.ts.map +1 -0
- package/build/billing/index.js +19 -0
- package/build/billing/models/admin-stats-response.schema.d.ts +37 -0
- package/build/billing/models/admin-stats-response.schema.d.ts.map +1 -0
- package/build/billing/models/admin-stats-response.schema.js +25 -0
- package/build/billing/models/index.d.ts +2 -0
- package/build/billing/models/index.d.ts.map +1 -0
- package/build/billing/models/index.js +17 -0
- package/build/errors/errors.d.ts +5 -0
- package/build/errors/errors.d.ts.map +1 -1
- package/build/errors/errors.js +5 -0
- package/build/scripts/generate-openapi.js +4 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/errors/errors.ts +5 -0
- package/package.json +1 -1
- package/scripts/generate-openapi.ts +8 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { MODEL_TYPE } from '../enums';
|
|
3
|
+
declare const ModelRevenueItemSchema: z.ZodObject<{
|
|
4
|
+
modelName: z.ZodString;
|
|
5
|
+
modelType: z.ZodEnum<typeof MODEL_TYPE>;
|
|
6
|
+
requestCount: z.ZodNumber;
|
|
7
|
+
revenue: z.ZodNumber;
|
|
8
|
+
revenueShare: z.ZodNumber;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
declare const DailyDataPointSchema: z.ZodObject<{
|
|
11
|
+
date: z.ZodString;
|
|
12
|
+
deposits: z.ZodNumber;
|
|
13
|
+
charges: z.ZodNumber;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export declare const AdminStatsResponseSchema: z.ZodObject<{
|
|
16
|
+
totalDeposits: z.ZodNumber;
|
|
17
|
+
totalCharges: z.ZodNumber;
|
|
18
|
+
depositCount: z.ZodNumber;
|
|
19
|
+
chargeCount: z.ZodNumber;
|
|
20
|
+
modelRevenue: z.ZodArray<z.ZodObject<{
|
|
21
|
+
modelName: z.ZodString;
|
|
22
|
+
modelType: z.ZodEnum<typeof MODEL_TYPE>;
|
|
23
|
+
requestCount: z.ZodNumber;
|
|
24
|
+
revenue: z.ZodNumber;
|
|
25
|
+
revenueShare: z.ZodNumber;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
dailyBreakdown: z.ZodArray<z.ZodObject<{
|
|
28
|
+
date: z.ZodString;
|
|
29
|
+
deposits: z.ZodNumber;
|
|
30
|
+
charges: z.ZodNumber;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export type AdminStatsResponseSchemaType = z.infer<typeof AdminStatsResponseSchema>;
|
|
34
|
+
export type ModelRevenueItem = z.infer<typeof ModelRevenueItemSchema>;
|
|
35
|
+
export type DailyDataPoint = z.infer<typeof DailyDataPointSchema>;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=admin-stats-response.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-stats-response.schema.d.ts","sourceRoot":"","sources":["../../../billing/models/admin-stats-response.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,QAAA,MAAM,sBAAsB;;;;;;iBAM1B,CAAC;AAEH,QAAA,MAAM,oBAAoB;;;;iBAIxB,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;iBAOnC,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AACpF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AdminStatsResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const enums_1 = require("../enums");
|
|
6
|
+
const ModelRevenueItemSchema = zod_1.z.object({
|
|
7
|
+
modelName: zod_1.z.string(),
|
|
8
|
+
modelType: zod_1.z.enum(enums_1.MODEL_TYPE),
|
|
9
|
+
requestCount: zod_1.z.number().int().nonnegative(),
|
|
10
|
+
revenue: zod_1.z.number(),
|
|
11
|
+
revenueShare: zod_1.z.number(),
|
|
12
|
+
});
|
|
13
|
+
const DailyDataPointSchema = zod_1.z.object({
|
|
14
|
+
date: zod_1.z.string(),
|
|
15
|
+
deposits: zod_1.z.number(),
|
|
16
|
+
charges: zod_1.z.number(),
|
|
17
|
+
});
|
|
18
|
+
exports.AdminStatsResponseSchema = zod_1.z.object({
|
|
19
|
+
totalDeposits: zod_1.z.number(),
|
|
20
|
+
totalCharges: zod_1.z.number(),
|
|
21
|
+
depositCount: zod_1.z.number().int().nonnegative(),
|
|
22
|
+
chargeCount: zod_1.z.number().int().nonnegative(),
|
|
23
|
+
modelRevenue: zod_1.z.array(ModelRevenueItemSchema),
|
|
24
|
+
dailyBreakdown: zod_1.z.array(DailyDataPointSchema),
|
|
25
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../billing/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
|
|
@@ -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("./admin-stats-response.schema"), exports);
|
package/build/errors/errors.d.ts
CHANGED
|
@@ -560,6 +560,11 @@ export declare const ERRORS: {
|
|
|
560
560
|
readonly code: "ADMIN.CANNOT_BAN_ADMIN";
|
|
561
561
|
readonly message: "Невозможно заблокировать администратора";
|
|
562
562
|
};
|
|
563
|
+
readonly STATS_ERROR: {
|
|
564
|
+
readonly httpCode: 500;
|
|
565
|
+
readonly code: "ADMIN.STATS_ERROR";
|
|
566
|
+
readonly message: "Не удалось получить статистику";
|
|
567
|
+
};
|
|
563
568
|
};
|
|
564
569
|
readonly REFERRAL: {
|
|
565
570
|
readonly SELF_REFERRAL: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsrBT,CAAC"}
|
package/build/errors/errors.js
CHANGED
|
@@ -563,6 +563,11 @@ exports.ERRORS = {
|
|
|
563
563
|
code: 'ADMIN.CANNOT_BAN_ADMIN',
|
|
564
564
|
message: 'Невозможно заблокировать администратора',
|
|
565
565
|
},
|
|
566
|
+
STATS_ERROR: {
|
|
567
|
+
httpCode: 500,
|
|
568
|
+
code: 'ADMIN.STATS_ERROR',
|
|
569
|
+
message: 'Не удалось получить статистику',
|
|
570
|
+
},
|
|
566
571
|
},
|
|
567
572
|
REFERRAL: {
|
|
568
573
|
SELF_REFERRAL: {
|
|
@@ -20,6 +20,7 @@ const get_admin_referral_config_query_1 = require("../admin/endpoints/queries/ge
|
|
|
20
20
|
const get_admin_users_query_1 = require("../admin/endpoints/queries/get-admin-users.query");
|
|
21
21
|
const get_admin_user_query_1 = require("../admin/endpoints/queries/get-admin-user.query");
|
|
22
22
|
const get_admin_user_transactions_query_1 = require("../admin/endpoints/queries/get-admin-user-transactions.query");
|
|
23
|
+
const get_admin_stats_query_1 = require("../billing/endpoints/queries/get-admin-stats.query");
|
|
23
24
|
const auth_1 = require("../auth/endpoints/auth");
|
|
24
25
|
const change_password_command_1 = require("../auth/endpoints/commands/change-password.command");
|
|
25
26
|
const delete_account_command_1 = require("../auth/endpoints/commands/delete-account.command");
|
|
@@ -225,6 +226,8 @@ async function main() {
|
|
|
225
226
|
registerSchema('AdminGetUserResponse', get_admin_user_query_1.GetAdminUserQueryResponse);
|
|
226
227
|
registerSchema('AdminGetUserTransactionsQuery', get_admin_user_transactions_query_1.GetAdminUserTransactionsQueryQuery);
|
|
227
228
|
registerSchema('AdminGetUserTransactionsResponse', get_admin_user_transactions_query_1.GetAdminUserTransactionsQueryResponse);
|
|
229
|
+
registerSchema('AdminGetStatsQuery', get_admin_stats_query_1.GetAdminStatsQueryQuery);
|
|
230
|
+
registerSchema('AdminGetStatsResponse', get_admin_stats_query_1.GetAdminStatsQueryResponse);
|
|
228
231
|
const authContracts = [
|
|
229
232
|
register_command_1.RegisterCommand,
|
|
230
233
|
login_command_1.LoginCommand,
|
|
@@ -288,6 +291,7 @@ async function main() {
|
|
|
288
291
|
get_admin_users_query_1.GetAdminUsersQuery,
|
|
289
292
|
get_admin_user_query_1.GetAdminUserQuery,
|
|
290
293
|
get_admin_user_transactions_query_1.GetAdminUserTransactionsQuery,
|
|
294
|
+
get_admin_stats_query_1.GetAdminStatsQuery,
|
|
291
295
|
];
|
|
292
296
|
for (const contract of authContracts) {
|
|
293
297
|
const method = contract.method.toLowerCase();
|