@remnawave/backend-contract 0.0.45 → 0.0.47
Sign up to get free protection for your applications and to get access to all the features.
- package/build/commands/api-tokens/create.command.js +1 -0
- package/build/commands/api-tokens/delete.command.js +1 -0
- package/build/commands/api-tokens/find.command.js +1 -0
- package/build/commands/auth/login.command.js +1 -0
- package/build/commands/hosts/create.command.js +1 -0
- package/build/commands/hosts/delete.command.js +1 -0
- package/build/commands/hosts/get-all.command.js +1 -0
- package/build/commands/hosts/reorder.command.js +1 -0
- package/build/commands/hosts/update.command.js +1 -0
- package/build/commands/inbounds/get-inbounds.command.js +1 -0
- package/build/commands/keygen/get-pubkey.command.js +1 -0
- package/build/commands/nodes/create.command.js +1 -0
- package/build/commands/nodes/delete.command.js +1 -0
- package/build/commands/nodes/disable.command.js +1 -0
- package/build/commands/nodes/enable.command.js +1 -0
- package/build/commands/nodes/get-all.command.js +1 -0
- package/build/commands/nodes/restart-all.command.js +1 -0
- package/build/commands/nodes/restart.command.js +1 -0
- package/build/commands/nodes/update.command.js +1 -0
- package/build/commands/subscription/get-subscription-by-short-uuid.command.js +1 -0
- package/build/commands/subscription/get-subscription-info-by-short-uuid.command.js +1 -0
- package/build/commands/system/get-bandwidth-stats.command.js +1 -0
- package/build/commands/system/get-nodes-statistics.js +1 -0
- package/build/commands/system/get-stats.command.js +1 -0
- package/build/commands/users/create-user.command.js +2 -1
- package/build/commands/users/delete-user.command.js +1 -0
- package/build/commands/users/disable-user.command.ts.js +1 -0
- package/build/commands/users/enable-user.command.js +1 -0
- package/build/commands/users/get-all-users-v2.command.js +1 -0
- package/build/commands/users/get-all-users.command.js +1 -0
- package/build/commands/users/get-user-by-short-uuid.command.js +1 -0
- package/build/commands/users/get-user-by-subscription-uuid.command.js +1 -0
- package/build/commands/users/get-user-by-uuid.command.js +1 -0
- package/build/commands/users/revoke-user-subscription.command.js +1 -0
- package/build/commands/users/update-user.command.js +1 -0
- package/build/commands/xray/get-config.command.js +1 -0
- package/build/commands/xray/update-config.command.js +1 -0
- package/build/models/users.schema.js +7 -7
- package/commands/api-tokens/create.command.ts +1 -0
- package/commands/api-tokens/delete.command.ts +1 -0
- package/commands/api-tokens/find.command.ts +1 -0
- package/commands/auth/login.command.ts +1 -0
- package/commands/hosts/create.command.ts +1 -0
- package/commands/hosts/delete.command.ts +1 -0
- package/commands/hosts/get-all.command.ts +1 -0
- package/commands/hosts/reorder.command.ts +1 -0
- package/commands/hosts/update.command.ts +3 -2
- package/commands/inbounds/get-inbounds.command.ts +1 -0
- package/commands/keygen/get-pubkey.command.ts +1 -0
- package/commands/nodes/create.command.ts +1 -0
- package/commands/nodes/delete.command.ts +1 -0
- package/commands/nodes/disable.command.ts +1 -0
- package/commands/nodes/enable.command.ts +1 -0
- package/commands/nodes/get-all.command.ts +1 -0
- package/commands/nodes/restart-all.command.ts +1 -0
- package/commands/nodes/restart.command.ts +1 -0
- package/commands/nodes/update.command.ts +1 -0
- package/commands/subscription/get-subscription-by-short-uuid.command.ts +1 -0
- package/commands/subscription/get-subscription-info-by-short-uuid.command.ts +1 -0
- package/commands/system/get-bandwidth-stats.command.ts +1 -0
- package/commands/system/get-nodes-statistics.ts +1 -0
- package/commands/system/get-stats.command.ts +1 -0
- package/commands/users/create-user.command.ts +3 -2
- package/commands/users/delete-user.command.ts +1 -0
- package/commands/users/disable-user.command.ts.ts +1 -0
- package/commands/users/enable-user.command.ts +1 -0
- package/commands/users/get-all-users-v2.command.ts +1 -0
- package/commands/users/get-all-users.command.ts +1 -0
- package/commands/users/get-user-by-short-uuid.command.ts +1 -0
- package/commands/users/get-user-by-subscription-uuid.command.ts +1 -0
- package/commands/users/get-user-by-uuid.command.ts +1 -0
- package/commands/users/revoke-user-subscription.command.ts +1 -0
- package/commands/users/update-user.command.ts +1 -0
- package/commands/xray/get-config.command.ts +2 -0
- package/commands/xray/update-config.command.ts +1 -0
- package/models/users.schema.ts +7 -7
- package/package.json +1 -1
@@ -6,6 +6,7 @@ const api_1 = require("../../api");
|
|
6
6
|
var CreateApiTokenCommand;
|
7
7
|
(function (CreateApiTokenCommand) {
|
8
8
|
CreateApiTokenCommand.url = api_1.REST_API.API_TOKENS.CREATE;
|
9
|
+
CreateApiTokenCommand.TSQ_url = CreateApiTokenCommand.url;
|
9
10
|
CreateApiTokenCommand.RequestSchema = zod_1.z.object({
|
10
11
|
tokenName: zod_1.z.string(),
|
11
12
|
tokenDescription: zod_1.z.string().nullable(),
|
@@ -6,6 +6,7 @@ const api_1 = require("../../api");
|
|
6
6
|
var DeleteApiTokenCommand;
|
7
7
|
(function (DeleteApiTokenCommand) {
|
8
8
|
DeleteApiTokenCommand.url = api_1.REST_API.API_TOKENS.DELETE;
|
9
|
+
DeleteApiTokenCommand.TSQ_url = DeleteApiTokenCommand.url(':uuid');
|
9
10
|
DeleteApiTokenCommand.RequestSchema = zod_1.z.object({
|
10
11
|
uuid: zod_1.z.string().uuid(),
|
11
12
|
});
|
@@ -7,6 +7,7 @@ const api_tokens_schema_1 = require("../../models/api-tokens.schema");
|
|
7
7
|
var FindAllApiTokensCommand;
|
8
8
|
(function (FindAllApiTokensCommand) {
|
9
9
|
FindAllApiTokensCommand.url = api_1.REST_API.API_TOKENS.GET_ALL;
|
10
|
+
FindAllApiTokensCommand.TSQ_url = FindAllApiTokensCommand.url;
|
10
11
|
FindAllApiTokensCommand.ResponseSchema = zod_1.z.object({
|
11
12
|
response: zod_1.z.array(api_tokens_schema_1.ApiTokensSchema),
|
12
13
|
});
|
@@ -6,6 +6,7 @@ const api_1 = require("../../api");
|
|
6
6
|
var LoginCommand;
|
7
7
|
(function (LoginCommand) {
|
8
8
|
LoginCommand.url = api_1.REST_API.AUTH.LOGIN;
|
9
|
+
LoginCommand.TSQ_url = LoginCommand.url;
|
9
10
|
LoginCommand.RequestSchema = zod_1.z.object({
|
10
11
|
username: zod_1.z.string(),
|
11
12
|
password: zod_1.z.string(),
|
@@ -9,6 +9,7 @@ const models_1 = require("../../models");
|
|
9
9
|
var CreateHostCommand;
|
10
10
|
(function (CreateHostCommand) {
|
11
11
|
CreateHostCommand.url = api_1.REST_API.HOSTS.CREATE;
|
12
|
+
CreateHostCommand.TSQ_url = CreateHostCommand.url;
|
12
13
|
CreateHostCommand.RequestSchema = zod_1.z.object({
|
13
14
|
inboundUuid: zod_1.z
|
14
15
|
.string({
|
@@ -6,6 +6,7 @@ const api_1 = require("../../api");
|
|
6
6
|
var DeleteHostCommand;
|
7
7
|
(function (DeleteHostCommand) {
|
8
8
|
DeleteHostCommand.url = api_1.REST_API.HOSTS.DELETE;
|
9
|
+
DeleteHostCommand.TSQ_url = DeleteHostCommand.url(':uuid');
|
9
10
|
DeleteHostCommand.RequestSchema = zod_1.z.object({
|
10
11
|
uuid: zod_1.z.string().uuid(),
|
11
12
|
});
|
@@ -7,6 +7,7 @@ const models_1 = require("../../models");
|
|
7
7
|
var GetAllHostsCommand;
|
8
8
|
(function (GetAllHostsCommand) {
|
9
9
|
GetAllHostsCommand.url = api_1.REST_API.HOSTS.GET_ALL;
|
10
|
+
GetAllHostsCommand.TSQ_url = GetAllHostsCommand.url;
|
10
11
|
GetAllHostsCommand.ResponseSchema = zod_1.z.object({
|
11
12
|
response: zod_1.z.array(models_1.HostsSchema),
|
12
13
|
});
|
@@ -7,6 +7,7 @@ const models_1 = require("../../models");
|
|
7
7
|
var ReorderHostCommand;
|
8
8
|
(function (ReorderHostCommand) {
|
9
9
|
ReorderHostCommand.url = api_1.REST_API.HOSTS.REORDER;
|
10
|
+
ReorderHostCommand.TSQ_url = ReorderHostCommand.url;
|
10
11
|
ReorderHostCommand.RequestSchema = zod_1.z.object({
|
11
12
|
hosts: zod_1.z.array(models_1.HostsSchema.pick({
|
12
13
|
viewPosition: true,
|
@@ -9,6 +9,7 @@ const models_1 = require("../../models");
|
|
9
9
|
var UpdateHostCommand;
|
10
10
|
(function (UpdateHostCommand) {
|
11
11
|
UpdateHostCommand.url = api_1.REST_API.HOSTS.UPDATE;
|
12
|
+
UpdateHostCommand.TSQ_url = UpdateHostCommand.url;
|
12
13
|
UpdateHostCommand.RequestSchema = models_1.HostsSchema.pick({
|
13
14
|
uuid: true,
|
14
15
|
}).extend({
|
@@ -7,6 +7,7 @@ const inbounds_schema_1 = require("../../models/inbounds.schema");
|
|
7
7
|
var GetInboundsCommand;
|
8
8
|
(function (GetInboundsCommand) {
|
9
9
|
GetInboundsCommand.url = api_1.REST_API.INBOUNDS.GET_INBOUNDS;
|
10
|
+
GetInboundsCommand.TSQ_url = GetInboundsCommand.url;
|
10
11
|
GetInboundsCommand.ResponseSchema = zod_1.z.object({
|
11
12
|
response: zod_1.z.array(inbounds_schema_1.InboundsSchema),
|
12
13
|
});
|
@@ -6,6 +6,7 @@ const api_1 = require("../../api");
|
|
6
6
|
var GetPubKeyCommand;
|
7
7
|
(function (GetPubKeyCommand) {
|
8
8
|
GetPubKeyCommand.url = api_1.REST_API.KEYGEN.GET;
|
9
|
+
GetPubKeyCommand.TSQ_url = GetPubKeyCommand.url;
|
9
10
|
GetPubKeyCommand.ResponseSchema = zod_1.z.object({
|
10
11
|
response: zod_1.z.object({
|
11
12
|
pubKey: zod_1.z.string(),
|
@@ -7,6 +7,7 @@ const models_1 = require("../../models");
|
|
7
7
|
var CreateNodeCommand;
|
8
8
|
(function (CreateNodeCommand) {
|
9
9
|
CreateNodeCommand.url = api_1.REST_API.NODES.CREATE;
|
10
|
+
CreateNodeCommand.TSQ_url = CreateNodeCommand.url;
|
10
11
|
CreateNodeCommand.RequestSchema = models_1.NodesSchema.pick({}).extend({
|
11
12
|
name: zod_1.z.string().min(5, 'Name is required'),
|
12
13
|
address: zod_1.z.string().min(2, 'Address is required'),
|
@@ -6,6 +6,7 @@ const api_1 = require("../../api");
|
|
6
6
|
var DeleteNodeCommand;
|
7
7
|
(function (DeleteNodeCommand) {
|
8
8
|
DeleteNodeCommand.url = api_1.REST_API.NODES.DELETE;
|
9
|
+
DeleteNodeCommand.TSQ_url = DeleteNodeCommand.url(':uuid');
|
9
10
|
DeleteNodeCommand.RequestSchema = zod_1.z.object({
|
10
11
|
uuid: zod_1.z.string().uuid(),
|
11
12
|
});
|
@@ -7,6 +7,7 @@ const models_1 = require("../../models");
|
|
7
7
|
var DisableNodeCommand;
|
8
8
|
(function (DisableNodeCommand) {
|
9
9
|
DisableNodeCommand.url = api_1.REST_API.NODES.DISABLE;
|
10
|
+
DisableNodeCommand.TSQ_url = DisableNodeCommand.url(':uuid');
|
10
11
|
DisableNodeCommand.RequestSchema = zod_1.z.object({
|
11
12
|
uuid: zod_1.z.string().uuid(),
|
12
13
|
});
|
@@ -7,6 +7,7 @@ const models_1 = require("../../models");
|
|
7
7
|
var EnableNodeCommand;
|
8
8
|
(function (EnableNodeCommand) {
|
9
9
|
EnableNodeCommand.url = api_1.REST_API.NODES.ENABLE;
|
10
|
+
EnableNodeCommand.TSQ_url = EnableNodeCommand.url(':uuid');
|
10
11
|
EnableNodeCommand.RequestSchema = zod_1.z.object({
|
11
12
|
uuid: zod_1.z.string().uuid(),
|
12
13
|
});
|
@@ -7,6 +7,7 @@ const models_1 = require("../../models");
|
|
7
7
|
var GetAllNodesCommand;
|
8
8
|
(function (GetAllNodesCommand) {
|
9
9
|
GetAllNodesCommand.url = api_1.REST_API.NODES.GET_ALL;
|
10
|
+
GetAllNodesCommand.TSQ_url = GetAllNodesCommand.url;
|
10
11
|
GetAllNodesCommand.ResponseSchema = zod_1.z.object({
|
11
12
|
response: zod_1.z.array(models_1.NodesSchema),
|
12
13
|
});
|
@@ -6,6 +6,7 @@ const api_1 = require("../../api");
|
|
6
6
|
var RestartAllNodesCommand;
|
7
7
|
(function (RestartAllNodesCommand) {
|
8
8
|
RestartAllNodesCommand.url = api_1.REST_API.NODES.RESTART_ALL;
|
9
|
+
RestartAllNodesCommand.TSQ_url = RestartAllNodesCommand.url;
|
9
10
|
RestartAllNodesCommand.ResponseSchema = zod_1.z.object({
|
10
11
|
response: zod_1.z.object({
|
11
12
|
eventSent: zod_1.z.boolean(),
|
@@ -6,6 +6,7 @@ const api_1 = require("../../api");
|
|
6
6
|
var RestartNodeCommand;
|
7
7
|
(function (RestartNodeCommand) {
|
8
8
|
RestartNodeCommand.url = api_1.REST_API.NODES.RESTART;
|
9
|
+
RestartNodeCommand.TSQ_url = RestartNodeCommand.url(':uuid');
|
9
10
|
RestartNodeCommand.RequestSchema = zod_1.z.object({
|
10
11
|
uuid: zod_1.z.string().uuid(),
|
11
12
|
});
|
@@ -7,6 +7,7 @@ const models_1 = require("../../models");
|
|
7
7
|
var UpdateNodeCommand;
|
8
8
|
(function (UpdateNodeCommand) {
|
9
9
|
UpdateNodeCommand.url = api_1.REST_API.NODES.UPDATE;
|
10
|
+
UpdateNodeCommand.TSQ_url = UpdateNodeCommand.url;
|
10
11
|
UpdateNodeCommand.RequestSchema = models_1.NodesSchema.pick({
|
11
12
|
uuid: true,
|
12
13
|
}).extend({
|
@@ -6,6 +6,7 @@ const api_1 = require("../../api");
|
|
6
6
|
var GetSubscriptionByShortUuidCommand;
|
7
7
|
(function (GetSubscriptionByShortUuidCommand) {
|
8
8
|
GetSubscriptionByShortUuidCommand.url = api_1.REST_API.SUBSCRIPTION.GET;
|
9
|
+
GetSubscriptionByShortUuidCommand.TSQ_url = GetSubscriptionByShortUuidCommand.url(':shortUuid');
|
9
10
|
GetSubscriptionByShortUuidCommand.RequestSchema = zod_1.z.object({
|
10
11
|
shortUuid: zod_1.z.string(),
|
11
12
|
});
|
@@ -7,6 +7,7 @@ const constants_1 = require("../../constants");
|
|
7
7
|
var GetSubscriptionInfoByShortUuidCommand;
|
8
8
|
(function (GetSubscriptionInfoByShortUuidCommand) {
|
9
9
|
GetSubscriptionInfoByShortUuidCommand.url = api_1.REST_API.SUBSCRIPTION.GET_INFO;
|
10
|
+
GetSubscriptionInfoByShortUuidCommand.TSQ_url = GetSubscriptionInfoByShortUuidCommand.url(':shortUuid');
|
10
11
|
GetSubscriptionInfoByShortUuidCommand.RequestSchema = zod_1.z.object({
|
11
12
|
shortUuid: zod_1.z.string(),
|
12
13
|
});
|
@@ -7,6 +7,7 @@ const base_stat_schema_1 = require("../../models/base-stat.schema");
|
|
7
7
|
var GetBandwidthStatsCommand;
|
8
8
|
(function (GetBandwidthStatsCommand) {
|
9
9
|
GetBandwidthStatsCommand.url = api_1.REST_API.SYSTEM.BANDWIDTH;
|
10
|
+
GetBandwidthStatsCommand.TSQ_url = GetBandwidthStatsCommand.url;
|
10
11
|
GetBandwidthStatsCommand.RequestQuerySchema = zod_1.z.object({
|
11
12
|
tz: zod_1.z.string().optional(),
|
12
13
|
});
|
@@ -6,6 +6,7 @@ const api_1 = require("../../api");
|
|
6
6
|
var GetNodesStatisticsCommand;
|
7
7
|
(function (GetNodesStatisticsCommand) {
|
8
8
|
GetNodesStatisticsCommand.url = api_1.REST_API.SYSTEM.NODES_STATISTIC;
|
9
|
+
GetNodesStatisticsCommand.TSQ_url = GetNodesStatisticsCommand.url;
|
9
10
|
GetNodesStatisticsCommand.RequestQuerySchema = zod_1.z.object({
|
10
11
|
tz: zod_1.z.string().optional(),
|
11
12
|
});
|
@@ -7,6 +7,7 @@ const constants_1 = require("../../constants");
|
|
7
7
|
var GetStatsCommand;
|
8
8
|
(function (GetStatsCommand) {
|
9
9
|
GetStatsCommand.url = api_1.REST_API.SYSTEM.STATS;
|
10
|
+
GetStatsCommand.TSQ_url = GetStatsCommand.url;
|
10
11
|
GetStatsCommand.RequestQuerySchema = zod_1.z.object({
|
11
12
|
tz: zod_1.z.string().optional(),
|
12
13
|
});
|
@@ -8,7 +8,8 @@ const models_1 = require("../../models");
|
|
8
8
|
var CreateUserCommand;
|
9
9
|
(function (CreateUserCommand) {
|
10
10
|
CreateUserCommand.url = api_1.REST_API.USERS.CREATE;
|
11
|
-
CreateUserCommand.
|
11
|
+
CreateUserCommand.TSQ_url = CreateUserCommand.url;
|
12
|
+
CreateUserCommand.RequestSchema = zod_1.z.object({
|
12
13
|
username: zod_1.z
|
13
14
|
.string({
|
14
15
|
required_error: 'Username is required',
|
@@ -6,6 +6,7 @@ const api_1 = require("../../api");
|
|
6
6
|
var DeleteUserCommand;
|
7
7
|
(function (DeleteUserCommand) {
|
8
8
|
DeleteUserCommand.url = api_1.REST_API.USERS.DELETE_USER;
|
9
|
+
DeleteUserCommand.TSQ_url = DeleteUserCommand.url(':uuid');
|
9
10
|
DeleteUserCommand.RequestSchema = zod_1.z.object({
|
10
11
|
uuid: zod_1.z.string().uuid(),
|
11
12
|
});
|
@@ -7,6 +7,7 @@ const users_schema_1 = require("../../models/users.schema");
|
|
7
7
|
var DisableUserCommand;
|
8
8
|
(function (DisableUserCommand) {
|
9
9
|
DisableUserCommand.url = api_1.REST_API.USERS.DISABLE_USER;
|
10
|
+
DisableUserCommand.TSQ_url = DisableUserCommand.url(':uuid');
|
10
11
|
DisableUserCommand.RequestSchema = zod_1.z.object({
|
11
12
|
uuid: zod_1.z.string().uuid(),
|
12
13
|
});
|
@@ -7,6 +7,7 @@ const users_schema_1 = require("../../models/users.schema");
|
|
7
7
|
var EnableUserCommand;
|
8
8
|
(function (EnableUserCommand) {
|
9
9
|
EnableUserCommand.url = api_1.REST_API.USERS.ENABLE_USER;
|
10
|
+
EnableUserCommand.TSQ_url = EnableUserCommand.url(':uuid');
|
10
11
|
EnableUserCommand.RequestSchema = zod_1.z.object({
|
11
12
|
uuid: zod_1.z.string().uuid(),
|
12
13
|
});
|
@@ -7,6 +7,7 @@ const users_schema_1 = require("../../models/users.schema");
|
|
7
7
|
var GetAllUsersV2Command;
|
8
8
|
(function (GetAllUsersV2Command) {
|
9
9
|
GetAllUsersV2Command.url = api_1.REST_API.USERS.GET_ALL_V2;
|
10
|
+
GetAllUsersV2Command.TSQ_url = GetAllUsersV2Command.url;
|
10
11
|
const FilterSchema = zod_1.z.object({
|
11
12
|
id: zod_1.z.string(),
|
12
13
|
value: zod_1.z.string(),
|
@@ -7,6 +7,7 @@ const users_schema_1 = require("../../models/users.schema");
|
|
7
7
|
var GetAllUsersCommand;
|
8
8
|
(function (GetAllUsersCommand) {
|
9
9
|
GetAllUsersCommand.url = api_1.REST_API.USERS.GET_ALL;
|
10
|
+
GetAllUsersCommand.TSQ_url = GetAllUsersCommand.url;
|
10
11
|
GetAllUsersCommand.SortableFields = [
|
11
12
|
'username',
|
12
13
|
'status',
|
@@ -7,6 +7,7 @@ const users_schema_1 = require("../../models/users.schema");
|
|
7
7
|
var GetUserByShortUuidCommand;
|
8
8
|
(function (GetUserByShortUuidCommand) {
|
9
9
|
GetUserByShortUuidCommand.url = api_1.REST_API.USERS.GET_BY_SHORT_UUID;
|
10
|
+
GetUserByShortUuidCommand.TSQ_url = GetUserByShortUuidCommand.url(':shortUuid');
|
10
11
|
GetUserByShortUuidCommand.RequestSchema = zod_1.z.object({
|
11
12
|
shortUuid: zod_1.z.string(),
|
12
13
|
});
|
@@ -7,6 +7,7 @@ const users_schema_1 = require("../../models/users.schema");
|
|
7
7
|
var GetUserBySubscriptionUuidCommand;
|
8
8
|
(function (GetUserBySubscriptionUuidCommand) {
|
9
9
|
GetUserBySubscriptionUuidCommand.url = api_1.REST_API.USERS.GET_BY_SUBSCRIPTION_UUID;
|
10
|
+
GetUserBySubscriptionUuidCommand.TSQ_url = GetUserBySubscriptionUuidCommand.url(':subscriptionUuid');
|
10
11
|
GetUserBySubscriptionUuidCommand.RequestSchema = zod_1.z.object({
|
11
12
|
subscriptionUuid: zod_1.z.string(),
|
12
13
|
});
|
@@ -7,6 +7,7 @@ const users_schema_1 = require("../../models/users.schema");
|
|
7
7
|
var GetUserByUuidCommand;
|
8
8
|
(function (GetUserByUuidCommand) {
|
9
9
|
GetUserByUuidCommand.url = api_1.REST_API.USERS.GET_BY_UUID;
|
10
|
+
GetUserByUuidCommand.TSQ_url = GetUserByUuidCommand.url(':uuid');
|
10
11
|
GetUserByUuidCommand.RequestSchema = zod_1.z.object({
|
11
12
|
uuid: zod_1.z.string().uuid(),
|
12
13
|
});
|
@@ -7,6 +7,7 @@ const users_schema_1 = require("../../models/users.schema");
|
|
7
7
|
var RevokeUserSubscriptionCommand;
|
8
8
|
(function (RevokeUserSubscriptionCommand) {
|
9
9
|
RevokeUserSubscriptionCommand.url = api_1.REST_API.USERS.REVOKE_SUBSCRIPTION;
|
10
|
+
RevokeUserSubscriptionCommand.TSQ_url = RevokeUserSubscriptionCommand.url(':uuid');
|
10
11
|
RevokeUserSubscriptionCommand.RequestSchema = zod_1.z.object({
|
11
12
|
uuid: zod_1.z.string().uuid(),
|
12
13
|
});
|
@@ -8,6 +8,7 @@ const models_1 = require("../../models");
|
|
8
8
|
var UpdateUserCommand;
|
9
9
|
(function (UpdateUserCommand) {
|
10
10
|
UpdateUserCommand.url = api_1.REST_API.USERS.UPDATE;
|
11
|
+
UpdateUserCommand.TSQ_url = UpdateUserCommand.url;
|
11
12
|
UpdateUserCommand.RequestSchema = models_1.UsersSchema.pick({
|
12
13
|
uuid: true,
|
13
14
|
}).extend({
|
@@ -6,6 +6,7 @@ const api_1 = require("../../api");
|
|
6
6
|
var GetXrayConfigCommand;
|
7
7
|
(function (GetXrayConfigCommand) {
|
8
8
|
GetXrayConfigCommand.url = api_1.REST_API.XRAY.GET_CONFIG;
|
9
|
+
GetXrayConfigCommand.TSQ_url = GetXrayConfigCommand.url;
|
9
10
|
GetXrayConfigCommand.ResponseSchema = zod_1.z.object({
|
10
11
|
response: zod_1.z.object({
|
11
12
|
config: zod_1.z.record(zod_1.z.any()),
|
@@ -6,6 +6,7 @@ const api_1 = require("../../api");
|
|
6
6
|
var UpdateXrayConfigCommand;
|
7
7
|
(function (UpdateXrayConfigCommand) {
|
8
8
|
UpdateXrayConfigCommand.url = api_1.REST_API.XRAY.UPDATE_CONFIG;
|
9
|
+
UpdateXrayConfigCommand.TSQ_url = UpdateXrayConfigCommand.url;
|
9
10
|
UpdateXrayConfigCommand.RequestSchema = zod_1.z.record(zod_1.z.any());
|
10
11
|
UpdateXrayConfigCommand.ResponseSchema = zod_1.z.object({
|
11
12
|
response: zod_1.z.object({
|
@@ -20,15 +20,15 @@ exports.UsersSchema = zod_1.z.object({
|
|
20
20
|
})
|
21
21
|
.default(constants_1.RESET_PERIODS_VALUES[0]),
|
22
22
|
subLastUserAgent: zod_1.z.nullable(zod_1.z.string()),
|
23
|
-
subLastOpenedAt: zod_1.z.nullable(zod_1.z.
|
24
|
-
expireAt: zod_1.z.nullable(zod_1.z.string().
|
25
|
-
onlineAt: zod_1.z.nullable(zod_1.z.string().
|
26
|
-
subRevokedAt: zod_1.z.nullable(zod_1.z.string().
|
27
|
-
lastTrafficResetAt: zod_1.z.nullable(zod_1.z.string().
|
23
|
+
subLastOpenedAt: zod_1.z.nullable(zod_1.z.string().transform((str) => new Date(str))),
|
24
|
+
expireAt: zod_1.z.nullable(zod_1.z.string().transform((str) => new Date(str))),
|
25
|
+
onlineAt: zod_1.z.nullable(zod_1.z.string().transform((str) => new Date(str))),
|
26
|
+
subRevokedAt: zod_1.z.nullable(zod_1.z.string().transform((str) => new Date(str))),
|
27
|
+
lastTrafficResetAt: zod_1.z.nullable(zod_1.z.string().transform((str) => new Date(str))),
|
28
28
|
trojanPassword: zod_1.z.string(),
|
29
29
|
vlessUuid: zod_1.z.string().uuid(),
|
30
30
|
ssPassword: zod_1.z.string(),
|
31
|
-
createdAt: zod_1.z.string().
|
32
|
-
updatedAt: zod_1.z.string().
|
31
|
+
createdAt: zod_1.z.string().transform((str) => new Date(str)),
|
32
|
+
updatedAt: zod_1.z.string().transform((str) => new Date(str)),
|
33
33
|
activeUserInbounds: zod_1.z.array(inbounds_schema_1.InboundsSchema),
|
34
34
|
});
|
@@ -4,6 +4,7 @@ import { ApiTokensSchema } from '../../models/api-tokens.schema';
|
|
4
4
|
|
5
5
|
export namespace FindAllApiTokensCommand {
|
6
6
|
export const url = REST_API.API_TOKENS.GET_ALL;
|
7
|
+
export const TSQ_url = url;
|
7
8
|
|
8
9
|
export const ResponseSchema = z.object({
|
9
10
|
response: z.array(ApiTokensSchema),
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import { z } from 'zod';
|
2
2
|
import { REST_API } from '../../api';
|
3
|
-
import {
|
4
|
-
import {
|
3
|
+
import { ALPN_VALUES } from '../../constants/hosts/alpn';
|
4
|
+
import { FINGERPRINTS_VALUES } from '../../constants/hosts/fingerprints';
|
5
5
|
import { HostsSchema } from '../../models';
|
6
6
|
|
7
7
|
export namespace UpdateHostCommand {
|
8
8
|
export const url = REST_API.HOSTS.UPDATE;
|
9
|
+
export const TSQ_url = url;
|
9
10
|
|
10
11
|
export const RequestSchema = HostsSchema.pick({
|
11
12
|
uuid: true,
|
@@ -4,6 +4,7 @@ import { InboundsSchema } from '../../models/inbounds.schema';
|
|
4
4
|
|
5
5
|
export namespace GetInboundsCommand {
|
6
6
|
export const url = REST_API.INBOUNDS.GET_INBOUNDS;
|
7
|
+
export const TSQ_url = url;
|
7
8
|
|
8
9
|
export const ResponseSchema = z.object({
|
9
10
|
response: z.array(InboundsSchema),
|
@@ -4,6 +4,7 @@ import { USERS_STATUS_VALUES } from '../../constants';
|
|
4
4
|
|
5
5
|
export namespace GetSubscriptionInfoByShortUuidCommand {
|
6
6
|
export const url = REST_API.SUBSCRIPTION.GET_INFO;
|
7
|
+
export const TSQ_url = url(':shortUuid');
|
7
8
|
|
8
9
|
export const RequestSchema = z.object({
|
9
10
|
shortUuid: z.string(),
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import { z } from 'zod';
|
2
2
|
import { REST_API } from '../../api';
|
3
3
|
import { RESET_PERIODS, USERS_STATUS } from '../../constants';
|
4
|
-
import {
|
4
|
+
import { UsersSchema } from '../../models';
|
5
5
|
|
6
6
|
export namespace CreateUserCommand {
|
7
7
|
export const url = REST_API.USERS.CREATE;
|
8
|
+
export const TSQ_url = url;
|
8
9
|
|
9
|
-
export const RequestSchema =
|
10
|
+
export const RequestSchema = z.object({
|
10
11
|
username: z
|
11
12
|
.string({
|
12
13
|
required_error: 'Username is required',
|
@@ -3,6 +3,7 @@ import { REST_API } from '../../api';
|
|
3
3
|
import { UsersSchema } from '../../models/users.schema';
|
4
4
|
export namespace DisableUserCommand {
|
5
5
|
export const url = REST_API.USERS.DISABLE_USER;
|
6
|
+
export const TSQ_url = url(':uuid');
|
6
7
|
|
7
8
|
export const RequestSchema = z.object({
|
8
9
|
uuid: z.string().uuid(),
|
@@ -4,6 +4,7 @@ import { UsersSchema } from '../../models/users.schema';
|
|
4
4
|
|
5
5
|
export namespace GetUserByShortUuidCommand {
|
6
6
|
export const url = REST_API.USERS.GET_BY_SHORT_UUID;
|
7
|
+
export const TSQ_url = url(':shortUuid');
|
7
8
|
|
8
9
|
export const RequestSchema = z.object({
|
9
10
|
shortUuid: z.string(),
|
@@ -4,6 +4,7 @@ import { UsersSchema } from '../../models/users.schema';
|
|
4
4
|
|
5
5
|
export namespace GetUserBySubscriptionUuidCommand {
|
6
6
|
export const url = REST_API.USERS.GET_BY_SUBSCRIPTION_UUID;
|
7
|
+
export const TSQ_url = url(':subscriptionUuid');
|
7
8
|
|
8
9
|
export const RequestSchema = z.object({
|
9
10
|
subscriptionUuid: z.string(),
|
@@ -4,6 +4,7 @@ import { UsersSchema } from '../../models/users.schema';
|
|
4
4
|
|
5
5
|
export namespace RevokeUserSubscriptionCommand {
|
6
6
|
export const url = REST_API.USERS.REVOKE_SUBSCRIPTION;
|
7
|
+
export const TSQ_url = url(':uuid');
|
7
8
|
|
8
9
|
export const RequestSchema = z.object({
|
9
10
|
uuid: z.string().uuid(),
|
@@ -2,6 +2,8 @@ import { z } from 'zod';
|
|
2
2
|
import { REST_API } from '../../api';
|
3
3
|
export namespace GetXrayConfigCommand {
|
4
4
|
export const url = REST_API.XRAY.GET_CONFIG;
|
5
|
+
export const TSQ_url = url;
|
6
|
+
|
5
7
|
export const ResponseSchema = z.object({
|
6
8
|
response: z.object({
|
7
9
|
config: z.record(z.any()),
|
package/models/users.schema.ts
CHANGED
@@ -20,19 +20,19 @@ export const UsersSchema = z.object({
|
|
20
20
|
})
|
21
21
|
.default(RESET_PERIODS_VALUES[0]),
|
22
22
|
subLastUserAgent: z.nullable(z.string()),
|
23
|
-
subLastOpenedAt: z.nullable(z.
|
23
|
+
subLastOpenedAt: z.nullable(z.string().transform((str) => new Date(str))),
|
24
24
|
|
25
|
-
expireAt: z.nullable(z.string().
|
26
|
-
onlineAt: z.nullable(z.string().
|
27
|
-
subRevokedAt: z.nullable(z.string().
|
28
|
-
lastTrafficResetAt: z.nullable(z.string().
|
25
|
+
expireAt: z.nullable(z.string().transform((str) => new Date(str))),
|
26
|
+
onlineAt: z.nullable(z.string().transform((str) => new Date(str))),
|
27
|
+
subRevokedAt: z.nullable(z.string().transform((str) => new Date(str))),
|
28
|
+
lastTrafficResetAt: z.nullable(z.string().transform((str) => new Date(str))),
|
29
29
|
|
30
30
|
trojanPassword: z.string(),
|
31
31
|
vlessUuid: z.string().uuid(),
|
32
32
|
ssPassword: z.string(),
|
33
33
|
|
34
|
-
createdAt: z.string().
|
35
|
-
updatedAt: z.string().
|
34
|
+
createdAt: z.string().transform((str) => new Date(str)),
|
35
|
+
updatedAt: z.string().transform((str) => new Date(str)),
|
36
36
|
|
37
37
|
activeUserInbounds: z.array(InboundsSchema),
|
38
38
|
});
|