@polinetwork/backend 0.5.1 → 0.5.3

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 CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as _trpc_server from '@trpc/server';
2
2
  import * as _trpc_server_unstable_core_do_not_import from '@trpc/server/unstable-core-do-not-import';
3
3
  import * as zod from 'zod';
4
+ import { z } from 'zod';
4
5
  import * as better_auth from 'better-auth';
5
6
 
6
7
  declare const TRPC_PATH = "/api/trpc";
@@ -246,8 +247,10 @@ declare const telegramPlugin: () => {
246
247
  };
247
248
  endpoints: {
248
249
  startLink: {
249
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0?: ({
250
- body?: undefined;
250
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
251
+ body: {
252
+ telegramUsername: string;
253
+ };
251
254
  } & {
252
255
  method?: "POST" | undefined;
253
256
  } & {
@@ -266,7 +269,7 @@ declare const telegramPlugin: () => {
266
269
  } & {
267
270
  asResponse?: AsResponse | undefined;
268
271
  returnHeaders?: ReturnHeaders | undefined;
269
- }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
272
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
270
273
  headers: Headers;
271
274
  response: better_auth.APIError | {
272
275
  code: string;
@@ -278,6 +281,36 @@ declare const telegramPlugin: () => {
278
281
  }>;
279
282
  options: {
280
283
  method: "POST";
284
+ use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
285
+ session: {
286
+ session: Record<string, any> & {
287
+ id: string;
288
+ createdAt: Date;
289
+ updatedAt: Date;
290
+ userId: string;
291
+ expiresAt: Date;
292
+ token: string;
293
+ ipAddress?: string | null | undefined;
294
+ userAgent?: string | null | undefined;
295
+ };
296
+ user: Record<string, any> & {
297
+ id: string;
298
+ name: string;
299
+ email: string;
300
+ emailVerified: boolean;
301
+ createdAt: Date;
302
+ updatedAt: Date;
303
+ image?: string | null | undefined;
304
+ };
305
+ };
306
+ }>)[];
307
+ body: z.ZodObject<{
308
+ telegramUsername: z.ZodEffects<z.ZodString, string, string>;
309
+ }, "strip", z.ZodTypeAny, {
310
+ telegramUsername: string;
311
+ }, {
312
+ telegramUsername: string;
313
+ }>;
281
314
  } & {
282
315
  use: any[];
283
316
  };
@@ -289,11 +322,11 @@ declare const telegramPlugin: () => {
289
322
  } & {
290
323
  method?: "GET" | undefined;
291
324
  } & {
292
- query?: Record<string, any> | undefined;
293
- } & {
294
- params: {
325
+ query: {
295
326
  code: string;
296
327
  };
328
+ } & {
329
+ params?: Record<string, any>;
297
330
  } & {
298
331
  request?: Request;
299
332
  } & {
@@ -318,10 +351,40 @@ declare const telegramPlugin: () => {
318
351
  }>;
319
352
  options: {
320
353
  method: "GET";
354
+ use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
355
+ session: {
356
+ session: Record<string, any> & {
357
+ id: string;
358
+ createdAt: Date;
359
+ updatedAt: Date;
360
+ userId: string;
361
+ expiresAt: Date;
362
+ token: string;
363
+ ipAddress?: string | null | undefined;
364
+ userAgent?: string | null | undefined;
365
+ };
366
+ user: Record<string, any> & {
367
+ id: string;
368
+ name: string;
369
+ email: string;
370
+ emailVerified: boolean;
371
+ createdAt: Date;
372
+ updatedAt: Date;
373
+ image?: string | null | undefined;
374
+ };
375
+ };
376
+ }>)[];
377
+ query: z.ZodObject<{
378
+ code: z.ZodString;
379
+ }, "strip", z.ZodTypeAny, {
380
+ code: string;
381
+ }, {
382
+ code: string;
383
+ }>;
321
384
  } & {
322
385
  use: any[];
323
386
  };
324
- path: "/telegram/link/verify/:code";
387
+ path: "/telegram/link/verify";
325
388
  };
326
389
  };
327
390
  };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as _trpc_server from '@trpc/server';
