@wix/sdk-types 1.5.0 → 1.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.
package/build/index.d.mts CHANGED
@@ -16,7 +16,7 @@ type Host<Environment = unknown> = {
16
16
 
17
17
  type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
18
18
  interface HttpClient {
19
- request<T>(req: RequestOptionsFactory): Promise<HttpResponse<T>>;
19
+ request<T>(req: RequestOptionsFactory<T>): Promise<HttpResponse<T>>;
20
20
  }
21
21
  type RequestOptionsFactory<T = any> = (context: any) => RequestOptions<T>;
22
22
  type HttpResponse<T = any> = {
@@ -40,9 +40,14 @@ type APIMetadata = {
40
40
  type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
41
41
 
42
42
  type AuthenticationStrategy<Host = unknown> = {
43
- getAuthHeaders: (host?: Host) => Promise<{
43
+ getAuthHeaders: (host: Host) => Promise<{
44
+ headers: Record<string, string>;
45
+ }>;
46
+ };
47
+ type BoundAuthenticationStrategy = {
48
+ getAuthHeaders: () => Promise<{
44
49
  headers: Record<string, string>;
45
50
  }>;
46
51
  };
47
52
 
48
- export { APIMetadata, AuthenticationStrategy, BuildRESTFunction, Host, HostModule, HostModuleAPI, HttpClient, HttpResponse, RESTFunctionDescriptor, RequestOptions, RequestOptionsFactory };
53
+ export type { APIMetadata, AuthenticationStrategy, BoundAuthenticationStrategy, BuildRESTFunction, Host, HostModule, HostModuleAPI, HttpClient, HttpResponse, RESTFunctionDescriptor, RequestOptions, RequestOptionsFactory };
package/build/index.d.ts CHANGED
@@ -16,7 +16,7 @@ type Host<Environment = unknown> = {
16
16
 
17
17
  type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
18
18
  interface HttpClient {
19
- request<T>(req: RequestOptionsFactory): Promise<HttpResponse<T>>;
19
+ request<T>(req: RequestOptionsFactory<T>): Promise<HttpResponse<T>>;
20
20
  }
21
21
  type RequestOptionsFactory<T = any> = (context: any) => RequestOptions<T>;
22
22
  type HttpResponse<T = any> = {
@@ -40,9 +40,14 @@ type APIMetadata = {
40
40
  type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
41
41
 
42
42
  type AuthenticationStrategy<Host = unknown> = {
43
- getAuthHeaders: (host?: Host) => Promise<{
43
+ getAuthHeaders: (host: Host) => Promise<{
44
+ headers: Record<string, string>;
45
+ }>;
46
+ };
47
+ type BoundAuthenticationStrategy = {
48
+ getAuthHeaders: () => Promise<{
44
49
  headers: Record<string, string>;
45
50
  }>;
46
51
  };
47
52
 
48
- export { APIMetadata, AuthenticationStrategy, BuildRESTFunction, Host, HostModule, HostModuleAPI, HttpClient, HttpResponse, RESTFunctionDescriptor, RequestOptions, RequestOptionsFactory };
53
+ export type { APIMetadata, AuthenticationStrategy, BoundAuthenticationStrategy, BuildRESTFunction, Host, HostModule, HostModuleAPI, HttpClient, HttpResponse, RESTFunctionDescriptor, RequestOptions, RequestOptionsFactory };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/sdk-types",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "license": "UNLICENSED",
5
5
  "author": {
6
6
  "name": "Ronny Ringel",
@@ -28,11 +28,11 @@
28
28
  "*.{js,ts}": "yarn lint"
29
29
  },
30
30
  "devDependencies": {
31
- "@types/node": "^16.18.50",
31
+ "@types/node": "^20.10.0",
32
32
  "eslint": "^7.32.0",
33
33
  "eslint-config-sdk": "0.0.0",
34
- "tsup": "^7.2.0",
35
- "typescript": "~4.9.5"
34
+ "tsup": "^7.3.0",
35
+ "typescript": "^5.3.2"
36
36
  },
37
37
  "yoshiFlowLibrary": {
38
38
  "buildEsmWithBabel": true
@@ -57,5 +57,5 @@
57
57
  "wallaby": {
58
58
  "autoDetect": true
59
59
  },
60
- "falconPackageHash": "3351d2f65a09b21e85210a440bc6fa5b7d5684cd2348d62711c5c0f2"
60
+ "falconPackageHash": "dc7a23cf9438bfbbcb58bb7f92eaf9275a78f18498ecc02ef185f002"
61
61
  }