@remnawave/backend-contract 0.0.60 → 0.0.62
Sign up to get free protection for your applications and to get access to all the features.
- package/build/backend/api/controllers/users.d.ts +1 -0
- package/build/backend/api/controllers/users.d.ts.map +1 -1
- package/build/backend/api/controllers/users.js +1 -0
- package/build/backend/api/routes.d.ts +1 -0
- package/build/backend/api/routes.d.ts.map +1 -1
- package/build/backend/api/routes.js +1 -0
- package/build/backend/commands/users/create-user.command.d.ts +13 -8
- package/build/backend/commands/users/create-user.command.d.ts.map +1 -1
- package/build/backend/commands/users/disable-user.command.ts.d.ts +12 -7
- package/build/backend/commands/users/disable-user.command.ts.d.ts.map +1 -1
- package/build/backend/commands/users/enable-user.command.d.ts +12 -7
- package/build/backend/commands/users/enable-user.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-all-users-v2.command.d.ts +17 -10
- package/build/backend/commands/users/get-all-users-v2.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-all-users.command.d.ts +21 -14
- package/build/backend/commands/users/get-all-users.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-user-by-short-uuid.command.d.ts +12 -7
- package/build/backend/commands/users/get-user-by-short-uuid.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-user-by-subscription-uuid.command.d.ts +12 -7
- package/build/backend/commands/users/get-user-by-subscription-uuid.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-user-by-username.command.d.ts +160 -0
- package/build/backend/commands/users/get-user-by-username.command.d.ts.map +1 -0
- package/build/backend/commands/users/get-user-by-username.command.js +17 -0
- package/build/backend/commands/users/get-user-by-uuid.command.d.ts +12 -7
- package/build/backend/commands/users/get-user-by-uuid.command.d.ts.map +1 -1
- package/build/backend/commands/users/index.d.ts +1 -0
- package/build/backend/commands/users/index.d.ts.map +1 -1
- package/build/backend/commands/users/index.js +1 -0
- package/build/backend/commands/users/revoke-user-subscription.command.d.ts +12 -7
- package/build/backend/commands/users/revoke-user-subscription.command.d.ts.map +1 -1
- package/build/backend/commands/users/update-user.command.d.ts +14 -8
- package/build/backend/commands/users/update-user.command.d.ts.map +1 -1
- package/build/backend/models/users.schema.d.ts +7 -4
- package/build/backend/models/users.schema.d.ts.map +1 -1
- package/build/backend/models/users.schema.js +2 -1
- package/build/frontend/api/controllers/users.js +1 -0
- package/build/frontend/api/routes.js +1 -0
- package/build/frontend/commands/users/get-user-by-username.command.js +17 -0
- package/build/frontend/commands/users/index.js +1 -0
- package/build/frontend/models/users.schema.js +2 -1
- package/package.json +1 -1
@@ -8,7 +8,8 @@ export declare namespace UpdateUserCommand {
|
|
8
8
|
shortUuid: z.ZodString;
|
9
9
|
username: z.ZodString;
|
10
10
|
status: z.ZodDefault<z.ZodEnum<["DISABLED" | "ACTIVE" | "LIMITED" | "EXPIRED", ...("DISABLED" | "ACTIVE" | "LIMITED" | "EXPIRED")[]]>>;
|
11
|
-
usedTrafficBytes: z.
|
11
|
+
usedTrafficBytes: z.ZodNumber;
|
12
|
+
lifetimeUsedTrafficBytes: z.ZodNumber;
|
12
13
|
trafficLimitBytes: z.ZodDefault<z.ZodNumber>;
|
13
14
|
trafficLimitStrategy: z.ZodDefault<z.ZodEnum<["MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK", ...("MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK")[]]>>;
|
14
15
|
subLastUserAgent: z.ZodNullable<z.ZodString>;
|
@@ -64,7 +65,8 @@ export declare namespace UpdateUserCommand {
|
|
64
65
|
shortUuid: z.ZodString;
|
65
66
|
username: z.ZodString;
|
66
67
|
status: z.ZodDefault<z.ZodEnum<["DISABLED" | "ACTIVE" | "LIMITED" | "EXPIRED", ...("DISABLED" | "ACTIVE" | "LIMITED" | "EXPIRED")[]]>>;
|
67
|
-
usedTrafficBytes: z.
|
68
|
+
usedTrafficBytes: z.ZodNumber;
|
69
|
+
lifetimeUsedTrafficBytes: z.ZodNumber;
|
68
70
|
trafficLimitBytes: z.ZodDefault<z.ZodNumber>;
|
69
71
|
trafficLimitStrategy: z.ZodDefault<z.ZodEnum<["MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK", ...("MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK")[]]>>;
|
70
72
|
subLastUserAgent: z.ZodNullable<z.ZodString>;
|
@@ -93,14 +95,15 @@ export declare namespace UpdateUserCommand {
|
|
93
95
|
}>, "many">;
|
94
96
|
}, "strip", z.ZodTypeAny, {
|
95
97
|
uuid: string;
|
98
|
+
username: string;
|
96
99
|
status: "DISABLED" | "ACTIVE" | "LIMITED" | "EXPIRED";
|
97
100
|
createdAt: Date;
|
98
101
|
updatedAt: Date;
|
99
|
-
username: string;
|
100
102
|
trafficLimitBytes: number;
|
101
103
|
subscriptionUuid: string;
|
102
104
|
shortUuid: string;
|
103
105
|
usedTrafficBytes: number;
|
106
|
+
lifetimeUsedTrafficBytes: number;
|
104
107
|
trafficLimitStrategy: "MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK";
|
105
108
|
subLastUserAgent: string | null;
|
106
109
|
subLastOpenedAt: Date | null;
|
@@ -118,11 +121,13 @@ export declare namespace UpdateUserCommand {
|
|
118
121
|
}[];
|
119
122
|
}, {
|
120
123
|
uuid: string;
|
124
|
+
username: string;
|
121
125
|
createdAt: string;
|
122
126
|
updatedAt: string;
|
123
|
-
username: string;
|
124
127
|
subscriptionUuid: string;
|
125
128
|
shortUuid: string;
|
129
|
+
usedTrafficBytes: number;
|
130
|
+
lifetimeUsedTrafficBytes: number;
|
126
131
|
subLastUserAgent: string | null;
|
127
132
|
subLastOpenedAt: string | null;
|
128
133
|
expireAt: string | null;
|
@@ -139,20 +144,20 @@ export declare namespace UpdateUserCommand {
|
|
139
144
|
}[];
|
140
145
|
status?: "DISABLED" | "ACTIVE" | "LIMITED" | "EXPIRED" | undefined;
|
141
146
|
trafficLimitBytes?: number | undefined;
|
142
|
-
usedTrafficBytes?: number | undefined;
|
143
147
|
trafficLimitStrategy?: "MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK" | undefined;
|
144
148
|
}>;
|
145
149
|
}, "strip", z.ZodTypeAny, {
|
146
150
|
response: {
|
147
151
|
uuid: string;
|
152
|
+
username: string;
|
148
153
|
status: "DISABLED" | "ACTIVE" | "LIMITED" | "EXPIRED";
|
149
154
|
createdAt: Date;
|
150
155
|
updatedAt: Date;
|
151
|
-
username: string;
|
152
156
|
trafficLimitBytes: number;
|
153
157
|
subscriptionUuid: string;
|
154
158
|
shortUuid: string;
|
155
159
|
usedTrafficBytes: number;
|
160
|
+
lifetimeUsedTrafficBytes: number;
|
156
161
|
trafficLimitStrategy: "MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK";
|
157
162
|
subLastUserAgent: string | null;
|
158
163
|
subLastOpenedAt: Date | null;
|
@@ -172,11 +177,13 @@ export declare namespace UpdateUserCommand {
|
|
172
177
|
}, {
|
173
178
|
response: {
|
174
179
|
uuid: string;
|
180
|
+
username: string;
|
175
181
|
createdAt: string;
|
176
182
|
updatedAt: string;
|
177
|
-
username: string;
|
178
183
|
subscriptionUuid: string;
|
179
184
|
shortUuid: string;
|
185
|
+
usedTrafficBytes: number;
|
186
|
+
lifetimeUsedTrafficBytes: number;
|
180
187
|
subLastUserAgent: string | null;
|
181
188
|
subLastOpenedAt: string | null;
|
182
189
|
expireAt: string | null;
|
@@ -193,7 +200,6 @@ export declare namespace UpdateUserCommand {
|
|
193
200
|
}[];
|
194
201
|
status?: "DISABLED" | "ACTIVE" | "LIMITED" | "EXPIRED" | undefined;
|
195
202
|
trafficLimitBytes?: number | undefined;
|
196
|
-
usedTrafficBytes?: number | undefined;
|
197
203
|
trafficLimitStrategy?: "MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK" | undefined;
|
198
204
|
};
|
199
205
|
}>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"update-user.command.d.ts","sourceRoot":"","sources":["../../../../commands/users/update-user.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,yBAAiB,iBAAiB,CAAC;IACxB,MAAM,GAAG,qBAAwB,CAAC;IAClC,MAAM,OAAO,qBAAM,CAAC;IAEpB,MAAM,aAAa
|
1
|
+
{"version":3,"file":"update-user.command.d.ts","sourceRoot":"","sources":["../../../../commands/users/update-user.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,yBAAiB,iBAAiB,CAAC;IACxB,MAAM,GAAG,qBAAwB,CAAC;IAClC,MAAM,OAAO,qBAAM,CAAC;IAEpB,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAyCxB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAEzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
|
@@ -5,7 +5,8 @@ export declare const UsersSchema: z.ZodObject<{
|
|
5
5
|
shortUuid: z.ZodString;
|
6
6
|
username: z.ZodString;
|
7
7
|
status: z.ZodDefault<z.ZodEnum<["DISABLED" | "ACTIVE" | "LIMITED" | "EXPIRED", ...("DISABLED" | "ACTIVE" | "LIMITED" | "EXPIRED")[]]>>;
|
8
|
-
usedTrafficBytes: z.
|
8
|
+
usedTrafficBytes: z.ZodNumber;
|
9
|
+
lifetimeUsedTrafficBytes: z.ZodNumber;
|
9
10
|
trafficLimitBytes: z.ZodDefault<z.ZodNumber>;
|
10
11
|
trafficLimitStrategy: z.ZodDefault<z.ZodEnum<["MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK", ...("MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK")[]]>>;
|
11
12
|
subLastUserAgent: z.ZodNullable<z.ZodString>;
|
@@ -34,14 +35,15 @@ export declare const UsersSchema: z.ZodObject<{
|
|
34
35
|
}>, "many">;
|
35
36
|
}, "strip", z.ZodTypeAny, {
|
36
37
|
uuid: string;
|
38
|
+
username: string;
|
37
39
|
status: "DISABLED" | "ACTIVE" | "LIMITED" | "EXPIRED";
|
38
40
|
createdAt: Date;
|
39
41
|
updatedAt: Date;
|
40
|
-
username: string;
|
41
42
|
trafficLimitBytes: number;
|
42
43
|
subscriptionUuid: string;
|
43
44
|
shortUuid: string;
|
44
45
|
usedTrafficBytes: number;
|
46
|
+
lifetimeUsedTrafficBytes: number;
|
45
47
|
trafficLimitStrategy: "MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK";
|
46
48
|
subLastUserAgent: string | null;
|
47
49
|
subLastOpenedAt: Date | null;
|
@@ -59,11 +61,13 @@ export declare const UsersSchema: z.ZodObject<{
|
|
59
61
|
}[];
|
60
62
|
}, {
|
61
63
|
uuid: string;
|
64
|
+
username: string;
|
62
65
|
createdAt: string;
|
63
66
|
updatedAt: string;
|
64
|
-
username: string;
|
65
67
|
subscriptionUuid: string;
|
66
68
|
shortUuid: string;
|
69
|
+
usedTrafficBytes: number;
|
70
|
+
lifetimeUsedTrafficBytes: number;
|
67
71
|
subLastUserAgent: string | null;
|
68
72
|
subLastOpenedAt: string | null;
|
69
73
|
expireAt: string | null;
|
@@ -80,7 +84,6 @@ export declare const UsersSchema: z.ZodObject<{
|
|
80
84
|
}[];
|
81
85
|
status?: "DISABLED" | "ACTIVE" | "LIMITED" | "EXPIRED" | undefined;
|
82
86
|
trafficLimitBytes?: number | undefined;
|
83
|
-
usedTrafficBytes?: number | undefined;
|
84
87
|
trafficLimitStrategy?: "MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK" | undefined;
|
85
88
|
}>;
|
86
89
|
//# sourceMappingURL=users.schema.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"users.schema.d.ts","sourceRoot":"","sources":["../../../models/users.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,WAAW
|
1
|
+
{"version":3,"file":"users.schema.d.ts","sourceRoot":"","sources":["../../../models/users.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCtB,CAAC"}
|
@@ -12,7 +12,8 @@ exports.UsersSchema = zod_1.z.object({
|
|
12
12
|
status: zod_1.z
|
13
13
|
.enum([constants_1.USERS_STATUS_VALUES[0], ...constants_1.USERS_STATUS_VALUES])
|
14
14
|
.default(constants_1.USERS_STATUS_VALUES[0]),
|
15
|
-
usedTrafficBytes: zod_1.z.number()
|
15
|
+
usedTrafficBytes: zod_1.z.number(),
|
16
|
+
lifetimeUsedTrafficBytes: zod_1.z.number(),
|
16
17
|
trafficLimitBytes: zod_1.z.number().int().default(0),
|
17
18
|
trafficLimitStrategy: zod_1.z
|
18
19
|
.enum([constants_1.RESET_PERIODS_VALUES[0], ...constants_1.RESET_PERIODS_VALUES], {
|
@@ -70,6 +70,7 @@ exports.REST_API = {
|
|
70
70
|
CREATE: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.CREATE}`,
|
71
71
|
GET_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_UUID}/${uuid}`,
|
72
72
|
GET_BY_SHORT_UUID: (shortUuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_SHORT_UUID}/${shortUuid}`,
|
73
|
+
GET_BY_USERNAME: (username) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_USERNAME}/${username}`,
|
73
74
|
GET_BY_SUBSCRIPTION_UUID: (subscriptionUuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_SUBSCRIPTION_UUID}/${subscriptionUuid}`,
|
74
75
|
GET_ALL: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_ALL}`,
|
75
76
|
REVOKE_SUBSCRIPTION: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.REVOKE_SUBSCRIPTION}/${uuid}`,
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.GetUserByUsernameCommand = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const api_1 = require("../../api");
|
6
|
+
const users_schema_1 = require("../../models/users.schema");
|
7
|
+
var GetUserByUsernameCommand;
|
8
|
+
(function (GetUserByUsernameCommand) {
|
9
|
+
GetUserByUsernameCommand.url = api_1.REST_API.USERS.GET_BY_USERNAME;
|
10
|
+
GetUserByUsernameCommand.TSQ_url = GetUserByUsernameCommand.url(':username');
|
11
|
+
GetUserByUsernameCommand.RequestSchema = zod_1.z.object({
|
12
|
+
username: zod_1.z.string(),
|
13
|
+
});
|
14
|
+
GetUserByUsernameCommand.ResponseSchema = zod_1.z.object({
|
15
|
+
response: users_schema_1.UsersSchema,
|
16
|
+
});
|
17
|
+
})(GetUserByUsernameCommand || (exports.GetUserByUsernameCommand = GetUserByUsernameCommand = {}));
|
@@ -25,3 +25,4 @@ __exportStar(require("./get-user-by-subscription-uuid.command"), exports);
|
|
25
25
|
__exportStar(require("./get-user-by-uuid.command"), exports);
|
26
26
|
__exportStar(require("./revoke-user-subscription.command"), exports);
|
27
27
|
__exportStar(require("./update-user.command"), exports);
|
28
|
+
__exportStar(require("./get-user-by-username.command"), exports);
|
@@ -12,7 +12,8 @@ exports.UsersSchema = zod_1.z.object({
|
|
12
12
|
status: zod_1.z
|
13
13
|
.enum([constants_1.USERS_STATUS_VALUES[0], ...constants_1.USERS_STATUS_VALUES])
|
14
14
|
.default(constants_1.USERS_STATUS_VALUES[0]),
|
15
|
-
usedTrafficBytes: zod_1.z.number()
|
15
|
+
usedTrafficBytes: zod_1.z.number(),
|
16
|
+
lifetimeUsedTrafficBytes: zod_1.z.number(),
|
16
17
|
trafficLimitBytes: zod_1.z.number().int().default(0),
|
17
18
|
trafficLimitStrategy: zod_1.z
|
18
19
|
.enum([constants_1.RESET_PERIODS_VALUES[0], ...constants_1.RESET_PERIODS_VALUES], {
|