2
2
  import * as _trpc_server_unstable_core_do_not_import from '@trpc/server/unstable-core-do-not-import';
3
3
  import * as zod from 'zod';
4
+ import { z } from 'zod';
4
5
  import * as better_auth from 'better-auth';
5
6
 
6
7
  declare const TRPC_PATH = "/api/trpc";
@@ -246,8 +247,10 @@ declare const telegramPlugin: () => {
246
247
  };
247
248
  endpoints: {
248
249
  startLink: {
249
- <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0?: ({
250
- body?: undefined;
250
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
251
+ body: {
252
+ telegramUsername: string;
253
+ };
251
254
  } & {
252
255
  method?: "POST" | undefined;
253
256
  } & {
@@ -266,7 +269,7 @@ declare const telegramPlugin: () => {
266
269
  } & {
267
270
  asResponse?: AsResponse | undefined;
268
271
  returnHeaders?: ReturnHeaders | undefined;
269
- }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
272
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
270
273
  headers: Headers;
271
274
  response: better_auth.APIError | {
272
275
  code: string;
@@ -278,6 +281,36 @@ declare const telegramPlugin: () => {
278
281
  }>;
279
282
  options: {
280
283
  method: "POST";
284
+ use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
285
+ session: {
286
+ session: Record<string, any> & {
287
+ id: string;
288
+ createdAt: Date;
289
+ updatedAt: Date;
290
+ userId: string;
291
+ expiresAt: Date;
292
+ token: string;
293
+ ipAddress?: string | null | undefined;
294
+ userAgent?: string | null | undefined;
295
+ };
296
+ user: Record<string, any> & {
297
+ id: string;
298
+ name: string;
299
+ email: string;
300
+ emailVerified: boolean;
301
+ createdAt: Date;
302
+ updatedAt: Date;
303
+ image?: string | null | undefined;
304
+ };
305
+ };
306
+ }>)[];
307
+ body: z.ZodObject<{
308
+ telegramUsername: z.ZodEffects<z.ZodString, string, string>;
309
+ }, "strip", z.ZodTypeAny, {
310
+ telegramUsername: string;
311
+ }, {
312
+ telegramUsername: string;
313
+ }>;
281
314
  } & {
282
315
  use: any[];
283
316
  };
@@ -289,11 +322,11 @@ declare const telegramPlugin: () => {
289
322
  } & {
290
323
  method?: "GET" | undefined;
291
324
  } & {
292
- query?: Record<string, any> | undefined;
293
- } & {
294
- params: {
325
+ query: {
295
326
  code: string;
296
327
  };
328
+ } & {
329
+ params?: Record<string, any>;
297
330
  } & {
298
331
  request?: Request;
299
332
  } & {
@@ -318,10 +351,40 @@ declare const telegramPlugin: () => {
318
351
  }>;
319
352
  options: {
320
353
  method: "GET";
354
+ use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
355
+ session: {
356
+ session: Record<string, any> & {
357
+ id: string;
358
+ createdAt: Date;
359
+ updatedAt: Date;
360
+ userId: string;
361
+ expiresAt: Date;
362
+ token: string;
363
+ ipAddress?: string | null | undefined;
364
+ userAgent?: string | null | undefined;
365
+ };
366
+ user: Record<string, any> & {
367
+ id: string;
368
+ name: string;
369
+ email: string;
370
+ emailVerified: boolean;
371
+ createdAt: Date;
372
+ updatedAt: Date;
373
+ image?: string | null | undefined;
374
+ };
375
+ };
376
+ }>)[];
377
+ query: z.ZodObject<{
378
+ code: z.ZodString;
379
+ }, "strip", z.ZodTypeAny, {
380
+ code: string;
381
+ }, {
382
+ code: string;
383
+ }>;
321
384
  } & {
322
385
  use: any[];
323
386
  };
324
- path: "/telegram/link/verify/:code";
387
+ path: "/telegram/link/verify";
325
388
  };
326
389
  };
327
390
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polinetwork/backend",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "Utils to interact with the backend.",
5
5
  "repository": {
6
6
  "type": "git",