@faasjs/http 8.0.0-beta.4 → 8.0.0-beta.6
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 +1 -1
- package/dist/index.cjs +0 -8
- package/dist/index.d.ts +17 -22
- package/dist/index.mjs +2 -9
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -14,7 +14,6 @@ npm install @faasjs/http
|
|
|
14
14
|
## Functions
|
|
15
15
|
|
|
16
16
|
- [useHttp](functions/useHttp.md)
|
|
17
|
-
- [useHttpFunc](functions/useHttpFunc.md)
|
|
18
17
|
|
|
19
18
|
## Classes
|
|
20
19
|
|
|
@@ -29,6 +28,7 @@ npm install @faasjs/http
|
|
|
29
28
|
- [HttpConfig](type-aliases/HttpConfig.md)
|
|
30
29
|
- [HttpFuncHandler](type-aliases/HttpFuncHandler.md)
|
|
31
30
|
- [Response](type-aliases/Response.md)
|
|
31
|
+
- [SessionContent](type-aliases/SessionContent.md)
|
|
32
32
|
- [SessionOptions](type-aliases/SessionOptions.md)
|
|
33
33
|
|
|
34
34
|
## Variables
|
package/dist/index.cjs
CHANGED
|
@@ -442,13 +442,6 @@ var Http = class {
|
|
|
442
442
|
function useHttp(config) {
|
|
443
443
|
return func.usePlugin(new Http(config));
|
|
444
444
|
}
|
|
445
|
-
function useHttpFunc(handler, config) {
|
|
446
|
-
const func$1 = func.useFunc(() => {
|
|
447
|
-
useHttp(config?.http);
|
|
448
|
-
return handler();
|
|
449
|
-
});
|
|
450
|
-
return func$1;
|
|
451
|
-
}
|
|
452
445
|
|
|
453
446
|
exports.ContentType = ContentType;
|
|
454
447
|
exports.Cookie = Cookie;
|
|
@@ -456,4 +449,3 @@ exports.Http = Http;
|
|
|
456
449
|
exports.HttpError = HttpError;
|
|
457
450
|
exports.Session = Session;
|
|
458
451
|
exports.useHttp = useHttp;
|
|
459
|
-
exports.useHttpFunc = useHttpFunc;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as _faasjs_func from '@faasjs/func';
|
|
2
1
|
import { Plugin, MountData, Next, InvokeData, UseifyPlugin } from '@faasjs/func';
|
|
3
2
|
import { Logger } from '@faasjs/logger';
|
|
4
3
|
|
|
@@ -161,25 +160,21 @@ type HttpFuncHandler<TParams extends Record<string, any> = Record<string, any>,
|
|
|
161
160
|
cookie?: Cookie<TCookie, TSession>;
|
|
162
161
|
session?: Session<TSession, TCookie>;
|
|
163
162
|
}) => Promise<TResult>;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}): _faasjs_func.Func<{
|
|
181
|
-
[key: string]: any;
|
|
182
|
-
params?: TParams;
|
|
183
|
-
}, any, TResult>;
|
|
163
|
+
declare module '@faasjs/func' {
|
|
164
|
+
interface FaasPluginEventMap {
|
|
165
|
+
http: {
|
|
166
|
+
headers?: Record<string, any>;
|
|
167
|
+
body?: any;
|
|
168
|
+
params?: Record<string, any>;
|
|
169
|
+
queryString?: Record<string, any>;
|
|
170
|
+
httpMethod?: string;
|
|
171
|
+
path?: string;
|
|
172
|
+
raw?: {
|
|
173
|
+
request?: unknown;
|
|
174
|
+
response?: unknown;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
}
|
|
184
179
|
|
|
185
|
-
export { ContentType, Cookie, type CookieOptions, Http, type HttpConfig, HttpError, type HttpFuncHandler, type Response, Session, type SessionOptions, useHttp
|
|
180
|
+
export { ContentType, Cookie, type CookieOptions, Http, type HttpConfig, HttpError, type HttpFuncHandler, type Response, Session, type SessionContent, type SessionOptions, useHttp };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createBrotliCompress, createGzip, createDeflate } from 'zlib';
|
|
2
2
|
import { deepMerge } from '@faasjs/deep_merge';
|
|
3
|
-
import { usePlugin
|
|
3
|
+
import { usePlugin } from '@faasjs/func';
|
|
4
4
|
import { randomBytes, pbkdf2Sync, createCipheriv, createHmac, createDecipheriv } from 'crypto';
|
|
5
5
|
|
|
6
6
|
// src/index.ts
|
|
@@ -440,12 +440,5 @@ var Http = class {
|
|
|
440
440
|
function useHttp(config) {
|
|
441
441
|
return usePlugin(new Http(config));
|
|
442
442
|
}
|
|
443
|
-
function useHttpFunc(handler, config) {
|
|
444
|
-
const func = useFunc(() => {
|
|
445
|
-
useHttp(config?.http);
|
|
446
|
-
return handler();
|
|
447
|
-
});
|
|
448
|
-
return func;
|
|
449
|
-
}
|
|
450
443
|
|
|
451
|
-
export { ContentType, Cookie, Http, HttpError, Session, useHttp
|
|
444
|
+
export { ContentType, Cookie, Http, HttpError, Session, useHttp };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/http",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-beta.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"dist"
|
|
31
31
|
],
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@faasjs/func": ">=
|
|
34
|
-
"@faasjs/logger": ">=
|
|
33
|
+
"@faasjs/func": ">=8.0.0-beta.6",
|
|
34
|
+
"@faasjs/logger": ">=8.0.0-beta.6"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@faasjs/func": ">=
|
|
38
|
-
"@faasjs/logger": ">=
|
|
37
|
+
"@faasjs/func": ">=8.0.0-beta.6",
|
|
38
|
+
"@faasjs/logger": ">=8.0.0-beta.6"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": ">=24.0.0",
|