@remnawave/backend-contract 0.3.49 → 0.3.51

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.
@@ -26,5 +26,8 @@ export declare const USERS_ROUTES: {
26
26
  };
27
27
  readonly GET_BY_TELEGRAM_ID: "tg";
28
28
  readonly GET_BY_EMAIL: "email";
29
+ readonly BANDWIDTH_STATS: {
30
+ readonly GET_USAGE_BY_RANGE: "bandwidth-stats/usage-by-range";
31
+ };
29
32
  };
30
33
  //# sourceMappingURL=users.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../api/controllers/users.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Bf,CAAC"}
1
+ {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../api/controllers/users.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Bf,CAAC"}
@@ -29,4 +29,7 @@ exports.USERS_ROUTES = {
29
29
  },
30
30
  GET_BY_TELEGRAM_ID: 'tg',
31
31
  GET_BY_EMAIL: 'email',
32
+ BANDWIDTH_STATS: {
33
+ GET_USAGE_BY_RANGE: 'bandwidth-stats/usage-by-range',
34
+ },
32
35
  };
@@ -72,6 +72,9 @@ export declare const REST_API: {
72
72
  };
73
73
  readonly GET_BY_TELEGRAM_ID: (telegramId: string) => string;
74
74
  readonly GET_BY_EMAIL: (email: string) => string;
75
+ readonly BANDWIDTH_STATS: {
76
+ readonly GET_USAGE_BY_RANGE: (uuid: string) => string;
77
+ };
75
78
  };
76
79
  readonly SUBSCRIPTION: {
77
80
  readonly GET: (shortUuid: string) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AACpC,eAAO,MAAM,YAAY,EAAG,UAAmB,CAAC;AAChD,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AAEjD,eAAO,MAAM,QAAQ;;;;;;;;gCAQE,MAAM;;;;;;;;gCASN,MAAM;;;iCAIL,MAAM;iCAEN,MAAM;iCAEN,MAAM;gCAEP,MAAM;;;;;;;;;;;;;;kDAeY,MAAM;;;;;;;;;;qCAWnB,MAAM;gDAEK,MAAM;6CAET,MAAM;8DAEW,MAAM;6CAEvB,MAAM;sCAEb,MAAM;qCAEP,MAAM;qCAEN,MAAM;;;4CAIC,MAAM;;;;;;;;;;;;;kDAcA,MAAM;uCAEjB,MAAM;;;kCAIX,MAAM;0CAEE,MAAM;uCAET,MAAM;;;;;;;;gCASb,MAAM;iCAEL,MAAM;;;;;;;;;;;;;;;0CAgBG,MAAM;;;;;;;CAQ7B,CAAC"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AACpC,eAAO,MAAM,YAAY,EAAG,UAAmB,CAAC;AAChD,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AAEjD,eAAO,MAAM,QAAQ;;;;;;;;gCAQE,MAAM;;;;;;;;gCASN,MAAM;;;iCAIL,MAAM;iCAEN,MAAM;iCAEN,MAAM;gCAEP,MAAM;;;;;;;;;;;;;;kDAeY,MAAM;;;;;;;;;;qCAWnB,MAAM;gDAEK,MAAM;6CAET,MAAM;8DAEW,MAAM;6CAEvB,MAAM;sCAEb,MAAM;qCAEP,MAAM;qCAEN,MAAM;;;4CAIC,MAAM;;;;;;;;;;;;;kDAcA,MAAM;uCAEjB,MAAM;;gDAGG,MAAM;;;;kCAKpB,MAAM;0CAEE,MAAM;uCAET,MAAM;;;;;;;;gCASb,MAAM;iCAEL,MAAM;;;;;;;;;;;;;;;0CAgBG,MAAM;;;;;;;CAQ7B,CAAC"}
@@ -109,6 +109,9 @@ exports.REST_API = {
109
109
  },
110
110
  GET_BY_TELEGRAM_ID: (telegramId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_TELEGRAM_ID}/${telegramId}`,
111
111
  GET_BY_EMAIL: (email) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_EMAIL}/${email}`,
112
+ BANDWIDTH_STATS: {
113
+ GET_USAGE_BY_RANGE: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BANDWIDTH_STATS.GET_USAGE_BY_RANGE}/${uuid}`,
114
+ },
112
115
  },
113
116
  SUBSCRIPTION: {
114
117
  GET: (shortUuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.GET}/${shortUuid}`,
