@jwn-js/common 2.1.0 → 2.1.1
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/docs/assets/search.js +1 -1
- package/docs/classes/ApiError.html +1 -1
- package/docs/classes/AsyncJwt.html +1 -1
- package/docs/classes/Controller.html +1 -1
- package/docs/classes/Jwt.html +1 -1
- package/docs/classes/Memcached.html +1 -1
- package/docs/classes/Model.html +1 -1
- package/docs/classes/Server.html +1 -1
- package/docs/classes/Ssr.html +1 -1
- package/docs/classes/Web.html +3 -3
- package/docs/index.html +1 -1
- package/docs/interfaces/ApiErrorMessage.html +1 -1
- package/docs/interfaces/ContextSsr.html +1 -1
- package/docs/interfaces/ContextWeb.html +1 -1
- package/docs/interfaces/OptionsSsr.html +1 -1
- package/docs/interfaces/OptionsWeb.html +1 -1
- package/docs/interfaces/ResponseOptions.html +1 -1
- package/docs/interfaces/Route.html +1 -1
- package/docs/interfaces/Schema.html +1 -1
- package/docs/interfaces/ServerHandler.html +1 -1
- package/docs/interfaces/ServerOptions.html +1 -1
- package/docs/interfaces/ServerWebsocket.html +1 -1
- package/docs/modules.html +1 -1
- package/index.d.ts +5 -1
- package/index.js +3 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -531,6 +531,9 @@ interface Request {
|
|
|
531
531
|
lang?: string;
|
|
532
532
|
[key: string]: any;
|
|
533
533
|
}
|
|
534
|
+
interface DefaultRequestParams {
|
|
535
|
+
lang: "ru" | "ua" | "en" | "es" | string;
|
|
536
|
+
}
|
|
534
537
|
/**
|
|
535
538
|
* Entry point for /web api
|
|
536
539
|
* handler for api request
|
|
@@ -539,7 +542,7 @@ declare class Web {
|
|
|
539
542
|
private readonly res;
|
|
540
543
|
private readonly req;
|
|
541
544
|
private readonly context;
|
|
542
|
-
private
|
|
545
|
+
private defaultRequest;
|
|
543
546
|
private readonly defaultResponse;
|
|
544
547
|
private readonly defaultControllerSubaction;
|
|
545
548
|
private route;
|
|
@@ -548,6 +551,7 @@ declare class Web {
|
|
|
548
551
|
[key: string]: any;
|
|
549
552
|
};
|
|
550
553
|
constructor(res: HttpResponse, req: HttpRequest, context: OptionsWeb);
|
|
554
|
+
setDefaultRequest(params: DefaultRequestParams): void;
|
|
551
555
|
request(input?: Request): Promise<void>;
|
|
552
556
|
/**
|
|
553
557
|
* Import controller class
|
package/index.js
CHANGED
|
@@ -1111,6 +1111,9 @@ class Web {
|
|
|
1111
1111
|
this.res.onAborted(() => new ApiError.ApiError({ message: "The connection was close", code: 1, statusCode: 404 }));
|
|
1112
1112
|
this.context = context;
|
|
1113
1113
|
}
|
|
1114
|
+
setDefaultRequest(params) {
|
|
1115
|
+
Object.assign(this.defaultRequest, params);
|
|
1116
|
+
}
|
|
1114
1117
|
async request(input = {}) {
|
|
1115
1118
|
let response = {};
|
|
1116
1119
|
try {
|