@remnawave/backend-contract 2.8.26 → 2.8.28

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 (50) hide show
  1. package/build/backend/api/controllers/users.d.ts +1 -0
  2. package/build/backend/api/controllers/users.d.ts.map +1 -1
  3. package/build/backend/api/controllers/users.js +1 -0
  4. package/build/backend/api/routes.d.ts +1 -0
  5. package/build/backend/api/routes.d.ts.map +1 -1
  6. package/build/backend/api/routes.js +1 -0
  7. package/build/backend/commands/infra-billing/create-billing-node.command.d.ts +31 -21
  8. package/build/backend/commands/infra-billing/create-billing-node.command.d.ts.map +1 -1
  9. package/build/backend/commands/infra-billing/create-billing-node.command.js +2 -2
  10. package/build/backend/commands/infra-billing/create-infra-provider.command.d.ts +34 -14
  11. package/build/backend/commands/infra-billing/create-infra-provider.command.d.ts.map +1 -1
  12. package/build/backend/commands/infra-billing/delete-billing-node-by-uuid.command.d.ts +22 -15
  13. package/build/backend/commands/infra-billing/delete-billing-node-by-uuid.command.d.ts.map +1 -1
  14. package/build/backend/commands/infra-billing/get-billing-nodes.command.d.ts +22 -15
  15. package/build/backend/commands/infra-billing/get-billing-nodes.command.d.ts.map +1 -1
  16. package/build/backend/commands/infra-billing/get-infra-provider-by-uuid.command.d.ts +34 -14
  17. package/build/backend/commands/infra-billing/get-infra-provider-by-uuid.command.d.ts.map +1 -1
  18. package/build/backend/commands/infra-billing/get-infra-providers.command.d.ts +42 -18
  19. package/build/backend/commands/infra-billing/get-infra-providers.command.d.ts.map +1 -1
  20. package/build/backend/commands/infra-billing/update-billing-node.command.d.ts +22 -15
  21. package/build/backend/commands/infra-billing/update-billing-node.command.d.ts.map +1 -1
  22. package/build/backend/commands/infra-billing/update-infra-provider.command.d.ts +34 -14
  23. package/build/backend/commands/infra-billing/update-infra-provider.command.d.ts.map +1 -1
  24. package/build/backend/commands/users/get-all-users.command.d.ts.map +1 -1
  25. package/build/backend/commands/users/get-all-users.command.js +1 -1
  26. package/build/backend/commands/users/get-users-stream.command.d.ts +321 -0
  27. package/build/backend/commands/users/get-users-stream.command.d.ts.map +1 -0
  28. package/build/backend/commands/users/get-users-stream.command.js +37 -0
  29. package/build/backend/commands/users/index.d.ts +1 -0
  30. package/build/backend/commands/users/index.d.ts.map +1 -1
  31. package/build/backend/commands/users/index.js +1 -0
  32. package/build/backend/constants/errors/errors.d.ts +5 -0
  33. package/build/backend/constants/errors/errors.d.ts.map +1 -1
  34. package/build/backend/constants/errors/errors.js +5 -0
  35. package/build/backend/models/infra-billing-node.schema.d.ts +10 -7
  36. package/build/backend/models/infra-billing-node.schema.d.ts.map +1 -1
  37. package/build/backend/models/infra-billing-node.schema.js +3 -2
  38. package/build/backend/models/infra-provider.schema.d.ts +26 -10
  39. package/build/backend/models/infra-provider.schema.d.ts.map +1 -1
  40. package/build/backend/models/infra-provider.schema.js +6 -2
  41. package/build/frontend/api/controllers/users.js +1 -0
  42. package/build/frontend/api/routes.js +1 -0
  43. package/build/frontend/commands/infra-billing/create-billing-node.command.js +2 -2
  44. package/build/frontend/commands/users/get-all-users.command.js +1 -1
  45. package/build/frontend/commands/users/get-users-stream.command.js +37 -0
  46. package/build/frontend/commands/users/index.js +1 -0
  47. package/build/frontend/constants/errors/errors.js +5 -0
  48. package/build/frontend/models/infra-billing-node.schema.js +3 -2
  49. package/build/frontend/models/infra-provider.schema.js +6 -2
  50. package/package.json +1 -1
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetUsersStreamCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../constants");
6
+ const models_1 = require("../../models");
7
+ const api_1 = require("../../api");
8
+ var GetUsersStreamCommand;
9
+ (function (GetUsersStreamCommand) {
10
+ GetUsersStreamCommand.url = api_1.REST_API.USERS.STREAM;
11
+ GetUsersStreamCommand.TSQ_url = GetUsersStreamCommand.url;
12
+ GetUsersStreamCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.STREAM, 'get', 'Get all users using cursor-based (keyset) pagination', { scope: 'stream', kind: 'read' });
13
+ GetUsersStreamCommand.RequestQuerySchema = zod_1.z.object({
14
+ cursor: zod_1.z
15
+ .string()
16
+ .regex(/^\d+$/, 'Cursor must be a positive integer string')
17
+ .optional()
18
+ .describe('Cursor for pagination — pass the nextCursor from the previous response. Omit on the first request.'),
19
+ size: zod_1.z.coerce
20
+ .number()
21
+ .int()
22
+ .min(1, 'Size (limit) must be greater than 0')
23
+ .max(1000, 'Size (limit) must be less than 1000')
24
+ .describe('Number of results to return, no more than 1000')
25
+ .default(250),
26
+ });
27
+ GetUsersStreamCommand.ResponseSchema = zod_1.z.object({
28
+ response: zod_1.z.object({
29
+ users: zod_1.z.array(models_1.ExtendedUsersSchema),
30
+ nextCursor: zod_1.z
31
+ .string()
32
+ .nullable()
33
+ .describe('Cursor to fetch the next page, or null if there are no more results'),
34
+ hasMore: zod_1.z.boolean().describe('Whether there are more results to fetch'),
35
+ }),
36
+ });
37
+ })(GetUsersStreamCommand || (exports.GetUsersStreamCommand = GetUsersStreamCommand = {}));
@@ -24,6 +24,7 @@ __exportStar(require("./get-by"), exports);
24
24
  __exportStar(require("./get-user-accessible-nodes.command"), exports);
