maxserver 0.2.1 → 0.2.2

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.
Files changed (2) hide show
  1. package/index.d.ts +14 -0
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -5,8 +5,22 @@ declare function maxserver(...args: any[]): any;
5
5
  export default maxserver;
6
6
 
7
7
  declare global {
8
+
9
+ var global: typeof globalThis;
10
+
11
+ /** Casts a string ID to a MongoDB ObjectId using the global helper [cite: 2026-02-15]. */
8
12
  var oid: (id: string) => import("mongodb").ObjectId;
13
+
14
+ /** Access to the global MongoDB database instance [cite: 2026-02-15]. */
9
15
  var db: import("mongodb").Db;
16
+
17
+ /**
18
+ * Creates an Error object with an attached HTTP status code [cite: 2026-02-15].
19
+ * Fastify catches this to return a structured JSON response.
20
+ * * @param code The HTTP status code (e.g., 400, 401, 403, 404).
21
+ * @param message The specific failure reason returned in the JSON body.
22
+ */
23
+ var createError: (code: number, message: string) => Error;
10
24
  }
11
25
 
12
26
  declare module "fastify" {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maxserver",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Node server setup based fastify",
5
5
  "author": "Max Matinpalo",
6
6
  "type": "module",