@remnawave/backend-contract 3.2.2 → 3.3.0

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.
Files changed (63) hide show
  1. package/build/backend/api/controllers/snippets.d.ts +3 -0
  2. package/build/backend/api/controllers/snippets.d.ts.map +1 -1
  3. package/build/backend/api/controllers/snippets.js +4 -0
  4. package/build/backend/api/routes.d.ts +3 -0
  5. package/build/backend/api/routes.d.ts.map +1 -1
  6. package/build/backend/api/routes.js +3 -0
  7. package/build/backend/commands/hosts/bulk/update-many-hosts.command.d.ts +42 -4
  8. package/build/backend/commands/hosts/bulk/update-many-hosts.command.d.ts.map +1 -1
  9. package/build/backend/commands/hosts/create.command.d.ts +76 -0
  10. package/build/backend/commands/hosts/create.command.d.ts.map +1 -1
  11. package/build/backend/commands/hosts/create.command.js +2 -0
  12. package/build/backend/commands/hosts/get-host.command.d.ts +38 -0
  13. package/build/backend/commands/hosts/get-host.command.d.ts.map +1 -1
  14. package/build/backend/commands/hosts/get-hosts.command.d.ts +38 -0
  15. package/build/backend/commands/hosts/get-hosts.command.d.ts.map +1 -1
  16. package/build/backend/commands/hosts/host.response.d.ts +38 -0
  17. package/build/backend/commands/hosts/host.response.d.ts.map +1 -1
  18. package/build/backend/commands/hosts/update.command.d.ts +76 -0
  19. package/build/backend/commands/hosts/update.command.d.ts.map +1 -1
  20. package/build/backend/commands/hosts/update.command.js +1 -0
  21. package/build/backend/commands/snippets/actions/index.d.ts +2 -0
  22. package/build/backend/commands/snippets/actions/index.d.ts.map +1 -0
  23. package/build/backend/commands/snippets/actions/index.js +17 -0
  24. package/build/backend/commands/snippets/actions/sync.command.d.ts +11 -0
  25. package/build/backend/commands/snippets/actions/sync.command.d.ts.map +1 -0
  26. package/build/backend/commands/snippets/actions/sync.command.js +19 -0
  27. package/build/backend/commands/snippets/index.d.ts +1 -0
  28. package/build/backend/commands/snippets/index.d.ts.map +1 -1
  29. package/build/backend/commands/snippets/index.js +1 -0
  30. package/build/backend/commands/subscriptions/get-by/get-raw-subscription-by-short-uuid.command.d.ts +39 -0
  31. package/build/backend/commands/subscriptions/get-by/get-raw-subscription-by-short-uuid.command.d.ts.map +1 -1
  32. package/build/backend/constants/errors/errors.d.ts +5 -0
  33. package/build/backend/constants/errors/errors.d.ts.map +1 -1
  34. package/build/backend/constants/errors/errors.js +5 -0
  35. package/build/backend/models/host-mapper/host-mapper.schema.d.ts +90 -0
  36. package/build/backend/models/host-mapper/host-mapper.schema.d.ts.map +1 -0
  37. package/build/backend/models/host-mapper/host-mapper.schema.js +262 -0
  38. package/build/backend/models/host-mapper/index.d.ts +2 -0
  39. package/build/backend/models/host-mapper/index.d.ts.map +1 -0
  40. package/build/backend/models/host-mapper/index.js +17 -0
  41. package/build/backend/models/hosts.schema.d.ts +38 -0
  42. package/build/backend/models/hosts.schema.d.ts.map +1 -1
  43. package/build/backend/models/hosts.schema.js +2 -0
  44. package/build/backend/models/index.d.ts +1 -0
  45. package/build/backend/models/index.d.ts.map +1 -1
  46. package/build/backend/models/index.js +1 -0
  47. package/build/backend/models/resolved-proxy-config.schema.d.ts +41 -0
  48. package/build/backend/models/resolved-proxy-config.schema.d.ts.map +1 -1
  49. package/build/backend/models/resolved-proxy-config.schema.js +3 -0
  50. package/build/frontend/api/controllers/snippets.js +4 -0
  51. package/build/frontend/api/routes.js +3 -0
  52. package/build/frontend/commands/hosts/create.command.js +2 -0
  53. package/build/frontend/commands/hosts/update.command.js +1 -0
  54. package/build/frontend/commands/snippets/actions/index.js +17 -0
  55. package/build/frontend/commands/snippets/actions/sync.command.js +19 -0
  56. package/build/frontend/commands/snippets/index.js +1 -0
  57. package/build/frontend/constants/errors/errors.js +5 -0
  58. package/build/frontend/models/host-mapper/host-mapper.schema.js +262 -0
  59. package/build/frontend/models/host-mapper/index.js +17 -0
  60. package/build/frontend/models/hosts.schema.js +2 -0
  61. package/build/frontend/models/index.js +1 -0
  62. package/build/frontend/models/resolved-proxy-config.schema.js +3 -0
  63. package/package.json +1 -1
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
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;
4
4
  const zod_1 = require("zod");
