@remnawave/backend-contract 0.7.1 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/build/backend/commands/users/actions/activate-all-inbounds.command.d.ts +10 -0
  2. package/build/backend/commands/users/actions/activate-all-inbounds.command.d.ts.map +1 -1
  3. package/build/backend/commands/users/actions/disable-user.command.d.ts +10 -0
  4. package/build/backend/commands/users/actions/disable-user.command.d.ts.map +1 -1
  5. package/build/backend/commands/users/actions/enable-user.command.d.ts +10 -0
  6. package/build/backend/commands/users/actions/enable-user.command.d.ts.map +1 -1
  7. package/build/backend/commands/users/actions/reset-user-traffic.command.d.ts +10 -0
  8. package/build/backend/commands/users/actions/reset-user-traffic.command.d.ts.map +1 -1
  9. package/build/backend/commands/users/actions/revoke-user-subscription.command.d.ts +20 -0
  10. package/build/backend/commands/users/actions/revoke-user-subscription.command.d.ts.map +1 -1
  11. package/build/backend/commands/users/actions/revoke-user-subscription.command.js +7 -0
  12. package/build/backend/commands/users/create-user.command.d.ts +10 -0
  13. package/build/backend/commands/users/create-user.command.d.ts.map +1 -1
  14. package/build/backend/commands/users/get-all-users.command.d.ts +14 -0
  15. package/build/backend/commands/users/get-all-users.command.d.ts.map +1 -1
  16. package/build/backend/commands/users/get-by/get-user-by-email.command.d.ts +10 -0
  17. package/build/backend/commands/users/get-by/get-user-by-email.command.d.ts.map +1 -1
  18. package/build/backend/commands/users/get-by/get-user-by-short-uuid.command.d.ts +10 -0
  19. package/build/backend/commands/users/get-by/get-user-by-short-uuid.command.d.ts.map +1 -1
  20. package/build/backend/commands/users/get-by/get-user-by-subscription-uuid.command.d.ts +10 -0
  21. package/build/backend/commands/users/get-by/get-user-by-subscription-uuid.command.d.ts.map +1 -1
  22. package/build/backend/commands/users/get-by/get-user-by-tag.command.d.ts +10 -0
  23. package/build/backend/commands/users/get-by/get-user-by-tag.command.d.ts.map +1 -1
  24. package/build/backend/commands/users/get-by/get-user-by-telegram-id.command.d.ts +10 -0
  25. package/build/backend/commands/users/get-by/get-user-by-telegram-id.command.d.ts.map +1 -1
  26. package/build/backend/commands/users/get-by/get-user-by-username.command.d.ts +10 -0
  27. package/build/backend/commands/users/get-by/get-user-by-username.command.d.ts.map +1 -1
  28. package/build/backend/commands/users/get-user-by-uuid.command.d.ts +10 -0
  29. package/build/backend/commands/users/get-user-by-uuid.command.d.ts.map +1 -1
  30. package/build/backend/commands/users/update-user.command.d.ts +12 -0
  31. package/build/backend/commands/users/update-user.command.d.ts.map +1 -1
  32. package/build/backend/constants/errors/errors.d.ts +5 -0
  33. package/build/backend/constants/errors/errors.d.ts.map +1 -1
  34. package/build/backend/constants/errors/errors.js +5 -0
  35. package/build/backend/constants/events/events.d.ts +8 -0
  36. package/build/backend/constants/events/events.d.ts.map +1 -1
  37. package/build/backend/constants/events/events.js +7 -0
  38. package/build/backend/models/extented-users.schema.d.ts +6 -0
  39. package/build/backend/models/extented-users.schema.d.ts.map +1 -1
  40. package/build/backend/models/users.schema.d.ts +6 -0
  41. package/build/backend/models/users.schema.d.ts.map +1 -1
  42. package/build/backend/models/users.schema.js +5 -0
  43. package/build/frontend/commands/users/actions/revoke-user-subscription.command.js +7 -0
  44. package/build/frontend/constants/errors/errors.js +5 -0
  45. package/build/frontend/constants/events/events.js +7 -0
  46. package/build/frontend/models/users.schema.js +5 -0
  47. package/package.json +1 -1
