@polinetwork/backend 0.1.0 → 0.2.0
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/{lib/index.js → dist/index.cjs} +1 -1
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +340 -0
- package/dist/index.d.ts +340 -0
- package/{lib/index.mjs → dist/index.js} +1 -1
- package/package.json +19 -22
- package/README.md +0 -8
- package/lib/index.d.mts +0 -28
- package/lib/index.d.ts +0 -28
- package/lib/index.js.map +0 -1
- /package/{lib → dist}/index.global.js +0 -0
- /package/{lib → dist}/index.global.js.map +0 -0
- /package/{lib/index.mjs.map → dist/index.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/constants.ts"],"sourcesContent":["export { TRPC_PATH } from \"./constants\"\nexport { type AppRouter } from \"./routers\"\n","export const TRPC_PATH = \"/api/trpc\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,YAAY;","names":[]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import * as _trpc_server from '@trpc/server';
|
|
2
|
+
import * as _trpc_server_rpc from '@trpc/server/rpc';
|
|
3
|
+
import * as zod from 'zod';
|
|
4
|
+
import * as fastify_types_type_provider from 'fastify/types/type-provider';
|
|
5
|
+
import * as http from 'http';
|
|
6
|
+
import * as fastify from 'fastify';
|
|
7
|
+
|
|
8
|
+
declare const TRPC_PATH = "/api/trpc";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* This is the primary router for your server.
|
|
12
|
+
*
|
|
13
|
+
* All routers added in /api/routers should be manually added here.
|
|
14
|
+
*/
|
|
15
|
+
declare const appRouter: _trpc_server.CreateRouterInner<_trpc_server.RootConfig<{
|
|
16
|
+
ctx: {
|
|
17
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
18
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
19
|
+
userId: string;
|
|
20
|
+
};
|
|
21
|
+
meta: object;
|
|
22
|
+
errorShape: {
|
|
23
|
+
data: {
|
|
24
|
+
zodError: zod.typeToFlattenedError<any, string> | null;
|
|
25
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_KEY;
|
|
26
|
+
httpStatus: number;
|
|
27
|
+
path?: string;
|
|
28
|
+
stack?: string;
|
|
29
|
+
};
|
|
30
|
+
message: string;
|
|
31
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_NUMBER;
|
|
32
|
+
};
|
|
33
|
+
transformer: _trpc_server.DefaultDataTransformer;
|
|
34
|
+
}>, {
|
|
35
|
+
test: _trpc_server.CreateRouterInner<_trpc_server.RootConfig<{
|
|
36
|
+
ctx: {
|
|
37
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
38
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
39
|
+
userId: string;
|
|
40
|
+
};
|
|
41
|
+
meta: object;
|
|
42
|
+
errorShape: {
|
|
43
|
+
data: {
|
|
44
|
+
zodError: zod.typeToFlattenedError<any, string> | null;
|
|
45
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_KEY;
|
|
46
|
+
httpStatus: number;
|
|
47
|
+
path?: string;
|
|
48
|
+
stack?: string;
|
|
49
|
+
};
|
|
50
|
+
message: string;
|
|
51
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_NUMBER;
|
|
52
|
+
};
|
|
53
|
+
transformer: _trpc_server.DefaultDataTransformer;
|
|
54
|
+
}>, {
|
|
55
|
+
dbQuery: _trpc_server.BuildProcedure<"query", {
|
|
56
|
+
_config: _trpc_server.RootConfig<{
|
|
57
|
+
ctx: {
|
|
58
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
59
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
60
|
+
userId: string;
|
|
61
|
+
};
|
|
62
|
+
meta: object;
|
|
63
|
+
errorShape: {
|
|
64
|
+
data: {
|
|
65
|
+
zodError: zod.typeToFlattenedError<any, string> | null;
|
|
66
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_KEY;
|
|
67
|
+
httpStatus: number;
|
|
68
|
+
path?: string;
|
|
69
|
+
stack?: string;
|
|
70
|
+
};
|
|
71
|
+
message: string;
|
|
72
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_NUMBER;
|
|
73
|
+
};
|
|
74
|
+
transformer: _trpc_server.DefaultDataTransformer;
|
|
75
|
+
}>;
|
|
76
|
+
_meta: object;
|
|
77
|
+
_ctx_out: {
|
|
78
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
79
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
80
|
+
userId: string;
|
|
81
|
+
};
|
|
82
|
+
_input_in: {
|
|
83
|
+
dbName: "web" | "tg";
|
|
84
|
+
};
|
|
85
|
+
_input_out: {
|
|
86
|
+
dbName: "web" | "tg";
|
|
87
|
+
};
|
|
88
|
+
_output_in: typeof _trpc_server.unsetMarker;
|
|
89
|
+
_output_out: typeof _trpc_server.unsetMarker;
|
|
90
|
+
}, string[]>;
|
|
91
|
+
dbInsert: _trpc_server.BuildProcedure<"mutation", {
|
|
92
|
+
_config: _trpc_server.RootConfig<{
|
|
93
|
+
ctx: {
|
|
94
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
95
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
96
|
+
userId: string;
|
|
97
|
+
};
|
|
98
|
+
meta: object;
|
|
99
|
+
errorShape: {
|
|
100
|
+
data: {
|
|
101
|
+
zodError: zod.typeToFlattenedError<any, string> | null;
|
|
102
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_KEY;
|
|
103
|
+
httpStatus: number;
|
|
104
|
+
path?: string;
|
|
105
|
+
stack?: string;
|
|
106
|
+
};
|
|
107
|
+
message: string;
|
|
108
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_NUMBER;
|
|
109
|
+
};
|
|
110
|
+
transformer: _trpc_server.DefaultDataTransformer;
|
|
111
|
+
}>;
|
|
112
|
+
_meta: object;
|
|
113
|
+
_ctx_out: {
|
|
114
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
115
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
116
|
+
userId: string;
|
|
117
|
+
};
|
|
118
|
+
_input_in: {
|
|
119
|
+
text: string;
|
|
120
|
+
dbName: "web" | "tg";
|
|
121
|
+
};
|
|
122
|
+
_input_out: {
|
|
123
|
+
text: string;
|
|
124
|
+
dbName: "web" | "tg";
|
|
125
|
+
};
|
|
126
|
+
_output_in: typeof _trpc_server.unsetMarker;
|
|
127
|
+
_output_out: typeof _trpc_server.unsetMarker;
|
|
128
|
+
}, boolean>;
|
|
129
|
+
}>;
|
|
130
|
+
tg: _trpc_server.CreateRouterInner<_trpc_server.RootConfig<{
|
|
131
|
+
ctx: {
|
|
132
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
133
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
134
|
+
userId: string;
|
|
135
|
+
};
|
|
136
|
+
meta: object;
|
|
137
|
+
errorShape: {
|
|
138
|
+
data: {
|
|
139
|
+
zodError: zod.typeToFlattenedError<any, string> | null;
|
|
140
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_KEY;
|
|
141
|
+
httpStatus: number;
|
|
142
|
+
path?: string;
|
|
143
|
+
stack?: string;
|
|
144
|
+
};
|
|
145
|
+
message: string;
|
|
146
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_NUMBER;
|
|
147
|
+
};
|
|
148
|
+
transformer: _trpc_server.DefaultDataTransformer;
|
|
149
|
+
}>, {
|
|
150
|
+
groups: _trpc_server.CreateRouterInner<_trpc_server.RootConfig<{
|
|
151
|
+
ctx: {
|
|
152
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
153
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
154
|
+
userId: string;
|
|
155
|
+
};
|
|
156
|
+
meta: object;
|
|
157
|
+
errorShape: {
|
|
158
|
+
data: {
|
|
159
|
+
zodError: zod.typeToFlattenedError<any, string> | null;
|
|
160
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_KEY;
|
|
161
|
+
httpStatus: number;
|
|
162
|
+
path?: string;
|
|
163
|
+
stack?: string;
|
|
164
|
+
};
|
|
165
|
+
message: string;
|
|
166
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_NUMBER;
|
|
167
|
+
};
|
|
168
|
+
transformer: _trpc_server.DefaultDataTransformer;
|
|
169
|
+
}>, {
|
|
170
|
+
getAll: _trpc_server.BuildProcedure<"query", {
|
|
171
|
+
_config: _trpc_server.RootConfig<{
|
|
172
|
+
ctx: {
|
|
173
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
174
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
175
|
+
userId: string;
|
|
176
|
+
};
|
|
177
|
+
meta: object;
|
|
178
|
+
errorShape: {
|
|
179
|
+
data: {
|
|
180
|
+
zodError: zod.typeToFlattenedError<any, string> | null;
|
|
181
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_KEY;
|
|
182
|
+
httpStatus: number;
|
|
183
|
+
path?: string;
|
|
184
|
+
stack?: string;
|
|
185
|
+
};
|
|
186
|
+
message: string;
|
|
187
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_NUMBER;
|
|
188
|
+
};
|
|
189
|
+
transformer: _trpc_server.DefaultDataTransformer;
|
|
190
|
+
}>;
|
|
191
|
+
_meta: object;
|
|
192
|
+
_ctx_out: {
|
|
193
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
194
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
195
|
+
userId: string;
|
|
196
|
+
};
|
|
197
|
+
_input_in: typeof _trpc_server.unsetMarker;
|
|
198
|
+
_input_out: typeof _trpc_server.unsetMarker;
|
|
199
|
+
_output_in: typeof _trpc_server.unsetMarker;
|
|
200
|
+
_output_out: typeof _trpc_server.unsetMarker;
|
|
201
|
+
}, {
|
|
202
|
+
updatedAt: Date | null;
|
|
203
|
+
createdAt: Date;
|
|
204
|
+
id: number;
|
|
205
|
+
telegramId: number;
|
|
206
|
+
title: string;
|
|
207
|
+
link: string | null;
|
|
208
|
+
}[]>;
|
|
209
|
+
search: _trpc_server.BuildProcedure<"query", {
|
|
210
|
+
_config: _trpc_server.RootConfig<{
|
|
211
|
+
ctx: {
|
|
212
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
213
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
214
|
+
userId: string;
|
|
215
|
+
};
|
|
216
|
+
meta: object;
|
|
217
|
+
errorShape: {
|
|
218
|
+
data: {
|
|
219
|
+
zodError: zod.typeToFlattenedError<any, string> | null;
|
|
220
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_KEY;
|
|
221
|
+
httpStatus: number;
|
|
222
|
+
path?: string;
|
|
223
|
+
stack?: string;
|
|
224
|
+
};
|
|
225
|
+
message: string;
|
|
226
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_NUMBER;
|
|
227
|
+
};
|
|
228
|
+
transformer: _trpc_server.DefaultDataTransformer;
|
|
229
|
+
}>;
|
|
230
|
+
_meta: object;
|
|
231
|
+
_ctx_out: {
|
|
232
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
233
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
234
|
+
userId: string;
|
|
235
|
+
};
|
|
236
|
+
_input_in: {
|
|
237
|
+
query: string;
|
|
238
|
+
};
|
|
239
|
+
_input_out: {
|
|
240
|
+
query: string;
|
|
241
|
+
};
|
|
242
|
+
_output_in: typeof _trpc_server.unsetMarker;
|
|
243
|
+
_output_out: typeof _trpc_server.unsetMarker;
|
|
244
|
+
}, {
|
|
245
|
+
link: string | null;
|
|
246
|
+
id: number;
|
|
247
|
+
telegramId: number;
|
|
248
|
+
title: string;
|
|
249
|
+
updatedAt: Date | null;
|
|
250
|
+
createdAt: Date;
|
|
251
|
+
}[]>;
|
|
252
|
+
getById: _trpc_server.BuildProcedure<"query", {
|
|
253
|
+
_config: _trpc_server.RootConfig<{
|
|
254
|
+
ctx: {
|
|
255
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
256
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
257
|
+
userId: string;
|
|
258
|
+
};
|
|
259
|
+
meta: object;
|
|
260
|
+
errorShape: {
|
|
261
|
+
data: {
|
|
262
|
+
zodError: zod.typeToFlattenedError<any, string> | null;
|
|
263
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_KEY;
|
|
264
|
+
httpStatus: number;
|
|
265
|
+
path?: string;
|
|
266
|
+
stack?: string;
|
|
267
|
+
};
|
|
268
|
+
message: string;
|
|
269
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_NUMBER;
|
|
270
|
+
};
|
|
271
|
+
transformer: _trpc_server.DefaultDataTransformer;
|
|
272
|
+
}>;
|
|
273
|
+
_meta: object;
|
|
274
|
+
_ctx_out: {
|
|
275
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
276
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
277
|
+
userId: string;
|
|
278
|
+
};
|
|
279
|
+
_input_in: {
|
|
280
|
+
telegramId: number;
|
|
281
|
+
};
|
|
282
|
+
_input_out: {
|
|
283
|
+
telegramId: number;
|
|
284
|
+
};
|
|
285
|
+
_output_in: typeof _trpc_server.unsetMarker;
|
|
286
|
+
_output_out: typeof _trpc_server.unsetMarker;
|
|
287
|
+
}, {
|
|
288
|
+
link: string | null;
|
|
289
|
+
id: number;
|
|
290
|
+
telegramId: number;
|
|
291
|
+
title: string;
|
|
292
|
+
updatedAt: Date | null;
|
|
293
|
+
createdAt: Date;
|
|
294
|
+
} | undefined>;
|
|
295
|
+
create: _trpc_server.BuildProcedure<"mutation", {
|
|
296
|
+
_config: _trpc_server.RootConfig<{
|
|
297
|
+
ctx: {
|
|
298
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
299
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
300
|
+
userId: string;
|
|
301
|
+
};
|
|
302
|
+
meta: object;
|
|
303
|
+
errorShape: {
|
|
304
|
+
data: {
|
|
305
|
+
zodError: zod.typeToFlattenedError<any, string> | null;
|
|
306
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_KEY;
|
|
307
|
+
httpStatus: number;
|
|
308
|
+
path?: string;
|
|
309
|
+
stack?: string;
|
|
310
|
+
};
|
|
311
|
+
message: string;
|
|
312
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_NUMBER;
|
|
313
|
+
};
|
|
314
|
+
transformer: _trpc_server.DefaultDataTransformer;
|
|
315
|
+
}>;
|
|
316
|
+
_meta: object;
|
|
317
|
+
_ctx_out: {
|
|
318
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
319
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
320
|
+
userId: string;
|
|
321
|
+
};
|
|
322
|
+
_input_in: {
|
|
323
|
+
link: string;
|
|
324
|
+
telegramId: number;
|
|
325
|
+
title: string;
|
|
326
|
+
}[];
|
|
327
|
+
_input_out: {
|
|
328
|
+
link: string;
|
|
329
|
+
telegramId: number;
|
|
330
|
+
title: string;
|
|
331
|
+
}[];
|
|
332
|
+
_output_in: typeof _trpc_server.unsetMarker;
|
|
333
|
+
_output_out: typeof _trpc_server.unsetMarker;
|
|
334
|
+
}, number[]>;
|
|
335
|
+
}>;
|
|
336
|
+
}>;
|
|
337
|
+
}>;
|
|
338
|
+
type AppRouter = typeof appRouter;
|
|
339
|
+
|
|
340
|
+
export { type AppRouter, TRPC_PATH };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import * as _trpc_server from '@trpc/server';
|
|
2
|
+
import * as _trpc_server_rpc from '@trpc/server/rpc';
|
|
3
|
+
import * as zod from 'zod';
|
|
4
|
+
import * as fastify_types_type_provider from 'fastify/types/type-provider';
|
|
5
|
+
import * as http from 'http';
|
|
6
|
+
import * as fastify from 'fastify';
|
|
7
|
+
|
|
8
|
+
declare const TRPC_PATH = "/api/trpc";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* This is the primary router for your server.
|
|
12
|
+
*
|
|
13
|
+
* All routers added in /api/routers should be manually added here.
|
|
14
|
+
*/
|
|
15
|
+
declare const appRouter: _trpc_server.CreateRouterInner<_trpc_server.RootConfig<{
|
|
16
|
+
ctx: {
|
|
17
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
18
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
19
|
+
userId: string;
|
|
20
|
+
};
|
|
21
|
+
meta: object;
|
|
22
|
+
errorShape: {
|
|
23
|
+
data: {
|
|
24
|
+
zodError: zod.typeToFlattenedError<any, string> | null;
|
|
25
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_KEY;
|
|
26
|
+
httpStatus: number;
|
|
27
|
+
path?: string;
|
|
28
|
+
stack?: string;
|
|
29
|
+
};
|
|
30
|
+
message: string;
|
|
31
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_NUMBER;
|
|
32
|
+
};
|
|
33
|
+
transformer: _trpc_server.DefaultDataTransformer;
|
|
34
|
+
}>, {
|
|
35
|
+
test: _trpc_server.CreateRouterInner<_trpc_server.RootConfig<{
|
|
36
|
+
ctx: {
|
|
37
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
38
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
39
|
+
userId: string;
|
|
40
|
+
};
|
|
41
|
+
meta: object;
|
|
42
|
+
errorShape: {
|
|
43
|
+
data: {
|
|
44
|
+
zodError: zod.typeToFlattenedError<any, string> | null;
|
|
45
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_KEY;
|
|
46
|
+
httpStatus: number;
|
|
47
|
+
path?: string;
|
|
48
|
+
stack?: string;
|
|
49
|
+
};
|
|
50
|
+
message: string;
|
|
51
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_NUMBER;
|
|
52
|
+
};
|
|
53
|
+
transformer: _trpc_server.DefaultDataTransformer;
|
|
54
|
+
}>, {
|
|
55
|
+
dbQuery: _trpc_server.BuildProcedure<"query", {
|
|
56
|
+
_config: _trpc_server.RootConfig<{
|
|
57
|
+
ctx: {
|
|
58
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
59
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
60
|
+
userId: string;
|
|
61
|
+
};
|
|
62
|
+
meta: object;
|
|
63
|
+
errorShape: {
|
|
64
|
+
data: {
|
|
65
|
+
zodError: zod.typeToFlattenedError<any, string> | null;
|
|
66
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_KEY;
|
|
67
|
+
httpStatus: number;
|
|
68
|
+
path?: string;
|
|
69
|
+
stack?: string;
|
|
70
|
+
};
|
|
71
|
+
message: string;
|
|
72
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_NUMBER;
|
|
73
|
+
};
|
|
74
|
+
transformer: _trpc_server.DefaultDataTransformer;
|
|
75
|
+
}>;
|
|
76
|
+
_meta: object;
|
|
77
|
+
_ctx_out: {
|
|
78
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
79
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
80
|
+
userId: string;
|
|
81
|
+
};
|
|
82
|
+
_input_in: {
|
|
83
|
+
dbName: "web" | "tg";
|
|
84
|
+
};
|
|
85
|
+
_input_out: {
|
|
86
|
+
dbName: "web" | "tg";
|
|
87
|
+
};
|
|
88
|
+
_output_in: typeof _trpc_server.unsetMarker;
|
|
89
|
+
_output_out: typeof _trpc_server.unsetMarker;
|
|
90
|
+
}, string[]>;
|
|
91
|
+
dbInsert: _trpc_server.BuildProcedure<"mutation", {
|
|
92
|
+
_config: _trpc_server.RootConfig<{
|
|
93
|
+
ctx: {
|
|
94
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
95
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
96
|
+
userId: string;
|
|
97
|
+
};
|
|
98
|
+
meta: object;
|
|
99
|
+
errorShape: {
|
|
100
|
+
data: {
|
|
101
|
+
zodError: zod.typeToFlattenedError<any, string> | null;
|
|
102
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_KEY;
|
|
103
|
+
httpStatus: number;
|
|
104
|
+
path?: string;
|
|
105
|
+
stack?: string;
|
|
106
|
+
};
|
|
107
|
+
message: string;
|
|
108
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_NUMBER;
|
|
109
|
+
};
|
|
110
|
+
transformer: _trpc_server.DefaultDataTransformer;
|
|
111
|
+
}>;
|
|
112
|
+
_meta: object;
|
|
113
|
+
_ctx_out: {
|
|
114
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
115
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
116
|
+
userId: string;
|
|
117
|
+
};
|
|
118
|
+
_input_in: {
|
|
119
|
+
text: string;
|
|
120
|
+
dbName: "web" | "tg";
|
|
121
|
+
};
|
|
122
|
+
_input_out: {
|
|
123
|
+
text: string;
|
|
124
|
+
dbName: "web" | "tg";
|
|
125
|
+
};
|
|
126
|
+
_output_in: typeof _trpc_server.unsetMarker;
|
|
127
|
+
_output_out: typeof _trpc_server.unsetMarker;
|
|
128
|
+
}, boolean>;
|
|
129
|
+
}>;
|
|
130
|
+
tg: _trpc_server.CreateRouterInner<_trpc_server.RootConfig<{
|
|
131
|
+
ctx: {
|
|
132
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
133
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
134
|
+
userId: string;
|
|
135
|
+
};
|
|
136
|
+
meta: object;
|
|
137
|
+
errorShape: {
|
|
138
|
+
data: {
|
|
139
|
+
zodError: zod.typeToFlattenedError<any, string> | null;
|
|
140
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_KEY;
|
|
141
|
+
httpStatus: number;
|
|
142
|
+
path?: string;
|
|
143
|
+
stack?: string;
|
|
144
|
+
};
|
|
145
|
+
message: string;
|
|
146
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_NUMBER;
|
|
147
|
+
};
|
|
148
|
+
transformer: _trpc_server.DefaultDataTransformer;
|
|
149
|
+
}>, {
|
|
150
|
+
groups: _trpc_server.CreateRouterInner<_trpc_server.RootConfig<{
|
|
151
|
+
ctx: {
|
|
152
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
153
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
154
|
+
userId: string;
|
|
155
|
+
};
|
|
156
|
+
meta: object;
|
|
157
|
+
errorShape: {
|
|
158
|
+
data: {
|
|
159
|
+
zodError: zod.typeToFlattenedError<any, string> | null;
|
|
160
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_KEY;
|
|
161
|
+
httpStatus: number;
|
|
162
|
+
path?: string;
|
|
163
|
+
stack?: string;
|
|
164
|
+
};
|
|
165
|
+
message: string;
|
|
166
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_NUMBER;
|
|
167
|
+
};
|
|
168
|
+
transformer: _trpc_server.DefaultDataTransformer;
|
|
169
|
+
}>, {
|
|
170
|
+
getAll: _trpc_server.BuildProcedure<"query", {
|
|
171
|
+
_config: _trpc_server.RootConfig<{
|
|
172
|
+
ctx: {
|
|
173
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
174
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
175
|
+
userId: string;
|
|
176
|
+
};
|
|
177
|
+
meta: object;
|
|
178
|
+
errorShape: {
|
|
179
|
+
data: {
|
|
180
|
+
zodError: zod.typeToFlattenedError<any, string> | null;
|
|
181
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_KEY;
|
|
182
|
+
httpStatus: number;
|
|
183
|
+
path?: string;
|
|
184
|
+
stack?: string;
|
|
185
|
+
};
|
|
186
|
+
message: string;
|
|
187
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_NUMBER;
|
|
188
|
+
};
|
|
189
|
+
transformer: _trpc_server.DefaultDataTransformer;
|
|
190
|
+
}>;
|
|
191
|
+
_meta: object;
|
|
192
|
+
_ctx_out: {
|
|
193
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
194
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
195
|
+
userId: string;
|
|
196
|
+
};
|
|
197
|
+
_input_in: typeof _trpc_server.unsetMarker;
|
|
198
|
+
_input_out: typeof _trpc_server.unsetMarker;
|
|
199
|
+
_output_in: typeof _trpc_server.unsetMarker;
|
|
200
|
+
_output_out: typeof _trpc_server.unsetMarker;
|
|
201
|
+
}, {
|
|
202
|
+
updatedAt: Date | null;
|
|
203
|
+
createdAt: Date;
|
|
204
|
+
id: number;
|
|
205
|
+
telegramId: number;
|
|
206
|
+
title: string;
|
|
207
|
+
link: string | null;
|
|
208
|
+
}[]>;
|
|
209
|
+
search: _trpc_server.BuildProcedure<"query", {
|
|
210
|
+
_config: _trpc_server.RootConfig<{
|
|
211
|
+
ctx: {
|
|
212
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
213
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
214
|
+
userId: string;
|
|
215
|
+
};
|
|
216
|
+
meta: object;
|
|
217
|
+
errorShape: {
|
|
218
|
+
data: {
|
|
219
|
+
zodError: zod.typeToFlattenedError<any, string> | null;
|
|
220
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_KEY;
|
|
221
|
+
httpStatus: number;
|
|
222
|
+
path?: string;
|
|
223
|
+
stack?: string;
|
|
224
|
+
};
|
|
225
|
+
message: string;
|
|
226
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_NUMBER;
|
|
227
|
+
};
|
|
228
|
+
transformer: _trpc_server.DefaultDataTransformer;
|
|
229
|
+
}>;
|
|
230
|
+
_meta: object;
|
|
231
|
+
_ctx_out: {
|
|
232
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
233
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
234
|
+
userId: string;
|
|
235
|
+
};
|
|
236
|
+
_input_in: {
|
|
237
|
+
query: string;
|
|
238
|
+
};
|
|
239
|
+
_input_out: {
|
|
240
|
+
query: string;
|
|
241
|
+
};
|
|
242
|
+
_output_in: typeof _trpc_server.unsetMarker;
|
|
243
|
+
_output_out: typeof _trpc_server.unsetMarker;
|
|
244
|
+
}, {
|
|
245
|
+
link: string | null;
|
|
246
|
+
id: number;
|
|
247
|
+
telegramId: number;
|
|
248
|
+
title: string;
|
|
249
|
+
updatedAt: Date | null;
|
|
250
|
+
createdAt: Date;
|
|
251
|
+
}[]>;
|
|
252
|
+
getById: _trpc_server.BuildProcedure<"query", {
|
|
253
|
+
_config: _trpc_server.RootConfig<{
|
|
254
|
+
ctx: {
|
|
255
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
256
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
257
|
+
userId: string;
|
|
258
|
+
};
|
|
259
|
+
meta: object;
|
|
260
|
+
errorShape: {
|
|
261
|
+
data: {
|
|
262
|
+
zodError: zod.typeToFlattenedError<any, string> | null;
|
|
263
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_KEY;
|
|
264
|
+
httpStatus: number;
|
|
265
|
+
path?: string;
|
|
266
|
+
stack?: string;
|
|
267
|
+
};
|
|
268
|
+
message: string;
|
|
269
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_NUMBER;
|
|
270
|
+
};
|
|
271
|
+
transformer: _trpc_server.DefaultDataTransformer;
|
|
272
|
+
}>;
|
|
273
|
+
_meta: object;
|
|
274
|
+
_ctx_out: {
|
|
275
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
276
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
277
|
+
userId: string;
|
|
278
|
+
};
|
|
279
|
+
_input_in: {
|
|
280
|
+
telegramId: number;
|
|
281
|
+
};
|
|
282
|
+
_input_out: {
|
|
283
|
+
telegramId: number;
|
|
284
|
+
};
|
|
285
|
+
_output_in: typeof _trpc_server.unsetMarker;
|
|
286
|
+
_output_out: typeof _trpc_server.unsetMarker;
|
|
287
|
+
}, {
|
|
288
|
+
link: string | null;
|
|
289
|
+
id: number;
|
|
290
|
+
telegramId: number;
|
|
291
|
+
title: string;
|
|
292
|
+
updatedAt: Date | null;
|
|
293
|
+
createdAt: Date;
|
|
294
|
+
} | undefined>;
|
|
295
|
+
create: _trpc_server.BuildProcedure<"mutation", {
|
|
296
|
+
_config: _trpc_server.RootConfig<{
|
|
297
|
+
ctx: {
|
|
298
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
299
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
300
|
+
userId: string;
|
|
301
|
+
};
|
|
302
|
+
meta: object;
|
|
303
|
+
errorShape: {
|
|
304
|
+
data: {
|
|
305
|
+
zodError: zod.typeToFlattenedError<any, string> | null;
|
|
306
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_KEY;
|
|
307
|
+
httpStatus: number;
|
|
308
|
+
path?: string;
|
|
309
|
+
stack?: string;
|
|
310
|
+
};
|
|
311
|
+
message: string;
|
|
312
|
+
code: _trpc_server_rpc.TRPC_ERROR_CODE_NUMBER;
|
|
313
|
+
};
|
|
314
|
+
transformer: _trpc_server.DefaultDataTransformer;
|
|
315
|
+
}>;
|
|
316
|
+
_meta: object;
|
|
317
|
+
_ctx_out: {
|
|
318
|
+
req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypeProviderDefault, fastify.FastifySchema, fastify.RouteGenericInterface>>;
|
|
319
|
+
res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
|
|
320
|
+
userId: string;
|
|
321
|
+
};
|
|
322
|
+
_input_in: {
|
|
323
|
+
link: string;
|
|
324
|
+
telegramId: number;
|
|
325
|
+
title: string;
|
|
326
|
+
}[];
|
|
327
|
+
_input_out: {
|
|
328
|
+
link: string;
|
|
329
|
+
telegramId: number;
|
|
330
|
+
title: string;
|
|
331
|
+
}[];
|
|
332
|
+
_output_in: typeof _trpc_server.unsetMarker;
|
|
333
|
+
_output_out: typeof _trpc_server.unsetMarker;
|
|
334
|
+
}, number[]>;
|
|
335
|
+
}>;
|
|
336
|
+
}>;
|
|
337
|
+
}>;
|
|
338
|
+
type AppRouter = typeof appRouter;
|
|
339
|
+
|
|
340
|
+
export { type AppRouter, TRPC_PATH };
|
package/package.json
CHANGED
|
@@ -1,33 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polinetwork/backend",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "lib/index.js",
|
|
6
|
-
"types": "lib/index.d.ts",
|
|
7
|
-
"module": "lib/index.esm.js",
|
|
8
|
-
"files": [
|
|
9
|
-
"lib"
|
|
10
|
-
],
|
|
11
|
-
"private": false,
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Utils to interact with the backend.",
|
|
12
5
|
"keywords": [],
|
|
13
6
|
"author": "PoliNetwork APS",
|
|
14
7
|
"license": "ISC",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"main": "dist/index.cjs",
|
|
10
|
+
"module": "dist/index.js",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"require": "./dist/index.cjs",
|
|
18
|
+
"import": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
15
21
|
"devDependencies": {
|
|
16
|
-
"
|
|
17
|
-
"
|
|
22
|
+
"copyfiles": "^2.4.1",
|
|
23
|
+
"rimraf": "^6.0.1",
|
|
18
24
|
"tsup": "^8.3.6",
|
|
19
|
-
"
|
|
20
|
-
"typescript": "^5.7.3"
|
|
21
|
-
},
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"@trpc/server": "^10.45.2",
|
|
24
|
-
"fastify": "^5.2.1",
|
|
25
|
-
"zod": "^3.24.1"
|
|
25
|
+
"typescript": "^4.9.4"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
|
-
"build
|
|
29
|
-
"build:npm": "NODE_ENV=production tsup",
|
|
30
|
-
"dev": "NODE_ENV=development tsx watch src/server.ts",
|
|
31
|
-
"start": "NODE_ENV=production node dist/index.js"
|
|
28
|
+
"build": "cd ../backend && pnpm install && pnpm run build:npm && cd ../package && copyfiles -u 3 ../backend/lib/* dist"
|
|
32
29
|
}
|
|
33
30
|
}
|
package/README.md
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# Backend
|
|
2
|
-
|
|
3
|
-
> [!NOTE]
|
|
4
|
-
> ### WIP
|
|
5
|
-
> This is a rewrite currently WIP that will take time. Drink a coffee and join us if you would like to contribute.
|
|
6
|
-
|
|
7
|
-
Currently we are building a backend which can be reached by other services/repos with a tRPC client.
|
|
8
|
-
If you are using another language than TS... then you might fullfil a PR and implement gRPC (are you sure u want pain?).
|
package/lib/index.d.mts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as _trpc_server from '@trpc/server';
|
|
2
|
-
|
|
3
|
-
declare const TRPC_PATH = "/api/trpc";
|
|
4
|
-
|
|
5
|
-
declare const appRouter: _trpc_server.CreateRouterInner<_trpc_server.RootConfig<{
|
|
6
|
-
ctx: object;
|
|
7
|
-
meta: object;
|
|
8
|
-
errorShape: _trpc_server.DefaultErrorShape;
|
|
9
|
-
transformer: _trpc_server.DefaultDataTransformer;
|
|
10
|
-
}>, {
|
|
11
|
-
add: _trpc_server.BuildProcedure<"query", {
|
|
12
|
-
_config: _trpc_server.RootConfig<{
|
|
13
|
-
ctx: object;
|
|
14
|
-
meta: object;
|
|
15
|
-
errorShape: _trpc_server.DefaultErrorShape;
|
|
16
|
-
transformer: _trpc_server.DefaultDataTransformer;
|
|
17
|
-
}>;
|
|
18
|
-
_meta: object;
|
|
19
|
-
_ctx_out: object;
|
|
20
|
-
_input_in: number[];
|
|
21
|
-
_input_out: number[];
|
|
22
|
-
_output_in: typeof _trpc_server.unsetMarker;
|
|
23
|
-
_output_out: typeof _trpc_server.unsetMarker;
|
|
24
|
-
}, number>;
|
|
25
|
-
}>;
|
|
26
|
-
type AppRouter = typeof appRouter;
|
|
27
|
-
|
|
28
|
-
export { type AppRouter, TRPC_PATH };
|
package/lib/index.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as _trpc_server from '@trpc/server';
|
|
2
|
-
|
|
3
|
-
declare const TRPC_PATH = "/api/trpc";
|
|
4
|
-
|
|
5
|
-
declare const appRouter: _trpc_server.CreateRouterInner<_trpc_server.RootConfig<{
|
|
6
|
-
ctx: object;
|
|
7
|
-
meta: object;
|
|
8
|
-
errorShape: _trpc_server.DefaultErrorShape;
|
|
9
|
-
transformer: _trpc_server.DefaultDataTransformer;
|
|
10
|
-
}>, {
|
|
11
|
-
add: _trpc_server.BuildProcedure<"query", {
|
|
12
|
-
_config: _trpc_server.RootConfig<{
|
|
13
|
-
ctx: object;
|
|
14
|
-
meta: object;
|
|
15
|
-
errorShape: _trpc_server.DefaultErrorShape;
|
|
16
|
-
transformer: _trpc_server.DefaultDataTransformer;
|
|
17
|
-
}>;
|
|
18
|
-
_meta: object;
|
|
19
|
-
_ctx_out: object;
|
|
20
|
-
_input_in: number[];
|
|
21
|
-
_input_out: number[];
|
|
22
|
-
_output_in: typeof _trpc_server.unsetMarker;
|
|
23
|
-
_output_out: typeof _trpc_server.unsetMarker;
|
|
24
|
-
}, number>;
|
|
25
|
-
}>;
|
|
26
|
-
type AppRouter = typeof appRouter;
|
|
27
|
-
|
|
28
|
-
export { type AppRouter, TRPC_PATH };
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/constants.ts"],"sourcesContent":["export { TRPC_PATH } from \"./constants\"\nexport { type AppRouter } from \"./router\"\n","export const TRPC_PATH = \"/api/trpc\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,YAAY;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|