@remnawave/backend-contract 3.4.1 → 3.4.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.
Files changed (37) hide show
  1. package/build/backend/commands/hosts/bulk/update-many-hosts.command.d.ts +19 -1
  2. package/build/backend/commands/hosts/bulk/update-many-hosts.command.d.ts.map +1 -1
  3. package/build/backend/commands/hosts/create.command.d.ts +38 -2
  4. package/build/backend/commands/hosts/create.command.d.ts.map +1 -1
  5. package/build/backend/commands/hosts/create.command.js +1 -3
  6. package/build/backend/commands/hosts/get-host.command.d.ts +19 -1
  7. package/build/backend/commands/hosts/get-host.command.d.ts.map +1 -1
  8. package/build/backend/commands/hosts/get-hosts.command.d.ts +19 -1
  9. package/build/backend/commands/hosts/get-hosts.command.d.ts.map +1 -1
  10. package/build/backend/commands/hosts/host.response.d.ts +19 -1
  11. package/build/backend/commands/hosts/host.response.d.ts.map +1 -1
  12. package/build/backend/commands/hosts/update.command.d.ts +38 -2
  13. package/build/backend/commands/hosts/update.command.d.ts.map +1 -1
  14. package/build/backend/commands/hosts/update.command.js +1 -3
  15. package/build/backend/commands/subscriptions/get-by/get-raw-subscription-by-short-uuid.command.d.ts +12 -0
  16. package/build/backend/commands/subscriptions/get-by/get-raw-subscription-by-short-uuid.command.d.ts.map +1 -1
  17. package/build/backend/constants/hosts/index.d.ts +1 -0
  18. package/build/backend/constants/hosts/index.d.ts.map +1 -1
  19. package/build/backend/constants/hosts/index.js +1 -0
  20. package/build/backend/constants/hosts/internal-squads-mode.d.ts +7 -0
  21. package/build/backend/constants/hosts/internal-squads-mode.d.ts.map +1 -0
  22. package/build/backend/constants/hosts/internal-squads-mode.js +8 -0
  23. package/build/backend/models/host-mapper/host-mapper.schema.d.ts +24 -0
  24. package/build/backend/models/host-mapper/host-mapper.schema.d.ts.map +1 -1
  25. package/build/backend/models/host-mapper/host-mapper.schema.js +45 -3
  26. package/build/backend/models/hosts.schema.d.ts +26 -1
  27. package/build/backend/models/hosts.schema.d.ts.map +1 -1
  28. package/build/backend/models/hosts.schema.js +14 -2
  29. package/build/backend/models/resolved-proxy-config.schema.d.ts +24 -0
  30. package/build/backend/models/resolved-proxy-config.schema.d.ts.map +1 -1
  31. package/build/frontend/commands/hosts/create.command.js +1 -3
  32. package/build/frontend/commands/hosts/update.command.js +1 -3
  33. package/build/frontend/constants/hosts/index.js +1 -0
  34. package/build/frontend/constants/hosts/internal-squads-mode.js +8 -0
  35. package/build/frontend/models/host-mapper/host-mapper.schema.js +45 -3
  36. package/build/frontend/models/hosts.schema.js +14 -2
  37. package/package.json +1 -1
@@ -55,6 +55,18 @@ export declare namespace UpdateManyHostsCommand {
55
55
  op: z.ZodLiteral<"unset">;
56
56
  to: z.ZodString;
57
57
  }, z.core.$strip>], "op">>>;
58
+ singbox: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
59
+ op: z.ZodLiteral<"copy">;
60
+ from: z.ZodString;
61
+ to: z.ZodString;
62
+ }, z.core.$strip>, z.ZodObject<{
63
+ op: z.ZodLiteral<"set">;
64
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodJSONSchema>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
65
+ to: z.ZodString;
66
+ }, z.core.$strip>, z.ZodObject<{
67
+ op: z.ZodLiteral<"unset">;
68
+ to: z.ZodString;
69
+ }, z.core.$strip>], "op">>>;
58
70
  }, z.core.$strip>>>;
59
71
  remark: z.ZodOptional<z.ZodOptional<z.ZodString>>;
60
72
  address: z.ZodOptional<z.ZodOptional<z.ZodString>>;
@@ -90,7 +102,6 @@ export declare namespace UpdateManyHostsCommand {
90
102
  readonly IPV6_PREFER: "ipv6-prefer";
91
103
  }>>>>;
92
104
  xrayJsonTemplateUuid: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodUUID>>>;
93
- excludedInternalSquads: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodUUID>>>;
94
105
  excludeFromSubscriptionTypes: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodEnum<{
95
106
  readonly XRAY_JSON: "XRAY_JSON";
96
107
  readonly XRAY_BASE64: "XRAY_BASE64";
@@ -99,6 +110,13 @@ export declare namespace UpdateManyHostsCommand {
99
110
  readonly CLASH: "CLASH";
100
111
  readonly SINGBOX: "SINGBOX";
101
112
  }>>>>;
113
+ internalSquads: z.ZodOptional<z.ZodOptional<z.ZodObject<{
114
+ mode: z.ZodEnum<{
115
+ readonly EXCLUDE: "EXCLUDE";
116
+ readonly ALLOW_ONLY: "ALLOW_ONLY";
117
+ }>;
118
+ squads: z.ZodArray<z.ZodUUID>;
119
+ }, z.core.$strip>>>;
102
120
  uuids: z.ZodArray<z.ZodUUID>;
103
121
  }, z.core.$strip>;
104
122
  type RequestBody = z.infer<typeof RequestBodySchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"update-many-hosts.command.d.ts","sourceRoot":"","sources":["../../../../../commands/hosts/bulk/update-many-hosts.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,sBAAsB,CAAC;IAC7B,MAAM,GAAG,0BAA6B,CAAC;IACvC,MAAM,OAAO,0BAAM,CAAC;IAEpB,MAAM,eAAe,8CAK3B,CAAC;IAEK,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAIxB,CAAC;IAEP,KAAY,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;CAC/D"}
1
+ {"version":3,"file":"update-many-hosts.command.d.ts","sourceRoot":"","sources":["../../../../../commands/hosts/bulk/update-many-hosts.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,sBAAsB,CAAC;IAC7B,MAAM,GAAG,0BAA6B,CAAC;IACvC,MAAM,OAAO,0BAAM,CAAC;IAEpB,MAAM,eAAe,8CAK3B,CAAC;IAEK,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAIxB,CAAC;IAEP,KAAY,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;CAC/D"}
@@ -52,7 +52,6 @@ export declare namespace CreateHostCommand {
52
52
  }>>>;
53
53
  nodes: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
54
54
  xrayJsonTemplateUuid: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
55
- excludedInternalSquads: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
56
55
  excludeFromSubscriptionTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
57
56
  readonly XRAY_JSON: "XRAY_JSON";
58
57
  readonly XRAY_BASE64: "XRAY_BASE64";
@@ -98,6 +97,25 @@ export declare namespace CreateHostCommand {
98
97
  op: z.ZodLiteral<"unset">;
99
98
  to: z.ZodString;
100
99
  }, z.core.$strip>], "op">>>;