5
5
  const constants_1 = require("../constants");
6
+ const host_mapper_1 = require("./host-mapper");
6
7
  exports.VlessProtocolOptionsSchema = zod_1.z.object({
7
8
  encryption: zod_1.z.string(),
8
9
  id: zod_1.z.string(),
@@ -85,6 +86,7 @@ exports.TlsSecurityOptionsSchema = zod_1.z.object({
85
86
  echConfigList: zod_1.z.string().nullable(),
86
87
  echForceQuery: zod_1.z.string().nullable(),
87
88
  echSockopt: zod_1.z.nullable(zod_1.z.unknown()),
89
+ cipherSuites: zod_1.z.string().nullable(),
88
90
  });
89
91
  exports.RealitySecurityOptionsSchema = zod_1.z.object({
90
92
  fingerprint: zod_1.z.string(),
@@ -217,6 +219,7 @@ exports.ResolvedProxyConfigSchema = zod_1.z.object({
217
219
  mihomoIpVersion: zod_1.z.enum(constants_1.MIHOMO_IP_VERSION).nullable(),
218
220
  serverDescription: zod_1.z.string().nullable(),
219
221
  xrayJsonTemplate: zod_1.z.nullable(zod_1.z.unknown()),
222
+ mapper: host_mapper_1.HostMapperSchema,
220
223
  }),
221
224
  metadata: exports.ProxyEntryMetadataSchema,
222
225
  });
@@ -2,9 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SNIPPETS_ROUTES = exports.SNIPPETS_CONTROLLER = void 0;
4
4
  exports.SNIPPETS_CONTROLLER = 'snippets';
5
+ const ACTIONS_ROUTE = 'actions';
5
6
  exports.SNIPPETS_ROUTES = {
6
7
  GET: '', // Get list of all snippets // get
7
8
  CREATE: '', // Create new snippet // post
8
9
  UPDATE: '', // Update snippet by name // patch
9
10
  DELETE: '', // Delete snippet by name // delete
11
+ ACTIONS: {
12
+ SYNC: `${ACTIONS_ROUTE}/sync`, // post
13
+ },
10
14
  };
@@ -268,6 +268,9 @@ exports.REST_API = {
268
268
  CREATE: `${exports.ROOT}/${CONTROLLERS.SNIPPETS_CONTROLLER}/${CONTROLLERS.SNIPPETS_ROUTES.CREATE}`,
269
269
  UPDATE: `${exports.ROOT}/${CONTROLLERS.SNIPPETS_CONTROLLER}/${CONTROLLERS.SNIPPETS_ROUTES.UPDATE}`,
270
270
  DELETE: `${exports.ROOT}/${CONTROLLERS.SNIPPETS_CONTROLLER}/${CONTROLLERS.SNIPPETS_ROUTES.DELETE}`,
271
+ ACTIONS: {
272
+ SYNC: `${exports.ROOT}/${CONTROLLERS.SNIPPETS_CONTROLLER}/${CONTROLLERS.SNIPPETS_ROUTES.ACTIONS.SYNC}`,
273
+ },
271
274
  },
272
275
  EXTERNAL_SQUADS: {
273
276
  GET: `${exports.ROOT}/${CONTROLLERS.EXTERNAL_SQUADS_CONTROLLER}/${CONTROLLERS.EXTERNAL_SQUADS_ROUTES.GET}`,
@@ -4,6 +4,7 @@ exports.CreateHostCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const api_1 = require("../../api");
6
6
  const constants_1 = require("../../constants");
7
+ const models_1 = require("../../models");
7
8
  const host_response_1 = require("./host.response");
8
9
  var CreateHostCommand;
9
10
  (function (CreateHostCommand) {
@@ -53,6 +54,7 @@ var CreateHostCommand;
53
54
  excludeFromSubscriptionTypes: zod_1.z
54
55
  .optional(zod_1.z.array(zod_1.z.enum(constants_1.SUBSCRIPTION_TEMPLATE_TYPE)))
55
56
  .describe('Optional. Subscription types from which the host will be excluded from.'),
57
+ mapper: models_1.HostMapperSchema.optional(),
56
58
  });
57
59
  CreateHostCommand.ResponseSchema = host_response_1.HostResponseSchema;
58
60
  })(CreateHostCommand || (exports.CreateHostCommand = CreateHostCommand = {}));
@@ -58,6 +58,7 @@ var UpdateHostCommand;
58
58
  excludeFromSubscriptionTypes: zod_1.z
59
59
  .optional(zod_1.z.array(zod_1.z.enum(constants_1.SUBSCRIPTION_TEMPLATE_TYPE)))
60
60
  .describe('Optional. Subscription types from which the host will be excluded from.'),
61
+ mapper: models_1.HostMapperSchema.optional(),
61
62
  });
