@long2ice/relayx-backend 0.0.1

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 (88) hide show
  1. package/README.md +13 -0
  2. package/dist/app.d.ts +8592 -0
  3. package/dist/bullmq/index.d.ts +1 -0
  4. package/dist/bullmq/jobs.d.ts +34 -0
  5. package/dist/bullmq/queue.d.ts +6 -0
  6. package/dist/bullmq/queuedash.d.ts +12 -0
  7. package/dist/bullmq/worker.d.ts +1 -0
  8. package/dist/config.d.ts +16 -0
  9. package/dist/db.d.ts +3 -0
  10. package/dist/generated/prisma/zod/index.d.ts +2289 -0
  11. package/dist/index.d.ts +1 -0
  12. package/dist/middlewares/auth.d.ts +3 -0
  13. package/dist/middlewares/ip.d.ts +2 -0
  14. package/dist/middlewares/license.d.ts +2 -0
  15. package/dist/middlewares/plan.d.ts +2 -0
  16. package/dist/routes/admin/license.d.ts +90 -0
  17. package/dist/routes/admin/node.d.ts +919 -0
  18. package/dist/routes/admin/node_group.d.ts +2115 -0
  19. package/dist/routes/admin/pay.d.ts +261 -0
  20. package/dist/routes/admin/plan.d.ts +198 -0
  21. package/dist/routes/admin/plan_coupon.d.ts +92 -0
  22. package/dist/routes/admin/stats.d.ts +77 -0
  23. package/dist/routes/admin/system_config.d.ts +68 -0
  24. package/dist/routes/admin/ticket.d.ts +113 -0
  25. package/dist/routes/admin/topup.d.ts +88 -0
  26. package/dist/routes/admin/topup_activity.d.ts +84 -0
  27. package/dist/routes/admin/tunnel.d.ts +566 -0
  28. package/dist/routes/admin/user.d.ts +299 -0
  29. package/dist/routes/admin/user_plan.d.ts +109 -0
  30. package/dist/routes/bot.d.ts +13 -0
  31. package/dist/routes/dns_provider.d.ts +240 -0
  32. package/dist/routes/health.d.ts +3 -0
  33. package/dist/routes/in_node_group_dns.d.ts +132 -0
  34. package/dist/routes/license.d.ts +50 -0
  35. package/dist/routes/node.d.ts +148 -0
  36. package/dist/routes/node_group.d.ts +1498 -0
  37. package/dist/routes/pay.d.ts +34 -0
  38. package/dist/routes/plan.d.ts +148 -0
  39. package/dist/routes/plan_coupon.d.ts +22 -0
  40. package/dist/routes/system_config.d.ts +87 -0
  41. package/dist/routes/ticket.d.ts +129 -0
  42. package/dist/routes/topup.d.ts +93 -0
  43. package/dist/routes/tunnel.d.ts +742 -0
  44. package/dist/routes/user.d.ts +293 -0
  45. package/dist/schemas/context.d.ts +9 -0
  46. package/dist/schemas/license.d.ts +7 -0
  47. package/dist/schemas/request.d.ts +1181 -0
  48. package/dist/schemas/response.d.ts +2439 -0
  49. package/dist/schemas/socket.io.d.ts +33 -0
  50. package/dist/schemas/tunnel.d.ts +10 -0
  51. package/dist/services/dns/cloudflare.d.ts +12 -0
  52. package/dist/services/dns/huawei.d.ts +12 -0
  53. package/dist/services/dns/index.d.ts +4 -0
  54. package/dist/services/dns/interface.d.ts +8 -0
  55. package/dist/services/dns_provider.d.ts +46 -0
  56. package/dist/services/email.d.ts +11 -0
  57. package/dist/services/fernet.d.ts +2 -0
  58. package/dist/services/in_node_group_dns.d.ts +65 -0
  59. package/dist/services/license.d.ts +87 -0
  60. package/dist/services/logger.d.ts +7 -0
  61. package/dist/services/node.d.ts +39 -0
  62. package/dist/services/node_group.d.ts +75 -0
  63. package/dist/services/notify.d.ts +44 -0
  64. package/dist/services/order.d.ts +3 -0
  65. package/dist/services/pay.d.ts +6 -0
  66. package/dist/services/plan.d.ts +119 -0
  67. package/dist/services/plan_coupon.d.ts +16 -0
  68. package/dist/services/redis.d.ts +59 -0
  69. package/dist/services/stackauth.d.ts +25 -0
  70. package/dist/services/sysinfo.d.ts +7 -0
  71. package/dist/services/system_config.d.ts +7 -0
  72. package/dist/services/telegram.d.ts +8 -0
  73. package/dist/services/ticket.d.ts +134 -0
  74. package/dist/services/topup.d.ts +37 -0
  75. package/dist/services/topup_activity.d.ts +21 -0
  76. package/dist/services/tunnel.d.ts +1235 -0
  77. package/dist/services/user.d.ts +25 -0
  78. package/dist/socket-io/events.d.ts +13 -0
  79. package/dist/socket-io/handlers/disconnect.d.ts +2 -0
  80. package/dist/socket-io/handlers/listen.d.ts +3 -0
  81. package/dist/socket-io/handlers/register.d.ts +2 -0
  82. package/dist/socket-io/handlers/sysinfo.d.ts +2 -0
  83. package/dist/socket-io/index.d.ts +3 -0
  84. package/dist/socket-io/utils.d.ts +8 -0
  85. package/dist/utils/date.d.ts +1 -0
  86. package/dist/utils/ip.d.ts +2 -0
  87. package/dist/utils/uuid.d.ts +1 -0
  88. package/package.json +82 -0
