@remnawave/backend-contract 2.8.27 → 2.8.28

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.
@@ -4,6 +4,7 @@ export declare const USERS_ROUTES: {
4
4
  readonly CREATE: "";
5
5
  readonly UPDATE: "";
6
6
  readonly GET: "";
7
+ readonly STREAM: "stream";
7
8
  readonly DELETE: (uuid: string) => string;
8
9
  readonly GET_BY_UUID: (uuid: string) => string;
9
10
  readonly ACCESSIBLE_NODES: (uuid: string) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../api/controllers/users.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,eAAO,MAAM,mBAAmB,EAAG,SAAkB,CAAC;AAEtD,eAAO,MAAM,YAAY;;;;4BAIN,MAAM;iCACD,MAAM;sCACD,MAAM;kDACM,MAAM;;gCAExB,MAAM;iCACL,MAAM;uCACA,MAAM;6CACA,MAAM;;;0BAGzB,MAAM;yCACS,MAAM;sCACT,MAAM;uDACW,MAAM;2CAClB,MAAM;gCACjB,MAAM;4BACV,MAAM;;;;;;;;;;;;;;;;;;;;CAsBf,CAAC"}
1
+ {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../api/controllers/users.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,eAAO,MAAM,mBAAmB,EAAG,SAAkB,CAAC;AAEtD,eAAO,MAAM,YAAY;;;;;4BAKN,MAAM;iCACD,MAAM;sCACD,MAAM;kDACM,MAAM;;gCAExB,MAAM;iCACL,MAAM;uCACA,MAAM;6CACA,MAAM;;;0BAGzB,MAAM;yCACS,MAAM;sCACT,MAAM;uDACW,MAAM;2CAClB,MAAM;gCACjB,MAAM;4BACV,MAAM;;;;;;;;;;;;;;;;;;;;CAsBf,CAAC"}
@@ -7,6 +7,7 @@ exports.USERS_ROUTES = {
7
7
  CREATE: '',
8
8
  UPDATE: '',
9
9
  GET: '',
10
+ STREAM: 'stream',
10
11
  DELETE: (uuid) => `${uuid}`,
11
12
  GET_BY_UUID: (uuid) => `${uuid}`,
12
13
  ACCESSIBLE_NODES: (uuid) => `${uuid}/accessible-nodes`,
@@ -60,6 +60,7 @@ export declare const REST_API: {
60
60
  readonly CREATE: "/api/users/";
61
61
  readonly UPDATE: "/api/users/";
62
62
  readonly GET: "/api/users/";
63
+ readonly STREAM: "/api/users/stream";
63
64
  readonly DELETE: (uuid: string) => string;
64
65
  readonly GET_BY_UUID: (uuid: string) => string;
65
66
  readonly ACCESSIBLE_NODES: (uuid: string) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AACpC,eAAO,MAAM,YAAY,EAAG,UAAmB,CAAC;AAChD,eAAO,MAAM,WAAW,EAAG,SAAkB,CAAC;AAC9C,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AAEjD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;gCAyBE,MAAM;;;;;;;;;;qCAaD,MAAM;;gCAGX,MAAM;;;;;oCAOF,MAAM;qCAIL,MAAM;qCAIN,MAAM;;2CAKA,MAAM;;;;;;;;;;;;;gCAiBjB,MAAM;qCAGD,MAAM;0CAED,MAAM;sDAEM,MAAM;;qCAMvB,MAAM;oCAIP,MAAM;2CAIC,MAAM;iDAIA,MAAM;;;8BAOzB,MAAM;6CAES,MAAM;0CAIT,MAAM;2DAIW,MAAM;+CAIlB,MAAM;oCAIjB,MAAM;gCAIV,MAAM;;;;;;;;;;;;;;;;;;;;;;kCAyBJ,MAAM;uCAED,MAAM;;;;;;qCASR,MAAM;gCAEX,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAoCT,MAAM;;gCAKH,MAAM;;;;;;;;;;;;;;mDAiBa,MAAM;;;;;;;;;0CAYf,MAAM;kCAId,MAAM;6CAIK,MAAM;iDAIF,MAAM;;;6CAMV,MAAM;;qDAKE,MAAM;;;;;;qCAStB,MAAM;gCAIX,MAAM;sDAIgB,MAAM;6DAIC,MAAM;;;;;;;;;;qCAa9B,MAAM;gCAIX,MAAM;0CAII,MAAM;;uCAKT,MAAM;0CAEH,MAAM;;;;;;;;;;yCAWP,MAAM;8CAED,MAAM;;;;6CAMP,MAAM;;;gDAKH,MAAM;;;;;;;;;;;;;;;;qCAiBjB,MAAM;gCAIX,MAAM;;uCAKC,MAAM;0CAEH,MAAM;;;;;;;;;;;6BAYnB,MAAM;;;gCAIH,MAAM;;;;;;;;6BAST,MAAM;;;gCAIH,MAAM;;;;;;;;;;;;;;;;;uCAkBC,MAAM;;;;yCAKJ,MAAM;;;;2CAKJ,MAAM;;;6CAIJ,MAAM;;;;;mCAMhB,MAAM;+CAEM,MAAM;;6CAGR,MAAM;qDAEE,MAAM;;;;iCAK1B,MAAM;oCAEH,MAAM;;;iCAIT,MAAM;oCAEH,MAAM;;;CAIvB,CAAC"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AACpC,eAAO,MAAM,YAAY,EAAG,UAAmB,CAAC;AAChD,eAAO,MAAM,WAAW,EAAG,SAAkB,CAAC;AAC9C,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AAEjD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;gCAyBE,MAAM;;;;;;;;;;qCAaD,MAAM;;gCAGX,MAAM;;;;;oCAOF,MAAM;qCAIL,MAAM;qCAIN,MAAM;;2CAKA,MAAM;;;;;;;;;;;;;;gCAkBjB,MAAM;qCAGD,MAAM;0CAED,MAAM;sDAEM,MAAM;;qCAMvB,MAAM;oCAIP,MAAM;2CAIC,MAAM;iDAIA,MAAM;;;8BAOzB,MAAM;6CAES,MAAM;0CAIT,MAAM;2DAIW,MAAM;+CAIlB,MAAM;oCAIjB,MAAM;gCAIV,MAAM;;;;;;;;;;;;;;;;;;;;;;kCAyBJ,MAAM;uCAED,MAAM;;;;;;qCASR,MAAM;gCAEX,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAoCT,MAAM;;gCAKH,MAAM;;;;;;;;;;;;;;mDAiBa,MAAM;;;;;;;;;0CAYf,MAAM;kCAId,MAAM;6CAIK,MAAM;iDAIF,MAAM;;;6CAMV,MAAM;;qDAKE,MAAM;;;;;;qCAStB,MAAM;gCAIX,MAAM;sDAIgB,MAAM;6DAIC,MAAM;;;;;;;;;;qCAa9B,MAAM;gCAIX,MAAM;0CAII,MAAM;;uCAKT,MAAM;0CAEH,MAAM;;;;;;;;;;yCAWP,MAAM;8CAED,MAAM;;;;6CAMP,MAAM;;;gDAKH,MAAM;;;;;;;;;;;;;;;;qCAiBjB,MAAM;gCAIX,MAAM;;uCAKC,MAAM;0CAEH,MAAM;;;;;;;;;;;6BAYnB,MAAM;;;gCAIH,MAAM;;;;;;;;6BAST,MAAM;;;gCAIH,MAAM;;;;;;;;;;;;;;;;;uCAkBC,MAAM;;;;yCAKJ,MAAM;;;;2CAKJ,MAAM;;;6CAIJ,MAAM;;;;;mCAMhB,MAAM;+CAEM,MAAM;;6CAGR,MAAM;qDAEE,MAAM;;;;iCAK1B,MAAM;oCAEH,MAAM;;;iCAIT,MAAM;oCAEH,MAAM;;;CAIvB,CAAC"}
@@ -97,6 +97,7 @@ exports.REST_API = {
97
97
  CREATE: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.CREATE}`,
98
98
  UPDATE: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.UPDATE}`,
99
99
  GET: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET}`,
100
+ STREAM: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.STREAM}`,
100
101
  DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.DELETE(uuid)}`,
101
102
  GET_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_UUID(uuid)}`,
102
103
  ACCESSIBLE_NODES: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACCESSIBLE_NODES(uuid)}`,
@@ -1 +1 @@
1
- {"version":3,"file":"get-all-users.command.d.ts","sourceRoot":"","sources":["../../../../commands/users/get-all-users.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,kBAAkB,CAAC;IACzB,MAAM,GAAG,eAAqB,CAAC;IAC/B,MAAM,OAAO,eAAM,CAAC;IAEpB,MAAM,eAAe,2CAG1B,CAAC;IAEI,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAkC,CAAC;IAElE,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAEvD,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAKzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
1
+ {"version":3,"file":"get-all-users.command.d.ts","sourceRoot":"","sources":["../../../../commands/users/get-all-users.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,kBAAkB,CAAC;IACzB,MAAM,GAAG,eAAqB,CAAC;IAC/B,MAAM,OAAO,eAAM,CAAC;IAEpB,MAAM,eAAe,2CAQ3B,CAAC;IAEK,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAkC,CAAC;IAElE,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAEvD,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAKzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -9,7 +9,7 @@ var GetAllUsersCommand;
9
9
  (function (GetAllUsersCommand) {
10
10
  GetAllUsersCommand.url = api_1.REST_API.USERS.GET;
11
11
  GetAllUsersCommand.TSQ_url = GetAllUsersCommand.url;
12
- GetAllUsersCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.GET, 'get', 'Get all users', {
12
+ GetAllUsersCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.GET, 'get', 'Get all users using offset-based pagination', {
13
13
  scope: 'list',
14
14
  kind: 'read',
15
15
  });
@@ -0,0 +1,321 @@
1
+ import { z } from 'zod';
2
+ export declare namespace GetUsersStreamCommand {
3
+ const url: "/api/users/stream";
4
+ const TSQ_url: "/api/users/stream";
5
+ const endpointDetails: import("../../constants").EndpointDetails;
6
+ const RequestQuerySchema: z.ZodObject<{
7
+ cursor: z.ZodOptional<z.ZodString>;
8
+ size: z.ZodDefault<z.ZodNumber>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ size: number;
11
+ cursor?: string | undefined;
12
+ }, {
13
+ size?: number | undefined;
14
+ cursor?: string | undefined;
15
+ }>;
16
+ type RequestQuery = z.infer<typeof RequestQuerySchema>;
17
+ const ResponseSchema: z.ZodObject<{
18
+ response: z.ZodObject<{
19
+ users: z.ZodArray<z.ZodObject<{
20
+ uuid: z.ZodString;
21
+ id: z.ZodNumber;
22
+ shortUuid: z.ZodString;
23
+ username: z.ZodString;
24
+ status: z.ZodDefault<z.ZodNativeEnum<{
25
+ readonly ACTIVE: "ACTIVE";
26
+ readonly DISABLED: "DISABLED";
27
+ readonly LIMITED: "LIMITED";
28
+ readonly EXPIRED: "EXPIRED";
29
+ }>>;
30
+ trafficLimitBytes: z.ZodDefault<z.ZodNumber>;
31
+ trafficLimitStrategy: z.ZodDefault<z.ZodNativeEnum<{
32
+ readonly NO_RESET: "NO_RESET";
33
+ readonly DAY: "DAY";
34
+ readonly WEEK: "WEEK";
35
+ readonly MONTH: "MONTH";
36
+ readonly MONTH_ROLLING: "MONTH_ROLLING";
37
+ }>>;
38
+ expireAt: z.ZodEffects<z.ZodString, Date, string>;
39
+ telegramId: z.ZodNullable<z.ZodNumber>;
40
+ email: z.ZodNullable<z.ZodString>;
41
+ description: z.ZodNullable<z.ZodString>;
42
+ tag: z.ZodNullable<z.ZodString>;
43
+ hwidDeviceLimit: z.ZodNullable<z.ZodNumber>;
44
+ externalSquadUuid: z.ZodNullable<z.ZodString>;
45
+ trojanPassword: z.ZodString;
46
+ vlessUuid: z.ZodString;
47
+ ssPassword: z.ZodString;
48
+ lastTriggeredThreshold: z.ZodDefault<z.ZodNumber>;
49
+ subRevokedAt: z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>;
50
+ lastTrafficResetAt: z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>;
51
+ createdAt: z.ZodEffects<z.ZodString, Date, string>;
52
+ updatedAt: z.ZodEffects<z.ZodString, Date, string>;
53
+ } & {
54
+ subscriptionUrl: z.ZodString;
55
+ activeInternalSquads: z.ZodArray<z.ZodObject<{
56
+ uuid: z.ZodString;
57
+ name: z.ZodString;
58
+ }, "strip", z.ZodTypeAny, {
59
+ uuid: string;
60
+ name: string;
61
+ }, {
62
+ uuid: string;
63
+ name: string;
64
+ }>, "many">;
65
+ userTraffic: z.ZodObject<{
66
+ usedTrafficBytes: z.ZodNumber;
67
+ lifetimeUsedTrafficBytes: z.ZodNumber;
68
+ onlineAt: z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>;
69
+ firstConnectedAt: z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>;
70
+ lastConnectedNodeUuid: z.ZodNullable<z.ZodString>;
71
+ }, "strip", z.ZodTypeAny, {
72
+ usedTrafficBytes: number;
73
+ lifetimeUsedTrafficBytes: number;
74
+ onlineAt: Date | null;
75
+ firstConnectedAt: Date | null;
76
+ lastConnectedNodeUuid: string | null;
77
+ }, {
78
+ usedTrafficBytes: number;
79
+ lifetimeUsedTrafficBytes: number;
80
+ onlineAt: string | null;
81
+ firstConnectedAt: string | null;
82
+ lastConnectedNodeUuid: string | null;
83
+ }>;
84
+ }, "strip", z.ZodTypeAny, {
85
+ status: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
86
+ uuid: string;
87
+ createdAt: Date;
88
+ updatedAt: Date;
89
+ description: string | null;
90
+ username: string;
91
+ tag: string | null;
92
+ id: number;
93
+ shortUuid: string;
94
+ trafficLimitBytes: number;
95
+ trafficLimitStrategy: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | "MONTH_ROLLING";
96
+ expireAt: Date;
97
+ telegramId: number | null;
98
+ email: string | null;
99
+ hwidDeviceLimit: number | null;
100
+ externalSquadUuid: string | null;
101
+ trojanPassword: string;
102
+ vlessUuid: string;
103
+ ssPassword: string;
104
+ lastTriggeredThreshold: number;
105
+ subRevokedAt: Date | null;
106
+ lastTrafficResetAt: Date | null;
107
+ subscriptionUrl: string;
108
+ activeInternalSquads: {
109
+ uuid: string;
110
+ name: string;
111
+ }[];
112
+ userTraffic: {
113
+ usedTrafficBytes: number;
114
+ lifetimeUsedTrafficBytes: number;
115
+ onlineAt: Date | null;
116
+ firstConnectedAt: Date | null;
117
+ lastConnectedNodeUuid: string | null;
118
+ };
119
+ }, {
120
+ uuid: string;
121
+ createdAt: string;
122
+ updatedAt: string;
123
+ description: string | null;
124
+ username: string;
125
+ tag: string | null;
126
+ id: number;
127
+ shortUuid: string;
128
+ expireAt: string;
129
+ telegramId: number | null;
130
+ email: string | null;
131
+ hwidDeviceLimit: number | null;
132
+ externalSquadUuid: string | null;
133
+ trojanPassword: string;
134
+ vlessUuid: string;
135
+ ssPassword: string;
136
+ subRevokedAt: string | null;
137
+ lastTrafficResetAt: string | null;
138
+ subscriptionUrl: string;
139
+ activeInternalSquads: {
140
+ uuid: string;
141
+ name: string;
142
+ }[];
143
+ userTraffic: {
144
+ usedTrafficBytes: number;
145
+ lifetimeUsedTrafficBytes: number;
146
+ onlineAt: string | null;
147
+ firstConnectedAt: string | null;
148
+ lastConnectedNodeUuid: string | null;
149
+ };
150
+ status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
151
+ trafficLimitBytes?: number | undefined;
152
+ trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | "MONTH_ROLLING" | undefined;
153
+ lastTriggeredThreshold?: number | undefined;
154
+ }>, "many">;
155
+ nextCursor: z.ZodNullable<z.ZodString>;
156
+ hasMore: z.ZodBoolean;
157
+ }, "strip", z.ZodTypeAny, {
158
+ users: {
159
+ status: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
160
+ uuid: string;
161
+ createdAt: Date;
162
+ updatedAt: Date;
163
+ description: string | null;
164
+ username: string;
165
+ tag: string | null;
166
+ id: number;
167
+ shortUuid: string;
168
+ trafficLimitBytes: number;
169
+ trafficLimitStrategy: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | "MONTH_ROLLING";
170
+ expireAt: Date;
171
+ telegramId: number | null;
172
+ email: string | null;
173
+ hwidDeviceLimit: number | null;
174
+ externalSquadUuid: string | null;
175
+ trojanPassword: string;
176
+ vlessUuid: string;
177
+ ssPassword: string;
178
+ lastTriggeredThreshold: number;
179
+ subRevokedAt: Date | null;
180
+ lastTrafficResetAt: Date | null;
181
+ subscriptionUrl: string;
182
+ activeInternalSquads: {
183
+ uuid: string;
184
+ name: string;
185
+ }[];
186
+ userTraffic: {
187
+ usedTrafficBytes: number;
188
+ lifetimeUsedTrafficBytes: number;
189
+ onlineAt: Date | null;
190
+ firstConnectedAt: Date | null;
191
+ lastConnectedNodeUuid: string | null;
192
+ };
193
+ }[];
194
+ nextCursor: string | null;
195
+ hasMore: boolean;
196
+ }, {
197
+ users: {
198
+ uuid: string;
199
+ createdAt: string;
200
+ updatedAt: string;
201
+ description: string | null;
202
+ username: string;
203
+ tag: string | null;
204
+ id: number;
205
+ shortUuid: string;
206
+ expireAt: string;
207
+ telegramId: number | null;
208
+ email: string | null;
209
+ hwidDeviceLimit: number | null;
210
+ externalSquadUuid: string | null;
211
+ trojanPassword: string;
212
+ vlessUuid: string;
213
+ ssPassword: string;
214
+ subRevokedAt: string | null;
215
+ lastTrafficResetAt: string | null;
216
+ subscriptionUrl: string;
217
+ activeInternalSquads: {
218
+ uuid: string;
219
+ name: string;
220
+ }[];
221
+ userTraffic: {
222
+ usedTrafficBytes: number;
223
+ lifetimeUsedTrafficBytes: number;
224
+ onlineAt: string | null;
225
+ firstConnectedAt: string | null;
226
+ lastConnectedNodeUuid: string | null;
227
+ };
228
+ status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
229
+ trafficLimitBytes?: number | undefined;
230
+ trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | "MONTH_ROLLING" | undefined;
231
+ lastTriggeredThreshold?: number | undefined;
232
+ }[];
233
+ nextCursor: string | null;
234
+ hasMore: boolean;
235
+ }>;
236
+ }, "strip", z.ZodTypeAny, {
237
+ response: {
238
+ users: {
239
+ status: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
240
+ uuid: string;
241
+ createdAt: Date;
242
+ updatedAt: Date;
243
+ description: string | null;
244
+ username: string;
245
+ tag: string | null;
246
+ id: number;
247
+ shortUuid: string;
248
+ trafficLimitBytes: number;
249
+ trafficLimitStrategy: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | "MONTH_ROLLING";
250
+ expireAt: Date;
251
+ telegramId: number | null;
252
+ email: string | null;
253
+ hwidDeviceLimit: number | null;
254
+ externalSquadUuid: string | null;
255
+ trojanPassword: string;
256
+ vlessUuid: string;
257
+ ssPassword: string;
258
+ lastTriggeredThreshold: number;
259
+ subRevokedAt: Date | null;
260
+ lastTrafficResetAt: Date | null;
261
+ subscriptionUrl: string;
262
+ activeInternalSquads: {
263
+ uuid: string;
264
+ name: string;
265
+ }[];
266
+ userTraffic: {
267
+ usedTrafficBytes: number;
268
+ lifetimeUsedTrafficBytes: number;
269
+ onlineAt: Date | null;
270
+ firstConnectedAt: Date | null;
271
+ lastConnectedNodeUuid: string | null;
272
+ };
273
+ }[];
274
+ nextCursor: string | null;
275
+ hasMore: boolean;
276
+ };
277
+ }, {
278
+ response: {
279
+ users: {
280
+ uuid: string;
281
+ createdAt: string;
282
+ updatedAt: string;
283
+ description: string | null;
284
+ username: string;
285
+ tag: string | null;
286
+ id: number;
287
+ shortUuid: string;
288
+ expireAt: string;
289
+ telegramId: number | null;
290
+ email: string | null;
291
+ hwidDeviceLimit: number | null;
292
+ externalSquadUuid: string | null;
293
+ trojanPassword: string;
294
+ vlessUuid: string;
295
+ ssPassword: string;
296
+ subRevokedAt: string | null;
297
+ lastTrafficResetAt: string | null;
298
+ subscriptionUrl: string;
299
+ activeInternalSquads: {
300
+ uuid: string;
301
+ name: string;
302
+ }[];
303
+ userTraffic: {
304
+ usedTrafficBytes: number;
305
+ lifetimeUsedTrafficBytes: number;
306
+ onlineAt: string | null;
307
+ firstConnectedAt: string | null;
308
+ lastConnectedNodeUuid: string | null;
309
+ };
310
+ status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
311
+ trafficLimitBytes?: number | undefined;
312
+ trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | "MONTH_ROLLING" | undefined;
313
+ lastTriggeredThreshold?: number | undefined;
314
+ }[];
315
+ nextCursor: string | null;
316
+ hasMore: boolean;
317
+ };
318
+ }>;
319
+ type Response = z.infer<typeof ResponseSchema>;
320
+ }
321
+ //# sourceMappingURL=get-users-stream.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-users-stream.command.d.ts","sourceRoot":"","sources":["../../../../commands/users/get-users-stream.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,qBAAqB,CAAC;IAC5B,MAAM,GAAG,qBAAwB,CAAC;IAClC,MAAM,OAAO,qBAAM,CAAC;IAEpB,MAAM,eAAe,2CAK3B,CAAC;IAEK,MAAM,kBAAkB;;;;;;;;;MAe7B,CAAC;IAEH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAEvD,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MASzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetUsersStreamCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../constants");
6
+ const models_1 = require("../../models");
7
+ const api_1 = require("../../api");
8
+ var GetUsersStreamCommand;
9
+ (function (GetUsersStreamCommand) {
10
+ GetUsersStreamCommand.url = api_1.REST_API.USERS.STREAM;
11
+ GetUsersStreamCommand.TSQ_url = GetUsersStreamCommand.url;
12
+ GetUsersStreamCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.STREAM, 'get', 'Get all users using cursor-based (keyset) pagination', { scope: 'stream', kind: 'read' });
13
+ GetUsersStreamCommand.RequestQuerySchema = zod_1.z.object({
14
+ cursor: zod_1.z
15
+ .string()
16
+ .regex(/^\d+$/, 'Cursor must be a positive integer string')
17
+ .optional()
18
+ .describe('Cursor for pagination — pass the nextCursor from the previous response. Omit on the first request.'),
19
+ size: zod_1.z.coerce
20
+ .number()
21
+ .int()
22
+ .min(1, 'Size (limit) must be greater than 0')
23
+ .max(1000, 'Size (limit) must be less than 1000')
24
+ .describe('Number of results to return, no more than 1000')
25
+ .default(250),
26
+ });
27
+ GetUsersStreamCommand.ResponseSchema = zod_1.z.object({
28
+ response: zod_1.z.object({
29
+ users: zod_1.z.array(models_1.ExtendedUsersSchema),
30
+ nextCursor: zod_1.z
31
+ .string()
32
+ .nullable()
33
+ .describe('Cursor to fetch the next page, or null if there are no more results'),
34
+ hasMore: zod_1.z.boolean().describe('Whether there are more results to fetch'),
35
+ }),
36
+ });
37
+ })(GetUsersStreamCommand || (exports.GetUsersStreamCommand = GetUsersStreamCommand = {}));
@@ -8,6 +8,7 @@ export * from './get-by';
8
8
  export * from './get-user-accessible-nodes.command';
9
9
  export * from './get-user-by-uuid.command';
10
10
  export * from './get-user-subscription-request-history.command';
11
+ export * from './get-users-stream.command';
11
12
  export * from './resolve-user.command';
12
13
  export * from './tags';
13
14
  export * from './update-user.command';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/users/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAE3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,UAAU,CAAC;AAEzB,cAAc,qCAAqC,CAAC;AAEpD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iDAAiD,CAAC;AAEhE,cAAc,wBAAwB,CAAC;AACvC,cAAc,QAAQ,CAAC;AACvB,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/users/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAE3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,UAAU,CAAC;AACzB,cAAc,qCAAqC,CAAC;AAEpD,cAAc,4BAA4B,CAAC;AAE3C,cAAc,iDAAiD,CAAC;AAChE,cAAc,4BAA4B,CAAC;AAE3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,QAAQ,CAAC;AACvB,cAAc,uBAAuB,CAAC"}
@@ -24,6 +24,7 @@ __exportStar(require("./get-by"), exports);
24
24
  __exportStar(require("./get-user-accessible-nodes.command"), exports);
25
25
  __exportStar(require("./get-user-by-uuid.command"), exports);
26
26
  __exportStar(require("./get-user-subscription-request-history.command"), exports);
27
+ __exportStar(require("./get-users-stream.command"), exports);
27
28
  __exportStar(require("./resolve-user.command"), exports);
28
29
  __exportStar(require("./tags"), exports);
29
30
  __exportStar(require("./update-user.command"), exports);
@@ -7,6 +7,7 @@ exports.USERS_ROUTES = {
7
7
  CREATE: '',
8
8
  UPDATE: '',
9
9
  GET: '',
10
+ STREAM: 'stream',
10
11
  DELETE: (uuid) => `${uuid}`,
11
12
  GET_BY_UUID: (uuid) => `${uuid}`,
12
13
  ACCESSIBLE_NODES: (uuid) => `${uuid}/accessible-nodes`,
@@ -97,6 +97,7 @@ exports.REST_API = {
97
97
  CREATE: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.CREATE}`,
