@remnawave/backend-contract 2.1.31 → 2.1.34

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 (52) hide show
  1. package/build/backend/api/controllers/hwid.d.ts +1 -0
  2. package/build/backend/api/controllers/hwid.d.ts.map +1 -1
  3. package/build/backend/api/controllers/hwid.js +1 -0
  4. package/build/backend/api/controllers/subscription.d.ts +0 -1
  5. package/build/backend/api/controllers/subscription.d.ts.map +1 -1
  6. package/build/backend/api/controllers/subscription.js +0 -1
  7. package/build/backend/api/controllers/subscriptions.d.ts +1 -0
  8. package/build/backend/api/controllers/subscriptions.d.ts.map +1 -1
  9. package/build/backend/api/controllers/subscriptions.js +1 -0
  10. package/build/backend/api/controllers-info.d.ts +79 -0
  11. package/build/backend/api/controllers-info.d.ts.map +1 -0
  12. package/build/backend/api/controllers-info.js +81 -0
  13. package/build/backend/api/index.d.ts +1 -0
  14. package/build/backend/api/index.d.ts.map +1 -1
  15. package/build/backend/api/index.js +1 -0
  16. package/build/backend/api/routes.d.ts +2 -1
  17. package/build/backend/api/routes.d.ts.map +1 -1
  18. package/build/backend/api/routes.js +2 -1
  19. package/build/backend/commands/hwid/delete-all-user-hwid-devices.command.d.ts +101 -0
  20. package/build/backend/commands/hwid/delete-all-user-hwid-devices.command.d.ts.map +1 -0
  21. package/build/backend/commands/hwid/delete-all-user-hwid-devices.command.js +22 -0
  22. package/build/backend/commands/hwid/index.d.ts +1 -0
  23. package/build/backend/commands/hwid/index.d.ts.map +1 -1
  24. package/build/backend/commands/hwid/index.js +1 -0
  25. package/build/backend/commands/subscription/get-subscription-info-by-short-uuid.command.js +1 -1
  26. package/build/backend/commands/subscription/index.d.ts +1 -1
  27. package/build/backend/commands/subscription/index.d.ts.map +1 -1
  28. package/build/backend/commands/subscription/index.js +1 -1
  29. package/build/backend/commands/{subscription → subscriptions/get-by}/get-raw-subscription-by-short-uuid.command.d.ts +302 -71
  30. package/build/backend/commands/subscriptions/get-by/get-raw-subscription-by-short-uuid.command.d.ts.map +1 -0
  31. package/build/backend/commands/{subscription → subscriptions/get-by}/get-raw-subscription-by-short-uuid.command.js +10 -23
  32. package/build/backend/commands/subscriptions/get-by/index.d.ts +1 -0
  33. package/build/backend/commands/subscriptions/get-by/index.d.ts.map +1 -1
  34. package/build/backend/commands/subscriptions/get-by/index.js +1 -0
  35. package/build/backend/constants/errors/errors.d.ts +5 -0
  36. package/build/backend/constants/errors/errors.d.ts.map +1 -1
  37. package/build/backend/constants/errors/errors.js +5 -0
  38. package/build/frontend/api/controllers/hwid.js +1 -0
  39. package/build/frontend/api/controllers/subscription.js +0 -1
  40. package/build/frontend/api/controllers/subscriptions.js +1 -0
  41. package/build/frontend/api/controllers-info.js +81 -0
  42. package/build/frontend/api/index.js +1 -0
  43. package/build/frontend/api/routes.js +2 -1
  44. package/build/frontend/commands/hwid/delete-all-user-hwid-devices.command.js +22 -0
  45. package/build/frontend/commands/hwid/index.js +1 -0
  46. package/build/frontend/commands/subscription/get-subscription-info-by-short-uuid.command.js +1 -1
  47. package/build/frontend/commands/subscription/index.js +1 -1
  48. package/build/frontend/commands/{subscription → subscriptions/get-by}/get-raw-subscription-by-short-uuid.command.js +10 -23
  49. package/build/frontend/commands/subscriptions/get-by/index.js +1 -0
  50. package/build/frontend/constants/errors/errors.js +5 -0
  51. package/package.json +1 -1
  52. package/build/backend/commands/subscription/get-raw-subscription-by-short-uuid.command.d.ts.map +0 -1
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CONTROLLERS_INFO = void 0;
4
+ exports.CONTROLLERS_INFO = {
5
+ AUTH: {
6
+ tag: 'Auth Controller',
7
+ description: 'Used to authenticate admin users.',
8
+ },
9
+ API_TOKENS: {
10
+ tag: 'API Tokens Controller',
11
+ description: "Manage API tokens to use in your code. This controller can't be used with API token, only with Admin JWT token",
12
+ },
13
+ USERS: {
14
+ tag: 'Users Controller',
15
+ description: 'Manage users, change their status, reset traffic, etc.',
16
+ },
17
+ USERS_BULK_ACTIONS: {
18
+ tag: 'Users Bulk Actions Controller',
19
+ description: 'Bulk actions with users.',
20
+ },
21
+ USERS_STATS: {
22
+ tag: 'Users Stats Controller',
23
+ description: '',
24
+ },
25
+ HWID_USER_DEVICES: {
26
+ tag: 'HWID User Devices Controller',
27
+ description: '',
28
+ },
29
+ SUBSCRIPTION: {
30
+ tag: '[Public] Subscription Controller',
31
+ description: 'Public Subscription Controller. Methods of this controller are not protected with auth. Use it only for public requests.',
32
+ },
33
+ SUBSCRIPTIONS: {
34
+ tag: '[Protected] Subscriptions Controller',
35
+ description: 'Methods of this controller are protected with auth, most of them is returning the same informations as public Subscription Controller.',
36
+ },
37
+ CONFIG_PROFILES: {
38
+ tag: 'Config Profiles Controller',
39
+ description: 'Management of Config Profiles.',
40
+ },
41
+ INTERNAL_SQUADS: {
42
+ tag: 'Internal Squads Controller',
43
+ description: 'Management of Internal Squads.',
44
+ },
45
+ NODES: {
46
+ tag: 'Nodes Controller',
47
+ description: '',
48
+ },
49
+ HOSTS: {
50
+ tag: 'Hosts Controller',
51
+ description: '',
52
+ },
53
+ HOSTS_BULK_ACTIONS: {
54
+ tag: 'Hosts Bulk Actions Controller',
55
+ description: '',
56
+ },
57
+ SUBSCRIPTION_TEMPLATE: {
58
+ tag: 'Subscription Template Controller',
59
+ description: '',
60
+ },
61
+ SUBSCRIPTION_SETTINGS: {
62
+ tag: 'Subscription Settings Controller',
63
+ description: '',
64
+ },
65
+ INFRA_BILLING: {
66
+ tag: 'Infra Billing Controller',
67
+ description: '',
68
+ },
69
+ SYSTEM: {
70
+ tag: 'System Controller',
71
+ description: '',
72
+ },
73
+ BANDWIDTH_STATS: {
74
+ tag: 'Bandwidth Stats Controller',
75
+ description: '',
76
+ },
77
+ KEYGEN: {
78
+ tag: 'Keygen Controller',
79
+ description: 'Generation of SSL_CERT for Remnawave Node.',
80
+ },
81
+ };
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./controllers"), exports);
18
+ __exportStar(require("./controllers-info"), exports);
18
19
  __exportStar(require("./routes"), exports);
