@wix/sdk-types 1.9.0 → 1.9.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.
package/build/index.d.mts CHANGED
@@ -17,7 +17,8 @@ type Host<Environment = unknown> = {
17
17
  type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
18
18
  interface HttpClient {
19
19
  request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
20
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
20
+ fetchWithAuth: typeof fetch;
21
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
21
22
  }
22
23
  type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
23
24
  type HttpResponse<T = any> = {
@@ -40,7 +41,7 @@ type APIMetadata = {
40
41
  };
41
42
  type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
42
43
 
43
- type AuthenticationStrategy<Host = unknown, WithAuth extends ((...args: any) => AuthenticationStrategy<Host, WithAuth>) | undefined = undefined> = {
44
+ type AuthenticationStrategy<Host = unknown> = {
44
45
  getAuthHeaders: (host: Host) => Promise<{
45
46
  headers: Record<string, string>;
46
47
  }> | {
@@ -52,7 +53,6 @@ type AuthenticationStrategy<Host = unknown, WithAuth extends ((...args: any) =>
52
53
  };
53
54
  valid: boolean;
54
55
  }>;
55
- withAuth?: WithAuth;
56
56
  };
57
57
  type BoundAuthenticationStrategy = {
58
58
  getAuthHeaders: () => Promise<{
package/build/index.d.ts CHANGED
@@ -17,7 +17,8 @@ type Host<Environment = unknown> = {
17
17
  type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
18
18
  interface HttpClient {
19
19
  request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
20
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
20
+ fetchWithAuth: typeof fetch;
21
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
21
22
  }
22
23
  type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
23
24
  type HttpResponse<T = any> = {
@@ -40,7 +41,7 @@ type APIMetadata = {
40
41
  };
41
42
  type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
42
43
 
43
- type AuthenticationStrategy<Host = unknown, WithAuth extends ((...args: any) => AuthenticationStrategy<Host, WithAuth>) | undefined = undefined> = {
44
+ type AuthenticationStrategy<Host = unknown> = {
44
45
  getAuthHeaders: (host: Host) => Promise<{
45
46
  headers: Record<string, string>;
46
47
  }> | {
@@ -52,7 +53,6 @@ type AuthenticationStrategy<Host = unknown, WithAuth extends ((...args: any) =>
52
53
  };
53
54
  valid: boolean;
54
55
  }>;
55
- withAuth?: WithAuth;
56
56
  };
57
57
  type BoundAuthenticationStrategy = {
58
58
  getAuthHeaders: () => Promise<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/sdk-types",
3
- "version": "1.9.0",
3
+ "version": "1.9.2",
4
4
  "license": "UNLICENSED",
5
5
  "author": {
6
6
  "name": "Ronny Ringel",
@@ -58,5 +58,5 @@
58
58
  "wallaby": {
59
59
  "autoDetect": true
60
60
  },
61
- "falconPackageHash": "2fb625b6ef9fd24f133e43d99abeee52ad19f9e49b2f2fd6d48d8aa9"
61
+ "falconPackageHash": "1503a311db02c1ee82ffe6effcdaa42861a2a605a9a214b4bb67d7ad"
62
62
  }