@wix/sdk-types 1.11.0 → 1.12.1
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 +18 -0
- package/build/index.d.ts +18 -0
- package/package.json +2 -2
package/build/index.d.mts
CHANGED
|
@@ -21,8 +21,18 @@ type Host<Environment = unknown> = {
|
|
|
21
21
|
* like internationalization, billing, etc.
|
|
22
22
|
*/
|
|
23
23
|
essentials?: {
|
|
24
|
+
/**
|
|
25
|
+
* The language of the currently viewed session
|
|
26
|
+
*/
|
|
24
27
|
language?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The locale of the currently viewed session
|
|
30
|
+
*/
|
|
25
31
|
locale?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Any headers that should be passed through to the API requests
|
|
34
|
+
*/
|
|
35
|
+
passThroughHeaders?: Record<string, string>;
|
|
26
36
|
};
|
|
27
37
|
};
|
|
28
38
|
|
|
@@ -31,6 +41,7 @@ interface HttpClient {
|
|
|
31
41
|
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
32
42
|
fetchWithAuth: typeof fetch;
|
|
33
43
|
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
44
|
+
getActiveToken?: () => string | undefined;
|
|
34
45
|
}
|
|
35
46
|
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
36
47
|
type HttpResponse<T = any> = {
|
|
@@ -65,6 +76,13 @@ type AuthenticationStrategy<Host = unknown> = {
|
|
|
65
76
|
};
|
|
66
77
|
valid: boolean;
|
|
67
78
|
}>;
|
|
79
|
+
/**
|
|
80
|
+
* This function is used to get the token that is currently active in the context of the strategy.
|
|
81
|
+
* This is useful when direct access to the access token is needed
|
|
82
|
+
* (such as getTokenInfo that requires the token in the body of the request).
|
|
83
|
+
* @returns the token that is currently active in the context of the strategy
|
|
84
|
+
*/
|
|
85
|
+
getActiveToken?: () => string | undefined;
|
|
68
86
|
};
|
|
69
87
|
type BoundAuthenticationStrategy = {
|
|
70
88
|
getAuthHeaders: () => Promise<{
|
package/build/index.d.ts
CHANGED
|
@@ -21,8 +21,18 @@ type Host<Environment = unknown> = {
|
|
|
21
21
|
* like internationalization, billing, etc.
|
|
22
22
|
*/
|
|
23
23
|
essentials?: {
|
|
24
|
+
/**
|
|
25
|
+
* The language of the currently viewed session
|
|
26
|
+
*/
|
|
24
27
|
language?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The locale of the currently viewed session
|
|
30
|
+
*/
|
|
25
31
|
locale?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Any headers that should be passed through to the API requests
|
|
34
|
+
*/
|
|
35
|
+
passThroughHeaders?: Record<string, string>;
|
|
26
36
|
};
|
|
27
37
|
};
|
|
28
38
|
|
|
@@ -31,6 +41,7 @@ interface HttpClient {
|
|
|
31
41
|
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
32
42
|
fetchWithAuth: typeof fetch;
|
|
33
43
|
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
44
|
+
getActiveToken?: () => string | undefined;
|
|
34
45
|
}
|
|
35
46
|
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
36
47
|
type HttpResponse<T = any> = {
|
|
@@ -65,6 +76,13 @@ type AuthenticationStrategy<Host = unknown> = {
|
|
|
65
76
|
};
|
|
66
77
|
valid: boolean;
|
|
67
78
|
}>;
|
|
79
|
+
/**
|
|
80
|
+
* This function is used to get the token that is currently active in the context of the strategy.
|
|
81
|
+
* This is useful when direct access to the access token is needed
|
|
82
|
+
* (such as getTokenInfo that requires the token in the body of the request).
|
|
83
|
+
* @returns the token that is currently active in the context of the strategy
|
|
84
|
+
*/
|
|
85
|
+
getActiveToken?: () => string | undefined;
|
|
68
86
|
};
|
|
69
87
|
type BoundAuthenticationStrategy = {
|
|
70
88
|
getAuthHeaders: () => Promise<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/sdk-types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.1",
|
|
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": "
|
|
61
|
+
"falconPackageHash": "3ade7900865a4781de88ae3fd23b77db1eff4d458880ae16e81a6b4e"
|
|
62
62
|
}
|