@faasjs/http 8.0.0-beta.4 → 8.0.0-beta.5
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 +0 -1
- package/dist/index.cjs +0 -8
- package/dist/index.d.ts +1 -22
- package/dist/index.mjs +2 -9
- package/package.json +5 -5
package/README.md
CHANGED
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,5 @@ 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
|
-
* A hook to create an HTTP function with specified handler and configuration.
|
|
166
|
-
*
|
|
167
|
-
* @template TParams - The type of the parameters object.
|
|
168
|
-
* @template TCookie - The type of the cookies object.
|
|
169
|
-
* @template TSession - The type of the session object.
|
|
170
|
-
* @template TResult - The type of the result.
|
|
171
|
-
*
|
|
172
|
-
* @param {() => HttpFuncHandler<TParams, TCookie, TSession, TResult>} handler - The function handler to be used.
|
|
173
|
-
* @param {Object} [config] - Optional configuration object.
|
|
174
|
-
* @param {HttpConfig} [config.http] - Optional HTTP configuration.
|
|
175
|
-
*
|
|
176
|
-
* @returns {Function} The created HTTP function.
|
|
177
|
-
*/
|
|
178
|
-
declare function useHttpFunc<TParams extends Record<string, any> = Record<string, any>, TCookie extends Record<string, string> = Record<string, string>, TSession extends Record<string, any> = Record<string, any>, TResult = any>(handler: () => HttpFuncHandler<TParams, TCookie, TSession, TResult>, config?: {
|
|
179
|
-
http?: HttpConfig;
|
|
180
|
-
}): _faasjs_func.Func<{
|
|
181
|
-
[key: string]: any;
|
|
182
|
-
params?: TParams;
|
|
183
|
-
}, any, TResult>;
|
|
184
163
|
|
|
185
|
-
export { ContentType, Cookie, type CookieOptions, Http, type HttpConfig, HttpError, type HttpFuncHandler, type Response, Session, type SessionOptions, useHttp
|
|
164
|
+
export { ContentType, Cookie, type CookieOptions, Http, type HttpConfig, HttpError, type HttpFuncHandler, type Response, Session, 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": "v8.0.0-beta.
|
|
3
|
+
"version": "v8.0.0-beta.5",
|
|
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": ">=v8.0.0-beta.
|
|
34
|
-
"@faasjs/logger": ">=v8.0.0-beta.
|
|
33
|
+
"@faasjs/func": ">=v8.0.0-beta.5",
|
|
34
|
+
"@faasjs/logger": ">=v8.0.0-beta.5"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@faasjs/func": ">=v8.0.0-beta.
|
|
38
|
-
"@faasjs/logger": ">=v8.0.0-beta.
|
|
37
|
+
"@faasjs/func": ">=v8.0.0-beta.5",
|
|
38
|
+
"@faasjs/logger": ">=v8.0.0-beta.5"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": ">=24.0.0",
|