cpeak 2.6.0 → 2.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.
@@ -0,0 +1,51 @@
1
+ export interface PbkdfOptions {
2
+ iterations?: number;
3
+ keylen?: number;
4
+ digest?: string;
5
+ saltSize?: number;
6
+ }
7
+
8
+ export interface AuthOptions extends PbkdfOptions {
9
+ secret: string;
10
+ saveToken: (
11
+ tokenId: string,
12
+ userId: string,
13
+ expiresAt: Date
14
+ ) => Promise<void>;
15
+ findToken: (
16
+ tokenId: string
17
+ ) => Promise<{ userId: string; expiresAt: Date } | null>;
18
+ tokenExpiry?: number;
19
+ hmacAlgorithm?: string;
20
+ tokenIdSize?: number;
21
+ revokeToken?: (tokenId: string) => Promise<void>;
22
+ }
23
+
24
+ export interface CookieOptions {
25
+ signed?: boolean;
26
+ httpOnly?: boolean;
27
+ secure?: boolean;
28
+ sameSite?: "strict" | "lax" | "none";
29
+ maxAge?: number; // ms
30
+ expires?: Date;
31
+ path?: string;
32
+ domain?: string;
33
+ }
34
+
35
+ export type OriginInput =
36
+ | string
37
+ | string[]
38
+ | RegExp
39
+ | boolean
40
+ | ((origin: string | undefined) => boolean | Promise<boolean>);
41
+
42
+ export interface CorsOptions {
43
+ origin?: OriginInput;
44
+ methods?: string | string[];
45
+ allowedHeaders?: string | string[];
46
+ exposedHeaders?: string | string[];
47
+ credentials?: boolean;
48
+ maxAge?: number;
49
+ preflightContinue?: boolean;
50
+ optionsSuccessStatus?: number;
51
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cpeak",
3
- "version": "2.6.0",
3
+ "version": "2.8.0",
4
4
  "description": "A minimal and fast Node.js HTTP framework.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -10,12 +10,12 @@
10
10
  },
11
11
  "repository": {
12
12
  "type": "git",
13
- "url": "https://github.com/agile8118/cpeak.git"
13
+ "url": "https://github.com/Cododev-Technology/cpeak.git"
14
14
  },
15
15
  "bugs": {
16
- "url": "https://github.com/agile8118/cpeak/issues"
16
+ "url": "https://github.com/Cododev-Technology/cpeak/issues"
17
17
  },
18
- "homepage": "https://github.com/agile8118/cpeak#readme",
18
+ "homepage": "https://github.com/Cododev-Technology/cpeak#readme",
19
19
  "main": "./dist/index.js",
20
20
  "module": "./dist/index.js",
21
21
  "types": "./dist/index.d.ts",