@remnawave/backend-contract 2.8.29 → 2.8.30

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 (90) hide show
  1. package/build/backend/commands/api-tokens/create.command.d.ts +22 -13
  2. package/build/backend/commands/api-tokens/create.command.d.ts.map +1 -1
  3. package/build/backend/commands/api-tokens/create.command.js +5 -2
  4. package/build/backend/commands/api-tokens/find.command.d.ts +26 -26
  5. package/build/backend/commands/api-tokens/find.command.js +2 -2
  6. package/build/backend/commands/bandwidth-stats/nodes/get-stats-nodes-usage.command.d.ts +12 -12
  7. package/build/backend/commands/bandwidth-stats/users/get-stats-user-usage.command.d.ts +12 -12
  8. package/build/backend/commands/config-profiles/actions/reorder.command.d.ts +16 -16
  9. package/build/backend/commands/config-profiles/create-config-profile.command.d.ts +10 -10
  10. package/build/backend/commands/config-profiles/get-computed-config-profile-by-uuid.command.d.ts +10 -10
  11. package/build/backend/commands/config-profiles/get-config-profile-by-uuid.command.d.ts +10 -10
  12. package/build/backend/commands/config-profiles/get-config-profiles.command.d.ts +14 -14
  13. package/build/backend/commands/config-profiles/update-config-profile.command.d.ts +10 -10
  14. package/build/backend/commands/external-squads/actions/reorder.command.d.ts +6 -6
  15. package/build/backend/commands/external-squads/create-external-squad.command.d.ts +4 -4
  16. package/build/backend/commands/external-squads/get-external-squad-by-uuid.command.d.ts +4 -4
  17. package/build/backend/commands/external-squads/get-external-squads.command.d.ts +6 -6
  18. package/build/backend/commands/external-squads/update-external-squad.command.d.ts +4 -4
  19. package/build/backend/commands/infra-billing/create-billing-node.command.d.ts +28 -28
  20. package/build/backend/commands/infra-billing/create-infra-provider.command.d.ts +4 -4
  21. package/build/backend/commands/infra-billing/delete-billing-node-by-uuid.command.d.ts +26 -26
  22. package/build/backend/commands/infra-billing/get-billing-nodes.command.d.ts +26 -26
  23. package/build/backend/commands/infra-billing/get-infra-provider-by-uuid.command.d.ts +4 -4
  24. package/build/backend/commands/infra-billing/get-infra-providers.command.d.ts +6 -6
  25. package/build/backend/commands/infra-billing/update-billing-node.command.d.ts +26 -26
  26. package/build/backend/commands/infra-billing/update-infra-provider.command.d.ts +4 -4
  27. package/build/backend/commands/internal-squads/actions/reorder.command.d.ts +6 -6
  28. package/build/backend/commands/internal-squads/create-internal-squad.command.d.ts +4 -4
  29. package/build/backend/commands/internal-squads/get-internal-squad-by-uuid.d.ts +4 -4
  30. package/build/backend/commands/internal-squads/get-internal-squads.command.d.ts +6 -6
  31. package/build/backend/commands/internal-squads/update-internal-squad.command.d.ts +4 -4
  32. package/build/backend/commands/node-plugins/torrent-blocker/get-torrent-blocker-reports-stats.command.d.ts +6 -6
  33. package/build/backend/commands/node-plugins/torrent-blocker/get-torrent-blocker-reports.command.d.ts +11 -11
  34. package/build/backend/commands/node-plugins/torrent-blocker/truncate-torrent-blocker-reports.command.d.ts +11 -11
  35. package/build/backend/commands/nodes/actions/disable.command.d.ts +10 -10
  36. package/build/backend/commands/nodes/actions/enable.command.d.ts +10 -10
  37. package/build/backend/commands/nodes/actions/reorder.command.d.ts +12 -12
  38. package/build/backend/commands/nodes/create.command.d.ts +11 -11
  39. package/build/backend/commands/nodes/get-all.command.d.ts +10 -10
  40. package/build/backend/commands/nodes/get-one.command.d.ts +10 -10
  41. package/build/backend/commands/nodes/update.command.d.ts +14 -14
  42. package/build/backend/commands/passkeys/delete-passkeys.command.d.ts +6 -6
  43. package/build/backend/commands/passkeys/get-active-passkeys.command.d.ts +6 -6
  44. package/build/backend/commands/passkeys/update-passkey.command.d.ts +6 -6
  45. package/build/backend/commands/subscription-settings/get-subscription-settings.command.d.ts +8 -8
  46. package/build/backend/commands/subscription-settings/update-subscription-settings.command.d.ts +14 -14
  47. package/build/backend/commands/subscriptions/get-by/get-raw-subscription-by-short-uuid.command.d.ts +6 -6
  48. package/build/backend/commands/system/testers/test-srr-matcher.command.d.ts +12 -12
  49. package/build/backend/commands/users/actions/disable-user.command.d.ts +4 -4
  50. package/build/backend/commands/users/actions/enable-user.command.d.ts +4 -4
  51. package/build/backend/commands/users/actions/reset-user-traffic.command.d.ts +4 -4
  52. package/build/backend/commands/users/actions/revoke-user-subscription.command.d.ts +4 -4
  53. package/build/backend/commands/users/bulk/bulk-update-users.command.d.ts +4 -4
  54. package/build/backend/commands/users/bulk-all/bulk-all-update-users.command.d.ts +2 -2
  55. package/build/backend/commands/users/create-user.command.d.ts +6 -6
  56. package/build/backend/commands/users/get-all-users.command.d.ts +6 -6
  57. package/build/backend/commands/users/get-by/get-user-by-email.command.d.ts +4 -4
  58. package/build/backend/commands/users/get-by/get-user-by-id.command.d.ts +4 -4
  59. package/build/backend/commands/users/get-by/get-user-by-short-uuid.command.d.ts +4 -4
  60. package/build/backend/commands/users/get-by/get-user-by-tag.command.d.ts +4 -4
  61. package/build/backend/commands/users/get-by/get-user-by-telegram-id.command.d.ts +4 -4
  62. package/build/backend/commands/users/get-by/get-user-by-username.command.d.ts +4 -4
  63. package/build/backend/commands/users/get-user-by-uuid.command.d.ts +4 -4
  64. package/build/backend/commands/users/get-users-stream.command.d.ts +6 -6
  65. package/build/backend/commands/users/update-user.command.d.ts +8 -8
  66. package/build/backend/constants/events/events.d.ts +2 -0
  67. package/build/backend/constants/events/events.d.ts.map +1 -1
  68. package/build/backend/constants/events/events.js +2 -0
  69. package/build/backend/models/api-tokens.schema.d.ts +6 -6
  70. package/build/backend/models/api-tokens.schema.d.ts.map +1 -1
  71. package/build/backend/models/api-tokens.schema.js +5 -2
  72. package/build/backend/models/config-profile.schema.d.ts +6 -6
  73. package/build/backend/models/extended-users.schema.d.ts +2 -2
  74. package/build/backend/models/external-squad.schema.d.ts +2 -2
  75. package/build/backend/models/infra-billing-available-node.schema.d.ts +5 -5
  76. package/build/backend/models/infra-billing-node.schema.d.ts +9 -9
  77. package/build/backend/models/infra-provider.schema.d.ts +4 -4
  78. package/build/backend/models/internal-squad.schema.d.ts +2 -2
  79. package/build/backend/models/nodes.schema.d.ts +6 -6
  80. package/build/backend/models/response-rules/response-rule.schema.d.ts +4 -4
  81. package/build/backend/models/response-rules/response-rules-config.schema.d.ts +4 -4
  82. package/build/backend/models/subscription-settings.schema.d.ts +6 -6
  83. package/build/backend/models/torrent-blocker-report.schema.d.ts +7 -7
  84. package/build/backend/models/users.schema.d.ts +2 -2
  85. package/build/backend/models/webhook/webhook.schema.d.ts +86 -86
  86. package/build/frontend/commands/api-tokens/create.command.js +5 -2
  87. package/build/frontend/commands/api-tokens/find.command.js +2 -2
  88. package/build/frontend/constants/events/events.js +2 -0
  89. package/build/frontend/models/api-tokens.schema.js +5 -2
  90. package/package.json +1 -1
