@remnawave/backend-contract 2.0.0-alpha.2 → 2.0.0-alpha.21

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 (170) hide show
  1. package/build/backend/api/controllers/index.d.ts +1 -0
  2. package/build/backend/api/controllers/index.d.ts.map +1 -1
  3. package/build/backend/api/controllers/index.js +1 -0
  4. package/build/backend/api/controllers/infra-billing.d.ts +16 -0
  5. package/build/backend/api/controllers/infra-billing.d.ts.map +1 -0
  6. package/build/backend/api/controllers/infra-billing.js +18 -0
  7. package/build/backend/api/controllers/users.d.ts +1 -0
  8. package/build/backend/api/controllers/users.d.ts.map +1 -1
  9. package/build/backend/api/controllers/users.js +1 -0
  10. package/build/backend/api/routes.d.ts +15 -0
  11. package/build/backend/api/routes.d.ts.map +1 -1
  12. package/build/backend/api/routes.js +15 -0
  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 +26 -10
  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 +26 -10
  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 +26 -10
  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 +26 -10
  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 +26 -10
  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 +44 -19
  25. package/build/backend/commands/hosts/create.command.d.ts.map +1 -1
  26. package/build/backend/commands/hosts/create.command.js +7 -11
  27. package/build/backend/commands/hosts/get-all.command.d.ts +26 -10
  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 +26 -10
  30. package/build/backend/commands/hosts/get-one.command.d.ts.map +1 -1
  31. package/build/backend/commands/hosts/reorder.command.d.ts +10 -2
  32. package/build/backend/commands/hosts/reorder.command.d.ts.map +1 -1
  33. package/build/backend/commands/hosts/update.command.d.ts +54 -21
  34. package/build/backend/commands/hosts/update.command.d.ts.map +1 -1
  35. package/build/backend/commands/hosts/update.command.js +4 -11
  36. package/build/backend/commands/index.d.ts +1 -0
  37. package/build/backend/commands/index.d.ts.map +1 -1
  38. package/build/backend/commands/index.js +1 -0
  39. package/build/backend/commands/infra-billing/create-bill-record.command.d.ts +125 -0
  40. package/build/backend/commands/infra-billing/create-bill-record.command.d.ts.map +1 -0
  41. package/build/backend/commands/infra-billing/create-bill-record.command.js +30 -0
  42. package/build/backend/commands/infra-billing/create-billing-node.command.d.ts +413 -0
  43. package/build/backend/commands/infra-billing/create-billing-node.command.d.ts.map +1 -0
  44. package/build/backend/commands/infra-billing/create-billing-node.command.js +38 -0
  45. package/build/backend/commands/infra-billing/create-infra-provider.command.d.ts +123 -0
  46. package/build/backend/commands/infra-billing/create-infra-provider.command.d.ts.map +1 -0
  47. package/build/backend/commands/infra-billing/create-infra-provider.command.js +24 -0
  48. package/build/backend/commands/infra-billing/delete-bill-record-by-uuid.command.d.ts +119 -0
  49. package/build/backend/commands/infra-billing/delete-bill-record-by-uuid.command.d.ts.map +1 -0
  50. package/build/backend/commands/infra-billing/delete-bill-record-by-uuid.command.js +22 -0
  51. package/build/backend/commands/infra-billing/delete-billing-node-by-uuid.command.d.ts +407 -0
  52. package/build/backend/commands/infra-billing/delete-billing-node-by-uuid.command.d.ts.map +1 -0
  53. package/build/backend/commands/infra-billing/delete-billing-node-by-uuid.command.js +29 -0
  54. package/build/backend/commands/infra-billing/delete-infra-provider-by-uuid.command.d.ts +33 -0
  55. package/build/backend/commands/infra-billing/delete-infra-provider-by-uuid.command.d.ts.map +1 -0
  56. package/build/backend/commands/infra-billing/delete-infra-provider-by-uuid.command.js +20 -0
  57. package/build/backend/commands/infra-billing/get-bill-records.command.d.ts +122 -0
  58. package/build/backend/commands/infra-billing/get-bill-records.command.d.ts.map +1 -0
  59. package/build/backend/commands/infra-billing/get-bill-records.command.js +31 -0
  60. package/build/backend/commands/infra-billing/get-blling-nodes.command.d.ts +399 -0
  61. package/build/backend/commands/infra-billing/get-blling-nodes.command.d.ts.map +1 -0
  62. package/build/backend/commands/infra-billing/get-blling-nodes.command.js +26 -0
  63. package/build/backend/commands/infra-billing/get-infra-provider-by-uuid.command.d.ts +117 -0
  64. package/build/backend/commands/infra-billing/get-infra-provider-by-uuid.command.d.ts.map +1 -0
  65. package/build/backend/commands/infra-billing/get-infra-provider-by-uuid.command.js +19 -0
  66. package/build/backend/commands/infra-billing/get-infra-providers.command.d.ts +156 -0
  67. package/build/backend/commands/infra-billing/get-infra-providers.command.d.ts.map +1 -0
  68. package/build/backend/commands/infra-billing/get-infra-providers.command.js +19 -0
  69. package/build/backend/commands/infra-billing/index.d.ts +13 -0
  70. package/build/backend/commands/infra-billing/index.d.ts.map +1 -0
  71. package/build/backend/commands/infra-billing/index.js +28 -0
  72. package/build/backend/commands/infra-billing/update-billing-node.command.d.ts +410 -0
  73. package/build/backend/commands/infra-billing/update-billing-node.command.d.ts.map +1 -0
  74. package/build/backend/commands/infra-billing/update-billing-node.command.js +35 -0
  75. package/build/backend/commands/infra-billing/update-infra-provider.command.d.ts +126 -0
  76. package/build/backend/commands/infra-billing/update-infra-provider.command.d.ts.map +1 -0
  77. package/build/backend/commands/infra-billing/update-infra-provider.command.js +26 -0
  78. package/build/backend/commands/internal-squads/create-internal-squad.command.js +2 -2
  79. package/build/backend/commands/nodes/actions/disable.command.d.ts +59 -0
  80. package/build/backend/commands/nodes/actions/disable.command.d.ts.map +1 -1
  81. package/build/backend/commands/nodes/actions/enable.command.d.ts +59 -0
  82. package/build/backend/commands/nodes/actions/enable.command.d.ts.map +1 -1
  83. package/build/backend/commands/nodes/actions/reorder.command.d.ts +82 -0
  84. package/build/backend/commands/nodes/actions/reorder.command.d.ts.map +1 -1
  85. package/build/backend/commands/nodes/create.command.d.ts +62 -0
  86. package/build/backend/commands/nodes/create.command.d.ts.map +1 -1
  87. package/build/backend/commands/nodes/create.command.js +1 -0
  88. package/build/backend/commands/nodes/get-all.command.d.ts +59 -0
  89. package/build/backend/commands/nodes/get-all.command.d.ts.map +1 -1
  90. package/build/backend/commands/nodes/get-one.command.d.ts +59 -0
  91. package/build/backend/commands/nodes/get-one.command.d.ts.map +1 -1
  92. package/build/backend/commands/nodes/stats/get-node-user-usage-by-range.command.d.ts +4 -4
  93. package/build/backend/commands/nodes/stats/get-nodes-usage-by-range.command.d.ts +4 -4
  94. package/build/backend/commands/nodes/update.command.d.ts +85 -0
  95. package/build/backend/commands/nodes/update.command.d.ts.map +1 -1
  96. package/build/backend/commands/nodes/update.command.js +1 -0
  97. package/build/backend/commands/users/get-user-accessible-nodes.command.d.ts +114 -0
  98. package/build/backend/commands/users/get-user-accessible-nodes.command.d.ts.map +1 -0
  99. package/build/backend/commands/users/get-user-accessible-nodes.command.js +31 -0
  100. package/build/backend/commands/users/get-user-usage-by-range.command.d.ts +4 -4
  101. package/build/backend/commands/users/index.d.ts +1 -0
  102. package/build/backend/commands/users/index.d.ts.map +1 -1
  103. package/build/backend/commands/users/index.js +1 -0
  104. package/build/backend/constants/errors/errors.d.ts +75 -0
  105. package/build/backend/constants/errors/errors.d.ts.map +1 -1
  106. package/build/backend/constants/errors/errors.js +75 -0
  107. package/build/backend/constants/events/events.d.ts +11 -0
  108. package/build/backend/constants/events/events.d.ts.map +1 -1
  109. package/build/backend/constants/events/events.js +10 -0
  110. package/build/backend/constants/templates/template-keys.d.ts +1 -1
  111. package/build/backend/constants/templates/template-keys.d.ts.map +1 -1
  112. package/build/backend/constants/templates/template-keys.js +1 -0
  113. package/build/backend/models/hosts.schema.d.ts +18 -6
  114. package/build/backend/models/hosts.schema.d.ts.map +1 -1
  115. package/build/backend/models/hosts.schema.js +4 -2
  116. package/build/backend/models/index.d.ts +4 -0
  117. package/build/backend/models/index.d.ts.map +1 -1
  118. package/build/backend/models/index.js +4 -0
  119. package/build/backend/models/infra-billing-available-node.schema.d.ts +90 -0
  120. package/build/backend/models/infra-billing-available-node.schema.d.ts.map +1 -0
  121. package/build/backend/models/infra-billing-available-node.schema.js +9 -0
  122. package/build/backend/models/infra-billing-history-record.schema.d.ts +44 -0
  123. package/build/backend/models/infra-billing-history-record.schema.d.ts.map +1 -0
  124. package/build/backend/models/infra-billing-history-record.schema.js +19 -0
  125. package/build/backend/models/infra-billing-node.schema.d.ts +153 -0
  126. package/build/backend/models/infra-billing-node.schema.d.ts.map +1 -0
  127. package/build/backend/models/infra-billing-node.schema.js +34 -0
  128. package/build/backend/models/infra-provider.schema.d.ts +87 -0
  129. package/build/backend/models/infra-provider.schema.d.ts.map +1 -0
  130. package/build/backend/models/infra-provider.schema.js +41 -0
  131. package/build/backend/models/nodes.schema.d.ts +41 -0
  132. package/build/backend/models/nodes.schema.d.ts.map +1 -1
  133. package/build/backend/models/nodes.schema.js +3 -0
  134. package/build/frontend/api/controllers/index.js +1 -0
  135. package/build/frontend/api/controllers/infra-billing.js +18 -0
  136. package/build/frontend/api/controllers/users.js +1 -0
  137. package/build/frontend/api/routes.js +15 -0
  138. package/build/frontend/commands/config-profiles/create-config-profile.command.js +2 -2
  139. package/build/frontend/commands/hosts/create.command.js +7 -11
  140. package/build/frontend/commands/hosts/update.command.js +4 -11
  141. package/build/frontend/commands/index.js +1 -0
  142. package/build/frontend/commands/infra-billing/create-bill-record.command.js +30 -0
  143. package/build/frontend/commands/infra-billing/create-billing-node.command.js +38 -0
  144. package/build/frontend/commands/infra-billing/create-infra-provider.command.js +24 -0
  145. package/build/frontend/commands/infra-billing/delete-bill-record-by-uuid.command.js +22 -0
  146. package/build/frontend/commands/infra-billing/delete-billing-node-by-uuid.command.js +29 -0
  147. package/build/frontend/commands/infra-billing/delete-infra-provider-by-uuid.command.js +20 -0
  148. package/build/frontend/commands/infra-billing/get-bill-records.command.js +31 -0
  149. package/build/frontend/commands/infra-billing/get-blling-nodes.command.js +26 -0
  150. package/build/frontend/commands/infra-billing/get-infra-provider-by-uuid.command.js +19 -0
  151. package/build/frontend/commands/infra-billing/get-infra-providers.command.js +19 -0
  152. package/build/frontend/commands/infra-billing/index.js +28 -0
  153. package/build/frontend/commands/infra-billing/update-billing-node.command.js +35 -0
  154. package/build/frontend/commands/infra-billing/update-infra-provider.command.js +26 -0
  155. package/build/frontend/commands/internal-squads/create-internal-squad.command.js +2 -2
  156. package/build/frontend/commands/nodes/create.command.js +1 -0
  157. package/build/frontend/commands/nodes/update.command.js +1 -0
  158. package/build/frontend/commands/users/get-user-accessible-nodes.command.js +31 -0
  159. package/build/frontend/commands/users/index.js +1 -0
  160. package/build/frontend/constants/errors/errors.js +75 -0
  161. package/build/frontend/constants/events/events.js +10 -0
  162. package/build/frontend/constants/templates/template-keys.js +1 -0
  163. package/build/frontend/models/hosts.schema.js +4 -2
  164. package/build/frontend/models/index.js +4 -0
  165. package/build/frontend/models/infra-billing-available-node.schema.js +9 -0
  166. package/build/frontend/models/infra-billing-history-record.schema.js +19 -0
  167. package/build/frontend/models/infra-billing-node.schema.js +34 -0
  168. package/build/frontend/models/infra-provider.schema.js +41 -0
  169. package/build/frontend/models/nodes.schema.js +3 -0
  170. package/package.json +1 -1
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetInfraProviderByUuidCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ const constants_1 = require("../../constants");
7
+ const models_1 = require("../../models");
8
+ var GetInfraProviderByUuidCommand;
9
+ (function (GetInfraProviderByUuidCommand) {
10
+ GetInfraProviderByUuidCommand.url = api_1.REST_API.INFRA_BILLING.GET_PROVIDER_BY_UUID(':uuid');
11
+ GetInfraProviderByUuidCommand.TSQ_url = GetInfraProviderByUuidCommand.url;
12
+ GetInfraProviderByUuidCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.INFRA_BILLING_ROUTES.GET_PROVIDER_BY_UUID(':uuid'), 'get', 'Get infra provider by uuid');
13
+ GetInfraProviderByUuidCommand.RequestSchema = zod_1.z.object({
14
+ uuid: zod_1.z.string().uuid(),
15
+ });
16
+ GetInfraProviderByUuidCommand.ResponseSchema = zod_1.z.object({
17
+ response: models_1.InfraProviderSchema,
18
+ });
19
+ })(GetInfraProviderByUuidCommand || (exports.GetInfraProviderByUuidCommand = GetInfraProviderByUuidCommand = {}));
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetInfraProvidersCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ const constants_1 = require("../../constants");
7
+ const models_1 = require("../../models");
8
+ var GetInfraProvidersCommand;
9
+ (function (GetInfraProvidersCommand) {
10
+ GetInfraProvidersCommand.url = api_1.REST_API.INFRA_BILLING.GET_PROVIDERS;
11
+ GetInfraProvidersCommand.TSQ_url = GetInfraProvidersCommand.url;
12
+ GetInfraProvidersCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.INFRA_BILLING_ROUTES.GET_PROVIDERS, 'get', 'Get all infra providers');
13
+ GetInfraProvidersCommand.ResponseSchema = zod_1.z.object({
14
+ response: zod_1.z.object({
15
+ total: zod_1.z.number(),
16
+ providers: zod_1.z.array(models_1.InfraProviderSchema),
17
+ }),
18
+ });
19
+ })(GetInfraProvidersCommand || (exports.GetInfraProvidersCommand = GetInfraProvidersCommand = {}));
@@ -0,0 +1,28 @@
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("./create-bill-record.command"), exports);
18
+ __exportStar(require("./create-billing-node.command"), exports);
19
+ __exportStar(require("./create-infra-provider.command"), exports);
20
+ __exportStar(require("./delete-bill-record-by-uuid.command"), exports);
21
+ __exportStar(require("./delete-billing-node-by-uuid.command"), exports);
22
+ __exportStar(require("./delete-infra-provider-by-uuid.command"), exports);
23
+ __exportStar(require("./get-bill-records.command"), exports);
24
+ __exportStar(require("./get-blling-nodes.command"), exports);
25
+ __exportStar(require("./get-infra-provider-by-uuid.command"), exports);
26
+ __exportStar(require("./get-infra-providers.command"), exports);
27
+ __exportStar(require("./update-billing-node.command"), exports);
28
+ __exportStar(require("./update-infra-provider.command"), exports);
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateInfraBillingNodeCommand = 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 UpdateInfraBillingNodeCommand;
9
+ (function (UpdateInfraBillingNodeCommand) {
10
+ UpdateInfraBillingNodeCommand.url = api_1.REST_API.INFRA_BILLING.UPDATE_BILLING_NODE;
11
+ UpdateInfraBillingNodeCommand.TSQ_url = UpdateInfraBillingNodeCommand.url;
12
+ UpdateInfraBillingNodeCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.INFRA_BILLING_ROUTES.UPDATE_BILLING_NODE, 'patch', 'Update infra billing node');
13
+ UpdateInfraBillingNodeCommand.RequestSchema = zod_1.z.object({
14
+ uuid: zod_1.z.string().uuid(),
15
+ nextBillingAt: zod_1.z
16
+ .string({
17
+ invalid_type_error: 'Invalid date format',
18
+ })
19
+ .datetime({ message: 'Invalid date format', offset: true, local: true })
20
+ .transform((str) => new Date(str)),
21
+ });
22
+ UpdateInfraBillingNodeCommand.ResponseSchema = zod_1.z.object({
23
+ response: zod_1.z.object({
24
+ totalBillingNodes: zod_1.z.number(),
25
+ billingNodes: zod_1.z.array(models_1.InfraBillingNodeSchema),
26
+ availableBillingNodes: zod_1.z.array(models_1.InfraBillingAvailableNodeSchema),
27
+ totalAvailableBillingNodes: zod_1.z.number(),
28
+ stats: zod_1.z.object({
29
+ upcomingNodesCount: zod_1.z.number(),
30
+ currentMonthPayments: zod_1.z.number(),
31
+ totalSpent: zod_1.z.number(),
32
+ }),
33
+ }),
34
+ });
35
+ })(UpdateInfraBillingNodeCommand || (exports.UpdateInfraBillingNodeCommand = UpdateInfraBillingNodeCommand = {}));
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateInfraProviderCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ const constants_1 = require("../../constants");
7
+ const models_1 = require("../../models");
8
+ var UpdateInfraProviderCommand;
9
+ (function (UpdateInfraProviderCommand) {
10
+ UpdateInfraProviderCommand.url = api_1.REST_API.INFRA_BILLING.UPDATE_PROVIDER;
11
+ UpdateInfraProviderCommand.TSQ_url = UpdateInfraProviderCommand.url;
12
+ UpdateInfraProviderCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.INFRA_BILLING_ROUTES.UPDATE_PROVIDER, 'patch', 'Update infra provider');
13
+ UpdateInfraProviderCommand.RequestSchema = zod_1.z.object({
14
+ uuid: zod_1.z.string().uuid(),
15
+ name: zod_1.z
16
+ .string()
17
+ .min(2, 'Name must be at least 2 characters')
18
+ .max(30, 'Name must be less than 255 characters')
19
+ .optional(),
20
+ faviconLink: zod_1.z.optional(zod_1.z.nullable(zod_1.z.string().url())),
21
+ loginUrl: zod_1.z.optional(zod_1.z.nullable(zod_1.z.string().url())),
22
+ });
23
+ UpdateInfraProviderCommand.ResponseSchema = zod_1.z.object({
24
+ response: models_1.InfraProviderSchema,
25
+ });
26
+ })(UpdateInfraProviderCommand || (exports.UpdateInfraProviderCommand = UpdateInfraProviderCommand = {}));
@@ -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(6, 'Name must be at least 6 characters')
17
- .max(16, 'Name must be less than 16 characters')
16
+ .min(2, 'Name must be at least 2 characters')
17
+ .max(20, 'Name must be less than 20 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
  });