100
+ singbox: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
101
+ op: z.ZodLiteral<"copy">;
102
+ from: z.ZodString;
103
+ to: z.ZodString;
104
+ }, z.core.$strip>, z.ZodObject<{
105
+ op: z.ZodLiteral<"set">;
106
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodJSONSchema>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
107
+ to: z.ZodString;
108
+ }, z.core.$strip>, z.ZodObject<{
109
+ op: z.ZodLiteral<"unset">;
110
+ to: z.ZodString;
111
+ }, z.core.$strip>], "op">>>;
112
+ }, z.core.$strip>>;
113
+ internalSquads: z.ZodOptional<z.ZodObject<{
114
+ mode: z.ZodEnum<{
115
+ readonly EXCLUDE: "EXCLUDE";
116
+ readonly ALLOW_ONLY: "ALLOW_ONLY";
117
+ }>;
118
+ squads: z.ZodArray<z.ZodUUID>;
101
119
  }, z.core.$strip>>;
102
120
  }, z.core.$strip>;
103
121
  const ResponseSchema: z.ZodObject<{
@@ -152,7 +170,6 @@ export declare namespace CreateHostCommand {
152
170
  }>>;
153
171
  nodes: z.ZodArray<z.ZodUUID>;
154
172
  xrayJsonTemplateUuid: z.ZodNullable<z.ZodUUID>;
155
- excludedInternalSquads: z.ZodArray<z.ZodUUID>;
156
173
  excludeFromSubscriptionTypes: z.ZodArray<z.ZodEnum<{
157
174
  readonly XRAY_JSON: "XRAY_JSON";
158
175
  readonly XRAY_BASE64: "XRAY_BASE64";
@@ -198,6 +215,25 @@ export declare namespace CreateHostCommand {
198
215
  op: z.ZodLiteral<"unset">;
199
216
  to: z.ZodString;
200
217
  }, z.core.$strip>], "op">>>;
218
+ singbox: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
219
+ op: z.ZodLiteral<"copy">;
220
+ from: z.ZodString;
221
+ to: z.ZodString;
222
+ }, z.core.$strip>, z.ZodObject<{
223
+ op: z.ZodLiteral<"set">;
224
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodJSONSchema>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
225
+ to: z.ZodString;
226
+ }, z.core.$strip>, z.ZodObject<{
227
+ op: z.ZodLiteral<"unset">;
228
+ to: z.ZodString;
229
+ }, z.core.$strip>], "op">>>;
230
+ }, z.core.$strip>;
231
+ internalSquads: z.ZodObject<{
232
+ mode: z.ZodEnum<{
233
+ readonly EXCLUDE: "EXCLUDE";
234
+ readonly ALLOW_ONLY: "ALLOW_ONLY";
235
+ }>;
236
+ squads: z.ZodArray<z.ZodUUID>;
201
237
  }, z.core.$strip>;
202
238
  }, z.core.$strip>;
203
239
  }, z.core.$strip>;
@@ -1 +1 @@
1
- {"version":3,"file":"create.command.d.ts","sourceRoot":"","sources":["../../../../commands/hosts/create.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,yBAAiB,iBAAiB,CAAC;IACxB,MAAM,GAAG,eAAwB,CAAC;IAClC,MAAM,OAAO,eAAM,CAAC;IAEpB,MAAM,eAAe,2CAK3B,CAAC;IAEK,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAqD5B,CAAC;IAEI,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAqB,CAAC;IAEjD,KAAY,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;IAC5D,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
1
+ {"version":3,"file":"create.command.d.ts","sourceRoot":"","sources":["../../../../commands/hosts/create.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,yBAAiB,iBAAiB,CAAC;IACxB,MAAM,GAAG,eAAwB,CAAC;IAClC,MAAM,OAAO,eAAM,CAAC;IAEpB,MAAM,eAAe,2CAK3B,CAAC;IAEK,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAmD5B,CAAC;IAEI,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAqB,CAAC;IAEjD,KAAY,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;IAC5D,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -48,13 +48,11 @@ var CreateHostCommand;
48
48
  mihomoIpVersion: zod_1.z.enum(constants_1.MIHOMO_IP_VERSION).nullish(),
49
49
  nodes: zod_1.z.optional(zod_1.z.array(zod_1.z.uuid())),
50
50
  xrayJsonTemplateUuid: zod_1.z.uuid().nullish(),
51
- excludedInternalSquads: zod_1.z
52
- .optional(zod_1.z.array(zod_1.z.uuid()))
53
- .describe('Optional. Internal squads from which the host will be excluded.'),
54
51
  excludeFromSubscriptionTypes: zod_1.z
55
52
  .optional(zod_1.z.array(zod_1.z.enum(constants_1.SUBSCRIPTION_TEMPLATE_TYPE)))
56
53
  .describe('Optional. Subscription types from which the host will be excluded from.'),
57
54
  mapper: models_1.HostMapperSchema.optional(),
55
+ internalSquads: models_1.HostInternalSquadsSchema.optional(),
58
56
  });
59
57
  CreateHostCommand.ResponseSchema = host_response_1.HostResponseSchema;
60
58
  })(CreateHostCommand || (exports.CreateHostCommand = CreateHostCommand = {}));
@@ -58,7 +58,6 @@ export declare namespace GetHostCommand {
58
58
  }>>;
59
59
  nodes: z.ZodArray<z.ZodUUID>;
60
60
  xrayJsonTemplateUuid: z.ZodNullable<z.ZodUUID>;
61
- excludedInternalSquads: z.ZodArray<z.ZodUUID>;
62
61
  excludeFromSubscriptionTypes: z.ZodArray<z.ZodEnum<{
63
62
  readonly XRAY_JSON: "XRAY_JSON";
64
63
  readonly XRAY_BASE64: "XRAY_BASE64";
@@ -104,6 +103,25 @@ export declare namespace GetHostCommand {
104
103
  op: z.ZodLiteral<"unset">;
105
104
  to: z.ZodString;
106
105
  }, z.core.$strip>], "op">>>;
106
+ singbox: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
107
+ op: z.ZodLiteral<"copy">;
108
+ from: z.ZodString;
109
+ to: z.ZodString;
110
+ }, z.core.$strip>, z.ZodObject<{
111
+ op: z.ZodLiteral<"set">;
112
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodJSONSchema>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
113
+ to: z.ZodString;
114
+ }, z.core.$strip>, z.ZodObject<{
115
+ op: z.ZodLiteral<"unset">;
116
+ to: z.ZodString;
117
+ }, z.core.$strip>], "op">>>;
118
+ }, z.core.$strip>;
119
+ internalSquads: z.ZodObject<{
120
+ mode: z.ZodEnum<{
121
+ readonly EXCLUDE: "EXCLUDE";
122
+ readonly ALLOW_ONLY: "ALLOW_ONLY";
123
+ }>;
124
+ squads: z.ZodArray<z.ZodUUID>;
107
125
  }, z.core.$strip>;
