@remnawave/backend-contract 2.1.2 → 2.1.4

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 (75) hide show
  1. package/build/backend/api/controllers/hosts.d.ts +3 -0
  2. package/build/backend/api/controllers/hosts.d.ts.map +1 -1
  3. package/build/backend/api/controllers/hosts.js +3 -0
  4. package/build/backend/api/routes.d.ts +3 -0
  5. package/build/backend/api/routes.d.ts.map +1 -1
  6. package/build/backend/api/routes.js +3 -0
  7. package/build/backend/commands/hosts/bulk/delete-many-hosts.command.d.ts +10 -0
  8. package/build/backend/commands/hosts/bulk/delete-many-hosts.command.d.ts.map +1 -1
  9. package/build/backend/commands/hosts/bulk/disable-many-hosts.command.d.ts +10 -0
  10. package/build/backend/commands/hosts/bulk/disable-many-hosts.command.d.ts.map +1 -1
  11. package/build/backend/commands/hosts/bulk/enable-many-hosts.command.d.ts +10 -0
  12. package/build/backend/commands/hosts/bulk/enable-many-hosts.command.d.ts.map +1 -1
  13. package/build/backend/commands/hosts/bulk/set-inbound-to-many-hosts.command.d.ts +10 -0
  14. package/build/backend/commands/hosts/bulk/set-inbound-to-many-hosts.command.d.ts.map +1 -1
  15. package/build/backend/commands/hosts/bulk/set-port-to-many-hosts.command.d.ts +10 -0
  16. package/build/backend/commands/hosts/bulk/set-port-to-many-hosts.command.d.ts.map +1 -1
  17. package/build/backend/commands/hosts/create.command.d.ts +16 -0
  18. package/build/backend/commands/hosts/create.command.d.ts.map +1 -1
  19. package/build/backend/commands/hosts/create.command.js +8 -0
  20. package/build/backend/commands/hosts/get-all.command.d.ts +10 -0
  21. package/build/backend/commands/hosts/get-all.command.d.ts.map +1 -1
  22. package/build/backend/commands/hosts/get-one.command.d.ts +10 -0
  23. package/build/backend/commands/hosts/get-one.command.d.ts.map +1 -1
  24. package/build/backend/commands/hosts/index.d.ts +1 -0
  25. package/build/backend/commands/hosts/index.d.ts.map +1 -1
  26. package/build/backend/commands/hosts/index.js +1 -0
  27. package/build/backend/commands/hosts/reorder.command.d.ts +2 -0
  28. package/build/backend/commands/hosts/reorder.command.d.ts.map +1 -1
  29. package/build/backend/commands/hosts/tags/get-all-host-tags.command.d.ts +25 -0
  30. package/build/backend/commands/hosts/tags/get-all-host-tags.command.d.ts.map +1 -0
  31. package/build/backend/commands/hosts/tags/get-all-host-tags.command.js +17 -0
  32. package/build/backend/commands/hosts/tags/index.d.ts +2 -0
  33. package/build/backend/commands/hosts/tags/index.d.ts.map +1 -0
  34. package/build/backend/commands/hosts/tags/index.js +17 -0
  35. package/build/backend/commands/hosts/update.command.d.ts +18 -0
  36. package/build/backend/commands/hosts/update.command.d.ts.map +1 -1
  37. package/build/backend/commands/hosts/update.command.js +8 -0
  38. package/build/backend/commands/nodes/create.command.js +1 -1
  39. package/build/backend/commands/nodes/update.command.js +1 -1
  40. package/build/backend/commands/subscription/get-raw-subscription-by-short-uuid.command.d.ts +27 -0
  41. package/build/backend/commands/subscription/get-raw-subscription-by-short-uuid.command.d.ts.map +1 -1
  42. package/build/backend/commands/subscription/get-raw-subscription-by-short-uuid.command.js +3 -0
  43. package/build/backend/commands/users/create-user.command.js +2 -2
  44. package/build/backend/constants/cache-keys/cache-keys.constants.d.ts +4 -0
  45. package/build/backend/constants/cache-keys/cache-keys.constants.d.ts.map +1 -0
  46. package/build/backend/constants/cache-keys/cache-keys.constants.js +6 -0
  47. package/build/backend/constants/cache-keys/index.d.ts +2 -0
  48. package/build/backend/constants/cache-keys/index.d.ts.map +1 -0
  49. package/build/backend/constants/cache-keys/index.js +17 -0
  50. package/build/backend/constants/errors/errors.d.ts +5 -0
  51. package/build/backend/constants/errors/errors.d.ts.map +1 -1
  52. package/build/backend/constants/errors/errors.js +5 -0
  53. package/build/backend/constants/index.d.ts +1 -0
  54. package/build/backend/constants/index.d.ts.map +1 -1
  55. package/build/backend/constants/index.js +1 -0
  56. package/build/backend/models/hosts.schema.d.ts +6 -0
  57. package/build/backend/models/hosts.schema.d.ts.map +1 -1
  58. package/build/backend/models/hosts.schema.js +2 -0
  59. package/build/frontend/api/controllers/hosts.js +3 -0
  60. package/build/frontend/api/routes.js +3 -0
  61. package/build/frontend/commands/hosts/create.command.js +8 -0
  62. package/build/frontend/commands/hosts/index.js +1 -0
  63. package/build/frontend/commands/hosts/tags/get-all-host-tags.command.js +17 -0
  64. package/build/frontend/commands/hosts/tags/index.js +17 -0
  65. package/build/frontend/commands/hosts/update.command.js +8 -0
  66. package/build/frontend/commands/nodes/create.command.js +1 -1
  67. package/build/frontend/commands/nodes/update.command.js +1 -1
  68. package/build/frontend/commands/subscription/get-raw-subscription-by-short-uuid.command.js +3 -0
  69. package/build/frontend/commands/users/create-user.command.js +2 -2
  70. package/build/frontend/constants/cache-keys/cache-keys.constants.js +6 -0
  71. package/build/frontend/constants/cache-keys/index.js +17 -0
  72. package/build/frontend/constants/errors/errors.js +5 -0
  73. package/build/frontend/constants/index.js +1 -0
  74. package/build/frontend/models/hosts.schema.js +2 -0
  75. package/package.json +1 -1
