@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.
Files changed (41) hide show
  1. package/build/backend/api/controllers/users.d.ts +1 -0
  2. package/build/backend/api/controllers/users.d.ts.map +1 -1
  3. package/build/backend/api/controllers/users.js +1 -0
  4. package/build/backend/api/routes.d.ts +1 -0
  5. package/build/backend/api/routes.d.ts.map +1 -1
  6. package/build/backend/api/routes.js +1 -0
  7. package/build/backend/commands/users/create-user.command.d.ts +13 -8
  8. package/build/backend/commands/users/create-user.command.d.ts.map +1 -1
  9. package/build/backend/commands/users/disable-user.command.ts.d.ts +12 -7
  10. package/build/backend/commands/users/disable-user.command.ts.d.ts.map +1 -1
  11. package/build/backend/commands/users/enable-user.command.d.ts +12 -7
  12. package/build/backend/commands/users/enable-user.command.d.ts.map +1 -1
  13. package/build/backend/commands/users/get-all-users-v2.command.d.ts +17 -10
  14. package/build/backend/commands/users/get-all-users-v2.command.d.ts.map +1 -1
  15. package/build/backend/commands/users/get-all-users.command.d.ts +21 -14
  16. package/build/backend/commands/users/get-all-users.command.d.ts.map +1 -1
  17. package/build/backend/commands/users/get-user-by-short-uuid.command.d.ts +12 -7
  18. package/build/backend/commands/users/get-user-by-short-uuid.command.d.ts.map +1 -1
  19. package/build/backend/commands/users/get-user-by-subscription-uuid.command.d.ts +12 -7
  20. package/build/backend/commands/users/get-user-by-subscription-uuid.command.d.ts.map +1 -1
  21. package/build/backend/commands/users/get-user-by-username.command.d.ts +160 -0
  22. package/build/backend/commands/users/get-user-by-username.command.d.ts.map +1 -0
  23. package/build/backend/commands/users/get-user-by-username.command.js +17 -0
  24. package/build/backend/commands/users/get-user-by-uuid.command.d.ts +12 -7
  25. package/build/backend/commands/users/get-user-by-uuid.command.d.ts.map +1 -1
  26. package/build/backend/commands/users/index.d.ts +1 -0
  27. package/build/backend/commands/users/index.d.ts.map +1 -1
  28. package/build/backend/commands/users/index.js +1 -0
  29. package/build/backend/commands/users/revoke-user-subscription.command.d.ts +12 -7
  30. package/build/backend/commands/users/revoke-user-subscription.command.d.ts.map +1 -1
  31. package/build/backend/commands/users/update-user.command.d.ts +14 -8
  32. package/build/backend/commands/users/update-user.command.d.ts.map +1 -1
  33. package/build/backend/models/users.schema.d.ts +7 -4
  34. package/build/backend/models/users.schema.d.ts.map +1 -1
  35. package/build/backend/models/users.schema.js +2 -1
  36. package/build/frontend/api/controllers/users.js +1 -0
  37. package/build/frontend/api/routes.js +1 -0
  38. package/build/frontend/commands/users/get-user-by-username.command.js +17 -0
  39. package/build/frontend/commands/users/index.js +1 -0
  40. package/build/frontend/models/users.schema.js +2 -1
  41. 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.ZodDefault<z.ZodNumber>;
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.ZodDefault<z.ZodNumber>;
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
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.ZodDefault<z.ZodNumber>;
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCtB,CAAC"}
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().int().default(0),
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], {
@@ -6,6 +6,7 @@ exports.USERS_ROUTES = {
6
6
  CREATE: '',
7
7
  GET_BY_UUID: 'uuid',
8
8
  GET_BY_SHORT_UUID: 'short-uuid',
9
+ GET_BY_USERNAME: 'username',
9
10
  GET_BY_SUBSCRIPTION_UUID: 'sub-uuid',
10
11
  GET_ALL: '',
11
12
  GET_ALL_V2: 'v2',
@@ -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().int().default(0),
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], {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "0.0.60",
3
+ "version": "0.0.62",
4
4
  "description": "A contract library for Remnawave",
5
5
  "main": "build/backend/index.js",
6
6
  "browser": "build/frontend/index.js",