@remnawave/backend-contract 2.0.0-alpha.27 → 2.0.0-alpha.3

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 (199) hide show
  1. package/build/backend/api/controllers/index.d.ts +0 -1
  2. package/build/backend/api/controllers/index.d.ts.map +1 -1
  3. package/build/backend/api/controllers/index.js +0 -1
  4. package/build/backend/api/controllers/internal-squads.d.ts +0 -4
  5. package/build/backend/api/controllers/internal-squads.d.ts.map +1 -1
  6. package/build/backend/api/controllers/internal-squads.js +0 -5
  7. package/build/backend/api/controllers/users.d.ts +0 -1
  8. package/build/backend/api/controllers/users.d.ts.map +1 -1
  9. package/build/backend/api/controllers/users.js +0 -1
  10. package/build/backend/api/routes.d.ts +0 -19
  11. package/build/backend/api/routes.d.ts.map +1 -1
  12. package/build/backend/api/routes.js +0 -19
  13. package/build/backend/commands/config-profiles/create-config-profile.command.js +2 -2
  14. package/build/backend/commands/hosts/bulk/delete-many-hosts.command.d.ts +10 -26
  15. package/build/backend/commands/hosts/bulk/delete-many-hosts.command.d.ts.map +1 -1
  16. package/build/backend/commands/hosts/bulk/disable-many-hosts.command.d.ts +10 -26
  17. package/build/backend/commands/hosts/bulk/disable-many-hosts.command.d.ts.map +1 -1
  18. package/build/backend/commands/hosts/bulk/enable-many-hosts.command.d.ts +10 -26
  19. package/build/backend/commands/hosts/bulk/enable-many-hosts.command.d.ts.map +1 -1
  20. package/build/backend/commands/hosts/bulk/set-inbound-to-many-hosts.command.d.ts +10 -26
  21. package/build/backend/commands/hosts/bulk/set-inbound-to-many-hosts.command.d.ts.map +1 -1
  22. package/build/backend/commands/hosts/bulk/set-port-to-many-hosts.command.d.ts +10 -26
  23. package/build/backend/commands/hosts/bulk/set-port-to-many-hosts.command.d.ts.map +1 -1
  24. package/build/backend/commands/hosts/create.command.d.ts +19 -47
  25. package/build/backend/commands/hosts/create.command.d.ts.map +1 -1
  26. package/build/backend/commands/hosts/create.command.js +13 -13
  27. package/build/backend/commands/hosts/get-all.command.d.ts +10 -26
  28. package/build/backend/commands/hosts/get-all.command.d.ts.map +1 -1
  29. package/build/backend/commands/hosts/get-one.command.d.ts +10 -26
  30. package/build/backend/commands/hosts/get-one.command.d.ts.map +1 -1
  31. package/build/backend/commands/hosts/reorder.command.d.ts +2 -10
  32. package/build/backend/commands/hosts/reorder.command.d.ts.map +1 -1
  33. package/build/backend/commands/hosts/update.command.d.ts +21 -57
  34. package/build/backend/commands/hosts/update.command.d.ts.map +1 -1
  35. package/build/backend/commands/hosts/update.command.js +11 -10
  36. package/build/backend/commands/index.d.ts +0 -1
  37. package/build/backend/commands/index.d.ts.map +1 -1
  38. package/build/backend/commands/index.js +0 -1
  39. package/build/backend/commands/internal-squads/create-internal-squad.command.js +2 -2
  40. package/build/backend/commands/internal-squads/{get-internal-squad-by-uuid.d.ts → get-internal-squad-by-uuid..d.ts} +1 -1
  41. package/build/backend/commands/internal-squads/get-internal-squad-by-uuid..d.ts.map +1 -0
  42. package/build/backend/commands/internal-squads/index.d.ts +1 -2
  43. package/build/backend/commands/internal-squads/index.d.ts.map +1 -1
  44. package/build/backend/commands/internal-squads/index.js +1 -2
  45. package/build/backend/commands/nodes/actions/disable.command.d.ts +64 -157
  46. package/build/backend/commands/nodes/actions/disable.command.d.ts.map +1 -1
  47. package/build/backend/commands/nodes/actions/enable.command.d.ts +64 -157
  48. package/build/backend/commands/nodes/actions/enable.command.d.ts.map +1 -1
  49. package/build/backend/commands/nodes/actions/reorder.command.d.ts +88 -230
  50. package/build/backend/commands/nodes/actions/reorder.command.d.ts.map +1 -1
  51. package/build/backend/commands/nodes/create.command.d.ts +70 -178
  52. package/build/backend/commands/nodes/create.command.d.ts.map +1 -1
  53. package/build/backend/commands/nodes/create.command.js +4 -7
  54. package/build/backend/commands/nodes/get-all.command.d.ts +64 -157
  55. package/build/backend/commands/nodes/get-all.command.d.ts.map +1 -1
  56. package/build/backend/commands/nodes/get-one.command.d.ts +64 -157
  57. package/build/backend/commands/nodes/get-one.command.d.ts.map +1 -1
  58. package/build/backend/commands/nodes/stats/get-node-user-usage-by-range.command.d.ts +4 -4
  59. package/build/backend/commands/nodes/stats/get-nodes-usage-by-range.command.d.ts +4 -4
  60. package/build/backend/commands/nodes/update.command.d.ts +94 -251
  61. package/build/backend/commands/nodes/update.command.d.ts.map +1 -1
  62. package/build/backend/commands/nodes/update.command.js +4 -9
  63. package/build/backend/commands/users/get-user-usage-by-range.command.d.ts +4 -4
  64. package/build/backend/commands/users/index.d.ts +0 -1
  65. package/build/backend/commands/users/index.d.ts.map +1 -1
  66. package/build/backend/commands/users/index.js +0 -1
  67. package/build/backend/constants/errors/errors.d.ts +0 -95
  68. package/build/backend/constants/errors/errors.d.ts.map +1 -1
  69. package/build/backend/constants/errors/errors.js +0 -95
  70. package/build/backend/constants/events/events.d.ts +0 -11
  71. package/build/backend/constants/events/events.d.ts.map +1 -1
  72. package/build/backend/constants/events/events.js +0 -10
  73. package/build/backend/constants/templates/template-keys.d.ts +1 -1
  74. package/build/backend/constants/templates/template-keys.d.ts.map +1 -1
  75. package/build/backend/constants/templates/template-keys.js +0 -1
  76. package/build/backend/models/{extended-users.schema.d.ts → extented-users.schema.d.ts} +1 -1
  77. package/build/backend/models/{extended-users.schema.d.ts.map → extented-users.schema.d.ts.map} +1 -1
  78. package/build/backend/models/hosts.schema.d.ts +6 -18
  79. package/build/backend/models/hosts.schema.d.ts.map +1 -1
  80. package/build/backend/models/hosts.schema.js +2 -4
  81. package/build/backend/models/index.d.ts +1 -5
  82. package/build/backend/models/index.d.ts.map +1 -1
  83. package/build/backend/models/index.js +1 -5
  84. package/build/backend/models/nodes.schema.d.ts +44 -115
  85. package/build/backend/models/nodes.schema.d.ts.map +1 -1
  86. package/build/backend/models/nodes.schema.js +2 -7
  87. package/build/frontend/api/controllers/index.js +0 -1
  88. package/build/frontend/api/controllers/internal-squads.js +0 -5
  89. package/build/frontend/api/controllers/users.js +0 -1
  90. package/build/frontend/api/routes.js +0 -19
  91. package/build/frontend/commands/config-profiles/create-config-profile.command.js +2 -2
  92. package/build/frontend/commands/hosts/create.command.js +13 -13
  93. package/build/frontend/commands/hosts/update.command.js +11 -10
  94. package/build/frontend/commands/index.js +0 -1
  95. package/build/frontend/commands/internal-squads/create-internal-squad.command.js +2 -2
  96. package/build/frontend/commands/internal-squads/index.js +1 -2
  97. package/build/frontend/commands/nodes/create.command.js +4 -7
  98. package/build/frontend/commands/nodes/update.command.js +4 -9
  99. package/build/frontend/commands/users/index.js +0 -1
  100. package/build/frontend/constants/errors/errors.js +0 -95
  101. package/build/frontend/constants/events/events.js +0 -10
  102. package/build/frontend/constants/templates/template-keys.js +0 -1
  103. package/build/frontend/models/hosts.schema.js +2 -4
  104. package/build/frontend/models/index.js +1 -5
  105. package/build/frontend/models/nodes.schema.js +2 -7
  106. package/package.json +1 -1
  107. package/build/backend/api/controllers/infra-billing.d.ts +0 -16
  108. package/build/backend/api/controllers/infra-billing.d.ts.map +0 -1
  109. package/build/backend/api/controllers/infra-billing.js +0 -18
  110. package/build/backend/commands/infra-billing/create-bill-record.command.d.ts +0 -125
  111. package/build/backend/commands/infra-billing/create-bill-record.command.d.ts.map +0 -1
  112. package/build/backend/commands/infra-billing/create-bill-record.command.js +0 -30
  113. package/build/backend/commands/infra-billing/create-billing-node.command.d.ts +0 -465
  114. package/build/backend/commands/infra-billing/create-billing-node.command.d.ts.map +0 -1
  115. package/build/backend/commands/infra-billing/create-billing-node.command.js +0 -38
  116. package/build/backend/commands/infra-billing/create-infra-provider.command.d.ts +0 -123
  117. package/build/backend/commands/infra-billing/create-infra-provider.command.d.ts.map +0 -1
  118. package/build/backend/commands/infra-billing/create-infra-provider.command.js +0 -24
  119. package/build/backend/commands/infra-billing/delete-bill-record-by-uuid.command.d.ts +0 -119
  120. package/build/backend/commands/infra-billing/delete-bill-record-by-uuid.command.d.ts.map +0 -1
  121. package/build/backend/commands/infra-billing/delete-bill-record-by-uuid.command.js +0 -22
  122. package/build/backend/commands/infra-billing/delete-billing-node-by-uuid.command.d.ts +0 -459
  123. package/build/backend/commands/infra-billing/delete-billing-node-by-uuid.command.d.ts.map +0 -1
  124. package/build/backend/commands/infra-billing/delete-billing-node-by-uuid.command.js +0 -29
  125. package/build/backend/commands/infra-billing/delete-infra-provider-by-uuid.command.d.ts +0 -33
  126. package/build/backend/commands/infra-billing/delete-infra-provider-by-uuid.command.d.ts.map +0 -1
  127. package/build/backend/commands/infra-billing/delete-infra-provider-by-uuid.command.js +0 -20
  128. package/build/backend/commands/infra-billing/get-bill-records.command.d.ts +0 -122
  129. package/build/backend/commands/infra-billing/get-bill-records.command.d.ts.map +0 -1
  130. package/build/backend/commands/infra-billing/get-bill-records.command.js +0 -31
  131. package/build/backend/commands/infra-billing/get-billing-nodes.command.d.ts +0 -451
  132. package/build/backend/commands/infra-billing/get-billing-nodes.command.d.ts.map +0 -1
  133. package/build/backend/commands/infra-billing/get-billing-nodes.command.js +0 -26
  134. package/build/backend/commands/infra-billing/get-infra-provider-by-uuid.command.d.ts +0 -117
  135. package/build/backend/commands/infra-billing/get-infra-provider-by-uuid.command.d.ts.map +0 -1
  136. package/build/backend/commands/infra-billing/get-infra-provider-by-uuid.command.js +0 -19
  137. package/build/backend/commands/infra-billing/get-infra-providers.command.d.ts +0 -156
  138. package/build/backend/commands/infra-billing/get-infra-providers.command.d.ts.map +0 -1
  139. package/build/backend/commands/infra-billing/get-infra-providers.command.js +0 -19
  140. package/build/backend/commands/infra-billing/index.d.ts +0 -13
  141. package/build/backend/commands/infra-billing/index.d.ts.map +0 -1
  142. package/build/backend/commands/infra-billing/index.js +0 -28
  143. package/build/backend/commands/infra-billing/update-billing-node.command.d.ts +0 -462
  144. package/build/backend/commands/infra-billing/update-billing-node.command.d.ts.map +0 -1
  145. package/build/backend/commands/infra-billing/update-billing-node.command.js +0 -35
  146. package/build/backend/commands/infra-billing/update-infra-provider.command.d.ts +0 -126
  147. package/build/backend/commands/infra-billing/update-infra-provider.command.d.ts.map +0 -1
  148. package/build/backend/commands/infra-billing/update-infra-provider.command.js +0 -26
  149. package/build/backend/commands/internal-squads/bulk-actions/add-users-to-internal-squad.command.d.ts +0 -33
  150. package/build/backend/commands/internal-squads/bulk-actions/add-users-to-internal-squad.command.d.ts.map +0 -1
  151. package/build/backend/commands/internal-squads/bulk-actions/add-users-to-internal-squad.command.js +0 -20
  152. package/build/backend/commands/internal-squads/bulk-actions/delete-users-from-internal-squad.command.d.ts +0 -33
  153. package/build/backend/commands/internal-squads/bulk-actions/delete-users-from-internal-squad.command.d.ts.map +0 -1
  154. package/build/backend/commands/internal-squads/bulk-actions/delete-users-from-internal-squad.command.js +0 -20
  155. package/build/backend/commands/internal-squads/bulk-actions/index.d.ts +0 -3
  156. package/build/backend/commands/internal-squads/bulk-actions/index.d.ts.map +0 -1
  157. package/build/backend/commands/internal-squads/bulk-actions/index.js +0 -18
  158. package/build/backend/commands/internal-squads/get-internal-squad-by-uuid.d.ts.map +0 -1
  159. package/build/backend/commands/users/get-user-accessible-nodes.command.d.ts +0 -114
  160. package/build/backend/commands/users/get-user-accessible-nodes.command.d.ts.map +0 -1
  161. package/build/backend/commands/users/get-user-accessible-nodes.command.js +0 -31
  162. package/build/backend/models/infra-billing-available-node.schema.d.ts +0 -116
  163. package/build/backend/models/infra-billing-available-node.schema.d.ts.map +0 -1
  164. package/build/backend/models/infra-billing-available-node.schema.js +0 -9
  165. package/build/backend/models/infra-billing-history-record.schema.d.ts +0 -44
  166. package/build/backend/models/infra-billing-history-record.schema.d.ts.map +0 -1
  167. package/build/backend/models/infra-billing-history-record.schema.js +0 -19
  168. package/build/backend/models/infra-billing-node.schema.d.ts +0 -179
  169. package/build/backend/models/infra-billing-node.schema.d.ts.map +0 -1
  170. package/build/backend/models/infra-billing-node.schema.js +0 -34
  171. package/build/backend/models/infra-provider.schema.d.ts +0 -87
  172. package/build/backend/models/infra-provider.schema.d.ts.map +0 -1
  173. package/build/backend/models/infra-provider.schema.js +0 -41
  174. package/build/frontend/api/controllers/infra-billing.js +0 -18
  175. package/build/frontend/commands/infra-billing/create-bill-record.command.js +0 -30
  176. package/build/frontend/commands/infra-billing/create-billing-node.command.js +0 -38
  177. package/build/frontend/commands/infra-billing/create-infra-provider.command.js +0 -24
  178. package/build/frontend/commands/infra-billing/delete-bill-record-by-uuid.command.js +0 -22
  179. package/build/frontend/commands/infra-billing/delete-billing-node-by-uuid.command.js +0 -29
  180. package/build/frontend/commands/infra-billing/delete-infra-provider-by-uuid.command.js +0 -20
  181. package/build/frontend/commands/infra-billing/get-bill-records.command.js +0 -31
  182. package/build/frontend/commands/infra-billing/get-billing-nodes.command.js +0 -26
  183. package/build/frontend/commands/infra-billing/get-infra-provider-by-uuid.command.js +0 -19
  184. package/build/frontend/commands/infra-billing/get-infra-providers.command.js +0 -19
  185. package/build/frontend/commands/infra-billing/index.js +0 -28
  186. package/build/frontend/commands/infra-billing/update-billing-node.command.js +0 -35
  187. package/build/frontend/commands/infra-billing/update-infra-provider.command.js +0 -26
  188. package/build/frontend/commands/internal-squads/bulk-actions/add-users-to-internal-squad.command.js +0 -20
  189. package/build/frontend/commands/internal-squads/bulk-actions/delete-users-from-internal-squad.command.js +0 -20
  190. package/build/frontend/commands/internal-squads/bulk-actions/index.js +0 -18
  191. package/build/frontend/commands/users/get-user-accessible-nodes.command.js +0 -31
  192. package/build/frontend/models/infra-billing-available-node.schema.js +0 -9
  193. package/build/frontend/models/infra-billing-history-record.schema.js +0 -19
  194. package/build/frontend/models/infra-billing-node.schema.js +0 -34
  195. package/build/frontend/models/infra-provider.schema.js +0 -41
  196. /package/build/backend/commands/internal-squads/{get-internal-squad-by-uuid.js → get-internal-squad-by-uuid..js} +0 -0
  197. /package/build/backend/models/{extended-users.schema.js → extented-users.schema.js} +0 -0
  198. /package/build/frontend/commands/internal-squads/{get-internal-squad-by-uuid.js → get-internal-squad-by-uuid..js} +0 -0
  199. /package/build/frontend/models/{extended-users.schema.js → extented-users.schema.js} +0 -0