@@ -0,0 +1,63 @@
1
+ import { z } from 'zod';
2
+ export declare namespace GetUserUsageByRangeCommand {
3
+ const url: (uuid: string) => string;
4
+ const TSQ_url: string;
5
+ const RequestSchema: z.ZodObject<{
6
+ uuid: z.ZodString;
7
+ }, "strip", z.ZodTypeAny, {
8
+ uuid: string;
9
+ }, {
10
+ uuid: string;
11
+ }>;
12
+ type Request = z.infer<typeof RequestSchema>;
13
+ const RequestQuerySchema: z.ZodObject<{
14
+ start: z.ZodString;
15
+ end: z.ZodString;
16
+ }, "strip", z.ZodTypeAny, {
17
+ start: string;
18
+ end: string;
19
+ }, {
20
+ start: string;
21
+ end: string;
22
+ }>;
23
+ type RequestQuery = z.infer<typeof RequestQuerySchema>;
24
+ const ResponseSchema: z.ZodObject<{
25
+ response: z.ZodArray<z.ZodObject<{
26
+ userUuid: z.ZodString;
27
+ nodeUuid: z.ZodString;
28
+ nodeName: z.ZodString;
29
+ total: z.ZodNumber;
30
+ date: z.ZodEffects<z.ZodString, Date, string>;
31
+ }, "strip", z.ZodTypeAny, {
32
+ date: Date;
33
+ nodeName: string;
34
+ nodeUuid: string;
35
+ total: number;
36
+ userUuid: string;
37
+ }, {
38
+ date: string;
39
+ nodeName: string;
40
+ nodeUuid: string;
41
+ total: number;
42
+ userUuid: string;
43
+ }>, "many">;
44
+ }, "strip", z.ZodTypeAny, {
45
+ response: {
46
+ date: Date;
47
+ nodeName: string;
48
+ nodeUuid: string;
49
+ total: number;
50
+ userUuid: string;
51
+ }[];
52
+ }, {
53
+ response: {
54
+ date: string;
55
+ nodeName: string;
56
+ nodeUuid: string;
57
+ total: number;
58
+ userUuid: string;
59
+ }[];
60
+ }>;
61
+ type Response = z.infer<typeof ResponseSchema>;
62
+ }
63
+ //# sourceMappingURL=get-user-usage-by-range.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-user-usage-by-range.command.d.ts","sourceRoot":"","sources":["../../../../commands/users/get-user-usage-by-range.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,yBAAiB,0BAA0B,CAAC;IACjC,MAAM,GAAG,0BAAoD,CAAC;IAC9D,MAAM,OAAO,QAAe,CAAC;IAE7B,MAAM,aAAa;;;;;;MAExB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,kBAAkB;;;;;;;;;MAG7B,CAAC;IAEH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAEvD,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAUzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetUserUsageByRangeCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ var GetUserUsageByRangeCommand;
7
+ (function (GetUserUsageByRangeCommand) {
8
+ GetUserUsageByRangeCommand.url = api_1.REST_API.USERS.BANDWIDTH_STATS.GET_USAGE_BY_RANGE;
9
+ GetUserUsageByRangeCommand.TSQ_url = GetUserUsageByRangeCommand.url(':uuid');
10
+ GetUserUsageByRangeCommand.RequestSchema = zod_1.z.object({
11
+ uuid: zod_1.z.string().uuid(),
12
+ });
13
+ GetUserUsageByRangeCommand.RequestQuerySchema = zod_1.z.object({
14
+ start: zod_1.z.string(),
15
+ end: zod_1.z.string(),
16
+ });
17
+ GetUserUsageByRangeCommand.ResponseSchema = zod_1.z.object({
18
+ response: zod_1.z.array(zod_1.z.object({
19
+ userUuid: zod_1.z.string().uuid(),
20
+ nodeUuid: zod_1.z.string().uuid(),
21
+ nodeName: zod_1.z.string(),
22
+ total: zod_1.z.number(),
23
+ date: zod_1.z.string().transform((str) => new Date(str)),
24
+ })),
25
+ });
26
+ })(GetUserUsageByRangeCommand || (exports.GetUserUsageByRangeCommand = GetUserUsageByRangeCommand = {}));
@@ -11,6 +11,7 @@ export * from './get-user-by-subscription-uuid.command';
11
11
  export * from './get-user-by-telegram-id.command';
12
12
  export * from './get-user-by-username.command';
13
13
  export * from './get-user-by-uuid.command';
14
+ export * from './get-user-usage-by-range.command';
14
15
  export * from './reset-user-traffic.command';
15
16
  export * from './revoke-user-subscription.command';
16
17
  export * from './update-user.command';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/users/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/users/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC"}
@@ -27,6 +27,7 @@ __exportStar(require("./get-user-by-subscription-uuid.command"), exports);
27
27
  __exportStar(require("./get-user-by-telegram-id.command"), exports);
28
28
  __exportStar(require("./get-user-by-username.command"), exports);
29
29
  __exportStar(require("./get-user-by-uuid.command"), exports);
30
+ __exportStar(require("./get-user-usage-by-range.command"), exports);
30
31
  __exportStar(require("./reset-user-traffic.command"), exports);
31
32
  __exportStar(require("./revoke-user-subscription.command"), exports);
