autumn-js 0.0.44 → 0.0.46

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.
@@ -1,8 +1,11 @@
1
+ import { A as Autumn } from './client-C4aZxBxK.mjs';
1
2
  import { AuthResult } from './utils/AuthFunction.mjs';
3
+ import './response-ByHPEnHs.mjs';
2
4
 
3
5
  type AutumnRequestHandler = (req: any, res: any, next: any) => void;
4
6
  type AutumnHandlerOptions = {
5
7
  identify: (req: any) => AuthResult;
8
+ autumn?: (req: any) => Autumn | Autumn;
6
9
  version?: string;
7
10
  };
8
11
  declare const autumnHandler: (options?: AutumnHandlerOptions) => AutumnRequestHandler;
@@ -1,8 +1,11 @@
1
+ import { A as Autumn } from './client-DJJAbrX7.js';
1
2
  import { AuthResult } from './utils/AuthFunction.js';
3
+ import './response-ByHPEnHs.js';
2
4
 
3
5
  type AutumnRequestHandler = (req: any, res: any, next: any) => void;
4
6
  type AutumnHandlerOptions = {
5
7
  identify: (req: any) => AuthResult;
8
+ autumn?: (req: any) => Autumn | Autumn;
6
9
  version?: string;
7
10
  };
8
11
  declare const autumnHandler: (options?: AutumnHandlerOptions) => AutumnRequestHandler;
@@ -756,8 +756,9 @@ var autumnHandler = (options) => {
756
756
  }
757
757
  }
758
758
  try {
759
+ let autumnClient = typeof options?.autumn === "function" ? options.autumn(req) : options?.autumn || autumn;
759
760
  let result = await handler({
760
- autumn,
761
+ autumn: autumnClient,
761
762
  body,
762
763
  path: req.path,
763
764
  getCustomer: async () => {
@@ -40,8 +40,9 @@ var autumnHandler = (options) => {
40
40
  }
41
41
  }
42
42
  try {
43
+ let autumnClient = typeof options?.autumn === "function" ? options.autumn(req) : options?.autumn || autumn;
43
44
  let result = await handler({
44
- autumn,
45
+ autumn: autumnClient,
45
46
  body,
46
47
  path: req.path,
47
48
  getCustomer: async () => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "autumn-js",
3
3
  "description": "Autumn JS Library",
4
- "version": "0.0.44",
4
+ "version": "0.0.46",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
7
7
  "cli": "tsx src/cli/index.ts",
@@ -89,5 +89,30 @@
89
89
  },
90
90
  "dependencies": {
91
91
  "rou3": "^0.6.1"
92
+ },
93
+ "typesVersions": {
94
+ "*": {
95
+ "next": [
96
+ "./dist/next/index.d.ts"
97
+ ],
98
+ "hono": [
99
+ "./dist/libraries/backend/hono.d.ts"
100
+ ],
101
+ "express": [
102
+ "./dist/libraries/backend/express.d.ts"
103
+ ],
104
+ "fastify": [
105
+ "./dist/libraries/backend/fastify.d.ts"
106
+ ],
107
+ "remix": [
108
+ "./dist/libraries/backend/remix.d.ts"
109
+ ],
110
+ "tanstack": [
111
+ "./dist/libraries/backend/tanstack.d.ts"
112
+ ],
113
+ "react": [
114
+ "./dist/libraries/react/index.d.ts"
115
+ ]
116
+ }
92
117
  }
93
118
  }