@remnawave/backend-contract 0.3.67 → 0.3.69

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 (22) hide show
  1. package/build/backend/commands/hosts/bulk/set-port-to-many-hosts.command.js +1 -1
  2. package/build/backend/commands/subscription/get-subscription-by-short-uuid-by-client-type.command.d.ts +3 -2
  3. package/build/backend/commands/subscription/get-subscription-by-short-uuid-by-client-type.command.d.ts.map +1 -1
  4. package/build/backend/commands/users/bulk-all/bulk-all-update-users.command.js +1 -1
  5. package/build/backend/commands/users/get-all-users-v2.command.d.ts +4 -4
  6. package/build/backend/commands/users/get-all-users-v2.command.d.ts.map +1 -1
  7. package/build/backend/commands/users/get-all-users-v2.command.js +10 -2
  8. package/build/backend/constants/errors/errors.d.ts +1 -1
  9. package/build/backend/constants/errors/errors.js +1 -1
  10. package/build/backend/constants/subscription-template/template-type/request-template-type.constant.d.ts +2 -1
  11. package/build/backend/constants/subscription-template/template-type/request-template-type.constant.d.ts.map +1 -1
  12. package/build/backend/constants/subscription-template/template-type/request-template-type.constant.js +1 -0
  13. package/build/backend/constants/templates/template-keys.d.ts +1 -1
  14. package/build/backend/constants/templates/template-keys.d.ts.map +1 -1
  15. package/build/backend/constants/templates/template-keys.js +3 -0
  16. package/build/frontend/commands/hosts/bulk/set-port-to-many-hosts.command.js +1 -1
  17. package/build/frontend/commands/users/bulk-all/bulk-all-update-users.command.js +1 -1
  18. package/build/frontend/commands/users/get-all-users-v2.command.js +10 -2
  19. package/build/frontend/constants/errors/errors.js +1 -1
  20. package/build/frontend/constants/subscription-template/template-type/request-template-type.constant.js +1 -0
  21. package/build/frontend/constants/templates/template-keys.js +3 -0
  22. package/package.json +1 -1
@@ -10,7 +10,7 @@ var SetPortToManyHostsCommand;
10
10
  SetPortToManyHostsCommand.TSQ_url = SetPortToManyHostsCommand.url;
11
11
  SetPortToManyHostsCommand.RequestSchema = zod_1.z.object({
12
12
  uuids: zod_1.z.array(zod_1.z.string().uuid()),
13
- port: zod_1.z.number(),
13
+ port: zod_1.z.number().int().min(1).max(65535),
14
14
  });
15
15
  SetPortToManyHostsCommand.ResponseSchema = zod_1.z.object({
16
16
  response: zod_1.z.array(models_1.HostsSchema),
@@ -10,14 +10,15 @@ export declare namespace GetSubscriptionByShortUuidByClientTypeCommand {
10
10
  readonly SINGBOX_LEGACY: "singbox-legacy";
11
11
  readonly MIHOMO: "mihomo";
12
12
  readonly XRAY_JSON: "json";
13
+ readonly V2RAY_JSON: "v2ray-json";
13
14
  readonly CLASH: "clash";
14
15
  }>;
15
16
  }, "strip", z.ZodTypeAny, {
16
17
  shortUuid: string;
17
- clientType: "stash" | "singbox" | "singbox-legacy" | "mihomo" | "json" | "clash";
18
+ clientType: "stash" | "singbox" | "singbox-legacy" | "mihomo" | "json" | "v2ray-json" | "clash";
18
19
  }, {
19
20
  shortUuid: string;
20
- clientType: "stash" | "singbox" | "singbox-legacy" | "mihomo" | "json" | "clash";
21
+ clientType: "stash" | "singbox" | "singbox-legacy" | "mihomo" | "json" | "v2ray-json" | "clash";
21
22
  }>;
22
23
  type Request = z.infer<typeof RequestSchema>;
23
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get-subscription-by-short-uuid-by-client-type.command.d.ts","sourceRoot":"","sources":["../../../../commands/subscription/get-subscription-by-short-uuid-by-client-type.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,yBAAiB,6CAA6C,CAAC;IACpD,MAAM,GAAG,+BAA4B,CAAC;IACtC,MAAM,OAAO,QAAoB,CAAC;IAElC,MAAM,aAAa;;;;;;;;;;;;;;;;MAGxB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;CACvD"}
1
+ {"version":3,"file":"get-subscription-by-short-uuid-by-client-type.command.d.ts","sourceRoot":"","sources":["../../../../commands/subscription/get-subscription-by-short-uuid-by-client-type.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,yBAAiB,6CAA6C,CAAC;IACpD,MAAM,GAAG,+BAA4B,CAAC;IACtC,MAAM,OAAO,QAAoB,CAAC;IAElC,MAAM,aAAa;;;;;;;;;;;;;;;;;MAGxB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;CACvD"}
@@ -16,7 +16,7 @@ var BulkAllUpdateUsersCommand;
16
16
  invalid_type_error: 'Traffic limit must be a number',
17
17
  })
