@remnawave/node-plugins 0.0.1

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.
@@ -0,0 +1,2 @@
1
+ export * from './torrent-blocker';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,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("./torrent-blocker"), exports);
@@ -0,0 +1,2 @@
1
+ export * from './torrent-blocker.constants';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../constants/torrent-blocker/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,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("./torrent-blocker.constants"), exports);
@@ -0,0 +1,8 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,12 @@
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;
@@ -0,0 +1,3 @@
1
+ export * from './constants';
2
+ export * from './models';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,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("./constants"), exports);
18
+ __exportStar(require("./models"), exports);
@@ -0,0 +1,2 @@
1
+ export * from './node-plugins.schema';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../models/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,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("./node-plugins.schema"), exports);
@@ -0,0 +1,177 @@
1
+ import { z } from 'zod';
2
+ export declare const SharedIpListSchema: z.ZodObject<{
3
+ name: z.ZodString;
4
+ ipList: z.ZodArray<z.ZodString, "many">;
5
+ }, "strip", z.ZodTypeAny, {
6
+ name: string;
7
+ ipList: string[];
8
+ }, {
9
+ name: string;
10
+ ipList: string[];
11
+ }>;
12
+ export declare const TorrentBlockerPluginSchema: z.ZodObject<{
13
+ enabled: z.ZodBoolean;
14
+ mode: z.ZodNativeEnum<{
15
+ readonly BLOCK: "BLOCK";
16
+ readonly NOTIFY: "NOTIFY";
17
+ }>;
18
+ blockDuration: z.ZodNumber;
19
+ ignoreLists: z.ZodObject<{
20
+ ip: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodString]>, "many">>>;
21
+ userId: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>;
22
+ }, "strip", z.ZodTypeAny, {
23
+ ip: string[];
24
+ userId: number[];
25
+ }, {
26
+ ip?: string[] | undefined;
27
+ userId?: number[] | undefined;
28
+ }>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ enabled: boolean;
31
+ mode: "BLOCK" | "NOTIFY";
32
+ blockDuration: number;
33
+ ignoreLists: {
34
+ ip: string[];
35
+ userId: number[];
36
+ };
37
+ }, {
38
+ enabled: boolean;
39
+ mode: "BLOCK" | "NOTIFY";
40
+ blockDuration: number;
41
+ ignoreLists: {
42
+ ip?: string[] | undefined;
43
+ userId?: number[] | undefined;
44
+ };
45
+ }>;
46
+ export declare const BlacklistPluginSchema: z.ZodObject<{
47
+ enabled: z.ZodBoolean;
48
+ ip: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodString]>, "many">;
49
+ }, "strip", z.ZodTypeAny, {
50
+ enabled: boolean;
51
+ ip: string[];
52
+ }, {
53
+ enabled: boolean;
54
+ ip: string[];
55
+ }>;
56
+ export declare const ConnectionDropPluginSchema: z.ZodObject<{
57
+ enabled: z.ZodBoolean;
58
+ ip: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodString]>, "many">;
59
+ }, "strip", z.ZodTypeAny, {
60
+ enabled: boolean;
61
+ ip: string[];
62
+ }, {
63
+ enabled: boolean;
64
+ ip: string[];
65
+ }>;
66
+ export declare const NodePluginsSchema: z.ZodObject<{
67
+ sharedLists: z.ZodArray<z.ZodObject<{
68
+ name: z.ZodString;
69
+ ipList: z.ZodArray<z.ZodString, "many">;
70
+ }, "strip", z.ZodTypeAny, {
71
+ name: string;
72
+ ipList: string[];
73
+ }, {
74
+ name: string;
75
+ ipList: string[];
76
+ }>, "many">;
77
+ torrentBlocker: z.ZodOptional<z.ZodObject<{
78
+ enabled: z.ZodBoolean;
79
+ mode: z.ZodNativeEnum<{
80
+ readonly BLOCK: "BLOCK";
81
+ readonly NOTIFY: "NOTIFY";
82
+ }>;
83
+ blockDuration: z.ZodNumber;
84
+ ignoreLists: z.ZodObject<{
85
+ ip: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodString]>, "many">>>;
86
+ userId: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>;
87
+ }, "strip", z.ZodTypeAny, {
88
+ ip: string[];
89
+ userId: number[];
90
+ }, {
91
+ ip?: string[] | undefined;
92
+ userId?: number[] | undefined;
93
+ }>;
94
+ }, "strip", z.ZodTypeAny, {
95
+ enabled: boolean;
96
+ mode: "BLOCK" | "NOTIFY";
97
+ blockDuration: number;
98
+ ignoreLists: {
99
+ ip: string[];
100
+ userId: number[];
101
+ };
102
+ }, {
103
+ enabled: boolean;
104
+ mode: "BLOCK" | "NOTIFY";
105
+ blockDuration: number;
106
+ ignoreLists: {
107
+ ip?: string[] | undefined;
108
+ userId?: number[] | undefined;
109
+ };
110
+ }>>;
111
+ blacklist: z.ZodOptional<z.ZodObject<{
112
+ enabled: z.ZodBoolean;
113
+ ip: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodString]>, "many">;
114
+ }, "strip", z.ZodTypeAny, {
115
+ enabled: boolean;
116
+ ip: string[];
117
+ }, {
118
+ enabled: boolean;
119
+ ip: string[];
120
+ }>>;
121
+ connectionDrop: z.ZodOptional<z.ZodObject<{
122
+ enabled: z.ZodBoolean;
123
+ ip: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodString]>, "many">;
124
+ }, "strip", z.ZodTypeAny, {
125
+ enabled: boolean;
126
+ ip: string[];
127
+ }, {
128
+ enabled: boolean;
129
+ ip: string[];
130
+ }>>;
131
+ }, "strip", z.ZodTypeAny, {
132
+ sharedLists: {
133
+ name: string;
134
+ ipList: string[];
135
+ }[];
136
+ torrentBlocker?: {
137
+ enabled: boolean;
138
+ mode: "BLOCK" | "NOTIFY";
139
+ blockDuration: number;
140
+ ignoreLists: {
141
+ ip: string[];
142
+ userId: number[];
143
+ };
144
+ } | undefined;
145
+ blacklist?: {
146
+ enabled: boolean;
147
+ ip: string[];
148
+ } | undefined;
149
+ connectionDrop?: {
150
+ enabled: boolean;
151
+ ip: string[];
152
+ } | undefined;
153
+ }, {
154
+ sharedLists: {
155
+ name: string;
156
+ ipList: string[];
157
+ }[];
158
+ torrentBlocker?: {
159
+ enabled: boolean;
160
+ mode: "BLOCK" | "NOTIFY";
161
+ blockDuration: number;
162
+ ignoreLists: {
163
+ ip?: string[] | undefined;
164
+ userId?: number[] | undefined;
165
+ };
166
+ } | undefined;
167
+ blacklist?: {
168
+ enabled: boolean;
169
+ ip: string[];
170
+ } | undefined;
171
+ connectionDrop?: {
172
+ enabled: boolean;
173
+ ip: string[];
174
+ } | undefined;
175
+ }>;
176
+ export type TNodePlugins = z.infer<typeof NodePluginsSchema>;
177
+ //# sourceMappingURL=node-plugins.schema.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NodePluginsSchema = exports.ConnectionDropPluginSchema = exports.BlacklistPluginSchema = exports.TorrentBlockerPluginSchema = exports.SharedIpListSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../constants");
6
+ exports.SharedIpListSchema = zod_1.z.object({
7
+ name: zod_1.z.string().startsWith('ext:'),
8
+ ipList: zod_1.z.array(zod_1.z.string().ip()),
9
+ });
10
+ exports.TorrentBlockerPluginSchema = zod_1.z.object({
11
+ enabled: zod_1.z.boolean(),
12
+ mode: zod_1.z.nativeEnum(constants_1.TORRENT_BLOCKER_MODES),
13
+ blockDuration: zod_1.z.number().int(),
14
+ ignoreLists: zod_1.z.object({
15
+ ip: zod_1.z
16
+ .array(zod_1.z.union([zod_1.z.string().ip(), zod_1.z.string().startsWith('ext:')]))
17
+ .optional()
18
+ .default([]),
19
+ userId: zod_1.z.array(zod_1.z.number().int()).optional().default([]),
20
+ }),
21
+ });
22
+ exports.BlacklistPluginSchema = zod_1.z.object({
23
+ enabled: zod_1.z.boolean(),
24
+ ip: zod_1.z.array(zod_1.z.union([zod_1.z.string().ip(), zod_1.z.string().startsWith('ext:')])),
25
+ });
26
+ exports.ConnectionDropPluginSchema = zod_1.z.object({
27
+ 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:')])),
29
+ });
30
+ exports.NodePluginsSchema = zod_1.z.object({
31
+ sharedLists: zod_1.z.array(exports.SharedIpListSchema),
32
+ torrentBlocker: exports.TorrentBlockerPluginSchema.optional(),
33
+ blacklist: exports.BlacklistPluginSchema.optional(),
34
+ connectionDrop: exports.ConnectionDropPluginSchema.optional(),
35
+ });
@@ -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("./torrent-blocker"), exports);
@@ -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("./torrent-blocker.constants"), exports);
@@ -0,0 +1,12 @@
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;
@@ -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("./constants"), exports);
18
+ __exportStar(require("./models"), exports);
@@ -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("./node-plugins.schema"), exports);
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NodePluginsSchema = exports.ConnectionDropPluginSchema = exports.BlacklistPluginSchema = exports.TorrentBlockerPluginSchema = exports.SharedIpListSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../constants");
6
+ exports.SharedIpListSchema = zod_1.z.object({
7
+ name: zod_1.z.string().startsWith('ext:'),
8
+ ipList: zod_1.z.array(zod_1.z.string().ip()),
9
+ });
10
+ exports.TorrentBlockerPluginSchema = zod_1.z.object({
11
+ enabled: zod_1.z.boolean(),
12
+ mode: zod_1.z.nativeEnum(constants_1.TORRENT_BLOCKER_MODES),
13
+ blockDuration: zod_1.z.number().int(),
14
+ ignoreLists: zod_1.z.object({
15
+ ip: zod_1.z
16
+ .array(zod_1.z.union([zod_1.z.string().ip(), zod_1.z.string().startsWith('ext:')]))
17
+ .optional()
18
+ .default([]),
19
+ userId: zod_1.z.array(zod_1.z.number().int()).optional().default([]),
20
+ }),
21
+ });
22
+ exports.BlacklistPluginSchema = zod_1.z.object({
23
+ enabled: zod_1.z.boolean(),
24
+ ip: zod_1.z.array(zod_1.z.union([zod_1.z.string().ip(), zod_1.z.string().startsWith('ext:')])),
25
+ });
26
+ exports.ConnectionDropPluginSchema = zod_1.z.object({
27
+ 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:')])),
29
+ });
30
+ exports.NodePluginsSchema = zod_1.z.object({
31
+ sharedLists: zod_1.z.array(exports.SharedIpListSchema),
32
+ torrentBlocker: exports.TorrentBlockerPluginSchema.optional(),
33
+ blacklist: exports.BlacklistPluginSchema.optional(),
34
+ connectionDrop: exports.ConnectionDropPluginSchema.optional(),
35
+ });
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@remnawave/node-plugins",
3
+ "version": "0.0.1",
4
+ "public": true,
5
+ "license": "AGPL-3.0-only",
6
+ "description": "A library for Remnawave Node Plugins.",
7
+ "author": "REMNAWAVE <github.com/remnawave>",
8
+ "homepage": "https://github.com/remnawave",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/remnawave/backend.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/remnawave/backend/issues"
15
+ },
16
+ "main": "build/backend/index.js",
17
+ "browser": "build/frontend/index.js",
18
+ "types": "build/backend/index.d.ts",
19
+ "files": [
20
+ "build/**/*"
21
+ ],
22
+ "scripts": {
23
+ "clean": "rm -rf build",
24
+ "build:backend": "tsc -p tsconfig.backend.json",
25
+ "build:frontend": "tsc -p tsconfig.frontend.json",
26
+ "build": "npm run clean && npm run build:backend && npm run build:frontend",
27
+ "prepublish": "npm run build"
28
+ },
29
+ "keywords": [],
30
+ "dependencies": {
31
+ "zod": "3.25.76"
32
+ }
33
+ }