108
126
  }, z.core.$strip>;
109
127
  }, z.core.$strip>;
@@ -1 +1 @@
1
- {"version":3,"file":"get-host.command.d.ts","sourceRoot":"","sources":["../../../../commands/hosts/get-host.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,cAAc,CAAC;IACrB,MAAM,GAAG,0BAA6B,CAAC;IACvC,MAAM,OAAO,QAAe,CAAC;IAE7B,MAAM,eAAe,2CAK3B,CAAC;IAEK,MAAM,kBAAkB;;qBAE7B,CAAC;IAEI,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAqB,CAAC;IAEjD,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC9D,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
1
+ {"version":3,"file":"get-host.command.d.ts","sourceRoot":"","sources":["../../../../commands/hosts/get-host.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,cAAc,CAAC;IACrB,MAAM,GAAG,0BAA6B,CAAC;IACvC,MAAM,OAAO,QAAe,CAAC;IAE7B,MAAM,eAAe,2CAK3B,CAAC;IAEK,MAAM,kBAAkB;;qBAE7B,CAAC;IAEI,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAqB,CAAC;IAEjD,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC9D,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -55,7 +55,6 @@ export declare namespace GetHostsCommand {
55
55
  }>>;
56
56
  nodes: z.ZodArray<z.ZodUUID>;
57
57
  xrayJsonTemplateUuid: z.ZodNullable<z.ZodUUID>;
58
- excludedInternalSquads: z.ZodArray<z.ZodUUID>;
59
58
  excludeFromSubscriptionTypes: z.ZodArray<z.ZodEnum<{
60
59
  readonly XRAY_JSON: "XRAY_JSON";
61
60
  readonly XRAY_BASE64: "XRAY_BASE64";
@@ -101,6 +100,25 @@ export declare namespace GetHostsCommand {
101
100
  op: z.ZodLiteral<"unset">;
102
101
  to: z.ZodString;
103
102
  }, z.core.$strip>], "op">>>;
103
+ singbox: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
104
+ op: z.ZodLiteral<"copy">;
105
+ from: z.ZodString;
106
+ to: z.ZodString;
107
+ }, z.core.$strip>, z.ZodObject<{
108
+ op: z.ZodLiteral<"set">;
109
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodJSONSchema>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
110
+ to: z.ZodString;
111
+ }, z.core.$strip>, z.ZodObject<{
112
+ op: z.ZodLiteral<"unset">;
113
+ to: z.ZodString;
114
+ }, z.core.$strip>], "op">>>;
115
+ }, z.core.$strip>;
116
+ internalSquads: z.ZodObject<{
117
+ mode: z.ZodEnum<{
118
+ readonly EXCLUDE: "EXCLUDE";
119
+ readonly ALLOW_ONLY: "ALLOW_ONLY";
120
+ }>;
121
+ squads: z.ZodArray<z.ZodUUID>;
104
122
  }, z.core.$strip>;
105
123
  }, z.core.$strip>>;
106
124
  }, z.core.$strip>;
@@ -1 +1 @@
1
- {"version":3,"file":"get-hosts.command.d.ts","sourceRoot":"","sources":["../../../../commands/hosts/get-hosts.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,eAAe,CAAC;IACtB,MAAM,GAAG,eAAqB,CAAC;IAC/B,MAAM,OAAO,eAAM,CAAC;IAEpB,MAAM,eAAe,2CAG1B,CAAC;IAEI,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAEzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
1
+ {"version":3,"file":"get-hosts.command.d.ts","sourceRoot":"","sources":["../../../../commands/hosts/get-hosts.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,eAAe,CAAC;IACtB,MAAM,GAAG,eAAqB,CAAC;IAC/B,MAAM,OAAO,eAAM,CAAC;IAEpB,MAAM,eAAe,2CAG1B,CAAC;IAEI,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAEzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -51,7 +51,6 @@ export declare const HostResponseSchema: z.ZodObject<{
51
51
  }>>;
52
52
  nodes: z.ZodArray<z.ZodUUID>;
53
53
  xrayJsonTemplateUuid: z.ZodNullable<z.ZodUUID>;
54
- excludedInternalSquads: z.ZodArray<z.ZodUUID>;
55
54
  excludeFromSubscriptionTypes: z.ZodArray<z.ZodEnum<{
56
55
  readonly XRAY_JSON: "XRAY_JSON";
57
56
  readonly XRAY_BASE64: "XRAY_BASE64";
@@ -97,6 +96,25 @@ export declare const HostResponseSchema: z.ZodObject<{
97
96
  op: z.ZodLiteral<"unset">;
98
97
  to: z.ZodString;
99
98
  }, z.core.$strip>], "op">>>;
99
+ singbox: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
100
+ op: z.ZodLiteral<"copy">;
101
+ from: z.ZodString;
102
+ to: z.ZodString;
103
+ }, z.core.$strip>, z.ZodObject<{
104
+ op: z.ZodLiteral<"set">;
105
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodJSONSchema>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
106
+ to: z.ZodString;
107
+ }, z.core.$strip>, z.ZodObject<{
108
+ op: z.ZodLiteral<"unset">;
109
+ to: z.ZodString;
110
+ }, z.core.$strip>], "op">>>;
111
+ }, z.core.$strip>;
112
+ internalSquads: z.ZodObject<{
113
+ mode: z.ZodEnum<{
114
+ readonly EXCLUDE: "EXCLUDE";
115
+ readonly ALLOW_ONLY: "ALLOW_ONLY";
116
+ }>;
117
+ squads: z.ZodArray<z.ZodUUID>;
100
118
  }, z.core.$strip>;
101
119
  }, z.core.$strip>;
102
120
  }, z.core.$strip>;
@@ -1 +1 @@
1
- {"version":3,"file":"host.response.d.ts","sourceRoot":"","sources":["../../../../commands/hosts/host.response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAE7B,CAAC"}
1
+ {"version":3,"file":"host.response.d.ts","sourceRoot":"","sources":["../../../../commands/hosts/host.response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAE7B,CAAC"}
@@ -53,7 +53,6 @@ export declare namespace UpdateHostCommand {
53
53
  }>>>;
54
54
  nodes: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
55
55
  xrayJsonTemplateUuid: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
56
- excludedInternalSquads: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
57
56
  excludeFromSubscriptionTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
58
57
  readonly XRAY_JSON: "XRAY_JSON";
59
58
  readonly XRAY_BASE64: "XRAY_BASE64";
@@ -99,6 +98,25 @@ export declare namespace UpdateHostCommand {
99
98
  op: z.ZodLiteral<"unset">;
100
99
  to: z.ZodString;
101
100
  }, z.core.$strip>], "op">>>;
101
+ singbox: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
102
+ op: z.ZodLiteral<"copy">;
103
+ from: z.ZodString;
104
+ to: z.ZodString;
105
+ }, z.core.$strip>, z.ZodObject<{
106
+ op: z.ZodLiteral<"set">;
107
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodJSONSchema>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
108
+ to: z.ZodString;
109
+ }, z.core.$strip>, z.ZodObject<{
110
+ op: z.ZodLiteral<"unset">;
111
+ to: z.ZodString;
112
+ }, z.core.$strip>], "op">>>;
113
+ }, z.core.$strip>>;
114
+ internalSquads: z.ZodOptional<z.ZodObject<{
115
+ mode: z.ZodEnum<{
116
+ readonly EXCLUDE: "EXCLUDE";
117
+ readonly ALLOW_ONLY: "ALLOW_ONLY";
118
+ }>;
119
+ squads: z.ZodArray<z.ZodUUID>;
102
120
  }, z.core.$strip>>;