18
18
  .int('Traffic limit must be an integer')
19
- .min(0, 'Traffic limit must be greater than 0')
19
+ .min(0, 'Traffic limit must be 0 or greater')
20
20
  .describe('Traffic limit in bytes. 0 - unlimited')),
21
21
  trafficLimitStrategy: zod_1.z.optional(zod_1.z
22
22
  .nativeEnum(constants_1.RESET_PERIODS, {
@@ -3,8 +3,8 @@ export declare namespace GetAllUsersV2Command {
3
3
  const url: "/api/users/v2";
4
4
  const TSQ_url: "/api/users/v2";
5
5
  const RequestQuerySchema: z.ZodObject<{
6
- start: z.ZodOptional<z.ZodNumber>;
7
- size: z.ZodOptional<z.ZodNumber>;
6
+ start: z.ZodDefault<z.ZodNumber>;
7
+ size: z.ZodDefault<z.ZodNumber>;
8
8
  filters: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodObject<{
9
9
  id: z.ZodString;
10
10
  value: z.ZodUnknown;
@@ -34,8 +34,8 @@ export declare namespace GetAllUsersV2Command {
34
34
  desc: boolean;
35
35
  }[], unknown>>;
36
36
  }, "strip", z.ZodTypeAny, {
37
- start?: number | undefined;
38
- size?: number | undefined;
37
+ start: number;
38
+ size: number;
39
39
  filters?: {
40
40
  id: string;
41
41
  value?: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"get-all-users-v2.command.d.ts","sourceRoot":"","sources":["../../../../commands/users/get-all-users-v2.command.ts"],"names":[],"mappings":"AAAA,OA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAUzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -18,8 +18,16 @@ var GetAllUsersV2Command;
18
18
  desc: zod_1.z.boolean(),
19
19
  });
20
20
  GetAllUsersV2Command.RequestQuerySchema = zod_1.z.object({
21
- start: zod_1.z.coerce.number().optional(),
22
- size: zod_1.z.coerce.number().optional(),
21
+ start: zod_1.z.coerce
22
+ .number()
23
+ .default(0)
24
+ .describe('Start index (offset) of the users to return, default is 0'),
25
+ size: zod_1.z.coerce
26
+ .number()
27
+ .min(1, 'Size (limit) must be greater than 0')
28
+ .max(1000, 'Size (limit) must be less than 1000')
29
+ .describe('Number of users to return, no more than 1000')
30
+ .default(25),
23
31
  filters: zod_1.z
24
32
  .preprocess((str) => (typeof str === 'string' ? JSON.parse(str) : str), zod_1.z.array(FilterSchema))
25
33
  .optional(),
@@ -465,7 +465,7 @@ export declare const ERRORS: {
465
465
  readonly httpCode: 500;
466
466
  };
467
467
  readonly BULK_UPDATE_ALL_USERS_ERROR: {
468
- readonly code: "A087";
468
+ readonly code: "A089";
469
469
  readonly message: "Bulk update all users error";
470
470
  readonly httpCode: 500;
471
471
  };
@@ -436,7 +436,7 @@ exports.ERRORS = {
436
436
  httpCode: 500,
437
437
  },
438
438
  BULK_UPDATE_ALL_USERS_ERROR: {
439
- code: 'A087',
439
+ code: 'A089',
440
440
  message: 'Bulk update all users error',
441
441
  httpCode: 500,
442
442
  },
@@ -4,9 +4,10 @@ export declare const REQUEST_TEMPLATE_TYPE: {
4
4
  readonly SINGBOX_LEGACY: "singbox-legacy";
5
5
  readonly MIHOMO: "mihomo";
6
6
  readonly XRAY_JSON: "json";
7
+ readonly V2RAY_JSON: "v2ray-json";
7
8
  readonly CLASH: "clash";
8
9
  };
9
10
  export type TRequestTemplateType = [keyof typeof REQUEST_TEMPLATE_TYPE][number];
10
- export declare const REQUEST_TEMPLATE_TYPE_VALUES: ("stash" | "singbox" | "singbox-legacy" | "mihomo" | "json" | "clash")[];
11
+ export declare const REQUEST_TEMPLATE_TYPE_VALUES: ("stash" | "singbox" | "singbox-legacy" | "mihomo" | "json" | "v2ray-json" | "clash")[];
11
12
  export type TRequestTemplateTypeKeys = (typeof REQUEST_TEMPLATE_TYPE)[keyof typeof REQUEST_TEMPLATE_TYPE];
12
13
  //# sourceMappingURL=request-template-type.constant.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"request-template-type.constant.d.ts","sourceRoot":"","sources":["../../../../../constants/subscription-template/template-type/request-template-type.constant.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB;;;;;;;CAOxB,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAChF,eAAO,MAAM,4BAA4B,0EAAuC,CAAC;AACjF,MAAM,MAAM,wBAAwB,GAChC,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC"}
1
+ {"version":3,"file":"request-template-type.constant.d.ts","sourceRoot":"","sources":["../../../../../constants/subscription-template/template-type/request-template-type.constant.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB;;;;;;;;CAQxB,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAChF,eAAO,MAAM,4BAA4B,yFAAuC,CAAC;AACjF,MAAM,MAAM,wBAAwB,GAChC,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC"}
@@ -7,6 +7,7 @@ exports.REQUEST_TEMPLATE_TYPE = {
7
7
  SINGBOX_LEGACY: 'singbox-legacy',
8
8
  MIHOMO: 'mihomo',
9
9
  XRAY_JSON: 'json',
10
+ V2RAY_JSON: 'v2ray-json',
10
11
  CLASH: 'clash',
11
12
  };
12
13
  exports.REQUEST_TEMPLATE_TYPE_VALUES = Object.values(exports.REQUEST_TEMPLATE_TYPE);
@@ -1,3 +1,3 @@
1
- export declare const TEMPLATE_KEYS: readonly ["DAYS_LEFT", "TRAFFIC_USED", "TRAFFIC_LEFT", "STATUS", "TOTAL_TRAFFIC"];
1
+ export declare const TEMPLATE_KEYS: readonly ["DAYS_LEFT", "TRAFFIC_USED", "TRAFFIC_LEFT", "STATUS", "TOTAL_TRAFFIC", "USERNAME", "EMAIL", "TELEGRAM_ID"];
2
2
  export type TemplateKeys = (typeof TEMPLATE_KEYS)[number];
3
3
  //# sourceMappingURL=template-keys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"template-keys.d.ts","sourceRoot":"","sources":["../../../../constants/templates/template-keys.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,mFAMhB,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"template-keys.d.ts","sourceRoot":"","sources":["../../../../constants/templates/template-keys.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,uHAShB,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -7,4 +7,7 @@ exports.TEMPLATE_KEYS = [
7
7
  'TRAFFIC_LEFT',
8
8
  'STATUS',
9
9
  'TOTAL_TRAFFIC',
10
+ 'USERNAME',
11
+ 'EMAIL',
12
+ 'TELEGRAM_ID',
10
13
  ];
@@ -10,7 +10,7 @@ var SetPortToManyHostsCommand;
10
10
  SetPortToManyHostsCommand.TSQ_url = SetPortToManyHostsCommand.url;
11
11
  SetPortToManyHostsCommand.RequestSchema = zod_1.z.object({
12
12
  uuids: zod_1.z.array(zod_1.z.string().uuid()),
13
- port: zod_1.z.number(),
13
+ port: zod_1.z.number().int().min(1).max(65535),
14
14
  });
15
15
  SetPortToManyHostsCommand.ResponseSchema = zod_1.z.object({
16
16
  response: zod_1.z.array(models_1.HostsSchema),
@@ -16,7 +16,7 @@ var BulkAllUpdateUsersCommand;
16
16
  invalid_type_error: 'Traffic limit must be a number',
17
17
  })
18
18
  .int('Traffic limit must be an integer')
19
- .min(0, 'Traffic limit must be greater than 0')
19
+ .min(0, 'Traffic limit must be 0 or greater')
20
20
  .describe('Traffic limit in bytes. 0 - unlimited')),
21
21
  trafficLimitStrategy: zod_1.z.optional(zod_1.z
22
22
  .nativeEnum(constants_1.RESET_PERIODS, {
@@ -18,8 +18,16 @@ var GetAllUsersV2Command;
18
18
  desc: zod_1.z.boolean(),
19
19
  });
20
20
  GetAllUsersV2Command.RequestQuerySchema = zod_1.z.object({
21
- start: zod_1.z.coerce.number().optional(),
22
- size: zod_1.z.coerce.number().optional(),
21
+ start: zod_1.z.coerce
22
+ .number()
23
+ .default(0)
24
+ .describe('Start index (offset) of the users to return, default is 0'),
25
+ size: zod_1.z.coerce
26
+ .number()
27
+ .min(1, 'Size (limit) must be greater than 0')
28
+ .max(1000, 'Size (limit) must be less than 1000')
29
+ .describe('Number of users to return, no more than 1000')
30
+ .default(25),
23
31
  filters: zod_1.z
24
32
  .preprocess((str) => (typeof str === 'string' ? JSON.parse(str) : str), zod_1.z.array(FilterSchema))
25
33
  .optional(),
@@ -436,7 +436,7 @@ exports.ERRORS = {
436
436
  httpCode: 500,
437
437
  },
438
438
  BULK_UPDATE_ALL_USERS_ERROR: {
439
- code: 'A087',
439
+ code: 'A089',
440
440
  message: 'Bulk update all users error',
441
441
  httpCode: 500,
442
442
  },
@@ -7,6 +7,7 @@ exports.REQUEST_TEMPLATE_TYPE = {
7
7
  SINGBOX_LEGACY: 'singbox-legacy',
8
8
  MIHOMO: 'mihomo',
9
9
  XRAY_JSON: 'json',
10
+ V2RAY_JSON: 'v2ray-json',
10
11
  CLASH: 'clash',
11
12
  };
12
13
  exports.REQUEST_TEMPLATE_TYPE_VALUES = Object.values(exports.REQUEST_TEMPLATE_TYPE);
@@ -7,4 +7,7 @@ exports.TEMPLATE_KEYS = [
7
7
  'TRAFFIC_LEFT',
8
8
  'STATUS',
9
9
  'TOTAL_TRAFFIC',
10
+ 'USERNAME',
11
+ 'EMAIL',
12
+ 'TELEGRAM_ID',
10
13
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "0.3.67",
3
+ "version": "0.3.69",
4
4
  "public": true,
5
5
  "license": "AGPL-3.0-only",
6
6
  "description": "A contract library for Remnawave Backend. It can be used in backend and frontend.",