@aeriajs/http 0.0.90 → 0.0.92
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/dist/routing.d.ts +1 -1
- package/dist/routing.js +1 -1
- package/dist/routing.mjs +1 -1
- package/package.json +6 -6
package/dist/routing.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ type TypedContext<TContractWithRoles extends ContractWithRoles> = RouteContext<R
|
|
|
21
21
|
export type ProxiedRouter<TRouter> = TRouter & Record<RequestMethod, <const TContractWithRoles extends ContractWithRoles, TCallback extends (TContractWithRoles extends {
|
|
22
22
|
response: infer Response;
|
|
23
23
|
} ? InferResponse<Response> : any) extends infer Response ? (context: TypedContext<TContractWithRoles>) => Response : never>(exp: RouteUri, cb: TCallback, contract?: TContractWithRoles) => ReturnType<typeof registerRoute>>;
|
|
24
|
-
export declare const matches: <TRequest extends GenericRequest>(req: TRequest, method: RequestMethod | RequestMethod[] | null, exp: string | RegExp, options
|
|
24
|
+
export declare const matches: <TRequest extends GenericRequest>(req: TRequest, method: RequestMethod | RequestMethod[] | null, exp: string | RegExp, options?: RouterOptions, config?: ApiConfig) => {
|
|
25
25
|
fragments: string[];
|
|
26
26
|
} | undefined;
|
|
27
27
|
export declare const registerRoute: (context: RouteContext, method: RequestMethod | RequestMethod[], exp: RouteUri, cb: (context: RouteContext) => any, contract?: ContractWithRoles, options?: RouterOptions) => Promise<any>;
|
package/dist/routing.js
CHANGED
|
@@ -23,7 +23,7 @@ const checkUnprocessable = ({ error }, context) => {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
const matches = (req, method, exp, options, config) => {
|
|
26
|
+
const matches = (req, method, exp, options = {}, config) => {
|
|
27
27
|
const base = config?.baseUrl && config.baseUrl !== '/'
|
|
28
28
|
? options.base
|
|
29
29
|
? `${config.baseUrl}${options.base}`
|
package/dist/routing.mjs
CHANGED
|
@@ -21,7 +21,7 @@ const checkUnprocessable = ({ error }, context) => {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
export const matches = (req, method, exp, options, config) => {
|
|
24
|
+
export const matches = (req, method, exp, options = {}, config) => {
|
|
25
25
|
const base = config?.baseUrl && config.baseUrl !== "/" ? options.base ? `${config.baseUrl}${options.base}` : config.baseUrl : options.base ? options.base : "";
|
|
26
26
|
if (method && method !== req.method) {
|
|
27
27
|
if (!Array.isArray(method) || !method.includes(req.method)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/http",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.92",
|
|
4
4
|
"description": "## Installation",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"@aeriajs/validation": "link:../validation"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@aeriajs/common": "^0.0.
|
|
32
|
-
"@aeriajs/entrypoint": "^0.0.
|
|
33
|
-
"@aeriajs/types": "^0.0.
|
|
34
|
-
"@aeriajs/validation": "^0.0.
|
|
31
|
+
"@aeriajs/common": "^0.0.81",
|
|
32
|
+
"@aeriajs/entrypoint": "^0.0.83",
|
|
33
|
+
"@aeriajs/types": "^0.0.69",
|
|
34
|
+
"@aeriajs/validation": "^0.0.84"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
|
-
"test": "
|
|
37
|
+
"test": "TS_NODE_COMPILER_OPTIONS=\"$(cat ../compilerOptions.json)\" mocha -r ts-node/register tests/*.spec.ts",
|
|
38
38
|
"lint": "eslint src",
|
|
39
39
|
"lint:fix": "eslint src --fix",
|
|
40
40
|
"build": "pnpm build:cjs && pnpm build:esm",
|