maxserver 0.1.31 → 0.2.1
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/index.d.ts +48 -0
- package/package.json +2 -1
package/index.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import "fastify";
|
|
2
|
+
import "@fastify/jwt";
|
|
3
|
+
|
|
4
|
+
declare function maxserver(...args: any[]): any;
|
|
5
|
+
export default maxserver;
|
|
6
|
+
|
|
7
|
+
declare global {
|
|
8
|
+
var oid: (id: string) => import("mongodb").ObjectId;
|
|
9
|
+
var db: import("mongodb").Db;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare module "fastify" {
|
|
13
|
+
interface FastifyInstance {
|
|
14
|
+
maxserver: {
|
|
15
|
+
env?: string;
|
|
16
|
+
cors?: string | boolean | RegExp | Array<string | RegExp>;
|
|
17
|
+
secret?: string;
|
|
18
|
+
mongodb?: string;
|
|
19
|
+
static?: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface FastifyRequest {
|
|
24
|
+
userId: string | null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface FastifyContextConfig {
|
|
28
|
+
auth?: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface RouteShorthandOptions {
|
|
32
|
+
config?: FastifyContextConfig;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare module "@fastify/jwt" {
|
|
37
|
+
interface FastifyJWT {
|
|
38
|
+
user: {
|
|
39
|
+
sub?: string;
|
|
40
|
+
userId?: string;
|
|
41
|
+
userid?: string;
|
|
42
|
+
id?: string;
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "maxserver",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Node server setup based fastify",
|
|
5
5
|
"author": "Max Matinpalo",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
|
+
"types": "index.d.ts",
|
|
8
9
|
"homepage": "https://github.com/max-matinpalo/maxserver#readme",
|
|
9
10
|
"repository": {
|
|
10
11
|
"type": "git",
|