@rdyl/node-koa-controller 0.3.8 → 0.3.9
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/CHANGELOG.md +1 -1
- package/dist/meta.js +4 -1
- package/package.json +1 -1
- package/types/meta.d.ts +4 -1
package/CHANGELOG.md
CHANGED
package/dist/meta.js
CHANGED
|
@@ -135,7 +135,10 @@ var BaseController = /** @class */ (function () {
|
|
|
135
135
|
_this._ctx.body = body;
|
|
136
136
|
};
|
|
137
137
|
return {
|
|
138
|
-
raw: function (body) {
|
|
138
|
+
raw: function (body, headers) {
|
|
139
|
+
var _a;
|
|
140
|
+
if (headers === void 0) { headers = {}; }
|
|
141
|
+
_this._ctx.response.set("Content-Type", (_a = headers["Content-Type"]) !== null && _a !== void 0 ? _a : "application/json;charset=utf-8");
|
|
139
142
|
_this._ctx.status = 200;
|
|
140
143
|
_this._ctx.body = body;
|
|
141
144
|
},
|
package/package.json
CHANGED
package/types/meta.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export declare class BaseController {
|
|
|
30
30
|
get body(): any;
|
|
31
31
|
files(): Promise<import("formidable").Files | undefined>;
|
|
32
32
|
get status(): {
|
|
33
|
-
raw: (body?: unknown) => void;
|
|
33
|
+
raw: (body?: unknown, headers?: HandlerStatusBody) => void;
|
|
34
34
|
ok(data?: unknown): void;
|
|
35
35
|
okCreated(data: unknown, msg?: string): void;
|
|
36
36
|
okAccept(data: unknown, msg?: string): void;
|
|
@@ -87,4 +87,7 @@ export type UseJwtHandlerRes = {
|
|
|
87
87
|
export type UseJwtHandlerOpts = {
|
|
88
88
|
public: boolean;
|
|
89
89
|
};
|
|
90
|
+
export type HandlerStatusBody = {
|
|
91
|
+
"Content-Type"?: string;
|
|
92
|
+
};
|
|
90
93
|
export type UseJwtHandler = (_ctx: KoaCtx, opts: UseJwtHandlerOpts) => Promise<UseJwtHandlerRes>;
|