@@ -39,6 +39,7 @@ var CreateNodeCommand;
39
39
  activeInbounds: zod_1.z.optional(zod_1.z.array(zod_1.z.string().uuid(), {
40
40
  invalid_type_error: 'Active inbounds must be an array of UUIDs',
41
41
  })),
42
+ providerUuid: zod_1.z.optional(zod_1.z.nullable(zod_1.z.string().uuid())),
42
43
  });
43
44
  CreateNodeCommand.ResponseSchema = zod_1.z.object({
44
45
  response: models_1.NodesSchema,
@@ -35,6 +35,7 @@ var UpdateNodeCommand;
35
35
  activeInbounds: zod_1.z.optional(zod_1.z.array(zod_1.z.string().uuid(), {
36
36
  invalid_type_error: 'Active inbounds must be an array of UUIDs',
37
37
  })),
38
+ providerUuid: zod_1.z.optional(zod_1.z.nullable(zod_1.z.string().uuid())),
38
39
  });
39
40
  UpdateNodeCommand.ResponseSchema = zod_1.z.object({
40
41
  response: models_1.NodesSchema,
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetUserAccessibleNodesCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../constants");
6
+ const api_1 = require("../../api");
7
+ var GetUserAccessibleNodesCommand;
8
+ (function (GetUserAccessibleNodesCommand) {
9
+ GetUserAccessibleNodesCommand.url = api_1.REST_API.USERS.ACCESSIBLE_NODES;
10
+ GetUserAccessibleNodesCommand.TSQ_url = GetUserAccessibleNodesCommand.url(':uuid');
11
+ GetUserAccessibleNodesCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.ACCESSIBLE_NODES(':uuid'), 'get', 'Get user accessible nodes');
12
+ GetUserAccessibleNodesCommand.RequestSchema = zod_1.z.object({
13
+ uuid: zod_1.z.string().uuid(),
14
+ });
15
+ GetUserAccessibleNodesCommand.ResponseSchema = zod_1.z.object({
16
+ response: zod_1.z.object({
17
+ userUuid: zod_1.z.string().uuid(),
18
+ activeNodes: zod_1.z.array(zod_1.z.object({
19
+ uuid: zod_1.z.string().uuid(),
20
+ nodeName: zod_1.z.string(),
21
+ countryCode: zod_1.z.string(),
22
+ configProfileUuid: zod_1.z.string().uuid(),
23
+ configProfileName: zod_1.z.string(),
24
+ activeSquads: zod_1.z.array(zod_1.z.object({
25
+ squadName: zod_1.z.string(),
26
+ activeInbounds: zod_1.z.array(zod_1.z.string()),
27
+ })),
28
+ })),
29
+ }),
30
+ });
31
+ })(GetUserAccessibleNodesCommand || (exports.GetUserAccessibleNodesCommand = GetUserAccessibleNodesCommand = {}));
@@ -21,6 +21,7 @@ __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);
24
25
  __exportStar(require("./get-user-by-uuid.command"), exports);
