@remnawave/backend-contract 0.0.14 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- package/api/controllers/hosts.ts +5 -4
- package/api/controllers/users.ts +1 -1
- package/api/routes.ts +7 -7
- package/build/api/controllers/hosts.js +5 -4
- package/build/api/controllers/users.js +1 -1
- package/build/api/routes.js +7 -7
- package/build/commands/hosts/get-all.command.js +13 -0
- package/build/commands/hosts/index.js +1 -0
- package/build/constants/errors/errors.js +5 -0
- package/commands/hosts/get-all.command.ts +13 -0
- package/commands/hosts/index.ts +1 -0
- package/constants/errors/errors.ts +5 -0
- package/package.json +1 -1
package/api/controllers/hosts.ts
CHANGED
@@ -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: '
|
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;
|
package/api/controllers/users.ts
CHANGED
package/api/routes.ts
CHANGED
@@ -41,20 +41,20 @@ export const REST_API = {
|
|
41
41
|
USERS: {
|
42
42
|
CREATE: `${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.CREATE}`,
|
43
43
|
GET_BY_UUID: (uuid: string) =>
|
44
|
-
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_UUID}
|
44
|
+
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_UUID}/${uuid}`,
|
45
45
|
GET_BY_SHORT_UUID: (shortUuid: string) =>
|
46
|
-
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_SHORT_UUID}
|
46
|
+
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_SHORT_UUID}/${shortUuid}`,
|
47
47
|
GET_BY_SUBSCRIPTION_UUID: (subscriptionUuid: string) =>
|
48
|
-
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_SUBSCRIPTION_UUID}
|
48
|
+
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_SUBSCRIPTION_UUID}/${subscriptionUuid}`,
|
49
49
|
GET_ALL: `${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_ALL}`,
|
50
50
|
REVOKE_SUBSCRIPTION: (uuid: string) =>
|
51
|
-
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.REVOKE_SUBSCRIPTION}
|
51
|
+
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.REVOKE_SUBSCRIPTION}/${uuid}`,
|
52
52
|
DISABLE_USER: (uuid: string) =>
|
53
|
-
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.DISABLE_USER}
|
53
|
+
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.DISABLE_USER}/${uuid}`,
|
54
54
|
ENABLE_USER: (uuid: string) =>
|
55
|
-
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ENABLE_USER}
|
55
|
+
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ENABLE_USER}/${uuid}`,
|
56
56
|
DELETE_USER: (uuid: string) =>
|
57
|
-
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.DELETE_USER}
|
57
|
+
`${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.DELETE_USER}/${uuid}`,
|
58
58
|
UPDATE: `${ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.UPDATE}`,
|
59
59
|
},
|
60
60
|
SUBSCRIPTION: {
|
@@ -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: '
|
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
|
};
|
@@ -4,7 +4,7 @@ exports.USERS_ROUTES = exports.USERS_CONTROLLER = void 0;
|
|
4
4
|
exports.USERS_CONTROLLER = 'users';
|
5
5
|
exports.USERS_ROUTES = {
|
6
6
|
CREATE: '',
|
7
|
-
GET_BY_UUID: '',
|
7
|
+
GET_BY_UUID: 'uuid',
|
8
8
|
GET_BY_SHORT_UUID: 'short-uuid',
|
9
9
|
GET_BY_SUBSCRIPTION_UUID: 'sub-uuid',
|
10
10
|
GET_ALL: '',
|
package/build/api/routes.js
CHANGED
@@ -68,14 +68,14 @@ exports.REST_API = {
|
|
68
68
|
},
|
69
69
|
USERS: {
|
70
70
|
CREATE: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.CREATE}`,
|
71
|
-
GET_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_UUID}
|
72
|
-
GET_BY_SHORT_UUID: (shortUuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_SHORT_UUID}
|
73
|
-
GET_BY_SUBSCRIPTION_UUID: (subscriptionUuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_SUBSCRIPTION_UUID}
|
71
|
+
GET_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_UUID}/${uuid}`,
|
72
|
+
GET_BY_SHORT_UUID: (shortUuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_SHORT_UUID}/${shortUuid}`,
|
73
|
+
GET_BY_SUBSCRIPTION_UUID: (subscriptionUuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_SUBSCRIPTION_UUID}/${subscriptionUuid}`,
|
74
74
|
GET_ALL: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_ALL}`,
|
75
|
-
REVOKE_SUBSCRIPTION: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.REVOKE_SUBSCRIPTION}
|
76
|
-
DISABLE_USER: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.DISABLE_USER}
|
77
|
-
ENABLE_USER: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ENABLE_USER}
|
78
|
-
DELETE_USER: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.DELETE_USER}
|
75
|
+
REVOKE_SUBSCRIPTION: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.REVOKE_SUBSCRIPTION}/${uuid}`,
|
76
|
+
DISABLE_USER: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.DISABLE_USER}/${uuid}`,
|
77
|
+
ENABLE_USER: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ENABLE_USER}/${uuid}`,
|
78
|
+
DELETE_USER: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.DELETE_USER}/${uuid}`,
|
79
79
|
UPDATE: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.UPDATE}`,
|
80
80
|
},
|
81
81
|
SUBSCRIPTION: {
|
@@ -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);
|
@@ -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
|
+
}
|
package/commands/hosts/index.ts
CHANGED