Skip to content

Commit c737ae7

Browse files
committed
chore: bump backend-contract version to 2.1.62 and add shuffleHost and mihomoX25519 fields
- Added optional shuffleHost and mihomoX25519 fields to various command schemas and response models. - Enhanced the FormatHostsService to support shuffling hosts based on the new shuffleHost field.
1 parent 3a97a89 commit c737ae7

File tree

17 files changed

+128
-4
lines changed

17 files changed

+128
-4
lines changed

libs/contract/commands/hosts/create.command.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ export namespace CreateHostCommand {
7474
overrideSniFromAddress: z.optional(z.boolean().default(false)),
7575
allowInsecure: z.optional(z.boolean().default(false)),
7676
vlessRouteId: z.optional(z.number().int().min(0).max(65535).nullable()),
77+
shuffleHost: z.optional(z.boolean().default(false)),
78+
mihomoX25519: z.optional(z.boolean().default(false)),
7779
});
7880

7981
export type Request = z.infer<typeof RequestSchema>;

libs/contract/commands/hosts/update.command.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ export namespace UpdateHostCommand {
7878
overrideSniFromAddress: z.optional(z.boolean()),
7979
vlessRouteId: z.optional(z.number().int().min(0).max(65535).nullable()),
8080
allowInsecure: z.optional(z.boolean()),
81+
shuffleHost: z.optional(z.boolean()),
82+
mihomoX25519: z.optional(z.boolean()),
8183
});
8284
export type Request = z.infer<typeof RequestSchema>;
8385

