@remnawave/node-contract 2.6.0 → 2.6.3

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 (55) hide show
  1. package/build/api/controllers/handler.d.ts +2 -0
  2. package/build/api/controllers/handler.d.ts.map +1 -1
  3. package/build/api/controllers/handler.js +2 -0
  4. package/build/api/controllers/index.d.ts +1 -0
  5. package/build/api/controllers/index.d.ts.map +1 -1
  6. package/build/api/controllers/index.js +1 -0
  7. package/build/api/controllers/plugin.d.ts +9 -0
  8. package/build/api/controllers/plugin.d.ts.map +1 -0
  9. package/build/api/controllers/plugin.js +11 -0
  10. package/build/api/routes.d.ts +8 -0
  11. package/build/api/routes.d.ts.map +1 -1
  12. package/build/api/routes.js +8 -0
  13. package/build/commands/handler/drop-ips.command.d.ts +31 -0
  14. package/build/commands/handler/drop-ips.command.d.ts.map +1 -0
  15. package/build/commands/handler/drop-ips.command.js +17 -0
  16. package/build/commands/handler/drop-users-connections.command.d.ts +31 -0
  17. package/build/commands/handler/drop-users-connections.command.d.ts.map +1 -0
  18. package/build/commands/handler/drop-users-connections.command.js +17 -0
  19. package/build/commands/handler/index.d.ts +2 -0
  20. package/build/commands/handler/index.d.ts.map +1 -1
  21. package/build/commands/handler/index.js +2 -0
  22. package/build/commands/index.d.ts +1 -0
  23. package/build/commands/index.d.ts.map +1 -1
  24. package/build/commands/index.js +1 -0
  25. package/build/commands/plugin/index.d.ts +3 -0
  26. package/build/commands/plugin/index.d.ts.map +1 -0
  27. package/build/commands/plugin/index.js +18 -0
  28. package/build/commands/plugin/sync.command.d.ts +51 -0
  29. package/build/commands/plugin/sync.command.d.ts.map +1 -0
  30. package/build/commands/plugin/sync.command.js +23 -0
  31. package/build/commands/plugin/torrent-blocker/collect-reports.schema.d.ts +233 -0
  32. package/build/commands/plugin/torrent-blocker/collect-reports.schema.d.ts.map +1 -0
  33. package/build/commands/plugin/torrent-blocker/collect-reports.schema.js +15 -0
  34. package/build/commands/plugin/torrent-blocker/index.d.ts +2 -0
  35. package/build/commands/plugin/torrent-blocker/index.d.ts.map +1 -0
  36. package/build/commands/plugin/torrent-blocker/index.js +17 -0
  37. package/build/constants/internal/internal.constants.d.ts +2 -0
  38. package/build/constants/internal/internal.constants.d.ts.map +1 -1
  39. package/build/constants/internal/internal.constants.js +3 -1
  40. package/build/constants/xray/stats.d.ts +14 -0
  41. package/build/constants/xray/stats.d.ts.map +1 -1
  42. package/build/constants/xray/stats.js +14 -1
  43. package/build/index.d.ts +1 -0
  44. package/build/index.d.ts.map +1 -1
  45. package/build/index.js +1 -0
  46. package/build/models/index.d.ts +3 -0
  47. package/build/models/index.d.ts.map +1 -0
  48. package/build/models/index.js +18 -0
  49. package/build/models/torrent-blocker.report.schema.d.ts +118 -0
  50. package/build/models/torrent-blocker.report.schema.d.ts.map +1 -0
  51. package/build/models/torrent-blocker.report.schema.js +22 -0
  52. package/build/models/xray-webhook.schema.d.ts +46 -0
  53. package/build/models/xray-webhook.schema.d.ts.map +1 -0
  54. package/build/models/xray-webhook.schema.js +19 -0
  55. package/package.json +1 -1
@@ -6,5 +6,7 @@ export declare const HANDLER_ROUTES: {
6
6
  readonly REMOVE_USERS: "remove-users";
7
7
  readonly GET_INBOUND_USERS_COUNT: "get-inbound-users-count";
8
8
  readonly GET_INBOUND_USERS: "get-inbound-users";
9
+ readonly DROP_USERS_CONNECTIONS: "drop-users-connections";
10
+ readonly DROP_IPS: "drop-ips";
9
11
  };
10
12
  //# sourceMappingURL=handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../api/controllers/handler.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,EAAG,SAAkB,CAAC;AAErD,eAAO,MAAM,cAAc;;;;;;;CAOjB,CAAC"}
