@wix/sdk-react 0.5.1 → 0.5.2

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.
@@ -51,6 +51,10 @@ function useWixFetch() {
51
51
  const sdk = useWix();
52
52
  return sdk.fetch;
53
53
  }
54
+ function useWixFetchWithAuth() {
55
+ const sdk = useWix();
56
+ return sdk.fetchWithAuth;
57
+ }
54
58
  function useWixAuth() {
55
59
  const sdk = useWix();
56
60
  return sdk.auth;
@@ -74,5 +78,6 @@ export {
74
78
  useWix,
75
79
  useWixAuth,
76
80
  useWixFetch,
81
+ useWixFetchWithAuth,
77
82
  useWixModules
78
83
  };
package/build/index.cjs CHANGED
@@ -36,6 +36,7 @@ __export(src_exports, {
36
36
  useWix: () => useWix,
37
37
  useWixAuth: () => useWixAuth,
38
38
  useWixFetch: () => useWixFetch,
39
+ useWixFetchWithAuth: () => useWixFetchWithAuth,
39
40
  useWixModules: () => useWixModules
40
41
  });
41
42
  module.exports = __toCommonJS(src_exports);
@@ -89,6 +90,10 @@ function useWixFetch() {
89
90
  const sdk = useWix();
90
91
  return sdk.fetch;
91
92
  }
93
+ function useWixFetchWithAuth() {
94
+ const sdk = useWix();
95
+ return sdk.fetchWithAuth;
96
+ }
92
97
  function useWixAuth() {
93
98
  const sdk = useWix();
94
99
  return sdk.auth;
@@ -113,6 +118,7 @@ function useEnvironment() {
113
118
  useWix,
114
119
  useWixAuth,
115
120
  useWixFetch,
121
+ useWixFetchWithAuth,
116
122
  useWixModules,
117
123
  ...require("@wix/sdk")
118
124
  });
package/build/index.d.cts CHANGED
@@ -8,9 +8,14 @@ declare function WixProvider<H extends Host<any> | undefined = undefined, T exte
8
8
  host?: H;
9
9
  }>): React.JSX.Element;
10
10
  declare function useWix<T extends WixClient<Host<any> | undefined> = WixClient>(): T;
11
+ /**
12
+ * @deprecated please use `useWixFetchWithAuth()` instead
13
+ * @returns fetch
14
+ */
11
15
  declare function useWixFetch(): (relativeUrl: string, options: RequestInit) => Promise<Response>;
16
+ declare function useWixFetchWithAuth(): typeof fetch;
12
17
  declare function useWixAuth<T extends AuthenticationStrategy>(): Omit<T, "getAuthHeaders"> & BoundAuthenticationStrategy;
13
18
  declare function useWixModules<T extends Descriptors>(modules: T): BuildDescriptors<T, Host<any>>;
14
19
  declare function useEnvironment<T>(): T;
15
20
 
16
- export { WixProvider, useEnvironment, useWix, useWixAuth, useWixFetch, useWixModules };
21
+ export { WixProvider, useEnvironment, useWix, useWixAuth, useWixFetch, useWixFetchWithAuth, useWixModules };
package/build/index.d.ts CHANGED
@@ -8,9 +8,14 @@ declare function WixProvider<H extends Host<any> | undefined = undefined, T exte
8
8
  host?: H;
9
9
  }>): React.JSX.Element;
10
10
  declare function useWix<T extends WixClient<Host<any> | undefined> = WixClient>(): T;
11
+ /**
12
+ * @deprecated please use `useWixFetchWithAuth()` instead
13
+ * @returns fetch
14
+ */
11
15
  declare function useWixFetch(): (relativeUrl: string, options: RequestInit) => Promise<Response>;
16
+ declare function useWixFetchWithAuth(): typeof fetch;
12
17
  declare function useWixAuth<T extends AuthenticationStrategy>(): Omit<T, "getAuthHeaders"> & BoundAuthenticationStrategy;
13
18
  declare function useWixModules<T extends Descriptors>(modules: T): BuildDescriptors<T, Host<any>>;
14
19
  declare function useEnvironment<T>(): T;
15
20
 
16
- export { WixProvider, useEnvironment, useWix, useWixAuth, useWixFetch, useWixModules };
21
+ export { WixProvider, useEnvironment, useWix, useWixAuth, useWixFetch, useWixFetchWithAuth, useWixModules };
package/build/index.js CHANGED
@@ -51,6 +51,10 @@ function useWixFetch() {
51
51
  const sdk = useWix();
52
52
  return sdk.fetch;
53
53
  }
54
+ function useWixFetchWithAuth() {
55
+ const sdk = useWix();
56
+ return sdk.fetchWithAuth;
57
+ }
54
58
  function useWixAuth() {
55
59
  const sdk = useWix();
56
60
  return sdk.auth;
@@ -74,5 +78,6 @@ export {
74
78
  useWix,
75
79
  useWixAuth,
76
80
  useWixFetch,
81
+ useWixFetchWithAuth,
77
82
  useWixModules
78
83
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/sdk-react",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "license": "UNLICENSED",
5
5
  "main": "build/index.cjs",
6
6
  "module": "build/index.js",
@@ -30,7 +30,7 @@
30
30
  "typecheck": "tsc --noEmit"
31
31
  },
32
32
  "dependencies": {
33
- "@wix/sdk": "^1.9.4"
33
+ "@wix/sdk": "^1.9.5"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "react": "^16.0.0 || ^17.0.0 || ^18.0.0"
@@ -69,5 +69,5 @@
69
69
  "eslintConfig": {
70
70
  "extends": "sdk"
71
71
  },
72
- "falconPackageHash": "8d9bdab3a1a6704c420d89f3d767fe80dc1e279b263379e54bcd7adb"
72
+ "falconPackageHash": "c0e2b310ecde349171b6bb7b79883011010f310028f70d8242d50061"
73
73
  }