32
33
  __exportStar(require("./update-user.command"), exports);
@@ -479,5 +479,10 @@ export declare const ERRORS: {
479
479
  readonly message: "Keypair creation error";
480
480
  readonly httpCode: 500;
481
481
  };
482
+ readonly GET_USER_USAGE_BY_RANGE_ERROR: {
483
+ readonly code: "A091";
484
+ readonly message: "Get user usage by range error";
485
+ readonly httpCode: 500;
486
+ };
482
487
  };
483
488
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAwJY,MAAM;;;;;;;;;;wCAUN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA4IN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoJ3B,CAAC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAwJY,MAAM;;;;;;;;;;wCAUN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA4IN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyJ3B,CAAC"}
@@ -450,4 +450,9 @@ exports.ERRORS = {
450
450
  message: 'Keypair creation error',
451
451
  httpCode: 500,
452
452
  },
453
+ GET_USER_USAGE_BY_RANGE_ERROR: {
454
+ code: 'A091',
455
+ message: 'Get user usage by range error',
456
+ httpCode: 500,
457
+ },
453
458
  };
@@ -29,4 +29,7 @@ exports.USERS_ROUTES = {
29
29
  },
30
30
  GET_BY_TELEGRAM_ID: 'tg',
31
31
  GET_BY_EMAIL: 'email',
32
+ BANDWIDTH_STATS: {
33
+ GET_USAGE_BY_RANGE: 'bandwidth-stats/usage-by-range',
34
+ },
32
35
  };
@@ -109,6 +109,9 @@ exports.REST_API = {
109
109
  },
110
110
  GET_BY_TELEGRAM_ID: (telegramId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_TELEGRAM_ID}/${telegramId}`,
111
111
  GET_BY_EMAIL: (email) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_EMAIL}/${email}`,
112
+ BANDWIDTH_STATS: {
113
+ GET_USAGE_BY_RANGE: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BANDWIDTH_STATS.GET_USAGE_BY_RANGE}/${uuid}`,
114
+ },
112
115
  },
113
116
  SUBSCRIPTION: {
114
117
  GET: (shortUuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.GET}/${shortUuid}`,
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetUserUsageByRangeCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ var GetUserUsageByRangeCommand;
7
+ (function (GetUserUsageByRangeCommand) {
8
+ GetUserUsageByRangeCommand.url = api_1.REST_API.USERS.BANDWIDTH_STATS.GET_USAGE_BY_RANGE;
9
+ GetUserUsageByRangeCommand.TSQ_url = GetUserUsageByRangeCommand.url(':uuid');
10
+ GetUserUsageByRangeCommand.RequestSchema = zod_1.z.object({
11
+ uuid: zod_1.z.string().uuid(),
12
+ });
13
+ GetUserUsageByRangeCommand.RequestQuerySchema = zod_1.z.object({
14
+ start: zod_1.z.string(),
15
+ end: zod_1.z.string(),
16
+ });
17
+ GetUserUsageByRangeCommand.ResponseSchema = zod_1.z.object({
18
+ response: zod_1.z.array(zod_1.z.object({
19
+ userUuid: zod_1.z.string().uuid(),
20
+ nodeUuid: zod_1.z.string().uuid(),
21
+ nodeName: zod_1.z.string(),
22
+ total: zod_1.z.number(),
23
+ date: zod_1.z.string().transform((str) => new Date(str)),
24
+ })),
25
+ });
26
+ })(GetUserUsageByRangeCommand || (exports.GetUserUsageByRangeCommand = GetUserUsageByRangeCommand = {}));
@@ -27,6 +27,7 @@ __exportStar(require("./get-user-by-subscription-uuid.command"), exports);
27
27
  __exportStar(require("./get-user-by-telegram-id.command"), exports);
28
28
  __exportStar(require("./get-user-by-username.command"), exports);
29
29
  __exportStar(require("./get-user-by-uuid.command"), exports);
30
+ __exportStar(require("./get-user-usage-by-range.command"), exports);
30
31
  __exportStar(require("./reset-user-traffic.command"), exports);
31
32
  __exportStar(require("./revoke-user-subscription.command"), exports);
32
33
  __exportStar(require("./update-user.command"), exports);
@@ -450,4 +450,9 @@ exports.ERRORS = {
450
450
  message: 'Keypair creation error',
451
451
  httpCode: 500,
452
452
  },
453
+ GET_USER_USAGE_BY_RANGE_ERROR: {
454
+ code: 'A091',
455
+ message: 'Get user usage by range error',
456
+ httpCode: 500,
457
+ },
453
458
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "0.3.49",
3
+ "version": "0.3.51",
4
4
  "public": true,
5
5
  "license": "AGPL-3.0-only",
6
6
  "description": "A contract library for Remnawave Backend. It can be used in backend and frontend.",