1
+ {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../api/controllers/handler.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,EAAG,SAAkB,CAAC;AAErD,eAAO,MAAM,cAAc;;;;;;;;;CAUjB,CAAC"}
@@ -9,4 +9,6 @@ exports.HANDLER_ROUTES = {
9
9
  REMOVE_USERS: 'remove-users',
10
10
  GET_INBOUND_USERS_COUNT: 'get-inbound-users-count',
11
11
  GET_INBOUND_USERS: 'get-inbound-users',
12
+ DROP_USERS_CONNECTIONS: 'drop-users-connections',
13
+ DROP_IPS: 'drop-ips',
12
14
  };
@@ -1,4 +1,5 @@
1
1
  export * from './handler';
2
+ export * from './plugin';
2
3
  export * from './stats';
3
4
  export * from './vision';
4
5
  export * from './xray';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../api/controllers/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../api/controllers/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./handler"), exports);
18
+ __exportStar(require("./plugin"), exports);
18
19
  __exportStar(require("./stats"), exports);
19
20
  __exportStar(require("./vision"), exports);
20
21
  __exportStar(require("./xray"), exports);
@@ -0,0 +1,9 @@
1
+ export declare const PLUGIN_CONTROLLER: "plugin";
2
+ export declare const TORRENT_BLOCKER_ROUTE: "torrent-blocker";
3
+ export declare const PLUGIN_ROUTES: {
4
+ readonly SYNC: "sync";
5
+ readonly TORRENT_BLOCKER: {
6
+ readonly COLLECT: "torrent-blocker/collect";
7
+ };
8
+ };
9
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../api/controllers/plugin.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,EAAG,QAAiB,CAAC;AAEnD,eAAO,MAAM,qBAAqB,EAAG,iBAA0B,CAAC;AAEhE,eAAO,MAAM,aAAa;;;;;CAMhB,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PLUGIN_ROUTES = exports.TORRENT_BLOCKER_ROUTE = exports.PLUGIN_CONTROLLER = void 0;
4
+ exports.PLUGIN_CONTROLLER = 'plugin';
5
+ exports.TORRENT_BLOCKER_ROUTE = 'torrent-blocker';
6
+ exports.PLUGIN_ROUTES = {
7
+ SYNC: 'sync',
8
+ TORRENT_BLOCKER: {
9
+ COLLECT: `${exports.TORRENT_BLOCKER_ROUTE}/collect`,
10
+ },
11
+ };
@@ -24,10 +24,18 @@ export declare const REST_API: {
24
24
  readonly GET_INBOUND_USERS: "/node/handler/get-inbound-users";
25
25
  readonly ADD_USERS: "/node/handler/add-users";
26
26
  readonly REMOVE_USERS: "/node/handler/remove-users";
27
+ readonly DROP_USERS_CONNECTIONS: "/node/handler/drop-users-connections";
28
+ readonly DROP_IPS: "/node/handler/drop-ips";
27
29
  };
28
30
  readonly VISION: {
29
31
  readonly UNBLOCK_IP: "vision/unblock-ip";
30
32
  readonly BLOCK_IP: "vision/block-ip";
31
33
  };
34
+ readonly PLUGIN: {
35
+ readonly SYNC: "/node/plugin/sync";
36
+ readonly TORRENT_BLOCKER: {
37
+ readonly COLLECT: "/node/plugin/torrent-blocker/collect";
38
+ };
39
+ };
32
40
  };
33
41
  //# sourceMappingURL=routes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,OAAgB,CAAC;AAErC,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BX,CAAC"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,OAAgB,CAAC;AAErC,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCX,CAAC"}
@@ -61,9 +61,17 @@ exports.REST_API = {
61
61
  GET_INBOUND_USERS: `${exports.ROOT}/${CONTROLLERS.HANDLER_CONTROLLER}/${CONTROLLERS.HANDLER_ROUTES.GET_INBOUND_USERS}`,
62
62
  ADD_USERS: `${exports.ROOT}/${CONTROLLERS.HANDLER_CONTROLLER}/${CONTROLLERS.HANDLER_ROUTES.ADD_USERS}`,
63
63
  REMOVE_USERS: `${exports.ROOT}/${CONTROLLERS.HANDLER_CONTROLLER}/${CONTROLLERS.HANDLER_ROUTES.REMOVE_USERS}`,
64
+ DROP_USERS_CONNECTIONS: `${exports.ROOT}/${CONTROLLERS.HANDLER_CONTROLLER}/${CONTROLLERS.HANDLER_ROUTES.DROP_USERS_CONNECTIONS}`,
65
+ DROP_IPS: `${exports.ROOT}/${CONTROLLERS.HANDLER_CONTROLLER}/${CONTROLLERS.HANDLER_ROUTES.DROP_IPS}`,
64
66
  },
65
67
  VISION: {
66
68
  UNBLOCK_IP: `${CONTROLLERS.VISION_CONTROLLER}/${CONTROLLERS.VISION_ROUTES.UNBLOCK_IP}`,
67
69
  BLOCK_IP: `${CONTROLLERS.VISION_CONTROLLER}/${CONTROLLERS.VISION_ROUTES.BLOCK_IP}`,
68
70
  },
71
+ PLUGIN: {
72
+ SYNC: `${exports.ROOT}/${CONTROLLERS.PLUGIN_CONTROLLER}/${CONTROLLERS.PLUGIN_ROUTES.SYNC}`,
73
+ TORRENT_BLOCKER: {
74
+ COLLECT: `${exports.ROOT}/${CONTROLLERS.PLUGIN_CONTROLLER}/${CONTROLLERS.PLUGIN_ROUTES.TORRENT_BLOCKER.COLLECT}`,
75
+ },
76
+ },
69
77
  };
