@polinetwork/backend 0.5.3 → 0.6.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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/constants.ts"],"sourcesContent":["export { TRPC_PATH, AUTH_PATH } from \"./constants\"\nexport { type AppRouter } from \"./routers\"\nimport type { telegramPlugin } from \"./auth/plugins/telegram\"\n\nexport type TelegramPlugin = typeof telegramPlugin\n","export const TRPC_PATH = \"/api/trpc\";\nexport const AUTH_PATH = \"/api/auth\";\n\nexport const TRUSTED_ORIGINS = [\n \"http://localhost:3001\",\n \"http://localhost:3002\",\n \"http://localhost:3003\",\n \"http://localhost:5173\",\n \"http://localhost:5174\",\n \"http://localhost:5175\",\n]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,YAAY;AAClB,IAAM,YAAY;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/constants.ts"],"sourcesContent":["export { TRPC_PATH, AUTH_PATH } from \"./constants\"\nexport { type AppRouter } from \"./routers\"\nimport type { telegramPlugin } from \"./auth/plugins/telegram\"\n\nexport type TelegramPlugin = typeof telegramPlugin\n","export const TRPC_PATH = \"/api/trpc\";\nexport const AUTH_PATH = \"/api/auth\";\n\nexport const TRUSTED_ORIGINS = [\n \"http://localhost:3001\",\n \"http://localhost:3002\",\n \"http://localhost:3003\",\n \"http://localhost:5173\",\n \"http://localhost:5174\",\n \"http://localhost:5175\",\n]\n\nexport const MESSAGES_RETENTION_DAYS = 7\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,YAAY;AAClB,IAAM,YAAY;","names":[]}
package/dist/index.d.cts CHANGED
@@ -28,7 +28,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
28
28
  message: string;
29
29
  code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
30
30
  };
31
- transformer: false;
31
+ transformer: true;
32
32
  }, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<{
33
33
  test: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
34
34
  ctx: {
@@ -46,7 +46,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
46
46
  message: string;
47
47
  code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
48
48
  };
49
- transformer: false;
49
+ transformer: true;
50
50
  }, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<{
51
51
  dbQuery: _trpc_server.TRPCQueryProcedure<{
52
52
  input: {
@@ -78,7 +78,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
78
78
  message: string;
79
79
  code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
80
80
  };
81
- transformer: false;
81
+ transformer: true;
82
82
  }, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<{
83
83
  groups: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
84
84
  ctx: {
@@ -96,7 +96,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
96
96
  message: string;
97
97
  code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
98
98
  };
99
- transformer: false;
99
+ transformer: true;
100
100
  }, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<{
101
101
  getAll: _trpc_server.TRPCQueryProcedure<{
102
102
  input: void;
@@ -160,7 +160,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
160
160
  message: string;
161
161
  code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
162
162
  };
163
- transformer: false;
163
+ transformer: true;
164
164
  }, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<{
165
165
  getRole: _trpc_server.TRPCQueryProcedure<{
166
166
  input: {
@@ -211,7 +211,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
211
211
  message: string;
212
212
  code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
213
213
  };
214
- transformer: false;
214
+ transformer: true;
215
215
  }, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<{
216
216
  link: _trpc_server.TRPCQueryProcedure<{
217
217
  input: {
@@ -221,6 +221,62 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
221
221
  };
222
222
  output: {
223
223
  success: boolean;
224
+ error: string;
225
+ } | {
226
+ success: boolean;
227
+ error: undefined;
228
+ };
229
+ }>;
230
+ }>>;
231
+ messages: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
232
+ ctx: {
233
+ userId?: string;
234
+ };
235
+ meta: object;
236
+ errorShape: {
237
+ data: {
238
+ zodError: zod.typeToFlattenedError<any, string> | null;
239
+ code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_KEY;
240
+ httpStatus: number;
241
+ path?: string;
242
+ stack?: string;
243
+ };
244
+ message: string;
245
+ code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
246
+ };
247
+ transformer: true;
248
+ }, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<{
249
+ get: _trpc_server.TRPCQueryProcedure<{
250
+ input: {
251
+ chatId: number;
252
+ messageId: number;
253
+ };
254
+ output: {
255
+ error: null;
256
+ message: {
257
+ chatId: number;
258
+ messageId: number;
259
+ authorId: number;
260
+ timestamp: Date;
261
+ message: string;
262
+ };
263
+ } | {
264
+ error: "NOT_FOUND" | "DECRYPT_ERROR";
265
+ message: null;
266
+ };
267
+ }>;
268
+ add: _trpc_server.TRPCMutationProcedure<{
269
+ input: {
270
+ messages: {
271
+ chatId: number;
272
+ messageId: number;
273
+ authorId: number;
274
+ timestamp: Date;
275
+ message: string;
276
+ }[];
277
+ };
278
+ output: {
279
+ error: "ENCRYPT_ERROR" | null;
224
280
  };
225
281
  }>;
226
282
  }>>;
package/dist/index.d.ts CHANGED
@@ -28,7 +28,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
28
28
  message: string;
29
29
  code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
30
30
  };