98
98
  UPDATE: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.UPDATE}`,
99
99
  GET: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET}`,
100
+ STREAM: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.STREAM}`,
100
101
  DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.DELETE(uuid)}`,
101
102
  GET_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_UUID(uuid)}`,
102
103
  ACCESSIBLE_NODES: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACCESSIBLE_NODES(uuid)}`,
@@ -9,7 +9,7 @@ var GetAllUsersCommand;
9
9
  (function (GetAllUsersCommand) {
10
10
  GetAllUsersCommand.url = api_1.REST_API.USERS.GET;
11
11
  GetAllUsersCommand.TSQ_url = GetAllUsersCommand.url;
12
- GetAllUsersCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.GET, 'get', 'Get all users', {
12
+ GetAllUsersCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.GET, 'get', 'Get all users using offset-based pagination', {
13
13
  scope: 'list',
14
14
  kind: 'read',
15
15
  });
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetUsersStreamCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../constants");
6
+ const models_1 = require("../../models");
7
+ const api_1 = require("../../api");
8
+ var GetUsersStreamCommand;
9
+ (function (GetUsersStreamCommand) {
10
+ GetUsersStreamCommand.url = api_1.REST_API.USERS.STREAM;
11
+ GetUsersStreamCommand.TSQ_url = GetUsersStreamCommand.url;
12
+ GetUsersStreamCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.STREAM, 'get', 'Get all users using cursor-based (keyset) pagination', { scope: 'stream', kind: 'read' });
13
+ GetUsersStreamCommand.RequestQuerySchema = zod_1.z.object({
14
+ cursor: zod_1.z
15
+ .string()
16
+ .regex(/^\d+$/, 'Cursor must be a positive integer string')
17
+ .optional()
18
+ .describe('Cursor for pagination — pass the nextCursor from the previous response. Omit on the first request.'),
19
+ size: zod_1.z.coerce
20
+ .number()
21
+ .int()
22
+ .min(1, 'Size (limit) must be greater than 0')
23
+ .max(1000, 'Size (limit) must be less than 1000')
24
+ .describe('Number of results to return, no more than 1000')
25
+ .default(250),
26
+ });
27
+ GetUsersStreamCommand.ResponseSchema = zod_1.z.object({
28
+ response: zod_1.z.object({
29
+ users: zod_1.z.array(models_1.ExtendedUsersSchema),
30
+ nextCursor: zod_1.z
31
+ .string()
32
+ .nullable()
33
+ .describe('Cursor to fetch the next page, or null if there are no more results'),
34
+ hasMore: zod_1.z.boolean().describe('Whether there are more results to fetch'),
35
+ }),
36
+ });
37
+ })(GetUsersStreamCommand || (exports.GetUsersStreamCommand = GetUsersStreamCommand = {}));
@@ -24,6 +24,7 @@ __exportStar(require("./get-by"), exports);
24
24
  __exportStar(require("./get-user-accessible-nodes.command"), exports);
25
25
  __exportStar(require("./get-user-by-uuid.command"), exports);
26
26
  __exportStar(require("./get-user-subscription-request-history.command"), exports);
27
+ __exportStar(require("./get-users-stream.command"), exports);
27
28
  __exportStar(require("./resolve-user.command"), exports);
28
29
  __exportStar(require("./tags"), exports);
29
30
  __exportStar(require("./update-user.command"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "2.8.27",
3
+ "version": "2.8.28",
4
4
  "public": true,
5
5
  "license": "AGPL-3.0-only",
6
6
  "description": "A contract library for Remnawave Backend. It can be used in backend and frontend.",