@@ -121,7 +121,6 @@ exports.REST_API = {
121
121
  GET: (shortUuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.GET}${shortUuid}`,
122
122
  GET_OUTLINE: (shortUuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.GET_OUTLINE}/${shortUuid}`,
123
123
  GET_INFO: (shortUuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.GET_INFO(shortUuid)}`,
124
- GET_RAW: (shortUuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.GET_RAW(shortUuid)}`,
125
124
  },
126
125
  HOSTS: {
127
126
  CREATE: `${exports.ROOT}/${CONTROLLERS.HOSTS_CONTROLLER}/${CONTROLLERS.HOSTS_ROUTES.CREATE}`,
@@ -167,6 +166,7 @@ exports.REST_API = {
167
166
  CREATE_USER_HWID_DEVICE: `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.CREATE_USER_HWID_DEVICE}`,
168
167
  GET_USER_HWID_DEVICES: (userUuid) => `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.GET_USER_HWID_DEVICES(userUuid)}`,
169
168
  DELETE_USER_HWID_DEVICE: `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.DELETE_USER_HWID_DEVICE}`,
169
+ DELETE_ALL_USER_HWID_DEVICES: `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.DELETE_ALL_USER_HWID_DEVICES}`,
170
170
  },
171
171
  SUBSCRIPTIONS: {
172
172
  GET: `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTIONS_CONTROLLER}/${CONTROLLERS.SUBSCRIPTIONS_ROUTES.GET}`,
@@ -174,6 +174,7 @@ exports.REST_API = {
174
174
  USERNAME: (username) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTIONS_CONTROLLER}/${CONTROLLERS.SUBSCRIPTIONS_ROUTES.GET_BY.USERNAME(username)}`,
175
175
  UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTIONS_CONTROLLER}/${CONTROLLERS.SUBSCRIPTIONS_ROUTES.GET_BY.UUID(uuid)}`,
176
176
  SHORT_UUID: (shortUuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTIONS_CONTROLLER}/${CONTROLLERS.SUBSCRIPTIONS_ROUTES.GET_BY.SHORT_UUID(shortUuid)}`,
177
+ SHORT_UUID_RAW: (shortUuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTIONS_CONTROLLER}/${CONTROLLERS.SUBSCRIPTIONS_ROUTES.GET_BY.SHORT_UUID_RAW(shortUuid)}`,
177
178
  },
178
179
  },
