@next-feature/client 0.1.2-3 → 0.1.2-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/index.js +2 -2
- package/lib/actions/with-api.d.ts +2 -2
- package/package.json +10 -7
- package/server.js +1 -1
- /package/{error-CN4QrYXy.mjs → error-CN4QrYXy.js} +0 -0
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z as i, a, h as r } from "./error-CN4QrYXy.
|
|
2
|
-
import { A as m, g as E, b as k, c as w, i as A } from "./error-CN4QrYXy.
|
|
1
|
+
import { z as i, a, h as r } from "./error-CN4QrYXy.js";
|
|
2
|
+
import { A as m, g as E, b as k, c as w, i as A } from "./error-CN4QrYXy.js";
|
|
3
3
|
i.object({
|
|
4
4
|
NODE_ENV: i.enum(["development", "production"]),
|
|
5
5
|
CLIENT_API_URL: i.string().url()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ApiResponse } from '../types';
|
|
2
|
-
type WrapperFn<F extends (...args: unknown[]) =>
|
|
2
|
+
type WrapperFn<T, F extends (...args: unknown[]) => Promise<T> | T> = (...args: Parameters<F>) => Promise<ApiResponse<T>>;
|
|
3
3
|
interface WithApiOptions<T> {
|
|
4
4
|
fallbackData?: T | null;
|
|
5
5
|
successMessage?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare const withApi: <F extends (...args: any[]) =>
|
|
7
|
+
export declare const withApi: <T, F extends (...args: any[]) => Promise<T>>(fn: F, options?: WithApiOptions<T>) => WrapperFn<T, F>;
|
|
8
8
|
export {};
|
package/package.json
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-feature/client",
|
|
3
|
-
"version": "0.1.2-
|
|
3
|
+
"version": "0.1.2-5",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"main": "./index.js",
|
|
5
6
|
"types": "./index.d.ts",
|
|
6
7
|
"exports": {
|
|
7
8
|
".": {
|
|
8
|
-
"
|
|
9
|
-
"
|
|
9
|
+
"types": "./index.d.ts",
|
|
10
|
+
"import": "./index.js",
|
|
11
|
+
"default": "./index.js"
|
|
10
12
|
},
|
|
11
13
|
"./server": {
|
|
12
|
-
"types": "./
|
|
13
|
-
"import": "./
|
|
14
|
-
"default": "./
|
|
15
|
-
}
|
|
14
|
+
"types": "./server.d.ts",
|
|
15
|
+
"import": "./server.js",
|
|
16
|
+
"default": "./server.js"
|
|
17
|
+
},
|
|
18
|
+
"./package.json": "./package.json"
|
|
16
19
|
}
|
|
17
20
|
}
|
package/server.js
CHANGED
|
File without changes
|