@@ -11,10 +11,13 @@ var CreateApiTokenCommand;
11
11
  CreateApiTokenCommand.TSQ_url = CreateApiTokenCommand.url;
12
12
  CreateApiTokenCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.API_TOKENS_ROUTES.CREATE, 'post', 'Create a new API token', { scope: 'create', kind: 'write' }, 'This endpoint is forbidden to use via "API-key". It can only be used with an admin JWT-token.');
13
13
  CreateApiTokenCommand.RequestSchema = zod_1.z.object({
14
- tokenName: zod_1.z.string(),
14
+ name: zod_1.z.string().min(2).max(30),
15
+ expiresInDays: zod_1.z.number().min(1),
15
16
  scopes: zod_1.z.array(zod_1.z.string()).optional().default(['*']),
16
17
  });
17
18
  CreateApiTokenCommand.ResponseSchema = zod_1.z.object({
18
- response: api_tokens_schema_1.ApiTokensSchema,
19
+ response: api_tokens_schema_1.ApiTokensSchema.extend({
20
+ token: zod_1.z.string(),
21
+ }),
19
22
  });
20
23
  })(CreateApiTokenCommand || (exports.CreateApiTokenCommand = CreateApiTokenCommand = {}));
@@ -12,9 +12,9 @@ var FindAllApiTokensCommand;
12
12
  FindAllApiTokensCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.API_TOKENS_ROUTES.GET, 'get', 'Get all API tokens', { scope: 'list', kind: 'read' }, 'This endpoint is forbidden to use via "API-key". It can only be used with admin JWT-token.');