103
121
  }, z.core.$strip>;
104
122
  const ResponseSchema: z.ZodObject<{
@@ -153,7 +171,6 @@ export declare namespace UpdateHostCommand {
153
171
  }>>;
154
172
  nodes: z.ZodArray<z.ZodUUID>;
155
173
  xrayJsonTemplateUuid: z.ZodNullable<z.ZodUUID>;
156
- excludedInternalSquads: z.ZodArray<z.ZodUUID>;
157
174
  excludeFromSubscriptionTypes: z.ZodArray<z.ZodEnum<{
158
175
  readonly XRAY_JSON: "XRAY_JSON";
159
176
  readonly XRAY_BASE64: "XRAY_BASE64";
@@ -199,6 +216,25 @@ export declare namespace UpdateHostCommand {
199
216
  op: z.ZodLiteral<"unset">;
200
217
  to: z.ZodString;
201
218
  }, z.core.$strip>], "op">>>;
219
+ singbox: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
220
+ op: z.ZodLiteral<"copy">;
221
+ from: z.ZodString;
222
+ to: z.ZodString;
223
+ }, z.core.$strip>, z.ZodObject<{
224
+ op: z.ZodLiteral<"set">;
225
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodJSONSchema>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
226
+ to: z.ZodString;
227
+ }, z.core.$strip>, z.ZodObject<{
228
+ op: z.ZodLiteral<"unset">;
229
+ to: z.ZodString;
230
+ }, z.core.$strip>], "op">>>;
231
+ }, z.core.$strip>;
232
+ internalSquads: z.ZodObject<{
233
+ mode: z.ZodEnum<{
234
+ readonly EXCLUDE: "EXCLUDE";
235
+ readonly ALLOW_ONLY: "ALLOW_ONLY";
236
+ }>;
237
+ squads: z.ZodArray<z.ZodUUID>;
202
238
  }, z.core.$strip>;
203
239
  }, z.core.$strip>;
204
240
  }, z.core.$strip>;
@@ -1 +1 @@
1
- {"version":3,"file":"update.command.d.ts","sourceRoot":"","sources":["../../../../commands/hosts/update.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,yBAAiB,iBAAiB,CAAC;IACxB,MAAM,GAAG,eAAwB,CAAC;IAClC,MAAM,OAAO,eAAM,CAAC;IAEpB,MAAM,eAAe,2CAK3B,CAAC;IAEK,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAuD5B,CAAC;IAEI,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAqB,CAAC;IAEjD,KAAY,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;IAC5D,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
1
+ {"version":3,"file":"update.command.d.ts","sourceRoot":"","sources":["../../../../commands/hosts/update.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,yBAAiB,iBAAiB,CAAC;IACxB,MAAM,GAAG,eAAwB,CAAC;IAClC,MAAM,OAAO,eAAM,CAAC;IAEpB,MAAM,eAAe,2CAK3B,CAAC;IAEK,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAqD5B,CAAC;IAEI,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAqB,CAAC;IAEjD,KAAY,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;IAC5D,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -52,13 +52,11 @@ var UpdateHostCommand;
52
52
  mihomoIpVersion: zod_1.z.enum(constants_1.MIHOMO_IP_VERSION).nullish(),
53
53
  nodes: zod_1.z.optional(zod_1.z.array(zod_1.z.uuid())),
54
54
  xrayJsonTemplateUuid: zod_1.z.uuid().nullish(),
55
- excludedInternalSquads: zod_1.z
56
- .optional(zod_1.z.array(zod_1.z.uuid()))
57
- .describe('Optional. Internal squads from which the host will be excluded.'),
58
55
  excludeFromSubscriptionTypes: zod_1.z
59
56
  .optional(zod_1.z.array(zod_1.z.enum(constants_1.SUBSCRIPTION_TEMPLATE_TYPE)))
60
57
  .describe('Optional. Subscription types from which the host will be excluded from.'),
61
58
  mapper: models_1.HostMapperSchema.optional(),
59
+ internalSquads: models_1.HostInternalSquadsSchema.optional(),
62
60
  });
63
61
  UpdateHostCommand.ResponseSchema = host_response_1.HostResponseSchema;
64
62
  })(UpdateHostCommand || (exports.UpdateHostCommand = UpdateHostCommand = {}));
@@ -128,6 +128,18 @@ export declare namespace GetRawSubscriptionByShortUuidCommand {
128
128
  op: z.ZodLiteral<"unset">;
129
129
  to: z.ZodString;
130
130
  }, z.core.$strip>], "op">>>;
131
+ singbox: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
132
+ op: z.ZodLiteral<"copy">;
133
+ from: z.ZodString;
134
+ to: z.ZodString;
135
+ }, z.core.$strip>, z.ZodObject<{
136
+ op: z.ZodLiteral<"set">;
137
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodJSONSchema>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
138
+ to: z.ZodString;
139
+ }, z.core.$strip>, z.ZodObject<{
140
+ op: z.ZodLiteral<"unset">;
141
+ to: z.ZodString;
142
+ }, z.core.$strip>], "op">>>;
131
143
  }, z.core.$strip>;
132
144
  }, z.core.$strip>;