libs/contract/commands/subscriptions/get-by/get-raw-subscription-by-short-uuid.command.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ export namespace GetRawSubscriptionByShortUuidCommand {
7777
serverDescription: z.optional(z.nullable(z.string())),
7878
flow: z.optional(z.nullable(z.string())),
7979
allowInsecure: z.optional(z.nullable(z.boolean())),
80+
shuffleHost: z.optional(z.nullable(z.boolean())),
81+
mihomoX25519: z.optional(z.nullable(z.boolean())),
8082
protocolOptions: z.optional(
8183
z.nullable(
8284
z.object({

libs/contract/models/hosts.schema.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ export const HostsSchema = z.object({
3030
overrideSniFromAddress: z.boolean().default(false),
3131
vlessRouteId: z.number().int().nullable(),
3232
allowInsecure: z.boolean().default(false),
33+
shuffleHost: z.boolean(),
34+
mihomoX25519: z.boolean(),
3335
});

libs/contract/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@remnawave/backend-contract",
3-
"version": "2.1.60",
3+
"version": "2.1.62",
44
"public": true,
55
"license": "AGPL-3.0-only",
66
"description": "A contract library for Remnawave Backend. It can be used in backend and frontend.",
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
-- AlterTable
2+
ALTER TABLE "public"."admin" ALTER COLUMN "created_at" SET DEFAULT now(),
3+
ALTER COLUMN "updated_at" SET DEFAULT now();
4+
5+
-- AlterTable
6+
ALTER TABLE "public"."api_tokens" ALTER COLUMN "created_at" SET DEFAULT now(),
7+
ALTER COLUMN "updated_at" SET DEFAULT now();
8+
9+
-- AlterTable
10+
ALTER TABLE "public"."config_profiles" ALTER COLUMN "created_at" SET DEFAULT now(),
11+
ALTER COLUMN "updated_at" SET DEFAULT now();
12+
13+
-- AlterTable
14+
ALTER TABLE "public"."hosts" ADD COLUMN "mihomo_x25519" BOOLEAN NOT NULL DEFAULT false,
15+
ADD COLUMN "shuffle_host" BOOLEAN NOT NULL DEFAULT false;
16+
17+
-- AlterTable
18+
ALTER TABLE "public"."hwid_user_devices" ALTER COLUMN "created_at" SET DEFAULT now(),
19+
ALTER COLUMN "updated_at" SET DEFAULT now();
20+
21+
-- AlterTable
22+
ALTER TABLE "public"."infra_billing_nodes" ALTER COLUMN "created_at" SET DEFAULT now(),
23+
ALTER COLUMN "updated_at" SET DEFAULT now();
24+
25+
-- AlterTable
26+
ALTER TABLE "public"."infra_providers" ALTER COLUMN "created_at" SET DEFAULT now(),
27+
ALTER COLUMN "updated_at" SET DEFAULT now();
28+
29+
-- AlterTable
30+
ALTER TABLE "public"."internal_squads" ALTER COLUMN "created_at" SET DEFAULT now(),
31+
ALTER COLUMN "updated_at" SET DEFAULT now();
32+
33+
-- AlterTable
34+
ALTER TABLE "public"."keygen" ALTER COLUMN "created_at" SET DEFAULT now(),
35+
ALTER COLUMN "updated_at" SET DEFAULT now();
36+
37+
-- AlterTable
38+
ALTER TABLE "public"."nodes" ALTER COLUMN "created_at" SET DEFAULT now(),
39+
ALTER COLUMN "updated_at" SET DEFAULT now();
40+
41+
-- AlterTable
42+
ALTER TABLE "public"."nodes_traffic_usage_history" ALTER COLUMN "reset_at" SET DEFAULT now();
43+
44+
-- AlterTable
45+
ALTER TABLE "public"."nodes_usage_history" ALTER COLUMN "created_at" SET DEFAULT date_trunc('hour', now()),
46+
ALTER COLUMN "updated_at" SET DEFAULT now();
47+
48+
-- AlterTable
49+
ALTER TABLE "public"."nodes_user_usage_history" ALTER COLUMN "updated_at" SET DEFAULT now();
50+
51+
-- AlterTable
52+
ALTER TABLE "public"."subscription_settings" ALTER COLUMN "created_at" SET DEFAULT now(),
53+
ALTER COLUMN "updated_at" SET DEFAULT now();
54+
55+
-- AlterTable
56+
ALTER TABLE "public"."subscription_templates" ALTER COLUMN "created_at" SET DEFAULT now(),
57+
ALTER COLUMN "updated_at" SET DEFAULT now();
58+
59+
-- AlterTable
60+
ALTER TABLE "public"."user_subscription_request_history" ALTER COLUMN "request_at" SET DEFAULT now();
61+
62+
-- AlterTable
63+
ALTER TABLE "public"."user_traffic_history" ALTER COLUMN "reset_at" SET DEFAULT now();
64+
65+
-- AlterTable
66+
ALTER TABLE "public"."users" ALTER COLUMN "created_at" SET DEFAULT now(),
67+
ALTER COLUMN "updated_at" SET DEFAULT now();

prisma/schema.prisma

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ model Hosts {
252252
serverDescription String? @map("server_description")
253253
vlessRouteId Int? @map("vless_route_id")
254254
allowInsecure Boolean @default(false) @map("allow_insecure")
255+
shuffleHost Boolean @default(false) @map("shuffle_host")
256+
mihomoX25519 Boolean @default(false) @map("mihomo_x25519")
255257
256258
tag String? @map("tag")
257259
isHidden Boolean @default(false) @map("is_hidden")

src/modules/hosts/entities/hosts.entity.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export class HostsEntity implements Hosts {
2626

2727
overrideSniFromAddress: boolean;
2828
vlessRouteId: number | null;
29+
shuffleHost: boolean;
30+
mihomoX25519: boolean;
2931

3032
configProfileUuid: string | null;
3133
configProfileInboundUuid: string | null;

src/modules/hosts/hosts.converter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ const entityToModel = (entity: HostsEntity): Hosts => {
3030
sockoptParams: entity.sockoptParams,
3131
serverDescription: entity.serverDescription,
3232
allowInsecure: entity.allowInsecure,
33+
shuffleHost: entity.shuffleHost,
34+
mihomoX25519: entity.mihomoX25519,
3335

3436
tag: entity.tag,
3537
isHidden: entity.isHidden,

src/modules/hosts/models/create-host.response.model.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export class CreateHostResponseModel {
2323
public serverDescription: null | string;
2424
public allowInsecure: boolean;
2525

26+
public shuffleHost: boolean;
27+
public mihomoX25519: boolean;
28+
2629
public tag: null | string;
2730
public isHidden: boolean;
2831

@@ -54,6 +57,8 @@ export class CreateHostResponseModel {
5457
this.sockoptParams = data.sockoptParams;
5558
this.serverDescription = data.serverDescription;
5659
this.allowInsecure = data.allowInsecure;
60+
this.shuffleHost = data.shuffleHost;
61+
this.mihomoX25519 = data.mihomoX25519;
5762

5863
this.tag = data.tag;
5964
this.isHidden = data.isHidden;

0 commit comments

Comments
 (0)