@remnawave/backend-contract 0.7.10 → 0.7.11
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/users/create-user.command.d.ts +9 -9
- package/build/backend/commands/users/create-user.command.d.ts.map +1 -1
- package/build/backend/commands/users/create-user.command.js +44 -23
- package/build/frontend/commands/users/create-user.command.js +44 -23
- package/package.json +1 -1
@@ -16,7 +16,7 @@ export declare namespace CreateUserCommand {
|
|
16
16
|
trojanPassword: z.ZodOptional<z.ZodString>;
|
17
17
|
vlessUuid: z.ZodOptional<z.ZodString>;
|
18
18
|
ssPassword: z.ZodOptional<z.ZodString>;
|
19
|
-
trafficLimitBytes: z.
|
19
|
+
trafficLimitBytes: z.ZodNumber;
|
20
20
|
trafficLimitStrategy: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<{
|
21
21
|
readonly NO_RESET: "NO_RESET";
|
22
22
|
readonly DAY: "DAY";
|
@@ -25,8 +25,8 @@ export declare namespace CreateUserCommand {
|
|
25
25
|
}>>>>, "MONTH" | "NO_RESET" | "DAY" | "WEEK", "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined>;
|
26
26
|
activeUserInbounds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
27
27
|
expireAt: z.ZodEffects<z.ZodString, Date, string>;
|
28
|
-
createdAt: z.
|
29
|
-
lastTrafficResetAt: z.
|
28
|
+
createdAt: z.ZodEffects<z.ZodString, Date, string>;
|
29
|
+
lastTrafficResetAt: z.ZodEffects<z.ZodString, Date, string>;
|
30
30
|
description: z.ZodOptional<z.ZodString>;
|
31
31
|
tag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
32
32
|
telegramId: z.ZodOptional<z.ZodNumber>;
|
@@ -35,16 +35,16 @@ export declare namespace CreateUserCommand {
|
|
35
35
|
activateAllInbounds: z.ZodOptional<z.ZodBoolean>;
|
36
36
|
}, "strip", z.ZodTypeAny, {
|
37
37
|
status: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
|
38
|
+
createdAt: Date;
|
38
39
|
username: string;
|
40
|
+
trafficLimitBytes: number;
|
39
41
|
trafficLimitStrategy: "MONTH" | "NO_RESET" | "DAY" | "WEEK";
|
40
42
|
expireAt: Date;
|
41
|
-
|
43
|
+
lastTrafficResetAt: Date;
|
42
44
|
tag?: string | null | undefined;
|
43
45
|
subscriptionUuid?: string | undefined;
|
44
46
|
shortUuid?: string | undefined;
|
45
|
-
trafficLimitBytes?: number | undefined;
|
46
47
|
description?: string | undefined;
|
47
|
-
lastTrafficResetAt?: Date | undefined;
|
48
48
|
trojanPassword?: string | undefined;
|
49
49
|
vlessUuid?: string | undefined;
|
50
50
|
ssPassword?: string | undefined;
|
@@ -54,17 +54,17 @@ export declare namespace CreateUserCommand {
|
|
54
54
|
activeUserInbounds?: string[] | undefined;
|
55
55
|
activateAllInbounds?: boolean | undefined;
|
56
56
|
}, {
|
57
|
+
createdAt: string;
|
57
58
|
username: string;
|
59
|
+
trafficLimitBytes: number;
|
58
60
|
expireAt: string;
|
61
|
+
lastTrafficResetAt: string;
|
59
62
|
status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
|
60
|
-
createdAt?: string | undefined;
|
61
63
|
tag?: string | null | undefined;
|
62
64
|
subscriptionUuid?: string | undefined;
|
63
65
|
shortUuid?: string | undefined;
|
64
|
-
trafficLimitBytes?: number | undefined;
|
65
66
|
description?: string | undefined;
|
66
67
|
trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
|
67
|
-
lastTrafficResetAt?: string | undefined;
|
68
68
|
trojanPassword?: string | undefined;
|
69
69
|
vlessUuid?: string | undefined;
|
70
70
|
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,eAAe,2CAI3B,CAAC;IAEK,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,eAAe,2CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqJxB,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"}
|
@@ -18,49 +18,57 @@ var CreateUserCommand;
|
|
18
18
|
})
|
19
19
|
.regex(/^[a-zA-Z0-9_-]+$/, 'Username can only contain letters, numbers, underscores and dashes')
|
20
20
|
.max(36, 'Username must be less than 36 characters')
|
21
|
-
.min(6, 'Username must be at least 6 characters')
|
22
|
-
|
21
|
+
.min(6, 'Username must be at least 6 characters')
|
22
|
+
.describe('Unique username for the user. Required. Must be 6-36 characters long and contain only letters, numbers, underscores and dashes.'),
|
23
|
+
status: models_1.UsersSchema.shape.status
|
24
|
+
.optional()
|
25
|
+
.default(constants_1.USERS_STATUS.ACTIVE)
|
26
|
+
.describe('Optional. User account status. Defaults to ACTIVE.'),
|
23
27
|
subscriptionUuid: zod_1.z
|
24
28
|
.string({
|
25
29
|
invalid_type_error: 'Subscription UUID must be a string',
|
26
30
|
})
|
27
31
|
.uuid('Invalid subscription UUID format')
|
28
|
-
.optional()
|
32
|
+
.optional()
|
33
|
+
.describe('Optional. UUID for user subscription. Must be a valid UUID format.'),
|
29
34
|
shortUuid: zod_1.z
|
30
35
|
.string({
|
31
36
|
invalid_type_error: 'Short UUID must be a string',
|
32
37
|
})
|
33
|
-
.optional()
|
38
|
+
.optional()
|
39
|
+
.describe('Optional. Short UUID identifier for the user.'),
|
34
40
|
trojanPassword: zod_1.z
|
35
41
|
.string({
|
36
42
|
invalid_type_error: 'Trojan password must be a string',
|
37
43
|
})
|
38
44
|
.min(8, 'Trojan password must be at least 8 characters')
|
39
45
|
.max(32, 'Trojan password must be less than 32 characters')
|
40
|
-
.optional()
|
46
|
+
.optional()
|
47
|
+
.describe('Optional. Password for Trojan protocol. Must be 8-32 characters.'),
|
41
48
|
vlessUuid: zod_1.z
|
42
49
|
.string({
|
43
50
|
invalid_type_error: 'Vless UUID must be a string',
|
44
51
|
})
|
45
52
|
.uuid('Invalid Vless UUID format')
|
46
|
-
.optional()
|
53
|
+
.optional()
|
54
|
+
.describe('Optional. UUID for VLESS protocol. Must be a valid UUID format.'),
|
47
55
|
ssPassword: zod_1.z
|
48
56
|
.string({
|
49
57
|
invalid_type_error: 'SS password must be a string',
|
50
58
|
})
|
51
59
|
.min(8, 'SS password must be at least 8 characters')
|
52
60
|
.max(32, 'SS password must be less than 32 characters')
|
53
|
-
.optional()
|
61
|
+
.optional()
|
62
|
+
.describe('Optional. Password for Shadowsocks protocol. Must be 8-32 characters.'),
|
54
63
|
trafficLimitBytes: zod_1.z
|
55
64
|
.number({
|
56
65
|
invalid_type_error: 'Traffic limit must be a number',
|
57
66
|
})
|
58
67
|
.int('Traffic limit must be an integer')
|
59
68
|
.min(0, 'Traffic limit must be greater than 0')
|
60
|
-
.describe('Traffic limit in bytes. 0
|
61
|
-
.optional(),
|
69
|
+
.describe('Optional. Traffic limit in bytes. Set to 0 for unlimited traffic.'),
|
62
70
|
trafficLimitStrategy: models_1.UsersSchema.shape.trafficLimitStrategy
|
63
|
-
.describe('
|
71
|
+
.describe('Optional. Strategy for resetting traffic limits. Defaults to NO_RESET. Must be a valid reset period.')
|
64
72
|
.optional()
|
65
73
|
.default(constants_1.RESET_PERIODS.NO_RESET)
|
66
74
|
.superRefine((val, ctx) => {
|
@@ -78,7 +86,8 @@ var CreateUserCommand;
|
|
78
86
|
.array(zod_1.z.string().uuid(), {
|
79
87
|
invalid_type_error: 'Enabled inbounds must be an array',
|
80
88
|
})
|
81
|
-
.optional()
|
89
|
+
.optional()
|
90
|
+
.describe('Optional.Array of UUIDs representing enabled inbound connections.'),
|
82
91
|
expireAt: zod_1.z
|
83
92
|
.string({
|
84
93
|
required_error: 'Expiration date is required',
|
@@ -86,37 +95,49 @@ var CreateUserCommand;
|
|
86
95
|
})
|
87
96
|
.datetime({ message: 'Invalid date format', offset: true, local: true })
|
88
97
|
.transform((str) => new Date(str))
|
89
|
-
.describe('
|
98
|
+
.describe('Account expiration date. Required. Format: 2025-01-17T15:38:45.065Z'),
|
90
99
|
createdAt: zod_1.z
|
91
100
|
.string({
|
92
101
|
invalid_type_error: 'Invalid date format',
|
93
102
|
})
|
94
103
|
.datetime({ message: 'Invalid date format', offset: true, local: true })
|
95
104
|
.transform((str) => new Date(str))
|
96
|
-
.describe('
|
97
|
-
.optional(),
|
105
|
+
.describe('Optional. Account creation date. Format: 2025-01-17T15:38:45.065Z'),
|
98
106
|
lastTrafficResetAt: zod_1.z
|
99
107
|
.string({
|
100
108
|
invalid_type_error: 'Invalid date format',
|
101
109
|
})
|
102
110
|
.datetime({ message: 'Invalid date format', offset: true, local: true })
|
103
111
|
.transform((str) => new Date(str))
|
104
|
-
.describe('Date
|
105
|
-
|
106
|
-
|
107
|
-
|
112
|
+
.describe('Optional. Date of last traffic reset. Format: 2025-01-17T15:38:45.065Z'),
|
113
|
+
description: zod_1.z
|
114
|
+
.string()
|
115
|
+
.optional()
|
116
|
+
.describe('Optional. Additional notes or description for the user account.'),
|
117
|
+
tag: zod_1.z
|
118
|
+
.optional(zod_1.z
|
108
119
|
.string()
|
109
120
|
.regex(/^[A-Z0-9_]+$/, 'Tag can only contain uppercase letters, numbers, underscores')
|
110
121
|
.max(16, 'Tag must be less than 16 characters')
|
111
|
-
.nullable())
|
112
|
-
|
113
|
-
|
122
|
+
.nullable())
|
123
|
+
.describe('Optional. User tag for categorization. Max 16 characters, uppercase letters, numbers and underscores only.'),
|
124
|
+
telegramId: zod_1.z
|
125
|
+
.optional(zod_1.z.number().int())
|
126
|
+
.describe('Optional. Telegram user ID for notifications. Must be an integer.'),
|
127
|
+
email: zod_1.z
|
128
|
+
.string()
|
129
|
+
.email('Invalid email format')
|
130
|
+
.optional()
|
131
|
+
.describe('Optional. User email address. Must be a valid email format.'),
|
114
132
|
hwidDeviceLimit: zod_1.z.optional(zod_1.z
|
115
133
|
.number({ invalid_type_error: 'Device limit must be a number' })
|
116
134
|
.int('Device limit must be an integer')
|
117
135
|
.min(0, 'Device limit must be greater than 0')
|
118
|
-
.describe('
|
119
|
-
activateAllInbounds: zod_1.z
|
136
|
+
.describe('Optional. Maximum number of hardware devices allowed. Must be a positive integer.')),
|
137
|
+
activateAllInbounds: zod_1.z
|
138
|
+
.boolean()
|
139
|
+
.optional()
|
140
|
+
.describe('Optional. Whether to enable all available inbound connections. Boolean.'),
|
120
141
|
});
|
121
142
|
CreateUserCommand.ResponseSchema = zod_1.z.object({
|
122
143
|
response: models_1.ExtendedUsersSchema,
|
@@ -18,49 +18,57 @@ var CreateUserCommand;
|
|
18
18
|
})
|
19
19
|
.regex(/^[a-zA-Z0-9_-]+$/, 'Username can only contain letters, numbers, underscores and dashes')
|
20
20
|
.max(36, 'Username must be less than 36 characters')
|
21
|
-
.min(6, 'Username must be at least 6 characters')
|
22
|
-
|
21
|
+
.min(6, 'Username must be at least 6 characters')
|
22
|
+
.describe('Unique username for the user. Required. Must be 6-36 characters long and contain only letters, numbers, underscores and dashes.'),
|
23
|
+
status: models_1.UsersSchema.shape.status
|
24
|
+
.optional()
|
25
|
+
.default(constants_1.USERS_STATUS.ACTIVE)
|
26
|
+
.describe('Optional. User account status. Defaults to ACTIVE.'),
|
23
27
|
subscriptionUuid: zod_1.z
|
24
28
|
.string({
|
25
29
|
invalid_type_error: 'Subscription UUID must be a string',
|
26
30
|
})
|
27
31
|
.uuid('Invalid subscription UUID format')
|
28
|
-
.optional()
|
32
|
+
.optional()
|
33
|
+
.describe('Optional. UUID for user subscription. Must be a valid UUID format.'),
|
29
34
|
shortUuid: zod_1.z
|
30
35
|
.string({
|
31
36
|
invalid_type_error: 'Short UUID must be a string',
|
32
37
|
})
|
33
|
-
.optional()
|
38
|
+
.optional()
|
39
|
+
.describe('Optional. Short UUID identifier for the user.'),
|
34
40
|
trojanPassword: zod_1.z
|
35
41
|
.string({
|
36
42
|
invalid_type_error: 'Trojan password must be a string',
|
37
43
|
})
|
38
44
|
.min(8, 'Trojan password must be at least 8 characters')
|
39
45
|
.max(32, 'Trojan password must be less than 32 characters')
|
40
|
-
.optional()
|
46
|
+
.optional()
|
47
|
+
.describe('Optional. Password for Trojan protocol. Must be 8-32 characters.'),
|
41
48
|
vlessUuid: zod_1.z
|
42
49
|
.string({
|
43
50
|
invalid_type_error: 'Vless UUID must be a string',
|
44
51
|
})
|
45
52
|
.uuid('Invalid Vless UUID format')
|
46
|
-
.optional()
|
53
|
+
.optional()
|
54
|
+
.describe('Optional. UUID for VLESS protocol. Must be a valid UUID format.'),
|
47
55
|
ssPassword: zod_1.z
|
48
56
|
.string({
|
49
57
|
invalid_type_error: 'SS password must be a string',
|
50
58
|
})
|
51
59
|
.min(8, 'SS password must be at least 8 characters')
|
52
60
|
.max(32, 'SS password must be less than 32 characters')
|
53
|
-
.optional()
|
61
|
+
.optional()
|
62
|
+
.describe('Optional. Password for Shadowsocks protocol. Must be 8-32 characters.'),
|
54
63
|
trafficLimitBytes: zod_1.z
|
55
64
|
.number({
|
56
65
|
invalid_type_error: 'Traffic limit must be a number',
|
57
66
|
})
|
58
67
|
.int('Traffic limit must be an integer')
|
59
68
|
.min(0, 'Traffic limit must be greater than 0')
|
60
|
-
.describe('Traffic limit in bytes. 0
|
61
|
-
.optional(),
|
69
|
+
.describe('Optional. Traffic limit in bytes. Set to 0 for unlimited traffic.'),
|
62
70
|
trafficLimitStrategy: models_1.UsersSchema.shape.trafficLimitStrategy
|
63
|
-
.describe('
|
71
|
+
.describe('Optional. Strategy for resetting traffic limits. Defaults to NO_RESET. Must be a valid reset period.')
|
64
72
|
.optional()
|
65
73
|
.default(constants_1.RESET_PERIODS.NO_RESET)
|
66
74
|
.superRefine((val, ctx) => {
|
@@ -78,7 +86,8 @@ var CreateUserCommand;
|
|
78
86
|
.array(zod_1.z.string().uuid(), {
|
79
87
|
invalid_type_error: 'Enabled inbounds must be an array',
|
80
88
|
})
|
81
|
-
.optional()
|
89
|
+
.optional()
|
90
|
+
.describe('Optional.Array of UUIDs representing enabled inbound connections.'),
|
82
91
|
expireAt: zod_1.z
|
83
92
|
.string({
|
84
93
|
required_error: 'Expiration date is required',
|
@@ -86,37 +95,49 @@ var CreateUserCommand;
|
|
86
95
|
})
|
87
96
|
.datetime({ message: 'Invalid date format', offset: true, local: true })
|
88
97
|
.transform((str) => new Date(str))
|
89
|
-
.describe('
|
98
|
+
.describe('Account expiration date. Required. Format: 2025-01-17T15:38:45.065Z'),
|
90
99
|
createdAt: zod_1.z
|
91
100
|
.string({
|
92
101
|
invalid_type_error: 'Invalid date format',
|
93
102
|
})
|
94
103
|
.datetime({ message: 'Invalid date format', offset: true, local: true })
|
95
104
|
.transform((str) => new Date(str))
|
96
|
-
.describe('
|
97
|
-
.optional(),
|
105
|
+
.describe('Optional. Account creation date. Format: 2025-01-17T15:38:45.065Z'),
|
98
106
|
lastTrafficResetAt: zod_1.z
|
99
107
|
.string({
|
100
108
|
invalid_type_error: 'Invalid date format',
|
101
109
|
})
|
102
110
|
.datetime({ message: 'Invalid date format', offset: true, local: true })
|
103
111
|
.transform((str) => new Date(str))
|
104
|
-
.describe('Date
|
105
|
-
|
106
|
-
|
107
|
-
|
112
|
+
.describe('Optional. Date of last traffic reset. Format: 2025-01-17T15:38:45.065Z'),
|
113
|
+
description: zod_1.z
|
114
|
+
.string()
|
115
|
+
.optional()
|
116
|
+
.describe('Optional. Additional notes or description for the user account.'),
|
117
|
+
tag: zod_1.z
|
118
|
+
.optional(zod_1.z
|
108
119
|
.string()
|
109
120
|
.regex(/^[A-Z0-9_]+$/, 'Tag can only contain uppercase letters, numbers, underscores')
|
110
121
|
.max(16, 'Tag must be less than 16 characters')
|
111
|
-
.nullable())
|
112
|
-
|
113
|
-
|
122
|
+
.nullable())
|
123
|
+
.describe('Optional. User tag for categorization. Max 16 characters, uppercase letters, numbers and underscores only.'),
|
124
|
+
telegramId: zod_1.z
|
125
|
+
.optional(zod_1.z.number().int())
|
126
|
+
.describe('Optional. Telegram user ID for notifications. Must be an integer.'),
|
127
|
+
email: zod_1.z
|
128
|
+
.string()
|
129
|
+
.email('Invalid email format')
|
130
|
+
.optional()
|
131
|
+
.describe('Optional. User email address. Must be a valid email format.'),
|
114
132
|
hwidDeviceLimit: zod_1.z.optional(zod_1.z
|
115
133
|
.number({ invalid_type_error: 'Device limit must be a number' })
|
116
134
|
.int('Device limit must be an integer')
|
117
135
|
.min(0, 'Device limit must be greater than 0')
|
118
|
-
.describe('
|
119
|
-
activateAllInbounds: zod_1.z
|
136
|
+
.describe('Optional. Maximum number of hardware devices allowed. Must be a positive integer.')),
|
137
|
+
activateAllInbounds: zod_1.z
|
138
|
+
.boolean()
|
139
|
+
.optional()
|
140
|
+
.describe('Optional. Whether to enable all available inbound connections. Boolean.'),
|
120
141
|
});
|
121
142
|
CreateUserCommand.ResponseSchema = zod_1.z.object({
|
122
143
|
response: models_1.ExtendedUsersSchema,
|