179
180
  CONFIG_PROFILES: {
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteAllUserHwidDevicesCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../constants");
6
+ const models_1 = require("../../models");
7
+ const api_1 = require("../../api");
8
+ var DeleteAllUserHwidDevicesCommand;
9
+ (function (DeleteAllUserHwidDevicesCommand) {
10
+ DeleteAllUserHwidDevicesCommand.url = api_1.REST_API.HWID.DELETE_ALL_USER_HWID_DEVICES;
11
+ DeleteAllUserHwidDevicesCommand.TSQ_url = DeleteAllUserHwidDevicesCommand.url;
12
+ DeleteAllUserHwidDevicesCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.HWID_ROUTES.DELETE_ALL_USER_HWID_DEVICES, 'post', 'Delete all user HWID devices');
13
+ DeleteAllUserHwidDevicesCommand.RequestSchema = zod_1.z.object({
14
+ userUuid: zod_1.z.string().uuid(),
15
+ });
16
+ DeleteAllUserHwidDevicesCommand.ResponseSchema = zod_1.z.object({
17
+ response: zod_1.z.object({
18
+ total: zod_1.z.number(),
19
+ devices: zod_1.z.array(models_1.HwidUserDeviceSchema),
20
+ }),
21
+ });
22
+ })(DeleteAllUserHwidDevicesCommand || (exports.DeleteAllUserHwidDevicesCommand = DeleteAllUserHwidDevicesCommand = {}));
@@ -15,5 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./create-user-hwid-device.command"), exports);
18
+ __exportStar(require("./delete-all-user-hwid-devices.command"), exports);
18
19
  __exportStar(require("./delete-user-hwid-device.command"), exports);
19
20
  __exportStar(require("./get-user-hwid-devices.command"), exports);
@@ -9,7 +9,7 @@ var GetSubscriptionInfoByShortUuidCommand;
9
9
  (function (GetSubscriptionInfoByShortUuidCommand) {
10
10
  GetSubscriptionInfoByShortUuidCommand.url = api_1.REST_API.SUBSCRIPTION.GET_INFO;
11
11
  GetSubscriptionInfoByShortUuidCommand.TSQ_url = GetSubscriptionInfoByShortUuidCommand.url(':shortUuid');
12
- GetSubscriptionInfoByShortUuidCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SUBSCRIPTION_ROUTES.GET_INFO(':shortUuid'), 'get', 'Public endpoint: Get Subscription Info by Short UUID');
12
+ GetSubscriptionInfoByShortUuidCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SUBSCRIPTION_ROUTES.GET_INFO(':shortUuid'), 'get', 'Get Subscription Info by Short UUID');
13
13
  GetSubscriptionInfoByShortUuidCommand.RequestSchema = zod_1.z.object({
14
14
  shortUuid: zod_1.z.string(),
15
15
  });
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("../subscriptions/get-by/get-raw-subscription-by-short-uuid.command"), exports);
17
18
  __exportStar(require("./get-outline-subscription-by-short-uuid.command"), exports);
18
- __exportStar(require("./get-raw-subscription-by-short-uuid.command"), exports);
19
19
  __exportStar(require("./get-subscription-by-short-uuid-by-client-type.command"), exports);
20
20
  __exportStar(require("./get-subscription-by-short-uuid.command"), exports);
21
21
  __exportStar(require("./get-subscription-info-by-short-uuid.command"), exports);
@@ -2,14 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetRawSubscriptionByShortUuidCommand = void 0;
4
4
  const zod_1 = require("zod");
5
- const constants_1 = require("../../constants");
6
- const api_1 = require("../../api");
7
- const constants_2 = require("../../constants");
5
+ const api_1 = require("../../../api");
6
+ const constants_1 = require("../../../constants");
7
+ const models_1 = require("../../../models");
8
8
  var GetRawSubscriptionByShortUuidCommand;
