@wix/pricing-plans 1.0.95 → 1.0.97
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/package.json +4 -4
- package/type-bundles/context.bundle.d.ts +514 -108
- package/type-bundles/index.bundle.d.ts +514 -108
- package/type-bundles/meta.bundle.d.ts +3 -15
@@ -1,9 +1,9 @@
|
|
1
|
-
type HostModule<T, H extends Host> = {
|
1
|
+
type HostModule$1<T, H extends Host$1> = {
|
2
2
|
__type: 'host';
|
3
3
|
create(host: H): T;
|
4
4
|
};
|
5
|
-
type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
|
6
|
-
type Host<Environment = unknown> = {
|
5
|
+
type HostModuleAPI$1<T extends HostModule$1<any, any>> = T extends HostModule$1<infer U, any> ? U : never;
|
6
|
+
type Host$1<Environment = unknown> = {
|
7
7
|
channel: {
|
8
8
|
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
9
9
|
disconnect: () => void;
|
@@ -36,92 +36,92 @@ type Host<Environment = unknown> = {
|
|
36
36
|
};
|
37
37
|
};
|
38
38
|
|
39
|
-
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
40
|
-
interface HttpClient {
|
41
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
39
|
+
type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
|
40
|
+
interface HttpClient$1 {
|
41
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
|
42
42
|
fetchWithAuth: typeof fetch;
|
43
43
|
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
44
44
|
getActiveToken?: () => string | undefined;
|
45
45
|
}
|
46
|
-
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
47
|
-
type HttpResponse<T = any> = {
|
46
|
+
type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
|
47
|
+
type HttpResponse$1<T = any> = {
|
48
48
|
data: T;
|
49
49
|
status: number;
|
50
50
|
statusText: string;
|
51
51
|
headers: any;
|
52
52
|
request?: any;
|
53
53
|
};
|
54
|
-
type RequestOptions<_TResponse = any, Data = any> = {
|
54
|
+
type RequestOptions$1<_TResponse = any, Data = any> = {
|
55
55
|
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
56
56
|
url: string;
|
57
57
|
data?: Data;
|
58
58
|
params?: URLSearchParams;
|
59
|
-
} & APIMetadata;
|
60
|
-
type APIMetadata = {
|
59
|
+
} & APIMetadata$1;
|
60
|
+
type APIMetadata$1 = {
|
61
61
|
methodFqn?: string;
|
62
62
|
entityFqdn?: string;
|
63
63
|
packageName?: string;
|
64
64
|
};
|
65
|
-
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
66
|
-
type EventDefinition$
|
65
|
+
type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
|
66
|
+
type EventDefinition$3<Payload = unknown, Type extends string = string> = {
|
67
67
|
__type: 'event-definition';
|
68
68
|
type: Type;
|
69
69
|
isDomainEvent?: boolean;
|
70
70
|
transformations?: (envelope: unknown) => Payload;
|
71
71
|
__payload: Payload;
|
72
72
|
};
|
73
|
-
declare function EventDefinition$
|
74
|
-
type EventHandler$
|
75
|
-
type BuildEventDefinition$
|
73
|
+
declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
|
74
|
+
type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
|
75
|
+
type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
|
76
76
|
|
77
|
-
type ServicePluginMethodInput = {
|
77
|
+
type ServicePluginMethodInput$1 = {
|
78
78
|
request: any;
|
79
79
|
metadata: any;
|
80
80
|
};
|
81
|
-
type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
|
82
|
-
type ServicePluginMethodMetadata = {
|
81
|
+
type ServicePluginContract$1 = Record<string, (payload: ServicePluginMethodInput$1) => unknown | Promise<unknown>>;
|
82
|
+
type ServicePluginMethodMetadata$1 = {
|
83
83
|
name: string;
|
84
84
|
primaryHttpMappingPath: string;
|
85
85
|
transformations: {
|
86
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput;
|
86
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput$1;
|
87
87
|
toREST: (...args: unknown[]) => unknown;
|
88
88
|
};
|
89
89
|
};
|
90
|
-
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
90
|
+
type ServicePluginDefinition$1<Contract extends ServicePluginContract$1> = {
|
91
91
|
__type: 'service-plugin-definition';
|
92
92
|
componentType: string;
|
93
|
-
methods: ServicePluginMethodMetadata[];
|
93
|
+
methods: ServicePluginMethodMetadata$1[];
|
94
94
|
__contract: Contract;
|
95
95
|
};
|
96
|
-
declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
|
97
|
-
type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
|
98
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
|
96
|
+
declare function ServicePluginDefinition$1<Contract extends ServicePluginContract$1>(componentType: string, methods: ServicePluginMethodMetadata$1[]): ServicePluginDefinition$1<Contract>;
|
97
|
+
type BuildServicePluginDefinition$1<T extends ServicePluginDefinition$1<any>> = (implementation: T['__contract']) => void;
|
98
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE$1 = "wix_spi_error";
|
99
99
|
|
100
|
-
type RequestContext = {
|
100
|
+
type RequestContext$1 = {
|
101
101
|
isSSR: boolean;
|
102
102
|
host: string;
|
103
103
|
protocol?: string;
|
104
104
|
};
|
105
|
-
type ResponseTransformer = (data: any, headers?: any) => any;
|
105
|
+
type ResponseTransformer$1 = (data: any, headers?: any) => any;
|
106
106
|
/**
|
107
107
|
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
108
108
|
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
109
109
|
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
110
110
|
*/
|
111
|
-
type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
112
|
-
type AmbassadorRequestOptions<T = any> = {
|
111
|
+
type Method$1 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
112
|
+
type AmbassadorRequestOptions$1<T = any> = {
|
113
113
|
_?: T;
|
114
114
|
url?: string;
|
115
|
-
method?: Method;
|
115
|
+
method?: Method$1;
|
116
116
|
params?: any;
|
117
117
|
data?: any;
|
118
|
-
transformResponse?: ResponseTransformer | ResponseTransformer[];
|
118
|
+
transformResponse?: ResponseTransformer$1 | ResponseTransformer$1[];
|
119
119
|
};
|
120
|
-
type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
|
120
|
+
type AmbassadorFactory$1<Request, Response> = (payload: Request) => ((context: RequestContext$1) => AmbassadorRequestOptions$1<Response>) & {
|
121
121
|
__isAmbassador: boolean;
|
122
122
|
};
|
123
|
-
type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
|
124
|
-
type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
123
|
+
type AmbassadorFunctionDescriptor$1<Request = any, Response = any> = AmbassadorFactory$1<Request, Response>;
|
124
|
+
type BuildAmbassadorFunction$1<T extends AmbassadorFunctionDescriptor$1> = T extends AmbassadorFunctionDescriptor$1<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
125
125
|
|
126
126
|
declare global {
|
127
127
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
@@ -130,7 +130,7 @@ declare global {
|
|
130
130
|
}
|
131
131
|
}
|
132
132
|
|
133
|
-
declare const emptyObjectSymbol: unique symbol;
|
133
|
+
declare const emptyObjectSymbol$1: unique symbol;
|
134
134
|
|
135
135
|
/**
|
136
136
|
Represents a strictly empty plain object, the `{}` value.
|
@@ -158,7 +158,7 @@ Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<n
|
|
158
158
|
|
159
159
|
@category Object
|
160
160
|
*/
|
161
|
-
type EmptyObject = {[emptyObjectSymbol]?: never};
|
161
|
+
type EmptyObject$1 = {[emptyObjectSymbol$1]?: never};
|
162
162
|
|
163
163
|
/**
|
164
164
|
Returns a boolean for whether the two given types are equal.
|
@@ -186,7 +186,7 @@ type Includes<Value extends readonly any[], Item> =
|
|
186
186
|
@category Type Guard
|
187
187
|
@category Utilities
|
188
188
|
*/
|
189
|
-
type IsEqual<A, B> =
|
189
|
+
type IsEqual$1<A, B> =
|
190
190
|
(<G>() => G extends A ? 1 : 2) extends
|
191
191
|
(<G>() => G extends B ? 1 : 2)
|
192
192
|
? true
|
@@ -219,9 +219,9 @@ type Filtered = Filter<'bar', 'foo'>;
|
|
219
219
|
|
220
220
|
@see {Except}
|
221
221
|
*/
|
222
|
-
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
222
|
+
type Filter$1<KeyType, ExcludeType> = IsEqual$1<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
223
223
|
|
224
|
-
type ExceptOptions = {
|
224
|
+
type ExceptOptions$1 = {
|
225
225
|
/**
|
226
226
|
Disallow assigning non-specified properties.
|
227
227
|
|
@@ -265,8 +265,8 @@ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
265
265
|
|
266
266
|
@category Object
|
267
267
|
*/
|
268
|
-
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
|
269
|
-
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
268
|
+
type Except$1<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$1 = {requireExactProps: false}> = {
|
269
|
+
[KeyType in keyof ObjectType as Filter$1<KeyType, KeysType>]: ObjectType[KeyType];
|
270
270
|
} & (Options['requireExactProps'] extends true
|
271
271
|
? Partial<Record<KeysType, never>>
|
272
272
|
: {});
|
@@ -303,7 +303,7 @@ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
303
303
|
|
304
304
|
@category Object
|
305
305
|
*/
|
306
|
-
type ConditionalKeys<Base, Condition> = NonNullable<
|
306
|
+
type ConditionalKeys$1<Base, Condition> = NonNullable<
|
307
307
|
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
308
308
|
{
|
309
309
|
// Map through all the keys of the given base type.
|
@@ -357,9 +357,9 @@ type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
357
357
|
|
358
358
|
@category Object
|
359
359
|
*/
|
360
|
-
type ConditionalExcept<Base, Condition> = Except<
|
360
|
+
type ConditionalExcept$1<Base, Condition> = Except$1<
|
361
361
|
Base,
|
362
|
-
ConditionalKeys<Base, Condition>
|
362
|
+
ConditionalKeys$1<Base, Condition>
|
363
363
|
>;
|
364
364
|
|
365
365
|
/**
|
@@ -367,8 +367,8 @@ ConditionalKeys<Base, Condition>
|
|
367
367
|
* can either be a REST module or a host module.
|
368
368
|
* This type is recursive, so it can describe nested modules.
|
369
369
|
*/
|
370
|
-
type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition$
|
371
|
-
[key: string]: Descriptors | PublicMetadata | any;
|
370
|
+
type Descriptors$1 = RESTFunctionDescriptor$1 | AmbassadorFunctionDescriptor$1 | HostModule$1<any, any> | EventDefinition$3<any> | ServicePluginDefinition$1<any> | {
|
371
|
+
[key: string]: Descriptors$1 | PublicMetadata$1 | any;
|
372
372
|
};
|
373
373
|
/**
|
374
374
|
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
@@ -376,12 +376,12 @@ type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostM
|
|
376
376
|
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
377
377
|
* do not match the given host (as they will not work with the given host).
|
378
378
|
*/
|
379
|
-
type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
|
379
|
+
type BuildDescriptors$1<T extends Descriptors$1, H extends Host$1<any> | undefined, Depth extends number = 5> = {
|
380
380
|
done: T;
|
381
381
|
recurse: T extends {
|
382
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE;
|
383
|
-
} ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition$
|
384
|
-
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
|
382
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$1;
|
383
|
+
} ? never : T extends AmbassadorFunctionDescriptor$1 ? BuildAmbassadorFunction$1<T> : T extends RESTFunctionDescriptor$1 ? BuildRESTFunction$1<T> : T extends EventDefinition$3<any> ? BuildEventDefinition$3<T> : T extends ServicePluginDefinition$1<any> ? BuildServicePluginDefinition$1<T> : T extends HostModule$1<any, any> ? HostModuleAPI$1<T> : ConditionalExcept$1<{
|
384
|
+
[Key in keyof T]: T[Key] extends Descriptors$1 ? BuildDescriptors$1<T[Key], H, [
|
385
385
|
-1,
|
386
386
|
0,
|
387
387
|
1,
|
@@ -390,9 +390,9 @@ type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, De
|
|
390
390
|
4,
|
391
391
|
5
|
392
392
|
][Depth]> : never;
|
393
|
-
}, EmptyObject>;
|
393
|
+
}, EmptyObject$1>;
|
394
394
|
}[Depth extends -1 ? 'done' : 'recurse'];
|
395
|
-
type PublicMetadata = {
|
395
|
+
type PublicMetadata$1 = {
|
396
396
|
PACKAGE_NAME?: string;
|
397
397
|
};
|
398
398
|
|
@@ -404,9 +404,9 @@ declare global {
|
|
404
404
|
* A type used to create concerete types from SDK descriptors in
|
405
405
|
* case a contextual client is available.
|
406
406
|
*/
|
407
|
-
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
408
|
-
host: Host;
|
409
|
-
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
407
|
+
type MaybeContext$1<T extends Descriptors$1> = globalThis.ContextualClient extends {
|
408
|
+
host: Host$1;
|
409
|
+
} ? BuildDescriptors$1<T, globalThis.ContextualClient['host']> : T;
|
410
410
|
|
411
411
|
/**
|
412
412
|
* An order object includes all of the details related to the purchase of a Pricing Plan.
|
@@ -652,11 +652,7 @@ interface Recurrence$1 {
|
|
652
652
|
}
|
653
653
|
/** A duration expressed in number of time units. */
|
654
654
|
interface Duration$1 {
|
655
|
-
/**
|
656
|
-
* The amount of a duration `unit` in a single payment cycle.
|
657
|
-
*
|
658
|
-
* Currently limited to support only `1`.
|
659
|
-
*/
|
655
|
+
/** The amount of a duration `unit` in a single payment cycle. */
|
660
656
|
count?: number | null;
|
661
657
|
/** Unit of time for the cycle duration. */
|
662
658
|
unit?: PeriodUnit$1;
|
@@ -2074,7 +2070,7 @@ interface ManagementListOrdersOptions {
|
|
2074
2070
|
fieldSet?: Set;
|
2075
2071
|
}
|
2076
2072
|
|
2077
|
-
declare function memberGetOrder$1(httpClient: HttpClient): MemberGetOrderSignature;
|
2073
|
+
declare function memberGetOrder$1(httpClient: HttpClient$1): MemberGetOrderSignature;
|
2078
2074
|
interface MemberGetOrderSignature {
|
2079
2075
|
/**
|
2080
2076
|
* Gets an order by ID for the currently logged-in member.
|
@@ -2086,7 +2082,7 @@ interface MemberGetOrderSignature {
|
|
2086
2082
|
*/
|
2087
2083
|
(_id: string, options?: MemberGetOrderOptions | undefined): Promise<Order & OrderNonNullableFields>;
|
2088
2084
|
}
|
2089
|
-
declare function memberListOrders$1(httpClient: HttpClient): MemberListOrdersSignature;
|
2085
|
+
declare function memberListOrders$1(httpClient: HttpClient$1): MemberListOrdersSignature;
|
2090
2086
|
interface MemberListOrdersSignature {
|
2091
2087
|
/**
|
2092
2088
|
* Lists orders for the currently logged-in member.
|
@@ -2096,7 +2092,7 @@ interface MemberListOrdersSignature {
|
|
2096
2092
|
*/
|
2097
2093
|
(options?: MemberListOrdersOptions | undefined): Promise<MemberListOrdersResponse & MemberListOrdersResponseNonNullableFields>;
|
2098
2094
|
}
|
2099
|
-
declare function requestCancellation$1(httpClient: HttpClient): RequestCancellationSignature;
|
2095
|
+
declare function requestCancellation$1(httpClient: HttpClient$1): RequestCancellationSignature;
|
2100
2096
|
interface RequestCancellationSignature {
|
2101
2097
|
/**
|
2102
2098
|
* Starts the process of canceling an order.
|
@@ -2124,7 +2120,7 @@ interface RequestCancellationSignature {
|
|
2124
2120
|
*/
|
2125
2121
|
(_id: string, effectiveAt: CancellationEffectiveAt): Promise<void>;
|
2126
2122
|
}
|
2127
|
-
declare function createOfflineOrder$1(httpClient: HttpClient): CreateOfflineOrderSignature;
|
2123
|
+
declare function createOfflineOrder$1(httpClient: HttpClient$1): CreateOfflineOrderSignature;
|
2128
2124
|
interface CreateOfflineOrderSignature {
|
2129
2125
|
/**
|
2130
2126
|
* Creates an order for a buyer who purchased the plan with an offline transaction.
|
@@ -2149,7 +2145,7 @@ interface CreateOfflineOrderSignature {
|
|
2149
2145
|
*/
|
2150
2146
|
(planId: string, memberId: string, options?: CreateOfflineOrderOptions | undefined): Promise<CreateOfflineOrderResponse & CreateOfflineOrderResponseNonNullableFields>;
|
2151
2147
|
}
|
2152
|
-
declare function getOfflineOrderPreview$1(httpClient: HttpClient): GetOfflineOrderPreviewSignature;
|
2148
|
+
declare function getOfflineOrderPreview$1(httpClient: HttpClient$1): GetOfflineOrderPreviewSignature;
|
2153
2149
|
interface GetOfflineOrderPreviewSignature {
|
2154
2150
|
/**
|
2155
2151
|
* Provides a preview of an offline order as if it was purchased.
|
@@ -2168,7 +2164,7 @@ interface GetOfflineOrderPreviewSignature {
|
|
2168
2164
|
*/
|
2169
2165
|
(planId: string, memberId: string, options?: GetOfflineOrderPreviewOptions | undefined): Promise<GetOfflineOrderPreviewResponse & GetOfflineOrderPreviewResponseNonNullableFields>;
|
2170
2166
|
}
|
2171
|
-
declare function getPricePreview$1(httpClient: HttpClient): GetPricePreviewSignature;
|
2167
|
+
declare function getPricePreview$1(httpClient: HttpClient$1): GetPricePreviewSignature;
|
2172
2168
|
interface GetPricePreviewSignature {
|
2173
2169
|
/**
|
2174
2170
|
* Retrieves a preview of an order's pricing as if it was purchased.
|
@@ -2184,7 +2180,7 @@ interface GetPricePreviewSignature {
|
|
2184
2180
|
*/
|
2185
2181
|
(planId: string, options?: GetPricePreviewOptions | undefined): Promise<GetPricePreviewResponse & GetPricePreviewResponseNonNullableFields>;
|
2186
2182
|
}
|
2187
|
-
declare function managementGetOrder$1(httpClient: HttpClient): ManagementGetOrderSignature;
|
2183
|
+
declare function managementGetOrder$1(httpClient: HttpClient$1): ManagementGetOrderSignature;
|
2188
2184
|
interface ManagementGetOrderSignature {
|
2189
2185
|
/**
|
2190
2186
|
* Retrieves an order by ID.
|
@@ -2195,7 +2191,7 @@ interface ManagementGetOrderSignature {
|
|
2195
2191
|
*/
|
2196
2192
|
(_id: string, options?: ManagementGetOrderOptions | undefined): Promise<GetOrderResponse & GetOrderResponseNonNullableFields>;
|
2197
2193
|
}
|
2198
|
-
declare function managementListOrders$1(httpClient: HttpClient): ManagementListOrdersSignature;
|
2194
|
+
declare function managementListOrders$1(httpClient: HttpClient$1): ManagementListOrdersSignature;
|
2199
2195
|
interface ManagementListOrdersSignature {
|
2200
2196
|
/**
|
2201
2197
|
* Lists pricing plan orders.
|
@@ -2207,7 +2203,7 @@ interface ManagementListOrdersSignature {
|
|
2207
2203
|
*/
|
2208
2204
|
(options?: ManagementListOrdersOptions | undefined): Promise<ListOrdersResponse & ListOrdersResponseNonNullableFields>;
|
2209
2205
|
}
|
2210
|
-
declare function postponeEndDate$1(httpClient: HttpClient): PostponeEndDateSignature;
|
2206
|
+
declare function postponeEndDate$1(httpClient: HttpClient$1): PostponeEndDateSignature;
|
2211
2207
|
interface PostponeEndDateSignature {
|
2212
2208
|
/**
|
2213
2209
|
* Extends the duration of a pricing plan order by postponing the order's `endDate`.
|
@@ -2229,7 +2225,7 @@ interface PostponeEndDateSignature {
|
|
2229
2225
|
*/
|
2230
2226
|
(_id: string, endDate: Date): Promise<void>;
|
2231
2227
|
}
|
2232
|
-
declare function cancelOrder$1(httpClient: HttpClient): CancelOrderSignature;
|
2228
|
+
declare function cancelOrder$1(httpClient: HttpClient$1): CancelOrderSignature;
|
2233
2229
|
interface CancelOrderSignature {
|
2234
2230
|
/**
|
2235
2231
|
* Cancels an existing order.
|
@@ -2260,7 +2256,7 @@ interface CancelOrderSignature {
|
|
2260
2256
|
*/
|
2261
2257
|
(_id: string, effectiveAt: CancellationEffectiveAt): Promise<void>;
|
2262
2258
|
}
|
2263
|
-
declare function markAsPaid$1(httpClient: HttpClient): MarkAsPaidSignature;
|
2259
|
+
declare function markAsPaid$1(httpClient: HttpClient$1): MarkAsPaidSignature;
|
2264
2260
|
interface MarkAsPaidSignature {
|
2265
2261
|
/**
|
2266
2262
|
* Marks an offline order as paid.
|
@@ -2283,7 +2279,7 @@ interface MarkAsPaidSignature {
|
|
2283
2279
|
*/
|
2284
2280
|
(_id: string): Promise<void>;
|
2285
2281
|
}
|
2286
|
-
declare function pauseOrder$1(httpClient: HttpClient): PauseOrderSignature;
|
2282
|
+
declare function pauseOrder$1(httpClient: HttpClient$1): PauseOrderSignature;
|
2287
2283
|
interface PauseOrderSignature {
|
2288
2284
|
/**
|
2289
2285
|
* Pauses a pricing plan order.
|
@@ -2304,7 +2300,7 @@ interface PauseOrderSignature {
|
|
2304
2300
|
*/
|
2305
2301
|
(_id: string): Promise<void>;
|
2306
2302
|
}
|
2307
|
-
declare function resumeOrder$1(httpClient: HttpClient): ResumeOrderSignature;
|
2303
|
+
declare function resumeOrder$1(httpClient: HttpClient$1): ResumeOrderSignature;
|
2308
2304
|
interface ResumeOrderSignature {
|
2309
2305
|
/**
|
2310
2306
|
* Resumes a paused pricing plan order.
|
@@ -2323,30 +2319,30 @@ interface ResumeOrderSignature {
|
|
2323
2319
|
*/
|
2324
2320
|
(_id: string): Promise<void>;
|
2325
2321
|
}
|
2326
|
-
declare const onOrderCanceled$1: EventDefinition$
|
2327
|
-
declare const onOrderCreated$1: EventDefinition$
|
2328
|
-
declare const onOrderUpdated$1: EventDefinition$
|
2329
|
-
declare const onOrderStartDateChanged$1: EventDefinition$
|
2330
|
-
declare const onOrderPurchased$1: EventDefinition$
|
2331
|
-
declare const onOrderStarted$1: EventDefinition$
|
2332
|
-
declare const onOrderCycleStarted$1: EventDefinition$
|
2333
|
-
declare const onOrderAutoRenewCanceled$1: EventDefinition$
|
2334
|
-
declare const onOrderEnded$1: EventDefinition$
|
2335
|
-
declare const onOrderEndDatePostponed$1: EventDefinition$
|
2336
|
-
declare const onOrderMarkedAsPaid$1: EventDefinition$
|
2337
|
-
declare const onOrderPaused$1: EventDefinition$
|
2338
|
-
declare const onOrderResumed$1: EventDefinition$
|
2322
|
+
declare const onOrderCanceled$1: EventDefinition$3<OrderCanceledEnvelope, "wix.pricing_plans.v2.order_canceled">;
|
2323
|
+
declare const onOrderCreated$1: EventDefinition$3<OrderCreatedEnvelope, "wix.pricing_plans.v2.order_created">;
|
2324
|
+
declare const onOrderUpdated$1: EventDefinition$3<OrderUpdatedEnvelope, "wix.pricing_plans.v2.order_updated">;
|
2325
|
+
declare const onOrderStartDateChanged$1: EventDefinition$3<OrderStartDateChangedEnvelope, "wix.pricing_plans.v2.order_start_date_changed">;
|
2326
|
+
declare const onOrderPurchased$1: EventDefinition$3<OrderPurchasedEnvelope, "wix.pricing_plans.v2.order_purchased">;
|
2327
|
+
declare const onOrderStarted$1: EventDefinition$3<OrderStartedEnvelope, "wix.pricing_plans.v2.order_started">;
|
2328
|
+
declare const onOrderCycleStarted$1: EventDefinition$3<OrderCycleStartedEnvelope, "wix.pricing_plans.v2.order_cycle_started">;
|
2329
|
+
declare const onOrderAutoRenewCanceled$1: EventDefinition$3<OrderAutoRenewCanceledEnvelope, "wix.pricing_plans.v2.order_auto_renew_canceled">;
|
2330
|
+
declare const onOrderEnded$1: EventDefinition$3<OrderEndedEnvelope, "wix.pricing_plans.v2.order_ended">;
|
2331
|
+
declare const onOrderEndDatePostponed$1: EventDefinition$3<OrderEndDatePostponedEnvelope, "wix.pricing_plans.v2.order_end_date_postponed">;
|
2332
|
+
declare const onOrderMarkedAsPaid$1: EventDefinition$3<OrderMarkedAsPaidEnvelope, "wix.pricing_plans.v2.order_marked_as_paid">;
|
2333
|
+
declare const onOrderPaused$1: EventDefinition$3<OrderPausedEnvelope, "wix.pricing_plans.v2.order_paused">;
|
2334
|
+
declare const onOrderResumed$1: EventDefinition$3<OrderResumedEnvelope, "wix.pricing_plans.v2.order_resumed">;
|
2339
2335
|
|
2340
|
-
type EventDefinition$
|
2336
|
+
type EventDefinition$2<Payload = unknown, Type extends string = string> = {
|
2341
2337
|
__type: 'event-definition';
|
2342
2338
|
type: Type;
|
2343
2339
|
isDomainEvent?: boolean;
|
2344
2340
|
transformations?: (envelope: unknown) => Payload;
|
2345
2341
|
__payload: Payload;
|
2346
2342
|
};
|
2347
|
-
declare function EventDefinition$
|
2348
|
-
type EventHandler$
|
2349
|
-
type BuildEventDefinition$
|
2343
|
+
declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
|
2344
|
+
type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
|
2345
|
+
type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
|
2350
2346
|
|
2351
2347
|
declare global {
|
2352
2348
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
@@ -2355,21 +2351,21 @@ declare global {
|
|
2355
2351
|
}
|
2356
2352
|
}
|
2357
2353
|
|
2358
|
-
declare function createEventModule$1<T extends EventDefinition$
|
2354
|
+
declare function createEventModule$1<T extends EventDefinition$2<any, string>>(eventDefinition: T): BuildEventDefinition$2<T> & T;
|
2359
2355
|
|
2360
|
-
declare const memberGetOrder: MaybeContext<BuildRESTFunction<typeof memberGetOrder$1> & typeof memberGetOrder$1>;
|
2361
|
-
declare const memberListOrders: MaybeContext<BuildRESTFunction<typeof memberListOrders$1> & typeof memberListOrders$1>;
|
2362
|
-
declare const requestCancellation: MaybeContext<BuildRESTFunction<typeof requestCancellation$1> & typeof requestCancellation$1>;
|
2363
|
-
declare const createOfflineOrder: MaybeContext<BuildRESTFunction<typeof createOfflineOrder$1> & typeof createOfflineOrder$1>;
|
2364
|
-
declare const getOfflineOrderPreview: MaybeContext<BuildRESTFunction<typeof getOfflineOrderPreview$1> & typeof getOfflineOrderPreview$1>;
|
2365
|
-
declare const getPricePreview: MaybeContext<BuildRESTFunction<typeof getPricePreview$1> & typeof getPricePreview$1>;
|
2366
|
-
declare const managementGetOrder: MaybeContext<BuildRESTFunction<typeof managementGetOrder$1> & typeof managementGetOrder$1>;
|
2367
|
-
declare const managementListOrders: MaybeContext<BuildRESTFunction<typeof managementListOrders$1> & typeof managementListOrders$1>;
|
2368
|
-
declare const postponeEndDate: MaybeContext<BuildRESTFunction<typeof postponeEndDate$1> & typeof postponeEndDate$1>;
|
2369
|
-
declare const cancelOrder: MaybeContext<BuildRESTFunction<typeof cancelOrder$1> & typeof cancelOrder$1>;
|
2370
|
-
declare const markAsPaid: MaybeContext<BuildRESTFunction<typeof markAsPaid$1> & typeof markAsPaid$1>;
|
2371
|
-
declare const pauseOrder: MaybeContext<BuildRESTFunction<typeof pauseOrder$1> & typeof pauseOrder$1>;
|
2372
|
-
declare const resumeOrder: MaybeContext<BuildRESTFunction<typeof resumeOrder$1> & typeof resumeOrder$1>;
|
2356
|
+
declare const memberGetOrder: MaybeContext$1<BuildRESTFunction$1<typeof memberGetOrder$1> & typeof memberGetOrder$1>;
|
2357
|
+
declare const memberListOrders: MaybeContext$1<BuildRESTFunction$1<typeof memberListOrders$1> & typeof memberListOrders$1>;
|
2358
|
+
declare const requestCancellation: MaybeContext$1<BuildRESTFunction$1<typeof requestCancellation$1> & typeof requestCancellation$1>;
|
2359
|
+
declare const createOfflineOrder: MaybeContext$1<BuildRESTFunction$1<typeof createOfflineOrder$1> & typeof createOfflineOrder$1>;
|
2360
|
+
declare const getOfflineOrderPreview: MaybeContext$1<BuildRESTFunction$1<typeof getOfflineOrderPreview$1> & typeof getOfflineOrderPreview$1>;
|
2361
|
+
declare const getPricePreview: MaybeContext$1<BuildRESTFunction$1<typeof getPricePreview$1> & typeof getPricePreview$1>;
|
2362
|
+
declare const managementGetOrder: MaybeContext$1<BuildRESTFunction$1<typeof managementGetOrder$1> & typeof managementGetOrder$1>;
|
2363
|
+
declare const managementListOrders: MaybeContext$1<BuildRESTFunction$1<typeof managementListOrders$1> & typeof managementListOrders$1>;
|
2364
|
+
declare const postponeEndDate: MaybeContext$1<BuildRESTFunction$1<typeof postponeEndDate$1> & typeof postponeEndDate$1>;
|
2365
|
+
declare const cancelOrder: MaybeContext$1<BuildRESTFunction$1<typeof cancelOrder$1> & typeof cancelOrder$1>;
|
2366
|
+
declare const markAsPaid: MaybeContext$1<BuildRESTFunction$1<typeof markAsPaid$1> & typeof markAsPaid$1>;
|
2367
|
+
declare const pauseOrder: MaybeContext$1<BuildRESTFunction$1<typeof pauseOrder$1> & typeof pauseOrder$1>;
|
2368
|
+
declare const resumeOrder: MaybeContext$1<BuildRESTFunction$1<typeof resumeOrder$1> & typeof resumeOrder$1>;
|
2373
2369
|
|
2374
2370
|
type _publicOnOrderCanceledType = typeof onOrderCanceled$1;
|
2375
2371
|
/**
|
@@ -2658,6 +2654,416 @@ declare namespace index_d$1 {
|
|
2658
2654
|
export { type ActionEvent$1 as ActionEvent, type ApplicationError$1 as ApplicationError, type index_d$1_ApplyCouponRequest as ApplyCouponRequest, type index_d$1_ApplyCouponResponse as ApplyCouponResponse, type BaseEventMetadata$1 as BaseEventMetadata, type BulkActionMetadata$1 as BulkActionMetadata, type index_d$1_BulkOrderResult as BulkOrderResult, type index_d$1_BulkPauseOrderRequest as BulkPauseOrderRequest, type index_d$1_BulkPauseOrderResponse as BulkPauseOrderResponse, type index_d$1_BulkResumeOrderRequest as BulkResumeOrderRequest, type index_d$1_BulkResumeOrderResponse as BulkResumeOrderResponse, type index_d$1_Buyer as Buyer, type index_d$1_CancelOrderRequest as CancelOrderRequest, type index_d$1_CancelOrderResponse as CancelOrderResponse, type index_d$1_Cancellation as Cancellation, index_d$1_CancellationCause as CancellationCause, index_d$1_CancellationEffectiveAt as CancellationEffectiveAt, type index_d$1_Captcha as Captcha, type index_d$1_ChangeStartDateRequest as ChangeStartDateRequest, type index_d$1_ChangeStartDateResponse as ChangeStartDateResponse, type index_d$1_Coupon as Coupon, type index_d$1_CouponsError as CouponsError, type index_d$1_CreateExternalOrderRequest as CreateExternalOrderRequest, type index_d$1_CreateExternalOrderResponse as CreateExternalOrderResponse, type index_d$1_CreateGuestOnlineOrderRequest as CreateGuestOnlineOrderRequest, type index_d$1_CreateGuestOnlineOrderResponse as CreateGuestOnlineOrderResponse, type index_d$1_CreateOfflineOrderOptions as CreateOfflineOrderOptions, type index_d$1_CreateOfflineOrderRequest as CreateOfflineOrderRequest, type index_d$1_CreateOfflineOrderResponse as CreateOfflineOrderResponse, type index_d$1_CreateOfflineOrderResponseNonNullableFields as CreateOfflineOrderResponseNonNullableFields, type index_d$1_CreateOnlineOrderRequest as CreateOnlineOrderRequest, type index_d$1_CreateOnlineOrderResponse as CreateOnlineOrderResponse, type index_d$1_CurrentCycle as CurrentCycle, type index_d$1_CursorPaging as CursorPaging, type Cursors$1 as Cursors, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type Duration$1 as Duration, type index_d$1_Empty as Empty, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type Fee$1 as Fee, type index_d$1_FormData as FormData, type index_d$1_GetAvailableOrderActionsRequest as GetAvailableOrderActionsRequest, type index_d$1_GetAvailableOrderActionsResponse as GetAvailableOrderActionsResponse, type index_d$1_GetGuestOnlineOrderPreviewRequest as GetGuestOnlineOrderPreviewRequest, type index_d$1_GetGuestOnlineOrderPreviewResponse as GetGuestOnlineOrderPreviewResponse, type index_d$1_GetOfflineOrderPreviewOptions as GetOfflineOrderPreviewOptions, type index_d$1_GetOfflineOrderPreviewRequest as GetOfflineOrderPreviewRequest, type index_d$1_GetOfflineOrderPreviewResponse as GetOfflineOrderPreviewResponse, type index_d$1_GetOfflineOrderPreviewResponseNonNullableFields as GetOfflineOrderPreviewResponseNonNullableFields, type index_d$1_GetOnlineOrderPreviewRequest as GetOnlineOrderPreviewRequest, type index_d$1_GetOnlineOrderPreviewResponse as GetOnlineOrderPreviewResponse, type index_d$1_GetOrderRequest as GetOrderRequest, type index_d$1_GetOrderResponse as GetOrderResponse, type index_d$1_GetOrderResponseNonNullableFields as GetOrderResponseNonNullableFields, type index_d$1_GetOrdersStatsRequest as GetOrdersStatsRequest, type index_d$1_GetOrdersStatsResponse as GetOrdersStatsResponse, type index_d$1_GetPricePreviewOptions as GetPricePreviewOptions, type index_d$1_GetPricePreviewRequest as GetPricePreviewRequest, type index_d$1_GetPricePreviewResponse as GetPricePreviewResponse, type index_d$1_GetPricePreviewResponseNonNullableFields as GetPricePreviewResponseNonNullableFields, type index_d$1_Guest as Guest, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type ItemMetadata$1 as ItemMetadata, type index_d$1_ListOrdersRequest as ListOrdersRequest, type index_d$1_ListOrdersResponse as ListOrdersResponse, type index_d$1_ListOrdersResponseNonNullableFields as ListOrdersResponseNonNullableFields, type index_d$1_ManagementGetOrderOptions as ManagementGetOrderOptions, type index_d$1_ManagementListOrdersOptions as ManagementListOrdersOptions, type index_d$1_MarkAsPaidRequest as MarkAsPaidRequest, type index_d$1_MarkAsPaidResponse as MarkAsPaidResponse, type index_d$1_MemberGetOrderOptions as MemberGetOrderOptions, type index_d$1_MemberGetOrderRequest as MemberGetOrderRequest, type index_d$1_MemberGetOrderResponse as MemberGetOrderResponse, type index_d$1_MemberGetOrderResponseNonNullableFields as MemberGetOrderResponseNonNullableFields, type index_d$1_MemberListOrdersOptions as MemberListOrdersOptions, type index_d$1_MemberListOrdersRequest as MemberListOrdersRequest, type index_d$1_MemberListOrdersResponse as MemberListOrdersResponse, type index_d$1_MemberListOrdersResponseNonNullableFields as MemberListOrdersResponseNonNullableFields, type MessageEnvelope$1 as MessageEnvelope, type index_d$1_OnBehalf as OnBehalf, type index_d$1_Order as Order, type index_d$1_OrderAutoRenewCanceled as OrderAutoRenewCanceled, type index_d$1_OrderAutoRenewCanceledEnvelope as OrderAutoRenewCanceledEnvelope, type index_d$1_OrderCanceled as OrderCanceled, type index_d$1_OrderCanceledEnvelope as OrderCanceledEnvelope, type index_d$1_OrderCreatedEnvelope as OrderCreatedEnvelope, type index_d$1_OrderCycle as OrderCycle, type index_d$1_OrderCycleStarted as OrderCycleStarted, type index_d$1_OrderCycleStartedEnvelope as OrderCycleStartedEnvelope, type index_d$1_OrderEndDatePostponed as OrderEndDatePostponed, type index_d$1_OrderEndDatePostponedEnvelope as OrderEndDatePostponedEnvelope, type index_d$1_OrderEnded as OrderEnded, type index_d$1_OrderEndedEnvelope as OrderEndedEnvelope, type index_d$1_OrderMarkedAsPaid as OrderMarkedAsPaid, type index_d$1_OrderMarkedAsPaidEnvelope as OrderMarkedAsPaidEnvelope, index_d$1_OrderMethod as OrderMethod, type index_d$1_OrderNonNullableFields as OrderNonNullableFields, type index_d$1_OrderPaused as OrderPaused, type index_d$1_OrderPausedEnvelope as OrderPausedEnvelope, type index_d$1_OrderPurchased as OrderPurchased, type index_d$1_OrderPurchasedEnvelope as OrderPurchasedEnvelope, type index_d$1_OrderResumed as OrderResumed, type index_d$1_OrderResumedEnvelope as OrderResumedEnvelope, type index_d$1_OrderStartDateChanged as OrderStartDateChanged, type index_d$1_OrderStartDateChangedEnvelope as OrderStartDateChangedEnvelope, type index_d$1_OrderStarted as OrderStarted, type index_d$1_OrderStartedEnvelope as OrderStartedEnvelope, index_d$1_OrderStatus as OrderStatus, index_d$1_OrderType as OrderType, type index_d$1_OrderUpdatedEnvelope as OrderUpdatedEnvelope, type index_d$1_OrdersQueryOrdersRequest as OrdersQueryOrdersRequest, type index_d$1_OrdersQueryOrdersResponse as OrdersQueryOrdersResponse, type Paging$1 as Paging, type PagingMetadataV2$1 as PagingMetadataV2, type index_d$1_PauseOrderRequest as PauseOrderRequest, type index_d$1_PauseOrderResponse as PauseOrderResponse, type index_d$1_PausePeriod as PausePeriod, index_d$1_PaymentStatus as PaymentStatus, PeriodUnit$1 as PeriodUnit, type index_d$1_PostponeEndDateRequest as PostponeEndDateRequest, type index_d$1_PostponeEndDateResponse as PostponeEndDateResponse, type index_d$1_Price as Price, type index_d$1_PriceDetails as PriceDetails, type index_d$1_PriceDetailsPricingModelOneOf as PriceDetailsPricingModelOneOf, type index_d$1_PriceDuration as PriceDuration, type index_d$1_PricingDetails as PricingDetails, type index_d$1_PricingDetailsPricingModelOneOf as PricingDetailsPricingModelOneOf, type index_d$1_QueryOrdersRequest as QueryOrdersRequest, type index_d$1_QueryOrdersResponse as QueryOrdersResponse, type QueryV2$1 as QueryV2, type index_d$1_QueryV2PagingMethodOneOf as QueryV2PagingMethodOneOf, index_d$1_ReasonNotSuspendable as ReasonNotSuspendable, type Recurrence$1 as Recurrence, type index_d$1_RequestCancellationRequest as RequestCancellationRequest, type index_d$1_RequestCancellationResponse as RequestCancellationResponse, type RestoreInfo$1 as RestoreInfo, type index_d$1_ResumeOrderRequest as ResumeOrderRequest, type index_d$1_ResumeOrderResponse as ResumeOrderResponse, index_d$1_Set as Set, type index_d$1_SetSubmissionRequest as SetSubmissionRequest, type index_d$1_SetSubmissionResponse as SetSubmissionResponse, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, type index_d$1_SpannedPrice as SpannedPrice, index_d$1_Status as Status, type index_d$1_Tax as Tax, WebhookIdentityType$1 as WebhookIdentityType, type index_d$1__publicOnOrderAutoRenewCanceledType as _publicOnOrderAutoRenewCanceledType, type index_d$1__publicOnOrderCanceledType as _publicOnOrderCanceledType, type index_d$1__publicOnOrderCreatedType as _publicOnOrderCreatedType, type index_d$1__publicOnOrderCycleStartedType as _publicOnOrderCycleStartedType, type index_d$1__publicOnOrderEndDatePostponedType as _publicOnOrderEndDatePostponedType, type index_d$1__publicOnOrderEndedType as _publicOnOrderEndedType, type index_d$1__publicOnOrderMarkedAsPaidType as _publicOnOrderMarkedAsPaidType, type index_d$1__publicOnOrderPausedType as _publicOnOrderPausedType, type index_d$1__publicOnOrderPurchasedType as _publicOnOrderPurchasedType, type index_d$1__publicOnOrderResumedType as _publicOnOrderResumedType, type index_d$1__publicOnOrderStartDateChangedType as _publicOnOrderStartDateChangedType, type index_d$1__publicOnOrderStartedType as _publicOnOrderStartedType, type index_d$1__publicOnOrderUpdatedType as _publicOnOrderUpdatedType, index_d$1_cancelOrder as cancelOrder, index_d$1_createOfflineOrder as createOfflineOrder, index_d$1_getOfflineOrderPreview as getOfflineOrderPreview, index_d$1_getPricePreview as getPricePreview, index_d$1_managementGetOrder as managementGetOrder, index_d$1_managementListOrders as managementListOrders, index_d$1_markAsPaid as markAsPaid, index_d$1_memberGetOrder as memberGetOrder, index_d$1_memberListOrders as memberListOrders, index_d$1_onOrderAutoRenewCanceled as onOrderAutoRenewCanceled, index_d$1_onOrderCanceled as onOrderCanceled, index_d$1_onOrderCreated as onOrderCreated, index_d$1_onOrderCycleStarted as onOrderCycleStarted, index_d$1_onOrderEndDatePostponed as onOrderEndDatePostponed, index_d$1_onOrderEnded as onOrderEnded, index_d$1_onOrderMarkedAsPaid as onOrderMarkedAsPaid, index_d$1_onOrderPaused as onOrderPaused, index_d$1_onOrderPurchased as onOrderPurchased, index_d$1_onOrderResumed as onOrderResumed, index_d$1_onOrderStartDateChanged as onOrderStartDateChanged, index_d$1_onOrderStarted as onOrderStarted, index_d$1_onOrderUpdated as onOrderUpdated, index_d$1_pauseOrder as pauseOrder, index_d$1_postponeEndDate as postponeEndDate, onOrderAutoRenewCanceled$1 as publicOnOrderAutoRenewCanceled, onOrderCanceled$1 as publicOnOrderCanceled, onOrderCreated$1 as publicOnOrderCreated, onOrderCycleStarted$1 as publicOnOrderCycleStarted, onOrderEndDatePostponed$1 as publicOnOrderEndDatePostponed, onOrderEnded$1 as publicOnOrderEnded, onOrderMarkedAsPaid$1 as publicOnOrderMarkedAsPaid, onOrderPaused$1 as publicOnOrderPaused, onOrderPurchased$1 as publicOnOrderPurchased, onOrderResumed$1 as publicOnOrderResumed, onOrderStartDateChanged$1 as publicOnOrderStartDateChanged, onOrderStarted$1 as publicOnOrderStarted, onOrderUpdated$1 as publicOnOrderUpdated, index_d$1_requestCancellation as requestCancellation, index_d$1_resumeOrder as resumeOrder };
|
2659
2655
|
}
|
2660
2656
|
|
2657
|
+
type HostModule<T, H extends Host> = {
|
2658
|
+
__type: 'host';
|
2659
|
+
create(host: H): T;
|
2660
|
+
};
|
2661
|
+
type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
|
2662
|
+
type Host<Environment = unknown> = {
|
2663
|
+
channel: {
|
2664
|
+
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
2665
|
+
disconnect: () => void;
|
2666
|
+
} | Promise<{
|
2667
|
+
disconnect: () => void;
|
2668
|
+
}>;
|
2669
|
+
};
|
2670
|
+
environment?: Environment;
|
2671
|
+
/**
|
2672
|
+
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
2673
|
+
*/
|
2674
|
+
apiBaseUrl?: string;
|
2675
|
+
/**
|
2676
|
+
* Possible data to be provided by every host, for cross cutting concerns
|
2677
|
+
* like internationalization, billing, etc.
|
2678
|
+
*/
|
2679
|
+
essentials?: {
|
2680
|
+
/**
|
2681
|
+
* The language of the currently viewed session
|
2682
|
+
*/
|
2683
|
+
language?: string;
|
2684
|
+
/**
|
2685
|
+
* The locale of the currently viewed session
|
2686
|
+
*/
|
2687
|
+
locale?: string;
|
2688
|
+
/**
|
2689
|
+
* Any headers that should be passed through to the API requests
|
2690
|
+
*/
|
2691
|
+
passThroughHeaders?: Record<string, string>;
|
2692
|
+
};
|
2693
|
+
};
|
2694
|
+
|
2695
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
2696
|
+
interface HttpClient {
|
2697
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
2698
|
+
fetchWithAuth: typeof fetch;
|
2699
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
2700
|
+
getActiveToken?: () => string | undefined;
|
2701
|
+
}
|
2702
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
2703
|
+
type HttpResponse<T = any> = {
|
2704
|
+
data: T;
|
2705
|
+
status: number;
|
2706
|
+
statusText: string;
|
2707
|
+
headers: any;
|
2708
|
+
request?: any;
|
2709
|
+
};
|
2710
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
2711
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
2712
|
+
url: string;
|
2713
|
+
data?: Data;
|
2714
|
+
params?: URLSearchParams;
|
2715
|
+
} & APIMetadata;
|
2716
|
+
type APIMetadata = {
|
2717
|
+
methodFqn?: string;
|
2718
|
+
entityFqdn?: string;
|
2719
|
+
packageName?: string;
|
2720
|
+
};
|
2721
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
2722
|
+
type EventDefinition$1<Payload = unknown, Type extends string = string> = {
|
2723
|
+
__type: 'event-definition';
|
2724
|
+
type: Type;
|
2725
|
+
isDomainEvent?: boolean;
|
2726
|
+
transformations?: (envelope: unknown) => Payload;
|
2727
|
+
__payload: Payload;
|
2728
|
+
};
|
2729
|
+
declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
|
2730
|
+
type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
|
2731
|
+
type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
|
2732
|
+
|
2733
|
+
type ServicePluginMethodInput = {
|
2734
|
+
request: any;
|
2735
|
+
metadata: any;
|
2736
|
+
};
|
2737
|
+
type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
|
2738
|
+
type ServicePluginMethodMetadata = {
|
2739
|
+
name: string;
|
2740
|
+
primaryHttpMappingPath: string;
|
2741
|
+
transformations: {
|
2742
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput;
|
2743
|
+
toREST: (...args: unknown[]) => unknown;
|
2744
|
+
};
|
2745
|
+
};
|
2746
|
+
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
2747
|
+
__type: 'service-plugin-definition';
|
2748
|
+
componentType: string;
|
2749
|
+
methods: ServicePluginMethodMetadata[];
|
2750
|
+
__contract: Contract;
|
2751
|
+
};
|
2752
|
+
declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
|
2753
|
+
type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
|
2754
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
|
2755
|
+
|
2756
|
+
type RequestContext = {
|
2757
|
+
isSSR: boolean;
|
2758
|
+
host: string;
|
2759
|
+
protocol?: string;
|
2760
|
+
};
|
2761
|
+
type ResponseTransformer = (data: any, headers?: any) => any;
|
2762
|
+
/**
|
2763
|
+
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
2764
|
+
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
2765
|
+
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
2766
|
+
*/
|
2767
|
+
type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
2768
|
+
type AmbassadorRequestOptions<T = any> = {
|
2769
|
+
_?: T;
|
2770
|
+
url?: string;
|
2771
|
+
method?: Method;
|
2772
|
+
params?: any;
|
2773
|
+
data?: any;
|
2774
|
+
transformResponse?: ResponseTransformer | ResponseTransformer[];
|
2775
|
+
};
|
2776
|
+
type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
|
2777
|
+
__isAmbassador: boolean;
|
2778
|
+
};
|
2779
|
+
type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
|
2780
|
+
type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
2781
|
+
|
2782
|
+
declare global {
|
2783
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
2784
|
+
interface SymbolConstructor {
|
2785
|
+
readonly observable: symbol;
|
2786
|
+
}
|
2787
|
+
}
|
2788
|
+
|
2789
|
+
declare const emptyObjectSymbol: unique symbol;
|
2790
|
+
|
2791
|
+
/**
|
2792
|
+
Represents a strictly empty plain object, the `{}` value.
|
2793
|
+
|
2794
|
+
When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
|
2795
|
+
|
2796
|
+
@example
|
2797
|
+
```
|
2798
|
+
import type {EmptyObject} from 'type-fest';
|
2799
|
+
|
2800
|
+
// The following illustrates the problem with `{}`.
|
2801
|
+
const foo1: {} = {}; // Pass
|
2802
|
+
const foo2: {} = []; // Pass
|
2803
|
+
const foo3: {} = 42; // Pass
|
2804
|
+
const foo4: {} = {a: 1}; // Pass
|
2805
|
+
|
2806
|
+
// With `EmptyObject` only the first case is valid.
|
2807
|
+
const bar1: EmptyObject = {}; // Pass
|
2808
|
+
const bar2: EmptyObject = 42; // Fail
|
2809
|
+
const bar3: EmptyObject = []; // Fail
|
2810
|
+
const bar4: EmptyObject = {a: 1}; // Fail
|
2811
|
+
```
|
2812
|
+
|
2813
|
+
Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
|
2814
|
+
|
2815
|
+
@category Object
|
2816
|
+
*/
|
2817
|
+
type EmptyObject = {[emptyObjectSymbol]?: never};
|
2818
|
+
|
2819
|
+
/**
|
2820
|
+
Returns a boolean for whether the two given types are equal.
|
2821
|
+
|
2822
|
+
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
2823
|
+
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
2824
|
+
|
2825
|
+
Use-cases:
|
2826
|
+
- If you want to make a conditional branch based on the result of a comparison of two types.
|
2827
|
+
|
2828
|
+
@example
|
2829
|
+
```
|
2830
|
+
import type {IsEqual} from 'type-fest';
|
2831
|
+
|
2832
|
+
// This type returns a boolean for whether the given array includes the given item.
|
2833
|
+
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
2834
|
+
type Includes<Value extends readonly any[], Item> =
|
2835
|
+
Value extends readonly [Value[0], ...infer rest]
|
2836
|
+
? IsEqual<Value[0], Item> extends true
|
2837
|
+
? true
|
2838
|
+
: Includes<rest, Item>
|
2839
|
+
: false;
|
2840
|
+
```
|
2841
|
+
|
2842
|
+
@category Type Guard
|
2843
|
+
@category Utilities
|
2844
|
+
*/
|
2845
|
+
type IsEqual<A, B> =
|
2846
|
+
(<G>() => G extends A ? 1 : 2) extends
|
2847
|
+
(<G>() => G extends B ? 1 : 2)
|
2848
|
+
? true
|
2849
|
+
: false;
|
2850
|
+
|
2851
|
+
/**
|
2852
|
+
Filter out keys from an object.
|
2853
|
+
|
2854
|
+
Returns `never` if `Exclude` is strictly equal to `Key`.
|
2855
|
+
Returns `never` if `Key` extends `Exclude`.
|
2856
|
+
Returns `Key` otherwise.
|
2857
|
+
|
2858
|
+
@example
|
2859
|
+
```
|
2860
|
+
type Filtered = Filter<'foo', 'foo'>;
|
2861
|
+
//=> never
|
2862
|
+
```
|
2863
|
+
|
2864
|
+
@example
|
2865
|
+
```
|
2866
|
+
type Filtered = Filter<'bar', string>;
|
2867
|
+
//=> never
|
2868
|
+
```
|
2869
|
+
|
2870
|
+
@example
|
2871
|
+
```
|
2872
|
+
type Filtered = Filter<'bar', 'foo'>;
|
2873
|
+
//=> 'bar'
|
2874
|
+
```
|
2875
|
+
|
2876
|
+
@see {Except}
|
2877
|
+
*/
|
2878
|
+
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
2879
|
+
|
2880
|
+
type ExceptOptions = {
|
2881
|
+
/**
|
2882
|
+
Disallow assigning non-specified properties.
|
2883
|
+
|
2884
|
+
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
2885
|
+
|
2886
|
+
@default false
|
2887
|
+
*/
|
2888
|
+
requireExactProps?: boolean;
|
2889
|
+
};
|
2890
|
+
|
2891
|
+
/**
|
2892
|
+
Create a type from an object type without certain keys.
|
2893
|
+
|
2894
|
+
We recommend setting the `requireExactProps` option to `true`.
|
2895
|
+
|
2896
|
+
This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
|
2897
|
+
|
2898
|
+
This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
|
2899
|
+
|
2900
|
+
@example
|
2901
|
+
```
|
2902
|
+
import type {Except} from 'type-fest';
|
2903
|
+
|
2904
|
+
type Foo = {
|
2905
|
+
a: number;
|
2906
|
+
b: string;
|
2907
|
+
};
|
2908
|
+
|
2909
|
+
type FooWithoutA = Except<Foo, 'a'>;
|
2910
|
+
//=> {b: string}
|
2911
|
+
|
2912
|
+
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
2913
|
+
//=> errors: 'a' does not exist in type '{ b: string; }'
|
2914
|
+
|
2915
|
+
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
2916
|
+
//=> {a: number} & Partial<Record<"b", never>>
|
2917
|
+
|
2918
|
+
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
2919
|
+
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
2920
|
+
```
|
2921
|
+
|
2922
|
+
@category Object
|
2923
|
+
*/
|
2924
|
+
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
|
2925
|
+
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
2926
|
+
} & (Options['requireExactProps'] extends true
|
2927
|
+
? Partial<Record<KeysType, never>>
|
2928
|
+
: {});
|
2929
|
+
|
2930
|
+
/**
|
2931
|
+
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
2932
|
+
|
2933
|
+
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
2934
|
+
|
2935
|
+
@example
|
2936
|
+
```
|
2937
|
+
import type {ConditionalKeys} from 'type-fest';
|
2938
|
+
|
2939
|
+
interface Example {
|
2940
|
+
a: string;
|
2941
|
+
b: string | number;
|
2942
|
+
c?: string;
|
2943
|
+
d: {};
|
2944
|
+
}
|
2945
|
+
|
2946
|
+
type StringKeysOnly = ConditionalKeys<Example, string>;
|
2947
|
+
//=> 'a'
|
2948
|
+
```
|
2949
|
+
|
2950
|
+
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
2951
|
+
|
2952
|
+
@example
|
2953
|
+
```
|
2954
|
+
import type {ConditionalKeys} from 'type-fest';
|
2955
|
+
|
2956
|
+
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
2957
|
+
//=> 'a' | 'c'
|
2958
|
+
```
|
2959
|
+
|
2960
|
+
@category Object
|
2961
|
+
*/
|
2962
|
+
type ConditionalKeys<Base, Condition> = NonNullable<
|
2963
|
+
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
2964
|
+
{
|
2965
|
+
// Map through all the keys of the given base type.
|
2966
|
+
[Key in keyof Base]:
|
2967
|
+
// Pick only keys with types extending the given `Condition` type.
|
2968
|
+
Base[Key] extends Condition
|
2969
|
+
// Retain this key since the condition passes.
|
2970
|
+
? Key
|
2971
|
+
// Discard this key since the condition fails.
|
2972
|
+
: never;
|
2973
|
+
|
2974
|
+
// Convert the produced object into a union type of the keys which passed the conditional test.
|
2975
|
+
}[keyof Base]
|
2976
|
+
>;
|
2977
|
+
|
2978
|
+
/**
|
2979
|
+
Exclude keys from a shape that matches the given `Condition`.
|
2980
|
+
|
2981
|
+
This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
|
2982
|
+
|
2983
|
+
@example
|
2984
|
+
```
|
2985
|
+
import type {Primitive, ConditionalExcept} from 'type-fest';
|
2986
|
+
|
2987
|
+
class Awesome {
|
2988
|
+
name: string;
|
2989
|
+
successes: number;
|
2990
|
+
failures: bigint;
|
2991
|
+
|
2992
|
+
run() {}
|
2993
|
+
}
|
2994
|
+
|
2995
|
+
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
2996
|
+
//=> {run: () => void}
|
2997
|
+
```
|
2998
|
+
|
2999
|
+
@example
|
3000
|
+
```
|
3001
|
+
import type {ConditionalExcept} from 'type-fest';
|
3002
|
+
|
3003
|
+
interface Example {
|
3004
|
+
a: string;
|
3005
|
+
b: string | number;
|
3006
|
+
c: () => void;
|
3007
|
+
d: {};
|
3008
|
+
}
|
3009
|
+
|
3010
|
+
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
3011
|
+
//=> {b: string | number; c: () => void; d: {}}
|
3012
|
+
```
|
3013
|
+
|
3014
|
+
@category Object
|
3015
|
+
*/
|
3016
|
+
type ConditionalExcept<Base, Condition> = Except<
|
3017
|
+
Base,
|
3018
|
+
ConditionalKeys<Base, Condition>
|
3019
|
+
>;
|
3020
|
+
|
3021
|
+
/**
|
3022
|
+
* Descriptors are objects that describe the API of a module, and the module
|
3023
|
+
* can either be a REST module or a host module.
|
3024
|
+
* This type is recursive, so it can describe nested modules.
|
3025
|
+
*/
|
3026
|
+
type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition$1<any> | ServicePluginDefinition<any> | {
|
3027
|
+
[key: string]: Descriptors | PublicMetadata | any;
|
3028
|
+
};
|
3029
|
+
/**
|
3030
|
+
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
3031
|
+
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
3032
|
+
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
3033
|
+
* do not match the given host (as they will not work with the given host).
|
3034
|
+
*/
|
3035
|
+
type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
|
3036
|
+
done: T;
|
3037
|
+
recurse: T extends {
|
3038
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE;
|
3039
|
+
} ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition$1<any> ? BuildEventDefinition$1<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
|
3040
|
+
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
|
3041
|
+
-1,
|
3042
|
+
0,
|
3043
|
+
1,
|
3044
|
+
2,
|
3045
|
+
3,
|
3046
|
+
4,
|
3047
|
+
5
|
3048
|
+
][Depth]> : never;
|
3049
|
+
}, EmptyObject>;
|
3050
|
+
}[Depth extends -1 ? 'done' : 'recurse'];
|
3051
|
+
type PublicMetadata = {
|
3052
|
+
PACKAGE_NAME?: string;
|
3053
|
+
};
|
3054
|
+
|
3055
|
+
declare global {
|
3056
|
+
interface ContextualClient {
|
3057
|
+
}
|
3058
|
+
}
|
3059
|
+
/**
|
3060
|
+
* A type used to create concerete types from SDK descriptors in
|
3061
|
+
* case a contextual client is available.
|
3062
|
+
*/
|
3063
|
+
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
3064
|
+
host: Host;
|
3065
|
+
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
3066
|
+
|
2661
3067
|
/** Information about the pricing plan. */
|
2662
3068
|
interface Plan {
|
2663
3069
|
/**
|
@@ -3728,10 +4134,10 @@ interface ArchivePlanSignature {
|
|
3728
4134
|
*/
|
3729
4135
|
(_id: string): Promise<ArchivePlanResponse & ArchivePlanResponseNonNullableFields>;
|
3730
4136
|
}
|
3731
|
-
declare const onPlanUpdated$1: EventDefinition$
|
3732
|
-
declare const onPlanCreated$1: EventDefinition$
|
3733
|
-
declare const onPlanBuyerCanCancelUpdated$1: EventDefinition$
|
3734
|
-
declare const onPlanArchived$1: EventDefinition$
|
4137
|
+
declare const onPlanUpdated$1: EventDefinition$1<PlanUpdatedEnvelope, "wix.pricing_plans.plan_updated">;
|
4138
|
+
declare const onPlanCreated$1: EventDefinition$1<PlanCreatedEnvelope, "wix.pricing_plans.plan_created">;
|
4139
|
+
declare const onPlanBuyerCanCancelUpdated$1: EventDefinition$1<PlanBuyerCanCancelUpdatedEnvelope, "wix.pricing_plans.plan_buyer_can_cancel_updated">;
|
4140
|
+
declare const onPlanArchived$1: EventDefinition$1<PlanArchivedEnvelope, "wix.pricing_plans.plan_plan_archived">;
|
3735
4141
|
|
3736
4142
|
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
3737
4143
|
__type: 'event-definition';
|