@remnawave/backend-contract 2.0.0-alpha.1 → 2.0.0-alpha.10

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 (126) 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 +22 -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.d.ts +7 -0
  14. package/build/backend/commands/config-profiles/create-config-profile.command.d.ts.map +1 -1
  15. package/build/backend/commands/config-profiles/create-config-profile.command.js +2 -2
  16. package/build/backend/commands/config-profiles/get-all-inbounds.command.d.ts +7 -0
  17. package/build/backend/commands/config-profiles/get-all-inbounds.command.d.ts.map +1 -1
  18. package/build/backend/commands/config-profiles/get-config-profile-by-uuid.command.d.ts +7 -0
  19. package/build/backend/commands/config-profiles/get-config-profile-by-uuid.command.d.ts.map +1 -1
  20. package/build/backend/commands/config-profiles/get-config-profiles.command.d.ts +9 -0
  21. package/build/backend/commands/config-profiles/get-config-profiles.command.d.ts.map +1 -1
  22. package/build/backend/commands/config-profiles/get-inbounds-by-profile-uuid.command.d.ts +7 -0
  23. package/build/backend/commands/config-profiles/get-inbounds-by-profile-uuid.command.d.ts.map +1 -1
  24. package/build/backend/commands/config-profiles/update-config-profile.command.d.ts +7 -0
  25. package/build/backend/commands/config-profiles/update-config-profile.command.d.ts.map +1 -1
  26. package/build/backend/commands/hosts/create.command.d.ts +6 -6
  27. package/build/backend/commands/hosts/create.command.d.ts.map +1 -1
  28. package/build/backend/commands/hosts/create.command.js +4 -2
  29. package/build/backend/commands/index.d.ts +1 -0
  30. package/build/backend/commands/index.d.ts.map +1 -1
  31. package/build/backend/commands/index.js +1 -0
  32. package/build/backend/commands/infra-billing/create-infra-provider.command.d.ts +123 -0
  33. package/build/backend/commands/infra-billing/create-infra-provider.command.d.ts.map +1 -0
  34. package/build/backend/commands/infra-billing/create-infra-provider.command.js +24 -0
  35. package/build/backend/commands/infra-billing/delete-infra-provider-by-uuid.command.d.ts +33 -0
  36. package/build/backend/commands/infra-billing/delete-infra-provider-by-uuid.command.d.ts.map +1 -0
  37. package/build/backend/commands/infra-billing/delete-infra-provider-by-uuid.command.js +20 -0
  38. package/build/backend/commands/infra-billing/get-infra-provider-by-uuid.command.d.ts +117 -0
  39. package/build/backend/commands/infra-billing/get-infra-provider-by-uuid.command.d.ts.map +1 -0
  40. package/build/backend/commands/infra-billing/get-infra-provider-by-uuid.command.js +19 -0
  41. package/build/backend/commands/infra-billing/get-infra-providers.command.d.ts +156 -0
  42. package/build/backend/commands/infra-billing/get-infra-providers.command.d.ts.map +1 -0
  43. package/build/backend/commands/infra-billing/get-infra-providers.command.js +19 -0
  44. package/build/backend/commands/infra-billing/index.d.ts +6 -0
  45. package/build/backend/commands/infra-billing/index.d.ts.map +1 -0
  46. package/build/backend/commands/infra-billing/index.js +21 -0
  47. package/build/backend/commands/infra-billing/update-infra-provider.command.d.ts +126 -0
  48. package/build/backend/commands/infra-billing/update-infra-provider.command.d.ts.map +1 -0
  49. package/build/backend/commands/infra-billing/update-infra-provider.command.js +26 -0
  50. package/build/backend/commands/internal-squads/create-internal-squad.command.d.ts +7 -0
  51. package/build/backend/commands/internal-squads/create-internal-squad.command.d.ts.map +1 -1
  52. package/build/backend/commands/internal-squads/create-internal-squad.command.js +2 -2
  53. package/build/backend/commands/internal-squads/get-internal-squad-by-uuid..d.ts +7 -0
  54. package/build/backend/commands/internal-squads/get-internal-squad-by-uuid..d.ts.map +1 -1
  55. package/build/backend/commands/internal-squads/get-internal-squads.command.d.ts +9 -0
  56. package/build/backend/commands/internal-squads/get-internal-squads.command.d.ts.map +1 -1
  57. package/build/backend/commands/internal-squads/update-internal-squad.command.d.ts +7 -0
  58. package/build/backend/commands/internal-squads/update-internal-squad.command.d.ts.map +1 -1
  59. package/build/backend/commands/nodes/actions/disable.command.d.ts +143 -0
  60. package/build/backend/commands/nodes/actions/disable.command.d.ts.map +1 -1
  61. package/build/backend/commands/nodes/actions/enable.command.d.ts +143 -0
  62. package/build/backend/commands/nodes/actions/enable.command.d.ts.map +1 -1
  63. package/build/backend/commands/nodes/actions/reorder.command.d.ts +210 -0
  64. package/build/backend/commands/nodes/actions/reorder.command.d.ts.map +1 -1
  65. package/build/backend/commands/nodes/create.command.d.ts +146 -0
  66. package/build/backend/commands/nodes/create.command.d.ts.map +1 -1
  67. package/build/backend/commands/nodes/create.command.js +1 -0
  68. package/build/backend/commands/nodes/get-all.command.d.ts +143 -0
  69. package/build/backend/commands/nodes/get-all.command.d.ts.map +1 -1
  70. package/build/backend/commands/nodes/get-one.command.d.ts +143 -0
  71. package/build/backend/commands/nodes/get-one.command.d.ts.map +1 -1
  72. package/build/backend/commands/nodes/stats/get-node-user-usage-by-range.command.d.ts +4 -4
  73. package/build/backend/commands/nodes/stats/get-nodes-usage-by-range.command.d.ts +4 -4
  74. package/build/backend/commands/nodes/update.command.d.ts +213 -0
  75. package/build/backend/commands/nodes/update.command.d.ts.map +1 -1
  76. package/build/backend/commands/nodes/update.command.js +1 -0
  77. package/build/backend/commands/users/get-user-accessible-nodes.command.d.ts +114 -0
  78. package/build/backend/commands/users/get-user-accessible-nodes.command.d.ts.map +1 -0
  79. package/build/backend/commands/users/get-user-accessible-nodes.command.js +31 -0
  80. package/build/backend/commands/users/get-user-usage-by-range.command.d.ts +4 -4
  81. package/build/backend/commands/users/index.d.ts +1 -0
  82. package/build/backend/commands/users/index.d.ts.map +1 -1
  83. package/build/backend/commands/users/index.js +1 -0
  84. package/build/backend/constants/errors/errors.d.ts +35 -0
  85. package/build/backend/constants/errors/errors.d.ts.map +1 -1
  86. package/build/backend/constants/errors/errors.js +35 -0
  87. package/build/backend/models/config-profile-inbounds.schema.d.ts +3 -0
  88. package/build/backend/models/config-profile-inbounds.schema.d.ts.map +1 -1
  89. package/build/backend/models/config-profile-inbounds.schema.js +1 -0
  90. package/build/backend/models/config-profile.schema.d.ts +5 -0
  91. package/build/backend/models/config-profile.schema.d.ts.map +1 -1
  92. package/build/backend/models/index.d.ts +1 -0
  93. package/build/backend/models/index.d.ts.map +1 -1
  94. package/build/backend/models/index.js +1 -0
  95. package/build/backend/models/infra-provider.schema.d.ts +65 -0
  96. package/build/backend/models/infra-provider.schema.d.ts.map +1 -0
  97. package/build/backend/models/infra-provider.schema.js +27 -0
  98. package/build/backend/models/internal-squad.schema.d.ts +5 -0
  99. package/build/backend/models/internal-squad.schema.d.ts.map +1 -1
  100. package/build/backend/models/nodes.schema.d.ts +105 -0
  101. package/build/backend/models/nodes.schema.d.ts.map +1 -1
  102. package/build/backend/models/nodes.schema.js +3 -0
  103. package/build/frontend/api/controllers/index.js +1 -0
  104. package/build/frontend/api/controllers/infra-billing.js +22 -0
  105. package/build/frontend/api/controllers/users.js +1 -0
  106. package/build/frontend/api/routes.js +15 -0
  107. package/build/frontend/commands/config-profiles/create-config-profile.command.js +2 -2
  108. package/build/frontend/commands/hosts/create.command.js +4 -2
  109. package/build/frontend/commands/index.js +1 -0
  110. package/build/frontend/commands/infra-billing/create-infra-provider.command.js +24 -0
  111. package/build/frontend/commands/infra-billing/delete-infra-provider-by-uuid.command.js +20 -0
  112. package/build/frontend/commands/infra-billing/get-infra-provider-by-uuid.command.js +19 -0
  113. package/build/frontend/commands/infra-billing/get-infra-providers.command.js +19 -0
  114. package/build/frontend/commands/infra-billing/index.js +21 -0
  115. package/build/frontend/commands/infra-billing/update-infra-provider.command.js +26 -0
  116. package/build/frontend/commands/internal-squads/create-internal-squad.command.js +2 -2
  117. package/build/frontend/commands/nodes/create.command.js +1 -0
  118. package/build/frontend/commands/nodes/update.command.js +1 -0
  119. package/build/frontend/commands/users/get-user-accessible-nodes.command.js +31 -0
  120. package/build/frontend/commands/users/index.js +1 -0
  121. package/build/frontend/constants/errors/errors.js +35 -0
  122. package/build/frontend/models/config-profile-inbounds.schema.js +1 -0
  123. package/build/frontend/models/index.js +1 -0
  124. package/build/frontend/models/infra-provider.schema.js +27 -0
  125. package/build/frontend/models/nodes.schema.js +3 -0
  126. package/package.json +1 -1
@@ -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,39 @@ 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
+ },
623
658
  };
@@ -10,4 +10,5 @@ exports.ConfigProfileInboundsSchema = zod_1.z.object({
10
10
  network: zod_1.z.nullable(zod_1.z.string()),
11
11
  security: zod_1.z.nullable(zod_1.z.string()),
12
12
  port: zod_1.z.nullable(zod_1.z.number()),
13
+ rawInbound: zod_1.z.nullable(zod_1.z.unknown()),
13
14
  });
@@ -24,6 +24,7 @@ __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-provider.schema"), exports);
27
28
  __exportStar(require("./internal-squad.schema"), exports);
28
29
  __exportStar(require("./last-connected-node.schema"), exports);
29
30
  __exportStar(require("./nodes.schema"), exports);
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ 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
+ });
@@ -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.InfraProviderSchema),
45
48
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-alpha.10",
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.",