@@ -0,0 +1,31 @@
1
+ import { z } from 'zod';
2
+ export declare namespace DropIpsCommand {
3
+ const url: "/node/handler/drop-ips";
4
+ const RequestSchema: z.ZodObject<{
5
+ ips: z.ZodArray<z.ZodString, "many">;
6
+ }, "strip", z.ZodTypeAny, {
7
+ ips: string[];
8
+ }, {
9
+ ips: string[];
10
+ }>;
11
+ type Request = z.infer<typeof RequestSchema>;
12
+ const ResponseSchema: z.ZodObject<{
13
+ response: z.ZodObject<{
14
+ success: z.ZodBoolean;
15
+ }, "strip", z.ZodTypeAny, {
16
+ success: boolean;
17
+ }, {
18
+ success: boolean;
19
+ }>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ response: {
22
+ success: boolean;
23
+ };
24
+ }, {
25
+ response: {
26
+ success: boolean;
27
+ };
28
+ }>;
29
+ type Response = z.infer<typeof ResponseSchema>;
30
+ }
31
+ //# sourceMappingURL=drop-ips.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drop-ips.command.d.ts","sourceRoot":"","sources":["../../../commands/handler/drop-ips.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,yBAAiB,cAAc,CAAC;IACrB,MAAM,GAAG,0BAA4B,CAAC;IAEtC,MAAM,aAAa;;;;;;MAExB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;MAIzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DropIpsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ var DropIpsCommand;
7
+ (function (DropIpsCommand) {
8
+ DropIpsCommand.url = api_1.REST_API.HANDLER.DROP_IPS;
9
+ DropIpsCommand.RequestSchema = zod_1.z.object({
10
+ ips: zod_1.z.array(zod_1.z.string()).min(1),
11
+ });
12
+ DropIpsCommand.ResponseSchema = zod_1.z.object({
13
+ response: zod_1.z.object({
14
+ success: zod_1.z.boolean(),
15
+ }),
16
+ });
17
+ })(DropIpsCommand || (exports.DropIpsCommand = DropIpsCommand = {}));
@@ -0,0 +1,31 @@
1
+ import { z } from 'zod';
2
+ export declare namespace DropUsersConnectionsCommand {
3
+ const url: "/node/handler/drop-users-connections";
4
+ const RequestSchema: z.ZodObject<{
5
+ userIds: z.ZodArray<z.ZodString, "many">;
6
+ }, "strip", z.ZodTypeAny, {
7
+ userIds: string[];
8
+ }, {
9
+ userIds: string[];
10
+ }>;
11
+ type Request = z.infer<typeof RequestSchema>;
12
+ const ResponseSchema: z.ZodObject<{
13
+ response: z.ZodObject<{
14
+ success: z.ZodBoolean;
15
+ }, "strip", z.ZodTypeAny, {
16
+ success: boolean;
17
+ }, {
18
+ success: boolean;
19
+ }>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ response: {
22
+ success: boolean;
23
+ };
24
+ }, {
25
+ response: {
26
+ success: boolean;
27
+ };
28
+ }>;
29
+ type Response = z.infer<typeof ResponseSchema>;
30
+ }
31
+ //# sourceMappingURL=drop-users-connections.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drop-users-connections.command.d.ts","sourceRoot":"","sources":["../../../commands/handler/drop-users-connections.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,yBAAiB,2BAA2B,CAAC;IAClC,MAAM,GAAG,wCAA0C,CAAC;IAEpD,MAAM,aAAa;;;;;;MAExB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;MAIzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DropUsersConnectionsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ var DropUsersConnectionsCommand;
7
+ (function (DropUsersConnectionsCommand) {
8
+ DropUsersConnectionsCommand.url = api_1.REST_API.HANDLER.DROP_USERS_CONNECTIONS;
9
+ DropUsersConnectionsCommand.RequestSchema = zod_1.z.object({
10
+ userIds: zod_1.z.array(zod_1.z.string()).min(1),
11
+ });
12
+ DropUsersConnectionsCommand.ResponseSchema = zod_1.z.object({
13
+ response: zod_1.z.object({
14
+ success: zod_1.z.boolean(),
15
+ }),
16
+ });
17
+ })(DropUsersConnectionsCommand || (exports.DropUsersConnectionsCommand = DropUsersConnectionsCommand = {}));
@@ -1,5 +1,7 @@
1
1
  export * from './add-user.command';
2
2
  export * from './add-users.command';
3
+ export * from './drop-ips.command';
4
+ export * from './drop-users-connections.command';
3
5
  export * from './get-inbound-users-count.command';
4
6
  export * from './get-inbound-users.command';
5
7
  export * from './remove-user.command';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/handler/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/handler/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
@@ -16,6 +16,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./add-user.command"), exports);
18
18
  __exportStar(require("./add-users.command"), exports);
19
+ __exportStar(require("./drop-ips.command"), exports);
20
+ __exportStar(require("./drop-users-connections.command"), exports);
19
21
  __exportStar(require("./get-inbound-users-count.command"), exports);
20
22
  __exportStar(require("./get-inbound-users.command"), exports);
21
23
  __exportStar(require("./remove-user.command"), exports);
@@ -1,4 +1,5 @@
1
1
  export * from './handler';
2
+ export * from './plugin';
2
3
  export * from './stats';
3
4
  export * from './vision';
4
5
  export * from './xray';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./handler"), exports);
18
+ __exportStar(require("./plugin"), exports);
18
19
  __exportStar(require("./stats"), exports);
19
20
  __exportStar(require("./vision"), exports);
20
21
  __exportStar(require("./xray"), exports);