62
63
  UpdateHostCommand.ResponseSchema = host_response_1.HostResponseSchema;
63
64
  })(UpdateHostCommand || (exports.UpdateHostCommand = UpdateHostCommand = {}));
@@ -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("./sync.command"), exports);
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SyncSnippetCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../../api");
6
+ const constants_1 = require("../../../constants");
7
+ var SyncSnippetCommand;
8
+ (function (SyncSnippetCommand) {
9
+ SyncSnippetCommand.url = api_1.REST_API.SNIPPETS.ACTIONS.SYNC;
10
+ SyncSnippetCommand.TSQ_url = SyncSnippetCommand.url;
11
+ SyncSnippetCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SNIPPETS_ROUTES.ACTIONS.SYNC, 'post', 'Sync snippet to affected config profiles', { scope: 'sync', kind: 'write' }, 'Trigger the sync of a snippet to all config profiles that reference it. Nodes which use affected config profiles will be restarted.');
12
+ SyncSnippetCommand.RequestBodySchema = zod_1.z.object({
13
+ name: zod_1.z
14
+ .string()
15
+ .min(2, 'Name must be at least 2 characters')
16
+ .max(255, 'Name must be less than 255 characters')
17
+ .regex(/^[A-Za-z0-9_\s-]+$/, 'Name can only contain letters, numbers, underscores, dashes and spaces'),
18
+ });
19
+ })(SyncSnippetCommand || (exports.SyncSnippetCommand = SyncSnippetCommand = {}));
@@ -14,6 +14,7 @@ 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("./actions"), exports);
17
18
  __exportStar(require("./create-snippet.command"), exports);
18
19
  __exportStar(require("./delete-snippet.command"), exports);
19
20
  __exportStar(require("./get-snippets.command"), exports);
@@ -1185,4 +1185,9 @@ exports.ERRORS = {
1185
1185
  message: 'Get stats digest error',
1186
1186
  httpCode: 500,
1187
1187
  },
1188
+ SYNC_SNIPPET_ERROR: {
1189
+ code: 'A237',
1190
+ message: 'Sync snippet error',
1191
+ httpCode: 500,
1192
+ },
1188
1193
  };