31
- transformer: false;
31
+ transformer: true;
32
32
  }, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<{
33
33
  test: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
34
34
  ctx: {
@@ -46,7 +46,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
46
46
  message: string;
47
47
  code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
48
48
  };
49
- transformer: false;
49
+ transformer: true;
50
50
  }, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<{
51
51
  dbQuery: _trpc_server.TRPCQueryProcedure<{
52
52
  input: {
@@ -78,7 +78,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
78
78
  message: string;
79
79
  code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
80
80
  };
81
- transformer: false;
81
+ transformer: true;
82
82
  }, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<{
83
83
  groups: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
84
84
  ctx: {
@@ -96,7 +96,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
96
96
  message: string;
97
97
  code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
98
98
  };
99
- transformer: false;
99
+ transformer: true;
100
100
  }, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<{
101
101
  getAll: _trpc_server.TRPCQueryProcedure<{
102
102
  input: void;
@@ -160,7 +160,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
160
160
  message: string;
161
161
  code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
162
162
  };
163
- transformer: false;
163
+ transformer: true;
164
164
  }, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<{
165
165
  getRole: _trpc_server.TRPCQueryProcedure<{
166
166
  input: {
@@ -211,7 +211,7 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
211
211
  message: string;
212
212
  code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
213
213
  };
214
- transformer: false;
214
+ transformer: true;
215
215
  }, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<{
216
216
  link: _trpc_server.TRPCQueryProcedure<{
217
217
  input: {
@@ -221,6 +221,62 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
221
221
  };
222
222
  output: {
223
223
  success: boolean;
224
+ error: string;
225
+ } | {
226
+ success: boolean;
227
+ error: undefined;
228
+ };
229
+ }>;
230
+ }>>;
231
+ messages: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
232
+ ctx: {
233
+ userId?: string;
234
+ };
235
+ meta: object;
236
+ errorShape: {
237
+ data: {
238
+ zodError: zod.typeToFlattenedError<any, string> | null;
239
+ code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_KEY;
240
+ httpStatus: number;
241
+ path?: string;
242
+ stack?: string;
243
+ };
244
+ message: string;
245
+ code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
246
+ };
247
+ transformer: true;
248
+ }, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<{
249
+ get: _trpc_server.TRPCQueryProcedure<{
250
+ input: {
251
+ chatId: number;
252
+ messageId: number;
253
+ };
254
+ output: {
255
+ error: null;
256
+ message: {
257
+ chatId: number;
258
+ messageId: number;
259
+ authorId: number;
260
+ timestamp: Date;
261
+ message: string;
262
+ };
263
+ } | {
264
+ error: "NOT_FOUND" | "DECRYPT_ERROR";
265
+ message: null;
266
+ };
267
+ }>;
268
+ add: _trpc_server.TRPCMutationProcedure<{
269
+ input: {
270
+ messages: {
271
+ chatId: number;
272
+ messageId: number;
273
+ authorId: number;
274
+ timestamp: Date;
275
+ message: string;
276
+ }[];
277
+ };
278
+ output: {
279
+ error: "ENCRYPT_ERROR" | null;
224
280
  };
225
281
  }>;
226
282
  }>>;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/constants.ts"],"sourcesContent":["export const TRPC_PATH = \"/api/trpc\";\nexport const AUTH_PATH = \"/api/auth\";\n\nexport const TRUSTED_ORIGINS = [\n \"http://localhost:3001\",\n \"http://localhost:3002\",\n \"http://localhost:3003\",\n \"http://localhost:5173\",\n \"http://localhost:5174\",\n \"http://localhost:5175\",\n]\n"],"mappings":";AAAO,IAAM,YAAY;AAClB,IAAM,YAAY;","names":[]}
1
+ {"version":3,"sources":["../src/constants.ts"],"sourcesContent":["export const TRPC_PATH = \"/api/trpc\";\nexport const AUTH_PATH = \"/api/auth\";\n\nexport const TRUSTED_ORIGINS = [\n \"http://localhost:3001\",\n \"http://localhost:3002\",\n \"http://localhost:3003\",\n \"http://localhost:5173\",\n \"http://localhost:5174\",\n \"http://localhost:5175\",\n]\n\nexport const MESSAGES_RETENTION_DAYS = 7\n"],"mappings":";AAAO,IAAM,YAAY;AAClB,IAAM,YAAY;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polinetwork/backend",
3
- "version": "0.5.3",
3
+ "version": "0.6.0",
4
4
  "description": "Utils to interact with the backend.",
5
5
  "repository": {
6
6
  "type": "git",