@remnawave/backend-contract 2.6.33 → 2.6.34

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.
Files changed (42) hide show
  1. package/build/backend/api/controllers/node-plugins.d.ts +5 -0
  2. package/build/backend/api/controllers/node-plugins.d.ts.map +1 -1
  3. package/build/backend/api/controllers/node-plugins.js +6 -0
  4. package/build/backend/api/routes.d.ts +5 -0
  5. package/build/backend/api/routes.d.ts.map +1 -1
  6. package/build/backend/api/routes.js +5 -0
  7. package/build/backend/commands/node-plugins/index.d.ts +1 -0
  8. package/build/backend/commands/node-plugins/index.d.ts.map +1 -1
  9. package/build/backend/commands/node-plugins/index.js +1 -0
  10. package/build/backend/commands/node-plugins/torrent-blocker/get-torrent-blocker-reports-stats.command.d.ts +60 -0
  11. package/build/backend/commands/node-plugins/torrent-blocker/get-torrent-blocker-reports-stats.command.d.ts.map +1 -0
  12. package/build/backend/commands/node-plugins/torrent-blocker/get-torrent-blocker-reports-stats.command.js +22 -0
  13. package/build/backend/commands/node-plugins/torrent-blocker/get-torrent-blocker-reports.command.d.ts +626 -0
  14. package/build/backend/commands/node-plugins/torrent-blocker/get-torrent-blocker-reports.command.d.ts.map +1 -0
  15. package/build/backend/commands/node-plugins/torrent-blocker/get-torrent-blocker-reports.command.js +20 -0
  16. package/build/backend/commands/node-plugins/torrent-blocker/index.d.ts +3 -0
  17. package/build/backend/commands/node-plugins/torrent-blocker/index.d.ts.map +1 -0
  18. package/build/backend/commands/node-plugins/torrent-blocker/index.js +18 -0
  19. package/build/backend/commands/node-plugins/torrent-blocker/truncate-torrent-blocker-reports.command.d.ts +573 -0
  20. package/build/backend/commands/node-plugins/torrent-blocker/truncate-torrent-blocker-reports.command.d.ts.map +1 -0
  21. package/build/backend/commands/node-plugins/torrent-blocker/truncate-torrent-blocker-reports.command.js +19 -0
  22. package/build/backend/constants/errors/errors.d.ts +5 -0
  23. package/build/backend/constants/errors/errors.d.ts.map +1 -1
  24. package/build/backend/constants/errors/errors.js +5 -0
  25. package/build/backend/models/index.d.ts +1 -0
  26. package/build/backend/models/index.d.ts.map +1 -1
  27. package/build/backend/models/index.js +1 -0
  28. package/build/backend/models/torrent-blocker-report.schema.d.ts +390 -0
  29. package/build/backend/models/torrent-blocker-report.schema.d.ts.map +1 -0
  30. package/build/backend/models/torrent-blocker-report.schema.js +55 -0
  31. package/build/backend/models/webhook/webhook.schema.d.ts +16 -16
  32. package/build/frontend/api/controllers/node-plugins.js +6 -0
  33. package/build/frontend/api/routes.js +5 -0
  34. package/build/frontend/commands/node-plugins/index.js +1 -0
  35. package/build/frontend/commands/node-plugins/torrent-blocker/get-torrent-blocker-reports-stats.command.js +22 -0
  36. package/build/frontend/commands/node-plugins/torrent-blocker/get-torrent-blocker-reports.command.js +20 -0
  37. package/build/frontend/commands/node-plugins/torrent-blocker/index.js +18 -0
  38. package/build/frontend/commands/node-plugins/torrent-blocker/truncate-torrent-blocker-reports.command.js +19 -0
  39. package/build/frontend/constants/errors/errors.js +5 -0
  40. package/build/frontend/models/index.js +1 -0
  41. package/build/frontend/models/torrent-blocker-report.schema.js +55 -0
  42. package/package.json +1 -1
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetTorrentBlockerReportsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../../models");
6
+ const api_1 = require("../../../api");
7
+ const constants_1 = require("../../../constants");
8
+ var GetTorrentBlockerReportsCommand;
9
+ (function (GetTorrentBlockerReportsCommand) {
10
+ GetTorrentBlockerReportsCommand.url = api_1.REST_API.NODE_PLUGINS.TORRENT_BLOCKER.GET_REPORTS;
11
+ GetTorrentBlockerReportsCommand.TSQ_url = GetTorrentBlockerReportsCommand.url;
12
+ GetTorrentBlockerReportsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.NODE_PLUGINS_ROUTES.TORRENT_BLOCKER.GET_REPORTS, 'get', 'Get Torrent Blocker Reports');
13
+ GetTorrentBlockerReportsCommand.RequestQuerySchema = models_1.TanstackQueryRequestQuerySchema;
14
+ GetTorrentBlockerReportsCommand.ResponseSchema = zod_1.z.object({
15
+ response: zod_1.z.object({
16
+ records: zod_1.z.array(models_1.TorrentBlockerReportSchema),
17
+ total: zod_1.z.number(),
18
+ }),
19
+ });
20
+ })(GetTorrentBlockerReportsCommand || (exports.GetTorrentBlockerReportsCommand = GetTorrentBlockerReportsCommand = {}));
@@ -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-torrent-blocker-reports.command"), exports);
18
+ __exportStar(require("./truncate-torrent-blocker-reports.command"), exports);
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TruncateTorrentBlockerReportsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../../models");
6
+ const api_1 = require("../../../api");
7
+ const constants_1 = require("../../../constants");
8
+ var TruncateTorrentBlockerReportsCommand;
9
+ (function (TruncateTorrentBlockerReportsCommand) {
10
+ TruncateTorrentBlockerReportsCommand.url = api_1.REST_API.NODE_PLUGINS.TORRENT_BLOCKER.TRUNCATE_REPORTS;
11
+ TruncateTorrentBlockerReportsCommand.TSQ_url = TruncateTorrentBlockerReportsCommand.url;
12
+ TruncateTorrentBlockerReportsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.NODE_PLUGINS_ROUTES.TORRENT_BLOCKER.TRUNCATE_REPORTS, 'delete', 'Truncate Torrent Blocker Reports');
13
+ TruncateTorrentBlockerReportsCommand.ResponseSchema = zod_1.z.object({
14
+ response: zod_1.z.object({
15
+ records: zod_1.z.array(models_1.TorrentBlockerReportSchema),
16
+ total: zod_1.z.number(),
17
+ }),
18
+ });
19
+ })(TruncateTorrentBlockerReportsCommand || (exports.TruncateTorrentBlockerReportsCommand = TruncateTorrentBlockerReportsCommand = {}));
@@ -1145,4 +1145,9 @@ exports.ERRORS = {
1145
1145
  message: 'Metadata not found',
1146
1146
  httpCode: 404,
1147
1147
  },