25
25
  __exportStar(require("./get-user-by-uuid.command"), exports);
26
26
  __exportStar(require("./get-user-subscription-request-history.command"), exports);
27
+ __exportStar(require("./get-users-stream.command"), exports);
27
28
  __exportStar(require("./resolve-user.command"), exports);
28
29
  __exportStar(require("./tags"), exports);
29
30
  __exportStar(require("./update-user.command"), exports);
@@ -1145,4 +1145,9 @@ exports.ERRORS = {
1145
1145
  message: 'One or more provided API token scopes are invalid',
1146
1146
  httpCode: 400,
1147
1147
  },
1148
+ CREATE_INFRA_BILLING_NODE_MISSING_TARGET: {
1149
+ code: 'A230',
1150
+ message: 'Either nodeUuid or name must be provided',
1151
+ httpCode: 400,
1152
+ },
1148
1153
  };
@@ -6,7 +6,8 @@ const infra_provider_schema_1 = require("./infra-provider.schema");
6
6
  const nodes_schema_1 = require("./nodes.schema");
7
7
  exports.InfraBillingNodeSchema = zod_1.z.object({
8
8
  uuid: zod_1.z.string().uuid(),
9
- nodeUuid: zod_1.z.string().uuid(),
9
+ nodeUuid: zod_1.z.string().uuid().nullable(),
10
+ name: zod_1.z.string().nullable(),
10
11
  providerUuid: zod_1.z.string().uuid(),
11
12
  provider: infra_provider_schema_1.PartialInfraProviderSchema.pick({
12
13
  uuid: true,
@@ -18,7 +19,7 @@ exports.InfraBillingNodeSchema = zod_1.z.object({
18
19
  uuid: true,
19
20
  name: true,
20
21
  countryCode: true,
21
- }),
22
+ }).nullable(),
22
23
  nextBillingAt: zod_1.z
23
24
  .string()
24
25
  .datetime()
@@ -20,9 +20,13 @@ exports.InfraProviderSchema = zod_1.z.object({
20
20
  totalBills: zod_1.z.number(),
21
21
  }),
22
22
  billingNodes: zod_1.z.array(zod_1.z.object({
23
- nodeUuid: zod_1.z.string().uuid(),
24
23
  name: zod_1.z.string(),
25
- countryCode: zod_1.z.string(),
24
+ details: zod_1.z
25
+ .object({
26
+ nodeUuid: zod_1.z.string().uuid(),
27
+ countryCode: zod_1.z.string(),
28
+ })
29
+ .nullable(),
26
30
  })),
27
31
  });
28
32
  exports.PartialInfraProviderSchema = zod_1.z.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "2.8.26",
3
+ "version": "2.8.28",
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.",