@@ -49,6 +49,14 @@ var CreateHostCommand;
49
49
  message: 'Server description must be less than 30 characters',
50
50
  })
51
51
  .nullable()),
52
+ tag: zod_1.z
53
+ .optional(zod_1.z
54
+ .string()
55
+ .regex(/^[A-Z0-9_]+$/, 'Tag can only contain uppercase letters, numbers, underscores')
56
+ .max(16, 'Tag must be less than 16 characters')
57
+ .nullable())
58
+ .describe('Optional. Host tag for categorization. Max 16 characters, uppercase letters, numbers and underscores only.'),
59
+ isHidden: zod_1.z.optional(zod_1.z.boolean().default(false)),
52
60
  });
53
61
  CreateHostCommand.ResponseSchema = zod_1.z.object({
54
62
  response: models_1.HostsSchema,
@@ -20,4 +20,5 @@ __exportStar(require("./delete.command"), exports);
20
20
  __exportStar(require("./get-all.command"), exports);
21
21
  __exportStar(require("./get-one.command"), exports);
22
22
  __exportStar(require("./reorder.command"), exports);
23
+ __exportStar(require("./tags"), exports);
23
24
  __exportStar(require("./update.command"), exports);
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetAllHostTagsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../../constants");
6
+ const api_1 = require("../../../api");
7
+ var GetAllHostTagsCommand;
8
+ (function (GetAllHostTagsCommand) {
9
+ GetAllHostTagsCommand.url = api_1.REST_API.HOSTS.TAGS.GET;
10
+ GetAllHostTagsCommand.TSQ_url = GetAllHostTagsCommand.url;
11
+ GetAllHostTagsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.HOSTS_ROUTES.TAGS.GET, 'get', 'Get all existing host tags');
12
+ GetAllHostTagsCommand.ResponseSchema = zod_1.z.object({
13
+ response: zod_1.z.object({
14
+ tags: zod_1.z.array(zod_1.z.string()),
15
+ }),
16
+ });
17
+ })(GetAllHostTagsCommand || (exports.GetAllHostTagsCommand = GetAllHostTagsCommand = {}));
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./get-all-host-tags.command"), exports);
@@ -54,6 +54,14 @@ var UpdateHostCommand;
54
54
  message: 'Server description must be less than 30 characters',
55
55
  })
56
56
  .nullable()),
57
+ tag: zod_1.z
58
+ .optional(zod_1.z
59
+ .string()
60
+ .regex(/^[A-Z0-9_]+$/, 'Tag can only contain uppercase letters, numbers, underscores')
61
+ .max(16, 'Tag must be less than 16 characters')
62
+ .nullable())
63
+ .describe('Optional. Host tag for categorization. Max 16 characters, uppercase letters, numbers and underscores only.'),
64
+ isHidden: zod_1.z.optional(zod_1.z.boolean()),
57
65
  });
