@remnawave/node-plugins 0.0.4 → 0.0.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,13 +1,16 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const SharedListSchema: z.ZodObject<{
|
|
3
3
|
name: z.ZodString;
|
|
4
|
-
|
|
4
|
+
type: z.ZodEnum<["ipList"]>;
|
|
5
|
+
items: z.ZodArray<z.ZodString, "many">;
|
|
5
6
|
}, "strip", z.ZodTypeAny, {
|
|
6
7
|
name: string;
|
|
7
|
-
|
|
8
|
+
type: "ipList";
|
|
9
|
+
items: string[];
|
|
8
10
|
}, {
|
|
9
11
|
name: string;
|
|
10
|
-
|
|
12
|
+
type: "ipList";
|
|
13
|
+
items: string[];
|
|
11
14
|
}>;
|
|
12
15
|
export declare const TorrentBlockerPluginSchema: z.ZodObject<{
|
|
13
16
|
enabled: z.ZodBoolean;
|
|
@@ -57,17 +60,20 @@ export declare const ConnectionDropPluginSchema: z.ZodObject<{
|
|
|
57
60
|
enabled: boolean;
|
|
58
61
|
whitelistIps: string[];
|
|
59
62
|
}>;
|
|
60
|
-
export declare const
|
|
61
|
-
sharedLists: z.ZodArray<z.ZodObject<{
|
|
63
|
+
export declare const NodePluginSchema: z.ZodObject<{
|
|
64
|
+
sharedLists: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
62
65
|
name: z.ZodString;
|
|
63
|
-
|
|
66
|
+
type: z.ZodEnum<["ipList"]>;
|
|
67
|
+
items: z.ZodArray<z.ZodString, "many">;
|
|
64
68
|
}, "strip", z.ZodTypeAny, {
|
|
65
69
|
name: string;
|
|
66
|
-
|
|
70
|
+
type: "ipList";
|
|
71
|
+
items: string[];
|
|
67
72
|
}, {
|
|
68
73
|
name: string;
|
|
69
|
-
|
|
70
|
-
|
|
74
|
+
type: "ipList";
|
|
75
|
+
items: string[];
|
|
76
|
+
}>, "many">>>;
|
|
71
77
|
torrentBlocker: z.ZodOptional<z.ZodObject<{
|
|
72
78
|
enabled: z.ZodBoolean;
|
|
73
79
|
blockDuration: z.ZodNumber;
|
|
@@ -119,7 +125,8 @@ export declare const NodePluginsSchema: z.ZodObject<{
|
|
|
119
125
|
}, "strip", z.ZodTypeAny, {
|
|
120
126
|
sharedLists: {
|
|
121
127
|
name: string;
|
|
122
|
-
|
|
128
|
+
type: "ipList";
|
|
129
|
+
items: string[];
|
|
123
130
|
}[];
|
|
124
131
|
torrentBlocker?: {
|
|
125
132
|
enabled: boolean;
|
|
@@ -138,10 +145,11 @@ export declare const NodePluginsSchema: z.ZodObject<{
|
|
|
138
145
|
whitelistIps: string[];
|
|
139
146
|
} | undefined;
|
|
140
147
|
}, {
|
|
141
|
-
sharedLists
|
|
148
|
+
sharedLists?: {
|
|
142
149
|
name: string;
|
|
143
|
-
|
|
144
|
-
|
|
150
|
+
type: "ipList";
|
|
151
|
+
items: string[];
|
|
152
|
+
}[] | undefined;
|
|
145
153
|
torrentBlocker?: {
|
|
146
154
|
enabled: boolean;
|
|
147
155
|
blockDuration: number;
|
|
@@ -159,5 +167,5 @@ export declare const NodePluginsSchema: z.ZodObject<{
|
|
|
159
167
|
whitelistIps: string[];
|
|
160
168
|
} | undefined;
|
|
161
169
|
}>;
|
|
162
|
-
export type
|
|
170
|
+
export type TNodePlugin = z.infer<typeof NodePluginSchema>;
|
|
163
171
|
//# sourceMappingURL=node-plugins.schema.d.ts.map
|
|
@@ -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;AAExB,eAAO,MAAM,
|
|
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,gBAAgB;;;;;;;;;;;;EAI3B,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4CrC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;EAahC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;EAarC,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0B3B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -1,33 +1,74 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.NodePluginSchema = exports.ConnectionDropPluginSchema = exports.BlacklistPluginSchema = exports.TorrentBlockerPluginSchema = exports.SharedListSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
exports.
|
|
5
|
+
exports.SharedListSchema = zod_1.z.object({
|
|
6
6
|
name: zod_1.z.string().startsWith('ext:'),
|
|
7
|
-
|
|
7
|
+
type: zod_1.z.enum(['ipList']),
|
|
8
|
+
items: zod_1.z.array(zod_1.z.string()),
|
|
8
9
|
});
|
|
9
10
|
exports.TorrentBlockerPluginSchema = zod_1.z.object({
|
|
10
|
-
enabled: zod_1.z.boolean()
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
enabled: zod_1.z.boolean().describe(JSON.stringify({
|
|
12
|
+
markdownDescription: 'Please review documentation for this plugin before enabling it.',
|
|
13
|
+
})),
|
|
14
|
+
blockDuration: zod_1.z
|
|
15
|
+
.number()
|
|
16
|
+
.int()
|
|
17
|
+
.describe(JSON.stringify({
|
|
18
|
+
markdownDescription: 'Duration of the block in seconds. \n\n If the block duration is 0, the block will be permanent. \n\n For example, if the block duration is 3600, the block will be permanent for 1 hour.',
|
|
19
|
+
})),
|
|
20
|
+
ignoreLists: zod_1.z
|
|
21
|
+
.object({
|
|
13
22
|
ip: zod_1.z
|
|
14
23
|
.array(zod_1.z.union([zod_1.z.string().ip(), zod_1.z.string().startsWith('ext:')]))
|
|
15
24
|
.optional()
|
|
16
|
-
.default([])
|
|
17
|
-
|
|
18
|
-
|
|
25
|
+
.default([])
|
|
26
|
+
.describe(JSON.stringify({
|
|
27
|
+
markdownDescription: 'List of IP addresses to ignore from the block. \n\n You can use lists from **sharedLists** in the format: **ext:list_name**. \n\n You can also specify user IDs to ignore from the block.',
|
|
28
|
+
})),
|
|
29
|
+
userId: zod_1.z
|
|
30
|
+
.array(zod_1.z.number().int())
|
|
31
|
+
.optional()
|
|
32
|
+
.default([])
|
|
33
|
+
.describe(JSON.stringify({
|
|
34
|
+
markdownDescription: 'List of user IDs to ignore from the block. \n\n You can also specify user IDs to ignore from the block.',
|
|
35
|
+
})),
|
|
36
|
+
})
|
|
37
|
+
.describe(JSON.stringify({
|
|
38
|
+
markdownDescription: 'List of IP addresses to ignore from the block. \n\n You can use lists from **sharedLists** in the format: **ext:list_name**. \n\n You can also specify user IDs to ignore from the block.',
|
|
39
|
+
})),
|
|
19
40
|
});
|
|
20
41
|
exports.BlacklistPluginSchema = zod_1.z.object({
|
|
21
|
-
enabled: zod_1.z.boolean()
|
|
22
|
-
|
|
42
|
+
enabled: zod_1.z.boolean().describe(JSON.stringify({
|
|
43
|
+
markdownDescription: 'If this plugin is enabled, all IP addresses specified in the **ip** object will be blocked via nftables. **Use with caution.**',
|
|
44
|
+
})),
|
|
45
|
+
ip: zod_1.z.array(zod_1.z.union([zod_1.z.string().ip(), zod_1.z.string().startsWith('ext:')])).describe(JSON.stringify({
|
|
46
|
+
markdownDescription: 'List of IP addresses to block via nftables. \n\n You can use lists from **sharedLists** in the format: **ext:list_name**.',
|
|
47
|
+
})),
|
|
23
48
|
});
|
|
24
49
|
exports.ConnectionDropPluginSchema = zod_1.z.object({
|
|
25
|
-
enabled: zod_1.z.boolean()
|
|
26
|
-
|
|
50
|
+
enabled: zod_1.z.boolean().describe(JSON.stringify({
|
|
51
|
+
markdownDescription: 'Controls whether IP addresses from the **whitelistIps** object will be used.',
|
|
52
|
+
})),
|
|
53
|
+
whitelistIps: zod_1.z.array(zod_1.z.union([zod_1.z.string().ip(), zod_1.z.string().startsWith('ext:')])).describe(JSON.stringify({
|
|
54
|
+
markdownDescription: 'List of IP addresses, for which the connection drop will not be applied, which is enabled by default for all IP addresses. \n\n You can use lists from **sharedLists** in the format: **ext:list_name**.',
|
|
55
|
+
})),
|
|
27
56
|
});
|
|
28
|
-
exports.
|
|
29
|
-
sharedLists: zod_1.z
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
57
|
+
exports.NodePluginSchema = zod_1.z.object({
|
|
58
|
+
sharedLists: zod_1.z
|
|
59
|
+
.array(exports.SharedListSchema)
|
|
60
|
+
.optional()
|
|
61
|
+
.default([])
|
|
62
|
+
.describe(JSON.stringify({
|
|
63
|
+
markdownDescription: 'Array of shared lists, which can be used in other plugins. Optional.',
|
|
64
|
+
})),
|
|
65
|
+
torrentBlocker: exports.TorrentBlockerPluginSchema.optional().describe(JSON.stringify({
|
|
66
|
+
markdownDescription: 'Torrent Blocker Plugin configuration. Optional.',
|
|
67
|
+
})),
|
|
68
|
+
blacklist: exports.BlacklistPluginSchema.optional().describe(JSON.stringify({
|
|
69
|
+
markdownDescription: 'Blacklist Plugin configuration. Optional.',
|
|
70
|
+
})),
|
|
71
|
+
connectionDrop: exports.ConnectionDropPluginSchema.optional().describe(JSON.stringify({
|
|
72
|
+
markdownDescription: 'Connection Drop Plugin configuration. Optional.',
|
|
73
|
+
})),
|
|
33
74
|
});
|
|
@@ -1,33 +1,74 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.NodePluginSchema = exports.ConnectionDropPluginSchema = exports.BlacklistPluginSchema = exports.TorrentBlockerPluginSchema = exports.SharedListSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
exports.
|
|
5
|
+
exports.SharedListSchema = zod_1.z.object({
|
|
6
6
|
name: zod_1.z.string().startsWith('ext:'),
|
|
7
|
-
|
|
7
|
+
type: zod_1.z.enum(['ipList']),
|
|
8
|
+
items: zod_1.z.array(zod_1.z.string()),
|
|
8
9
|
});
|
|
9
10
|
exports.TorrentBlockerPluginSchema = zod_1.z.object({
|
|
10
|
-
enabled: zod_1.z.boolean()
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
enabled: zod_1.z.boolean().describe(JSON.stringify({
|
|
12
|
+
markdownDescription: 'Please review documentation for this plugin before enabling it.',
|
|
13
|
+
})),
|
|
14
|
+
blockDuration: zod_1.z
|
|
15
|
+
.number()
|
|
16
|
+
.int()
|
|
17
|
+
.describe(JSON.stringify({
|
|
18
|
+
markdownDescription: 'Duration of the block in seconds. \n\n If the block duration is 0, the block will be permanent. \n\n For example, if the block duration is 3600, the block will be permanent for 1 hour.',
|
|
19
|
+
})),
|
|
20
|
+
ignoreLists: zod_1.z
|
|
21
|
+
.object({
|
|
13
22
|
ip: zod_1.z
|
|
14
23
|
.array(zod_1.z.union([zod_1.z.string().ip(), zod_1.z.string().startsWith('ext:')]))
|
|
15
24
|
.optional()
|
|
16
|
-
.default([])
|
|
17
|
-
|
|
18
|
-
|
|
25
|
+
.default([])
|
|
26
|
+
.describe(JSON.stringify({
|
|
27
|
+
markdownDescription: 'List of IP addresses to ignore from the block. \n\n You can use lists from **sharedLists** in the format: **ext:list_name**. \n\n You can also specify user IDs to ignore from the block.',
|
|
28
|
+
})),
|
|
29
|
+
userId: zod_1.z
|
|
30
|
+
.array(zod_1.z.number().int())
|
|
31
|
+
.optional()
|
|
32
|
+
.default([])
|
|
33
|
+
.describe(JSON.stringify({
|
|
34
|
+
markdownDescription: 'List of user IDs to ignore from the block. \n\n You can also specify user IDs to ignore from the block.',
|
|
35
|
+
})),
|
|
36
|
+
})
|
|
37
|
+
.describe(JSON.stringify({
|
|
38
|
+
markdownDescription: 'List of IP addresses to ignore from the block. \n\n You can use lists from **sharedLists** in the format: **ext:list_name**. \n\n You can also specify user IDs to ignore from the block.',
|
|
39
|
+
})),
|
|
19
40
|
});
|
|
20
41
|
exports.BlacklistPluginSchema = zod_1.z.object({
|
|
21
|
-
enabled: zod_1.z.boolean()
|
|
22
|
-
|
|
42
|
+
enabled: zod_1.z.boolean().describe(JSON.stringify({
|
|
43
|
+
markdownDescription: 'If this plugin is enabled, all IP addresses specified in the **ip** object will be blocked via nftables. **Use with caution.**',
|
|
44
|
+
})),
|
|
45
|
+
ip: zod_1.z.array(zod_1.z.union([zod_1.z.string().ip(), zod_1.z.string().startsWith('ext:')])).describe(JSON.stringify({
|
|
46
|
+
markdownDescription: 'List of IP addresses to block via nftables. \n\n You can use lists from **sharedLists** in the format: **ext:list_name**.',
|
|
47
|
+
})),
|
|
23
48
|
});
|
|
24
49
|
exports.ConnectionDropPluginSchema = zod_1.z.object({
|
|
25
|
-
enabled: zod_1.z.boolean()
|
|
26
|
-
|
|
50
|
+
enabled: zod_1.z.boolean().describe(JSON.stringify({
|
|
51
|
+
markdownDescription: 'Controls whether IP addresses from the **whitelistIps** object will be used.',
|
|
52
|
+
})),
|
|
53
|
+
whitelistIps: zod_1.z.array(zod_1.z.union([zod_1.z.string().ip(), zod_1.z.string().startsWith('ext:')])).describe(JSON.stringify({
|
|
54
|
+
markdownDescription: 'List of IP addresses, for which the connection drop will not be applied, which is enabled by default for all IP addresses. \n\n You can use lists from **sharedLists** in the format: **ext:list_name**.',
|
|
55
|
+
})),
|
|
27
56
|
});
|
|
28
|
-
exports.
|
|
29
|
-
sharedLists: zod_1.z
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
57
|
+
exports.NodePluginSchema = zod_1.z.object({
|
|
58
|
+
sharedLists: zod_1.z
|
|
59
|
+
.array(exports.SharedListSchema)
|
|
60
|
+
.optional()
|
|
61
|
+
.default([])
|
|
62
|
+
.describe(JSON.stringify({
|
|
63
|
+
markdownDescription: 'Array of shared lists, which can be used in other plugins. Optional.',
|
|
64
|
+
})),
|
|
65
|
+
torrentBlocker: exports.TorrentBlockerPluginSchema.optional().describe(JSON.stringify({
|
|
66
|
+
markdownDescription: 'Torrent Blocker Plugin configuration. Optional.',
|
|
67
|
+
})),
|
|
68
|
+
blacklist: exports.BlacklistPluginSchema.optional().describe(JSON.stringify({
|
|
69
|
+
markdownDescription: 'Blacklist Plugin configuration. Optional.',
|
|
70
|
+
})),
|
|
71
|
+
connectionDrop: exports.ConnectionDropPluginSchema.optional().describe(JSON.stringify({
|
|
72
|
+
markdownDescription: 'Connection Drop Plugin configuration. Optional.',
|
|
73
|
+
})),
|
|
33
74
|
});
|