@remnawave/backend-contract 0.3.41 → 0.3.43

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.
@@ -18,6 +18,7 @@ export declare const USERS_ROUTES: {
18
18
  readonly RESET_TRAFFIC: "bulk/reset-traffic";
19
19
  readonly REVOKE_SUBSCRIPTION: "bulk/revoke-subscription";
20
20
  readonly DELETE: "bulk/delete";
21
+ readonly UPDATE_INBOUNDS: "bulk/update-inbounds";
21
22
  };
22
23
  readonly GET_BY_TELEGRAM_ID: "tg";
23
24
  readonly GET_BY_EMAIL: "email";
@@ -1 +1 @@
1
- {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../api/controllers/users.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;CAsBf,CAAC"}
1
+ {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../api/controllers/users.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;CAuBf,CAAC"}
@@ -21,6 +21,7 @@ exports.USERS_ROUTES = {
21
21
  RESET_TRAFFIC: 'bulk/reset-traffic',
22
22
  REVOKE_SUBSCRIPTION: 'bulk/revoke-subscription',
23
23
  DELETE: 'bulk/delete',
24
+ UPDATE_INBOUNDS: 'bulk/update-inbounds',
24
25
  },
25
26
  GET_BY_TELEGRAM_ID: 'tg',
26
27
  GET_BY_EMAIL: 'email',
@@ -64,6 +64,7 @@ export declare const REST_API: {
64
64
  readonly RESET_TRAFFIC: "/api/users/bulk/reset-traffic";
65
65
  readonly REVOKE_SUBSCRIPTION: "/api/users/bulk/revoke-subscription";
66
66
  readonly DELETE: "/api/users/bulk/delete";
67
+ readonly UPDATE_INBOUNDS: "/api/users/bulk/update-inbounds";
67
68
  };
68
69
  readonly GET_BY_TELEGRAM_ID: (telegramId: string) => string;
69
70
  readonly GET_BY_EMAIL: (email: string) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AACpC,eAAO,MAAM,YAAY,EAAG,UAAmB,CAAC;AAChD,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AAEjD,eAAO,MAAM,QAAQ;;;;;;;;gCAQE,MAAM;;;;;;;;gCASN,MAAM;;;iCAIL,MAAM;iCAEN,MAAM;iCAEN,MAAM;gCAEP,MAAM;;;;;;;;;;;;;;kDAeY,MAAM;;;;;;;;;;qCAWnB,MAAM;gDAEK,MAAM;6CAET,MAAM;8DAEW,MAAM;6CAEvB,MAAM;sCAEb,MAAM;qCAEP,MAAM;qCAEN,MAAM;;;4CAIC,MAAM;;;;;;;;kDASA,MAAM;uCAEjB,MAAM;;;kCAIX,MAAM;0CAEE,MAAM;uCAET,MAAM;;;;;;;;gCASb,MAAM;iCAEL,MAAM;;;;;;;;;;;;;;;0CAgBG,MAAM;;;;;;;CAQ7B,CAAC"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AACpC,eAAO,MAAM,YAAY,EAAG,UAAmB,CAAC;AAChD,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AAEjD,eAAO,MAAM,QAAQ;;;;;;;;gCAQE,MAAM;;;;;;;;gCASN,MAAM;;;iCAIL,MAAM;iCAEN,MAAM;iCAEN,MAAM;gCAEP,MAAM;;;;;;;;;;;;;;kDAeY,MAAM;;;;;;;;;;qCAWnB,MAAM;gDAEK,MAAM;6CAET,MAAM;8DAEW,MAAM;6CAEvB,MAAM;sCAEb,MAAM;qCAEP,MAAM;qCAEN,MAAM;;;4CAIC,MAAM;;;;;;;;;kDAUA,MAAM;uCAEjB,MAAM;;;kCAIX,MAAM;0CAEE,MAAM;uCAET,MAAM;;;;;;;;gCASb,MAAM;iCAEL,MAAM;;;;;;;;;;;;;;;0CAgBG,MAAM;;;;;;;CAQ7B,CAAC"}
@@ -101,6 +101,7 @@ exports.REST_API = {
101
101
  RESET_TRAFFIC: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.RESET_TRAFFIC}`,
102
102
  REVOKE_SUBSCRIPTION: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.REVOKE_SUBSCRIPTION}`,
103
103
  DELETE: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.DELETE}`,
104
+ UPDATE_INBOUNDS: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.UPDATE_INBOUNDS}`,
104
105
  },
105
106
  GET_BY_TELEGRAM_ID: (telegramId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_TELEGRAM_ID}/${telegramId}`,
106
107
  GET_BY_EMAIL: (email) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_EMAIL}/${email}`,
@@ -12,7 +12,7 @@ var RegisterCommand;
12
12
  password: zod_1.z
13
13
  .string()
14
14
  .min(24, 'Password must contain at least 24 characters')