1148
+ GET_TORRENT_BLOCKER_REPORTS_ERROR: {
1149
+ code: 'A227',
1150
+ message: 'Get torrent blocker reports error',
1151
+ httpCode: 500,
1152
+ },
1148
1153
  };
@@ -43,6 +43,7 @@ __exportStar(require("./subscription-settings"), exports);
43
43
  __exportStar(require("./subscription-settings.schema"), exports);
44
44
  __exportStar(require("./subscription-template.schema"), exports);
45
45
  __exportStar(require("./tanstack-query"), exports);
46
+ __exportStar(require("./torrent-blocker-report.schema"), exports);
46
47
  __exportStar(require("./users.schema"), exports);
47
48
  __exportStar(require("./webhook"), exports);
48
49
  __exportStar(require("./xray-json-advanced"), exports);
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TorrentBlockerReportSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const extended_users_schema_1 = require("./extended-users.schema");
6
+ const nodes_schema_1 = require("./nodes.schema");
7
+ exports.TorrentBlockerReportSchema = zod_1.z.object({
8
+ id: zod_1.z.number(),
9
+ userId: zod_1.z.number(),
10
+ nodeId: zod_1.z.number(),
11
+ user: extended_users_schema_1.ExtendedUsersSchema.pick({
12
+ uuid: true,
13
+ username: true,
14
+ }),
15
+ node: nodes_schema_1.NodesSchema.pick({
16
+ uuid: true,
17
+ name: true,
18
+ countryCode: true,
19
+ }),
20
+ report: zod_1.z.object({
21
+ actionReport: zod_1.z.object({
22
+ blocked: zod_1.z.boolean(),
23
+ ip: zod_1.z.string(),
24
+ blockDuration: zod_1.z.number(),
25
+ willUnblockAt: zod_1.z
26
+ .string()
27
+ .datetime({ offset: true, local: true })
28
+ .transform((str) => new Date(str)),
29
+ userId: zod_1.z.string(),
30
+ processedAt: zod_1.z
31
+ .string()
32
+ .datetime({ offset: true, local: true })
33
+ .transform((str) => new Date(str)),
34
+ }),
35
+ xrayReport: zod_1.z.object({
36
+ email: zod_1.z.string().nullable(),
37
+ level: zod_1.z.number().nullable(),
38
+ protocol: zod_1.z.string().nullable(),
39
+ network: zod_1.z.string(),
40
+ source: zod_1.z.string().nullable(),
41
+ destination: zod_1.z.string(),
42
+ routeTarget: zod_1.z.string().nullable(),
43
+ originalTarget: zod_1.z.string().nullable(),
44
+ inboundTag: zod_1.z.string().nullable(),
45
+ inboundName: zod_1.z.string().nullable(),
46
+ inboundLocal: zod_1.z.string().nullable(),
47
+ outboundTag: zod_1.z.string().nullable(),
48
+ ts: zod_1.z.number(),
49
+ }),
50
+ }),
51
+ createdAt: zod_1.z
52
+ .string()
53
+ .datetime()
54
+ .transform((str) => new Date(str)),
55
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "2.6.33",
3
+ "version": "2.6.34",
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.",