@@ -46,6 +46,8 @@ export declare namespace GetUserBySubscriptionUuidCommand {
46
46
  telegramId: z.ZodNullable<z.ZodNumber>;
47
47
  email: z.ZodNullable<z.ZodString>;
48
48
  hwidDeviceLimit: z.ZodNullable<z.ZodNumber>;
49
+ firstConnectedAt: z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>;
50
+ lastTriggeredThreshold: z.ZodDefault<z.ZodNumber>;
49
51
  createdAt: z.ZodEffects<z.ZodString, Date, string>;
50
52
  updatedAt: z.ZodEffects<z.ZodString, Date, string>;
51
53
  activeUserInbounds: z.ZodArray<z.ZodObject<{
@@ -112,6 +114,8 @@ export declare namespace GetUserBySubscriptionUuidCommand {
112
114
  telegramId: number | null;
113
115
  email: string | null;
114
116
  hwidDeviceLimit: number | null;
117
+ firstConnectedAt: Date | null;
118
+ lastTriggeredThreshold: number;
115
119
  activeUserInbounds: {
116
120
  type: string;
117
121
  uuid: string;
@@ -150,6 +154,7 @@ export declare namespace GetUserBySubscriptionUuidCommand {
150
154
  telegramId: number | null;
151
155
  email: string | null;
152
156
  hwidDeviceLimit: number | null;
157
+ firstConnectedAt: string | null;
153
158
  activeUserInbounds: {
154
159
  type: string;
155
160
  uuid: string;
@@ -168,6 +173,7 @@ export declare namespace GetUserBySubscriptionUuidCommand {
168
173
  status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
169
174
  trafficLimitBytes?: number | undefined;
170
175
  trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
176
+ lastTriggeredThreshold?: number | undefined;
171
177
  }>;
172
178
  }, "strip", z.ZodTypeAny, {
173
179
  response: {
@@ -196,6 +202,8 @@ export declare namespace GetUserBySubscriptionUuidCommand {
196
202
  telegramId: number | null;
197
203
  email: string | null;
198
204
  hwidDeviceLimit: number | null;
205
+ firstConnectedAt: Date | null;
206
+ lastTriggeredThreshold: number;
199
207
  activeUserInbounds: {
200
208
  type: string;
201
209
  uuid: string;
@@ -236,6 +244,7 @@ export declare namespace GetUserBySubscriptionUuidCommand {
236
244
  telegramId: number | null;
237
245
  email: string | null;
238
246
  hwidDeviceLimit: number | null;
247
+ firstConnectedAt: string | null;
239
248
  activeUserInbounds: {
240
249
  type: string;
241
250
  uuid: string;
@@ -254,6 +263,7 @@ export declare namespace GetUserBySubscriptionUuidCommand {
254
263
  status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
255
264
  trafficLimitBytes?: number | undefined;
256
265
  trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
266
+ lastTriggeredThreshold?: number | undefined;
257
267
  };
258
268
  }>;
259
269
  type Response = z.infer<typeof ResponseSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"get-user-by-subscription-uuid.command.d.ts","sourceRoot":"","sources":["../../../../../commands/users/get-by/get-user-by-subscription-uuid.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,gCAAgC,CAAC;IACvC,MAAM,GAAG,sCAA0C,CAAC;IACpD,MAAM,OAAO,QAA2B,CAAC;IAEzC,MAAM,eAAe,8CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;MAExB,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":"get-user-by-subscription-uuid.command.d.ts","sourceRoot":"","sources":["../../../../../commands/users/get-by/get-user-by-subscription-uuid.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,gCAAgC,CAAC;IACvC,MAAM,GAAG,sCAA0C,CAAC;IACpD,MAAM,OAAO,QAA2B,CAAC;IAEzC,MAAM,eAAe,8CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;MAExB,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"}
@@ -46,6 +46,8 @@ export declare namespace GetUserByTagCommand {
46
46
  telegramId: z.ZodNullable<z.ZodNumber>;
47
47
  email: z.ZodNullable<z.ZodString>;
48
48
  hwidDeviceLimit: z.ZodNullable<z.ZodNumber>;
49
+ firstConnectedAt: z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>;
50
+ lastTriggeredThreshold: z.ZodDefault<z.ZodNumber>;
49
51
  createdAt: z.ZodEffects<z.ZodString, Date, string>;
50
52
  updatedAt: z.ZodEffects<z.ZodString, Date, string>;
51
53
  activeUserInbounds: z.ZodArray<z.ZodObject<{
@@ -112,6 +114,8 @@ export declare namespace GetUserByTagCommand {
112
114
  telegramId: number | null;
113
115
  email: string | null;
114
116
  hwidDeviceLimit: number | null;
117
+ firstConnectedAt: Date | null;
118
+ lastTriggeredThreshold: number;
115
119
  activeUserInbounds: {
116
120
  type: string;
117
121
  uuid: string;
@@ -150,6 +154,7 @@ export declare namespace GetUserByTagCommand {
150
154
  telegramId: number | null;
151
155
  email: string | null;
152
156
  hwidDeviceLimit: number | null;
157
+ firstConnectedAt: string | null;
153
158
  activeUserInbounds: {
154
159
  type: string;
155
160
  uuid: string;
@@ -168,6 +173,7 @@ export declare namespace GetUserByTagCommand {
168
173
  status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
169
174
  trafficLimitBytes?: number | undefined;
170
175
  trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
176
+ lastTriggeredThreshold?: number | undefined;
171
177
  }>, "many">;
172
178
  }, "strip", z.ZodTypeAny, {
173
179
  response: {
@@ -196,6 +202,8 @@ export declare namespace GetUserByTagCommand {
196
202
  telegramId: number | null;
197
203
  email: string | null;
198
204
  hwidDeviceLimit: number | null;
205
+ firstConnectedAt: Date | null;
206
+ lastTriggeredThreshold: number;
199
207
  activeUserInbounds: {
200
208
  type: string;
201
209
  uuid: string;
@@ -236,6 +244,7 @@ export declare namespace GetUserByTagCommand {
236
244
  telegramId: number | null;
237
245
  email: string | null;
238
246
  hwidDeviceLimit: number | null;
247
+ firstConnectedAt: string | null;
239
248
  activeUserInbounds: {
240
249
  type: string;
241
250
  uuid: string;
@@ -254,6 +263,7 @@ export declare namespace GetUserByTagCommand {
254
263
  status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
255
264
  trafficLimitBytes?: number | undefined;
256
265
  trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
266
+ lastTriggeredThreshold?: number | undefined;
257
267
  }[];
258
268
  }>;
259
269
  type Response = z.infer<typeof ResponseSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"get-user-by-tag.command.d.ts","sourceRoot":"","sources":["../../../../../commands/users/get-by/get-user-by-tag.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,mBAAmB,CAAC;IAC1B,MAAM,GAAG,yBAA4B,CAAC;IACtC,MAAM,OAAO,QAAc,CAAC;IAE5B,MAAM,eAAe,8CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;MAKxB,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":"get-user-by-tag.command.d.ts","sourceRoot":"","sources":["../../../../../commands/users/get-by/get-user-by-tag.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,mBAAmB,CAAC;IAC1B,MAAM,GAAG,yBAA4B,CAAC;IACtC,MAAM,OAAO,QAAc,CAAC;IAE5B,MAAM,eAAe,8CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;MAKxB,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"}
@@ -46,6 +46,8 @@ export declare namespace GetUserByTelegramIdCommand {
46
46
  telegramId: z.ZodNullable<z.ZodNumber>;
47
47
  email: z.ZodNullable<z.ZodString>;
48
48
  hwidDeviceLimit: z.ZodNullable<z.ZodNumber>;
49
+ firstConnectedAt: z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>;
50
+ lastTriggeredThreshold: z.ZodDefault<z.ZodNumber>;
49
51
  createdAt: z.ZodEffects<z.ZodString, Date, string>;
50
52
  updatedAt: z.ZodEffects<z.ZodString, Date, string>;
51
53
  activeUserInbounds: z.ZodArray<z.ZodObject<{
@@ -112,6 +114,8 @@ export declare namespace GetUserByTelegramIdCommand {
112
114
  telegramId: number | null;
113
115
  email: string | null;
114
116
  hwidDeviceLimit: number | null;
117
+ firstConnectedAt: Date | null;
118
+ lastTriggeredThreshold: number;
115
119
  activeUserInbounds: {
116
120
  type: string;
117
121
  uuid: string;
@@ -150,6 +154,7 @@ export declare namespace GetUserByTelegramIdCommand {
150
154
  telegramId: number | null;
151
155
  email: string | null;
152
156
  hwidDeviceLimit: number | null;
157
+ firstConnectedAt: string | null;
153
158
  activeUserInbounds: {
154
159
  type: string;
155
160
  uuid: string;
@@ -168,6 +173,7 @@ export declare namespace GetUserByTelegramIdCommand {
168
173
  status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
169
174
  trafficLimitBytes?: number | undefined;
170
175
  trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
176
+ lastTriggeredThreshold?: number | undefined;
171
177
  }>, "many">;
172
178
  }, "strip", z.ZodTypeAny, {
173
179
  response: {
@@ -196,6 +202,8 @@ export declare namespace GetUserByTelegramIdCommand {
196
202
  telegramId: number | null;
197
203
  email: string | null;
198
204
  hwidDeviceLimit: number | null;
205
+ firstConnectedAt: Date | null;
206
+ lastTriggeredThreshold: number;
199
207
  activeUserInbounds: {
200
208
  type: string;
201
209
  uuid: string;
@@ -236,6 +244,7 @@ export declare namespace GetUserByTelegramIdCommand {
236
244
  telegramId: number | null;
237
245
  email: string | null;
238
246
  hwidDeviceLimit: number | null;
247
+ firstConnectedAt: string | null;
239
248
  activeUserInbounds: {
240
249
  type: string;
241
250
  uuid: string;
@@ -254,6 +263,7 @@ export declare namespace GetUserByTelegramIdCommand {
254
263
  status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
255
264
  trafficLimitBytes?: number | undefined;
256
265
  trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
266
+ lastTriggeredThreshold?: number | undefined;
257
267
  }[];
258
268
  }>;
259
269
  type Response = z.infer<typeof ResponseSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"get-user-by-telegram-id.command.d.ts","sourceRoot":"","sources":["../../../../../commands/users/get-by/get-user-by-telegram-id.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,0BAA0B,CAAC;IACjC,MAAM,GAAG,gCAAoC,CAAC;IAC9C,MAAM,OAAO,QAAqB,CAAC;IAEnC,MAAM,eAAe,8CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;MAExB,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":"get-user-by-telegram-id.command.d.ts","sourceRoot":"","sources":["../../../../../commands/users/get-by/get-user-by-telegram-id.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,0BAA0B,CAAC;IACjC,MAAM,GAAG,gCAAoC,CAAC;IAC9C,MAAM,OAAO,QAAqB,CAAC;IAEnC,MAAM,eAAe,8CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;MAExB,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"}
@@ -46,6 +46,8 @@ export declare namespace GetUserByUsernameCommand {
46
46
  telegramId: z.ZodNullable<z.ZodNumber>;
47
47
  email: z.ZodNullable<z.ZodString>;
48
48
  hwidDeviceLimit: z.ZodNullable<z.ZodNumber>;
49
+ firstConnectedAt: z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>;
50
+ lastTriggeredThreshold: z.ZodDefault<z.ZodNumber>;
49
51
  createdAt: z.ZodEffects<z.ZodString, Date, string>;
50
52
  updatedAt: z.ZodEffects<z.ZodString, Date, string>;
51
53
  activeUserInbounds: z.ZodArray<z.ZodObject<{
@@ -112,6 +114,8 @@ export declare namespace GetUserByUsernameCommand {
112
114
  telegramId: number | null;
113
115
  email: string | null;
114
116
  hwidDeviceLimit: number | null;
117
+ firstConnectedAt: Date | null;
118
+ lastTriggeredThreshold: number;
115
119
  activeUserInbounds: {
116
120
  type: string;
117
121
  uuid: string;
@@ -150,6 +154,7 @@ export declare namespace GetUserByUsernameCommand {
150
154
  telegramId: number | null;
151
155
  email: string | null;
152
156
  hwidDeviceLimit: number | null;
157
+ firstConnectedAt: string | null;
153
158
  activeUserInbounds: {
154
159
  type: string;
155
160
  uuid: string;
@@ -168,6 +173,7 @@ export declare namespace GetUserByUsernameCommand {
168
173
  status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
169
174
  trafficLimitBytes?: number | undefined;
170
175
  trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
176
+ lastTriggeredThreshold?: number | undefined;
171
177
  }>;
172
178
  }, "strip", z.ZodTypeAny, {
173
179
  response: {
@@ -196,6 +202,8 @@ export declare namespace GetUserByUsernameCommand {
196
202
  telegramId: number | null;
197
203
  email: string | null;
198
204
  hwidDeviceLimit: number | null;
205
+ firstConnectedAt: Date | null;
206
+ lastTriggeredThreshold: number;
199
207
  activeUserInbounds: {
200
208
  type: string;
201
209
  uuid: string;
@@ -236,6 +244,7 @@ export declare namespace GetUserByUsernameCommand {
236
244
  telegramId: number | null;
237
245
  email: string | null;
238
246
  hwidDeviceLimit: number | null;
247
+ firstConnectedAt: string | null;
239
248
  activeUserInbounds: {
240
249
  type: string;
241
250
  uuid: string;
@@ -254,6 +263,7 @@ export declare namespace GetUserByUsernameCommand {
254
263
  status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
255
264
  trafficLimitBytes?: number | undefined;
256
265
  trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
266
+ lastTriggeredThreshold?: number | undefined;
257
267
  };
258
268
  }>;
259
269
  type Response = z.infer<typeof ResponseSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"get-user-by-username.command.d.ts","sourceRoot":"","sources":["../../../../../commands/users/get-by/get-user-by-username.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,wBAAwB,CAAC;IAC/B,MAAM,GAAG,8BAAiC,CAAC;IAC3C,MAAM,OAAO,QAAmB,CAAC;IAEjC,MAAM,eAAe,8CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;MAExB,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":"get-user-by-username.command.d.ts","sourceRoot":"","sources":["../../../../../commands/users/get-by/get-user-by-username.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,wBAAwB,CAAC;IAC/B,MAAM,GAAG,8BAAiC,CAAC;IAC3C,MAAM,OAAO,QAAmB,CAAC;IAEjC,MAAM,eAAe,8CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;MAExB,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"}
@@ -46,6 +46,8 @@ export declare namespace GetUserByUuidCommand {
46
46
  telegramId: z.ZodNullable<z.ZodNumber>;
47
47
  email: z.ZodNullable<z.ZodString>;
48
48
  hwidDeviceLimit: z.ZodNullable<z.ZodNumber>;
49
+ firstConnectedAt: z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>;
50
+ lastTriggeredThreshold: z.ZodDefault<z.ZodNumber>;
49
51
  createdAt: z.ZodEffects<z.ZodString, Date, string>;
50
52
  updatedAt: z.ZodEffects<z.ZodString, Date, string>;
51
53
  activeUserInbounds: z.ZodArray<z.ZodObject<{
@@ -112,6 +114,8 @@ export declare namespace GetUserByUuidCommand {
112
114
  telegramId: number | null;
113
115
  email: string | null;
114
116
  hwidDeviceLimit: number | null;
117
+ firstConnectedAt: Date | null;
118
+ lastTriggeredThreshold: number;
115
119
  activeUserInbounds: {
116
120
  type: string;
117
121
  uuid: string;
@@ -150,6 +154,7 @@ export declare namespace GetUserByUuidCommand {
150
154
  telegramId: number | null;
151
155
  email: string | null;
152
156
  hwidDeviceLimit: number | null;
157
+ firstConnectedAt: string | null;
153
158
  activeUserInbounds: {
154
159
  type: string;
155
160
  uuid: string;
@@ -168,6 +173,7 @@ export declare namespace GetUserByUuidCommand {
168
173
  status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
169
174
  trafficLimitBytes?: number | undefined;
170
175
  trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
176
+ lastTriggeredThreshold?: number | undefined;
171
177
  }>;
172
178
  }, "strip", z.ZodTypeAny, {
173
179
  response: {
@@ -196,6 +202,8 @@ export declare namespace GetUserByUuidCommand {
196
202
  telegramId: number | null;
197
203
  email: string | null;
198
204
  hwidDeviceLimit: number | null;
205
+ firstConnectedAt: Date | null;
206
+ lastTriggeredThreshold: number;
199
207
  activeUserInbounds: {
200
208
  type: string;
201
209
  uuid: string;
@@ -236,6 +244,7 @@ export declare namespace GetUserByUuidCommand {
236
244
  telegramId: number | null;
237
245
  email: string | null;
238
246
  hwidDeviceLimit: number | null;
247
+ firstConnectedAt: string | null;
239
248
  activeUserInbounds: {
240
249
  type: string;
241
250
  uuid: string;
@@ -254,6 +263,7 @@ export declare namespace GetUserByUuidCommand {
254
263
  status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
255
264
  trafficLimitBytes?: number | undefined;
256
265
  trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
266
+ lastTriggeredThreshold?: number | undefined;
257
267
  };
258
268
  }>;
259
269
  type Response = z.infer<typeof ResponseSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"get-user-by-uuid.command.d.ts","sourceRoot":"","sources":["../../../../commands/users/get-user-by-uuid.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,oBAAoB,CAAC;IAC3B,MAAM,GAAG,0BAA6B,CAAC;IACvC,MAAM,OAAO,QAAe,CAAC;IAE7B,MAAM,eAAe,2CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;MAExB,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":"get-user-by-uuid.command.d.ts","sourceRoot":"","sources":["../../../../commands/users/get-user-by-uuid.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,oBAAoB,CAAC;IAC3B,MAAM,GAAG,0BAA6B,CAAC;IACvC,MAAM,OAAO,QAAe,CAAC;IAE7B,MAAM,eAAe,2CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;MAExB,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"}
@@ -37,6 +37,8 @@ export declare namespace UpdateUserCommand {
37
37
  telegramId: z.ZodNullable<z.ZodNumber>;
38
38
  email: z.ZodNullable<z.ZodString>;
39
39
  hwidDeviceLimit: z.ZodNullable<z.ZodNumber>;
40
+ firstConnectedAt: z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>;
41
+ lastTriggeredThreshold: z.ZodDefault<z.ZodNumber>;
40
42
  createdAt: z.ZodEffects<z.ZodString, Date, string>;
41
43
  updatedAt: z.ZodEffects<z.ZodString, Date, string>;
42
44
  activeUserInbounds: z.ZodArray<z.ZodObject<{
@@ -140,6 +142,8 @@ export declare namespace UpdateUserCommand {
140
142
  telegramId: z.ZodNullable<z.ZodNumber>;
141
143
  email: z.ZodNullable<z.ZodString>;
142
144
  hwidDeviceLimit: z.ZodNullable<z.ZodNumber>;
145
+ firstConnectedAt: z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>;
146
+ lastTriggeredThreshold: z.ZodDefault<z.ZodNumber>;
143
147
  createdAt: z.ZodEffects<z.ZodString, Date, string>;
144
148
  updatedAt: z.ZodEffects<z.ZodString, Date, string>;
145
149
  activeUserInbounds: z.ZodArray<z.ZodObject<{
@@ -206,6 +210,8 @@ export declare namespace UpdateUserCommand {
206
210
  telegramId: number | null;
207
211
  email: string | null;
208
212
  hwidDeviceLimit: number | null;
213
+ firstConnectedAt: Date | null;
214
+ lastTriggeredThreshold: number;
209
215
  activeUserInbounds: {
210
216
  type: string;
211
217
  uuid: string;
@@ -244,6 +250,7 @@ export declare namespace UpdateUserCommand {
244
250
  telegramId: number | null;
245
251
  email: string | null;
246
252
  hwidDeviceLimit: number | null;
253
+ firstConnectedAt: string | null;
247
254
  activeUserInbounds: {
248
255
  type: string;
249
256
  uuid: string;
@@ -262,6 +269,7 @@ export declare namespace UpdateUserCommand {
262
269
  status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
263
270
  trafficLimitBytes?: number | undefined;
264
271
  trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
272
+ lastTriggeredThreshold?: number | undefined;
265
273
  }>;
266
274
  }, "strip", z.ZodTypeAny, {
267
275
  response: {
@@ -290,6 +298,8 @@ export declare namespace UpdateUserCommand {
290
298
  telegramId: number | null;
291
299
  email: string | null;
292
300
  hwidDeviceLimit: number | null;
301
+ firstConnectedAt: Date | null;
302
+ lastTriggeredThreshold: number;
293
303
  activeUserInbounds: {
294
304
  type: string;
295
305
  uuid: string;
@@ -330,6 +340,7 @@ export declare namespace UpdateUserCommand {
330
340
  telegramId: number | null;
331
341
  email: string | null;
332
342
  hwidDeviceLimit: number | null;
343
+ firstConnectedAt: string | null;
333
344
  activeUserInbounds: {
334
345
  type: string;
335
346
  uuid: string;
@@ -348,6 +359,7 @@ export declare namespace UpdateUserCommand {
348
359
  status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
349
360
  trafficLimitBytes?: number | undefined;
350
361
  trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
362
+ lastTriggeredThreshold?: number | undefined;
351
363
  };
352
364
  }>;
353
365
  type Response = z.infer<typeof ResponseSchema>;
@@ -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;AAMxB,yBAAiB,iBAAiB,CAAC;IACxB,MAAM,GAAG,eAAwB,CAAC;IAClC,MAAM,OAAO,eAAM,CAAC;IAEpB,MAAM,eAAe,2CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAwDxB,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;AAMxB,yBAAiB,iBAAiB,CAAC;IACxB,MAAM,GAAG,eAAwB,CAAC;IAClC,MAAM,OAAO,eAAM,CAAC;IAEpB,MAAM,eAAe,2CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAwDxB,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"}
@@ -549,5 +549,10 @@ export declare const ERRORS: {
549
549
  readonly message: "Getting all subscriptions error";
550
550
  readonly httpCode: 500;
551
551
  };
552
+ readonly TRIGGER_THRESHOLD_NOTIFICATION_ERROR: {
553
+ readonly code: "A105";
554
+ readonly message: "Trigger threshold notification error";
555
+ readonly httpCode: 500;
556
+ };
552
557
  };
553
558
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAwJY,MAAM;;;;;;;;;;wCAUN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA4IN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0N3B,CAAC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAwJY,MAAM;;;;;;;;;;wCAUN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA4IN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+N3B,CAAC"}
@@ -520,4 +520,9 @@ exports.ERRORS = {
520
520
  message: 'Getting all subscriptions error',
521
521
  httpCode: 500,
522
522
  },
523
+ TRIGGER_THRESHOLD_NOTIFICATION_ERROR: {
524
+ code: 'A105',
525
+ message: 'Trigger threshold notification error',
526
+ httpCode: 500,
527
+ },
523
528
  };
@@ -15,6 +15,8 @@ export declare const EVENTS: {
15
15
  readonly EXPIRES_IN_24_HOURS: "user.expires_in_24_hours";
16
16
  readonly EXPIRED_24_HOURS_AGO: "user.expired_24_hours_ago";
17
17
  };
18
+ readonly FIRST_CONNECTED: "user.first_connected";
19
+ readonly BANDWIDTH_USAGE_THRESHOLD_REACHED: "user.bandwidth_usage_threshold_reached";
18
20
  };
19
21
  readonly NODE: {
20
22
  readonly CREATED: "node.created";
@@ -31,11 +33,17 @@ export declare const EVENTS: {
31
33
  readonly LOGIN_ATTEMPT_FAILED: "service.login_attempt_failed";
32
34
  readonly LOGIN_ATTEMPT_SUCCESS: "service.login_attempt_success";
33
35
  };
36
+ readonly ERRORS: {
37
+ readonly BANDWIDTH_USAGE_THRESHOLD_REACHED_MAX_NOTIFICATIONS: "errors.bandwidth_usage_threshold_reached_max_notifications";
38
+ };
34
39
  readonly CATCH_ALL_USER_EVENTS: "user.*";
35
40
  readonly CATCH_ALL_NODE_EVENTS: "node.*";
36
41
  readonly CATCH_ALL_SERVICE_EVENTS: "service.*";
42
+ readonly CATCH_ALL_ERRORS_EVENTS: "errors.*";
43
+ readonly CATCH_ALL_ERRORS: "*";
37
44
  };
38
45
  export type TNodeEvents = (typeof EVENTS.NODE)[keyof typeof EVENTS.NODE];
39
46
  export type TUserEvents = (typeof EVENTS.USER)[keyof typeof EVENTS.USER];
40
47
  export type TServiceEvents = (typeof EVENTS.SERVICE)[keyof typeof EVENTS.SERVICE];
48
+ export type TErrorsEvents = (typeof EVENTS.ERRORS)[keyof typeof EVENTS.ERRORS];
41
49
  //# sourceMappingURL=events.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../constants/events/events.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCT,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;AACzE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;AACzE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../constants/events/events.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4CT,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;AACzE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;AACzE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC;AAClF,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC"}
@@ -18,6 +18,8 @@ exports.EVENTS = {
18
18
  EXPIRES_IN_24_HOURS: 'user.expires_in_24_hours',
19
19
  EXPIRED_24_HOURS_AGO: 'user.expired_24_hours_ago',
20
20
  },
21
+ FIRST_CONNECTED: 'user.first_connected',
22
+ BANDWIDTH_USAGE_THRESHOLD_REACHED: 'user.bandwidth_usage_threshold_reached',
21
23
  },
22
24
  NODE: {
23
25
  CREATED: 'node.created',
@@ -34,7 +36,12 @@ exports.EVENTS = {
34
36
  LOGIN_ATTEMPT_FAILED: 'service.login_attempt_failed',
35
37
  LOGIN_ATTEMPT_SUCCESS: 'service.login_attempt_success',
36
38
  },
39
+ ERRORS: {
40
+ BANDWIDTH_USAGE_THRESHOLD_REACHED_MAX_NOTIFICATIONS: 'errors.bandwidth_usage_threshold_reached_max_notifications',
41
+ },
37
42
  CATCH_ALL_USER_EVENTS: 'user.*',
38
43
  CATCH_ALL_NODE_EVENTS: 'node.*',
39
44
  CATCH_ALL_SERVICE_EVENTS: 'service.*',
45
+ CATCH_ALL_ERRORS_EVENTS: 'errors.*',
46
+ CATCH_ALL_ERRORS: '*',
40
47
  };
@@ -33,6 +33,8 @@ export declare const ExtendedUsersSchema: z.ZodObject<{
33
33
  telegramId: z.ZodNullable<z.ZodNumber>;
34
34
  email: z.ZodNullable<z.ZodString>;
35
35
  hwidDeviceLimit: z.ZodNullable<z.ZodNumber>;
36
+ firstConnectedAt: z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>;
37
+ lastTriggeredThreshold: z.ZodDefault<z.ZodNumber>;
36
38
  createdAt: z.ZodEffects<z.ZodString, Date, string>;
37
39
  updatedAt: z.ZodEffects<z.ZodString, Date, string>;
38
40
  activeUserInbounds: z.ZodArray<z.ZodObject<{
@@ -99,6 +101,8 @@ export declare const ExtendedUsersSchema: z.ZodObject<{
99
101
  telegramId: number | null;
100
102
  email: string | null;
101
103
  hwidDeviceLimit: number | null;
104
+ firstConnectedAt: Date | null;
105
+ lastTriggeredThreshold: number;
102
106
  activeUserInbounds: {
103
107
  type: string;
104
108
  uuid: string;
@@ -137,6 +141,7 @@ export declare const ExtendedUsersSchema: z.ZodObject<{
137
141
  telegramId: number | null;
138
142
  email: string | null;
139
143
  hwidDeviceLimit: number | null;
144
+ firstConnectedAt: string | null;
140
145
  activeUserInbounds: {
141
146
  type: string;
142
147
  uuid: string;
@@ -155,5 +160,6 @@ export declare const ExtendedUsersSchema: z.ZodObject<{
155
160
  status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
156
161
  trafficLimitBytes?: number | undefined;
157
162
  trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
163
+ lastTriggeredThreshold?: number | undefined;
158
164
  }>;
159
165
  //# sourceMappingURL=extented-users.schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extented-users.schema.d.ts","sourceRoot":"","sources":["../../../models/extented-users.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI9B,CAAC"}
1
+ {"version":3,"file":"extented-users.schema.d.ts","sourceRoot":"","sources":["../../../models/extented-users.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI9B,CAAC"}
@@ -33,6 +33,8 @@ export declare const UsersSchema: z.ZodObject<{
33
33
  telegramId: z.ZodNullable<z.ZodNumber>;
34
34
  email: z.ZodNullable<z.ZodString>;
35
35
  hwidDeviceLimit: z.ZodNullable<z.ZodNumber>;
36
+ firstConnectedAt: z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>;
37
+ lastTriggeredThreshold: z.ZodDefault<z.ZodNumber>;
36
38
  createdAt: z.ZodEffects<z.ZodString, Date, string>;
37
39
  updatedAt: z.ZodEffects<z.ZodString, Date, string>;
38
40
  activeUserInbounds: z.ZodArray<z.ZodObject<{
@@ -80,6 +82,8 @@ export declare const UsersSchema: z.ZodObject<{
80
82
  telegramId: number | null;
81
83
  email: string | null;
82
84
  hwidDeviceLimit: number | null;
85
+ firstConnectedAt: Date | null;
86
+ lastTriggeredThreshold: number;
83
87
  activeUserInbounds: {
84
88
  type: string;
85
89
  uuid: string;
@@ -110,6 +114,7 @@ export declare const UsersSchema: z.ZodObject<{
110
114
  telegramId: number | null;
111
115
  email: string | null;
112
116
  hwidDeviceLimit: number | null;
117
+ firstConnectedAt: string | null;
113
118
  activeUserInbounds: {
114
119
  type: string;
115
120
  uuid: string;
@@ -120,5 +125,6 @@ export declare const UsersSchema: z.ZodObject<{
120
125
  status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
121
126
  trafficLimitBytes?: number | undefined;
122
127
  trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
128
+ lastTriggeredThreshold?: number | undefined;
123
129
  }>;
124
130
  //# 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;AAKxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuEtB,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;AAKxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgFtB,CAAC"}
@@ -47,6 +47,11 @@ exports.UsersSchema = zod_1.z.object({
47
47
  telegramId: zod_1.z.nullable(zod_1.z.number().int()),
48
48
  email: zod_1.z.nullable(zod_1.z.string().email()),
49
49
  hwidDeviceLimit: zod_1.z.nullable(zod_1.z.number().int()),
50
+ firstConnectedAt: zod_1.z.nullable(zod_1.z
51
+ .string()
52
+ .datetime()
53
+ .transform((str) => new Date(str))),
54
+ lastTriggeredThreshold: zod_1.z.number().int().default(0),
50
55
  createdAt: zod_1.z
51
56
  .string()
52
57
  .datetime()
@@ -13,6 +13,13 @@ var RevokeUserSubscriptionCommand;
13
13
  RevokeUserSubscriptionCommand.RequestSchema = zod_1.z.object({
14
14
  uuid: zod_1.z.string().uuid(),
15
15
  });
16
+ RevokeUserSubscriptionCommand.RequestBodySchema = zod_1.z.preprocess((val) => val || {}, zod_1.z.object({
17
+ shortUuid: zod_1.z.optional(zod_1.z
18
+ .string()
19
+ .min(6, { message: 'Short UUID must be at least 6 characters' })
20
+ .max(48, { message: 'Short UUID must be at most 48 characters' })
21
+ .describe('Optional. If not provided, a new short UUID will be generated by Remnawave. Please note that it is strongly recommended to allow Remnawave to generate the short UUID.')),
22
+ }));
16
23
  RevokeUserSubscriptionCommand.ResponseSchema = zod_1.z.object({
17
24
  response: models_1.ExtendedUsersSchema,
18
25
  });
@@ -520,4 +520,9 @@ exports.ERRORS = {
520
520
  message: 'Getting all subscriptions error',
521
521
  httpCode: 500,
522
522
  },
523
+ TRIGGER_THRESHOLD_NOTIFICATION_ERROR: {
524
+ code: 'A105',
525
+ message: 'Trigger threshold notification error',
526
+ httpCode: 500,
527
+ },
523
528
  };
@@ -18,6 +18,8 @@ exports.EVENTS = {
18
18
  EXPIRES_IN_24_HOURS: 'user.expires_in_24_hours',
19
19
  EXPIRED_24_HOURS_AGO: 'user.expired_24_hours_ago',
20
20
  },
21
+ FIRST_CONNECTED: 'user.first_connected',
22
+ BANDWIDTH_USAGE_THRESHOLD_REACHED: 'user.bandwidth_usage_threshold_reached',
21
23
  },
22
24
  NODE: {
23
25
  CREATED: 'node.created',
@@ -34,7 +36,12 @@ exports.EVENTS = {
34
36
  LOGIN_ATTEMPT_FAILED: 'service.login_attempt_failed',
35
37
  LOGIN_ATTEMPT_SUCCESS: 'service.login_attempt_success',
36
38
  },
39
+ ERRORS: {
40
+ BANDWIDTH_USAGE_THRESHOLD_REACHED_MAX_NOTIFICATIONS: 'errors.bandwidth_usage_threshold_reached_max_notifications',
41
+ },
37
42
  CATCH_ALL_USER_EVENTS: 'user.*',
38
43
  CATCH_ALL_NODE_EVENTS: 'node.*',
39
44
  CATCH_ALL_SERVICE_EVENTS: 'service.*',
45
+ CATCH_ALL_ERRORS_EVENTS: 'errors.*',
46
+ CATCH_ALL_ERRORS: '*',
40
47
  };
@@ -47,6 +47,11 @@ exports.UsersSchema = zod_1.z.object({
47
47
  telegramId: zod_1.z.nullable(zod_1.z.number().int()),
48
48
  email: zod_1.z.nullable(zod_1.z.string().email()),
49
49
  hwidDeviceLimit: zod_1.z.nullable(zod_1.z.number().int()),
50
+ firstConnectedAt: zod_1.z.nullable(zod_1.z
51
+ .string()
52
+ .datetime()
53
+ .transform((str) => new Date(str))),
54
+ lastTriggeredThreshold: zod_1.z.number().int().default(0),
50
55
  createdAt: zod_1.z
51
56
  .string()
52
57
  .datetime()