15
- .regex(/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9]).{24,}$/, 'Password must contain uppercase and lowercase letters and numbers'),
15
+ .regex(/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9]).{24,}$/, 'Password must contain uppercase and lowercase letters and numbers, and be at least 24 characters long.'),
16
16
  });
17
17
  RegisterCommand.ResponseSchema = zod_1.z.object({
18
18
  response: zod_1.z.object({
@@ -0,0 +1,35 @@
1
+ import { z } from 'zod';
2
+ export declare namespace BulkUpdateUsersInboundsCommand {
3
+ const url: "/api/users/bulk/update-inbounds";
4
+ const TSQ_url: "/api/users/bulk/update-inbounds";
5
+ const RequestSchema: z.ZodObject<{
6
+ uuids: z.ZodArray<z.ZodString, "many">;
7
+ activeUserInbounds: z.ZodArray<z.ZodString, "many">;
8
+ }, "strip", z.ZodTypeAny, {
9
+ activeUserInbounds: string[];
10
+ uuids: string[];
11
+ }, {
12
+ activeUserInbounds: string[];
13
+ uuids: string[];
14
+ }>;
15
+ type Request = z.infer<typeof RequestSchema>;
16
+ const ResponseSchema: z.ZodObject<{
17
+ response: z.ZodObject<{
18
+ affectedRows: z.ZodNumber;
19
+ }, "strip", z.ZodTypeAny, {
20
+ affectedRows: number;
21
+ }, {
22
+ affectedRows: number;
23
+ }>;
24
+ }, "strip", z.ZodTypeAny, {
25
+ response: {
26
+ affectedRows: number;
27
+ };
28
+ }, {
29
+ response: {
30
+ affectedRows: number;
31
+ };
32
+ }>;
33
+ type Response = z.infer<typeof ResponseSchema>;
34
+ }
35
+ //# sourceMappingURL=bulk-update-users-inbounds.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulk-update-users-inbounds.command.d.ts","sourceRoot":"","sources":["../../../../../commands/users/bulk/bulk-update-users-inbounds.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,yBAAiB,8BAA8B,CAAC;IACrC,MAAM,GAAG,mCAAsC,CAAC;IAChD,MAAM,OAAO,mCAAM,CAAC;IAEpB,MAAM,aAAa;;;;;;;;;MAKxB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;MAIzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BulkUpdateUsersInboundsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../../api");
6
+ var BulkUpdateUsersInboundsCommand;
7
+ (function (BulkUpdateUsersInboundsCommand) {
8
+ BulkUpdateUsersInboundsCommand.url = api_1.REST_API.USERS.BULK.UPDATE_INBOUNDS;
9
+ BulkUpdateUsersInboundsCommand.TSQ_url = BulkUpdateUsersInboundsCommand.url;
10
+ BulkUpdateUsersInboundsCommand.RequestSchema = zod_1.z.object({
11
+ uuids: zod_1.z.array(zod_1.z.string().uuid()),
12
+ activeUserInbounds: zod_1.z.array(zod_1.z.string().uuid(), {
13
+ invalid_type_error: 'Enabled inbounds must be an array of UUIDs',
14
+ }),
15
+ });
16
+ BulkUpdateUsersInboundsCommand.ResponseSchema = zod_1.z.object({
17
+ response: zod_1.z.object({
18
+ affectedRows: zod_1.z.number(),
19
+ }),
20
+ });
21
+ })(BulkUpdateUsersInboundsCommand || (exports.BulkUpdateUsersInboundsCommand = BulkUpdateUsersInboundsCommand = {}));
@@ -2,5 +2,6 @@ export * from './bulk-delete-users-by-status.command';
2
2
  export * from './bulk-delete-users.command';
3
3
  export * from './bulk-reset-traffic-users.command';
4
4
  export * from './bulk-revoke-users-subscription.command';
5
+ export * from './bulk-update-users-inbounds.command';
5
6
  export * from './bulk-update-users.command';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../commands/users/bulk/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC;AACtD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,0CAA0C,CAAC;AACzD,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../commands/users/bulk/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC;AACtD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,cAAc,6BAA6B,CAAC"}
@@ -18,4 +18,5 @@ __exportStar(require("./bulk-delete-users-by-status.command"), exports);
18
18
  __exportStar(require("./bulk-delete-users.command"), exports);
19
19
  __exportStar(require("./bulk-reset-traffic-users.command"), exports);
20
20
  __exportStar(require("./bulk-revoke-users-subscription.command"), exports);
21
+ __exportStar(require("./bulk-update-users-inbounds.command"), exports);
21
22
  __exportStar(require("./bulk-update-users.command"), exports);
@@ -459,5 +459,10 @@ export declare const ERRORS: {
459
459
  readonly message: "Bulk update users error";
460
460
  readonly httpCode: 500;
461
461
  };
462
+ readonly BULK_ADD_INBOUNDS_TO_USERS_ERROR: {
463
+ readonly code: "A088";
464
+ readonly message: "Bulk add inbounds to users error";
465
+ readonly httpCode: 500;
466
+ };
462
467
  };
463
468
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAwJY,MAAM;;;;;;;;;;wCAUN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA4IN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgI3B,CAAC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAwJY,MAAM;;;;;;;;;;wCAUN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA4IN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqI3B,CAAC"}
@@ -430,4 +430,9 @@ exports.ERRORS = {
430
430
  message: 'Bulk update users error',
431
431
  httpCode: 500,
432
432
  },
433
+ BULK_ADD_INBOUNDS_TO_USERS_ERROR: {
434
+ code: 'A088',
435
+ message: 'Bulk add inbounds to users error',
436
+ httpCode: 500,
437
+ },
433
438
  };
@@ -21,6 +21,7 @@ exports.USERS_ROUTES = {
21
21
  RESET_TRAFFIC: 'bulk/reset-traffic',
22
22
  REVOKE_SUBSCRIPTION: 'bulk/revoke-subscription',
23
23
  DELETE: 'bulk/delete',
24
+ UPDATE_INBOUNDS: 'bulk/update-inbounds',
24
25
  },
25
26
  GET_BY_TELEGRAM_ID: 'tg',
26
27
  GET_BY_EMAIL: 'email',
@@ -101,6 +101,7 @@ exports.REST_API = {
101
101
  RESET_TRAFFIC: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.RESET_TRAFFIC}`,
102
102
  REVOKE_SUBSCRIPTION: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.REVOKE_SUBSCRIPTION}`,
103
103
  DELETE: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.DELETE}`,
104
+ UPDATE_INBOUNDS: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.UPDATE_INBOUNDS}`,
104
105
  },
