@remnawave/node-contract 2.6.5 → 2.6.6

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.
@@ -1,9 +1,15 @@
1
1
  export declare const PLUGIN_CONTROLLER: "plugin";
2
2
  export declare const TORRENT_BLOCKER_ROUTE: "torrent-blocker";
3
+ export declare const NFTABLES_ROUTE: "nftables";
3
4
  export declare const PLUGIN_ROUTES: {
4
5
  readonly SYNC: "sync";
5
6
  readonly TORRENT_BLOCKER: {
6
7
  readonly COLLECT: "torrent-blocker/collect";
7
8
  };
9
+ readonly NFTABLES: {
10
+ readonly UNBLOCK_IPS: "nftables/unblock-ips";
11
+ readonly BLOCK_IPS: "nftables/block-ips";
12
+ readonly RECREATE_TABLES: "nftables/recreate-tables";
13
+ };
8
14
  };
9
15
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +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"}
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;AAChE,eAAO,MAAM,cAAc,EAAG,UAAmB,CAAC;AAElD,eAAO,MAAM,aAAa;;;;;;;;;;CAWhB,CAAC"}
@@ -1,11 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PLUGIN_ROUTES = exports.TORRENT_BLOCKER_ROUTE = exports.PLUGIN_CONTROLLER = void 0;
3
+ exports.PLUGIN_ROUTES = exports.NFTABLES_ROUTE = exports.TORRENT_BLOCKER_ROUTE = exports.PLUGIN_CONTROLLER = void 0;
4
4
  exports.PLUGIN_CONTROLLER = 'plugin';
5
5
  exports.TORRENT_BLOCKER_ROUTE = 'torrent-blocker';
6
+ exports.NFTABLES_ROUTE = 'nftables';
6
7
  exports.PLUGIN_ROUTES = {
7
8
  SYNC: 'sync',
8
9
  TORRENT_BLOCKER: {
9
10
  COLLECT: `${exports.TORRENT_BLOCKER_ROUTE}/collect`,
10
11
  },
12
+ NFTABLES: {
13
+ UNBLOCK_IPS: `${exports.NFTABLES_ROUTE}/unblock-ips`,
14
+ BLOCK_IPS: `${exports.NFTABLES_ROUTE}/block-ips`,
15
+ RECREATE_TABLES: `${exports.NFTABLES_ROUTE}/recreate-tables`,
16
+ },
11
17
  };
@@ -36,6 +36,11 @@ export declare const REST_API: {
36
36
  readonly TORRENT_BLOCKER: {
37
37
  readonly COLLECT: "/node/plugin/torrent-blocker/collect";
38
38
  };
39
+ readonly NFTABLES: {
40
+ readonly UNBLOCK_IPS: "/node/plugin/nftables/unblock-ips";
41
+ readonly BLOCK_IPS: "/node/plugin/nftables/block-ips";
42
+ readonly RECREATE_TABLES: "/node/plugin/nftables/recreate-tables";
43
+ };
39
44
  };
40
45
  };
41
46
  //# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCX,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CX,CAAC"}
@@ -73,5 +73,10 @@ exports.REST_API = {
73
73
  TORRENT_BLOCKER: {
74
74
  COLLECT: `${exports.ROOT}/${CONTROLLERS.PLUGIN_CONTROLLER}/${CONTROLLERS.PLUGIN_ROUTES.TORRENT_BLOCKER.COLLECT}`,
75
75
  },
76
+ NFTABLES: {
77
+ UNBLOCK_IPS: `${exports.ROOT}/${CONTROLLERS.PLUGIN_CONTROLLER}/${CONTROLLERS.PLUGIN_ROUTES.NFTABLES.UNBLOCK_IPS}`,
78
+ BLOCK_IPS: `${exports.ROOT}/${CONTROLLERS.PLUGIN_CONTROLLER}/${CONTROLLERS.PLUGIN_ROUTES.NFTABLES.BLOCK_IPS}`,
79
+ RECREATE_TABLES: `${exports.ROOT}/${CONTROLLERS.PLUGIN_CONTROLLER}/${CONTROLLERS.PLUGIN_ROUTES.NFTABLES.RECREATE_TABLES}`,
80
+ },
76
81
  },