@@ -0,0 +1,3 @@
1
+ export * from './sync.command';
2
+ export * from './torrent-blocker';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/plugin/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC"}
@@ -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("./sync.command"), exports);
18
+ __exportStar(require("./torrent-blocker"), exports);
@@ -0,0 +1,51 @@
1
+ import { z } from 'zod';
2
+ export declare namespace SyncCommand {
3
+ const url: "/node/plugin/sync";
4
+ const RequestSchema: z.ZodObject<{
5
+ plugin: z.ZodNullable<z.ZodObject<{
6
+ config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
7
+ uuid: z.ZodString;
8
+ name: z.ZodString;
9
+ }, "strip", z.ZodTypeAny, {
10
+ uuid: string;
11
+ config: Record<string, unknown>;
12
+ name: string;
13
+ }, {
14
+ uuid: string;
15
+ config: Record<string, unknown>;
16
+ name: string;
17
+ }>>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ plugin: {
20
+ uuid: string;
21
+ config: Record<string, unknown>;
22
+ name: string;
23
+ } | null;
24
+ }, {
25
+ plugin: {
26
+ uuid: string;
27
+ config: Record<string, unknown>;
28
+ name: string;
29
+ } | null;
30
+ }>;
31
+ type Request = z.infer<typeof RequestSchema>;
32
+ const ResponseSchema: z.ZodObject<{
33
+ response: z.ZodObject<{
34
+ accepted: z.ZodBoolean;
35
+ }, "strip", z.ZodTypeAny, {
36
+ accepted: boolean;
37
+ }, {
38
+ accepted: boolean;
39
+ }>;
40
+ }, "strip", z.ZodTypeAny, {
41
+ response: {
42
+ accepted: boolean;
43
+ };
44
+ }, {
45
+ response: {
46
+ accepted: boolean;
47
+ };
48
+ }>;
49
+ type Response = z.infer<typeof ResponseSchema>;
50
+ }
51
+ //# sourceMappingURL=sync.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.command.d.ts","sourceRoot":"","sources":["../../../commands/plugin/sync.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,yBAAiB,WAAW,CAAC;IAClB,MAAM,GAAG,qBAAuB,CAAC;IACjC,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;MAQxB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;MAIzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SyncCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ var SyncCommand;
7
+ (function (SyncCommand) {
8
+ SyncCommand.url = api_1.REST_API.PLUGIN.SYNC;
9
+ SyncCommand.RequestSchema = zod_1.z.object({
10
+ plugin: zod_1.z
11
+ .object({
12
+ config: zod_1.z.record(zod_1.z.unknown()),
13
+ uuid: zod_1.z.string().uuid(),
14
+ name: zod_1.z.string(),
15
+ })
16
+ .nullable(),
17
+ });
18
+ SyncCommand.ResponseSchema = zod_1.z.object({
19
+ response: zod_1.z.object({
20
+ accepted: zod_1.z.boolean(),
21
+ }),
22
+ });
23
+ })(SyncCommand || (exports.SyncCommand = SyncCommand = {}));
@@ -0,0 +1,233 @@
1
+ import { z } from 'zod';
2
+ export declare namespace CollectReportsCommand {
3
+ const url: "/node/plugin/torrent-blocker/collect";
4
+ const ResponseSchema: z.ZodObject<{
5
+ response: z.ZodObject<{
6
+ reports: z.ZodArray<z.ZodObject<{
7
+ actionReport: z.ZodObject<{
8
+ blocked: z.ZodBoolean;
9
+ whitelisted: z.ZodBoolean;
10
+ ip: z.ZodString;
11
+ blockDuration: z.ZodNumber;
12
+ userId: z.ZodString;
13
+ processedAt: z.ZodEffects<z.ZodString, Date, string>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ userId: string;
16
+ blocked: boolean;
17
+ whitelisted: boolean;
18
+ ip: string;
19
+ blockDuration: number;
20
+ processedAt: Date;
21
+ }, {
22
+ userId: string;
23
+ blocked: boolean;
24
+ whitelisted: boolean;
25
+ ip: string;
26
+ blockDuration: number;
27
+ processedAt: string;
28
+ }>;
29
+ xrayReport: z.ZodObject<{
30
+ email: z.ZodNullable<z.ZodString>;
31
+ level: z.ZodNullable<z.ZodNumber>;
32
+ protocol: z.ZodNullable<z.ZodString>;
33
+ network: z.ZodString;
34
+ source: z.ZodNullable<z.ZodString>;
35
+ destination: z.ZodString;
36
+ routeTarget: z.ZodNullable<z.ZodString>;
37
+ originalTarget: z.ZodNullable<z.ZodString>;
38
+ inboundTag: z.ZodNullable<z.ZodString>;
39
+ inboundName: z.ZodNullable<z.ZodString>;
40
+ inboundLocal: z.ZodNullable<z.ZodString>;
41
+ outboundTag: z.ZodNullable<z.ZodString>;
42
+ ts: z.ZodNumber;
43
+ }, "strip", z.ZodTypeAny, {
44
+ email: string | null;
45
+ level: number | null;
46
+ protocol: string | null;
47
+ network: string;
48
+ source: string | null;
49
+ destination: string;
50
+ routeTarget: string | null;
51
+ originalTarget: string | null;
52
+ inboundTag: string | null;
53
+ inboundName: string | null;
54
+ inboundLocal: string | null;
55
+ outboundTag: string | null;
56
+ ts: number;
57
+ }, {
58
+ email: string | null;
59
+ level: number | null;
60
+ protocol: string | null;
61
+ network: string;
62
+ source: string | null;
63
+ destination: string;
64
+ routeTarget: string | null;
65
+ originalTarget: string | null;
66
+ inboundTag: string | null;
67
+ inboundName: string | null;
68
+ inboundLocal: string | null;
69
+ outboundTag: string | null;
70
+ ts: number;
71
+ }>;
72
+ }, "strip", z.ZodTypeAny, {
73
+ actionReport: {
74
+ userId: string;
75
+ blocked: boolean;
76
+ whitelisted: boolean;
77
+ ip: string;
78
+ blockDuration: number;
79
+ processedAt: Date;
80
+ };
81
+ xrayReport: {
82
+ email: string | null;
83
+ level: number | null;
84
+ protocol: string | null;
85
+ network: string;
86
+ source: string | null;
87
+ destination: string;
88
+ routeTarget: string | null;
89
+ originalTarget: string | null;
90
+ inboundTag: string | null;
91
+ inboundName: string | null;
92
+ inboundLocal: string | null;
93
+ outboundTag: string | null;
94
+ ts: number;
95
+ };
96
+ }, {
97
+ actionReport: {
98
+ userId: string;
99
+ blocked: boolean;
100
+ whitelisted: boolean;
101
+ ip: string;
102
+ blockDuration: number;
103
+ processedAt: string;
104
+ };
105
+ xrayReport: {
106
+ email: string | null;
107
+ level: number | null;
108
+ protocol: string | null;
109
+ network: string;
110
+ source: string | null;
111
+ destination: string;
112
+ routeTarget: string | null;
113
+ originalTarget: string | null;
114
+ inboundTag: string | null;
115
+ inboundName: string | null;
116
+ inboundLocal: string | null;
117
+ outboundTag: string | null;
118
+ ts: number;
119
+ };
120
+ }>, "many">;
121
+ }, "strip", z.ZodTypeAny, {
122
+ reports: {
123
+ actionReport: {
124
+ userId: string;
125
+ blocked: boolean;
126
+ whitelisted: boolean;
127
+ ip: string;
128
+ blockDuration: number;
129
+ processedAt: Date;
130
+ };
131
+ xrayReport: {
132
+ email: string | null;
133
+ level: number | null;
134
+ protocol: string | null;
135
+ network: string;
136
+ source: string | null;
137
+ destination: string;
138
+ routeTarget: string | null;
139
+ originalTarget: string | null;
140
+ inboundTag: string | null;
141
+ inboundName: string | null;
142
+ inboundLocal: string | null;
143
+ outboundTag: string | null;
144
+ ts: number;
145
+ };
146
+ }[];
147
+ }, {
148
+ reports: {
149
+ actionReport: {
150
+ userId: string;
151
+ blocked: boolean;
152
+ whitelisted: boolean;
153
+ ip: string;
154
+ blockDuration: number;
155
+ processedAt: string;
156
+ };
157
+ xrayReport: {
158
+ email: string | null;
159
+ level: number | null;
160
+ protocol: string | null;
161
+ network: string;
162
+ source: string | null;
163
+ destination: string;
164
+ routeTarget: string | null;
165
+ originalTarget: string | null;
166
+ inboundTag: string | null;
167
+ inboundName: string | null;
168
+ inboundLocal: string | null;
169
+ outboundTag: string | null;
170
+ ts: number;
171
+ };
172
+ }[];
173
+ }>;
174
+ }, "strip", z.ZodTypeAny, {
175
+ response: {
176
+ reports: {
177
+ actionReport: {
178
+ userId: string;
179
+ blocked: boolean;
180
+ whitelisted: boolean;
181
+ ip: string;
182
+ blockDuration: number;
183
+ processedAt: Date;
184
+ };
185
+ xrayReport: {
186
+ email: string | null;
187
+ level: number | null;
188
+ protocol: string | null;
189
+ network: string;
190
+ source: string | null;
191
+ destination: string;
192
+ routeTarget: string | null;
193
+ originalTarget: string | null;
194
+ inboundTag: string | null;
195
+ inboundName: string | null;
196
+ inboundLocal: string | null;
197
+ outboundTag: string | null;
198
+ ts: number;
199
+ };
200
+ }[];
201
+ };
202
+ }, {
203
+ response: {
204
+ reports: {
205
+ actionReport: {
206
+ userId: string;
207
+ blocked: boolean;
208
+ whitelisted: boolean;
209
+ ip: string;
210
+ blockDuration: number;
211
+ processedAt: string;
212
+ };
213
+ xrayReport: {
214
+ email: string | null;
215
+ level: number | null;
216
+ protocol: string | null;
217
+ network: string;
218
+ source: string | null;
219
+ destination: string;
220
+ routeTarget: string | null;
221
+ originalTarget: string | null;
222
+ inboundTag: string | null;
223
+ inboundName: string | null;
224
+ inboundLocal: string | null;
225
+ outboundTag: string | null;
226
+ ts: number;
227
+ };
228
+ }[];
229
+ };
230
+ }>;
231
+ type Response = z.infer<typeof ResponseSchema>;
232
+ }
233
+ //# sourceMappingURL=collect-reports.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collect-reports.schema.d.ts","sourceRoot":"","sources":["../../../../commands/plugin/torrent-blocker/collect-reports.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,yBAAiB,qBAAqB,CAAC;IAC5B,MAAM,GAAG,wCAA0C,CAAC;IAEpD,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAIzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CollectReportsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../../models");
6
+ const api_1 = require("../../../api");
7
+ var CollectReportsCommand;
8
+ (function (CollectReportsCommand) {
9
+ CollectReportsCommand.url = api_1.REST_API.PLUGIN.TORRENT_BLOCKER.COLLECT;
10
+ CollectReportsCommand.ResponseSchema = zod_1.z.object({
11
+ response: zod_1.z.object({
12
+ reports: zod_1.z.array(models_1.TorrentBlockerReportSchema),
13
+ }),
14
+ });
15
+ })(CollectReportsCommand || (exports.CollectReportsCommand = CollectReportsCommand = {}));
@@ -0,0 +1,2 @@
1
+ export * from './collect-reports.schema';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/plugin/torrent-blocker/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,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("./collect-reports.schema"), exports);
@@ -1,4 +1,6 @@
1
1
  export declare const XRAY_INTERNAL_API_CONTROLLER = "internal";
