@remnawave/backend-contract 3.4.3 → 3.4.5

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.
@@ -71,7 +71,7 @@ export declare namespace UpdateManyHostsCommand {
71
71
  remark: z.ZodOptional<z.ZodOptional<z.ZodString>>;
72
72
  address: z.ZodOptional<z.ZodOptional<z.ZodString>>;
73
73
  fingerprint: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
74
- isDisabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
74
+ isDisabled: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
75
75
  securityLayer: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
76
76
  readonly DEFAULT: "DEFAULT";
77
77
  readonly TLS: "TLS";
@@ -24,7 +24,7 @@ export declare namespace UpdateHostCommand {
24
24
  readonly H3_H2_COMBINED: "h3,h2";
25
25
  }>>>;
26
26
  fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
- isDisabled: z.ZodDefault<z.ZodBoolean>;
27
+ isDisabled: z.ZodOptional<z.ZodBoolean>;
28
28
  securityLayer: z.ZodOptional<z.ZodEnum<{
29
29
  readonly DEFAULT: "DEFAULT";
30
30
  readonly TLS: "TLS";
@@ -28,7 +28,7 @@ var UpdateHostCommand;
28
28
  host: zod_1.z.string().nullish(),
29
29
  alpn: zod_1.z.enum(constants_1.ALPN).nullish(),
30
30
  fingerprint: zod_1.z.string().nullish(),
31
- isDisabled: zod_1.z.boolean().default(false),
31
+ isDisabled: zod_1.z.optional(zod_1.z.boolean()),
32
32
  securityLayer: zod_1.z.optional(zod_1.z.enum(constants_1.SECURITY_LAYERS)),
33
33
  xhttpExtraParams: zod_1.z.unknown().nullish(),
34
34
  muxParams: zod_1.z.unknown().nullish(),
@@ -1 +1 @@
1
- {"version":3,"file":"host-mapper.schema.d.ts","sourceRoot":"","sources":["../../../../models/host-mapper/host-mapper.schema.ts"],"names":[],"mappings":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C,OAAO,0BAA0B,CAAC,CAAC"}
@@ -180,8 +180,13 @@ exports.SingBoxHostMapperOperationsSchema = buildOperationsSchema({
180
180
  unsetSnippet: { to: 'multiplex' },
181
181
  });
182
182
  exports.Base64HostMapperOperationsSchema = buildOperationsSchema({
183
- target: 'the query string of the generated **share link**',
183
+ target: 'the query string of the generated **share link**, or the link itself with a `$link.` prefix',
184
184
  examples: [
185
+ '$link.address',
186
+ '$link.port',
187
+ '$link.password',
188
+ '$link.remark',
189
+ '$link.method',
185
190
  'alpn',
186
191
  'authority',
187
192
  'cs',
@@ -259,14 +264,24 @@ exports.HostMapperSchema = zod_1.z
259
264
  .meta({
260
265
  title: 'Base64',
261
266
  markdownDescription: [
262
- 'Operations applied to the **query string** of the share link generated for this host in the Base64 subscription.',
267
+ 'Operations applied to the share link generated for this host in the Base64 subscription.',
263
268
  '',
264
269
  '`to` is a plain query parameter name, not a path – dots carry no meaning here.',
265
270
  '',
271
+ 'With a `$link.` prefix the operation rewrites the link itself instead of its query string. Writable parts: `$link.address`, `$link.port`, `$link.password`, `$link.remark`, and `$link.method` for Shadowsocks. `$link.password` is the credential of the protocol.',
272
+ '',
273
+ '> A value that cannot make a valid link – an empty address, a port outside 1-65535 – is ignored, and the generated one is kept.',
274
+ '',
266
275
  '```json',
267
276
  JSON.stringify([
268
277
  { op: 'set', to: 'fp', value: 'chrome' },
269
278
  { op: 'unset', to: 'fm' },
279
+ { op: 'set', to: '$link.port', value: 2053 },
280
+ {
281
+ op: 'copy',
282
+ from: '$host.securityOptions.serverName',
283
+ to: '$link.address',
284
+ },
270
285
  ], null, 2),
271
286
  '```',
272
287
  ].join('\n'),
@@ -28,7 +28,7 @@ var UpdateHostCommand;
28
28
  host: zod_1.z.string().nullish(),
29
29
  alpn: zod_1.z.enum(constants_1.ALPN).nullish(),
30
30
  fingerprint: zod_1.z.string().nullish(),
31
- isDisabled: zod_1.z.boolean().default(false),
31
+ isDisabled: zod_1.z.optional(zod_1.z.boolean()),
32
32
  securityLayer: zod_1.z.optional(zod_1.z.enum(constants_1.SECURITY_LAYERS)),
33
33
  xhttpExtraParams: zod_1.z.unknown().nullish(),
34
34
  muxParams: zod_1.z.unknown().nullish(),
@@ -180,8 +180,13 @@ exports.SingBoxHostMapperOperationsSchema = buildOperationsSchema({
180
180
  unsetSnippet: { to: 'multiplex' },
181
181
  });
182
182
  exports.Base64HostMapperOperationsSchema = buildOperationsSchema({
183
- target: 'the query string of the generated **share link**',
183
+ target: 'the query string of the generated **share link**, or the link itself with a `$link.` prefix',
184
184
  examples: [
185
+ '$link.address',
186
+ '$link.port',
187
+ '$link.password',
188
+ '$link.remark',
189
+ '$link.method',
185
190
  'alpn',
186
191
  'authority',
187
192
  'cs',
@@ -259,14 +264,24 @@ exports.HostMapperSchema = zod_1.z
259
264
  .meta({
260
265
  title: 'Base64',
261
266
  markdownDescription: [
262
- 'Operations applied to the **query string** of the share link generated for this host in the Base64 subscription.',
267
+ 'Operations applied to the share link generated for this host in the Base64 subscription.',
263
268
  '',
264
269
  '`to` is a plain query parameter name, not a path – dots carry no meaning here.',
265
270
  '',
271
+ 'With a `$link.` prefix the operation rewrites the link itself instead of its query string. Writable parts: `$link.address`, `$link.port`, `$link.password`, `$link.remark`, and `$link.method` for Shadowsocks. `$link.password` is the credential of the protocol.',
272
+ '',
273
+ '> A value that cannot make a valid link – an empty address, a port outside 1-65535 – is ignored, and the generated one is kept.',
274
+ '',
266
275
  '```json',
267
276
  JSON.stringify([
268
277
  { op: 'set', to: 'fp', value: 'chrome' },
269
278
  { op: 'unset', to: 'fm' },
279
+ { op: 'set', to: '$link.port', value: 2053 },
280
+ {
281
+ op: 'copy',
282
+ from: '$host.securityOptions.serverName',
283
+ to: '$link.address',
284
+ },
270
285
  ], null, 2),
271
286
  '```',
272
287
  ].join('\n'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "3.4.3",
3
+ "version": "3.4.5",
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",