@wix/sdk-types 1.12.4 → 1.12.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/build/index.d.mts +15 -2
- package/build/index.d.ts +15 -2
- package/package.json +5 -5
package/build/index.d.mts
CHANGED
|
@@ -40,6 +40,7 @@ type Host<Environment = unknown> = {
|
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
type HTTPMethod = 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
43
44
|
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
44
45
|
interface HttpClient {
|
|
45
46
|
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
@@ -56,7 +57,7 @@ type HttpResponse<T = any> = {
|
|
|
56
57
|
request?: any;
|
|
57
58
|
};
|
|
58
59
|
type RequestOptions<_TResponse = any, Data = any> = {
|
|
59
|
-
method:
|
|
60
|
+
method: HTTPMethod;
|
|
60
61
|
url: string;
|
|
61
62
|
data?: Data;
|
|
62
63
|
params?: URLSearchParams;
|
|
@@ -67,6 +68,18 @@ type APIMetadata = {
|
|
|
67
68
|
packageName?: string;
|
|
68
69
|
};
|
|
69
70
|
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
71
|
+
type RestModuleMeta<TMethod extends HTTPMethod = HTTPMethod, TPathParams = unknown, RequestType = unknown, TOriginalRequestType = unknown, ResponseType = unknown, OriginalResponseType = unknown> = {
|
|
72
|
+
getUrl(context: {
|
|
73
|
+
host: string;
|
|
74
|
+
}): string;
|
|
75
|
+
httpMethod: TMethod;
|
|
76
|
+
pathParams: TPathParams;
|
|
77
|
+
path: string;
|
|
78
|
+
__requestType: RequestType;
|
|
79
|
+
__originalRequestType: TOriginalRequestType;
|
|
80
|
+
__responseType: ResponseType;
|
|
81
|
+
__originalResponseType: OriginalResponseType;
|
|
82
|
+
};
|
|
70
83
|
|
|
71
84
|
type AuthenticationStrategy<Host = unknown> = {
|
|
72
85
|
getAuthHeaders: (host: Host) => Promise<{
|
|
@@ -516,4 +529,4 @@ type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
|
516
529
|
host: Host;
|
|
517
530
|
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
518
531
|
|
|
519
|
-
export { type APIMetadata, type AmbassadorFactory, type AmbassadorFunctionDescriptor, type AmbassadorRequestOptions, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildAmbassadorFunction, type BuildDescriptors, type BuildEventDefinition, type BuildRESTFunction, type BuildServicePluginDefinition, type Descriptors, EventDefinition, type EventHandler, type EventIdentity, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type MaybeContext, type Method, type PublicMetadata, type RESTFunctionDescriptor, type RequestContext, type RequestOptions, type RequestOptionsFactory, SERVICE_PLUGIN_ERROR_TYPE, type ServicePluginContract, ServicePluginDefinition, type ServicePluginMethodInput, type ServicePluginMethodMetadata };
|
|
532
|
+
export { type APIMetadata, type AmbassadorFactory, type AmbassadorFunctionDescriptor, type AmbassadorRequestOptions, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildAmbassadorFunction, type BuildDescriptors, type BuildEventDefinition, type BuildRESTFunction, type BuildServicePluginDefinition, type Descriptors, EventDefinition, type EventHandler, type EventIdentity, type HTTPMethod, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type MaybeContext, type Method, type PublicMetadata, type RESTFunctionDescriptor, type RequestContext, type RequestOptions, type RequestOptionsFactory, type RestModuleMeta, SERVICE_PLUGIN_ERROR_TYPE, type ServicePluginContract, ServicePluginDefinition, type ServicePluginMethodInput, type ServicePluginMethodMetadata };
|
package/build/index.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ type Host<Environment = unknown> = {
|
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
type HTTPMethod = 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
43
44
|
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
44
45
|
interface HttpClient {
|
|
45
46
|
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
@@ -56,7 +57,7 @@ type HttpResponse<T = any> = {
|
|
|
56
57
|
request?: any;
|
|
57
58
|
};
|
|
58
59
|
type RequestOptions<_TResponse = any, Data = any> = {
|
|
59
|
-
method:
|
|
60
|
+
method: HTTPMethod;
|
|
60
61
|
url: string;
|
|
61
62
|
data?: Data;
|
|
62
63
|
params?: URLSearchParams;
|
|
@@ -67,6 +68,18 @@ type APIMetadata = {
|
|
|
67
68
|
packageName?: string;
|
|
68
69
|
};
|
|
69
70
|
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
71
|
+
type RestModuleMeta<TMethod extends HTTPMethod = HTTPMethod, TPathParams = unknown, RequestType = unknown, TOriginalRequestType = unknown, ResponseType = unknown, OriginalResponseType = unknown> = {
|
|
72
|
+
getUrl(context: {
|
|
73
|
+
host: string;
|
|
74
|
+
}): string;
|
|
75
|
+
httpMethod: TMethod;
|
|
76
|
+
pathParams: TPathParams;
|
|
77
|
+
path: string;
|
|
78
|
+
__requestType: RequestType;
|
|
79
|
+
__originalRequestType: TOriginalRequestType;
|
|
80
|
+
__responseType: ResponseType;
|
|
81
|
+
__originalResponseType: OriginalResponseType;
|
|
82
|
+
};
|
|
70
83
|
|
|
71
84
|
type AuthenticationStrategy<Host = unknown> = {
|
|
72
85
|
getAuthHeaders: (host: Host) => Promise<{
|
|
@@ -516,4 +529,4 @@ type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
|
516
529
|
host: Host;
|
|
517
530
|
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
518
531
|
|
|
519
|
-
export { type APIMetadata, type AmbassadorFactory, type AmbassadorFunctionDescriptor, type AmbassadorRequestOptions, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildAmbassadorFunction, type BuildDescriptors, type BuildEventDefinition, type BuildRESTFunction, type BuildServicePluginDefinition, type Descriptors, EventDefinition, type EventHandler, type EventIdentity, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type MaybeContext, type Method, type PublicMetadata, type RESTFunctionDescriptor, type RequestContext, type RequestOptions, type RequestOptionsFactory, SERVICE_PLUGIN_ERROR_TYPE, type ServicePluginContract, ServicePluginDefinition, type ServicePluginMethodInput, type ServicePluginMethodMetadata };
|
|
532
|
+
export { type APIMetadata, type AmbassadorFactory, type AmbassadorFunctionDescriptor, type AmbassadorRequestOptions, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildAmbassadorFunction, type BuildDescriptors, type BuildEventDefinition, type BuildRESTFunction, type BuildServicePluginDefinition, type Descriptors, EventDefinition, type EventHandler, type EventIdentity, type HTTPMethod, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type MaybeContext, type Method, type PublicMetadata, type RESTFunctionDescriptor, type RequestContext, type RequestOptions, type RequestOptionsFactory, type RestModuleMeta, SERVICE_PLUGIN_ERROR_TYPE, type ServicePluginContract, ServicePluginDefinition, type ServicePluginMethodInput, type ServicePluginMethodMetadata };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/sdk-types",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.5",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Ronny Ringel",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"*.{js,ts}": "yarn lint"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@types/node": "^20.17.
|
|
31
|
+
"@types/node": "^20.17.9",
|
|
32
32
|
"eslint": "^8.57.1",
|
|
33
33
|
"eslint-config-sdk": "0.0.0",
|
|
34
34
|
"tsup": "^7.3.0",
|
|
35
|
-
"type-fest": "^4.
|
|
36
|
-
"typescript": "^5.
|
|
35
|
+
"type-fest": "^4.29.0",
|
|
36
|
+
"typescript": "^5.7.2"
|
|
37
37
|
},
|
|
38
38
|
"yoshiFlowLibrary": {
|
|
39
39
|
"buildEsmWithBabel": true
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"wallaby": {
|
|
59
59
|
"autoDetect": true
|
|
60
60
|
},
|
|
61
|
-
"falconPackageHash": "
|
|
61
|
+
"falconPackageHash": "0d2624979aa91d2fdf561413936058ec3500f8622d610fd50c7cc8da"
|
|
62
62
|
}
|