133
145
  metadata: z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"get-raw-subscription-by-short-uuid.command.d.ts","sourceRoot":"","sources":["../../../../../commands/subscriptions/get-by/get-raw-subscription-by-short-uuid.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,oCAAoC,CAAC;IAC3C,MAAM,GAAG,+BAA+C,CAAC;IACzD,MAAM,OAAO,QAAoB,CAAC;IAElC,MAAM,eAAe,8CAK3B,CAAC;IAEK,MAAM,kBAAkB;;qBAE7B,CAAC;IAEI,MAAM,kBAAkB;;qBAM7B,CAAC;IAEI,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAoBzB,CAAC;IAEH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC9D,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC9D,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
1
+ {"version":3,"file":"get-raw-subscription-by-short-uuid.command.d.ts","sourceRoot":"","sources":["../../../../../commands/subscriptions/get-by/get-raw-subscription-by-short-uuid.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,oCAAoC,CAAC;IAC3C,MAAM,GAAG,+BAA+C,CAAC;IACzD,MAAM,OAAO,QAAoB,CAAC;IAElC,MAAM,eAAe,8CAK3B,CAAC;IAEK,MAAM,kBAAkB;;qBAE7B,CAAC;IAEI,MAAM,kBAAkB;;qBAM7B,CAAC;IAEI,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAoBzB,CAAC;IAEH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC9D,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC9D,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -2,4 +2,5 @@ export * from './alpn';
2
2
  export * from './fingerprints';
3
3
  export * from './mihomo-ip-version';
4
4
  export * from './security-layers';
5
+ export * from './internal-squads-mode';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../constants/hosts/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../constants/hosts/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC"}
@@ -18,3 +18,4 @@ __exportStar(require("./alpn"), exports);
18
18
  __exportStar(require("./fingerprints"), exports);
19
19
  __exportStar(require("./mihomo-ip-version"), exports);
20
20
  __exportStar(require("./security-layers"), exports);
21
+ __exportStar(require("./internal-squads-mode"), exports);
@@ -0,0 +1,7 @@
1
+ export declare const INTERNAL_SQUADS_MODE: {
2
+ readonly EXCLUDE: "EXCLUDE";
3
+ readonly ALLOW_ONLY: "ALLOW_ONLY";
4
+ };
5
+ export type TInternalSquadsMode = (typeof INTERNAL_SQUADS_MODE)[keyof typeof INTERNAL_SQUADS_MODE];
6
+ export declare const INTERNAL_SQUADS_MODE_VALUES: ("EXCLUDE" | "ALLOW_ONLY")[];
7
+ //# sourceMappingURL=internal-squads-mode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-squads-mode.d.ts","sourceRoot":"","sources":["../../../../constants/hosts/internal-squads-mode.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB;;;CAGvB,CAAC;AACX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC;AACnG,eAAO,MAAM,2BAA2B,8BAAsC,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.INTERNAL_SQUADS_MODE_VALUES = exports.INTERNAL_SQUADS_MODE = void 0;
4
+ exports.INTERNAL_SQUADS_MODE = {
5
+ EXCLUDE: 'EXCLUDE',
6
+ ALLOW_ONLY: 'ALLOW_ONLY',
7
+ };
8
+ exports.INTERNAL_SQUADS_MODE_VALUES = Object.values(exports.INTERNAL_SQUADS_MODE);
@@ -23,6 +23,18 @@ export declare const MihomoHostMapperOperationsSchema: z.ZodDiscriminatedUnion<[
23
23
  op: z.ZodLiteral<"unset">;
24
24
  to: z.ZodString;
25
25
  }, z.core.$strip>], "op">;
26
+ export declare const SingBoxHostMapperOperationsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
27
+ op: z.ZodLiteral<"copy">;
28
+ from: z.ZodString;
29
+ to: z.ZodString;
30
+ }, z.core.$strip>, z.ZodObject<{
31
+ op: z.ZodLiteral<"set">;
32
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodJSONSchema>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
33
+ to: z.ZodString;
34
+ }, z.core.$strip>, z.ZodObject<{
35
+ op: z.ZodLiteral<"unset">;
36
+ to: z.ZodString;
37
+ }, z.core.$strip>], "op">;
26
38
  export declare const Base64HostMapperOperationsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
27
39
  op: z.ZodLiteral<"copy">;
28
40
  from: z.ZodString;
@@ -84,6 +96,18 @@ export declare const HostMapperSchema: z.ZodObject<{
84
96
  op: z.ZodLiteral<"unset">;
85
97
  to: z.ZodString;
86
98
  }, z.core.$strip>], "op">>>;
99
+ singbox: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
100
+ op: z.ZodLiteral<"copy">;
101
+ from: z.ZodString;
102
+ to: z.ZodString;
103
+ }, z.core.$strip>, z.ZodObject<{
104
+ op: z.ZodLiteral<"set">;
105
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodJSONSchema>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
106
+ to: z.ZodString;
107
+ }, z.core.$strip>, z.ZodObject<{
108
+ op: z.ZodLiteral<"unset">;
109
+ to: z.ZodString;
110
+ }, z.core.$strip>], "op">>>;
87
111
  }, z.core.$strip>;
88
112
  export type THostMapper = z.infer<typeof HostMapperSchema>;
