@koine/api 2.0.0-beta.12 → 2.0.0-beta.14
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/nextApiResponse.d.ts +3 -2
- package/nextApiResponse.mjs +2 -2
- package/package.json +2 -2
package/nextApiResponse.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { NextResponse } from "next/server";
|
|
1
2
|
export declare const nextApiResponse: {
|
|
2
|
-
ok<T>(data: T, msg?: string):
|
|
3
|
-
fail<T_1>(data: T_1, msg?: string, status?: number):
|
|
3
|
+
ok<T>(data: T, msg?: string): NextResponse<Koine.Api.ResultOk<T>>;
|
|
4
|
+
fail<T_1>(data: T_1, msg?: string, status?: number): NextResponse<Koine.Api.ResultFail<T_1>>;
|
|
4
5
|
};
|
|
5
6
|
export default nextApiResponse;
|
package/nextApiResponse.mjs
CHANGED
|
@@ -3,10 +3,10 @@ import createApiResultFail from "./createApiResultFail";
|
|
|
3
3
|
import createApiResultOk from "./createApiResultOk";
|
|
4
4
|
export const nextApiResponse = {
|
|
5
5
|
ok (data, msg) {
|
|
6
|
-
NextResponse.json(createApiResultOk(data, msg));
|
|
6
|
+
return NextResponse.json(createApiResultOk(data, msg));
|
|
7
7
|
},
|
|
8
8
|
fail (data, msg, status) {
|
|
9
|
-
NextResponse.json(createApiResultFail(data, msg, status));
|
|
9
|
+
return NextResponse.json(createApiResultFail(data, msg, status));
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
export default nextApiResponse;
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@koine/utils": "2.0.0-beta.
|
|
13
|
+
"@koine/utils": "2.0.0-beta.14"
|
|
14
14
|
},
|
|
15
15
|
"module": "./index.mjs",
|
|
16
16
|
"main": "./index.js",
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"swr": "^2.2.0",
|
|
21
21
|
"type-fest": "^4.1.0"
|
|
22
22
|
},
|
|
23
|
-
"version": "2.0.0-beta.
|
|
23
|
+
"version": "2.0.0-beta.14"
|
|
24
24
|
}
|