@remnawave/backend-contract 3.3.1 → 3.3.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.
- package/build/backend/api/controllers/index.d.ts +1 -0
- package/build/backend/api/controllers/index.d.ts.map +1 -1
- package/build/backend/api/controllers/index.js +1 -0
- package/build/backend/api/controllers/node-integrations.d.ts +9 -0
- package/build/backend/api/controllers/node-integrations.d.ts.map +1 -0
- package/build/backend/api/controllers/node-integrations.js +11 -0
- package/build/backend/api/controllers-info.d.ts +5 -0
- package/build/backend/api/controllers-info.d.ts.map +1 -1
- package/build/backend/api/controllers-info.js +5 -0
- package/build/backend/api/routes.d.ts +7 -0
- package/build/backend/api/routes.d.ts.map +1 -1
- package/build/backend/api/routes.js +7 -0
- package/build/backend/commands/index.d.ts +1 -0
- package/build/backend/commands/index.d.ts.map +1 -1
- package/build/backend/commands/index.js +1 -0
- package/build/backend/commands/node-integrations/create-node-integration.command.d.ts +22 -0
- package/build/backend/commands/node-integrations/create-node-integration.command.d.ts.map +1 -0
- package/build/backend/commands/node-integrations/create-node-integration.command.js +24 -0
- package/build/backend/commands/node-integrations/delete-node-integration.command.d.ts +11 -0
- package/build/backend/commands/node-integrations/delete-node-integration.command.d.ts.map +1 -0
- package/build/backend/commands/node-integrations/delete-node-integration.command.js +15 -0
- package/build/backend/commands/node-integrations/get-node-integration.command.d.ts +20 -0
- package/build/backend/commands/node-integrations/get-node-integration.command.d.ts.map +1 -0
- package/build/backend/commands/node-integrations/get-node-integration.command.js +19 -0
- package/build/backend/commands/node-integrations/get-node-integrations.command.d.ts +19 -0
- package/build/backend/commands/node-integrations/get-node-integrations.command.d.ts.map +1 -0
- package/build/backend/commands/node-integrations/get-node-integrations.command.js +19 -0
- package/build/backend/commands/node-integrations/index.d.ts +6 -0
- package/build/backend/commands/node-integrations/index.d.ts.map +1 -0
- package/build/backend/commands/node-integrations/index.js +21 -0
- package/build/backend/commands/node-integrations/update-node-integration.command.d.ts +24 -0
- package/build/backend/commands/node-integrations/update-node-integration.command.d.ts.map +1 -0
- package/build/backend/commands/node-integrations/update-node-integration.command.js +27 -0
- package/build/backend/commands/nodes/actions/disable.command.d.ts +1 -0
- package/build/backend/commands/nodes/actions/disable.command.d.ts.map +1 -1
- package/build/backend/commands/nodes/actions/enable.command.d.ts +1 -0
- package/build/backend/commands/nodes/actions/enable.command.d.ts.map +1 -1
- package/build/backend/commands/nodes/actions/reorder.command.d.ts +1 -0
- package/build/backend/commands/nodes/actions/reorder.command.d.ts.map +1 -1
- package/build/backend/commands/nodes/bulk-actions/bulk-update.command.d.ts +1 -0
- package/build/backend/commands/nodes/bulk-actions/bulk-update.command.d.ts.map +1 -1
- package/build/backend/commands/nodes/bulk-actions/bulk-update.command.js +1 -0
- package/build/backend/commands/nodes/create.command.d.ts +2 -0
- package/build/backend/commands/nodes/create.command.d.ts.map +1 -1
- package/build/backend/commands/nodes/create.command.js +1 -0
- package/build/backend/commands/nodes/get-node.command.d.ts +1 -0
- package/build/backend/commands/nodes/get-node.command.d.ts.map +1 -1
- package/build/backend/commands/nodes/get-nodes.command.d.ts +1 -0
- package/build/backend/commands/nodes/get-nodes.command.d.ts.map +1 -1
- package/build/backend/commands/nodes/node.response.d.ts +1 -0
- package/build/backend/commands/nodes/node.response.d.ts.map +1 -1
- package/build/backend/commands/nodes/update.command.d.ts +2 -0
- package/build/backend/commands/nodes/update.command.d.ts.map +1 -1
- package/build/backend/commands/nodes/update.command.js +1 -0
- package/build/backend/commands/subscriptions/get-by/get-raw-subscription-by-short-uuid.command.d.ts +126 -108
- package/build/backend/commands/subscriptions/get-by/get-raw-subscription-by-short-uuid.command.d.ts.map +1 -1
- package/build/backend/constants/errors/errors.d.ts +35 -0
- package/build/backend/constants/errors/errors.d.ts.map +1 -1
- package/build/backend/constants/errors/errors.js +35 -0
- package/build/backend/models/index.d.ts +1 -0
- package/build/backend/models/index.d.ts.map +1 -1
- package/build/backend/models/index.js +1 -0
- package/build/backend/models/node-integration.schema.d.ts +8 -0
- package/build/backend/models/node-integration.schema.d.ts.map +1 -0
- package/build/backend/models/node-integration.schema.js +13 -0
- package/build/backend/models/nodes.schema.d.ts +1 -0
- package/build/backend/models/nodes.schema.d.ts.map +1 -1
- package/build/backend/models/nodes.schema.js +1 -0
- package/build/backend/models/resolved-proxy-config.schema.d.ts +207 -107
- package/build/backend/models/resolved-proxy-config.schema.d.ts.map +1 -1
- package/build/backend/models/resolved-proxy-config.schema.js +19 -35
- package/build/backend/models/webhook/webhook.schema.d.ts +4 -0
- package/build/backend/models/webhook/webhook.schema.d.ts.map +1 -1
- package/build/frontend/api/controllers/index.js +1 -0
- package/build/frontend/api/controllers/node-integrations.js +11 -0
- package/build/frontend/api/controllers-info.js +5 -0
- package/build/frontend/api/routes.js +7 -0
- package/build/frontend/commands/index.js +1 -0
- package/build/frontend/commands/node-integrations/create-node-integration.command.js +24 -0
- package/build/frontend/commands/node-integrations/delete-node-integration.command.js +15 -0
- package/build/frontend/commands/node-integrations/get-node-integration.command.js +19 -0
- package/build/frontend/commands/node-integrations/get-node-integrations.command.js +19 -0
- package/build/frontend/commands/node-integrations/index.js +21 -0
- package/build/frontend/commands/node-integrations/update-node-integration.command.js +27 -0
- package/build/frontend/commands/nodes/bulk-actions/bulk-update.command.js +1 -0
- package/build/frontend/commands/nodes/create.command.js +1 -0
- package/build/frontend/commands/nodes/update.command.js +1 -0
- package/build/frontend/constants/errors/errors.js +35 -0
- package/build/frontend/models/index.js +1 -0
- package/build/frontend/models/node-integration.schema.js +13 -0
- package/build/frontend/models/nodes.schema.js +1 -0
- package/build/frontend/models/resolved-proxy-config.schema.js +19 -35
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateNodeIntegrationCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const api_1 = require("../../api");
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
const models_1 = require("../../models");
|
|
8
|
+
var UpdateNodeIntegrationCommand;
|
|
9
|
+
(function (UpdateNodeIntegrationCommand) {
|
|
10
|
+
UpdateNodeIntegrationCommand.url = api_1.REST_API.NODE_INTEGRATIONS.UPDATE;
|
|
11
|
+
UpdateNodeIntegrationCommand.TSQ_url = UpdateNodeIntegrationCommand.url;
|
|
12
|
+
UpdateNodeIntegrationCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.NODE_INTEGRATIONS_ROUTES.UPDATE, 'patch', 'Update Node Integration', { scope: 'update', kind: 'write' });
|
|
13
|
+
UpdateNodeIntegrationCommand.RequestBodySchema = zod_1.z.object({
|
|
14
|
+
uuid: zod_1.z.uuid(),
|
|
15
|
+
name: zod_1.z
|
|
16
|
+
.string()
|
|
17
|
+
.min(2, 'Name must be at least 2 characters')
|
|
18
|
+
.max(30, 'Name must be less than 30 characters')
|
|
19
|
+
.optional(),
|
|
20
|
+
description: zod_1.z.nullish(zod_1.z.string().max(255, 'Description must be less than 255 characters')),
|
|
21
|
+
config: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
|
|
22
|
+
restartNodes: zod_1.z.optional(zod_1.z.boolean()),
|
|
23
|
+
});
|
|
24
|
+
UpdateNodeIntegrationCommand.ResponseSchema = zod_1.z.object({
|
|
25
|
+
response: models_1.NodeIntegrationSchema,
|
|
26
|
+
});
|
|
27
|
+
})(UpdateNodeIntegrationCommand || (exports.UpdateNodeIntegrationCommand = UpdateNodeIntegrationCommand = {}));
|
|
@@ -31,6 +31,7 @@ var BulkNodesUpdateCommand;
|
|
|
31
31
|
.max(36, 'Each tag must be less than 36 characters'))
|
|
32
32
|
.max(10, 'Maximum 10 tags')),
|
|
33
33
|
activePluginUuid: zod_1.z.uuid().nullish(),
|
|
34
|
+
integrationUuids: zod_1.z.optional(zod_1.z.array(zod_1.z.uuid()).max(20, 'Maximum 20 integrations')),
|
|
34
35
|
note: zod_1.z.optional(zod_1.z.string().max(255).nullable()),
|
|
35
36
|
}),
|
|
36
37
|
});
|
|
@@ -46,6 +46,7 @@ var CreateNodeCommand;
|
|
|
46
46
|
.max(36, 'Each tag must be less than 36 characters'))
|
|
47
47
|
.max(10, 'Maximum 10 tags')),
|
|
48
48
|
activePluginUuid: zod_1.z.optional(zod_1.z.nullable(zod_1.z.uuid())),
|
|
49
|
+
integrationUuids: zod_1.z.optional(zod_1.z.array(zod_1.z.uuid()).max(20, 'Maximum 20 integrations')),
|
|
49
50
|
note: zod_1.z.optional(zod_1.z.string().max(255, 'Note must be less than 255 characters')),
|
|
50
51
|
ips: zod_1.z.optional(models_1.NodeIpsSchema),
|
|
51
52
|
});
|
|
@@ -53,6 +53,7 @@ var UpdateNodeCommand;
|
|
|
53
53
|
.max(36, 'Each tag must be less than 36 characters'))
|
|
54
54
|
.max(10, 'Maximum 10 tags')),
|
|
55
55
|
activePluginUuid: zod_1.z.uuid().nullish(),
|
|
56
|
+
integrationUuids: zod_1.z.optional(zod_1.z.array(zod_1.z.uuid()).max(20, 'Maximum 20 integrations')),
|
|
56
57
|
note: zod_1.z.optional(zod_1.z.string().max(255).nullable()),
|
|
57
58
|
ips: zod_1.z.optional(models_1.NodeIpsSchema),
|
|
58
59
|
});
|
|
@@ -1190,4 +1190,39 @@ exports.ERRORS = {
|
|
|
1190
1190
|
message: 'Sync snippet error',
|
|
1191
1191
|
httpCode: 500,
|
|
1192
1192
|
},
|
|
1193
|
+
NODE_INTEGRATION_NOT_FOUND: {
|
|
1194
|
+
code: 'A238',
|
|
1195
|
+
message: 'Node integration not found',
|
|
1196
|
+
httpCode: 404,
|
|
1197
|
+
},
|
|
1198
|
+
GET_ALL_NODE_INTEGRATIONS_ERROR: {
|
|
1199
|
+
code: 'A239',
|
|
1200
|
+
message: 'Get all node integrations error',
|
|
1201
|
+
httpCode: 500,
|
|
1202
|
+
},
|
|
1203
|
+
GET_NODE_INTEGRATION_BY_UUID_ERROR: {
|
|
1204
|
+
code: 'A240',
|
|
1205
|
+
message: 'Get node integration by UUID error',
|
|
1206
|
+
httpCode: 500,
|
|
1207
|
+
},
|
|
1208
|
+
CREATE_NODE_INTEGRATION_ERROR: {
|
|
1209
|
+
code: 'A241',
|
|
1210
|
+
message: 'Create node integration error',
|
|
1211
|
+
httpCode: 500,
|
|
1212
|
+
},
|
|
1213
|
+
UPDATE_NODE_INTEGRATION_ERROR: {
|
|
1214
|
+
code: 'A242',
|
|
1215
|
+
message: 'Update node integration error',
|
|
1216
|
+
httpCode: 500,
|
|
1217
|
+
},
|
|
1218
|
+
DELETE_NODE_INTEGRATION_ERROR: {
|
|
1219
|
+
code: 'A243',
|
|
1220
|
+
message: 'Delete node integration error',
|
|
1221
|
+
httpCode: 500,
|
|
1222
|
+
},
|
|
1223
|
+
NODE_INTEGRATION_NAME_ALREADY_EXISTS: {
|
|
1224
|
+
code: 'A244',
|
|
1225
|
+
message: 'Node integration name already exists',
|
|
1226
|
+
httpCode: 400,
|
|
1227
|
+
},
|
|
1193
1228
|
};
|
|
@@ -32,6 +32,7 @@ __exportStar(require("./infra-billing-node.schema"), exports);
|
|
|
32
32
|
__exportStar(require("./infra-provider.schema"), exports);
|
|
33
33
|
__exportStar(require("./internal-squad.schema"), exports);
|
|
34
34
|
__exportStar(require("./last-connected-node.schema"), exports);
|
|
35
|
+
__exportStar(require("./node-integration.schema"), exports);
|
|
35
36
|
__exportStar(require("./node-plugin.schema"), exports);
|
|
36
37
|
__exportStar(require("./node-ips.schema"), exports);
|
|
37
38
|
__exportStar(require("./node-system.schema"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
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.NodeIntegrationSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
exports.NodeIntegrationSchema = zod_1.default.object({
|
|
9
|
+
uuid: zod_1.default.uuid(),
|
|
10
|
+
name: zod_1.default.string(),
|
|
11
|
+
description: zod_1.default.nullable(zod_1.default.string()),
|
|
12
|
+
config: zod_1.default.record(zod_1.default.string(), zod_1.default.unknown()),
|
|
13
|
+
});
|
|
@@ -28,6 +28,7 @@ exports.NodesSchema = zod_1.z.object({
|
|
|
28
28
|
consumptionMultiplier: zod_1.z.number(),
|
|
29
29
|
nodeConsumptionMultiplier: zod_1.z.number(),
|
|
30
30
|
tags: zod_1.z.array(zod_1.z.string()),
|
|
31
|
+
integrationUuids: zod_1.z.array(zod_1.z.uuid()),
|
|
31
32
|
ips: node_ips_schema_1.NodeIpsSchema,
|
|
32
33
|
createdAt: zod_1.z.iso.datetime().transform((str) => new Date(str)),
|
|
33
34
|
updatedAt: zod_1.z.iso.datetime().transform((str) => new Date(str)),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ResolvedProxyConfigSchema = exports.ProxyEntryMetadataSchema = exports.SecurityVariantSchema = exports.TransportVariantSchema = exports.ProtocolVariantSchema = exports.RealitySecurityOptionsSchema = exports.TlsSecurityOptionsSchema = exports.HysteriaTransportOptionsSchema = exports.HysteriaProtocolOptionsSchema = exports.KcpTransportOptionsSchema = exports.GrpcTransportOptionsSchema = exports.HttpUpgradeTransportOptionsSchema = exports.WsTransportOptionsSchema = exports.XhttpTransportOptionsSchema = exports.TcpTransportOptionsSchema = exports.ShadowsocksProtocolOptionsSchema = exports.TrojanProtocolOptionsSchema = exports.VlessProtocolOptionsSchema = void 0;
|
|
3
|
+
exports.ResolvedProxyConfigSchema = exports.ResolvedProxyConfigBaseSchema = exports.ProxyEntryMetadataSchema = exports.SecurityVariantSchema = exports.TransportVariantSchema = exports.ProtocolVariantSchema = exports.RealitySecurityOptionsSchema = exports.TlsSecurityOptionsSchema = exports.HysteriaTransportOptionsSchema = exports.HysteriaProtocolOptionsSchema = exports.KcpTransportOptionsSchema = exports.GrpcTransportOptionsSchema = exports.HttpUpgradeTransportOptionsSchema = exports.WsTransportOptionsSchema = exports.XhttpTransportOptionsSchema = exports.TcpTransportOptionsSchema = exports.ShadowsocksProtocolOptionsSchema = exports.TrojanProtocolOptionsSchema = exports.VlessProtocolOptionsSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
const host_mapper_1 = require("./host-mapper");
|
|
@@ -113,10 +113,10 @@ const HysteriaProtocolSchema = zod_1.z.object({
|
|
|
113
113
|
protocolOptions: exports.HysteriaProtocolOptionsSchema,
|
|
114
114
|
});
|
|
115
115
|
exports.ProtocolVariantSchema = zod_1.z.discriminatedUnion('protocol', [
|
|
116
|
-
VlessProtocolSchema,
|
|
117
|
-
TrojanProtocolSchema,
|
|
118
|
-
ShadowsocksProtocolSchema,
|
|
119
|
-
HysteriaProtocolSchema,
|
|
116
|
+
VlessProtocolSchema.meta({ title: 'vless' }),
|
|
117
|
+
TrojanProtocolSchema.meta({ title: 'trojan' }),
|
|
118
|
+
ShadowsocksProtocolSchema.meta({ title: 'shadowsocks' }),
|
|
119
|
+
HysteriaProtocolSchema.meta({ title: 'hysteria' }),
|
|
120
120
|
]);
|
|
121
121
|
const TcpTransportSchema = zod_1.z.object({
|
|
122
122
|
transport: zod_1.z.literal('tcp'),
|
|
@@ -147,13 +147,13 @@ const HysteriaTransportSchema = zod_1.z.object({
|
|
|
147
147
|
transportOptions: exports.HysteriaTransportOptionsSchema,
|
|
148
148
|
});
|
|
149
149
|
exports.TransportVariantSchema = zod_1.z.discriminatedUnion('transport', [
|
|
150
|
-
TcpTransportSchema,
|
|
151
|
-
XHttpTransportSchema,
|
|
152
|
-
WsTransportSchema,
|
|
153
|
-
HttpUpgradeTransportSchema,
|
|
154
|
-
GrpcTransportSchema,
|
|
155
|
-
KcpTransportSchema,
|
|
156
|
-
HysteriaTransportSchema,
|
|
150
|
+
TcpTransportSchema.meta({ title: 'tcp' }),
|
|
151
|
+
XHttpTransportSchema.meta({ title: 'xhttp' }),
|
|
152
|
+
WsTransportSchema.meta({ title: 'ws' }),
|
|
153
|
+
HttpUpgradeTransportSchema.meta({ title: 'httpupgrade' }),
|
|
154
|
+
GrpcTransportSchema.meta({ title: 'grpc' }),
|
|
155
|
+
KcpTransportSchema.meta({ title: 'kcp' }),
|
|
156
|
+
HysteriaTransportSchema.meta({ title: 'hysteria' }),
|
|
157
157
|
]);
|
|
158
158
|
const TlsSecuritySchema = zod_1.z.object({
|
|
159
159
|
security: zod_1.z.literal('tls'),
|
|
@@ -167,9 +167,9 @@ const NoneSecuritySchema = zod_1.z.object({
|
|
|
167
167
|
security: zod_1.z.literal('none'),
|
|
168
168
|
});
|
|
169
169
|
exports.SecurityVariantSchema = zod_1.z.discriminatedUnion('security', [
|
|
170
|
-
TlsSecuritySchema,
|
|
171
|
-
RealitySecuritySchema,
|
|
172
|
-
NoneSecuritySchema,
|
|
170
|
+
TlsSecuritySchema.meta({ title: 'tls' }),
|
|
171
|
+
RealitySecuritySchema.meta({ title: 'reality' }),
|
|
172
|
+
NoneSecuritySchema.meta({ title: 'none' }),
|
|
173
173
|
]);
|
|
174
174
|
exports.ProxyEntryMetadataSchema = zod_1.z.object({
|
|
175
175
|
uuid: zod_1.z.uuid(),
|
|
@@ -185,29 +185,10 @@ exports.ProxyEntryMetadataSchema = zod_1.z.object({
|
|
|
185
185
|
vlessRouteId: zod_1.z.int().nullable(),
|
|
186
186
|
rawInbound: zod_1.z.nullable(zod_1.z.unknown()),
|
|
187
187
|
});
|
|
188
|
-
exports.
|
|
188
|
+
exports.ResolvedProxyConfigBaseSchema = zod_1.z.object({
|
|
189
189
|
finalRemark: zod_1.z.string(),
|
|
190
190
|
address: zod_1.z.string(),
|
|
191
191
|
port: zod_1.z.int().positive(),
|
|
192
|
-
protocol: zod_1.z.enum(['vless', 'trojan', 'shadowsocks', 'hysteria']),
|
|
193
|
-
protocolOptions: zod_1.z.union([
|
|
194
|
-
exports.VlessProtocolOptionsSchema,
|
|
195
|
-
exports.TrojanProtocolOptionsSchema,
|
|
196
|
-
exports.ShadowsocksProtocolOptionsSchema,
|
|
197
|
-
exports.HysteriaProtocolOptionsSchema,
|
|
198
|
-
]),
|
|
199
|
-
transport: zod_1.z.enum(['tcp', 'xhttp', 'ws', 'httpupgrade', 'grpc', 'kcp', 'hysteria']),
|
|
200
|
-
transportOptions: zod_1.z.union([
|
|
201
|
-
exports.TcpTransportOptionsSchema,
|
|
202
|
-
exports.XhttpTransportOptionsSchema,
|
|
203
|
-
exports.WsTransportOptionsSchema,
|
|
204
|
-
exports.HttpUpgradeTransportOptionsSchema,
|
|
205
|
-
exports.GrpcTransportOptionsSchema,
|
|
206
|
-
exports.KcpTransportOptionsSchema,
|
|
207
|
-
exports.HysteriaTransportOptionsSchema,
|
|
208
|
-
]),
|
|
209
|
-
security: zod_1.z.enum(['tls', 'reality', 'none']),
|
|
210
|
-
securityOptions: zod_1.z.union([exports.TlsSecurityOptionsSchema, exports.RealitySecurityOptionsSchema]).optional(),
|
|
211
192
|
streamOverrides: zod_1.z.object({
|
|
212
193
|
finalMask: zod_1.z.nullable(zod_1.z.unknown()),
|
|
213
194
|
sockopt: zod_1.z.nullable(zod_1.z.unknown()),
|
|
@@ -223,3 +204,6 @@ exports.ResolvedProxyConfigSchema = zod_1.z.object({
|
|
|
223
204
|
}),
|
|
224
205
|
metadata: exports.ProxyEntryMetadataSchema,
|
|
225
206
|
});
|
|
207
|
+
exports.ResolvedProxyConfigSchema = exports.ResolvedProxyConfigBaseSchema.and(exports.ProtocolVariantSchema)
|
|
208
|
+
.and(exports.TransportVariantSchema)
|
|
209
|
+
.and(exports.SecurityVariantSchema);
|
package/package.json
CHANGED