58
66
  UpdateHostCommand.ResponseSchema = zod_1.z.object({
59
67
  response: models_1.HostsSchema,
@@ -11,7 +11,7 @@ var CreateNodeCommand;
11
11
  CreateNodeCommand.TSQ_url = CreateNodeCommand.url;
12
12
  CreateNodeCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.NODES_ROUTES.CREATE, 'post', 'Create a new node');
13
13
  CreateNodeCommand.RequestSchema = zod_1.z.object({
14
- name: zod_1.z.string().min(5, 'Minimum 5 characters!'),
14
+ name: zod_1.z.string().min(3, 'Minimum 3 characters!'),
15
15
  address: zod_1.z.string().min(2, 'Minimum 2 characters!'),
16
16
  port: zod_1.z.number().int().min(1, 'Port is required').optional(),
17
17
  isTrafficTrackingActive: zod_1.z.boolean().optional().default(false),
@@ -13,7 +13,7 @@ var UpdateNodeCommand;
13
13
  UpdateNodeCommand.RequestSchema = models_1.NodesSchema.pick({
14
14
  uuid: true,
15
15
  }).extend({
16
- name: zod_1.z.optional(zod_1.z.string().min(5, 'Min. 5 characters')),
16
+ name: zod_1.z.optional(zod_1.z.string().min(3, 'Min. 3 characters')),
17
17
  address: zod_1.z.optional(zod_1.z.string().min(2, 'Min. 2 characters')),
18
18
  port: zod_1.z.optional(zod_1.z.number()),
19
19
  isTrafficTrackingActive: zod_1.z.optional(zod_1.z.boolean()),
@@ -76,6 +76,9 @@ var GetRawSubscriptionByShortUuidCommand;
76
76
  configProfileInboundUuid: zod_1.z.nullable(zod_1.z.string()),
77
77
  isDisabled: zod_1.z.boolean(),
78
78
  viewPosition: zod_1.z.number(),
79
+ remark: zod_1.z.string(),
80
+ isHidden: zod_1.z.boolean(),
81
+ host: zod_1.z.nullable(zod_1.z.string()),
79
82
  })),
80
83
  })),
81
84
  headers: zod_1.z.record(zod_1.z.string(), zod_1.z.string()),
@@ -18,8 +18,8 @@ var CreateUserCommand;
18
18
  })
19
19
  .regex(/^[a-zA-Z0-9_-]+$/, 'Username can only contain letters, numbers, underscores and dashes')
20
20
  .max(36, 'Username must be less than 36 characters')
21
- .min(6, 'Username must be at least 6 characters')
22
- .describe('Unique username for the user. Required. Must be 6-36 characters long and contain only letters, numbers, underscores and dashes.'),
21
+ .min(3, 'Username must be at least 3 characters')
22
+ .describe('Unique username for the user. Required. Must be 3-36 characters long and contain only letters, numbers, underscores and dashes.'),
23
23
  status: models_1.UsersSchema.shape.status
24
24
  .optional()
25
25
  .default(constants_1.USERS_STATUS.ACTIVE)
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CACHE_KEYS = void 0;
4
+ exports.CACHE_KEYS = {
5
+ SUBSCRIPTION_SETTINGS: 'subscription_settings',
6
+ };
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./cache-keys.constants"), exports);
@@ -750,4 +750,9 @@ exports.ERRORS = {
750
750
  message: 'Sync active profile error',
751
751
  httpCode: 500,
752
752
  },
753
+ GET_ALL_HOST_TAGS_ERROR: {
754
+ code: 'A151',
755
+ message: 'Get all host tags error',
756
+ httpCode: 500,
757
+ },
753
758
  };
@@ -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("./cache-keys"), exports);
17
18
  __exportStar(require("./endpoint-details"), exports);
18
19
  __exportStar(require("./errors"), exports);
19
20
  __exportStar(require("./events"), exports);
@@ -24,4 +24,6 @@ exports.HostsSchema = zod_1.z.object({
24
24
  configProfileInboundUuid: zod_1.z.string().uuid().nullable(),
25
25
  }),
26
26
  serverDescription: zod_1.z.string().nullable(),
27
+ tag: zod_1.z.string().nullable(),
28
+ isHidden: zod_1.z.boolean().default(false),
27
29
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
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.",