105
106
  GET_BY_TELEGRAM_ID: (telegramId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_TELEGRAM_ID}/${telegramId}`,
106
107
  GET_BY_EMAIL: (email) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_EMAIL}/${email}`,
@@ -12,7 +12,7 @@ var RegisterCommand;
12
12
  password: zod_1.z
13
13
  .string()
14
14
  .min(24, 'Password must contain at least 24 characters')
15
- .regex(/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9]).{24,}$/, 'Password must contain uppercase and lowercase letters and numbers'),
15
+ .regex(/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9]).{24,}$/, 'Password must contain uppercase and lowercase letters and numbers, and be at least 24 characters long.'),
16
16
  });
17
17
  RegisterCommand.ResponseSchema = zod_1.z.object({
18
18
  response: zod_1.z.object({
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BulkUpdateUsersInboundsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../../api");
6
+ var BulkUpdateUsersInboundsCommand;
7
+ (function (BulkUpdateUsersInboundsCommand) {
8
+ BulkUpdateUsersInboundsCommand.url = api_1.REST_API.USERS.BULK.UPDATE_INBOUNDS;
9
+ BulkUpdateUsersInboundsCommand.TSQ_url = BulkUpdateUsersInboundsCommand.url;
10
+ BulkUpdateUsersInboundsCommand.RequestSchema = zod_1.z.object({
11
+ uuids: zod_1.z.array(zod_1.z.string().uuid()),
12
+ activeUserInbounds: zod_1.z.array(zod_1.z.string().uuid(), {
13
+ invalid_type_error: 'Enabled inbounds must be an array of UUIDs',
14
+ }),
15
+ });
16
+ BulkUpdateUsersInboundsCommand.ResponseSchema = zod_1.z.object({
17
+ response: zod_1.z.object({
18
+ affectedRows: zod_1.z.number(),
19
+ }),
20
+ });
21
+ })(BulkUpdateUsersInboundsCommand || (exports.BulkUpdateUsersInboundsCommand = BulkUpdateUsersInboundsCommand = {}));
@@ -18,4 +18,5 @@ __exportStar(require("./bulk-delete-users-by-status.command"), exports);
18
18
  __exportStar(require("./bulk-delete-users.command"), exports);
19
19
  __exportStar(require("./bulk-reset-traffic-users.command"), exports);
20
20
  __exportStar(require("./bulk-revoke-users-subscription.command"), exports);
21
+ __exportStar(require("./bulk-update-users-inbounds.command"), exports);
21
22
  __exportStar(require("./bulk-update-users.command"), exports);
@@ -430,4 +430,9 @@ exports.ERRORS = {
430
430
  message: 'Bulk update users error',
431
431
  httpCode: 500,
432
432
  },
433
+ BULK_ADD_INBOUNDS_TO_USERS_ERROR: {
434
+ code: 'A088',
435
+ message: 'Bulk add inbounds to users error',
436
+ httpCode: 500,
437
+ },
433
438
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "0.3.41",
3
+ "version": "0.3.43",
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.",