@remnawave/node-plugins 0.0.2 → 0.0.4

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,3 +1,2 @@
1
- export * from './constants';
2
1
  export * from './models';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -14,5 +14,4 @@ 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("./constants"), exports);
18
17
  __exportStar(require("./models"), exports);
@@ -11,10 +11,6 @@ export declare const SharedIpListSchema: z.ZodObject<{
11
11
  }>;
12
12
  export declare const TorrentBlockerPluginSchema: z.ZodObject<{
13
13
  enabled: z.ZodBoolean;
14
- mode: z.ZodNativeEnum<{
15
- readonly BLOCK: "BLOCK";
16
- readonly NOTIFY: "NOTIFY";
17
- }>;
18
14
  blockDuration: z.ZodNumber;
19
15
  ignoreLists: z.ZodObject<{
20
16
  ip: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodString]>, "many">>>;
@@ -28,7 +24,6 @@ export declare const TorrentBlockerPluginSchema: z.ZodObject<{
28
24
  }>;
29
25
  }, "strip", z.ZodTypeAny, {
30
26
  enabled: boolean;
31
- mode: "BLOCK" | "NOTIFY";
32
27
  blockDuration: number;
33
28
  ignoreLists: {
34
29
  ip: string[];
@@ -36,7 +31,6 @@ export declare const TorrentBlockerPluginSchema: z.ZodObject<{
36
31
  };
37
32
  }, {
38
33
  enabled: boolean;
39
- mode: "BLOCK" | "NOTIFY";
40
34
  blockDuration: number;
41
35
  ignoreLists: {
42
36
  ip?: string[] | undefined;
@@ -55,13 +49,13 @@ export declare const BlacklistPluginSchema: z.ZodObject<{
55
49
  }>;
56
50
  export declare const ConnectionDropPluginSchema: z.ZodObject<{
57
51
  enabled: z.ZodBoolean;
58
- ip: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodString]>, "many">;
52
+ whitelistIps: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodString]>, "many">;
59
53
  }, "strip", z.ZodTypeAny, {
60
54
  enabled: boolean;
61
- ip: string[];
55
+ whitelistIps: string[];
62
56
  }, {
63
57
  enabled: boolean;
64
- ip: string[];
58
+ whitelistIps: string[];
65
59
  }>;
66
60
  export declare const NodePluginsSchema: z.ZodObject<{
67
61
  sharedLists: z.ZodArray<z.ZodObject<{
@@ -76,10 +70,6 @@ export declare const NodePluginsSchema: z.ZodObject<{
76
70
  }>, "many">;
77
71
  torrentBlocker: z.ZodOptional<z.ZodObject<{
78
72
  enabled: z.ZodBoolean;
79
- mode: z.ZodNativeEnum<{
80
- readonly BLOCK: "BLOCK";
81
- readonly NOTIFY: "NOTIFY";
82
- }>;
83
73
  blockDuration: z.ZodNumber;
84
74
  ignoreLists: z.ZodObject<{
85
75
  ip: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodString]>, "many">>>;
@@ -93,7 +83,6 @@ export declare const NodePluginsSchema: z.ZodObject<{
93
83
  }>;
94
84
  }, "strip", z.ZodTypeAny, {
95
85
  enabled: boolean;
96
- mode: "BLOCK" | "NOTIFY";
97
86
  blockDuration: number;
98
87
  ignoreLists: {
99
88
  ip: string[];
@@ -101,7 +90,6 @@ export declare const NodePluginsSchema: z.ZodObject<{
101
90
  };
102
91
  }, {
103
92
  enabled: boolean;
104
- mode: "BLOCK" | "NOTIFY";
105
93
  blockDuration: number;
106
94
  ignoreLists: {
107
95
  ip?: string[] | undefined;
@@ -120,13 +108,13 @@ export declare const NodePluginsSchema: z.ZodObject<{
120
108
  }>>;
121
109
  connectionDrop: z.ZodOptional<z.ZodObject<{
122
110
  enabled: z.ZodBoolean;
123
- ip: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodString]>, "many">;
111
+ whitelistIps: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodString]>, "many">;
124
112
  }, "strip", z.ZodTypeAny, {
125
113
  enabled: boolean;
126
- ip: string[];
114
+ whitelistIps: string[];
127
115
  }, {
128
116
  enabled: boolean;
129
- ip: string[];
117
+ whitelistIps: string[];
130
118
  }>>;
131
119
  }, "strip", z.ZodTypeAny, {
132
120
  sharedLists: {
@@ -135,7 +123,6 @@ export declare const NodePluginsSchema: z.ZodObject<{
135
123
  }[];
136
124
  torrentBlocker?: {
137
125
  enabled: boolean;
138
- mode: "BLOCK" | "NOTIFY";
139
126
  blockDuration: number;
140
127
  ignoreLists: {
141
128
  ip: string[];
@@ -148,7 +135,7 @@ export declare const NodePluginsSchema: z.ZodObject<{
148
135
  } | undefined;
149
136
  connectionDrop?: {
150
137
  enabled: boolean;
151
- ip: string[];
138
+ whitelistIps: string[];
152
139
  } | undefined;
153
140
  }, {
154
141
  sharedLists: {
@@ -157,7 +144,6 @@ export declare const NodePluginsSchema: z.ZodObject<{
157
144
  }[];
158
145
  torrentBlocker?: {
159
146
  enabled: boolean;
160
- mode: "BLOCK" | "NOTIFY";
161
147
  blockDuration: number;
162
148
  ignoreLists: {
163
149
  ip?: string[] | undefined;
@@ -170,7 +156,7 @@ export declare const NodePluginsSchema: z.ZodObject<{
170
156
  } | undefined;
171
157
  connectionDrop?: {
172
158
  enabled: boolean;
173
- ip: string[];
159
+ whitelistIps: string[];
174
160
  } | undefined;
175
161
  }>;
176
162
  export type TNodePlugins = z.infer<typeof NodePluginsSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"node-plugins.schema.d.ts","sourceRoot":"","sources":["../../../models/node-plugins.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,kBAAkB;;;;;;;;;EAG7B,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWrC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;EAGhC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;EAGrC,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK5B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
1
+ {"version":3,"file":"node-plugins.schema.d.ts","sourceRoot":"","sources":["../../../models/node-plugins.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB;;;;;;;;;EAG7B,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUrC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;EAGhC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;EAGrC,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK5B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -2,14 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NodePluginsSchema = exports.ConnectionDropPluginSchema = exports.BlacklistPluginSchema = exports.TorrentBlockerPluginSchema = exports.SharedIpListSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const constants_1 = require("../constants");
6
5
  exports.SharedIpListSchema = zod_1.z.object({
7
6
  name: zod_1.z.string().startsWith('ext:'),
8
7
  ipList: zod_1.z.array(zod_1.z.string().ip()),
9
8
  });
10
9
  exports.TorrentBlockerPluginSchema = zod_1.z.object({
11
10
  enabled: zod_1.z.boolean(),
12
- mode: zod_1.z.nativeEnum(constants_1.TORRENT_BLOCKER_MODES),
13
11
  blockDuration: zod_1.z.number().int(),
14
12
  ignoreLists: zod_1.z.object({
15
13
  ip: zod_1.z
@@ -25,7 +23,7 @@ exports.BlacklistPluginSchema = zod_1.z.object({
25
23
  });
26
24
  exports.ConnectionDropPluginSchema = zod_1.z.object({
27
25
  enabled: zod_1.z.boolean(),
28
- ip: zod_1.z.array(zod_1.z.union([zod_1.z.string().ip(), zod_1.z.string().startsWith('ext:')])),
26
+ whitelistIps: zod_1.z.array(zod_1.z.union([zod_1.z.string().ip(), zod_1.z.string().startsWith('ext:')])),
29
27
  });
30
28
  exports.NodePluginsSchema = zod_1.z.object({
31
29
  sharedLists: zod_1.z.array(exports.SharedIpListSchema),
@@ -14,5 +14,4 @@ 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("./constants"), exports);
18
17
  __exportStar(require("./models"), exports);
@@ -2,14 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NodePluginsSchema = exports.ConnectionDropPluginSchema = exports.BlacklistPluginSchema = exports.TorrentBlockerPluginSchema = exports.SharedIpListSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const constants_1 = require("../constants");
6
5
  exports.SharedIpListSchema = zod_1.z.object({
7
6
  name: zod_1.z.string().startsWith('ext:'),
8
7
  ipList: zod_1.z.array(zod_1.z.string().ip()),
9
8
  });
10
9
  exports.TorrentBlockerPluginSchema = zod_1.z.object({
11
10
  enabled: zod_1.z.boolean(),
12
- mode: zod_1.z.nativeEnum(constants_1.TORRENT_BLOCKER_MODES),
13
11
  blockDuration: zod_1.z.number().int(),
14
12
  ignoreLists: zod_1.z.object({
15
13
  ip: zod_1.z
@@ -25,7 +23,7 @@ exports.BlacklistPluginSchema = zod_1.z.object({
25
23
  });
26
24
  exports.ConnectionDropPluginSchema = zod_1.z.object({
27
25
  enabled: zod_1.z.boolean(),
28
- ip: zod_1.z.array(zod_1.z.union([zod_1.z.string().ip(), zod_1.z.string().startsWith('ext:')])),
26
+ whitelistIps: zod_1.z.array(zod_1.z.union([zod_1.z.string().ip(), zod_1.z.string().startsWith('ext:')])),
29
27
  });
30
28
  exports.NodePluginsSchema = zod_1.z.object({
31
29
  sharedLists: zod_1.z.array(exports.SharedIpListSchema),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/node-plugins",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "public": true,
5
5
  "license": "AGPL-3.0-only",
6
6
  "description": "A library for Remnawave Node Plugins.",
@@ -1,2 +0,0 @@
1
- export * from './torrent-blocker';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -1,17 +0,0 @@
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"), exports);
@@ -1,2 +0,0 @@
1
- export * from './torrent-blocker.constants';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../constants/torrent-blocker/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC"}
@@ -1,17 +0,0 @@
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.constants"), exports);
@@ -1,8 +0,0 @@
1
- export declare const TORRENT_BLOCKER_MODES: {
2
- readonly BLOCK: "BLOCK";
3
- readonly NOTIFY: "NOTIFY";
4
- };
5
- export type TTorrentBlockerMode = (typeof TORRENT_BLOCKER_MODES)[keyof typeof TORRENT_BLOCKER_MODES];
6
- export declare const TORRENT_BLOCKER_MODES_VALUES: ("BLOCK" | "NOTIFY")[];
7
- export declare const isTorrentBlockerMode: (value: string) => value is TTorrentBlockerMode;
8
- //# sourceMappingURL=torrent-blocker.constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"torrent-blocker.constants.d.ts","sourceRoot":"","sources":["../../../../constants/torrent-blocker/torrent-blocker.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB;;;CAGxB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAC3B,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC;AAEvE,eAAO,MAAM,4BAA4B,wBAAuC,CAAC;AAEjF,eAAO,MAAM,oBAAoB,GAAI,OAAO,MAAM,KAAG,KAAK,IAAI,mBAE7D,CAAC"}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isTorrentBlockerMode = exports.TORRENT_BLOCKER_MODES_VALUES = exports.TORRENT_BLOCKER_MODES = void 0;
4
- exports.TORRENT_BLOCKER_MODES = {
5
- BLOCK: 'BLOCK',
6
- NOTIFY: 'NOTIFY',
7
- };
8
- exports.TORRENT_BLOCKER_MODES_VALUES = Object.values(exports.TORRENT_BLOCKER_MODES);
9
- const isTorrentBlockerMode = (value) => {
10
- return exports.TORRENT_BLOCKER_MODES_VALUES.includes(value);
11
- };
12
- exports.isTorrentBlockerMode = isTorrentBlockerMode;
@@ -1,17 +0,0 @@
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"), exports);
@@ -1,17 +0,0 @@
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.constants"), exports);
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isTorrentBlockerMode = exports.TORRENT_BLOCKER_MODES_VALUES = exports.TORRENT_BLOCKER_MODES = void 0;
4
- exports.TORRENT_BLOCKER_MODES = {
5
- BLOCK: 'BLOCK',
6
- NOTIFY: 'NOTIFY',
7
- };
8
- exports.TORRENT_BLOCKER_MODES_VALUES = Object.values(exports.TORRENT_BLOCKER_MODES);
9
- const isTorrentBlockerMode = (value) => {
10
- return exports.TORRENT_BLOCKER_MODES_VALUES.includes(value);
11
- };
12
- exports.isTorrentBlockerMode = isTorrentBlockerMode;