25
26
  __exportStar(require("./get-user-usage-by-range.command"), exports);
26
27
  __exportStar(require("./tags"), exports);
@@ -620,4 +620,79 @@ 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
+ },
623
698
  };
@@ -39,8 +39,18 @@ 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
+ },
42
51
  CATCH_ALL_USER_EVENTS: 'user.*',
43
52
  CATCH_ALL_NODE_EVENTS: 'node.*',
44
53
  CATCH_ALL_SERVICE_EVENTS: 'service.*',
45
54
  CATCH_ALL_ERRORS_EVENTS: 'errors.*',
55
+ CATCH_ALL_CRM_EVENTS: 'crm.*',
46
56
  };
@@ -11,4 +11,5 @@ exports.TEMPLATE_KEYS = [
11
11
  'EMAIL',
12
12
  'TELEGRAM_ID',
13
13
  'SUBSCRIPTION_URL',
14
+ 'TAG',
14
15
  ];
@@ -17,6 +17,8 @@ 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
- configProfileUuid: zod_1.z.string().uuid().nullable(),
21
- configProfileInboundUuid: zod_1.z.string().uuid().nullable(),
20
+ inbound: zod_1.z.object({
21
+ configProfileUuid: zod_1.z.string().uuid().nullable(),
22
+ configProfileInboundUuid: zod_1.z.string().uuid().nullable(),
23
+ }),
22
24
  });
