@polinetwork/backend 0.2.1 → 0.3.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/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @polinetwork/backend
2
+
3
+ See [this README](https://github.com/PoliNetworkOrg/backend#readme) for usage.
package/dist/index.d.cts CHANGED
@@ -122,12 +122,12 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
122
122
  query: string;
123
123
  };
124
124
  output: {
125
- link: string | null;
125
+ updatedAt: Date | null;
126
+ createdAt: Date;
126
127
  id: number;
127
128
  telegramId: number;
128
129
  title: string;
129
- updatedAt: Date | null;
130
- createdAt: Date;
130
+ link: string | null;
131
131
  }[];
132
132
  }>;
133
133
  getById: _trpc_server.TRPCQueryProcedure<{
@@ -135,13 +135,13 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
135
135
  telegramId: number;
136
136
  };
137
137
  output: {
138
- link: string | null;
138
+ updatedAt: Date | null;
139
+ createdAt: Date;
139
140
  id: number;
140
141
  telegramId: number;
141
142
  title: string;
142
- updatedAt: Date | null;
143
- createdAt: Date;
144
- } | undefined;
143
+ link: string | null;
144
+ }[];
145
145
  }>;
146
146
  create: _trpc_server.TRPCMutationProcedure<{
147
147
  input: {
@@ -152,6 +152,59 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
152
152
  output: number[];
153
153
  }>;
154
154
  }>>;
155
+ permissions: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
156
+ ctx: {
157
+ 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>>;
158
+ res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
159
+ userId: string;
160
+ };
161
+ meta: object;
162
+ errorShape: {
163
+ data: {
164
+ zodError: zod.typeToFlattenedError<any, string> | null;
165
+ code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_KEY;
166
+ httpStatus: number;
167
+ path?: string;
168
+ stack?: string;
169
+ };
170
+ message: string;
171
+ code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
172
+ };
173
+ transformer: false;
174
+ }, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<{
175
+ getRole: _trpc_server.TRPCQueryProcedure<{
176
+ input: {
177
+ userId: number;
178
+ };
179
+ output: {
180
+ userId: number;
181
+ role: string;
182
+ };
183
+ }>;
184
+ setRole: _trpc_server.TRPCQueryProcedure<{
185
+ input: {
186
+ userId: number;
187
+ role: "admin" | "hr" | "direttivo" | "owner";
188
+ adderId: number;
189
+ };
190
+ output: void;
191
+ }>;
192
+ checkGroup: _trpc_server.TRPCQueryProcedure<{
193
+ input: {
194
+ userId: number;
195
+ groupId: number;
196
+ };
197
+ output: boolean;
198
+ }>;
199
+ addGroup: _trpc_server.TRPCQueryProcedure<{
200
+ input: {
201
+ userId: number;
202
+ groupId: number;
203
+ adderId: number;
204
+ };
205
+ output: void;
206
+ }>;
207
+ }>>;
155
208
  }>>;
156
209
  }>>;
157
210
  type AppRouter = typeof appRouter;
package/dist/index.d.ts CHANGED
@@ -122,12 +122,12 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
122
122
  query: string;
123
123
  };
124
124
  output: {
125
- link: string | null;
125
+ updatedAt: Date | null;
126
+ createdAt: Date;
126
127
  id: number;
127
128
  telegramId: number;
128
129
  title: string;
129
- updatedAt: Date | null;
130
- createdAt: Date;
130
+ link: string | null;
131
131
  }[];
132
132
  }>;
133
133
  getById: _trpc_server.TRPCQueryProcedure<{
@@ -135,13 +135,13 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
135
135
  telegramId: number;
136
136
  };
137
137
  output: {
138
- link: string | null;
138
+ updatedAt: Date | null;
139
+ createdAt: Date;
139
140
  id: number;
140
141
  telegramId: number;
141
142
  title: string;
142
- updatedAt: Date | null;
143
- createdAt: Date;
144
- } | undefined;
143
+ link: string | null;
144
+ }[];
145
145
  }>;
146
146
  create: _trpc_server.TRPCMutationProcedure<{
147
147
  input: {
@@ -152,6 +152,59 @@ declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
152
152
  output: number[];
153
153
  }>;
154
154
  }>>;
155
+ permissions: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
156
+ ctx: {
157
+ 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>>;
158
+ res: fastify.FastifyReply<fastify.RouteGenericInterface, fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, unknown, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown>;
159
+ userId: string;
160
+ };
161
+ meta: object;
162
+ errorShape: {
163
+ data: {
164
+ zodError: zod.typeToFlattenedError<any, string> | null;
165
+ code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_KEY;
166
+ httpStatus: number;
167
+ path?: string;
168
+ stack?: string;
169
+ };
170
+ message: string;
171
+ code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
172
+ };
173
+ transformer: false;
174
+ }, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<{
175
+ getRole: _trpc_server.TRPCQueryProcedure<{
176
+ input: {
177
+ userId: number;
178
+ };
179
+ output: {
180
+ userId: number;
181
+ role: string;
182
+ };
183
+ }>;
184
+ setRole: _trpc_server.TRPCQueryProcedure<{
185
+ input: {
186
+ userId: number;
187
+ role: "admin" | "hr" | "direttivo" | "owner";
188
+ adderId: number;
189
+ };
190
+ output: void;
191
+ }>;
192
+ checkGroup: _trpc_server.TRPCQueryProcedure<{
193
+ input: {
194
+ userId: number;
195
+ groupId: number;
196
+ };
197
+ output: boolean;
198
+ }>;
199
+ addGroup: _trpc_server.TRPCQueryProcedure<{
200
+ input: {
201
+ userId: number;
202
+ groupId: number;
203
+ adderId: number;
204
+ };
205
+ output: void;
206
+ }>;
207
+ }>>;
155
208
  }>>;
156
209
  }>>;
157
210
  type AppRouter = typeof appRouter;
package/package.json CHANGED
@@ -1,8 +1,17 @@
1
1
  {
2
2
  "name": "@polinetwork/backend",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Utils to interact with the backend.",
5
- "keywords": [],
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/PoliNetworkOrg/backend.git"
8
+ },
9
+ "homepage": "https://github.com/PoliNetworkOrg/backend#readme",
10
+ "keywords": [
11
+ "polinetwork",
12
+ "polinetwork backend",
13
+ "polinetwork trpc"
14
+ ],
6
15
  "author": "PoliNetwork APS",
7
16
  "license": "ISC",
8
17
  "main": "dist/index.cjs",
@@ -24,6 +33,10 @@
24
33
  "tsup": "^8.3.6",
25
34
  "typescript": "^4.9.4"
26
35
  },
36
+ "engines": {
37
+ "npm": ">=10.9.2",
38
+ "node": ">=22.14.0"
39
+ },
27
40
  "scripts": {
28
41
  "build": "rimraf ./dist && cd ../backend && pnpm install && pnpm run build:npm && cd ../package && copyfiles -u 3 ../backend/lib/* dist"
29
42
  }