@remnawave/backend-contract 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,10 @@
1
1
  export const HOSTS_CONTROLLER = 'hosts' as const;
2
2
 
3
3
  export const HOSTS_ROUTES = {
4
- CREATE: '',
5
- DELETE: ':uuid',
6
- GET_ALL: '',
7
- UPDATE: '',
4
+ CREATE: 'create',
5
+ DELETE: 'delete',
6
+ GET_ALL: 'all',
7
+ UPDATE: 'update',
8
8
  UPDATE_MANY: 'many',
9
+ REORDER: 'reorder',
9
10
  } as const;
@@ -3,9 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HOSTS_ROUTES = exports.HOSTS_CONTROLLER = void 0;
4
4
  exports.HOSTS_CONTROLLER = 'hosts';
5
5
  exports.HOSTS_ROUTES = {
6
- CREATE: '',
7
- DELETE: ':uuid',
8
- GET_ALL: '',
9
- UPDATE: '',
6
+ CREATE: 'create',
7
+ DELETE: 'delete',
8
+ GET_ALL: 'all',
9
+ UPDATE: 'update',
10
10
  UPDATE_MANY: 'many',
11
+ REORDER: 'reorder',
11
12
  };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetAllHostsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ const models_1 = require("../../models");
7
+ var GetAllHostsCommand;
8
+ (function (GetAllHostsCommand) {
9
+ GetAllHostsCommand.url = api_1.REST_API.HOSTS.GET_ALL;
10
+ GetAllHostsCommand.ResponseSchema = zod_1.z.object({
11
+ response: zod_1.z.array(models_1.HostsSchema),
12
+ });
13
+ })(GetAllHostsCommand || (exports.GetAllHostsCommand = GetAllHostsCommand = {}));
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./create.command"), exports);
18
18
  __exportStar(require("./delete.command"), exports);
19
+ __exportStar(require("./get-all.command"), exports);
@@ -243,4 +243,9 @@ exports.ERRORS = {
243
243
  message: 'Update user with inbounds error',
244
244
  httpCode: 500,
245
245
  },
246
+ GET_ALL_HOSTS_ERROR: {
247
+ code: 'A050',
248
+ message: 'Get all hosts error',
249
+ httpCode: 500,
250
+ },
246
251
  };
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ import { REST_API } from '../../api';
3
+ import { HostsSchema } from '../../models';
4
+
5
+ export namespace GetAllHostsCommand {
6
+ export const url = REST_API.HOSTS.GET_ALL;
7
+
8
+ export const ResponseSchema = z.object({
9
+ response: z.array(HostsSchema),
10
+ });
11
+
12
+ export type Response = z.infer<typeof ResponseSchema>;
13
+ }
@@ -1,2 +1,3 @@
1
1
  export * from './create.command';
2
2
  export * from './delete.command';
3
+ export * from './get-all.command';
@@ -240,4 +240,9 @@ export const ERRORS = {
240
240
  message: 'Update user with inbounds error',
241
241
  httpCode: 500,
242
242
  },
243
+ GET_ALL_HOSTS_ERROR: {
244
+ code: 'A050',
245
+ message: 'Get all hosts error',
246
+ httpCode: 500,
247
+ },
243
248
  } as const;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "A contract library for Remnawave",
5
5
  "main": "index.js",
6
6
  "scripts": {