@@ -0,0 +1,262 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HostMapperSchema = exports.HostMapperOperationsSchema = exports.Base64HostMapperOperationsSchema = exports.MihomoHostMapperOperationsSchema = exports.XrayJsonHostMapperOperationsSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const buildFromSchema = () => zod_1.z
6
+ .string()
7
+ .min(1)
8
+ .max(512)
9
+ .meta({
10
+ title: 'Source path',
11
+ markdownDescription: [
12
+ 'Dot-separated path inside the **raw inbound** of the config profile this host belongs to. Array items are addressed by index.',
13
+ '',
14
+ '> If the path resolves to nothing, the operation is skipped and the target key is **not** created.',
15
+ ].join('\n'),
16
+ examples: [
17
+ 'streamSettings.tlsSettings.cipherSuites',
18
+ 'streamSettings.tlsSettings.alpn',
19
+ 'streamSettings.realitySettings.serverNames.0',
20
+ ],
21
+ });
22
+ const buildToSchema = (client) => zod_1.z
23
+ .string()
24
+ .min(1)
25
+ .max(512)
26
+ .meta({
27
+ title: 'Target path',
28
+ markdownDescription: [
29
+ `Dot-separated path inside ${client.target}, counted from its root.`,
30
+ '',
31
+ 'Missing objects along the path are created. Array items are addressed by index, and keys with dashes are written as is (`ip-version`).',
32
+ '',
33
+ '> A path running through a value that is not an object – for example `path.foo`, where `path` holds a string – is refused, so an existing value is never destroyed.',
34
+ ].join('\n'),
35
+ examples: client.examples,
36
+ });
37
+ const buildOperationsSchema = (client) => zod_1.z
38
+ .discriminatedUnion('op', [
39
+ zod_1.z
40
+ .object({
41
+ op: zod_1.z.literal('copy').meta({
42
+ title: 'Copy',
43
+ markdownDescription: 'Take a value from the raw inbound.',
44
+ }),
45
+ from: buildFromSchema(),
46
+ to: buildToSchema(client),
47
+ })
48
+ .meta({
49
+ title: 'Copy from the inbound',
50
+ markdownDescription: [
51
+ 'Reads a value from the raw inbound and writes it into the generated config.',
52
+ '',
53
+ '```json',
54
+ JSON.stringify({ op: 'copy', ...client.copySnippet }, null, 2),
55
+ '```',
56
+ ].join('\n'),
57
+ defaultSnippets: [
58
+ {
59
+ label: 'copy',
60
+ description: 'Copy a value from the raw inbound',
61
+ body: { op: 'copy', from: '$1', to: '$2' },
62
+ },
63
+ ],
64
+ }),
65
+ zod_1.z
66
+ .object({
67
+ op: zod_1.z.literal('set').meta({
68
+ title: 'Set',
69
+ markdownDescription: 'Write a fixed value.',
70
+ }),
71
+ value: zod_1.z
72
+ .union([
73
+ zod_1.z.string(),
74
+ zod_1.z.number(),
75
+ zod_1.z.boolean(),
76
+ zod_1.z.array(zod_1.z.json()),
77
+ zod_1.z.record(zod_1.z.string(), zod_1.z.json()),
78
+ ])
79
+ .meta({
80
+ title: 'Value',
81
+ markdownDescription: 'The value to write. Strings, numbers, booleans, arrays and objects are allowed.',
82
+ }),
83
+ to: buildToSchema(client),
84
+ })
85
+ .meta({
86
+ title: 'Set a fixed value',
87
+ markdownDescription: [
88
+ 'Writes a literal value into the generated config, creating the key if it is missing.',
89
+ '',
90
+ '```json',
91
+ JSON.stringify({ op: 'set', ...client.setSnippet }, null, 2),
92
+ '```',
93
+ ].join('\n'),
94
+ defaultSnippets: [
95
+ {
96
+ label: 'set',
97
+ description: 'Write a fixed value',
98
+ body: { op: 'set', to: '$1', value: '$2' },
99
+ },
100
+ ],
101
+ }),
102
+ zod_1.z
103
+ .object({
104
+ op: zod_1.z.literal('unset').meta({
105
+ title: 'Unset',
106
+ markdownDescription: 'Remove a field.',
107
+ }),
108
+ to: buildToSchema(client),
109
+ })
110
+ .meta({
111
+ title: 'Remove a field',
112
+ markdownDescription: [
113
+ 'Removes a field the generator produced by itself.',
114
+ '',
115
+ '```json',
116
+ JSON.stringify({ op: 'unset', ...client.unsetSnippet }, null, 2),
117
+ '```',
118
+ '',
119
+ '> Only the field itself is removed. A parent object left empty stays in the config as `{}`.',
120
+ ].join('\n'),
121
+ defaultSnippets: [
122
+ {
123
+ label: 'unset',
124
+ description: 'Remove a field',
125
+ body: { op: 'unset', to: '$1' },
126
+ },
127
+ ],
128
+ }),
129
+ ])
130
+ .meta({
131
+ title: 'Operation',
132
+ markdownDescription: [
133
+ 'Operations run one after another, in the order they are listed.',
134
+ '',
135
+ 'A later operation sees what the previous ones wrote, so an `unset` can remove a key an earlier `set` added.',
136
+ ].join('\n'),
137
+ });
138
+ exports.XrayJsonHostMapperOperationsSchema = buildOperationsSchema({
139
+ target: 'the generated **outbound**',
140
+ examples: [
141
+ 'streamSettings.tlsSettings.enableSessionResumption',
142
+ 'streamSettings.tlsSettings.cipherSuites',
143
+ ],
144
+ copySnippet: {
145
+ from: 'streamSettings.tlsSettings.cipherSuites',
146
+ to: 'streamSettings.tlsSettings.cipherSuites',
147
+ },
148
+ setSnippet: { to: 'streamSettings.tlsSettings.enableSessionResumption', value: true },
149
+ unsetSnippet: { to: 'mux' },
150
+ });
151
+ exports.MihomoHostMapperOperationsSchema = buildOperationsSchema({
152
+ target: 'the generated **proxy node**',
153
+ examples: ['ip-version', 'client-fingerprint', 'tfo', 'reality-opts.support-x25519mlkem768'],
154
+ copySnippet: { from: 'streamSettings.realitySettings.serverNames.0', to: 'servername' },
155
+ setSnippet: { to: 'reality-opts.support-x25519mlkem768', value: true },
156
+ unsetSnippet: { to: 'smux' },
157
+ });
158
+ exports.Base64HostMapperOperationsSchema = buildOperationsSchema({
159
+ target: 'the query string of the generated **share link**',
160
+ examples: [
161
+ 'alpn',
162
+ 'authority',
163
+ 'cs',
164
+ 'encryption',
165
+ 'extra',
166
+ 'flow',
167
+ 'fm',
168
+ 'fp',
169
+ 'headerType',
170
+ 'heartbeatPeriod',
171
+ 'host',
172
+ 'mode',
173
+ 'mtu',
174
+ 'obfs',
175
+ 'obfs-password',
176
+ 'path',
177
+ 'pbk',
178
+ 'pcs',
179
+ 'pinSHA256',
180
+ 'pqv',
181
+ 'security',
182
+ 'serviceName',
183
+ 'sid',
184
+ 'sni',
185
+ 'spx',
186
+ 'tti',
187
+ 'type',
188
+ 'vcn',
189
+ ],
190
+ copySnippet: { from: 'streamSettings.realitySettings.serverNames.0', to: 'sni' },
191
+ setSnippet: { to: 'fp', value: 'chrome' },
192
+ unsetSnippet: { to: 'fm' },
193
+ });
194
+ exports.HostMapperOperationsSchema = exports.XrayJsonHostMapperOperationsSchema;
195
+ exports.HostMapperSchema = zod_1.z
196
+ .object({
197
+ xrayJson: zod_1.z
198
+ .array(exports.XrayJsonHostMapperOperationsSchema)
199
+ .optional()
200
+ .meta({
201
+ title: 'Xray JSON',
202
+ markdownDescription: [
203
+ 'Operations applied to the **outbound** generated for this host in the Xray JSON subscription. Paths are counted from the root of the outbound.',
204
+ '',
205
+ '```json',
206
+ JSON.stringify([
207
+ {
208
+ op: 'copy',
209
+ from: 'streamSettings.tlsSettings.cipherSuites',
210
+ to: 'streamSettings.tlsSettings.cipherSuites',
211
+ },
212
+ { op: 'unset', to: 'mux' },
213
+ ], null, 2),
214
+ '```',
215
+ ].join('\n'),
216
+ }),
217
+ mihomo: zod_1.z
218
+ .array(exports.MihomoHostMapperOperationsSchema)
219
+ .optional()
220
+ .meta({
221
+ title: 'Mihomo',
222
+ markdownDescription: [
223
+ 'Operations applied to the **proxy node** generated for this host in the Mihomo subscription.',
224
+ '',
225
+ 'Paths are counted from the root of the node, where Mihomo keys are written in kebab-case.',
226
+ '',
227
+ '```json',
228
+ JSON.stringify([{ op: 'set', to: 'ip-version', value: 'ipv4' }], null, 2),
229
+ '```',
230
+ ].join('\n'),
231
+ }),
232
+ base64: zod_1.z
233
+ .array(exports.Base64HostMapperOperationsSchema)
234
+ .optional()
235
+ .meta({
236
+ title: 'Base64',
237
+ markdownDescription: [
238
+ 'Operations applied to the **query string** of the share link generated for this host in the Base64 subscription.',
239
+ '',
240
+ '`to` is a plain query parameter name, not a path – dots carry no meaning here.',
241
+ '',
242
+ '```json',
243
+ JSON.stringify([
244
+ { op: 'set', to: 'fp', value: 'chrome' },
245
+ { op: 'unset', to: 'fm' },
246
+ ], null, 2),
247
+ '```',
248
+ ].join('\n'),
249
+ }),
250
+ })
251
+ .meta({
252
+ title: 'Host Mapper',
253
+ markdownDescription: [
254
+ 'Rewrites the config generated for this host, per client type.',
255
+ '',
256
+ 'Operations run **after** the generator has finished, so they can change or remove anything it produced.',
257
+ '',
258
+ 'The source for `copy` is always the raw inbound of the config profile this host belongs to.',
259
+ '',
260
+ '> `to` is never checked against the target client. A misspelled key is written exactly like a real one.',
261
+ ].join('\n'),
262
+ });
@@ -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("./host-mapper.schema"), exports);
@@ -4,6 +4,7 @@ exports.HostsSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const constants_1 = require("../constants");
6
6
  const hosts_1 = require("../constants/hosts");