13
13
  FindAllApiTokensCommand.ResponseSchema = zod_1.z.object({
14
14
  response: zod_1.z.object({
15
- apiKeys: zod_1.z.array(api_tokens_schema_1.ApiTokensSchema),
15
+ tokens: zod_1.z.array(api_tokens_schema_1.ApiTokensSchema),
16
16
  docs: zod_1.z.object({
17
- isDocsEnabled: zod_1.z.boolean(),
17
+ enabled: zod_1.z.boolean(),
18
18
  scalarPath: zod_1.z.string().nullable(),
19
19
  swaggerPath: zod_1.z.string().nullable(),
20
20
  }),
@@ -54,6 +54,8 @@ exports.EVENTS = {
54
54
  LOGIN_ATTEMPT_FAILED: 'service.login_attempt_failed',
55
55
  LOGIN_ATTEMPT_SUCCESS: 'service.login_attempt_success',
56
56
  SUBPAGE_CONFIG_CHANGED: 'service.subpage_config_changed',
57
+ API_TOKEN_CREATED: 'service.api_token_created',
58
+ API_TOKEN_DELETED: 'service.api_token_deleted',
57
59
  },
58
60
  ERRORS: {
59
61
  BANDWIDTH_USAGE_THRESHOLD_REACHED_MAX_NOTIFICATIONS: 'errors.bandwidth_usage_threshold_reached_max_notifications',
@@ -4,8 +4,11 @@ exports.ApiTokensSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.ApiTokensSchema = zod_1.z.object({
6
6
  uuid: zod_1.z.string().uuid(),
7
- token: zod_1.z.string(),
8
- tokenName: zod_1.z.string(),
7
+ name: zod_1.z.string(),
8
+ expireAt: zod_1.z
9
+ .string()
10
+ .datetime()
11
+ .transform((str) => new Date(str)),
9
12
  scopes: zod_1.z.array(zod_1.z.string()),
10
13
  createdAt: zod_1.z
11
14
  .string()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "2.8.29",
3
+ "version": "2.8.30",
4
4
  "description": "A contract library for Remnawave Backend. It can be used in backend and frontend.",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/remnawave",