@@ -0,0 +1,293 @@
1
+ import { Variables } from "../schemas/context";
2
+ import { NotifyType } from "../services/notify";
3
+ declare const app: import("hono/hono-base").HonoBase<{
4
+ Variables: Variables;
5
+ }, {
6
+ "/info": {
7
+ $get: {
8
+ input: {};
9
+ output: {
10
+ user_plan: {
11
+ plan: {
12
+ name: string;
13
+ id: number;
14
+ order_by: number;
15
+ created_at: string;
16
+ updated_at: string;
17
+ status: import("../generated/prisma/client").$Enums.Status;
18
+ ip_limit: number | null;
19
+ bandwidth_limit: number | null;
20
+ traffic: number | null;
21
+ price: number;
22
+ max_tunnels: number | null;
23
+ description: string | null;
24
+ original_price: number | null;
25
+ allow_custom_in_node_group: boolean;
26
+ allow_custom_out_node_group: boolean;
27
+ all_in_node_groups: boolean;
28
+ all_out_node_groups: boolean;
29
+ setup_fee: number | null;
30
+ billing_cycle: import("../generated/prisma/client").$Enums.BillingCycle;
31
+ renewable: boolean;
32
+ stock: number | null;
33
+ };
34
+ id: number;
35
+ created_at: string;
36
+ updated_at: string;
37
+ user_id: number;
38
+ traffic: number | null;
39
+ plan_id: number;
40
+ traffic_used: number;
41
+ max_tunnels: number | null;
42
+ expired_at: string | null;
43
+ } | null;
44
+ id: number;
45
+ created_at: string;
46
+ updated_at: string;
47
+ super_admin: boolean;
48
+ email: string;
49
+ balance: number;
50
+ tg_id: string | null;
51
+ uid: string | null;
52
+ note: string | null;
53
+ parent_id: number | null;
54
+ referral_commission_rate: number | null;
55
+ referral_first_only: boolean | null;
56
+ auto_renew: boolean;
57
+ api_key: string;
58
+ notify_subscriptions: string | number | boolean | {
59
+ [x: string]: string | number | boolean | /*elided*/ any | {
60
+ [x: number]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
61
+ length: number;
62
+ toString: null;
63
+ toLocaleString: null;
64
+ pop: null;
65
+ push: {};
66
+ concat: {};
67
+ join: {};
68
+ reverse: null;
69
+ shift: null;
70
+ slice: {};
71
+ sort: {};
72
+ splice: {};
73
+ unshift: {};
74
+ indexOf: {};
75
+ lastIndexOf: {};
76
+ every: {};
77
+ some: {};
78
+ forEach: {};
79
+ map: {};
80
+ filter: {};
81
+ reduce: {};
82
+ reduceRight: {};
83
+ find: {};
84
+ findIndex: {};
85
+ fill: {};
86
+ copyWithin: {};
87
+ entries: null;
88
+ keys: null;
89
+ values: null;
90
+ includes: {};
91
+ flatMap: {};
92
+ flat: {};
93
+ at: {};
94
+ [Symbol.iterator]: null;
95
+ readonly [Symbol.unscopables]: {
96
+ [x: number]: boolean | undefined;
97
+ length?: boolean | undefined;
98
+ toString?: boolean | undefined;
99
+ toLocaleString?: boolean | undefined;
100
+ pop?: boolean | undefined;
101
+ push?: boolean | undefined;
102
+ concat?: boolean | undefined;
103
+ join?: boolean | undefined;
104
+ reverse?: boolean | undefined;
105
+ shift?: boolean | undefined;
106
+ slice?: boolean | undefined;
107
+ sort?: boolean | undefined;
108
+ splice?: boolean | undefined;
109
+ unshift?: boolean | undefined;
110
+ indexOf?: boolean | undefined;
111
+ lastIndexOf?: boolean | undefined;
112
+ every?: boolean | undefined;
113
+ some?: boolean | undefined;
114
+ forEach?: boolean | undefined;
115
+ map?: boolean | undefined;
116
+ filter?: boolean | undefined;
117
+ reduce?: boolean | undefined;
118
+ reduceRight?: boolean | undefined;
119
+ find?: boolean | undefined;
120
+ findIndex?: boolean | undefined;
121
+ fill?: boolean | undefined;
122
+ copyWithin?: boolean | undefined;
123
+ entries?: boolean | undefined;
124
+ keys?: boolean | undefined;
125
+ values?: boolean | undefined;
126
+ includes?: boolean | undefined;
127
+ flatMap?: boolean | undefined;
128
+ flat?: boolean | undefined;
129
+ at?: boolean | undefined;
130
+ };
131
+ } | null | undefined;
132
+ } | {
133
+ [x: number]: string | number | boolean | {
134
+ [x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null | undefined;
135
+ } | /*elided*/ any | null;
136
+ length: number;
137
+ toString: null;
138
+ toLocaleString: null;
139
+ pop: null;
140
+ push: {};
141
+ concat: {};
142
+ join: {};
143
+ reverse: null;
144
+ shift: null;
145
+ slice: {};
146
+ sort: {};
147
+ splice: {};
148
+ unshift: {};
149
+ indexOf: {};
150
+ lastIndexOf: {};
151
+ every: {};
152
+ some: {};
153
+ forEach: {};
154
+ map: {};
155
+ filter: {};
156
+ reduce: {};
157
+ reduceRight: {};
158
+ find: {};
159
+ findIndex: {};
160
+ fill: {};
161
+ copyWithin: {};
162
+ entries: null;
163
+ keys: null;
164
+ values: null;
165
+ includes: {};
166
+ flatMap: {};
167
+ flat: {};
168
+ at: {};
169
+ [Symbol.iterator]: null;
170
+ readonly [Symbol.unscopables]: {
171
+ [x: number]: boolean | undefined;
172
+ length?: boolean | undefined;
173
+ toString?: boolean | undefined;
174
+ toLocaleString?: boolean | undefined;
175
+ pop?: boolean | undefined;
176
+ push?: boolean | undefined;
177
+ concat?: boolean | undefined;
178
+ join?: boolean | undefined;
179
+ reverse?: boolean | undefined;
180
+ shift?: boolean | undefined;
181
+ slice?: boolean | undefined;
182
+ sort?: boolean | undefined;
183
+ splice?: boolean | undefined;
184
+ unshift?: boolean | undefined;
185
+ indexOf?: boolean | undefined;
186
+ lastIndexOf?: boolean | undefined;
187
+ every?: boolean | undefined;
188
+ some?: boolean | undefined;
189
+ forEach?: boolean | undefined;
190
+ map?: boolean | undefined;
191
+ filter?: boolean | undefined;
192
+ reduce?: boolean | undefined;
193
+ reduceRight?: boolean | undefined;
194
+ find?: boolean | undefined;
195
+ findIndex?: boolean | undefined;
196
+ fill?: boolean | undefined;
197
+ copyWithin?: boolean | undefined;
198
+ entries?: boolean | undefined;
199
+ keys?: boolean | undefined;
200
+ values?: boolean | undefined;
201
+ includes?: boolean | undefined;
202
+ flatMap?: boolean | undefined;
203
+ flat?: boolean | undefined;
204
+ at?: boolean | undefined;
205
+ };
206
+ } | null;
207
+ status: import("../generated/prisma/client").$Enums.Status;
208
+ };
209
+ outputFormat: "json";
210
+ status: import("hono/utils/http-status").ContentfulStatusCode;
211
+ };
212
+ };
213
+ } & {
214
+ "/": {
215
+ $patch: {
216
+ input: {
217
+ json: {
218
+ auto_renew?: boolean | undefined;
219
+ api_key?: boolean | undefined;
220
+ notify_subscriptions?: NotifyType[] | undefined;
221
+ };
222
+ };
223
+ output: null;
224
+ outputFormat: "body";
225
+ status: 204;
226
+ };
227
+ };
228
+ } & {
229
+ "/balance/log": {
230
+ $get: {
231
+ input: {
232
+ query: {
233
+ email?: string | string[] | undefined;
234
+ type?: string | string[] | undefined;
235
+ sort?: string | string[] | undefined;
236
+ page?: string | string[] | undefined;
237
+ perPage?: string | string[] | undefined;
238
+ };
239
+ };
240
+ output: {
241
+ data: {
242
+ created_at: string;
243
+ user: {
244
+ email: string;
245
+ };
246
+ id: number;
247
+ updated_at: string;
248
+ user_id: number;
249
+ balance: number;
250
+ amount: number;
251
+ type: import("../generated/prisma/client").$Enums.BalanceLogType;
252
+ }[];
253
+ total: number;
254
+ };
255
+ outputFormat: "json";
256
+ status: import("hono/utils/http-status").ContentfulStatusCode;
257
+ };
258
+ };
259
+ } & {
260
+ "/referral/info": {
261
+ $get: {
262
+ input: {};
263
+ output: {
264
+ referral_url: string;
265
+ commission_rate: number;
266
+ referral_count: number;
267
+ total_earnings: number;
268
+ };
269
+ outputFormat: "json";
270
+ status: import("hono/utils/http-status").ContentfulStatusCode;
271
+ };
272
+ };
273
+ } & {
274
+ "/referral/stats": {
275
+ $get: {
276
+ input: {
277
+ query: {
278
+ start_date?: string | string[] | undefined;
279
+ end_date?: string | string[] | undefined;
280
+ aggregate_by?: string | string[] | undefined;
281
+ };
282
+ };
283
+ output: {
284
+ date: string;
285
+ referral_count: number;
286
+ earnings: number;
287
+ }[];
288
+ outputFormat: "json";
289
+ status: import("hono/utils/http-status").ContentfulStatusCode;
290
+ };
291
+ };
292
+ }, "/">;
293
+ export default app;
@@ -0,0 +1,9 @@
1
+ import { Plan, User, UserPlan } from "@/generated/prisma/client";
2
+ type Variables = {
3
+ user: User;
4
+ plan: UserPlan & {
5
+ plan: Plan;
6
+ };
7
+ ip: string;
8
+ };
9
+ export type { Variables };
@@ -0,0 +1,7 @@
1
+ export interface License {
2
+ expired_at: Date;
3
+ created_at: Date;
4
+ site_url: string;
5
+ type: "personal" | "business";
6
+ content: string;
7
+ }