7
+ const host_mapper_1 = require("./host-mapper");
7
8
  exports.HostsSchema = zod_1.z.object({
8
9
  uuid: zod_1.z.uuid(),
9
10
  viewPosition: zod_1.z.int(),
@@ -40,4 +41,5 @@ exports.HostsSchema = zod_1.z.object({
40
41
  xrayJsonTemplateUuid: zod_1.z.uuid().nullable(),
41
42
  excludedInternalSquads: zod_1.z.array(zod_1.z.uuid()),
42
43
  excludeFromSubscriptionTypes: zod_1.z.array(zod_1.z.enum(constants_1.SUBSCRIPTION_TEMPLATE_TYPE)),
44
+ mapper: host_mapper_1.HostMapperSchema,
43
45
  });
@@ -52,3 +52,4 @@ __exportStar(require("./users.schema"), exports);
52
52
  __exportStar(require("./webhook"), exports);
53
53
  __exportStar(require("./xray-json-advanced"), exports);
54
54
  __exportStar(require("./path-params.schema"), exports);
55
+ __exportStar(require("./host-mapper"), exports);
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
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;
4
4
  const zod_1 = require("zod");
5
5
  const constants_1 = require("../constants");
6
+ const host_mapper_1 = require("./host-mapper");
6
7
  exports.VlessProtocolOptionsSchema = zod_1.z.object({
7
8
  encryption: zod_1.z.string(),
8
9
  id: zod_1.z.string(),
@@ -85,6 +86,7 @@ exports.TlsSecurityOptionsSchema = zod_1.z.object({
85
86
  echConfigList: zod_1.z.string().nullable(),
86
87
  echForceQuery: zod_1.z.string().nullable(),
87
88
  echSockopt: zod_1.z.nullable(zod_1.z.unknown()),
89
+ cipherSuites: zod_1.z.string().nullable(),
88
90
  });
89
91
  exports.RealitySecurityOptionsSchema = zod_1.z.object({
90
92
  fingerprint: zod_1.z.string(),
@@ -217,6 +219,7 @@ exports.ResolvedProxyConfigSchema = zod_1.z.object({
217
219
  mihomoIpVersion: zod_1.z.enum(constants_1.MIHOMO_IP_VERSION).nullable(),
218
220
  serverDescription: zod_1.z.string().nullable(),
219
221
  xrayJsonTemplate: zod_1.z.nullable(zod_1.z.unknown()),
222
+ mapper: host_mapper_1.HostMapperSchema,
220
223
  }),
221
224
  metadata: exports.ProxyEntryMetadataSchema,
222
225
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "3.2.2",
3
+ "version": "3.3.0",
4
4
  "description": "A contract library for Remnawave Backend. It can be used in backend and frontend.",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/remnawave",