@remnawave/backend-contract 0.1.4 → 0.1.7
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.
- package/build/backend/commands/subscription/get-subscription-info-by-short-uuid.command.d.ts.map +1 -1
- package/build/backend/commands/subscription/get-subscription-info-by-short-uuid.command.js +4 -1
- package/build/backend/commands/users/create-user.command.d.ts +6 -6
- package/build/backend/commands/users/create-user.command.d.ts.map +1 -1
- package/build/backend/commands/users/create-user.command.js +15 -9
- package/build/backend/commands/users/get-all-users-v2.command.d.ts +4 -4
- package/build/backend/commands/users/get-all-users-v2.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-all-users-v2.command.js +10 -2
- package/build/backend/commands/users/update-user.command.d.ts +2 -2
- package/build/backend/commands/users/update-user.command.d.ts.map +1 -1
- package/build/backend/commands/users/update-user.command.js +4 -5
- package/build/backend/constants/errors/errors.d.ts +15 -0
- package/build/backend/constants/errors/errors.d.ts.map +1 -1
- package/build/backend/constants/errors/errors.js +15 -0
- package/build/backend/models/api-tokens.schema.d.ts.map +1 -1
- package/build/backend/models/api-tokens.schema.js +8 -2
- package/build/backend/models/last-connected-node.schema.d.ts.map +1 -1
- package/build/backend/models/last-connected-node.schema.js +4 -1
- package/build/backend/models/nodes.schema.d.ts.map +1 -1
- package/build/backend/models/nodes.schema.js +12 -3
- package/build/backend/models/users.schema.d.ts.map +1 -1
- package/build/backend/models/users.schema.js +28 -7
- package/build/frontend/commands/subscription/get-subscription-info-by-short-uuid.command.js +4 -1
- package/build/frontend/commands/users/create-user.command.js +15 -9
- package/build/frontend/commands/users/get-all-users-v2.command.js +10 -2
- package/build/frontend/commands/users/update-user.command.js +4 -5
- package/build/frontend/constants/errors/errors.js +15 -0
- package/build/frontend/models/api-tokens.schema.js +8 -2
- package/build/frontend/models/last-connected-node.schema.js +4 -1
- package/build/frontend/models/nodes.schema.js +12 -3
- package/build/frontend/models/users.schema.js +28 -7
- package/package.json +1 -1
package/build/backend/commands/subscription/get-subscription-info-by-short-uuid.command.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-subscription-info-by-short-uuid.command.d.ts","sourceRoot":"","sources":["../../../../commands/subscription/get-subscription-info-by-short-uuid.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,yBAAiB,qCAAqC,CAAC;IAC5C,MAAM,GAAG,+BAAiC,CAAC;IAC3C,MAAM,OAAO,QAAoB,CAAC;IAElC,MAAM,aAAa;;;;;;MAExB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"get-subscription-info-by-short-uuid.command.d.ts","sourceRoot":"","sources":["../../../../commands/subscription/get-subscription-info-by-short-uuid.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,yBAAiB,qCAAqC,CAAC;IAC5C,MAAM,GAAG,+BAAiC,CAAC;IAC3C,MAAM,OAAO,QAAoB,CAAC;IAElC,MAAM,aAAa;;;;;;MAExB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqBzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
|
@@ -20,7 +20,10 @@ var GetSubscriptionInfoByShortUuidCommand;
|
|
20
20
|
trafficUsed: zod_1.z.string(),
|
21
21
|
trafficLimit: zod_1.z.string(),
|
22
22
|
username: zod_1.z.string(),
|
23
|
-
expiresAt: zod_1.z
|
23
|
+
expiresAt: zod_1.z
|
24
|
+
.string()
|
25
|
+
.datetime()
|
26
|
+
.transform((str) => new Date(str)),
|
24
27
|
isActive: zod_1.z.boolean(),
|
25
28
|
userStatus: zod_1.z.nativeEnum(constants_1.USERS_STATUS),
|
26
29
|
trafficLimitStrategy: zod_1.z.nativeEnum(constants_1.RESET_PERIODS),
|
@@ -23,9 +23,9 @@ export declare namespace CreateUserCommand {
|
|
23
23
|
readonly MONTH: "MONTH";
|
24
24
|
}>>>>, "MONTH" | "NO_RESET" | "DAY" | "WEEK", "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined>;
|
25
25
|
activeUserInbounds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
26
|
-
expireAt: z.
|
27
|
-
createdAt: z.ZodOptional<z.
|
28
|
-
lastTrafficResetAt: z.ZodOptional<z.
|
26
|
+
expireAt: z.ZodEffects<z.ZodString, Date, string>;
|
27
|
+
createdAt: z.ZodOptional<z.ZodEffects<z.ZodString, Date, string>>;
|
28
|
+
lastTrafficResetAt: z.ZodOptional<z.ZodEffects<z.ZodString, Date, string>>;
|
29
29
|
description: z.ZodOptional<z.ZodString>;
|
30
30
|
activateAllInbounds: z.ZodOptional<z.ZodBoolean>;
|
31
31
|
}, "strip", z.ZodTypeAny, {
|
@@ -46,15 +46,15 @@ export declare namespace CreateUserCommand {
|
|
46
46
|
activateAllInbounds?: boolean | undefined;
|
47
47
|
}, {
|
48
48
|
username: string;
|
49
|
-
expireAt:
|
49
|
+
expireAt: string;
|
50
50
|
status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
|
51
|
-
createdAt?:
|
51
|
+
createdAt?: string | undefined;
|
52
52
|
trafficLimitBytes?: number | undefined;
|
53
53
|
subscriptionUuid?: string | undefined;
|
54
54
|
shortUuid?: string | undefined;
|
55
55
|
description?: string | undefined;
|
56
56
|
trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
|
57
|
-
lastTrafficResetAt?:
|
57
|
+
lastTrafficResetAt?: string | undefined;
|
58
58
|
trojanPassword?: string | undefined;
|
59
59
|
vlessUuid?: string | undefined;
|
60
60
|
ssPassword?: string | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"create-user.command.d.ts","sourceRoot":"","sources":["../../../../commands/users/create-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,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"create-user.command.d.ts","sourceRoot":"","sources":["../../../../commands/users/create-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,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAoGxB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAKzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
|
@@ -78,24 +78,30 @@ var CreateUserCommand;
|
|
78
78
|
invalid_type_error: 'Enabled inbounds must be an array',
|
79
79
|
})
|
80
80
|
.optional(),
|
81
|
-
expireAt: zod_1.z
|
82
|
-
.
|
81
|
+
expireAt: zod_1.z
|
82
|
+
.string({
|
83
83
|
required_error: 'Expiration date is required',
|
84
|
-
invalid_type_error: 'Invalid
|
84
|
+
invalid_type_error: 'Invalid date format',
|
85
85
|
})
|
86
|
+
.datetime({ message: 'Invalid date format' })
|
87
|
+
.transform((str) => new Date(str))
|
86
88
|
.describe('Date format: 2025-01-17T15:38:45.065Z'),
|
87
|
-
createdAt: zod_1.z
|
88
|
-
.
|
89
|
+
createdAt: zod_1.z
|
90
|
+
.string({
|
89
91
|
required_error: 'Expiration date is required',
|
90
|
-
invalid_type_error: 'Invalid
|
92
|
+
invalid_type_error: 'Invalid date format',
|
91
93
|
})
|
94
|
+
.datetime({ message: 'Invalid date format' })
|
95
|
+
.transform((str) => new Date(str))
|
92
96
|
.describe('Date format: 2025-01-17T15:38:45.065Z')
|
93
97
|
.optional(),
|
94
|
-
lastTrafficResetAt: zod_1.z
|
95
|
-
.
|
98
|
+
lastTrafficResetAt: zod_1.z
|
99
|
+
.string({
|
96
100
|
required_error: 'Expiration date is required',
|
97
|
-
invalid_type_error: 'Invalid
|
101
|
+
invalid_type_error: 'Invalid date format',
|
98
102
|
})
|
103
|
+
.datetime({ message: 'Invalid date format' })
|
104
|
+
.transform((str) => new Date(str))
|
99
105
|
.describe('Date format: 2025-01-17T15:38:45.065Z')
|
100
106
|
.optional(),
|
101
107
|
description: zod_1.z.string().optional(),
|
@@ -3,8 +3,8 @@ export declare namespace GetAllUsersV2Command {
|
|
3
3
|
const url: "/api/users/v2";
|
4
4
|
const TSQ_url: "/api/users/v2";
|
5
5
|
const RequestQuerySchema: z.ZodObject<{
|
6
|
-
start: z.ZodOptional<z.ZodNumber
|
7
|
-
size: z.ZodOptional<z.ZodNumber
|
6
|
+
start: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>>;
|
7
|
+
size: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>>;
|
8
8
|
filters: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodObject<{
|
9
9
|
id: z.ZodString;
|
10
10
|
value: z.ZodUnknown;
|
@@ -47,8 +47,8 @@ export declare namespace GetAllUsersV2Command {
|
|
47
47
|
desc: boolean;
|
48
48
|
}[] | undefined;
|
49
49
|
}, {
|
50
|
-
start?:
|
51
|
-
size?:
|
50
|
+
start?: string | undefined;
|
51
|
+
size?: string | undefined;
|
52
52
|
filters?: unknown;
|
53
53
|
filterModes?: unknown;
|
54
54
|
globalFilterMode?: string | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-all-users-v2.command.d.ts","sourceRoot":"","sources":["../../../../commands/users/get-all-users-v2.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,oBAAoB,CAAC;IAC3B,MAAM,GAAG,iBAA4B,CAAC;IACtC,MAAM,OAAO,iBAAM,CAAC;IAYpB,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"get-all-users-v2.command.d.ts","sourceRoot":"","sources":["../../../../commands/users/get-all-users-v2.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,oBAAoB,CAAC;IAC3B,MAAM,GAAG,iBAA4B,CAAC;IACtC,MAAM,OAAO,iBAAM,CAAC;IAYpB,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiC7B,CAAC;IAEH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAEvD,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAWzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
|
@@ -18,8 +18,16 @@ var GetAllUsersV2Command;
|
|
18
18
|
desc: zod_1.z.boolean(),
|
19
19
|
});
|
20
20
|
GetAllUsersV2Command.RequestQuerySchema = zod_1.z.object({
|
21
|
-
start: zod_1.z
|
22
|
-
|
21
|
+
start: zod_1.z
|
22
|
+
.string()
|
23
|
+
.transform((val) => parseInt(val, 10))
|
24
|
+
.pipe(zod_1.z.number().int().min(0))
|
25
|
+
.optional(),
|
26
|
+
size: zod_1.z
|
27
|
+
.string()
|
28
|
+
.transform((val) => parseInt(val, 10))
|
29
|
+
.pipe(zod_1.z.number().int().min(1))
|
30
|
+
.optional(),
|
23
31
|
filters: zod_1.z
|
24
32
|
.preprocess((str) => (typeof str === 'string' ? JSON.parse(str) : str), zod_1.z.array(FilterSchema))
|
25
33
|
.optional(),
|
@@ -62,7 +62,7 @@ export declare namespace UpdateUserCommand {
|
|
62
62
|
readonly MONTH: "MONTH";
|
63
63
|
}>>, "MONTH" | "NO_RESET" | "DAY" | "WEEK", "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined>>;
|
64
64
|
activeUserInbounds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
65
|
-
expireAt: z.ZodOptional<z.ZodEffects<z.
|
65
|
+
expireAt: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, Date, string>, Date, string>>;
|
66
66
|
description: z.ZodOptional<z.ZodString>;
|
67
67
|
}>, "strip", z.ZodTypeAny, {
|
68
68
|
uuid: string;
|
@@ -78,7 +78,7 @@ export declare namespace UpdateUserCommand {
|
|
78
78
|
trafficLimitBytes?: number | undefined;
|
79
79
|
description?: string | undefined;
|
80
80
|
trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
|
81
|
-
expireAt?:
|
81
|
+
expireAt?: string | undefined;
|
82
82
|
activeUserInbounds?: string[] | undefined;
|
83
83
|
}>;
|
84
84
|
type Request = z.infer<typeof RequestSchema>;
|
@@ -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,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;AAMxB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAKzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
|
@@ -40,11 +40,10 @@ var UpdateUserCommand;
|
|
40
40
|
invalid_type_error: 'Enabled inbounds must be an array of UUIDs',
|
41
41
|
})
|
42
42
|
.optional(),
|
43
|
-
expireAt: zod_1.z
|
44
|
-
.
|
45
|
-
|
46
|
-
|
47
|
-
})
|
43
|
+
expireAt: zod_1.z
|
44
|
+
.string()
|
45
|
+
.datetime({ message: 'Invalid date format' })
|
46
|
+
.transform((str) => new Date(str))
|
48
47
|
.refine((date) => date > new Date(), {
|
49
48
|
message: 'Expiration date cannot be in the past',
|
50
49
|
})
|
@@ -314,5 +314,20 @@ export declare const ERRORS: {
|
|
314
314
|
readonly message: "Bulk delete users by status error";
|
315
315
|
readonly httpCode: 500;
|
316
316
|
};
|
317
|
+
readonly UPDATE_INBOUND_ERROR: {
|
318
|
+
readonly code: "A060";
|
319
|
+
readonly message: "Update inbound error";
|
320
|
+
readonly httpCode: 500;
|
321
|
+
};
|
322
|
+
readonly CONFIG_VALIDATION_ERROR: {
|
323
|
+
readonly code: "A061";
|
324
|
+
readonly message: "";
|
325
|
+
readonly httpCode: 500;
|
326
|
+
readonly withMessage: (message: string) => {
|
327
|
+
code: string;
|
328
|
+
message: string;
|
329
|
+
httpCode: number;
|
330
|
+
};
|
331
|
+
};
|
317
332
|
};
|
318
333
|
//# 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
|
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;;;;;;CAM3B,CAAC"}
|
@@ -293,4 +293,19 @@ exports.ERRORS = {
|
|
293
293
|
message: 'Bulk delete users by status error',
|
294
294
|
httpCode: 500,
|
295
295
|
},
|
296
|
+
UPDATE_INBOUND_ERROR: {
|
297
|
+
code: 'A060',
|
298
|
+
message: 'Update inbound error',
|
299
|
+
httpCode: 500,
|
300
|
+
},
|
301
|
+
CONFIG_VALIDATION_ERROR: {
|
302
|
+
code: 'A061',
|
303
|
+
message: '',
|
304
|
+
httpCode: 500,
|
305
|
+
withMessage: (message) => ({
|
306
|
+
code: 'A061',
|
307
|
+
message: message,
|
308
|
+
httpCode: 500,
|
309
|
+
}),
|
310
|
+
},
|
296
311
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"api-tokens.schema.d.ts","sourceRoot":"","sources":["../../../models/api-tokens.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"api-tokens.schema.d.ts","sourceRoot":"","sources":["../../../models/api-tokens.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;EAc1B,CAAC"}
|
@@ -7,6 +7,12 @@ exports.ApiTokensSchema = zod_1.z.object({
|
|
7
7
|
token: zod_1.z.string(),
|
8
8
|
tokenName: zod_1.z.string(),
|
9
9
|
tokenDescription: zod_1.z.nullable(zod_1.z.string()),
|
10
|
-
createdAt: zod_1.z
|
11
|
-
|
10
|
+
createdAt: zod_1.z
|
11
|
+
.string()
|
12
|
+
.datetime()
|
13
|
+
.transform((str) => new Date(str)),
|
14
|
+
updatedAt: zod_1.z
|
15
|
+
.string()
|
16
|
+
.datetime()
|
17
|
+
.transform((str) => new Date(str)),
|
12
18
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"last-connected-node.schema.d.ts","sourceRoot":"","sources":["../../../models/last-connected-node.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB;;;;;;;;;
|
1
|
+
{"version":3,"file":"last-connected-node.schema.d.ts","sourceRoot":"","sources":["../../../models/last-connected-node.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB;;;;;;;;;GAQrB,CAAC"}
|
@@ -4,7 +4,10 @@ exports.LastConnectedNodeSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
5
5
|
exports.LastConnectedNodeSchema = zod_1.z
|
6
6
|
.object({
|
7
|
-
connectedAt: zod_1.z
|
7
|
+
connectedAt: zod_1.z
|
8
|
+
.string()
|
9
|
+
.datetime()
|
10
|
+
.transform((str) => new Date(str)),
|
8
11
|
nodeName: zod_1.z.string(),
|
9
12
|
})
|
10
13
|
.nullable();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nodes.schema.d.ts","sourceRoot":"","sources":["../../../models/nodes.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"nodes.schema.d.ts","sourceRoot":"","sources":["../../../models/nodes.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CtB,CAAC"}
|
@@ -13,7 +13,10 @@ exports.NodesSchema = zod_1.z.object({
|
|
13
13
|
isConnecting: zod_1.z.boolean(),
|
14
14
|
isNodeOnline: zod_1.z.boolean(),
|
15
15
|
isXrayRunning: zod_1.z.boolean(),
|
16
|
-
lastStatusChange: zod_1.z.nullable(zod_1.z
|
16
|
+
lastStatusChange: zod_1.z.nullable(zod_1.z
|
17
|
+
.string()
|
18
|
+
.datetime()
|
19
|
+
.transform((str) => new Date(str))),
|
17
20
|
lastStatusMessage: zod_1.z.nullable(zod_1.z.string()),
|
18
21
|
xrayVersion: zod_1.z.nullable(zod_1.z.string()),
|
19
22
|
isTrafficTrackingActive: zod_1.z.boolean(),
|
@@ -28,7 +31,13 @@ exports.NodesSchema = zod_1.z.object({
|
|
28
31
|
cpuCount: zod_1.z.nullable(zod_1.z.number().int()),
|
29
32
|
cpuModel: zod_1.z.nullable(zod_1.z.string()),
|
30
33
|
totalRam: zod_1.z.nullable(zod_1.z.string()),
|
31
|
-
createdAt: zod_1.z
|
32
|
-
|
34
|
+
createdAt: zod_1.z
|
35
|
+
.string()
|
36
|
+
.datetime()
|
37
|
+
.transform((str) => new Date(str)),
|
38
|
+
updatedAt: zod_1.z
|
39
|
+
.string()
|
40
|
+
.datetime()
|
41
|
+
.transform((str) => new Date(str)),
|
33
42
|
excludedInbounds: zod_1.z.array(inbounds_schema_1.InboundsSchema),
|
34
43
|
});
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiEtB,CAAC"}
|
@@ -19,16 +19,37 @@ exports.UsersSchema = zod_1.z.object({
|
|
19
19
|
})
|
20
20
|
.default(constants_1.RESET_PERIODS.NO_RESET),
|
21
21
|
subLastUserAgent: zod_1.z.nullable(zod_1.z.string()),
|
22
|
-
subLastOpenedAt: zod_1.z.nullable(zod_1.z
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
22
|
+
subLastOpenedAt: zod_1.z.nullable(zod_1.z
|
23
|
+
.string()
|
24
|
+
.datetime()
|
25
|
+
.transform((str) => new Date(str))),
|
26
|
+
expireAt: zod_1.z.nullable(zod_1.z
|
27
|
+
.string()
|
28
|
+
.datetime()
|
29
|
+
.transform((str) => new Date(str))),
|
30
|
+
onlineAt: zod_1.z.nullable(zod_1.z
|
31
|
+
.string()
|
32
|
+
.datetime()
|
33
|
+
.transform((str) => new Date(str))),
|
34
|
+
subRevokedAt: zod_1.z.nullable(zod_1.z
|
35
|
+
.string()
|
36
|
+
.datetime()
|
37
|
+
.transform((str) => new Date(str))),
|
38
|
+
lastTrafficResetAt: zod_1.z.nullable(zod_1.z
|
39
|
+
.string()
|
40
|
+
.datetime()
|
41
|
+
.transform((str) => new Date(str))),
|
27
42
|
trojanPassword: zod_1.z.string(),
|
28
43
|
vlessUuid: zod_1.z.string().uuid(),
|
29
44
|
ssPassword: zod_1.z.string(),
|
30
45
|
description: zod_1.z.nullable(zod_1.z.string()),
|
31
|
-
createdAt: zod_1.z
|
32
|
-
|
46
|
+
createdAt: zod_1.z
|
47
|
+
.string()
|
48
|
+
.datetime()
|
49
|
+
.transform((str) => new Date(str)),
|
50
|
+
updatedAt: zod_1.z
|
51
|
+
.string()
|
52
|
+
.datetime()
|
53
|
+
.transform((str) => new Date(str)),
|
33
54
|
activeUserInbounds: zod_1.z.array(inbounds_schema_1.InboundsSchema),
|
34
55
|
});
|
@@ -20,7 +20,10 @@ var GetSubscriptionInfoByShortUuidCommand;
|
|
20
20
|
trafficUsed: zod_1.z.string(),
|
21
21
|
trafficLimit: zod_1.z.string(),
|
22
22
|
username: zod_1.z.string(),
|
23
|
-
expiresAt: zod_1.z
|
23
|
+
expiresAt: zod_1.z
|
24
|
+
.string()
|
25
|
+
.datetime()
|
26
|
+
.transform((str) => new Date(str)),
|
24
27
|
isActive: zod_1.z.boolean(),
|
25
28
|
userStatus: zod_1.z.nativeEnum(constants_1.USERS_STATUS),
|
26
29
|
trafficLimitStrategy: zod_1.z.nativeEnum(constants_1.RESET_PERIODS),
|
@@ -78,24 +78,30 @@ var CreateUserCommand;
|
|
78
78
|
invalid_type_error: 'Enabled inbounds must be an array',
|
79
79
|
})
|
80
80
|
.optional(),
|
81
|
-
expireAt: zod_1.z
|
82
|
-
.
|
81
|
+
expireAt: zod_1.z
|
82
|
+
.string({
|
83
83
|
required_error: 'Expiration date is required',
|
84
|
-
invalid_type_error: 'Invalid
|
84
|
+
invalid_type_error: 'Invalid date format',
|
85
85
|
})
|
86
|
+
.datetime({ message: 'Invalid date format' })
|
87
|
+
.transform((str) => new Date(str))
|
86
88
|
.describe('Date format: 2025-01-17T15:38:45.065Z'),
|
87
|
-
createdAt: zod_1.z
|
88
|
-
.
|
89
|
+
createdAt: zod_1.z
|
90
|
+
.string({
|
89
91
|
required_error: 'Expiration date is required',
|
90
|
-
invalid_type_error: 'Invalid
|
92
|
+
invalid_type_error: 'Invalid date format',
|
91
93
|
})
|
94
|
+
.datetime({ message: 'Invalid date format' })
|
95
|
+
.transform((str) => new Date(str))
|
92
96
|
.describe('Date format: 2025-01-17T15:38:45.065Z')
|
93
97
|
.optional(),
|
94
|
-
lastTrafficResetAt: zod_1.z
|
95
|
-
.
|
98
|
+
lastTrafficResetAt: zod_1.z
|
99
|
+
.string({
|
96
100
|
required_error: 'Expiration date is required',
|
97
|
-
invalid_type_error: 'Invalid
|
101
|
+
invalid_type_error: 'Invalid date format',
|
98
102
|
})
|
103
|
+
.datetime({ message: 'Invalid date format' })
|
104
|
+
.transform((str) => new Date(str))
|
99
105
|
.describe('Date format: 2025-01-17T15:38:45.065Z')
|
100
106
|
.optional(),
|
101
107
|
description: zod_1.z.string().optional(),
|
@@ -18,8 +18,16 @@ var GetAllUsersV2Command;
|
|
18
18
|
desc: zod_1.z.boolean(),
|
19
19
|
});
|
20
20
|
GetAllUsersV2Command.RequestQuerySchema = zod_1.z.object({
|
21
|
-
start: zod_1.z
|
22
|
-
|
21
|
+
start: zod_1.z
|
22
|
+
.string()
|
23
|
+
.transform((val) => parseInt(val, 10))
|
24
|
+
.pipe(zod_1.z.number().int().min(0))
|
25
|
+
.optional(),
|
26
|
+
size: zod_1.z
|
27
|
+
.string()
|
28
|
+
.transform((val) => parseInt(val, 10))
|
29
|
+
.pipe(zod_1.z.number().int().min(1))
|
30
|
+
.optional(),
|
23
31
|
filters: zod_1.z
|
24
32
|
.preprocess((str) => (typeof str === 'string' ? JSON.parse(str) : str), zod_1.z.array(FilterSchema))
|
25
33
|
.optional(),
|
@@ -40,11 +40,10 @@ var UpdateUserCommand;
|
|
40
40
|
invalid_type_error: 'Enabled inbounds must be an array of UUIDs',
|
41
41
|
})
|
42
42
|
.optional(),
|
43
|
-
expireAt: zod_1.z
|
44
|
-
.
|
45
|
-
|
46
|
-
|
47
|
-
})
|
43
|
+
expireAt: zod_1.z
|
44
|
+
.string()
|
45
|
+
.datetime({ message: 'Invalid date format' })
|
46
|
+
.transform((str) => new Date(str))
|
48
47
|
.refine((date) => date > new Date(), {
|
49
48
|
message: 'Expiration date cannot be in the past',
|
50
49
|
})
|
@@ -293,4 +293,19 @@ exports.ERRORS = {
|
|
293
293
|
message: 'Bulk delete users by status error',
|
294
294
|
httpCode: 500,
|
295
295
|
},
|
296
|
+
UPDATE_INBOUND_ERROR: {
|
297
|
+
code: 'A060',
|
298
|
+
message: 'Update inbound error',
|
299
|
+
httpCode: 500,
|
300
|
+
},
|
301
|
+
CONFIG_VALIDATION_ERROR: {
|
302
|
+
code: 'A061',
|
303
|
+
message: '',
|
304
|
+
httpCode: 500,
|
305
|
+
withMessage: (message) => ({
|
306
|
+
code: 'A061',
|
307
|
+
message: message,
|
308
|
+
httpCode: 500,
|
309
|
+
}),
|
310
|
+
},
|
296
311
|
};
|
@@ -7,6 +7,12 @@ exports.ApiTokensSchema = zod_1.z.object({
|
|
7
7
|
token: zod_1.z.string(),
|
8
8
|
tokenName: zod_1.z.string(),
|
9
9
|
tokenDescription: zod_1.z.nullable(zod_1.z.string()),
|
10
|
-
createdAt: zod_1.z
|
11
|
-
|
10
|
+
createdAt: zod_1.z
|
11
|
+
.string()
|
12
|
+
.datetime()
|
13
|
+
.transform((str) => new Date(str)),
|
14
|
+
updatedAt: zod_1.z
|
15
|
+
.string()
|
16
|
+
.datetime()
|
17
|
+
.transform((str) => new Date(str)),
|
12
18
|
});
|
@@ -4,7 +4,10 @@ exports.LastConnectedNodeSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
5
5
|
exports.LastConnectedNodeSchema = zod_1.z
|
6
6
|
.object({
|
7
|
-
connectedAt: zod_1.z
|
7
|
+
connectedAt: zod_1.z
|
8
|
+
.string()
|
9
|
+
.datetime()
|
10
|
+
.transform((str) => new Date(str)),
|
8
11
|
nodeName: zod_1.z.string(),
|
9
12
|
})
|
10
13
|
.nullable();
|
@@ -13,7 +13,10 @@ exports.NodesSchema = zod_1.z.object({
|
|
13
13
|
isConnecting: zod_1.z.boolean(),
|
14
14
|
isNodeOnline: zod_1.z.boolean(),
|
15
15
|
isXrayRunning: zod_1.z.boolean(),
|
16
|
-
lastStatusChange: zod_1.z.nullable(zod_1.z
|
16
|
+
lastStatusChange: zod_1.z.nullable(zod_1.z
|
17
|
+
.string()
|
18
|
+
.datetime()
|
19
|
+
.transform((str) => new Date(str))),
|
17
20
|
lastStatusMessage: zod_1.z.nullable(zod_1.z.string()),
|
18
21
|
xrayVersion: zod_1.z.nullable(zod_1.z.string()),
|
19
22
|
isTrafficTrackingActive: zod_1.z.boolean(),
|
@@ -28,7 +31,13 @@ exports.NodesSchema = zod_1.z.object({
|
|
28
31
|
cpuCount: zod_1.z.nullable(zod_1.z.number().int()),
|
29
32
|
cpuModel: zod_1.z.nullable(zod_1.z.string()),
|
30
33
|
totalRam: zod_1.z.nullable(zod_1.z.string()),
|
31
|
-
createdAt: zod_1.z
|
32
|
-
|
34
|
+
createdAt: zod_1.z
|
35
|
+
.string()
|
36
|
+
.datetime()
|
37
|
+
.transform((str) => new Date(str)),
|
38
|
+
updatedAt: zod_1.z
|
39
|
+
.string()
|
40
|
+
.datetime()
|
41
|
+
.transform((str) => new Date(str)),
|
33
42
|
excludedInbounds: zod_1.z.array(inbounds_schema_1.InboundsSchema),
|
34
43
|
});
|
@@ -19,16 +19,37 @@ exports.UsersSchema = zod_1.z.object({
|
|
19
19
|
})
|
20
20
|
.default(constants_1.RESET_PERIODS.NO_RESET),
|
21
21
|
subLastUserAgent: zod_1.z.nullable(zod_1.z.string()),
|
22
|
-
subLastOpenedAt: zod_1.z.nullable(zod_1.z
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
22
|
+
subLastOpenedAt: zod_1.z.nullable(zod_1.z
|
23
|
+
.string()
|
24
|
+
.datetime()
|
25
|
+
.transform((str) => new Date(str))),
|
26
|
+
expireAt: zod_1.z.nullable(zod_1.z
|
27
|
+
.string()
|
28
|
+
.datetime()
|
29
|
+
.transform((str) => new Date(str))),
|
30
|
+
onlineAt: zod_1.z.nullable(zod_1.z
|
31
|
+
.string()
|
32
|
+
.datetime()
|
33
|
+
.transform((str) => new Date(str))),
|
34
|
+
subRevokedAt: zod_1.z.nullable(zod_1.z
|
35
|
+
.string()
|
36
|
+
.datetime()
|
37
|
+
.transform((str) => new Date(str))),
|
38
|
+
lastTrafficResetAt: zod_1.z.nullable(zod_1.z
|
39
|
+
.string()
|
40
|
+
.datetime()
|
41
|
+
.transform((str) => new Date(str))),
|
27
42
|
trojanPassword: zod_1.z.string(),
|
28
43
|
vlessUuid: zod_1.z.string().uuid(),
|
29
44
|
ssPassword: zod_1.z.string(),
|
30
45
|
description: zod_1.z.nullable(zod_1.z.string()),
|
31
|
-
createdAt: zod_1.z
|
32
|
-
|
46
|
+
createdAt: zod_1.z
|
47
|
+
.string()
|
48
|
+
.datetime()
|
49
|
+
.transform((str) => new Date(str)),
|
50
|
+
updatedAt: zod_1.z
|
51
|
+
.string()
|
52
|
+
.datetime()
|
53
|
+
.transform((str) => new Date(str)),
|
33
54
|
activeUserInbounds: zod_1.z.array(inbounds_schema_1.InboundsSchema),
|
34
55
|
});
|