@@ -24,6 +24,10 @@ __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);
27
31
  __exportStar(require("./internal-squad.schema"), exports);
28
32
  __exportStar(require("./last-connected-node.schema"), exports);
29
33
  __exportStar(require("./nodes.schema"), exports);
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InfraBillingAvailableNodeSchema = void 0;
4
+ const nodes_schema_1 = require("./nodes.schema");
5
+ exports.InfraBillingAvailableNodeSchema = nodes_schema_1.NodesSchema.pick({
6
+ uuid: true,
7
+ name: true,
8
+ countryCode: true,
9
+ });
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InfraBillingHistoryRecordSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const infra_provider_schema_1 = require("./infra-provider.schema");
6
+ exports.InfraBillingHistoryRecordSchema = zod_1.z.object({
7
+ uuid: zod_1.z.string().uuid(),
8
+ providerUuid: zod_1.z.string().uuid(),
9
+ amount: zod_1.z.number(),
10
+ billedAt: zod_1.z
11
+ .string()
12
+ .datetime()
13
+ .transform((str) => new Date(str)),
14
+ provider: infra_provider_schema_1.PartialInfraProviderSchema.omit({
15
+ createdAt: true,
16
+ updatedAt: true,
17
+ loginUrl: true,
18
+ }),
19
+ });
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InfraBillingNodeSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const infra_provider_schema_1 = require("./infra-provider.schema");
6
+ const nodes_schema_1 = require("./nodes.schema");
7
+ exports.InfraBillingNodeSchema = zod_1.z.object({
8
+ uuid: zod_1.z.string().uuid(),
9
+ nodeUuid: zod_1.z.string().uuid(),
10
+ providerUuid: zod_1.z.string().uuid(),
11
+ provider: infra_provider_schema_1.PartialInfraProviderSchema.pick({
12
+ uuid: true,
13
+ name: true,
14
+ loginUrl: true,
15
+ faviconLink: true,
16
+ }),
17
+ node: nodes_schema_1.NodesSchema.pick({
18
+ uuid: true,
19
+ name: true,
20
+ countryCode: true,
21
+ }),
22
+ nextBillingAt: zod_1.z
23
+ .string()
24
+ .datetime()
25
+ .transform((str) => new Date(str)),
26
+ createdAt: zod_1.z
27
+ .string()
28
+ .datetime()
29
+ .transform((str) => new Date(str)),
30
+ updatedAt: zod_1.z
31
+ .string()
32
+ .datetime()
33
+ .transform((str) => new Date(str)),
34
+ });
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PartialInfraProviderSchema = exports.InfraProviderSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.InfraProviderSchema = zod_1.z.object({
6
+ uuid: zod_1.z.string().uuid(),
7
+ name: zod_1.z.string(),
8
+ faviconLink: zod_1.z.nullable(zod_1.z.string()),
9
+ loginUrl: zod_1.z.nullable(zod_1.z.string()),
10
+ createdAt: zod_1.z
11
+ .string()
12
+ .datetime()
13
+ .transform((str) => new Date(str)),
14
+ updatedAt: zod_1.z
15
+ .string()
16
+ .datetime()
17
+ .transform((str) => new Date(str)),
18
+ billingHistory: zod_1.z.object({
19
+ totalAmount: zod_1.z.number(),
20
+ totalBills: zod_1.z.number(),
21
+ }),
22
+ billingNodes: zod_1.z.array(zod_1.z.object({
23
+ nodeUuid: zod_1.z.string(),
24
+ name: zod_1.z.string(),
25
+ countryCode: zod_1.z.string(),
26
+ })),
27
+ });
28
+ exports.PartialInfraProviderSchema = zod_1.z.object({
29
+ uuid: zod_1.z.string().uuid(),
30
+ name: zod_1.z.string(),
31
+ faviconLink: zod_1.z.nullable(zod_1.z.string()),
32
+ loginUrl: zod_1.z.nullable(zod_1.z.string()),
33
+ createdAt: zod_1.z
34
+ .string()
35
+ .datetime()
36
+ .transform((str) => new Date(str)),
37
+ updatedAt: zod_1.z
38
+ .string()
39
+ .datetime()
40
+ .transform((str) => new Date(str)),
41
+ });
@@ -3,6 +3,7 @@ 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");
6
7
  exports.NodesSchema = zod_1.z.object({
7
8
  uuid: zod_1.z.string().uuid(),
8
9
  name: zod_1.z.string(),
@@ -42,4 +43,6 @@ exports.NodesSchema = zod_1.z.object({
42
43
  .transform((str) => new Date(str)),
43
44
  activeConfigProfileUuid: zod_1.z.nullable(zod_1.z.string().uuid()),
44
45
  activeInbounds: zod_1.z.nullable(zod_1.z.array(config_profile_inbounds_schema_1.ConfigProfileInboundsSchema)),
46
+ providerUuid: zod_1.z.nullable(zod_1.z.string().uuid()),
47
+ provider: zod_1.z.nullable(infra_provider_schema_1.PartialInfraProviderSchema),
45
48
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "2.0.0-alpha.2",
3
+ "version": "2.0.0-alpha.21",
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.",