77
82
  };
@@ -1,3 +1,4 @@
1
+ export * from './nftables';
1
2
  export * from './sync.command';
2
3
  export * from './torrent-blocker';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/plugin/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC"}
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./nftables"), exports);
17
18
  __exportStar(require("./sync.command"), exports);
18
19
  __exportStar(require("./torrent-blocker"), exports);
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod';
2
+ export declare namespace BlockIpsCommand {
3
+ const url: "/node/plugin/nftables/block-ips";
4
+ const RequestSchema: z.ZodObject<{
5
+ ips: z.ZodArray<z.ZodObject<{
6
+ ip: z.ZodString;
7
+ timeout: z.ZodNumber;
8
+ }, "strip", z.ZodTypeAny, {
9
+ ip: string;
10
+ timeout: number;
11
+ }, {
12
+ ip: string;
13
+ timeout: number;
14
+ }>, "many">;
15
+ }, "strip", z.ZodTypeAny, {
16
+ ips: {
17
+ ip: string;
18
+ timeout: number;
19
+ }[];
20
+ }, {
21
+ ips: {
22
+ ip: string;
23
+ timeout: number;
24
+ }[];
25
+ }>;
26
+ type Request = z.infer<typeof RequestSchema>;
27
+ const ResponseSchema: z.ZodObject<{
28
+ response: z.ZodObject<{
29
+ accepted: z.ZodBoolean;
30
+ }, "strip", z.ZodTypeAny, {
31
+ accepted: boolean;
32
+ }, {
33
+ accepted: boolean;
34
+ }>;
35
+ }, "strip", z.ZodTypeAny, {
36
+ response: {
37
+ accepted: boolean;
38
+ };
39
+ }, {
40
+ response: {
41
+ accepted: boolean;
42
+ };
43
+ }>;
44
+ type Response = z.infer<typeof ResponseSchema>;
45
+ }
46
+ //# sourceMappingURL=block-ips.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block-ips.schema.d.ts","sourceRoot":"","sources":["../../../../commands/plugin/nftables/block-ips.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,yBAAiB,eAAe,CAAC;IACtB,MAAM,GAAG,mCAAqC,CAAC;IAE/C,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;MAOxB,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,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BlockIpsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../../api");
6
+ var BlockIpsCommand;
7
+ (function (BlockIpsCommand) {
8
+ BlockIpsCommand.url = api_1.REST_API.PLUGIN.NFTABLES.BLOCK_IPS;
9
+ BlockIpsCommand.RequestSchema = zod_1.z.object({
10
+ ips: zod_1.z.array(zod_1.z.object({
11
+ ip: zod_1.z.string().ip(),
12
+ timeout: zod_1.z.number(),
13
+ })),
14
+ });
15
+ BlockIpsCommand.ResponseSchema = zod_1.z.object({
16
+ response: zod_1.z.object({
17
+ accepted: zod_1.z.boolean(),
18
+ }),
19
+ });
20
+ })(BlockIpsCommand || (exports.BlockIpsCommand = BlockIpsCommand = {}));
@@ -0,0 +1,4 @@
1
+ export * from './block-ips.schema';
2
+ export * from './recreate-tables.schema';
3
+ export * from './unblock-ips.schema';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/plugin/nftables/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,19 @@
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("./block-ips.schema"), exports);
18
+ __exportStar(require("./recreate-tables.schema"), exports);
19
+ __exportStar(require("./unblock-ips.schema"), exports);
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ export declare namespace RecreateTablesCommand {
3
+ const url: "/node/plugin/nftables/recreate-tables";
4
+ const ResponseSchema: z.ZodObject<{
5
+ response: z.ZodObject<{
6
+ accepted: z.ZodBoolean;
7
+ }, "strip", z.ZodTypeAny, {
8
+ accepted: boolean;
9
+ }, {
10
+ accepted: boolean;
11
+ }>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ response: {
14
+ accepted: boolean;
15
+ };
16
+ }, {
17
+ response: {
18
+ accepted: boolean;
19
+ };
20
+ }>;
21
+ type Response = z.infer<typeof ResponseSchema>;
22
+ }
23
+ //# sourceMappingURL=recreate-tables.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recreate-tables.schema.d.ts","sourceRoot":"","sources":["../../../../commands/plugin/nftables/recreate-tables.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,yBAAiB,qBAAqB,CAAC;IAC5B,MAAM,GAAG,yCAA2C,CAAC;IAErD,MAAM,cAAc;;;;;;;;;;;;;;;;MAA8D,CAAC;IAC1F,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RecreateTablesCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../../api");
6
+ var RecreateTablesCommand;
7
+ (function (RecreateTablesCommand) {
8
+ RecreateTablesCommand.url = api_1.REST_API.PLUGIN.NFTABLES.RECREATE_TABLES;
9
+ RecreateTablesCommand.ResponseSchema = zod_1.z.object({ response: zod_1.z.object({ accepted: zod_1.z.boolean() }) });
10
+ })(RecreateTablesCommand || (exports.RecreateTablesCommand = RecreateTablesCommand = {}));
@@ -0,0 +1,31 @@
1
+ import { z } from 'zod';
2
+ export declare namespace UnblockIpsCommand {
3
+ const url: "/node/plugin/nftables/unblock-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
+ accepted: z.ZodBoolean;
15
+ }, "strip", z.ZodTypeAny, {
16
+ accepted: boolean;
17
+ }, {
18
+ accepted: boolean;
19
+ }>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ response: {
22
+ accepted: boolean;
23
+ };
24
+ }, {
25
+ response: {
26
+ accepted: boolean;
27
+ };
28
+ }>;
29
+ type Response = z.infer<typeof ResponseSchema>;
30
+ }
31
+ //# sourceMappingURL=unblock-ips.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unblock-ips.schema.d.ts","sourceRoot":"","sources":["../../../../commands/plugin/nftables/unblock-ips.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,yBAAiB,iBAAiB,CAAC;IACxB,MAAM,GAAG,qCAAuC,CAAC;IAEjD,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.UnblockIpsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../../api");
6
+ var UnblockIpsCommand;
7
+ (function (UnblockIpsCommand) {
8
+ UnblockIpsCommand.url = api_1.REST_API.PLUGIN.NFTABLES.UNBLOCK_IPS;
9
+ UnblockIpsCommand.RequestSchema = zod_1.z.object({
10
+ ips: zod_1.z.array(zod_1.z.string().ip()),
11
+ });
12
+ UnblockIpsCommand.ResponseSchema = zod_1.z.object({
13
+ response: zod_1.z.object({
14
+ accepted: zod_1.z.boolean(),
15
+ }),
16
+ });
17
+ })(UnblockIpsCommand || (exports.UnblockIpsCommand = UnblockIpsCommand = {}));
@@ -13,15 +13,15 @@ export declare namespace CollectReportsCommand {
13
13
  processedAt: z.ZodEffects<z.ZodString, Date, string>;
14
14
  }, "strip", z.ZodTypeAny, {
15
15
  userId: string;
16
- blocked: boolean;
17
16
  ip: string;
17
+ blocked: boolean;
18
18
  blockDuration: number;
19
19
  willUnblockAt: Date;
20
20
  processedAt: Date;
21
21
  }, {
22
22
  userId: string;
23
- blocked: boolean;
24
23
  ip: string;
24
+ blocked: boolean;
25
25
  blockDuration: number;
26
26
  willUnblockAt: string;
27
27
  processedAt: string;
@@ -72,8 +72,8 @@ export declare namespace CollectReportsCommand {
72
72
  }, "strip", z.ZodTypeAny, {
73
73
  actionReport: {
74
74
  userId: string;
75
- blocked: boolean;
76
75
  ip: string;
76
+ blocked: boolean;
77
77
  blockDuration: number;
78
78
  willUnblockAt: Date;
79
79
  processedAt: Date;
@@ -96,8 +96,8 @@ export declare namespace CollectReportsCommand {
96
96
  }, {
97
97
  actionReport: {
98
98
  userId: string;
99
- blocked: boolean;
100
99
  ip: string;
100
+ blocked: boolean;
101
101
  blockDuration: number;
102
102
  willUnblockAt: string;
103
103
  processedAt: string;
@@ -122,8 +122,8 @@ export declare namespace CollectReportsCommand {
122
122
  reports: {
123
123
  actionReport: {
124
124
  userId: string;
125
- blocked: boolean;
126
125
  ip: string;
126
+ blocked: boolean;
127
127
  blockDuration: number;
128
128
  willUnblockAt: Date;
129
129
  processedAt: Date;
@@ -148,8 +148,8 @@ export declare namespace CollectReportsCommand {
148
148
  reports: {
149
149
  actionReport: {
150
150
  userId: string;
151
- blocked: boolean;
152
151
  ip: string;
152
+ blocked: boolean;
153
153
  blockDuration: number;
154
154
  willUnblockAt: string;
155
155
  processedAt: string;
@@ -176,8 +176,8 @@ export declare namespace CollectReportsCommand {
176
176
  reports: {
177
177
  actionReport: {
178
178
  userId: string;
179
- blocked: boolean;
180
179
  ip: string;
180
+ blocked: boolean;
181
181
  blockDuration: number;
182
182
  willUnblockAt: Date;
183
183
  processedAt: Date;
@@ -204,8 +204,8 @@ export declare namespace CollectReportsCommand {
204
204
  reports: {
205
205
  actionReport: {
206
206
  userId: string;
207
- blocked: boolean;
208
207
  ip: string;
208
+ blocked: boolean;
209
209
  blockDuration: number;
210
210
  willUnblockAt: string;
211
211
  processedAt: string;
@@ -9,15 +9,15 @@ export declare const TorrentBlockerReportSchema: z.ZodObject<{
9
9
  processedAt: z.ZodEffects<z.ZodString, Date, string>;
10
10
  }, "strip", z.ZodTypeAny, {
11
11
  userId: string;
12
- blocked: boolean;
13
12
  ip: string;
13
+ blocked: boolean;
14
14
  blockDuration: number;
15
15
  willUnblockAt: Date;
16
16
  processedAt: Date;
17
17
  }, {
18
18
  userId: string;
19
- blocked: boolean;
20
19
  ip: string;
20
+ blocked: boolean;
21
21
  blockDuration: number;
22
22
  willUnblockAt: string;
23
23
  processedAt: string;
@@ -68,8 +68,8 @@ export declare const TorrentBlockerReportSchema: z.ZodObject<{
68
68
  }, "strip", z.ZodTypeAny, {
69
69
  actionReport: {
70
70
  userId: string;
71
- blocked: boolean;
72
71
  ip: string;
72
+ blocked: boolean;
73
73
  blockDuration: number;
74
74
  willUnblockAt: Date;
75
75
  processedAt: Date;
@@ -92,8 +92,8 @@ export declare const TorrentBlockerReportSchema: z.ZodObject<{
92
92
  }, {
93
93
  actionReport: {
94
94
  userId: string;
95
- blocked: boolean;
96
95
  ip: string;
96
+ blocked: boolean;
97
97
  blockDuration: number;
98
98
  willUnblockAt: string;
99
99
  processedAt: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/node-contract",
3
- "version": "2.6.5",
3
+ "version": "2.6.6",
4
4
  "description": "A node-contract library for Remnawave Panel",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",