@polinetwork/backend 0.9.0 → 0.9.2
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/dist/index.d.cts +120 -50
- package/dist/index.d.ts +120 -50
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as _trpc_server from '@trpc/server';
|
|
2
|
-
import * as _trpc_server_unstable_core_do_not_import from '@trpc/server/unstable-core-do-not-import';
|
|
3
2
|
import * as better_auth from 'better-auth';
|
|
4
|
-
import { z } from 'zod
|
|
3
|
+
import { z } from 'zod';
|
|
5
4
|
|
|
6
5
|
declare const TRPC_PATH = "/api/trpc";
|
|
7
6
|
declare const AUTH_PATH = "/api/auth";
|
|
@@ -20,7 +19,7 @@ type TAuditType = (typeof AUDIT_TYPE)[keyof typeof AUDIT_TYPE];
|
|
|
20
19
|
*
|
|
21
20
|
* All routers added in /api/routers should be manually added here.
|
|
22
21
|
*/
|
|
23
|
-
declare const appRouter:
|
|
22
|
+
declare const appRouter: _trpc_server.TRPCBuiltRouter<{
|
|
24
23
|
ctx: {
|
|
25
24
|
userId?: string;
|
|
26
25
|
};
|
|
@@ -30,17 +29,17 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
30
29
|
zodError: {
|
|
31
30
|
errors: string[];
|
|
32
31
|
} | null;
|
|
33
|
-
code:
|
|
32
|
+
code: _trpc_server.TRPC_ERROR_CODE_KEY;
|
|
34
33
|
httpStatus: number;
|
|
35
34
|
path?: string;
|
|
36
35
|
stack?: string;
|
|
37
36
|
};
|
|
38
37
|
message: string;
|
|
39
|
-
code:
|
|
38
|
+
code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
|
|
40
39
|
};
|
|
41
40
|
transformer: true;
|
|
42
|
-
},
|
|
43
|
-
test:
|
|
41
|
+
}, _trpc_server.TRPCDecorateCreateRouterOptions<{
|
|
42
|
+
test: _trpc_server.TRPCBuiltRouter<{
|
|
44
43
|
ctx: {
|
|
45
44
|
userId?: string;
|
|
46
45
|
};
|
|
@@ -50,21 +49,22 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
50
49
|
zodError: {
|
|
51
50
|
errors: string[];
|
|
52
51
|
} | null;
|
|
53
|
-
code:
|
|
52
|
+
code: _trpc_server.TRPC_ERROR_CODE_KEY;
|
|
54
53
|
httpStatus: number;
|
|
55
54
|
path?: string;
|
|
56
55
|
stack?: string;
|
|
57
56
|
};
|
|
58
57
|
message: string;
|
|
59
|
-
code:
|
|
58
|
+
code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
|
|
60
59
|
};
|
|
61
60
|
transformer: true;
|
|
62
|
-
},
|
|
61
|
+
}, _trpc_server.TRPCDecorateCreateRouterOptions<{
|
|
63
62
|
dbQuery: _trpc_server.TRPCQueryProcedure<{
|
|
64
63
|
input: {
|
|
65
64
|
dbName: "web" | "tg";
|
|
66
65
|
};
|
|
67
66
|
output: string[];
|
|
67
|
+
meta: object;
|
|
68
68
|
}>;
|
|
69
69
|
dbInsert: _trpc_server.TRPCMutationProcedure<{
|
|
70
70
|
input: {
|
|
@@ -72,9 +72,10 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
72
72
|
dbName: "web" | "tg";
|
|
73
73
|
};
|
|
74
74
|
output: boolean;
|
|
75
|
+
meta: object;
|
|
75
76
|
}>;
|
|
76
77
|
}>>;
|
|
77
|
-
tg:
|
|
78
|
+
tg: _trpc_server.TRPCBuiltRouter<{
|
|
78
79
|
ctx: {
|
|
79
80
|
userId?: string;
|
|
80
81
|
};
|
|
@@ -84,17 +85,17 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
84
85
|
zodError: {
|
|
85
86
|
errors: string[];
|
|
86
87
|
} | null;
|
|
87
|
-
code:
|
|
88
|
+
code: _trpc_server.TRPC_ERROR_CODE_KEY;
|
|
88
89
|
httpStatus: number;
|
|
89
90
|
path?: string;
|
|
90
91
|
stack?: string;
|
|
91
92
|
};
|
|
92
93
|
message: string;
|
|
93
|
-
code:
|
|
94
|
+
code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
|
|
94
95
|
};
|
|
95
96
|
transformer: true;
|
|
96
|
-
},
|
|
97
|
-
groups:
|
|
97
|
+
}, _trpc_server.TRPCDecorateCreateRouterOptions<{
|
|
98
|
+
groups: _trpc_server.TRPCBuiltRouter<{
|
|
98
99
|
ctx: {
|
|
99
100
|
userId?: string;
|
|
100
101
|
};
|
|
@@ -104,16 +105,16 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
104
105
|
zodError: {
|
|
105
106
|
errors: string[];
|
|
106
107
|
} | null;
|
|
107
|
-
code:
|
|
108
|
+
code: _trpc_server.TRPC_ERROR_CODE_KEY;
|
|
108
109
|
httpStatus: number;
|
|
109
110
|
path?: string;
|
|
110
111
|
stack?: string;
|
|
111
112
|
};
|
|
112
113
|
message: string;
|
|
113
|
-
code:
|
|
114
|
+
code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
|
|
114
115
|
};
|
|
115
116
|
transformer: true;
|
|
116
|
-
},
|
|
117
|
+
}, _trpc_server.TRPCDecorateCreateRouterOptions<{
|
|
117
118
|
getAll: _trpc_server.TRPCQueryProcedure<{
|
|
118
119
|
input: void;
|
|
119
120
|
output: {
|
|
@@ -123,18 +124,22 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
123
124
|
title: string;
|
|
124
125
|
link: string | null;
|
|
125
126
|
}[];
|
|
127
|
+
meta: object;
|
|
126
128
|
}>;
|
|
127
129
|
search: _trpc_server.TRPCQueryProcedure<{
|
|
128
130
|
input: {
|
|
129
131
|
query: string;
|
|
132
|
+
limit?: number | undefined;
|
|
130
133
|
};
|
|
131
134
|
output: {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
groups: {
|
|
136
|
+
telegramId: number;
|
|
137
|
+
title: string;
|
|
138
|
+
link: string | null;
|
|
139
|
+
}[];
|
|
140
|
+
count: number;
|
|
141
|
+
};
|
|
142
|
+
meta: object;
|
|
138
143
|
}>;
|
|
139
144
|
getById: _trpc_server.TRPCQueryProcedure<{
|
|
140
145
|
input: {
|
|
@@ -147,6 +152,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
147
152
|
title: string;
|
|
148
153
|
link: string | null;
|
|
149
154
|
}[];
|
|
155
|
+
meta: object;
|
|
150
156
|
}>;
|
|
151
157
|
create: _trpc_server.TRPCMutationProcedure<{
|
|
152
158
|
input: {
|
|
@@ -155,15 +161,17 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
155
161
|
link: string;
|
|
156
162
|
}[];
|
|
157
163
|
output: number[];
|
|
164
|
+
meta: object;
|
|
158
165
|
}>;
|
|
159
166
|
delete: _trpc_server.TRPCMutationProcedure<{
|
|
160
167
|
input: {
|
|
161
168
|
telegramId: number;
|
|
162
169
|
};
|
|
163
170
|
output: boolean;
|
|
171
|
+
meta: object;
|
|
164
172
|
}>;
|
|
165
173
|
}>>;
|
|
166
|
-
permissions:
|
|
174
|
+
permissions: _trpc_server.TRPCBuiltRouter<{
|
|
167
175
|
ctx: {
|
|
168
176
|
userId?: string;
|
|
169
177
|
};
|
|
@@ -173,16 +181,16 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
173
181
|
zodError: {
|
|
174
182
|
errors: string[];
|
|
175
183
|
} | null;
|
|
176
|
-
code:
|
|
184
|
+
code: _trpc_server.TRPC_ERROR_CODE_KEY;
|
|
177
185
|
httpStatus: number;
|
|
178
186
|
path?: string;
|
|
179
187
|
stack?: string;
|
|
180
188
|
};
|
|
181
189
|
message: string;
|
|
182
|
-
code:
|
|
190
|
+
code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
|
|
183
191
|
};
|
|
184
192
|
transformer: true;
|
|
185
|
-
},
|
|
193
|
+
}, _trpc_server.TRPCDecorateCreateRouterOptions<{
|
|
186
194
|
getRole: _trpc_server.TRPCQueryProcedure<{
|
|
187
195
|
input: {
|
|
188
196
|
userId: number;
|
|
@@ -191,6 +199,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
191
199
|
userId: number;
|
|
192
200
|
role: string;
|
|
193
201
|
};
|
|
202
|
+
meta: object;
|
|
194
203
|
}>;
|
|
195
204
|
setRole: _trpc_server.TRPCQueryProcedure<{
|
|
196
205
|
input: {
|
|
@@ -199,6 +208,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
199
208
|
adderId: number;
|
|
200
209
|
};
|
|
201
210
|
output: void;
|
|
211
|
+
meta: object;
|
|
202
212
|
}>;
|
|
203
213
|
checkGroup: _trpc_server.TRPCQueryProcedure<{
|
|
204
214
|
input: {
|
|
@@ -206,6 +216,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
206
216
|
groupId: number;
|
|
207
217
|
};
|
|
208
218
|
output: boolean;
|
|
219
|
+
meta: object;
|
|
209
220
|
}>;
|
|
210
221
|
addGroup: _trpc_server.TRPCQueryProcedure<{
|
|
211
222
|
input: {
|
|
@@ -214,6 +225,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
214
225
|
groupId: number;
|
|
215
226
|
};
|
|
216
227
|
output: void;
|
|
228
|
+
meta: object;
|
|
217
229
|
}>;
|
|
218
230
|
canAddBot: _trpc_server.TRPCQueryProcedure<{
|
|
219
231
|
input: {
|
|
@@ -226,9 +238,10 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
226
238
|
allowed: false;
|
|
227
239
|
error: "NOT_FOUND";
|
|
228
240
|
};
|
|
241
|
+
meta: object;
|
|
229
242
|
}>;
|
|
230
243
|
}>>;
|
|
231
|
-
link:
|
|
244
|
+
link: _trpc_server.TRPCBuiltRouter<{
|
|
232
245
|
ctx: {
|
|
233
246
|
userId?: string;
|
|
234
247
|
};
|
|
@@ -238,16 +251,16 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
238
251
|
zodError: {
|
|
239
252
|
errors: string[];
|
|
240
253
|
} | null;
|
|
241
|
-
code:
|
|
254
|
+
code: _trpc_server.TRPC_ERROR_CODE_KEY;
|
|
242
255
|
httpStatus: number;
|
|
243
256
|
path?: string;
|
|
244
257
|
stack?: string;
|
|
245
258
|
};
|
|
246
259
|
message: string;
|
|
247
|
-
code:
|
|
260
|
+
code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
|
|
248
261
|
};
|
|
249
262
|
transformer: true;
|
|
250
|
-
},
|
|
263
|
+
}, _trpc_server.TRPCDecorateCreateRouterOptions<{
|
|
251
264
|
link: _trpc_server.TRPCQueryProcedure<{
|
|
252
265
|
input: {
|
|
253
266
|
code: string;
|
|
@@ -261,9 +274,10 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
261
274
|
success: boolean;
|
|
262
275
|
error: undefined;
|
|
263
276
|
};
|
|
277
|
+
meta: object;
|
|
264
278
|
}>;
|
|
265
279
|
}>>;
|
|
266
|
-
messages:
|
|
280
|
+
messages: _trpc_server.TRPCBuiltRouter<{
|
|
267
281
|
ctx: {
|
|
268
282
|
userId?: string;
|
|
269
283
|
};
|
|
@@ -273,16 +287,16 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
273
287
|
zodError: {
|
|
274
288
|
errors: string[];
|
|
275
289
|
} | null;
|
|
276
|
-
code:
|
|
290
|
+
code: _trpc_server.TRPC_ERROR_CODE_KEY;
|
|
277
291
|
httpStatus: number;
|
|
278
292
|
path?: string;
|
|
279
293
|
stack?: string;
|
|
280
294
|
};
|
|
281
295
|
message: string;
|
|
282
|
-
code:
|
|
296
|
+
code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
|
|
283
297
|
};
|
|
284
298
|
transformer: true;
|
|
285
|
-
},
|
|
299
|
+
}, _trpc_server.TRPCDecorateCreateRouterOptions<{
|
|
286
300
|
get: _trpc_server.TRPCQueryProcedure<{
|
|
287
301
|
input: {
|
|
288
302
|
chatId: number;
|
|
@@ -301,6 +315,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
301
315
|
message: null;
|
|
302
316
|
error: "NOT_FOUND" | "DECRYPT_ERROR";
|
|
303
317
|
};
|
|
318
|
+
meta: object;
|
|
304
319
|
}>;
|
|
305
320
|
add: _trpc_server.TRPCMutationProcedure<{
|
|
306
321
|
input: {
|
|
@@ -315,9 +330,10 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
315
330
|
output: {
|
|
316
331
|
error: "ENCRYPT_ERROR" | null;
|
|
317
332
|
};
|
|
333
|
+
meta: object;
|
|
318
334
|
}>;
|
|
319
335
|
}>>;
|
|
320
|
-
auditLog:
|
|
336
|
+
auditLog: _trpc_server.TRPCBuiltRouter<{
|
|
321
337
|
ctx: {
|
|
322
338
|
userId?: string;
|
|
323
339
|
};
|
|
@@ -327,16 +343,16 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
327
343
|
zodError: {
|
|
328
344
|
errors: string[];
|
|
329
345
|
} | null;
|
|
330
|
-
code:
|
|
346
|
+
code: _trpc_server.TRPC_ERROR_CODE_KEY;
|
|
331
347
|
httpStatus: number;
|
|
332
348
|
path?: string;
|
|
333
349
|
stack?: string;
|
|
334
350
|
};
|
|
335
351
|
message: string;
|
|
336
|
-
code:
|
|
352
|
+
code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
|
|
337
353
|
};
|
|
338
354
|
transformer: true;
|
|
339
|
-
},
|
|
355
|
+
}, _trpc_server.TRPCDecorateCreateRouterOptions<{
|
|
340
356
|
create: _trpc_server.TRPCMutationProcedure<{
|
|
341
357
|
input: {
|
|
342
358
|
adminId: number;
|
|
@@ -347,6 +363,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
347
363
|
reason?: string | undefined;
|
|
348
364
|
};
|
|
349
365
|
output: void;
|
|
366
|
+
meta: object;
|
|
350
367
|
}>;
|
|
351
368
|
getById: _trpc_server.TRPCQueryProcedure<{
|
|
352
369
|
input: {
|
|
@@ -364,6 +381,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
364
381
|
until: Date | null;
|
|
365
382
|
reason: string | null;
|
|
366
383
|
}[];
|
|
384
|
+
meta: object;
|
|
367
385
|
}>;
|
|
368
386
|
}>>;
|
|
369
387
|
}>>;
|
|
@@ -413,11 +431,37 @@ declare const telegramPlugin: () => {
|
|
|
413
431
|
returnHeaders?: ReturnHeaders | undefined;
|
|
414
432
|
}): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
|
|
415
433
|
headers: Headers;
|
|
416
|
-
response:
|
|
434
|
+
response: {
|
|
435
|
+
status: ("BAD_REQUEST" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "CONFLICT" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "TOO_MANY_REQUESTS" | "OK" | "CREATED" | "ACCEPTED" | "NO_CONTENT" | "MULTIPLE_CHOICES" | "MOVED_PERMANENTLY" | "FOUND" | "SEE_OTHER" | "NOT_MODIFIED" | "TEMPORARY_REDIRECT" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "PROXY_AUTHENTICATION_REQUIRED" | "REQUEST_TIMEOUT" | "GONE" | "LENGTH_REQUIRED" | "URI_TOO_LONG" | "RANGE_NOT_SATISFIABLE" | "EXPECTATION_FAILED" | "I'M_A_TEAPOT" | "MISDIRECTED_REQUEST" | "UNPROCESSABLE_ENTITY" | "LOCKED" | "FAILED_DEPENDENCY" | "TOO_EARLY" | "UPGRADE_REQUIRED" | "PRECONDITION_REQUIRED" | "REQUEST_HEADER_FIELDS_TOO_LARGE" | "UNAVAILABLE_FOR_LEGAL_REASONS" | "HTTP_VERSION_NOT_SUPPORTED" | "VARIANT_ALSO_NEGOTIATES" | "INSUFFICIENT_STORAGE" | "LOOP_DETECTED" | "NOT_EXTENDED" | "NETWORK_AUTHENTICATION_REQUIRED") | better_auth.Status;
|
|
436
|
+
body: ({
|
|
437
|
+
message?: string;
|
|
438
|
+
code?: string;
|
|
439
|
+
cause?: unknown;
|
|
440
|
+
} & Record<string, any>) | undefined;
|
|
441
|
+
headers: HeadersInit;
|
|
442
|
+
statusCode: number;
|
|
443
|
+
name: string;
|
|
444
|
+
message: string;
|
|
445
|
+
stack?: string;
|
|
446
|
+
cause?: unknown;
|
|
447
|
+
} | {
|
|
417
448
|
code: string;
|
|
418
449
|
ttl: number;
|
|
419
450
|
};
|
|
420
|
-
} :
|
|
451
|
+
} : {
|
|
452
|
+
status: ("BAD_REQUEST" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "CONFLICT" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "TOO_MANY_REQUESTS" | "OK" | "CREATED" | "ACCEPTED" | "NO_CONTENT" | "MULTIPLE_CHOICES" | "MOVED_PERMANENTLY" | "FOUND" | "SEE_OTHER" | "NOT_MODIFIED" | "TEMPORARY_REDIRECT" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "PROXY_AUTHENTICATION_REQUIRED" | "REQUEST_TIMEOUT" | "GONE" | "LENGTH_REQUIRED" | "URI_TOO_LONG" | "RANGE_NOT_SATISFIABLE" | "EXPECTATION_FAILED" | "I'M_A_TEAPOT" | "MISDIRECTED_REQUEST" | "UNPROCESSABLE_ENTITY" | "LOCKED" | "FAILED_DEPENDENCY" | "TOO_EARLY" | "UPGRADE_REQUIRED" | "PRECONDITION_REQUIRED" | "REQUEST_HEADER_FIELDS_TOO_LARGE" | "UNAVAILABLE_FOR_LEGAL_REASONS" | "HTTP_VERSION_NOT_SUPPORTED" | "VARIANT_ALSO_NEGOTIATES" | "INSUFFICIENT_STORAGE" | "LOOP_DETECTED" | "NOT_EXTENDED" | "NETWORK_AUTHENTICATION_REQUIRED") | better_auth.Status;
|
|
453
|
+
body: ({
|
|
454
|
+
message?: string;
|
|
455
|
+
code?: string;
|
|
456
|
+
cause?: unknown;
|
|
457
|
+
} & Record<string, any>) | undefined;
|
|
458
|
+
headers: HeadersInit;
|
|
459
|
+
statusCode: number;
|
|
460
|
+
name: string;
|
|
461
|
+
message: string;
|
|
462
|
+
stack?: string;
|
|
463
|
+
cause?: unknown;
|
|
464
|
+
} | {
|
|
421
465
|
code: string;
|
|
422
466
|
ttl: number;
|
|
423
467
|
}>;
|
|
@@ -437,11 +481,11 @@ declare const telegramPlugin: () => {
|
|
|
437
481
|
};
|
|
438
482
|
user: Record<string, any> & {
|
|
439
483
|
id: string;
|
|
440
|
-
name: string;
|
|
441
|
-
email: string;
|
|
442
|
-
emailVerified: boolean;
|
|
443
484
|
createdAt: Date;
|
|
444
485
|
updatedAt: Date;
|
|
486
|
+
email: string;
|
|
487
|
+
emailVerified: boolean;
|
|
488
|
+
name: string;
|
|
445
489
|
image?: string | null | undefined;
|
|
446
490
|
};
|
|
447
491
|
};
|
|
@@ -479,11 +523,37 @@ declare const telegramPlugin: () => {
|
|
|
479
523
|
returnHeaders?: ReturnHeaders | undefined;
|
|
480
524
|
}): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
|
|
481
525
|
headers: Headers;
|
|
482
|
-
response:
|
|
526
|
+
response: {
|
|
527
|
+
status: ("BAD_REQUEST" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "CONFLICT" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "TOO_MANY_REQUESTS" | "OK" | "CREATED" | "ACCEPTED" | "NO_CONTENT" | "MULTIPLE_CHOICES" | "MOVED_PERMANENTLY" | "FOUND" | "SEE_OTHER" | "NOT_MODIFIED" | "TEMPORARY_REDIRECT" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "PROXY_AUTHENTICATION_REQUIRED" | "REQUEST_TIMEOUT" | "GONE" | "LENGTH_REQUIRED" | "URI_TOO_LONG" | "RANGE_NOT_SATISFIABLE" | "EXPECTATION_FAILED" | "I'M_A_TEAPOT" | "MISDIRECTED_REQUEST" | "UNPROCESSABLE_ENTITY" | "LOCKED" | "FAILED_DEPENDENCY" | "TOO_EARLY" | "UPGRADE_REQUIRED" | "PRECONDITION_REQUIRED" | "REQUEST_HEADER_FIELDS_TOO_LARGE" | "UNAVAILABLE_FOR_LEGAL_REASONS" | "HTTP_VERSION_NOT_SUPPORTED" | "VARIANT_ALSO_NEGOTIATES" | "INSUFFICIENT_STORAGE" | "LOOP_DETECTED" | "NOT_EXTENDED" | "NETWORK_AUTHENTICATION_REQUIRED") | better_auth.Status;
|
|
528
|
+
body: ({
|
|
529
|
+
message?: string;
|
|
530
|
+
code?: string;
|
|
531
|
+
cause?: unknown;
|
|
532
|
+
} & Record<string, any>) | undefined;
|
|
533
|
+
headers: HeadersInit;
|
|
534
|
+
statusCode: number;
|
|
535
|
+
name: string;
|
|
536
|
+
message: string;
|
|
537
|
+
stack?: string;
|
|
538
|
+
cause?: unknown;
|
|
539
|
+
} | {
|
|
483
540
|
expired: boolean;
|
|
484
541
|
verified: boolean;
|
|
485
542
|
};
|
|
486
|
-
} :
|
|
543
|
+
} : {
|
|
544
|
+
status: ("BAD_REQUEST" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "CONFLICT" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "TOO_MANY_REQUESTS" | "OK" | "CREATED" | "ACCEPTED" | "NO_CONTENT" | "MULTIPLE_CHOICES" | "MOVED_PERMANENTLY" | "FOUND" | "SEE_OTHER" | "NOT_MODIFIED" | "TEMPORARY_REDIRECT" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "PROXY_AUTHENTICATION_REQUIRED" | "REQUEST_TIMEOUT" | "GONE" | "LENGTH_REQUIRED" | "URI_TOO_LONG" | "RANGE_NOT_SATISFIABLE" | "EXPECTATION_FAILED" | "I'M_A_TEAPOT" | "MISDIRECTED_REQUEST" | "UNPROCESSABLE_ENTITY" | "LOCKED" | "FAILED_DEPENDENCY" | "TOO_EARLY" | "UPGRADE_REQUIRED" | "PRECONDITION_REQUIRED" | "REQUEST_HEADER_FIELDS_TOO_LARGE" | "UNAVAILABLE_FOR_LEGAL_REASONS" | "HTTP_VERSION_NOT_SUPPORTED" | "VARIANT_ALSO_NEGOTIATES" | "INSUFFICIENT_STORAGE" | "LOOP_DETECTED" | "NOT_EXTENDED" | "NETWORK_AUTHENTICATION_REQUIRED") | better_auth.Status;
|
|
545
|
+
body: ({
|
|
546
|
+
message?: string;
|
|
547
|
+
code?: string;
|
|
548
|
+
cause?: unknown;
|
|
549
|
+
} & Record<string, any>) | undefined;
|
|
550
|
+
headers: HeadersInit;
|
|
551
|
+
statusCode: number;
|
|
552
|
+
name: string;
|
|
553
|
+
message: string;
|
|
554
|
+
stack?: string;
|
|
555
|
+
cause?: unknown;
|
|
556
|
+
} | {
|
|
487
557
|
expired: boolean;
|
|
488
558
|
verified: boolean;
|
|
489
559
|
}>;
|
|
@@ -503,11 +573,11 @@ declare const telegramPlugin: () => {
|
|
|
503
573
|
};
|
|
504
574
|
user: Record<string, any> & {
|
|
505
575
|
id: string;
|
|
506
|
-
name: string;
|
|
507
|
-
email: string;
|
|
508
|
-
emailVerified: boolean;
|
|
509
576
|
createdAt: Date;
|
|
510
577
|
updatedAt: Date;
|
|
578
|
+
email: string;
|
|
579
|
+
emailVerified: boolean;
|
|
580
|
+
name: string;
|
|
511
581
|
image?: string | null | undefined;
|
|
512
582
|
};
|
|
513
583
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as _trpc_server from '@trpc/server';
|
|
2
|
-
import * as _trpc_server_unstable_core_do_not_import from '@trpc/server/unstable-core-do-not-import';
|
|
3
2
|
import * as better_auth from 'better-auth';
|
|
4
|
-
import { z } from 'zod
|
|
3
|
+
import { z } from 'zod';
|
|
5
4
|
|
|
6
5
|
declare const TRPC_PATH = "/api/trpc";
|
|
7
6
|
declare const AUTH_PATH = "/api/auth";
|
|
@@ -20,7 +19,7 @@ type TAuditType = (typeof AUDIT_TYPE)[keyof typeof AUDIT_TYPE];
|
|
|
20
19
|
*
|
|
21
20
|
* All routers added in /api/routers should be manually added here.
|
|
22
21
|
*/
|
|
23
|
-
declare const appRouter:
|
|
22
|
+
declare const appRouter: _trpc_server.TRPCBuiltRouter<{
|
|
24
23
|
ctx: {
|
|
25
24
|
userId?: string;
|
|
26
25
|
};
|
|
@@ -30,17 +29,17 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
30
29
|
zodError: {
|
|
31
30
|
errors: string[];
|
|
32
31
|
} | null;
|
|
33
|
-
code:
|
|
32
|
+
code: _trpc_server.TRPC_ERROR_CODE_KEY;
|
|
34
33
|
httpStatus: number;
|
|
35
34
|
path?: string;
|
|
36
35
|
stack?: string;
|
|
37
36
|
};
|
|
38
37
|
message: string;
|
|
39
|
-
code:
|
|
38
|
+
code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
|
|
40
39
|
};
|
|
41
40
|
transformer: true;
|
|
42
|
-
},
|
|
43
|
-
test:
|
|
41
|
+
}, _trpc_server.TRPCDecorateCreateRouterOptions<{
|
|
42
|
+
test: _trpc_server.TRPCBuiltRouter<{
|
|
44
43
|
ctx: {
|
|
45
44
|
userId?: string;
|
|
46
45
|
};
|
|
@@ -50,21 +49,22 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
50
49
|
zodError: {
|
|
51
50
|
errors: string[];
|
|
52
51
|
} | null;
|
|
53
|
-
code:
|
|
52
|
+
code: _trpc_server.TRPC_ERROR_CODE_KEY;
|
|
54
53
|
httpStatus: number;
|
|
55
54
|
path?: string;
|
|
56
55
|
stack?: string;
|
|
57
56
|
};
|
|
58
57
|
message: string;
|
|
59
|
-
code:
|
|
58
|
+
code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
|
|
60
59
|
};
|
|
61
60
|
transformer: true;
|
|
62
|
-
},
|
|
61
|
+
}, _trpc_server.TRPCDecorateCreateRouterOptions<{
|
|
63
62
|
dbQuery: _trpc_server.TRPCQueryProcedure<{
|
|
64
63
|
input: {
|
|
65
64
|
dbName: "web" | "tg";
|
|
66
65
|
};
|
|
67
66
|
output: string[];
|
|
67
|
+
meta: object;
|
|
68
68
|
}>;
|
|
69
69
|
dbInsert: _trpc_server.TRPCMutationProcedure<{
|
|
70
70
|
input: {
|
|
@@ -72,9 +72,10 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
72
72
|
dbName: "web" | "tg";
|
|
73
73
|
};
|
|
74
74
|
output: boolean;
|
|
75
|
+
meta: object;
|
|
75
76
|
}>;
|
|
76
77
|
}>>;
|
|
77
|
-
tg:
|
|
78
|
+
tg: _trpc_server.TRPCBuiltRouter<{
|
|
78
79
|
ctx: {
|
|
79
80
|
userId?: string;
|
|
80
81
|
};
|
|
@@ -84,17 +85,17 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
84
85
|
zodError: {
|
|
85
86
|
errors: string[];
|
|
86
87
|
} | null;
|
|
87
|
-
code:
|
|
88
|
+
code: _trpc_server.TRPC_ERROR_CODE_KEY;
|
|
88
89
|
httpStatus: number;
|
|
89
90
|
path?: string;
|
|
90
91
|
stack?: string;
|
|
91
92
|
};
|
|
92
93
|
message: string;
|
|
93
|
-
code:
|
|
94
|
+
code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
|
|
94
95
|
};
|
|
95
96
|
transformer: true;
|
|
96
|
-
},
|
|
97
|
-
groups:
|
|
97
|
+
}, _trpc_server.TRPCDecorateCreateRouterOptions<{
|
|
98
|
+
groups: _trpc_server.TRPCBuiltRouter<{
|
|
98
99
|
ctx: {
|
|
99
100
|
userId?: string;
|
|
100
101
|
};
|
|
@@ -104,16 +105,16 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
104
105
|
zodError: {
|
|
105
106
|
errors: string[];
|
|
106
107
|
} | null;
|
|
107
|
-
code:
|
|
108
|
+
code: _trpc_server.TRPC_ERROR_CODE_KEY;
|
|
108
109
|
httpStatus: number;
|
|
109
110
|
path?: string;
|
|
110
111
|
stack?: string;
|
|
111
112
|
};
|
|
112
113
|
message: string;
|
|
113
|
-
code:
|
|
114
|
+
code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
|
|
114
115
|
};
|
|
115
116
|
transformer: true;
|
|
116
|
-
},
|
|
117
|
+
}, _trpc_server.TRPCDecorateCreateRouterOptions<{
|
|
117
118
|
getAll: _trpc_server.TRPCQueryProcedure<{
|
|
118
119
|
input: void;
|
|
119
120
|
output: {
|
|
@@ -123,18 +124,22 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
123
124
|
title: string;
|
|
124
125
|
link: string | null;
|
|
125
126
|
}[];
|
|
127
|
+
meta: object;
|
|
126
128
|
}>;
|
|
127
129
|
search: _trpc_server.TRPCQueryProcedure<{
|
|
128
130
|
input: {
|
|
129
131
|
query: string;
|
|
132
|
+
limit?: number | undefined;
|
|
130
133
|
};
|
|
131
134
|
output: {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
groups: {
|
|
136
|
+
telegramId: number;
|
|
137
|
+
title: string;
|
|
138
|
+
link: string | null;
|
|
139
|
+
}[];
|
|
140
|
+
count: number;
|
|
141
|
+
};
|
|
142
|
+
meta: object;
|
|
138
143
|
}>;
|
|
139
144
|
getById: _trpc_server.TRPCQueryProcedure<{
|
|
140
145
|
input: {
|
|
@@ -147,6 +152,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
147
152
|
title: string;
|
|
148
153
|
link: string | null;
|
|
149
154
|
}[];
|
|
155
|
+
meta: object;
|
|
150
156
|
}>;
|
|
151
157
|
create: _trpc_server.TRPCMutationProcedure<{
|
|
152
158
|
input: {
|
|
@@ -155,15 +161,17 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
155
161
|
link: string;
|
|
156
162
|
}[];
|
|
157
163
|
output: number[];
|
|
164
|
+
meta: object;
|
|
158
165
|
}>;
|
|
159
166
|
delete: _trpc_server.TRPCMutationProcedure<{
|
|
160
167
|
input: {
|
|
161
168
|
telegramId: number;
|
|
162
169
|
};
|
|
163
170
|
output: boolean;
|
|
171
|
+
meta: object;
|
|
164
172
|
}>;
|
|
165
173
|
}>>;
|
|
166
|
-
permissions:
|
|
174
|
+
permissions: _trpc_server.TRPCBuiltRouter<{
|
|
167
175
|
ctx: {
|
|
168
176
|
userId?: string;
|
|
169
177
|
};
|
|
@@ -173,16 +181,16 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
173
181
|
zodError: {
|
|
174
182
|
errors: string[];
|
|
175
183
|
} | null;
|
|
176
|
-
code:
|
|
184
|
+
code: _trpc_server.TRPC_ERROR_CODE_KEY;
|
|
177
185
|
httpStatus: number;
|
|
178
186
|
path?: string;
|
|
179
187
|
stack?: string;
|
|
180
188
|
};
|
|
181
189
|
message: string;
|
|
182
|
-
code:
|
|
190
|
+
code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
|
|
183
191
|
};
|
|
184
192
|
transformer: true;
|
|
185
|
-
},
|
|
193
|
+
}, _trpc_server.TRPCDecorateCreateRouterOptions<{
|
|
186
194
|
getRole: _trpc_server.TRPCQueryProcedure<{
|
|
187
195
|
input: {
|
|
188
196
|
userId: number;
|
|
@@ -191,6 +199,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
191
199
|
userId: number;
|
|
192
200
|
role: string;
|
|
193
201
|
};
|
|
202
|
+
meta: object;
|
|
194
203
|
}>;
|
|
195
204
|
setRole: _trpc_server.TRPCQueryProcedure<{
|
|
196
205
|
input: {
|
|
@@ -199,6 +208,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
199
208
|
adderId: number;
|
|
200
209
|
};
|
|
201
210
|
output: void;
|
|
211
|
+
meta: object;
|
|
202
212
|
}>;
|
|
203
213
|
checkGroup: _trpc_server.TRPCQueryProcedure<{
|
|
204
214
|
input: {
|
|
@@ -206,6 +216,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
206
216
|
groupId: number;
|
|
207
217
|
};
|
|
208
218
|
output: boolean;
|
|
219
|
+
meta: object;
|
|
209
220
|
}>;
|
|
210
221
|
addGroup: _trpc_server.TRPCQueryProcedure<{
|
|
211
222
|
input: {
|
|
@@ -214,6 +225,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
214
225
|
groupId: number;
|
|
215
226
|
};
|
|
216
227
|
output: void;
|
|
228
|
+
meta: object;
|
|
217
229
|
}>;
|
|
218
230
|
canAddBot: _trpc_server.TRPCQueryProcedure<{
|
|
219
231
|
input: {
|
|
@@ -226,9 +238,10 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
226
238
|
allowed: false;
|
|
227
239
|
error: "NOT_FOUND";
|
|
228
240
|
};
|
|
241
|
+
meta: object;
|
|
229
242
|
}>;
|
|
230
243
|
}>>;
|
|
231
|
-
link:
|
|
244
|
+
link: _trpc_server.TRPCBuiltRouter<{
|
|
232
245
|
ctx: {
|
|
233
246
|
userId?: string;
|
|
234
247
|
};
|
|
@@ -238,16 +251,16 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
238
251
|
zodError: {
|
|
239
252
|
errors: string[];
|
|
240
253
|
} | null;
|
|
241
|
-
code:
|
|
254
|
+
code: _trpc_server.TRPC_ERROR_CODE_KEY;
|
|
242
255
|
httpStatus: number;
|
|
243
256
|
path?: string;
|
|
244
257
|
stack?: string;
|
|
245
258
|
};
|
|
246
259
|
message: string;
|
|
247
|
-
code:
|
|
260
|
+
code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
|
|
248
261
|
};
|
|
249
262
|
transformer: true;
|
|
250
|
-
},
|
|
263
|
+
}, _trpc_server.TRPCDecorateCreateRouterOptions<{
|
|
251
264
|
link: _trpc_server.TRPCQueryProcedure<{
|
|
252
265
|
input: {
|
|
253
266
|
code: string;
|
|
@@ -261,9 +274,10 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
261
274
|
success: boolean;
|
|
262
275
|
error: undefined;
|
|
263
276
|
};
|
|
277
|
+
meta: object;
|
|
264
278
|
}>;
|
|
265
279
|
}>>;
|
|
266
|
-
messages:
|
|
280
|
+
messages: _trpc_server.TRPCBuiltRouter<{
|
|
267
281
|
ctx: {
|
|
268
282
|
userId?: string;
|
|
269
283
|
};
|
|
@@ -273,16 +287,16 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
273
287
|
zodError: {
|
|
274
288
|
errors: string[];
|
|
275
289
|
} | null;
|
|
276
|
-
code:
|
|
290
|
+
code: _trpc_server.TRPC_ERROR_CODE_KEY;
|
|
277
291
|
httpStatus: number;
|
|
278
292
|
path?: string;
|
|
279
293
|
stack?: string;
|
|
280
294
|
};
|
|
281
295
|
message: string;
|
|
282
|
-
code:
|
|
296
|
+
code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
|
|
283
297
|
};
|
|
284
298
|
transformer: true;
|
|
285
|
-
},
|
|
299
|
+
}, _trpc_server.TRPCDecorateCreateRouterOptions<{
|
|
286
300
|
get: _trpc_server.TRPCQueryProcedure<{
|
|
287
301
|
input: {
|
|
288
302
|
chatId: number;
|
|
@@ -301,6 +315,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
301
315
|
message: null;
|
|
302
316
|
error: "NOT_FOUND" | "DECRYPT_ERROR";
|
|
303
317
|
};
|
|
318
|
+
meta: object;
|
|
304
319
|
}>;
|
|
305
320
|
add: _trpc_server.TRPCMutationProcedure<{
|
|
306
321
|
input: {
|
|
@@ -315,9 +330,10 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
315
330
|
output: {
|
|
316
331
|
error: "ENCRYPT_ERROR" | null;
|
|
317
332
|
};
|
|
333
|
+
meta: object;
|
|
318
334
|
}>;
|
|
319
335
|
}>>;
|
|
320
|
-
auditLog:
|
|
336
|
+
auditLog: _trpc_server.TRPCBuiltRouter<{
|
|
321
337
|
ctx: {
|
|
322
338
|
userId?: string;
|
|
323
339
|
};
|
|
@@ -327,16 +343,16 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
327
343
|
zodError: {
|
|
328
344
|
errors: string[];
|
|
329
345
|
} | null;
|
|
330
|
-
code:
|
|
346
|
+
code: _trpc_server.TRPC_ERROR_CODE_KEY;
|
|
331
347
|
httpStatus: number;
|
|
332
348
|
path?: string;
|
|
333
349
|
stack?: string;
|
|
334
350
|
};
|
|
335
351
|
message: string;
|
|
336
|
-
code:
|
|
352
|
+
code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
|
|
337
353
|
};
|
|
338
354
|
transformer: true;
|
|
339
|
-
},
|
|
355
|
+
}, _trpc_server.TRPCDecorateCreateRouterOptions<{
|
|
340
356
|
create: _trpc_server.TRPCMutationProcedure<{
|
|
341
357
|
input: {
|
|
342
358
|
adminId: number;
|
|
@@ -347,6 +363,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
347
363
|
reason?: string | undefined;
|
|
348
364
|
};
|
|
349
365
|
output: void;
|
|
366
|
+
meta: object;
|
|
350
367
|
}>;
|
|
351
368
|
getById: _trpc_server.TRPCQueryProcedure<{
|
|
352
369
|
input: {
|
|
@@ -364,6 +381,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
|
364
381
|
until: Date | null;
|
|
365
382
|
reason: string | null;
|
|
366
383
|
}[];
|
|
384
|
+
meta: object;
|
|
367
385
|
}>;
|
|
368
386
|
}>>;
|
|
369
387
|
}>>;
|
|
@@ -413,11 +431,37 @@ declare const telegramPlugin: () => {
|
|
|
413
431
|
returnHeaders?: ReturnHeaders | undefined;
|
|
414
432
|
}): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
|
|
415
433
|
headers: Headers;
|
|
416
|
-
response:
|
|
434
|
+
response: {
|
|
435
|
+
status: ("BAD_REQUEST" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "CONFLICT" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "TOO_MANY_REQUESTS" | "OK" | "CREATED" | "ACCEPTED" | "NO_CONTENT" | "MULTIPLE_CHOICES" | "MOVED_PERMANENTLY" | "FOUND" | "SEE_OTHER" | "NOT_MODIFIED" | "TEMPORARY_REDIRECT" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "PROXY_AUTHENTICATION_REQUIRED" | "REQUEST_TIMEOUT" | "GONE" | "LENGTH_REQUIRED" | "URI_TOO_LONG" | "RANGE_NOT_SATISFIABLE" | "EXPECTATION_FAILED" | "I'M_A_TEAPOT" | "MISDIRECTED_REQUEST" | "UNPROCESSABLE_ENTITY" | "LOCKED" | "FAILED_DEPENDENCY" | "TOO_EARLY" | "UPGRADE_REQUIRED" | "PRECONDITION_REQUIRED" | "REQUEST_HEADER_FIELDS_TOO_LARGE" | "UNAVAILABLE_FOR_LEGAL_REASONS" | "HTTP_VERSION_NOT_SUPPORTED" | "VARIANT_ALSO_NEGOTIATES" | "INSUFFICIENT_STORAGE" | "LOOP_DETECTED" | "NOT_EXTENDED" | "NETWORK_AUTHENTICATION_REQUIRED") | better_auth.Status;
|
|
436
|
+
body: ({
|
|
437
|
+
message?: string;
|
|
438
|
+
code?: string;
|
|
439
|
+
cause?: unknown;
|
|
440
|
+
} & Record<string, any>) | undefined;
|
|
441
|
+
headers: HeadersInit;
|
|
442
|
+
statusCode: number;
|
|
443
|
+
name: string;
|
|
444
|
+
message: string;
|
|
445
|
+
stack?: string;
|
|
446
|
+
cause?: unknown;
|
|
447
|
+
} | {
|
|
417
448
|
code: string;
|
|
418
449
|
ttl: number;
|
|
419
450
|
};
|
|
420
|
-
} :
|
|
451
|
+
} : {
|
|
452
|
+
status: ("BAD_REQUEST" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "CONFLICT" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "TOO_MANY_REQUESTS" | "OK" | "CREATED" | "ACCEPTED" | "NO_CONTENT" | "MULTIPLE_CHOICES" | "MOVED_PERMANENTLY" | "FOUND" | "SEE_OTHER" | "NOT_MODIFIED" | "TEMPORARY_REDIRECT" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "PROXY_AUTHENTICATION_REQUIRED" | "REQUEST_TIMEOUT" | "GONE" | "LENGTH_REQUIRED" | "URI_TOO_LONG" | "RANGE_NOT_SATISFIABLE" | "EXPECTATION_FAILED" | "I'M_A_TEAPOT" | "MISDIRECTED_REQUEST" | "UNPROCESSABLE_ENTITY" | "LOCKED" | "FAILED_DEPENDENCY" | "TOO_EARLY" | "UPGRADE_REQUIRED" | "PRECONDITION_REQUIRED" | "REQUEST_HEADER_FIELDS_TOO_LARGE" | "UNAVAILABLE_FOR_LEGAL_REASONS" | "HTTP_VERSION_NOT_SUPPORTED" | "VARIANT_ALSO_NEGOTIATES" | "INSUFFICIENT_STORAGE" | "LOOP_DETECTED" | "NOT_EXTENDED" | "NETWORK_AUTHENTICATION_REQUIRED") | better_auth.Status;
|
|
453
|
+
body: ({
|
|
454
|
+
message?: string;
|
|
455
|
+
code?: string;
|
|
456
|
+
cause?: unknown;
|
|
457
|
+
} & Record<string, any>) | undefined;
|
|
458
|
+
headers: HeadersInit;
|
|
459
|
+
statusCode: number;
|
|
460
|
+
name: string;
|
|
461
|
+
message: string;
|
|
462
|
+
stack?: string;
|
|
463
|
+
cause?: unknown;
|
|
464
|
+
} | {
|
|
421
465
|
code: string;
|
|
422
466
|
ttl: number;
|
|
423
467
|
}>;
|
|
@@ -437,11 +481,11 @@ declare const telegramPlugin: () => {
|
|
|
437
481
|
};
|
|
438
482
|
user: Record<string, any> & {
|
|
439
483
|
id: string;
|
|
440
|
-
name: string;
|
|
441
|
-
email: string;
|
|
442
|
-
emailVerified: boolean;
|
|
443
484
|
createdAt: Date;
|
|
444
485
|
updatedAt: Date;
|
|
486
|
+
email: string;
|
|
487
|
+
emailVerified: boolean;
|
|
488
|
+
name: string;
|
|
445
489
|
image?: string | null | undefined;
|
|
446
490
|
};
|
|
447
491
|
};
|
|
@@ -479,11 +523,37 @@ declare const telegramPlugin: () => {
|
|
|
479
523
|
returnHeaders?: ReturnHeaders | undefined;
|
|
480
524
|
}): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
|
|
481
525
|
headers: Headers;
|
|
482
|
-
response:
|
|
526
|
+
response: {
|
|
527
|
+
status: ("BAD_REQUEST" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "CONFLICT" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "TOO_MANY_REQUESTS" | "OK" | "CREATED" | "ACCEPTED" | "NO_CONTENT" | "MULTIPLE_CHOICES" | "MOVED_PERMANENTLY" | "FOUND" | "SEE_OTHER" | "NOT_MODIFIED" | "TEMPORARY_REDIRECT" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "PROXY_AUTHENTICATION_REQUIRED" | "REQUEST_TIMEOUT" | "GONE" | "LENGTH_REQUIRED" | "URI_TOO_LONG" | "RANGE_NOT_SATISFIABLE" | "EXPECTATION_FAILED" | "I'M_A_TEAPOT" | "MISDIRECTED_REQUEST" | "UNPROCESSABLE_ENTITY" | "LOCKED" | "FAILED_DEPENDENCY" | "TOO_EARLY" | "UPGRADE_REQUIRED" | "PRECONDITION_REQUIRED" | "REQUEST_HEADER_FIELDS_TOO_LARGE" | "UNAVAILABLE_FOR_LEGAL_REASONS" | "HTTP_VERSION_NOT_SUPPORTED" | "VARIANT_ALSO_NEGOTIATES" | "INSUFFICIENT_STORAGE" | "LOOP_DETECTED" | "NOT_EXTENDED" | "NETWORK_AUTHENTICATION_REQUIRED") | better_auth.Status;
|
|
528
|
+
body: ({
|
|
529
|
+
message?: string;
|
|
530
|
+
code?: string;
|
|
531
|
+
cause?: unknown;
|
|
532
|
+
} & Record<string, any>) | undefined;
|
|
533
|
+
headers: HeadersInit;
|
|
534
|
+
statusCode: number;
|
|
535
|
+
name: string;
|
|
536
|
+
message: string;
|
|
537
|
+
stack?: string;
|
|
538
|
+
cause?: unknown;
|
|
539
|
+
} | {
|
|
483
540
|
expired: boolean;
|
|
484
541
|
verified: boolean;
|
|
485
542
|
};
|
|
486
|
-
} :
|
|
543
|
+
} : {
|
|
544
|
+
status: ("BAD_REQUEST" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "CONFLICT" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "TOO_MANY_REQUESTS" | "OK" | "CREATED" | "ACCEPTED" | "NO_CONTENT" | "MULTIPLE_CHOICES" | "MOVED_PERMANENTLY" | "FOUND" | "SEE_OTHER" | "NOT_MODIFIED" | "TEMPORARY_REDIRECT" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "PROXY_AUTHENTICATION_REQUIRED" | "REQUEST_TIMEOUT" | "GONE" | "LENGTH_REQUIRED" | "URI_TOO_LONG" | "RANGE_NOT_SATISFIABLE" | "EXPECTATION_FAILED" | "I'M_A_TEAPOT" | "MISDIRECTED_REQUEST" | "UNPROCESSABLE_ENTITY" | "LOCKED" | "FAILED_DEPENDENCY" | "TOO_EARLY" | "UPGRADE_REQUIRED" | "PRECONDITION_REQUIRED" | "REQUEST_HEADER_FIELDS_TOO_LARGE" | "UNAVAILABLE_FOR_LEGAL_REASONS" | "HTTP_VERSION_NOT_SUPPORTED" | "VARIANT_ALSO_NEGOTIATES" | "INSUFFICIENT_STORAGE" | "LOOP_DETECTED" | "NOT_EXTENDED" | "NETWORK_AUTHENTICATION_REQUIRED") | better_auth.Status;
|
|
545
|
+
body: ({
|
|
546
|
+
message?: string;
|
|
547
|
+
code?: string;
|
|
548
|
+
cause?: unknown;
|
|
549
|
+
} & Record<string, any>) | undefined;
|
|
550
|
+
headers: HeadersInit;
|
|
551
|
+
statusCode: number;
|
|
552
|
+
name: string;
|
|
553
|
+
message: string;
|
|
554
|
+
stack?: string;
|
|
555
|
+
cause?: unknown;
|
|
556
|
+
} | {
|
|
487
557
|
expired: boolean;
|
|
488
558
|
verified: boolean;
|
|
489
559
|
}>;
|
|
@@ -503,11 +573,11 @@ declare const telegramPlugin: () => {
|
|
|
503
573
|
};
|
|
504
574
|
user: Record<string, any> & {
|
|
505
575
|
id: string;
|
|
506
|
-
name: string;
|
|
507
|
-
email: string;
|
|
508
|
-
emailVerified: boolean;
|
|
509
576
|
createdAt: Date;
|
|
510
577
|
updatedAt: Date;
|
|
578
|
+
email: string;
|
|
579
|
+
emailVerified: boolean;
|
|
580
|
+
name: string;
|
|
511
581
|
image?: string | null | undefined;
|
|
512
582
|
};
|
|
513
583
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polinetwork/backend",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "Utils to interact with the backend.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"copyfiles": "^2.4.1",
|
|
32
32
|
"rimraf": "^6.0.1",
|
|
33
|
-
"tsup": "^8.
|
|
34
|
-
"typescript": "^
|
|
33
|
+
"tsup": "^8.5.0",
|
|
34
|
+
"typescript": "^5.9.2"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
37
|
-
"
|
|
38
|
-
"node": ">=
|
|
37
|
+
"pnpm": ">=10.17.1",
|
|
38
|
+
"node": ">=24.8.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "rimraf ./dist && cd ../backend && pnpm install && pnpm run build:npm && cd ../package && copyfiles -u 3 ../backend/lib/* dist"
|