89
113
  export type THostMapperOperation = z.infer<typeof HostMapperOperationsSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"host-mapper.schema.d.ts","sourceRoot":"","sources":["../../../../models/host-mapper/host-mapper.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuJxB,eAAO,MAAM,kCAAkC;;;;;;;;;;;yBAY7C,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;;;;;;yBAM3C,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;;;;;;yBAmC3C,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;yBAAqC,CAAC;AAE7E,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2EvB,CAAC;AAEP,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC3D,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
1
+ {"version":3,"file":"host-mapper.schema.d.ts","sourceRoot":"","sources":["../../../../models/host-mapper/host-mapper.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiKxB,eAAO,MAAM,kCAAkC;;;;;;;;;;;yBAY7C,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;;;;;;yBAM3C,CAAC;AAEH,eAAO,MAAM,iCAAiC;;;;;;;;;;;yBAa5C,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;;;;;;yBAmC3C,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;yBAAqC,CAAC;AAE7E,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiGvB,CAAC;AAEP,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC3D,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HostMapperSchema = exports.HostMapperOperationsSchema = exports.Base64HostMapperOperationsSchema = exports.MihomoHostMapperOperationsSchema = exports.XrayJsonHostMapperOperationsSchema = void 0;
3
+ exports.HostMapperSchema = exports.HostMapperOperationsSchema = exports.Base64HostMapperOperationsSchema = exports.SingBoxHostMapperOperationsSchema = exports.MihomoHostMapperOperationsSchema = exports.XrayJsonHostMapperOperationsSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const buildFromSchema = () => zod_1.z
6
6
  .string()
@@ -11,12 +11,22 @@ const buildFromSchema = () => zod_1.z
11
11
  markdownDescription: [
12
12
  'Dot-separated path inside the **raw inbound** of the config profile this host belongs to. Array items are addressed by index.',
13
13
  '',
14
- '> If the path resolves to nothing, the operation is skipped and the target key is **not** created.',
14
+ 'With a `$host.` prefix the value is read from the **host** itself, after overrides have been resolved – `$host.securityOptions.serverName` holds the SNI that actually went into the config.',
15
+ '',
16
+ 'Only a part of the host is readable. Each entry below also opens everything nested under it:',
17
+ '',
18
+ '`address`, `port`, `finalRemark`, `protocol`, `transport`, `security`, `protocolOptions`, `transportOptions`, `securityOptions`, `mux`, `streamOverrides.finalMask`, `streamOverrides.sockopt`, `clientOverrides.serverDescription`, `metadata.remark`, `metadata.tags`, `metadata.inboundTag`',
19
+ '',
20
+ '> If the path resolves to nothing – or points outside the list above – the operation is skipped and the target key is **not** created.',
15
21
  ].join('\n'),
16
22
  examples: [
17
23
  'streamSettings.tlsSettings.cipherSuites',
18
24
  'streamSettings.tlsSettings.alpn',
19
25
  'streamSettings.realitySettings.serverNames.0',
26
+ '$host.address',
27
+ '$host.securityOptions.serverName',
28
+ '$host.transportOptions.path',
29
+ '$host.mux.smux',
20
30
  ],
21
31
  });
22
32
  const buildToSchema = (client) => zod_1.z
@@ -155,6 +165,20 @@ exports.MihomoHostMapperOperationsSchema = buildOperationsSchema({
155
165
  setSnippet: { to: 'reality-opts.support-x25519mlkem768', value: true },
156
166
  unsetSnippet: { to: 'smux' },
157
167
  });
168
+ exports.SingBoxHostMapperOperationsSchema = buildOperationsSchema({
169
+ target: 'the generated **outbound**',
170
+ examples: [
171
+ 'domain_resolver',
172
+ 'multiplex.protocol',
173
+ 'packet_encoding',
174
+ 'tcp_fast_open',
175
+ 'tls.insecure',
176
+ 'tls.utls.fingerprint',
177
+ ],
178
+ copySnippet: { from: 'streamSettings.realitySettings.serverNames.0', to: 'tls.server_name' },
179
+ setSnippet: { to: 'tls.utls.fingerprint', value: 'chrome' },
180
+ unsetSnippet: { to: 'multiplex' },
181
+ });
158
182
  exports.Base64HostMapperOperationsSchema = buildOperationsSchema({
159
183
  target: 'the query string of the generated **share link**',
160
184
  examples: [
@@ -247,6 +271,24 @@ exports.HostMapperSchema = zod_1.z
247
271
  '```',
248
272
  ].join('\n'),
249
273
  }),
274
+ singbox: zod_1.z
275
+ .array(exports.SingBoxHostMapperOperationsSchema)
276
+ .optional()
277
+ .meta({
278
+ title: 'sing-box',
279
+ markdownDescription: [
280
+ 'Operations applied to the **outbound** generated for this host in the sing-box subscription. Paths are counted from the root of the outbound.',
281
+ '',
282
+ 'sing-box keys are written in snake_case, and the outbound of a Hysteria2 host has a shape of its own.',
283
+ '',
284
+ '```json',
285
+ JSON.stringify([
286
+ { op: 'set', to: 'tls.utls.fingerprint', value: 'chrome' },
287
+ { op: 'unset', to: 'multiplex' },
288
+ ], null, 2),
289
+ '```',
290
+ ].join('\n'),
291
+ }),
250
292
  })
251
293
  .meta({
252
294
  title: 'Host Mapper',
@@ -255,7 +297,7 @@ exports.HostMapperSchema = zod_1.z
255
297
  '',
256
298
  'Operations run **after** the generator has finished, so they can change or remove anything it produced.',
257
299
  '',
258
- 'The source for `copy` is always the raw inbound of the config profile this host belongs to.',
300
+ 'The source for `copy` is the raw inbound of the config profile this host belongs to, or the host itself when the path starts with `$host.`.',
259
301
  '',
260
302
  '> `to` is never checked against the target client. A misspelled key is written exactly like a real one.',
261
303
  ].join('\n'),
@@ -50,7 +50,6 @@ export declare const HostsSchema: z.ZodObject<{
50
50
  }>>;
51
51
  nodes: z.ZodArray<z.ZodUUID>;
52
52
  xrayJsonTemplateUuid: z.ZodNullable<z.ZodUUID>;
53
- excludedInternalSquads: z.ZodArray<z.ZodUUID>;
54
53
  excludeFromSubscriptionTypes: z.ZodArray<z.ZodEnum<{
55
54
  readonly XRAY_JSON: "XRAY_JSON";
56
55
  readonly XRAY_BASE64: "XRAY_BASE64";
@@ -96,6 +95,32 @@ export declare const HostsSchema: z.ZodObject<{
96
95
  op: z.ZodLiteral<"unset">;
97
96
  to: z.ZodString;
98
97
  }, z.core.$strip>], "op">>>;
98
+ singbox: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
99
+ op: z.ZodLiteral<"copy">;
100
+ from: z.ZodString;
101
+ to: z.ZodString;
102
+ }, z.core.$strip>, z.ZodObject<{
103
+ op: z.ZodLiteral<"set">;
104
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodJSONSchema>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
105
+ to: z.ZodString;
106
+ }, z.core.$strip>, z.ZodObject<{
107
+ op: z.ZodLiteral<"unset">;
108
+ to: z.ZodString;
109
+ }, z.core.$strip>], "op">>>;
110
+ }, z.core.$strip>;
111
+ internalSquads: z.ZodObject<{
112
+ mode: z.ZodEnum<{
113
+ readonly EXCLUDE: "EXCLUDE";
114
+ readonly ALLOW_ONLY: "ALLOW_ONLY";
115
+ }>;
116
+ squads: z.ZodArray<z.ZodUUID>;
99
117
  }, z.core.$strip>;
100
118
  }, z.core.$strip>;
119
+ export declare const HostInternalSquadsSchema: z.ZodObject<{
120
+ mode: z.ZodEnum<{
121
+ readonly EXCLUDE: "EXCLUDE";
122
+ readonly ALLOW_ONLY: "ALLOW_ONLY";
123
+ }>;
124
+ squads: z.ZodArray<z.ZodUUID>;
125
+ }, z.core.$strip>;
101
126
  //# sourceMappingURL=hosts.schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hosts.schema.d.ts","sourceRoot":"","sources":["../../../models/hosts.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwCtB,CAAC"}