@@ -13,11 +13,17 @@ var UpdateHostCommand;
13
13
  UpdateHostCommand.RequestSchema = models_1.HostsSchema.pick({
14
14
  uuid: true,
15
15
  }).extend({
16
- inbound: zod_1.z
17
- .object({
18
- configProfileUuid: zod_1.z.string().uuid(),
19
- configProfileInboundUuid: zod_1.z.string().uuid(),
16
+ configProfileUuid: zod_1.z
17
+ .string({
18
+ invalid_type_error: 'Config Profile UUID must be a string',
20
19
  })
20
+ .uuid('Config Profile UUID must be a valid UUID')
21
+ .optional(),
22
+ configProfileInboundUuid: zod_1.z
23
+ .string({
24
+ invalid_type_error: 'Inbound UUID must be a string',
25
+ })
26
+ .uuid('Inbound UUID must be a valid UUID')
21
27
  .optional(),
22
28
  remark: zod_1.z
23
29
  .string({
@@ -43,15 +49,10 @@ var UpdateHostCommand;
43
49
  host: zod_1.z.optional(zod_1.z.string()),
44
50
  alpn: zod_1.z.optional(zod_1.z.nativeEnum(constants_1.ALPN).nullable()),
45
51
  fingerprint: zod_1.z.optional(zod_1.z.nativeEnum(constants_1.FINGERPRINTS).nullable()),
52
+ allowInsecure: zod_1.z.optional(zod_1.z.boolean()),
46
53
  isDisabled: zod_1.z.optional(zod_1.z.boolean()),
47
54
  securityLayer: zod_1.z.optional(zod_1.z.nativeEnum(constants_1.SECURITY_LAYERS)),
48
55
  xHttpExtraParams: zod_1.z.optional(zod_1.z.nullable(zod_1.z.unknown())),
49
- serverDescription: zod_1.z.optional(zod_1.z
50
- .string()
51
- .max(30, {
52
- message: 'Server description must be less than 30 characters',
53
- })
54
- .nullable()),
55
56
  });
56
57
  UpdateHostCommand.ResponseSchema = zod_1.z.object({
57
58
  response: models_1.HostsSchema,
@@ -19,7 +19,6 @@ __exportStar(require("./auth"), exports);
19
19
  __exportStar(require("./config-profiles"), exports);
20
20
  __exportStar(require("./hosts"), exports);
21
21
  __exportStar(require("./hwid"), exports);
22
- __exportStar(require("./infra-billing"), exports);
23
22
  __exportStar(require("./internal-squads"), exports);
24
23
  __exportStar(require("./keygen"), exports);
25
24
  __exportStar(require("./nodes"), exports);
@@ -13,8 +13,8 @@ var CreateInternalSquadCommand;
13
13
  CreateInternalSquadCommand.RequestSchema = zod_1.z.object({
14
14
  name: zod_1.z
15
15
  .string()
16
- .min(2, 'Name must be at least 2 characters')
17
- .max(20, 'Name must be less than 20 characters')
16
+ .min(6, 'Name must be at least 6 characters')
17
+ .max(16, 'Name must be less than 16 characters')
18
18
  .regex(/^[A-Za-z0-9_-]+$/, 'Name can only contain letters, numbers, underscores and dashes'),
19
19
  inbounds: zod_1.z.array(zod_1.z.string().uuid()),
20
20
  });
@@ -14,9 +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("./bulk-actions"), exports);
18
17
  __exportStar(require("./create-internal-squad.command"), exports);
19
18
  __exportStar(require("./delete-internal-squad.command"), exports);
20
- __exportStar(require("./get-internal-squad-by-uuid"), exports);
19
+ __exportStar(require("./get-internal-squad-by-uuid."), exports);
21
20
  __exportStar(require("./get-internal-squads.command"), exports);
22
21
  __exportStar(require("./update-internal-squad.command"), exports);
@@ -35,13 +35,10 @@ var CreateNodeCommand;
35
35
  .number()
36
36
  .min(0.1, 'Consumption multiplier must be greater than 0')
37
37
  .transform((n) => Number(n.toFixed(1)))),
38
- configProfile: zod_1.z.object({
39
- activeConfigProfileUuid: zod_1.z.string().uuid(),
40
- activeInbounds: zod_1.z.array(zod_1.z.string().uuid(), {
41
- invalid_type_error: 'Config profile inbound UUID must be an array of UUIDs',
42
- }),
43
- }),
44
- providerUuid: zod_1.z.optional(zod_1.z.nullable(zod_1.z.string().uuid())),
38
+ activeConfigProfileUuid: zod_1.z.optional(zod_1.z.string().uuid()),
39
+ activeInbounds: zod_1.z.optional(zod_1.z.array(zod_1.z.string().uuid(), {
40
+ invalid_type_error: 'Active inbounds must be an array of UUIDs',
41
+ })),
45
42
  });
46
43
  CreateNodeCommand.ResponseSchema = zod_1.z.object({
47
44
  response: models_1.NodesSchema,
@@ -31,15 +31,10 @@ var UpdateNodeCommand;
31
31
  .number()
32
32
  .min(0.1, 'Consumption multiplier must be greater than 0')
33
33
  .transform((n) => Number(n.toFixed(1)))),
34
- configProfile: zod_1.z
35
- .object({
36
- activeConfigProfileUuid: zod_1.z.string().uuid(),
37
- activeInbounds: zod_1.z.array(zod_1.z.string().uuid(), {
38
- invalid_type_error: 'Must be an array of UUIDs',
39
- }),
40
- })
41
- .optional(),
42
- providerUuid: zod_1.z.optional(zod_1.z.nullable(zod_1.z.string().uuid())),
34
+ activeConfigProfileUuid: zod_1.z.optional(zod_1.z.string().uuid()),
35
+ activeInbounds: zod_1.z.optional(zod_1.z.array(zod_1.z.string().uuid(), {
36
+ invalid_type_error: 'Active inbounds must be an array of UUIDs',
37
+ })),
43
38
  });
44
39
  UpdateNodeCommand.ResponseSchema = zod_1.z.object({
45
40
  response: models_1.NodesSchema,
@@ -21,7 +21,6 @@ __exportStar(require("./create-user.command"), exports);
21
21
  __exportStar(require("./delete-user.command"), exports);
22
22
  __exportStar(require("./get-all-users.command"), exports);
23
23
  __exportStar(require("./get-by"), exports);
24
- __exportStar(require("./get-user-accessible-nodes.command"), exports);
25
24
  __exportStar(require("./get-user-by-uuid.command"), exports);
26
25
  __exportStar(require("./get-user-usage-by-range.command"), exports);
27
26
  __exportStar(require("./tags"), exports);
@@ -620,99 +620,4 @@ exports.ERRORS = {
620
620
  message: 'Config profile inbound not found in specified profile',
621
621
  httpCode: 404,
622
622
  },
623
- GET_USER_ACCESSIBLE_NODES_ERROR: {
624
- code: 'A125',
625
- message: 'Get user accessible nodes error',
626
- httpCode: 500,
627
- },
628
- GET_INFRA_PROVIDERS_ERROR: {
629
- code: 'A126',
630
- message: 'Get infra providers error',
631
- httpCode: 500,
632
- },
633
- GET_INFRA_PROVIDER_BY_UUID_ERROR: {
634
- code: 'A127',
635
- message: 'Get infra provider by UUID error',
636
- httpCode: 500,
637
- },
638
- INFRA_PROVIDER_NOT_FOUND: {
639
- code: 'A128',
640
- message: 'Infra provider not found',
641
- httpCode: 404,
642
- },
643
- DELETE_INFRA_PROVIDER_BY_UUID_ERROR: {
644
- code: 'A129',
645
- message: 'Delete infra provider by UUID error',
646
- httpCode: 500,
647
- },
648
- CREATE_INFRA_PROVIDER_ERROR: {
649
- code: 'A130',
650
- message: 'Create infra provider error',
651
- httpCode: 500,
652
- },
653
- UPDATE_INFRA_PROVIDER_ERROR: {
654
- code: 'A131',
655
- message: 'Update infra provider error',
656
- httpCode: 500,
657
- },
658
- CREATE_INFRA_BILLING_HISTORY_RECORD_ERROR: {
659
- code: 'A132',
660
- message: 'Create infra billing history record error',
661
- httpCode: 500,
662
- },
663
- GET_INFRA_BILLING_HISTORY_RECORDS_ERROR: {
664
- code: 'A133',
665
- message: 'Get infra billing history records error',
666
- httpCode: 500,
667
- },
668
- DELETE_INFRA_BILLING_HISTORY_RECORD_BY_UUID_ERROR: {
669
- code: 'A134',
670
- message: 'Delete infra billing history record by UUID error',
671
- httpCode: 500,
672
- },
673
- GET_BILLING_NODES_ERROR: {
674
- code: 'A135',
675
- message: 'Get billing nodes error',
676
- httpCode: 500,
677
- },
678
- UPDATE_INFRA_BILLING_NODE_ERROR: {
679
- code: 'A136',
680
- message: 'Update infra billing node error',
681
- httpCode: 500,
682
- },
683
- CREATE_INFRA_BILLING_NODE_ERROR: {
684
- code: 'A137',
685
- message: 'Create infra billing node error',
686
- httpCode: 500,
687
- },
688
- DELETE_INFRA_BILLING_NODE_BY_UUID_ERROR: {
689
- code: 'A138',
690
- message: 'Delete infra billing node by UUID error',
691
- httpCode: 500,
692
- },
693
- GET_BILLING_NODES_FOR_NOTIFICATIONS_ERROR: {
694
- code: 'A139',
695
- message: 'Get billing nodes for notifications error',
696
- httpCode: 500,
697
- },
698
- ADD_USERS_TO_INTERNAL_SQUAD_ERROR: {
699
- code: 'A140',
700
- message: 'Add users to internal squad error',
701
- httpCode: 500,
702
- },
703
- INTERNAL_SQUAD_BULK_ACTIONS_ERROR: {
704
- code: 'A141',
705
- message: 'Internal squad bulk actions error',
706
- httpCode: 500,
707
- },
708
- REMOVE_USERS_FROM_INTERNAL_SQUAD_ERROR: {
709
- code: 'A142',
710
- message: 'Remove users from internal squad error',
711
- httpCode: 500,
712
- },
713
- DELETE_CONFIG_PROFILE_BY_UUID_ERROR: {
714
- code: 'A143',
715
- message: 'Delete config profile by UUID error',
716
- httpCode: 500,
717
- },
718
623
  };
@@ -39,18 +39,8 @@ exports.EVENTS = {
39
39
  ERRORS: {
40
40
  BANDWIDTH_USAGE_THRESHOLD_REACHED_MAX_NOTIFICATIONS: 'errors.bandwidth_usage_threshold_reached_max_notifications',
41
41
  },
42
- CRM: {
43
- INFRA_BILLING_NODE_PAYMENT_IN_7_DAYS: 'crm.infra_billing_node_payment_in_7_days',
44
- INFRA_BILLING_NODE_PAYMENT_IN_48HRS: 'crm.infra_billing_node_payment_in_48hrs',
45
- INFRA_BILLING_NODE_PAYMENT_IN_24HRS: 'crm.infra_billing_node_payment_in_24hrs',
46
- INFRA_BILLING_NODE_PAYMENT_DUE_TODAY: 'crm.infra_billing_node_payment_due_today',
47
- INFRA_BILLING_NODE_PAYMENT_OVERDUE_24HRS: 'crm.infra_billing_node_payment_overdue_24hrs',
48
- INFRA_BILLING_NODE_PAYMENT_OVERDUE_48HRS: 'crm.infra_billing_node_payment_overdue_48hrs',
49
- INFRA_BILLING_NODE_PAYMENT_OVERDUE_7_DAYS: 'crm.infra_billing_node_payment_overdue_7_days',
50
- },
51
42
  CATCH_ALL_USER_EVENTS: 'user.*',
52
43
  CATCH_ALL_NODE_EVENTS: 'node.*',
53
44
  CATCH_ALL_SERVICE_EVENTS: 'service.*',
54
45
  CATCH_ALL_ERRORS_EVENTS: 'errors.*',
55
- CATCH_ALL_CRM_EVENTS: 'crm.*',
56
46
  };
@@ -11,5 +11,4 @@ exports.TEMPLATE_KEYS = [
11
11
  'EMAIL',
12
12
  'TELEGRAM_ID',
13
13
  'SUBSCRIPTION_URL',
14
- 'TAG',
15
14
  ];
@@ -17,8 +17,6 @@ exports.HostsSchema = zod_1.z.object({
17
17
  isDisabled: zod_1.z.boolean().default(false),
18
18
  securityLayer: zod_1.z.nativeEnum(hosts_1.SECURITY_LAYERS).default(hosts_1.SECURITY_LAYERS.DEFAULT),
19
19
  xHttpExtraParams: zod_1.z.nullable(zod_1.z.unknown()),
20
- inbound: zod_1.z.object({
21
- configProfileUuid: zod_1.z.string().uuid().nullable(),
22
- configProfileInboundUuid: zod_1.z.string().uuid().nullable(),
23
- }),
20
+ configProfileUuid: zod_1.z.string().uuid().nullable(),
21
+ configProfileInboundUuid: zod_1.z.string().uuid().nullable(),
24
22
  });
@@ -20,14 +20,10 @@ __exportStar(require("./base-internal-squad.schema"), exports);
20
20
  __exportStar(require("./base-stat.schema"), exports);
21
21
  __exportStar(require("./config-profile-inbounds.schema"), exports);
22
22
  __exportStar(require("./config-profile.schema"), exports);
23
- __exportStar(require("./extended-users.schema"), exports);
23
+ __exportStar(require("./extented-users.schema"), exports);
24
24
  __exportStar(require("./happ.schema"), exports);
25
25
  __exportStar(require("./hosts.schema"), exports);
26
26
  __exportStar(require("./hwid-user-device.schema"), exports);
27
- __exportStar(require("./infra-billing-available-node.schema"), exports);
28
- __exportStar(require("./infra-billing-history-record.schema"), exports);
29
- __exportStar(require("./infra-billing-node.schema"), exports);
30
- __exportStar(require("./infra-provider.schema"), exports);
31
27
  __exportStar(require("./internal-squad.schema"), exports);
32
28
  __exportStar(require("./last-connected-node.schema"), exports);
33
29
  __exportStar(require("./nodes.schema"), exports);
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NodesSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const config_profile_inbounds_schema_1 = require("./config-profile-inbounds.schema");
6
- const infra_provider_schema_1 = require("./infra-provider.schema");
7
6
  exports.NodesSchema = zod_1.z.object({
8
7
  uuid: zod_1.z.string().uuid(),
9
8
  name: zod_1.z.string(),
@@ -41,10 +40,6 @@ exports.NodesSchema = zod_1.z.object({
41
40
  .string()
42
41
  .datetime()
43
42
  .transform((str) => new Date(str)),
44
- configProfile: zod_1.z.object({
45
- activeConfigProfileUuid: zod_1.z.nullable(zod_1.z.string().uuid()),
46
- activeInbounds: zod_1.z.array(config_profile_inbounds_schema_1.ConfigProfileInboundsSchema),
47
- }),
48
- providerUuid: zod_1.z.nullable(zod_1.z.string().uuid()),
49
- provider: zod_1.z.nullable(infra_provider_schema_1.PartialInfraProviderSchema),
43
+ activeConfigProfileUuid: zod_1.z.nullable(zod_1.z.string().uuid()),
44
+ activeInbounds: zod_1.z.nullable(zod_1.z.array(config_profile_inbounds_schema_1.ConfigProfileInboundsSchema)),
50
45
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "2.0.0-alpha.27",
3
+ "version": "2.0.0-alpha.3",
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,16 +0,0 @@
1
- export declare const INFRA_BILLING_CONTROLLER: "infra-billing";
2
- export declare const INFRA_BILLING_ROUTES: {
3
- readonly GET_PROVIDERS: "providers";
4
- readonly CREATE_PROVIDER: "providers";
5
- readonly UPDATE_PROVIDER: "providers";
6
- readonly DELETE_PROVIDER: (uuid: string) => string;
7
- readonly GET_PROVIDER_BY_UUID: (uuid: string) => string;
8
- readonly GET_BILLING_NODES: "nodes";
9
- readonly CREATE_BILLING_NODE: "nodes";
10
- readonly UPDATE_BILLING_NODE: "nodes";
11
- readonly DELETE_BILLING_NODE: (uuid: string) => string;
12
- readonly GET_BILLING_HISTORY: "history";
13
- readonly CREATE_BILLING_HISTORY: "history";
14
- readonly DELETE_BILLING_HISTORY: (uuid: string) => string;
15
- };
16
- //# sourceMappingURL=infra-billing.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"infra-billing.d.ts","sourceRoot":"","sources":["../../../../api/controllers/infra-billing.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,EAAG,eAAwB,CAAC;AAEjE,eAAO,MAAM,oBAAoB;;;;qCAIL,MAAM;0CACD,MAAM;;;;yCAKP,MAAM;;;4CAIH,MAAM;CAC/B,CAAC"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.INFRA_BILLING_ROUTES = exports.INFRA_BILLING_CONTROLLER = void 0;
4
- exports.INFRA_BILLING_CONTROLLER = 'infra-billing';
5
- exports.INFRA_BILLING_ROUTES = {
6
- GET_PROVIDERS: 'providers', // Get list of all providers // get
7
- CREATE_PROVIDER: 'providers', // Create new provider // post
8
- UPDATE_PROVIDER: 'providers', // Update provider by uuid // patch
9
- DELETE_PROVIDER: (uuid) => `providers/${uuid}`, // Delete provider by uuid // delete
10
- GET_PROVIDER_BY_UUID: (uuid) => `providers/${uuid}`, // Get provider by uuid // get
11
- GET_BILLING_NODES: 'nodes', // Get list of all nodes billing // get
12
- CREATE_BILLING_NODE: 'nodes', // Create new node billing // post
13
- UPDATE_BILLING_NODE: 'nodes', // Update node billing by uuid // patch
14
- DELETE_BILLING_NODE: (uuid) => `nodes/${uuid}`, // Delete node billing by uuid // delete
15
- GET_BILLING_HISTORY: 'history', // Get list of all nodes billing history // get
16
- CREATE_BILLING_HISTORY: 'history', // Create new node billing history // post
17
- DELETE_BILLING_HISTORY: (uuid) => `history/${uuid}`, // Delete node billing history by uuid // delete
18
- };
@@ -1,125 +0,0 @@
1
- import { z } from 'zod';
2
- export declare namespace CreateInfraBillingHistoryRecordCommand {
3
- const url: "/api/infra-billing/history";
4
- const TSQ_url: "/api/infra-billing/history";
5
- const endpointDetails: import("../../constants").EndpointDetails;
6
- const RequestSchema: z.ZodObject<{
7
- providerUuid: z.ZodString;
8
- amount: z.ZodNumber;
9
- billedAt: z.ZodEffects<z.ZodString, Date, string>;
10
- }, "strip", z.ZodTypeAny, {
11
- providerUuid: string;
12
- amount: number;
13
- billedAt: Date;
14
- }, {
15
- providerUuid: string;
16
- amount: number;
17
- billedAt: string;
18
- }>;
19
- type Request = z.infer<typeof RequestSchema>;
20
- const ResponseSchema: z.ZodObject<{
21
- response: z.ZodObject<{
22
- records: z.ZodArray<z.ZodObject<{
23
- uuid: z.ZodString;
24
- providerUuid: z.ZodString;
25
- amount: z.ZodNumber;
26
- billedAt: z.ZodEffects<z.ZodString, Date, string>;
27
- provider: z.ZodObject<Omit<{
28
- uuid: z.ZodString;
29
- name: z.ZodString;
30
- faviconLink: z.ZodNullable<z.ZodString>;
31
- loginUrl: z.ZodNullable<z.ZodString>;
32
- createdAt: z.ZodEffects<z.ZodString, Date, string>;
33
- updatedAt: z.ZodEffects<z.ZodString, Date, string>;
34
- }, "createdAt" | "updatedAt" | "loginUrl">, "strip", z.ZodTypeAny, {
35
- uuid: string;
36
- name: string;
37
- faviconLink: string | null;
38
- }, {
39
- uuid: string;
40
- name: string;
41
- faviconLink: string | null;
42
- }>;
43
- }, "strip", z.ZodTypeAny, {
44
- uuid: string;
45
- providerUuid: string;
46
- provider: {
47
- uuid: string;
48
- name: string;
49
- faviconLink: string | null;
50
- };
51
- amount: number;
52
- billedAt: Date;
53
- }, {
54
- uuid: string;
55
- providerUuid: string;
56
- provider: {
57
- uuid: string;
58
- name: string;
59
- faviconLink: string | null;
60
- };
61
- amount: number;
62
- billedAt: string;
63
- }>, "many">;
64
- total: z.ZodNumber;
65
- }, "strip", z.ZodTypeAny, {
66
- total: number;
67
- records: {
68
- uuid: string;
69
- providerUuid: string;
70
- provider: {
71
- uuid: string;
72
- name: string;
73
- faviconLink: string | null;
74
- };
75
- amount: number;
76
- billedAt: Date;
77
- }[];
78
- }, {
79
- total: number;
80
- records: {
81
- uuid: string;
82
- providerUuid: string;
83
- provider: {
84
- uuid: string;
85
- name: string;
86
- faviconLink: string | null;
87
- };
88
- amount: number;
89
- billedAt: string;
90
- }[];
91
- }>;
92
- }, "strip", z.ZodTypeAny, {
93
- response: {
94
- total: number;
95
- records: {
96
- uuid: string;
97
- providerUuid: string;
98
- provider: {
99
- uuid: string;
100
- name: string;
101
- faviconLink: string | null;
102
- };
103
- amount: number;
104
- billedAt: Date;
105
- }[];
106
- };
107
- }, {
108
- response: {
109
- total: number;
110
- records: {
111
- uuid: string;
112
- providerUuid: string;
113
- provider: {
114
- uuid: string;
115
- name: string;
116
- faviconLink: string | null;
117
- };
118
- amount: number;
119
- billedAt: string;
120
- }[];
121
- };
122
- }>;
123
- type Response = z.infer<typeof ResponseSchema>;
124
- }
125
- //# sourceMappingURL=create-bill-record.command.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-bill-record.command.d.ts","sourceRoot":"","sources":["../../../../commands/infra-billing/create-bill-record.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,sCAAsC,CAAC;IAC7C,MAAM,GAAG,8BAAgD,CAAC;IAC1D,MAAM,OAAO,8BAAM,CAAC;IAEpB,MAAM,eAAe,2CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;;;;;;;MAUxB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAKzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreateInfraBillingHistoryRecordCommand = void 0;
4
- const zod_1 = require("zod");
5
- const models_1 = require("../../models");
6
- const api_1 = require("../../api");
7
- const constants_1 = require("../../constants");
8
- var CreateInfraBillingHistoryRecordCommand;
9
- (function (CreateInfraBillingHistoryRecordCommand) {
10
- CreateInfraBillingHistoryRecordCommand.url = api_1.REST_API.INFRA_BILLING.CREATE_BILLING_HISTORY;
11
- CreateInfraBillingHistoryRecordCommand.TSQ_url = CreateInfraBillingHistoryRecordCommand.url;
12
- CreateInfraBillingHistoryRecordCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.INFRA_BILLING_ROUTES.CREATE_BILLING_HISTORY, 'post', 'Create infra billing history');
13
- CreateInfraBillingHistoryRecordCommand.RequestSchema = zod_1.z.object({
14
- providerUuid: zod_1.z.string().uuid(),
15
- amount: zod_1.z.number().min(0, 'Amount must be greater than 0'),
16
- billedAt: zod_1.z
17
- .string({
18
- invalid_type_error: 'Invalid date format',
19
- })
20
- .datetime({ message: 'Invalid date format', offset: true, local: true })
21
- .transform((str) => new Date(str))
22
- .describe('Billing date. Format: 2025-01-17T15:38:45.065Z'),
23
- });
24
- CreateInfraBillingHistoryRecordCommand.ResponseSchema = zod_1.z.object({
25
- response: zod_1.z.object({
26
- records: zod_1.z.array(models_1.InfraBillingHistoryRecordSchema),
27
- total: zod_1.z.number(),
28
- }),
29
- });
30
- })(CreateInfraBillingHistoryRecordCommand || (exports.CreateInfraBillingHistoryRecordCommand = CreateInfraBillingHistoryRecordCommand = {}));