2
2
  export declare const XRAY_INTERNAL_API_PATH = "/get-config";
3
3
  export declare const XRAY_INTERNAL_FULL_PATH = "/internal/get-config";
4
+ export declare const XRAY_INTERNAL_WEBHOOK_PATH = "/webhook";
5
+ export declare const XRAY_INTERNAL_FULL_WEBHOOK_PATH = "/internal/webhook";
4
6
  //# sourceMappingURL=internal.constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.constants.d.ts","sourceRoot":"","sources":["../../../constants/internal/internal.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,aAAa,CAAC;AACvD,eAAO,MAAM,sBAAsB,gBAAgB,CAAC;AACpD,eAAO,MAAM,uBAAuB,yBAA8D,CAAC"}
1
+ {"version":3,"file":"internal.constants.d.ts","sourceRoot":"","sources":["../../../constants/internal/internal.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,aAAa,CAAC;AACvD,eAAO,MAAM,sBAAsB,gBAAgB,CAAC;AACpD,eAAO,MAAM,uBAAuB,yBAA8D,CAAC;AACnG,eAAO,MAAM,0BAA0B,aAAa,CAAC;AACrD,eAAO,MAAM,+BAA+B,sBAAkE,CAAC"}
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.XRAY_INTERNAL_FULL_PATH = exports.XRAY_INTERNAL_API_PATH = exports.XRAY_INTERNAL_API_CONTROLLER = void 0;
3
+ exports.XRAY_INTERNAL_FULL_WEBHOOK_PATH = exports.XRAY_INTERNAL_WEBHOOK_PATH = exports.XRAY_INTERNAL_FULL_PATH = exports.XRAY_INTERNAL_API_PATH = exports.XRAY_INTERNAL_API_CONTROLLER = void 0;
4
4
  exports.XRAY_INTERNAL_API_CONTROLLER = 'internal';
5
5
  exports.XRAY_INTERNAL_API_PATH = '/get-config';
6
6
  exports.XRAY_INTERNAL_FULL_PATH = `/${exports.XRAY_INTERNAL_API_CONTROLLER}${exports.XRAY_INTERNAL_API_PATH}`;
7
+ exports.XRAY_INTERNAL_WEBHOOK_PATH = '/webhook';
8
+ exports.XRAY_INTERNAL_FULL_WEBHOOK_PATH = `/${exports.XRAY_INTERNAL_API_CONTROLLER}${exports.XRAY_INTERNAL_WEBHOOK_PATH}`;
@@ -58,4 +58,18 @@ export declare const XRAY_ROUTING_RULES_MODEL: {
58
58
  readonly inboundTag: readonly ["REMNAWAVE_API_INBOUND"];
59
59
  readonly outboundTag: "REMNAWAVE_API";
60
60
  };
61
+ export declare const XRAY_TORRENT_BLOCKER_ROUTING_RULES_MODEL: ({ webhookUrl, }: {
62
+ webhookUrl: string;
63
+ }) => {
64
+ protocol: string[];
65
+ outboundTag: string;
66
+ webhook: {
67
+ url: string;
68
+ deduplication: number;
69
+ };
70
+ };
71
+ export declare const XRAY_TORRENT_BLOCKER_OUTBOUND_MODEL: {
72
+ readonly tag: "RW_TB_OUTBOUND_BLOCK";
73
+ readonly protocol: "blackhole";
74
+ };
61
75
  //# sourceMappingURL=stats.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../constants/xray/stats.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;CAgB5B,CAAC;AAEX,eAAO,MAAM,wBAAwB;;CAE3B,CAAC;AAEX,eAAO,MAAM,sBAAsB;;;;;CAKzB,CAAC;AAEX,eAAO,MAAM,sBAAsB,GAAI,mDAKpC;IACC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACxB;;;;;;;;;;;;;;;;;;;;;;;;CAqCc,CAAC;AAEhB,eAAO,MAAM,wBAAwB;;;CAG3B,CAAC"}
1
+ {"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../constants/xray/stats.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;CAgB5B,CAAC;AAEX,eAAO,MAAM,wBAAwB;;CAE3B,CAAC;AAEX,eAAO,MAAM,sBAAsB;;;;;CAKzB,CAAC;AAEX,eAAO,MAAM,sBAAsB,GAAI,mDAKpC;IACC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACxB;;;;;;;;;;;;;;;;;;;;;;;;CAqCc,CAAC;AAEhB,eAAO,MAAM,wBAAwB;;;CAG3B,CAAC;AAEX,eAAO,MAAM,wCAAwC,GAAI,iBAEtD;IACC,UAAU,EAAE,MAAM,CAAC;CACtB;;;;;;;CAOC,CAAC;AAEH,eAAO,MAAM,mCAAmC;;;CAGtC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.XRAY_ROUTING_RULES_MODEL = exports.XRAY_API_INBOUND_MODEL = exports.XRAY_DEFAULT_API_MODEL = exports.XRAY_DEFAULT_STATS_MODEL = exports.XRAY_DEFAULT_POLICY_MODEL = void 0;
3
+ exports.XRAY_TORRENT_BLOCKER_OUTBOUND_MODEL = exports.XRAY_TORRENT_BLOCKER_ROUTING_RULES_MODEL = exports.XRAY_ROUTING_RULES_MODEL = exports.XRAY_API_INBOUND_MODEL = exports.XRAY_DEFAULT_API_MODEL = exports.XRAY_DEFAULT_STATS_MODEL = exports.XRAY_DEFAULT_POLICY_MODEL = void 0;
4
4
  exports.XRAY_DEFAULT_POLICY_MODEL = {
5
5
  policy: {
6
6
  levels: {
@@ -69,3 +69,16 @@ exports.XRAY_ROUTING_RULES_MODEL = {
69
69
  inboundTag: ['REMNAWAVE_API_INBOUND'],
70
70
  outboundTag: 'REMNAWAVE_API',
71
71
  };
72
+ const XRAY_TORRENT_BLOCKER_ROUTING_RULES_MODEL = ({ webhookUrl, }) => ({
73
+ protocol: ['bittorrent'],
74
+ outboundTag: 'RW_TB_OUTBOUND_BLOCK',
75
+ webhook: {
76
+ url: webhookUrl,
77
+ deduplication: 30,
78
+ },
79
+ });
80
+ exports.XRAY_TORRENT_BLOCKER_ROUTING_RULES_MODEL = XRAY_TORRENT_BLOCKER_ROUTING_RULES_MODEL;
81
+ exports.XRAY_TORRENT_BLOCKER_OUTBOUND_MODEL = {
82
+ tag: 'RW_TB_OUTBOUND_BLOCK',
83
+ protocol: 'blackhole',
84
+ };
package/build/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './api';
2
2
  export * from './commands';
3
3
  export * from './constants';
4
+ export * from './models';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
package/build/index.js CHANGED
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./api"), exports);
18
18
  __exportStar(require("./commands"), exports);
19
19
  __exportStar(require("./constants"), exports);
20
+ __exportStar(require("./models"), exports);
@@ -0,0 +1,3 @@
1
+ export * from './torrent-blocker.report.schema';
2
+ export * from './xray-webhook.schema';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../models/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC"}
@@ -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("./torrent-blocker.report.schema"), exports);
18
+ __exportStar(require("./xray-webhook.schema"), exports);
@@ -0,0 +1,118 @@
1
+ import z from 'zod';
2
+ export declare const TorrentBlockerReportSchema: z.ZodObject<{
3
+ actionReport: z.ZodObject<{
4
+ blocked: z.ZodBoolean;
5
+ whitelisted: z.ZodBoolean;
6
+ ip: z.ZodString;
7
+ blockDuration: z.ZodNumber;
8
+ userId: z.ZodString;
9
+ processedAt: z.ZodEffects<z.ZodString, Date, string>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ userId: string;
12
+ blocked: boolean;
13
+ whitelisted: boolean;
14
+ ip: string;
15
+ blockDuration: number;
16
+ processedAt: Date;
17
+ }, {
18
+ userId: string;
19
+ blocked: boolean;
20
+ whitelisted: boolean;
21
+ ip: string;
22
+ blockDuration: number;
23
+ processedAt: string;
24
+ }>;
25
+ xrayReport: z.ZodObject<{
26
+ email: z.ZodNullable<z.ZodString>;
27
+ level: z.ZodNullable<z.ZodNumber>;
28
+ protocol: z.ZodNullable<z.ZodString>;
29
+ network: z.ZodString;
30
+ source: z.ZodNullable<z.ZodString>;
31
+ destination: z.ZodString;
32
+ routeTarget: z.ZodNullable<z.ZodString>;
33
+ originalTarget: z.ZodNullable<z.ZodString>;
34
+ inboundTag: z.ZodNullable<z.ZodString>;
35
+ inboundName: z.ZodNullable<z.ZodString>;
36
+ inboundLocal: z.ZodNullable<z.ZodString>;
37
+ outboundTag: z.ZodNullable<z.ZodString>;
38
+ ts: z.ZodNumber;
39
+ }, "strip", z.ZodTypeAny, {
40
+ email: string | null;
41
+ level: number | null;
42
+ protocol: string | null;
43
+ network: string;
44
+ source: string | null;
45
+ destination: string;
46
+ routeTarget: string | null;
47
+ originalTarget: string | null;
48
+ inboundTag: string | null;
49
+ inboundName: string | null;
50
+ inboundLocal: string | null;
51
+ outboundTag: string | null;
52
+ ts: number;
53
+ }, {
54
+ email: string | null;
55
+ level: number | null;
56
+ protocol: string | null;
57
+ network: string;
58
+ source: string | null;
59
+ destination: string;
60
+ routeTarget: string | null;
61
+ originalTarget: string | null;
62
+ inboundTag: string | null;
63
+ inboundName: string | null;
64
+ inboundLocal: string | null;
65
+ outboundTag: string | null;
66
+ ts: number;
67
+ }>;
68
+ }, "strip", z.ZodTypeAny, {
69
+ actionReport: {
70
+ userId: string;
71
+ blocked: boolean;
72
+ whitelisted: boolean;
73
+ ip: string;
74
+ blockDuration: number;
75
+ processedAt: Date;
76
+ };
77
+ xrayReport: {
78
+ email: string | null;
79
+ level: number | null;
80
+ protocol: string | null;
81
+ network: string;
82
+ source: string | null;
83
+ destination: string;
84
+ routeTarget: string | null;
85
+ originalTarget: string | null;
86
+ inboundTag: string | null;
87
+ inboundName: string | null;
88
+ inboundLocal: string | null;
89
+ outboundTag: string | null;
90
+ ts: number;
91
+ };
92
+ }, {
93
+ actionReport: {
94
+ userId: string;
95
+ blocked: boolean;
96
+ whitelisted: boolean;
97
+ ip: string;
98
+ blockDuration: number;
99
+ processedAt: string;
100
+ };
101
+ xrayReport: {
102
+ email: string | null;
103
+ level: number | null;
104
+ protocol: string | null;
105
+ network: string;
106
+ source: string | null;
107
+ destination: string;
108
+ routeTarget: string | null;
109
+ originalTarget: string | null;
110
+ inboundTag: string | null;
111
+ inboundName: string | null;
112
+ inboundLocal: string | null;
113
+ outboundTag: string | null;
114
+ ts: number;
115
+ };
116
+ }>;
117
+ export type TorrentBlockerReportModel = z.infer<typeof TorrentBlockerReportSchema>;
118
+ //# sourceMappingURL=torrent-blocker.report.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"torrent-blocker.report.schema.d.ts","sourceRoot":"","sources":["../../models/torrent-blocker.report.schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAIpB,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcrC,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TorrentBlockerReportSchema = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ const xray_webhook_schema_1 = require("./xray-webhook.schema");
9
+ exports.TorrentBlockerReportSchema = zod_1.default.object({
10
+ actionReport: zod_1.default.object({
11
+ blocked: zod_1.default.boolean(),
12
+ whitelisted: zod_1.default.boolean(),
13
+ ip: zod_1.default.string(),
14
+ blockDuration: zod_1.default.number(),
15
+ userId: zod_1.default.string(),
16
+ processedAt: zod_1.default
17
+ .string()
18
+ .datetime({ offset: true, local: true })
19
+ .transform((str) => new Date(str)),
20
+ }),
21
+ xrayReport: xray_webhook_schema_1.XrayWebhookSchema,
22
+ });
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod';
2
+ export declare const XrayWebhookSchema: z.ZodObject<{
3
+ email: z.ZodNullable<z.ZodString>;
4
+ level: z.ZodNullable<z.ZodNumber>;
5
+ protocol: z.ZodNullable<z.ZodString>;
6
+ network: z.ZodString;
7
+ source: z.ZodNullable<z.ZodString>;
8
+ destination: z.ZodString;
9
+ routeTarget: z.ZodNullable<z.ZodString>;
10
+ originalTarget: z.ZodNullable<z.ZodString>;
11
+ inboundTag: z.ZodNullable<z.ZodString>;
12
+ inboundName: z.ZodNullable<z.ZodString>;
13
+ inboundLocal: z.ZodNullable<z.ZodString>;
14
+ outboundTag: z.ZodNullable<z.ZodString>;
15
+ ts: z.ZodNumber;
16
+ }, "strip", z.ZodTypeAny, {
17
+ email: string | null;
18
+ level: number | null;
19
+ protocol: string | null;
20
+ network: string;
21
+ source: string | null;
22
+ destination: string;
23
+ routeTarget: string | null;
24
+ originalTarget: string | null;
25
+ inboundTag: string | null;
26
+ inboundName: string | null;
27
+ inboundLocal: string | null;
28
+ outboundTag: string | null;
29
+ ts: number;
30
+ }, {
31
+ email: string | null;
32
+ level: number | null;
33
+ protocol: string | null;
34
+ network: string;
35
+ source: string | null;
36
+ destination: string;
37
+ routeTarget: string | null;
38
+ originalTarget: string | null;
39
+ inboundTag: string | null;
40
+ inboundName: string | null;
41
+ inboundLocal: string | null;
42
+ outboundTag: string | null;
43
+ ts: number;
44
+ }>;
45
+ export type XrayWebhookModel = z.infer<typeof XrayWebhookSchema>;
46
+ //# sourceMappingURL=xray-webhook.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xray-webhook.schema.d.ts","sourceRoot":"","sources":["../../models/xray-webhook.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc5B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.XrayWebhookSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.XrayWebhookSchema = zod_1.z.object({
6
+ email: zod_1.z.string().nullable(),
7
+ level: zod_1.z.number().nullable(),
8
+ protocol: zod_1.z.string().nullable(),
9
+ network: zod_1.z.string(),
10
+ source: zod_1.z.string().nullable(),
11
+ destination: zod_1.z.string(),
12
+ routeTarget: zod_1.z.string().nullable(),
13
+ originalTarget: zod_1.z.string().nullable(),
14
+ inboundTag: zod_1.z.string().nullable(),
15
+ inboundName: zod_1.z.string().nullable(),
16
+ inboundLocal: zod_1.z.string().nullable(),
17
+ outboundTag: zod_1.z.string().nullable(),
18
+ ts: zod_1.z.number(),
19
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/node-contract",
3
- "version": "2.6.0",
3
+ "version": "2.6.3",
4
4
  "description": "A node-contract library for Remnawave Panel",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",