1
+ {"version":3,"file":"hosts.schema.d.ts","sourceRoot":"","sources":["../../../models/hosts.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4CtB,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;iBAQ/B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HostsSchema = void 0;
3
+ exports.HostInternalSquadsSchema = 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");
@@ -39,7 +39,19 @@ exports.HostsSchema = zod_1.z.object({
39
39
  mihomoIpVersion: zod_1.z.enum(hosts_1.MIHOMO_IP_VERSION).nullable(),
40
40
  nodes: zod_1.z.array(zod_1.z.uuid()),
41
41
  xrayJsonTemplateUuid: zod_1.z.uuid().nullable(),
42
- excludedInternalSquads: zod_1.z.array(zod_1.z.uuid()),
43
42
  excludeFromSubscriptionTypes: zod_1.z.array(zod_1.z.enum(constants_1.SUBSCRIPTION_TEMPLATE_TYPE)),
44
43
  mapper: host_mapper_1.HostMapperSchema,
44
+ internalSquads: zod_1.z.object({
45
+ mode: zod_1.z.enum(hosts_1.INTERNAL_SQUADS_MODE),
46
+ squads: zod_1.z.array(zod_1.z.uuid()),
47
+ }),
48
+ });
49
+ exports.HostInternalSquadsSchema = zod_1.z
50
+ .object({
51
+ mode: zod_1.z.enum(hosts_1.INTERNAL_SQUADS_MODE),
52
+ squads: zod_1.z.array(zod_1.z.uuid()),
53
+ })
54
+ .refine((v) => v.mode !== hosts_1.INTERNAL_SQUADS_MODE.ALLOW_ONLY || v.squads.length > 0, {
55
+ error: 'At least one internal squad is required in ALLOW_ONLY mode',
56
+ path: ['squads'],
45
57
  });
@@ -301,6 +301,18 @@ export declare const ResolvedProxyConfigBaseSchema: z.ZodObject<{
301
301
  op: z.ZodLiteral<"unset">;
302
302
  to: z.ZodString;
303
303
  }, z.core.$strip>], "op">>>;
304
+ singbox: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
305
+ op: z.ZodLiteral<"copy">;
306
+ from: z.ZodString;
307
+ to: z.ZodString;
308
+ }, z.core.$strip>, z.ZodObject<{
309
+ op: z.ZodLiteral<"set">;
310
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodJSONSchema>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
311
+ to: z.ZodString;
312
+ }, z.core.$strip>, z.ZodObject<{
313
+ op: z.ZodLiteral<"unset">;
314
+ to: z.ZodString;
315
+ }, z.core.$strip>], "op">>>;
304
316
  }, z.core.$strip>;
305
317
  }, z.core.$strip>;
306
318
  metadata: z.ZodObject<{
@@ -383,6 +395,18 @@ export declare const ResolvedProxyConfigSchema: z.ZodIntersection<z.ZodIntersect
383
395
  op: z.ZodLiteral<"unset">;
384
396
  to: z.ZodString;
385
397
  }, z.core.$strip>], "op">>>;
398
+ singbox: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
399
+ op: z.ZodLiteral<"copy">;
400
+ from: z.ZodString;
401
+ to: z.ZodString;
402
+ }, z.core.$strip>, z.ZodObject<{
403
+ op: z.ZodLiteral<"set">;
404
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodJSONSchema>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
405
+ to: z.ZodString;
406
+ }, z.core.$strip>, z.ZodObject<{
407
+ op: z.ZodLiteral<"unset">;
408
+ to: z.ZodString;
409
+ }, z.core.$strip>], "op">>>;
386
410
  }, z.core.$strip>;
387
411
  }, z.core.$strip>;
388
412
  metadata: z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"resolved-proxy-config.schema.d.ts","sourceRoot":"","sources":["../../../models/resolved-proxy-config.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,0BAA0B;;;;;;;;iBAIrC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;iBAEtC,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;iBAK3C,CAAC;AA4BH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;iBAEpC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;iBAKtC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;iBAKnC,CAAC;AAEH,eAAO,MAAM,iCAAiC;;;;iBAI5C,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;iBAIrC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;iBAIpC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;iBAExC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;iBAGzC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;iBAWnC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;iBAOvC,CAAC;AAsBH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAKhC,CAAC;AAqCH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAQjC,CAAC;AAgBH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;+BAIhC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;iBAanC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsBxC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAEP,CAAC"}
1
+ {"version":3,"file":"resolved-proxy-config.schema.d.ts","sourceRoot":"","sources":["../../../models/resolved-proxy-config.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,0BAA0B;;;;;;;;iBAIrC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;iBAEtC,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;iBAK3C,CAAC;AA4BH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;iBAEpC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;iBAKtC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;iBAKnC,CAAC;AAEH,eAAO,MAAM,iCAAiC;;;;iBAI5C,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;iBAIrC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;iBAIpC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;iBAExC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;iBAGzC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;iBAWnC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;iBAOvC,CAAC;AAsBH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAKhC,CAAC;AAqCH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAQjC,CAAC;AAgBH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;+BAIhC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;iBAanC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsBxC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAEP,CAAC"}
@@ -48,13 +48,11 @@ var CreateHostCommand;
48
48
  mihomoIpVersion: zod_1.z.enum(constants_1.MIHOMO_IP_VERSION).nullish(),
49
49
  nodes: zod_1.z.optional(zod_1.z.array(zod_1.z.uuid())),
50
50
  xrayJsonTemplateUuid: zod_1.z.uuid().nullish(),
51
- excludedInternalSquads: zod_1.z
52
- .optional(zod_1.z.array(zod_1.z.uuid()))
53
- .describe('Optional. Internal squads from which the host will be excluded.'),
54
51
  excludeFromSubscriptionTypes: zod_1.z
55
52
  .optional(zod_1.z.array(zod_1.z.enum(constants_1.SUBSCRIPTION_TEMPLATE_TYPE)))
56
53
  .describe('Optional. Subscription types from which the host will be excluded from.'),
57
54
  mapper: models_1.HostMapperSchema.optional(),
55
+ internalSquads: models_1.HostInternalSquadsSchema.optional(),
58
56
  });
59
57
  CreateHostCommand.ResponseSchema = host_response_1.HostResponseSchema;
60
58
  })(CreateHostCommand || (exports.CreateHostCommand = CreateHostCommand = {}));
@@ -52,13 +52,11 @@ var UpdateHostCommand;
52
52
  mihomoIpVersion: zod_1.z.enum(constants_1.MIHOMO_IP_VERSION).nullish(),
53
53
  nodes: zod_1.z.optional(zod_1.z.array(zod_1.z.uuid())),
54
54
  xrayJsonTemplateUuid: zod_1.z.uuid().nullish(),
55
- excludedInternalSquads: zod_1.z
56
- .optional(zod_1.z.array(zod_1.z.uuid()))
57
- .describe('Optional. Internal squads from which the host will be excluded.'),
58
55
  excludeFromSubscriptionTypes: zod_1.z
59
56
  .optional(zod_1.z.array(zod_1.z.enum(constants_1.SUBSCRIPTION_TEMPLATE_TYPE)))
60
57
  .describe('Optional. Subscription types from which the host will be excluded from.'),
61
58
  mapper: models_1.HostMapperSchema.optional(),
59
+ internalSquads: models_1.HostInternalSquadsSchema.optional(),
62
60
  });
63
61
  UpdateHostCommand.ResponseSchema = host_response_1.HostResponseSchema;
64
62
  })(UpdateHostCommand || (exports.UpdateHostCommand = UpdateHostCommand = {}));
@@ -18,3 +18,4 @@ __exportStar(require("./alpn"), exports);
18
18
  __exportStar(require("./fingerprints"), exports);
19
19
  __exportStar(require("./mihomo-ip-version"), exports);
20
20
  __exportStar(require("./security-layers"), exports);
