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

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 (146) 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/create.command.d.ts +6 -6
  15. package/build/backend/commands/hosts/create.command.d.ts.map +1 -1
  16. package/build/backend/commands/hosts/create.command.js +4 -2
  17. package/build/backend/commands/index.d.ts +1 -0
  18. package/build/backend/commands/index.d.ts.map +1 -1
  19. package/build/backend/commands/index.js +1 -0
  20. package/build/backend/commands/infra-billing/create-bill-record.command.d.ts +125 -0
  21. package/build/backend/commands/infra-billing/create-bill-record.command.d.ts.map +1 -0
  22. package/build/backend/commands/infra-billing/create-bill-record.command.js +30 -0
  23. package/build/backend/commands/infra-billing/create-billing-node.command.d.ts +413 -0
  24. package/build/backend/commands/infra-billing/create-billing-node.command.d.ts.map +1 -0
  25. package/build/backend/commands/infra-billing/create-billing-node.command.js +38 -0
  26. package/build/backend/commands/infra-billing/create-infra-provider.command.d.ts +123 -0
  27. package/build/backend/commands/infra-billing/create-infra-provider.command.d.ts.map +1 -0
  28. package/build/backend/commands/infra-billing/create-infra-provider.command.js +24 -0
  29. package/build/backend/commands/infra-billing/delete-bill-record-by-uuid.command.d.ts +119 -0
  30. package/build/backend/commands/infra-billing/delete-bill-record-by-uuid.command.d.ts.map +1 -0
  31. package/build/backend/commands/infra-billing/delete-bill-record-by-uuid.command.js +22 -0
  32. package/build/backend/commands/infra-billing/delete-billing-node-by-uuid.command.d.ts +407 -0
  33. package/build/backend/commands/infra-billing/delete-billing-node-by-uuid.command.d.ts.map +1 -0
  34. package/build/backend/commands/infra-billing/delete-billing-node-by-uuid.command.js +29 -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-bill-records.command.d.ts +122 -0
  39. package/build/backend/commands/infra-billing/get-bill-records.command.d.ts.map +1 -0
  40. package/build/backend/commands/infra-billing/get-bill-records.command.js +31 -0
  41. package/build/backend/commands/infra-billing/get-blling-nodes.command.d.ts +399 -0
  42. package/build/backend/commands/infra-billing/get-blling-nodes.command.d.ts.map +1 -0
  43. package/build/backend/commands/infra-billing/get-blling-nodes.command.js +26 -0
  44. package/build/backend/commands/infra-billing/get-infra-provider-by-uuid.command.d.ts +117 -0
  45. package/build/backend/commands/infra-billing/get-infra-provider-by-uuid.command.d.ts.map +1 -0
  46. package/build/backend/commands/infra-billing/get-infra-provider-by-uuid.command.js +19 -0
  47. package/build/backend/commands/infra-billing/get-infra-providers.command.d.ts +156 -0
  48. package/build/backend/commands/infra-billing/get-infra-providers.command.d.ts.map +1 -0
  49. package/build/backend/commands/infra-billing/get-infra-providers.command.js +19 -0
  50. package/build/backend/commands/infra-billing/index.d.ts +13 -0
  51. package/build/backend/commands/infra-billing/index.d.ts.map +1 -0
  52. package/build/backend/commands/infra-billing/index.js +28 -0
  53. package/build/backend/commands/infra-billing/update-billing-node.command.d.ts +410 -0
  54. package/build/backend/commands/infra-billing/update-billing-node.command.d.ts.map +1 -0
  55. package/build/backend/commands/infra-billing/update-billing-node.command.js +35 -0
  56. package/build/backend/commands/infra-billing/update-infra-provider.command.d.ts +126 -0
  57. package/build/backend/commands/infra-billing/update-infra-provider.command.d.ts.map +1 -0
  58. package/build/backend/commands/infra-billing/update-infra-provider.command.js +26 -0
  59. package/build/backend/commands/internal-squads/create-internal-squad.command.js +2 -2
  60. package/build/backend/commands/nodes/actions/disable.command.d.ts +59 -0
  61. package/build/backend/commands/nodes/actions/disable.command.d.ts.map +1 -1
  62. package/build/backend/commands/nodes/actions/enable.command.d.ts +59 -0
  63. package/build/backend/commands/nodes/actions/enable.command.d.ts.map +1 -1
  64. package/build/backend/commands/nodes/actions/reorder.command.d.ts +82 -0
  65. package/build/backend/commands/nodes/actions/reorder.command.d.ts.map +1 -1
  66. package/build/backend/commands/nodes/create.command.d.ts +62 -0
  67. package/build/backend/commands/nodes/create.command.d.ts.map +1 -1
  68. package/build/backend/commands/nodes/create.command.js +1 -0
  69. package/build/backend/commands/nodes/get-all.command.d.ts +59 -0
  70. package/build/backend/commands/nodes/get-all.command.d.ts.map +1 -1
  71. package/build/backend/commands/nodes/get-one.command.d.ts +59 -0
  72. package/build/backend/commands/nodes/get-one.command.d.ts.map +1 -1
  73. package/build/backend/commands/nodes/stats/get-node-user-usage-by-range.command.d.ts +4 -4
  74. package/build/backend/commands/nodes/stats/get-nodes-usage-by-range.command.d.ts +4 -4
  75. package/build/backend/commands/nodes/update.command.d.ts +85 -0
  76. package/build/backend/commands/nodes/update.command.d.ts.map +1 -1
  77. package/build/backend/commands/nodes/update.command.js +1 -0
  78. package/build/backend/commands/users/get-user-accessible-nodes.command.d.ts +114 -0
  79. package/build/backend/commands/users/get-user-accessible-nodes.command.d.ts.map +1 -0
  80. package/build/backend/commands/users/get-user-accessible-nodes.command.js +31 -0
  81. package/build/backend/commands/users/get-user-usage-by-range.command.d.ts +4 -4
  82. package/build/backend/commands/users/index.d.ts +1 -0
  83. package/build/backend/commands/users/index.d.ts.map +1 -1
  84. package/build/backend/commands/users/index.js +1 -0
  85. package/build/backend/constants/errors/errors.d.ts +75 -0
  86. package/build/backend/constants/errors/errors.d.ts.map +1 -1
  87. package/build/backend/constants/errors/errors.js +75 -0
  88. package/build/backend/constants/events/events.d.ts +11 -0
  89. package/build/backend/constants/events/events.d.ts.map +1 -1
  90. package/build/backend/constants/events/events.js +10 -0
  91. package/build/backend/constants/templates/template-keys.d.ts +1 -1
  92. package/build/backend/constants/templates/template-keys.d.ts.map +1 -1
  93. package/build/backend/constants/templates/template-keys.js +1 -0
  94. package/build/backend/models/index.d.ts +4 -0
  95. package/build/backend/models/index.d.ts.map +1 -1
  96. package/build/backend/models/index.js +4 -0
  97. package/build/backend/models/infra-billing-available-node.schema.d.ts +90 -0
  98. package/build/backend/models/infra-billing-available-node.schema.d.ts.map +1 -0
  99. package/build/backend/models/infra-billing-available-node.schema.js +9 -0
  100. package/build/backend/models/infra-billing-history-record.schema.d.ts +44 -0
  101. package/build/backend/models/infra-billing-history-record.schema.d.ts.map +1 -0
  102. package/build/backend/models/infra-billing-history-record.schema.js +19 -0
  103. package/build/backend/models/infra-billing-node.schema.d.ts +153 -0
  104. package/build/backend/models/infra-billing-node.schema.d.ts.map +1 -0
  105. package/build/backend/models/infra-billing-node.schema.js +34 -0
  106. package/build/backend/models/infra-provider.schema.d.ts +87 -0
  107. package/build/backend/models/infra-provider.schema.d.ts.map +1 -0
  108. package/build/backend/models/infra-provider.schema.js +41 -0
  109. package/build/backend/models/nodes.schema.d.ts +41 -0
  110. package/build/backend/models/nodes.schema.d.ts.map +1 -1
  111. package/build/backend/models/nodes.schema.js +3 -0
  112. package/build/frontend/api/controllers/index.js +1 -0
  113. package/build/frontend/api/controllers/infra-billing.js +18 -0
  114. package/build/frontend/api/controllers/users.js +1 -0
  115. package/build/frontend/api/routes.js +15 -0
  116. package/build/frontend/commands/config-profiles/create-config-profile.command.js +2 -2
  117. package/build/frontend/commands/hosts/create.command.js +4 -2
  118. package/build/frontend/commands/index.js +1 -0
  119. package/build/frontend/commands/infra-billing/create-bill-record.command.js +30 -0
  120. package/build/frontend/commands/infra-billing/create-billing-node.command.js +38 -0
  121. package/build/frontend/commands/infra-billing/create-infra-provider.command.js +24 -0
  122. package/build/frontend/commands/infra-billing/delete-bill-record-by-uuid.command.js +22 -0
  123. package/build/frontend/commands/infra-billing/delete-billing-node-by-uuid.command.js +29 -0
  124. package/build/frontend/commands/infra-billing/delete-infra-provider-by-uuid.command.js +20 -0
  125. package/build/frontend/commands/infra-billing/get-bill-records.command.js +31 -0
  126. package/build/frontend/commands/infra-billing/get-blling-nodes.command.js +26 -0
  127. package/build/frontend/commands/infra-billing/get-infra-provider-by-uuid.command.js +19 -0
  128. package/build/frontend/commands/infra-billing/get-infra-providers.command.js +19 -0
  129. package/build/frontend/commands/infra-billing/index.js +28 -0
  130. package/build/frontend/commands/infra-billing/update-billing-node.command.js +35 -0
  131. package/build/frontend/commands/infra-billing/update-infra-provider.command.js +26 -0
  132. package/build/frontend/commands/internal-squads/create-internal-squad.command.js +2 -2
  133. package/build/frontend/commands/nodes/create.command.js +1 -0
  134. package/build/frontend/commands/nodes/update.command.js +1 -0
  135. package/build/frontend/commands/users/get-user-accessible-nodes.command.js +31 -0
  136. package/build/frontend/commands/users/index.js +1 -0
  137. package/build/frontend/constants/errors/errors.js +75 -0
  138. package/build/frontend/constants/events/events.js +10 -0
  139. package/build/frontend/constants/templates/template-keys.js +1 -0
  140. package/build/frontend/models/index.js +4 -0
  141. package/build/frontend/models/infra-billing-available-node.schema.js +9 -0
  142. package/build/frontend/models/infra-billing-history-record.schema.js +19 -0
  143. package/build/frontend/models/infra-billing-node.schema.js +34 -0
  144. package/build/frontend/models/infra-provider.schema.js +41 -0
  145. package/build/frontend/models/nodes.schema.js +3 -0
  146. package/package.json +1 -1
@@ -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.20",
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.",