@polinetwork/backend 0.7.0 → 0.8.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/dist/index.d.cts CHANGED
@@ -7,6 +7,15 @@ import * as better_auth from 'better-auth';
7
7
  declare const TRPC_PATH = "/api/trpc";
8
8
  declare const AUTH_PATH = "/api/auth";
9
9
 
10
+ declare const AUDIT_TYPE: {
11
+ readonly BAN: "ban";
12
+ readonly KICK: "kick";
13
+ readonly MUTE: "mute";
14
+ readonly BAN_ALL: "ban_all";
15
+ readonly MUTE_ALL: "mute_all";
16
+ };
17
+ type TAuditType = (typeof AUDIT_TYPE)[keyof typeof AUDIT_TYPE];
18
+
10
19
  /**
11
20
  * This is the primary router for your server.
12
21
  *
@@ -292,6 +301,52 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
292
301
  };
293
302
  }>;
294
303
  }>>;
304
+ auditLog: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
305
+ ctx: {
306
+ userId?: string;
307
+ };
308
+ meta: object;
309
+ errorShape: {
310
+ data: {
311
+ zodError: zod.typeToFlattenedError<any, string> | null;
312
+ code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_KEY;
313
+ httpStatus: number;
314
+ path?: string;
315
+ stack?: string;
316
+ };
317
+ message: string;
318
+ code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
319
+ };
320
+ transformer: true;
321
+ }, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<{
322
+ create: _trpc_server.TRPCMutationProcedure<{
323
+ input: {
324
+ groupId: number | null;
325
+ adminId: number;
326
+ targetId: number;
327
+ type: "ban" | "kick" | "mute" | "ban_all" | "mute_all";
328
+ until: Date | null;
329
+ reason?: string | undefined;
330
+ };
331
+ output: void;
332
+ }>;
333
+ getById: _trpc_server.TRPCQueryProcedure<{
334
+ input: {
335
+ targetId: number;
336
+ };
337
+ output: {
338
+ updatedAt: Date | null;
339
+ createdAt: Date;
340
+ id: number;
341
+ adminId: number;
342
+ targetId: number;
343
+ groupId: number | null;
344
+ type: TAuditType;
345
+ until: Date | null;
346
+ reason: string | null;
347
+ }[];
348
+ }>;
349
+ }>>;
295
350
  }>>;
296
351
  }>>;
297
352
  type AppRouter = typeof appRouter;
package/dist/index.d.ts CHANGED
@@ -7,6 +7,15 @@ import * as better_auth from 'better-auth';
7
7
  declare const TRPC_PATH = "/api/trpc";
8
8
  declare const AUTH_PATH = "/api/auth";
9
9
 
10
+ declare const AUDIT_TYPE: {
11
+ readonly BAN: "ban";
12
+ readonly KICK: "kick";
13
+ readonly MUTE: "mute";
14
+ readonly BAN_ALL: "ban_all";
15
+ readonly MUTE_ALL: "mute_all";
16
+ };
17
+ type TAuditType = (typeof AUDIT_TYPE)[keyof typeof AUDIT_TYPE];
18
+
10
19
  /**
11
20
  * This is the primary router for your server.
12
21
  *
@@ -292,6 +301,52 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
292
301
  };
293
302
  }>;
294
303
  }>>;
304
+ auditLog: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
305
+ ctx: {
306
+ userId?: string;
307
+ };
308
+ meta: object;
309
+ errorShape: {
310
+ data: {
311
+ zodError: zod.typeToFlattenedError<any, string> | null;
312
+ code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_KEY;
313
+ httpStatus: number;
314
+ path?: string;
315
+ stack?: string;
316
+ };
317
+ message: string;
318
+ code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
319
+ };
320
+ transformer: true;
321
+ }, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<{
322
+ create: _trpc_server.TRPCMutationProcedure<{
323
+ input: {
324
+ groupId: number | null;
325
+ adminId: number;
326
+ targetId: number;
327
+ type: "ban" | "kick" | "mute" | "ban_all" | "mute_all";
328
+ until: Date | null;
329
+ reason?: string | undefined;
330
+ };
331
+ output: void;
332
+ }>;
333
+ getById: _trpc_server.TRPCQueryProcedure<{
334
+ input: {
335
+ targetId: number;
336
+ };
337
+ output: {
338
+ updatedAt: Date | null;
339
+ createdAt: Date;
340
+ id: number;
341
+ adminId: number;
342
+ targetId: number;
343
+ groupId: number | null;
344
+ type: TAuditType;
345
+ until: Date | null;
346
+ reason: string | null;
347
+ }[];
348
+ }>;
349
+ }>>;
295
350
  }>>;
296
351
  }>>;
297
352
  type AppRouter = typeof appRouter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polinetwork/backend",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Utils to interact with the backend.",
5
5
  "repository": {
6
6
  "type": "git",