21
+ __exportStar(require("./internal-squads-mode"), exports);
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.INTERNAL_SQUADS_MODE_VALUES = exports.INTERNAL_SQUADS_MODE = void 0;
4
+ exports.INTERNAL_SQUADS_MODE = {
5
+ EXCLUDE: 'EXCLUDE',
6
+ ALLOW_ONLY: 'ALLOW_ONLY',
7
+ };
8
+ exports.INTERNAL_SQUADS_MODE_VALUES = Object.values(exports.INTERNAL_SQUADS_MODE);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HostMapperSchema = exports.HostMapperOperationsSchema = exports.Base64HostMapperOperationsSchema = exports.MihomoHostMapperOperationsSchema = exports.XrayJsonHostMapperOperationsSchema = void 0;
3
+ exports.HostMapperSchema = exports.HostMapperOperationsSchema = exports.Base64HostMapperOperationsSchema = exports.SingBoxHostMapperOperationsSchema = exports.MihomoHostMapperOperationsSchema = exports.XrayJsonHostMapperOperationsSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const buildFromSchema = () => zod_1.z
6
6
  .string()
@@ -11,12 +11,22 @@ const buildFromSchema = () => zod_1.z
11
11
  markdownDescription: [
12
12
  'Dot-separated path inside the **raw inbound** of the config profile this host belongs to. Array items are addressed by index.',
13
13
  '',
14
- '> If the path resolves to nothing, the operation is skipped and the target key is **not** created.',
14
+ 'With a `$host.` prefix the value is read from the **host** itself, after overrides have been resolved – `$host.securityOptions.serverName` holds the SNI that actually went into the config.',
15
+ '',
16
+ 'Only a part of the host is readable. Each entry below also opens everything nested under it:',
17
+ '',
18
+ '`address`, `port`, `finalRemark`, `protocol`, `transport`, `security`, `protocolOptions`, `transportOptions`, `securityOptions`, `mux`, `streamOverrides.finalMask`, `streamOverrides.sockopt`, `clientOverrides.serverDescription`, `metadata.remark`, `metadata.tags`, `metadata.inboundTag`',
19
+ '',
20
+ '> If the path resolves to nothing – or points outside the list above – the operation is skipped and the target key is **not** created.',
15
21
  ].join('\n'),
16
22
  examples: [
17
23
  'streamSettings.tlsSettings.cipherSuites',
18
24
  'streamSettings.tlsSettings.alpn',
19
25
  'streamSettings.realitySettings.serverNames.0',
26
+ '$host.address',
27
+ '$host.securityOptions.serverName',
28
+ '$host.transportOptions.path',
29
+ '$host.mux.smux',
20
30
  ],
21
31
  });
22
32
  const buildToSchema = (client) => zod_1.z
@@ -155,6 +165,20 @@ exports.MihomoHostMapperOperationsSchema = buildOperationsSchema({
155
165
  setSnippet: { to: 'reality-opts.support-x25519mlkem768', value: true },
156
166
  unsetSnippet: { to: 'smux' },
157
167
  });
168
+ exports.SingBoxHostMapperOperationsSchema = buildOperationsSchema({
169
+ target: 'the generated **outbound**',
170
+ examples: [
171
+ 'domain_resolver',
172
+ 'multiplex.protocol',
173
+ 'packet_encoding',
174
+ 'tcp_fast_open',
175
+ 'tls.insecure',
176
+ 'tls.utls.fingerprint',
177
+ ],
178
+ copySnippet: { from: 'streamSettings.realitySettings.serverNames.0', to: 'tls.server_name' },
179
+ setSnippet: { to: 'tls.utls.fingerprint', value: 'chrome' },
180
+ unsetSnippet: { to: 'multiplex' },
181
+ });
158
182
  exports.Base64HostMapperOperationsSchema = buildOperationsSchema({
159
183
  target: 'the query string of the generated **share link**',
160
184
  examples: [
@@ -247,6 +271,24 @@ exports.HostMapperSchema = zod_1.z
247
271
  '```',
248
272
  ].join('\n'),
249
273
  }),
274
+ singbox: zod_1.z
275
+ .array(exports.SingBoxHostMapperOperationsSchema)
276
+ .optional()
277
+ .meta({
278
+ title: 'sing-box',
279
+ markdownDescription: [
280
+ 'Operations applied to the **outbound** generated for this host in the sing-box subscription. Paths are counted from the root of the outbound.',
281
+ '',
282
+ 'sing-box keys are written in snake_case, and the outbound of a Hysteria2 host has a shape of its own.',
283
+ '',
284
+ '```json',
285
+ JSON.stringify([
286
+ { op: 'set', to: 'tls.utls.fingerprint', value: 'chrome' },
287
+ { op: 'unset', to: 'multiplex' },
288
+ ], null, 2),
289
+ '```',
290
+ ].join('\n'),
291
+ }),
250
292
  })
251
293
  .meta({
252
294
  title: 'Host Mapper',
@@ -255,7 +297,7 @@ exports.HostMapperSchema = zod_1.z
255
297
  '',
256
298
  'Operations run **after** the generator has finished, so they can change or remove anything it produced.',
257
299
  '',
258
- 'The source for `copy` is always the raw inbound of the config profile this host belongs to.',
300
+ 'The source for `copy` is the raw inbound of the config profile this host belongs to, or the host itself when the path starts with `$host.`.',
259
301
  '',
260
302
  '> `to` is never checked against the target client. A misspelled key is written exactly like a real one.',
261
303
  ].join('\n'),
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HostsSchema = void 0;
3
+ exports.HostInternalSquadsSchema = 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");
@@ -39,7 +39,19 @@ exports.HostsSchema = zod_1.z.object({
39
39
  mihomoIpVersion: zod_1.z.enum(hosts_1.MIHOMO_IP_VERSION).nullable(),
40
40
  nodes: zod_1.z.array(zod_1.z.uuid()),
41
41
  xrayJsonTemplateUuid: zod_1.z.uuid().nullable(),
42
- excludedInternalSquads: zod_1.z.array(zod_1.z.uuid()),
43
42
  excludeFromSubscriptionTypes: zod_1.z.array(zod_1.z.enum(constants_1.SUBSCRIPTION_TEMPLATE_TYPE)),
44
43
  mapper: host_mapper_1.HostMapperSchema,
44
+ internalSquads: zod_1.z.object({
45
+ mode: zod_1.z.enum(hosts_1.INTERNAL_SQUADS_MODE),
46
+ squads: zod_1.z.array(zod_1.z.uuid()),
47
+ }),
48
+ });
49
+ exports.HostInternalSquadsSchema = zod_1.z
50
+ .object({
51
+ mode: zod_1.z.enum(hosts_1.INTERNAL_SQUADS_MODE),
52
+ squads: zod_1.z.array(zod_1.z.uuid()),
53
+ })
54
+ .refine((v) => v.mode !== hosts_1.INTERNAL_SQUADS_MODE.ALLOW_ONLY || v.squads.length > 0, {
55
+ error: 'At least one internal squad is required in ALLOW_ONLY mode',
56
+ path: ['squads'],
45
57
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "3.4.1",
3
+ "version": "3.4.3",
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",