9
9
  (function (GetRawSubscriptionByShortUuidCommand) {
10
- GetRawSubscriptionByShortUuidCommand.url = api_1.REST_API.SUBSCRIPTION.GET_RAW;
10
+ GetRawSubscriptionByShortUuidCommand.url = api_1.REST_API.SUBSCRIPTIONS.GET_BY.SHORT_UUID_RAW;
11
11
  GetRawSubscriptionByShortUuidCommand.TSQ_url = GetRawSubscriptionByShortUuidCommand.url(':shortUuid');
12
- GetRawSubscriptionByShortUuidCommand.endpointDetails = (0, constants_2.getEndpointDetails)(api_1.SUBSCRIPTION_ROUTES.GET_RAW(':shortUuid'), 'get', 'Get Raw Subscription by Short UUID');
12
+ GetRawSubscriptionByShortUuidCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SUBSCRIPTIONS_ROUTES.GET_BY.SHORT_UUID_RAW(':shortUuid'), 'get', 'Get Raw Subscription by Short UUID');
13
13
  GetRawSubscriptionByShortUuidCommand.RequestSchema = zod_1.z.object({
14
14
  shortUuid: zod_1.z.string(),
15
15
  });
@@ -22,26 +22,15 @@ var GetRawSubscriptionByShortUuidCommand;
22
22
  });
23
23
  GetRawSubscriptionByShortUuidCommand.ResponseSchema = zod_1.z.object({
24
24
  response: zod_1.z.object({
25
- user: zod_1.z.object({
26
- shortUuid: zod_1.z.string(),
25
+ user: models_1.ExtendedUsersSchema,
26
+ convertedUserInfo: zod_1.z.object({
27
27
  daysLeft: zod_1.z.number(),
28
- trafficUsed: zod_1.z.string(),
29
28
  trafficLimit: zod_1.z.string(),
29
+ trafficUsed: zod_1.z.string(),
30
30
  lifetimeTrafficUsed: zod_1.z.string(),
31
- trafficUsedBytes: zod_1.z.string(),
32
- trafficLimitBytes: zod_1.z.string(),
33
- lifetimeTrafficUsedBytes: zod_1.z.string(),
34
- username: zod_1.z.string(),
35
- expiresAt: zod_1.z
36
- .string()
37
- .datetime()
38
- .transform((str) => new Date(str)),
39
- isActive: zod_1.z.boolean(),
40
- userStatus: zod_1.z.nativeEnum(constants_1.USERS_STATUS),
41
- trafficLimitStrategy: zod_1.z.nativeEnum(constants_1.RESET_PERIODS),
42
- tag: zod_1.z.nullable(zod_1.z.string()),
31
+ isHwidLimited: zod_1.z.boolean(),
43
32
  }),
44
- subscriptionUrl: zod_1.z.string(),
33
+ headers: zod_1.z.record(zod_1.z.string(), zod_1.z.string().optional()),
45
34
  rawHosts: zod_1.z.array(zod_1.z.object({
46
35
  address: zod_1.z.optional(zod_1.z.nullable(zod_1.z.string())),
47
36
  alpn: zod_1.z.optional(zod_1.z.nullable(zod_1.z.string())),
@@ -91,8 +80,6 @@ var GetRawSubscriptionByShortUuidCommand;
91
80
  vlessRouteId: zod_1.z.number().int().nullable(),
92
81
  })),
93
82
  })),
94
- headers: zod_1.z.record(zod_1.z.string(), zod_1.z.string()),
95
- isHwidLimited: zod_1.z.boolean(),
96
83
  }),
97
84
  });
98
85
  })(GetRawSubscriptionByShortUuidCommand || (exports.GetRawSubscriptionByShortUuidCommand = GetRawSubscriptionByShortUuidCommand = {}));
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./get-raw-subscription-by-short-uuid.command"), exports);
17
18
  __exportStar(require("./get-subscription-by-short-uuid-protected.command"), exports);
18
19
  __exportStar(require("./get-subscription-by-username.command"), exports);
19
20
  __exportStar(require("./get-subscription-by-uuid.command"), exports);
@@ -770,4 +770,9 @@ exports.ERRORS = {
770
770
  message: 'Get internal squad accessible nodes error',
771
771
  httpCode: 500,
772
772
  },
773
+ DELETE_HWID_USER_DEVICES_ERROR: {
774
+ code: 'A155',
775
+ message: 'Delete hwid user devices error',
776
+ httpCode: 500,
777
+ },
773
778
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "2.1.31",
3
+ "version": "2.1.34",
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.",
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-raw-subscription-by-short-uuid.command.d.ts","sourceRoot":"","sources":["../../../../commands/subscription/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,+BAAgC,CAAC;IAC1C,MAAM,OAAO,QAAoB,CAAC;IAElC,MAAM,eAAe,2CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;MAExB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,kBAAkB;;;;;;MAM7B,CAAC;IAEH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAEvD,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA0FzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}