@wix/app-management 1.0.37 → 1.0.38
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 +2 -2
- package/type-bundles/context.bundle.d.ts +165 -29
- package/type-bundles/index.bundle.d.ts +165 -29
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/app-management",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.38",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"fqdn": ""
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
|
-
"falconPackageHash": "
|
|
52
|
+
"falconPackageHash": "181077870d42275fbce53ccdd9b196748b2238efaf7f6821a83342c1"
|
|
53
53
|
}
|
|
@@ -1,39 +1,29 @@
|
|
|
1
|
-
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
2
|
-
interface HttpClient {
|
|
3
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
1
|
+
type RESTFunctionDescriptor$4<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$4) => T;
|
|
2
|
+
interface HttpClient$4 {
|
|
3
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$4<TResponse, TData>): Promise<HttpResponse$4<TResponse>>;
|
|
4
4
|
fetchWithAuth: typeof fetch;
|
|
5
5
|
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
6
6
|
}
|
|
7
|
-
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
8
|
-
type HttpResponse<T = any> = {
|
|
7
|
+
type RequestOptionsFactory$4<TResponse = any, TData = any> = (context: any) => RequestOptions$4<TResponse, TData>;
|
|
8
|
+
type HttpResponse$4<T = any> = {
|
|
9
9
|
data: T;
|
|
10
10
|
status: number;
|
|
11
11
|
statusText: string;
|
|
12
12
|
headers: any;
|
|
13
13
|
request?: any;
|
|
14
14
|
};
|
|
15
|
-
type RequestOptions<_TResponse = any, Data = any> = {
|
|
15
|
+
type RequestOptions$4<_TResponse = any, Data = any> = {
|
|
16
16
|
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
17
17
|
url: string;
|
|
18
18
|
data?: Data;
|
|
19
19
|
params?: URLSearchParams;
|
|
20
|
-
} & APIMetadata;
|
|
21
|
-
type APIMetadata = {
|
|
20
|
+
} & APIMetadata$4;
|
|
21
|
+
type APIMetadata$4 = {
|
|
22
22
|
methodFqn?: string;
|
|
23
23
|
entityFqdn?: string;
|
|
24
24
|
packageName?: string;
|
|
25
25
|
};
|
|
26
|
-
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
27
|
-
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
28
|
-
__type: 'event-definition';
|
|
29
|
-
type: Type;
|
|
30
|
-
isDomainEvent?: boolean;
|
|
31
|
-
transformations?: (envelope: unknown) => Payload;
|
|
32
|
-
__payload: Payload;
|
|
33
|
-
};
|
|
34
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
35
|
-
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
36
|
-
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
26
|
+
type BuildRESTFunction$4<T extends RESTFunctionDescriptor$4> = T extends RESTFunctionDescriptor$4<infer U> ? U : never;
|
|
37
27
|
|
|
38
28
|
declare global {
|
|
39
29
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
@@ -306,7 +296,7 @@ interface ListAppPlansByAppIdResponseNonNullableFields {
|
|
|
306
296
|
appPlans: AppPlansNonNullableFields[];
|
|
307
297
|
}
|
|
308
298
|
|
|
309
|
-
declare function listAppPlansByAppId$1(httpClient: HttpClient): ListAppPlansByAppIdSignature;
|
|
299
|
+
declare function listAppPlansByAppId$1(httpClient: HttpClient$4): ListAppPlansByAppIdSignature;
|
|
310
300
|
interface ListAppPlansByAppIdSignature {
|
|
311
301
|
/**
|
|
312
302
|
* Retrieves plans for the given apps.
|
|
@@ -340,7 +330,7 @@ interface ListAppPlansByAppIdSignature {
|
|
|
340
330
|
(appIds: string[]): Promise<ListAppPlansByAppIdResponse & ListAppPlansByAppIdResponseNonNullableFields>;
|
|
341
331
|
}
|
|
342
332
|
|
|
343
|
-
declare const listAppPlansByAppId: BuildRESTFunction<typeof listAppPlansByAppId$1> & typeof listAppPlansByAppId$1;
|
|
333
|
+
declare const listAppPlansByAppId: BuildRESTFunction$4<typeof listAppPlansByAppId$1> & typeof listAppPlansByAppId$1;
|
|
344
334
|
|
|
345
335
|
type context$4_AppPlans = AppPlans;
|
|
346
336
|
type context$4_Cycle = Cycle;
|
|
@@ -366,6 +356,50 @@ declare namespace context$4 {
|
|
|
366
356
|
export { type context$4_AppPlans as AppPlans, type context$4_Cycle as Cycle, context$4_CycleType as CycleType, type context$4_Discount as Discount, context$4_DiscountType as DiscountType, type context$4_Duration as Duration, context$4_DurationUnit as DurationUnit, type context$4_ListAppPlansByAppIdRequest as ListAppPlansByAppIdRequest, type context$4_ListAppPlansByAppIdResponse as ListAppPlansByAppIdResponse, type context$4_ListAppPlansByAppIdResponseNonNullableFields as ListAppPlansByAppIdResponseNonNullableFields, type context$4_Plan as Plan, type context$4_Price as Price, type context$4_TaxSettings as TaxSettings, context$4_TaxType as TaxType, type context$4_UsageBasedDetails as UsageBasedDetails, context$4_listAppPlansByAppId as listAppPlansByAppId };
|
|
367
357
|
}
|
|
368
358
|
|
|
359
|
+
type RESTFunctionDescriptor$3<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$3) => T;
|
|
360
|
+
interface HttpClient$3 {
|
|
361
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$3<TResponse, TData>): Promise<HttpResponse$3<TResponse>>;
|
|
362
|
+
fetchWithAuth: typeof fetch;
|
|
363
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
364
|
+
}
|
|
365
|
+
type RequestOptionsFactory$3<TResponse = any, TData = any> = (context: any) => RequestOptions$3<TResponse, TData>;
|
|
366
|
+
type HttpResponse$3<T = any> = {
|
|
367
|
+
data: T;
|
|
368
|
+
status: number;
|
|
369
|
+
statusText: string;
|
|
370
|
+
headers: any;
|
|
371
|
+
request?: any;
|
|
372
|
+
};
|
|
373
|
+
type RequestOptions$3<_TResponse = any, Data = any> = {
|
|
374
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
375
|
+
url: string;
|
|
376
|
+
data?: Data;
|
|
377
|
+
params?: URLSearchParams;
|
|
378
|
+
} & APIMetadata$3;
|
|
379
|
+
type APIMetadata$3 = {
|
|
380
|
+
methodFqn?: string;
|
|
381
|
+
entityFqdn?: string;
|
|
382
|
+
packageName?: string;
|
|
383
|
+
};
|
|
384
|
+
type BuildRESTFunction$3<T extends RESTFunctionDescriptor$3> = T extends RESTFunctionDescriptor$3<infer U> ? U : never;
|
|
385
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
386
|
+
__type: 'event-definition';
|
|
387
|
+
type: Type;
|
|
388
|
+
isDomainEvent?: boolean;
|
|
389
|
+
transformations?: (envelope: unknown) => Payload;
|
|
390
|
+
__payload: Payload;
|
|
391
|
+
};
|
|
392
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
393
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
394
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
395
|
+
|
|
396
|
+
declare global {
|
|
397
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
398
|
+
interface SymbolConstructor {
|
|
399
|
+
readonly observable: symbol;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
369
403
|
/**
|
|
370
404
|
* An app instance is a specific occurrence of your app on a particular Wix site.
|
|
371
405
|
* When a site owner installs your app, a unique instance is generated for that
|
|
@@ -767,7 +801,7 @@ interface AppInstancePaidPlanAutoRenewalCancelledEnvelope {
|
|
|
767
801
|
metadata: BaseEventMetadata;
|
|
768
802
|
}
|
|
769
803
|
|
|
770
|
-
declare function getAppInstance$1(httpClient: HttpClient): GetAppInstanceSignature;
|
|
804
|
+
declare function getAppInstance$1(httpClient: HttpClient$3): GetAppInstanceSignature;
|
|
771
805
|
interface GetAppInstanceSignature {
|
|
772
806
|
/**
|
|
773
807
|
* Retrieves data about the instance of your app that's installed on a Wix site and data about the site itself.
|
|
@@ -788,7 +822,7 @@ declare const onAppInstancePaidPlanAutoRenewalCancelled$1: EventDefinition<AppIn
|
|
|
788
822
|
|
|
789
823
|
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
790
824
|
|
|
791
|
-
declare const getAppInstance: BuildRESTFunction<typeof getAppInstance$1> & typeof getAppInstance$1;
|
|
825
|
+
declare const getAppInstance: BuildRESTFunction$3<typeof getAppInstance$1> & typeof getAppInstance$1;
|
|
792
826
|
|
|
793
827
|
type _publicOnAppInstanceInstalledType = typeof onAppInstanceInstalled$1;
|
|
794
828
|
/**
|
|
@@ -865,6 +899,40 @@ declare namespace context$3 {
|
|
|
865
899
|
export { type context$3_AppInstalled as AppInstalled, type context$3_AppInstance as AppInstance, type context$3_AppInstanceInstalledEnvelope as AppInstanceInstalledEnvelope, type context$3_AppInstancePaidPlanAutoRenewalCancelledEnvelope as AppInstancePaidPlanAutoRenewalCancelledEnvelope, type context$3_AppInstancePaidPlanChangedEnvelope as AppInstancePaidPlanChangedEnvelope, type context$3_AppInstancePaidPlanPurchasedEnvelope as AppInstancePaidPlanPurchasedEnvelope, type context$3_AppInstanceRemovedEnvelope as AppInstanceRemovedEnvelope, type context$3_AppRemoved as AppRemoved, type context$3_AvailablePlan as AvailablePlan, type context$3_BaseEventMetadata as BaseEventMetadata, type context$3_BillingInfo as BillingInfo, type context$3_FreeTrialInfo as FreeTrialInfo, context$3_FreeTrialStatus as FreeTrialStatus, type context$3_GetAppInstanceByInstanceIdRequest as GetAppInstanceByInstanceIdRequest, type context$3_GetAppInstanceRequest as GetAppInstanceRequest, type context$3_GetAppInstanceResponse as GetAppInstanceResponse, type context$3_GetAppInstanceResponseNonNullableFields as GetAppInstanceResponseNonNullableFields, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type context$3_Locale as Locale, type MessageEnvelope$1 as MessageEnvelope, type context$3_Multilingual as Multilingual, type context$3_OwnerInfo as OwnerInfo, type context$3_PaidPlanAutoRenewalCancelled as PaidPlanAutoRenewalCancelled, type context$3_PaidPlanChanged as PaidPlanChanged, type context$3_PaidPlanPurchased as PaidPlanPurchased, PaymentCycle$1 as PaymentCycle, context$3_ResolutionMethod as ResolutionMethod, type context$3_SiteInfo as SiteInfo, type context$3_SupportedLanguage as SupportedLanguage, WebhookIdentityType$1 as WebhookIdentityType, type context$3__publicOnAppInstanceInstalledType as _publicOnAppInstanceInstalledType, type context$3__publicOnAppInstancePaidPlanAutoRenewalCancelledType as _publicOnAppInstancePaidPlanAutoRenewalCancelledType, type context$3__publicOnAppInstancePaidPlanChangedType as _publicOnAppInstancePaidPlanChangedType, type context$3__publicOnAppInstancePaidPlanPurchasedType as _publicOnAppInstancePaidPlanPurchasedType, type context$3__publicOnAppInstanceRemovedType as _publicOnAppInstanceRemovedType, context$3_getAppInstance as getAppInstance, context$3_onAppInstanceInstalled as onAppInstanceInstalled, context$3_onAppInstancePaidPlanAutoRenewalCancelled as onAppInstancePaidPlanAutoRenewalCancelled, context$3_onAppInstancePaidPlanChanged as onAppInstancePaidPlanChanged, context$3_onAppInstancePaidPlanPurchased as onAppInstancePaidPlanPurchased, context$3_onAppInstanceRemoved as onAppInstanceRemoved, onAppInstanceInstalled$1 as publicOnAppInstanceInstalled, onAppInstancePaidPlanAutoRenewalCancelled$1 as publicOnAppInstancePaidPlanAutoRenewalCancelled, onAppInstancePaidPlanChanged$1 as publicOnAppInstancePaidPlanChanged, onAppInstancePaidPlanPurchased$1 as publicOnAppInstancePaidPlanPurchased, onAppInstanceRemoved$1 as publicOnAppInstanceRemoved };
|
|
866
900
|
}
|
|
867
901
|
|
|
902
|
+
type RESTFunctionDescriptor$2<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$2) => T;
|
|
903
|
+
interface HttpClient$2 {
|
|
904
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
|
|
905
|
+
fetchWithAuth: typeof fetch;
|
|
906
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
907
|
+
}
|
|
908
|
+
type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
|
|
909
|
+
type HttpResponse$2<T = any> = {
|
|
910
|
+
data: T;
|
|
911
|
+
status: number;
|
|
912
|
+
statusText: string;
|
|
913
|
+
headers: any;
|
|
914
|
+
request?: any;
|
|
915
|
+
};
|
|
916
|
+
type RequestOptions$2<_TResponse = any, Data = any> = {
|
|
917
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
918
|
+
url: string;
|
|
919
|
+
data?: Data;
|
|
920
|
+
params?: URLSearchParams;
|
|
921
|
+
} & APIMetadata$2;
|
|
922
|
+
type APIMetadata$2 = {
|
|
923
|
+
methodFqn?: string;
|
|
924
|
+
entityFqdn?: string;
|
|
925
|
+
packageName?: string;
|
|
926
|
+
};
|
|
927
|
+
type BuildRESTFunction$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
|
|
928
|
+
|
|
929
|
+
declare global {
|
|
930
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
931
|
+
interface SymbolConstructor {
|
|
932
|
+
readonly observable: symbol;
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
|
|
868
936
|
interface SendBIEventResponse {
|
|
869
937
|
}
|
|
870
938
|
interface SendBIEventRequest {
|
|
@@ -953,7 +1021,7 @@ interface SendBiEventOptions {
|
|
|
953
1021
|
eventData?: Record<string, string>;
|
|
954
1022
|
}
|
|
955
1023
|
|
|
956
|
-
declare function sendBiEvent$1(httpClient: HttpClient): SendBiEventSignature;
|
|
1024
|
+
declare function sendBiEvent$1(httpClient: HttpClient$2): SendBiEventSignature;
|
|
957
1025
|
interface SendBiEventSignature {
|
|
958
1026
|
/**
|
|
959
1027
|
* Submit a BI event to Wix.
|
|
@@ -961,7 +1029,7 @@ interface SendBiEventSignature {
|
|
|
961
1029
|
(options?: SendBiEventOptions | undefined): Promise<void>;
|
|
962
1030
|
}
|
|
963
1031
|
|
|
964
|
-
declare const sendBiEvent: BuildRESTFunction<typeof sendBiEvent$1> & typeof sendBiEvent$1;
|
|
1032
|
+
declare const sendBiEvent: BuildRESTFunction$2<typeof sendBiEvent$1> & typeof sendBiEvent$1;
|
|
965
1033
|
|
|
966
1034
|
type context$2_EventName = EventName;
|
|
967
1035
|
declare const context$2_EventName: typeof EventName;
|
|
@@ -973,6 +1041,40 @@ declare namespace context$2 {
|
|
|
973
1041
|
export { context$2_EventName as EventName, type context$2_SendBIEventRequest as SendBIEventRequest, type context$2_SendBIEventResponse as SendBIEventResponse, type context$2_SendBiEventOptions as SendBiEventOptions, context$2_sendBiEvent as sendBiEvent };
|
|
974
1042
|
}
|
|
975
1043
|
|
|
1044
|
+
type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
|
|
1045
|
+
interface HttpClient$1 {
|
|
1046
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
|
|
1047
|
+
fetchWithAuth: typeof fetch;
|
|
1048
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
1049
|
+
}
|
|
1050
|
+
type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
|
|
1051
|
+
type HttpResponse$1<T = any> = {
|
|
1052
|
+
data: T;
|
|
1053
|
+
status: number;
|
|
1054
|
+
statusText: string;
|
|
1055
|
+
headers: any;
|
|
1056
|
+
request?: any;
|
|
1057
|
+
};
|
|
1058
|
+
type RequestOptions$1<_TResponse = any, Data = any> = {
|
|
1059
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
1060
|
+
url: string;
|
|
1061
|
+
data?: Data;
|
|
1062
|
+
params?: URLSearchParams;
|
|
1063
|
+
} & APIMetadata$1;
|
|
1064
|
+
type APIMetadata$1 = {
|
|
1065
|
+
methodFqn?: string;
|
|
1066
|
+
entityFqdn?: string;
|
|
1067
|
+
packageName?: string;
|
|
1068
|
+
};
|
|
1069
|
+
type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
|
|
1070
|
+
|
|
1071
|
+
declare global {
|
|
1072
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
1073
|
+
interface SymbolConstructor {
|
|
1074
|
+
readonly observable: symbol;
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
|
|
976
1078
|
interface PurchasedItem {
|
|
977
1079
|
/** ID of your app's paid plan. */
|
|
978
1080
|
productId?: string;
|
|
@@ -1225,7 +1327,7 @@ interface GetUrlOptions {
|
|
|
1225
1327
|
couponCode?: string | null;
|
|
1226
1328
|
}
|
|
1227
1329
|
|
|
1228
|
-
declare function getUrl$1(httpClient: HttpClient): GetUrlSignature;
|
|
1330
|
+
declare function getUrl$1(httpClient: HttpClient$1): GetUrlSignature;
|
|
1229
1331
|
interface GetUrlSignature {
|
|
1230
1332
|
/**
|
|
1231
1333
|
* Retrieves the URL for a Wix checkout page for the specified paid plan of your app.
|
|
@@ -1243,7 +1345,7 @@ interface GetUrlSignature {
|
|
|
1243
1345
|
*/
|
|
1244
1346
|
(productId: string, options?: GetUrlOptions | undefined): Promise<GetUrlResponse & GetUrlResponseNonNullableFields>;
|
|
1245
1347
|
}
|
|
1246
|
-
declare function getPurchaseHistory$1(httpClient: HttpClient): GetPurchaseHistorySignature;
|
|
1348
|
+
declare function getPurchaseHistory$1(httpClient: HttpClient$1): GetPurchaseHistorySignature;
|
|
1247
1349
|
interface GetPurchaseHistorySignature {
|
|
1248
1350
|
/**
|
|
1249
1351
|
* Retrieves a list of the site owner's past purchases for your app.
|
|
@@ -1257,8 +1359,8 @@ interface GetPurchaseHistorySignature {
|
|
|
1257
1359
|
(): Promise<GetPurchaseHistoryResponse & GetPurchaseHistoryResponseNonNullableFields>;
|
|
1258
1360
|
}
|
|
1259
1361
|
|
|
1260
|
-
declare const getUrl: BuildRESTFunction<typeof getUrl$1> & typeof getUrl$1;
|
|
1261
|
-
declare const getPurchaseHistory: BuildRESTFunction<typeof getPurchaseHistory$1> & typeof getPurchaseHistory$1;
|
|
1362
|
+
declare const getUrl: BuildRESTFunction$1<typeof getUrl$1> & typeof getUrl$1;
|
|
1363
|
+
declare const getPurchaseHistory: BuildRESTFunction$1<typeof getPurchaseHistory$1> & typeof getPurchaseHistory$1;
|
|
1262
1364
|
|
|
1263
1365
|
type context$1_Charge = Charge;
|
|
1264
1366
|
type context$1_ChargeOverride = ChargeOverride;
|
|
@@ -1290,6 +1392,40 @@ declare namespace context$1 {
|
|
|
1290
1392
|
export { type context$1_Charge as Charge, type context$1_ChargeOverride as ChargeOverride, type context$1_GetMeteredBillingChargesRequest as GetMeteredBillingChargesRequest, type context$1_GetMeteredBillingChargesResponse as GetMeteredBillingChargesResponse, type context$1_GetPurchaseHistoryRequest as GetPurchaseHistoryRequest, type context$1_GetPurchaseHistoryResponse as GetPurchaseHistoryResponse, type context$1_GetPurchaseHistoryResponseNonNullableFields as GetPurchaseHistoryResponseNonNullableFields, type context$1_GetSitePaymentMethodsStatusRequest as GetSitePaymentMethodsStatusRequest, type context$1_GetSitePaymentMethodsStatusResponse as GetSitePaymentMethodsStatusResponse, type context$1_GetUrlOptions as GetUrlOptions, type context$1_GetUrlRequest as GetUrlRequest, type context$1_GetUrlResponse as GetUrlResponse, type context$1_GetUrlResponseNonNullableFields as GetUrlResponseNonNullableFields, type context$1_IdentificationData as IdentificationData, type context$1_IdentificationDataIdOneOf as IdentificationDataIdOneOf, context$1_InvoiceStatus as InvoiceStatus, type context$1_InvoiceStatusUpdate as InvoiceStatusUpdate, type context$1_MessageEnvelope as MessageEnvelope, context$1_PaymentCycle as PaymentCycle, type context$1_PurchasedItem as PurchasedItem, context$1_WebhookIdentityType as WebhookIdentityType, context$1_getPurchaseHistory as getPurchaseHistory, context$1_getUrl as getUrl };
|
|
1291
1393
|
}
|
|
1292
1394
|
|
|
1395
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
1396
|
+
interface HttpClient {
|
|
1397
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
1398
|
+
fetchWithAuth: typeof fetch;
|
|
1399
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
1400
|
+
}
|
|
1401
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
1402
|
+
type HttpResponse<T = any> = {
|
|
1403
|
+
data: T;
|
|
1404
|
+
status: number;
|
|
1405
|
+
statusText: string;
|
|
1406
|
+
headers: any;
|
|
1407
|
+
request?: any;
|
|
1408
|
+
};
|
|
1409
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
1410
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
1411
|
+
url: string;
|
|
1412
|
+
data?: Data;
|
|
1413
|
+
params?: URLSearchParams;
|
|
1414
|
+
} & APIMetadata;
|
|
1415
|
+
type APIMetadata = {
|
|
1416
|
+
methodFqn?: string;
|
|
1417
|
+
entityFqdn?: string;
|
|
1418
|
+
packageName?: string;
|
|
1419
|
+
};
|
|
1420
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
1421
|
+
|
|
1422
|
+
declare global {
|
|
1423
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
1424
|
+
interface SymbolConstructor {
|
|
1425
|
+
readonly observable: symbol;
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1293
1429
|
/** Embedded script data */
|
|
1294
1430
|
interface ScriptProperties {
|
|
1295
1431
|
/** Script parameters */
|
|
@@ -1,39 +1,29 @@
|
|
|
1
|
-
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
2
|
-
interface HttpClient {
|
|
3
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
1
|
+
type RESTFunctionDescriptor$4<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$4) => T;
|
|
2
|
+
interface HttpClient$4 {
|
|
3
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$4<TResponse, TData>): Promise<HttpResponse$4<TResponse>>;
|
|
4
4
|
fetchWithAuth: typeof fetch;
|
|
5
5
|
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
6
6
|
}
|
|
7
|
-
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
8
|
-
type HttpResponse<T = any> = {
|
|
7
|
+
type RequestOptionsFactory$4<TResponse = any, TData = any> = (context: any) => RequestOptions$4<TResponse, TData>;
|
|
8
|
+
type HttpResponse$4<T = any> = {
|
|
9
9
|
data: T;
|
|
10
10
|
status: number;
|
|
11
11
|
statusText: string;
|
|
12
12
|
headers: any;
|
|
13
13
|
request?: any;
|
|
14
14
|
};
|
|
15
|
-
type RequestOptions<_TResponse = any, Data = any> = {
|
|
15
|
+
type RequestOptions$4<_TResponse = any, Data = any> = {
|
|
16
16
|
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
17
17
|
url: string;
|
|
18
18
|
data?: Data;
|
|
19
19
|
params?: URLSearchParams;
|
|
20
|
-
} & APIMetadata;
|
|
21
|
-
type APIMetadata = {
|
|
20
|
+
} & APIMetadata$4;
|
|
21
|
+
type APIMetadata$4 = {
|
|
22
22
|
methodFqn?: string;
|
|
23
23
|
entityFqdn?: string;
|
|
24
24
|
packageName?: string;
|
|
25
25
|
};
|
|
26
|
-
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
27
|
-
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
28
|
-
__type: 'event-definition';
|
|
29
|
-
type: Type;
|
|
30
|
-
isDomainEvent?: boolean;
|
|
31
|
-
transformations?: (envelope: unknown) => Payload;
|
|
32
|
-
__payload: Payload;
|
|
33
|
-
};
|
|
34
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
35
|
-
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
36
|
-
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
26
|
+
type BuildRESTFunction$4<T extends RESTFunctionDescriptor$4> = T extends RESTFunctionDescriptor$4<infer U> ? U : never;
|
|
37
27
|
|
|
38
28
|
declare global {
|
|
39
29
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
@@ -306,7 +296,7 @@ interface ListAppPlansByAppIdResponseNonNullableFields {
|
|
|
306
296
|
appPlans: AppPlansNonNullableFields[];
|
|
307
297
|
}
|
|
308
298
|
|
|
309
|
-
declare function listAppPlansByAppId$1(httpClient: HttpClient): ListAppPlansByAppIdSignature;
|
|
299
|
+
declare function listAppPlansByAppId$1(httpClient: HttpClient$4): ListAppPlansByAppIdSignature;
|
|
310
300
|
interface ListAppPlansByAppIdSignature {
|
|
311
301
|
/**
|
|
312
302
|
* Retrieves plans for the given apps.
|
|
@@ -340,7 +330,7 @@ interface ListAppPlansByAppIdSignature {
|
|
|
340
330
|
(appIds: string[]): Promise<ListAppPlansByAppIdResponse & ListAppPlansByAppIdResponseNonNullableFields>;
|
|
341
331
|
}
|
|
342
332
|
|
|
343
|
-
declare const listAppPlansByAppId: BuildRESTFunction<typeof listAppPlansByAppId$1> & typeof listAppPlansByAppId$1;
|
|
333
|
+
declare const listAppPlansByAppId: BuildRESTFunction$4<typeof listAppPlansByAppId$1> & typeof listAppPlansByAppId$1;
|
|
344
334
|
|
|
345
335
|
type index_d$4_AppPlans = AppPlans;
|
|
346
336
|
type index_d$4_Cycle = Cycle;
|
|
@@ -366,6 +356,50 @@ declare namespace index_d$4 {
|
|
|
366
356
|
export { type index_d$4_AppPlans as AppPlans, type index_d$4_Cycle as Cycle, index_d$4_CycleType as CycleType, type index_d$4_Discount as Discount, index_d$4_DiscountType as DiscountType, type index_d$4_Duration as Duration, index_d$4_DurationUnit as DurationUnit, type index_d$4_ListAppPlansByAppIdRequest as ListAppPlansByAppIdRequest, type index_d$4_ListAppPlansByAppIdResponse as ListAppPlansByAppIdResponse, type index_d$4_ListAppPlansByAppIdResponseNonNullableFields as ListAppPlansByAppIdResponseNonNullableFields, type index_d$4_Plan as Plan, type index_d$4_Price as Price, type index_d$4_TaxSettings as TaxSettings, index_d$4_TaxType as TaxType, type index_d$4_UsageBasedDetails as UsageBasedDetails, index_d$4_listAppPlansByAppId as listAppPlansByAppId };
|
|
367
357
|
}
|
|
368
358
|
|
|
359
|
+
type RESTFunctionDescriptor$3<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$3) => T;
|
|
360
|
+
interface HttpClient$3 {
|
|
361
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$3<TResponse, TData>): Promise<HttpResponse$3<TResponse>>;
|
|
362
|
+
fetchWithAuth: typeof fetch;
|
|
363
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
364
|
+
}
|
|
365
|
+
type RequestOptionsFactory$3<TResponse = any, TData = any> = (context: any) => RequestOptions$3<TResponse, TData>;
|
|
366
|
+
type HttpResponse$3<T = any> = {
|
|
367
|
+
data: T;
|
|
368
|
+
status: number;
|
|
369
|
+
statusText: string;
|
|
370
|
+
headers: any;
|
|
371
|
+
request?: any;
|
|
372
|
+
};
|
|
373
|
+
type RequestOptions$3<_TResponse = any, Data = any> = {
|
|
374
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
375
|
+
url: string;
|
|
376
|
+
data?: Data;
|
|
377
|
+
params?: URLSearchParams;
|
|
378
|
+
} & APIMetadata$3;
|
|
379
|
+
type APIMetadata$3 = {
|
|
380
|
+
methodFqn?: string;
|
|
381
|
+
entityFqdn?: string;
|
|
382
|
+
packageName?: string;
|
|
383
|
+
};
|
|
384
|
+
type BuildRESTFunction$3<T extends RESTFunctionDescriptor$3> = T extends RESTFunctionDescriptor$3<infer U> ? U : never;
|
|
385
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
386
|
+
__type: 'event-definition';
|
|
387
|
+
type: Type;
|
|
388
|
+
isDomainEvent?: boolean;
|
|
389
|
+
transformations?: (envelope: unknown) => Payload;
|
|
390
|
+
__payload: Payload;
|
|
391
|
+
};
|
|
392
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
393
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
394
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
395
|
+
|
|
396
|
+
declare global {
|
|
397
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
398
|
+
interface SymbolConstructor {
|
|
399
|
+
readonly observable: symbol;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
369
403
|
/**
|
|
370
404
|
* An app instance is a specific occurrence of your app on a particular Wix site.
|
|
371
405
|
* When a site owner installs your app, a unique instance is generated for that
|
|
@@ -767,7 +801,7 @@ interface AppInstancePaidPlanAutoRenewalCancelledEnvelope {
|
|
|
767
801
|
metadata: BaseEventMetadata;
|
|
768
802
|
}
|
|
769
803
|
|
|
770
|
-
declare function getAppInstance$1(httpClient: HttpClient): GetAppInstanceSignature;
|
|
804
|
+
declare function getAppInstance$1(httpClient: HttpClient$3): GetAppInstanceSignature;
|
|
771
805
|
interface GetAppInstanceSignature {
|
|
772
806
|
/**
|
|
773
807
|
* Retrieves data about the instance of your app that's installed on a Wix site and data about the site itself.
|
|
@@ -788,7 +822,7 @@ declare const onAppInstancePaidPlanAutoRenewalCancelled$1: EventDefinition<AppIn
|
|
|
788
822
|
|
|
789
823
|
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
790
824
|
|
|
791
|
-
declare const getAppInstance: BuildRESTFunction<typeof getAppInstance$1> & typeof getAppInstance$1;
|
|
825
|
+
declare const getAppInstance: BuildRESTFunction$3<typeof getAppInstance$1> & typeof getAppInstance$1;
|
|
792
826
|
|
|
793
827
|
type _publicOnAppInstanceInstalledType = typeof onAppInstanceInstalled$1;
|
|
794
828
|
/**
|
|
@@ -865,6 +899,40 @@ declare namespace index_d$3 {
|
|
|
865
899
|
export { type index_d$3_AppInstalled as AppInstalled, type index_d$3_AppInstance as AppInstance, type index_d$3_AppInstanceInstalledEnvelope as AppInstanceInstalledEnvelope, type index_d$3_AppInstancePaidPlanAutoRenewalCancelledEnvelope as AppInstancePaidPlanAutoRenewalCancelledEnvelope, type index_d$3_AppInstancePaidPlanChangedEnvelope as AppInstancePaidPlanChangedEnvelope, type index_d$3_AppInstancePaidPlanPurchasedEnvelope as AppInstancePaidPlanPurchasedEnvelope, type index_d$3_AppInstanceRemovedEnvelope as AppInstanceRemovedEnvelope, type index_d$3_AppRemoved as AppRemoved, type index_d$3_AvailablePlan as AvailablePlan, type index_d$3_BaseEventMetadata as BaseEventMetadata, type index_d$3_BillingInfo as BillingInfo, type index_d$3_FreeTrialInfo as FreeTrialInfo, index_d$3_FreeTrialStatus as FreeTrialStatus, type index_d$3_GetAppInstanceByInstanceIdRequest as GetAppInstanceByInstanceIdRequest, type index_d$3_GetAppInstanceRequest as GetAppInstanceRequest, type index_d$3_GetAppInstanceResponse as GetAppInstanceResponse, type index_d$3_GetAppInstanceResponseNonNullableFields as GetAppInstanceResponseNonNullableFields, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type index_d$3_Locale as Locale, type MessageEnvelope$1 as MessageEnvelope, type index_d$3_Multilingual as Multilingual, type index_d$3_OwnerInfo as OwnerInfo, type index_d$3_PaidPlanAutoRenewalCancelled as PaidPlanAutoRenewalCancelled, type index_d$3_PaidPlanChanged as PaidPlanChanged, type index_d$3_PaidPlanPurchased as PaidPlanPurchased, PaymentCycle$1 as PaymentCycle, index_d$3_ResolutionMethod as ResolutionMethod, type index_d$3_SiteInfo as SiteInfo, type index_d$3_SupportedLanguage as SupportedLanguage, WebhookIdentityType$1 as WebhookIdentityType, type index_d$3__publicOnAppInstanceInstalledType as _publicOnAppInstanceInstalledType, type index_d$3__publicOnAppInstancePaidPlanAutoRenewalCancelledType as _publicOnAppInstancePaidPlanAutoRenewalCancelledType, type index_d$3__publicOnAppInstancePaidPlanChangedType as _publicOnAppInstancePaidPlanChangedType, type index_d$3__publicOnAppInstancePaidPlanPurchasedType as _publicOnAppInstancePaidPlanPurchasedType, type index_d$3__publicOnAppInstanceRemovedType as _publicOnAppInstanceRemovedType, index_d$3_getAppInstance as getAppInstance, index_d$3_onAppInstanceInstalled as onAppInstanceInstalled, index_d$3_onAppInstancePaidPlanAutoRenewalCancelled as onAppInstancePaidPlanAutoRenewalCancelled, index_d$3_onAppInstancePaidPlanChanged as onAppInstancePaidPlanChanged, index_d$3_onAppInstancePaidPlanPurchased as onAppInstancePaidPlanPurchased, index_d$3_onAppInstanceRemoved as onAppInstanceRemoved, onAppInstanceInstalled$1 as publicOnAppInstanceInstalled, onAppInstancePaidPlanAutoRenewalCancelled$1 as publicOnAppInstancePaidPlanAutoRenewalCancelled, onAppInstancePaidPlanChanged$1 as publicOnAppInstancePaidPlanChanged, onAppInstancePaidPlanPurchased$1 as publicOnAppInstancePaidPlanPurchased, onAppInstanceRemoved$1 as publicOnAppInstanceRemoved };
|
|
866
900
|
}
|
|
867
901
|
|
|
902
|
+
type RESTFunctionDescriptor$2<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$2) => T;
|
|
903
|
+
interface HttpClient$2 {
|
|
904
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
|
|
905
|
+
fetchWithAuth: typeof fetch;
|
|
906
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
907
|
+
}
|
|
908
|
+
type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
|
|
909
|
+
type HttpResponse$2<T = any> = {
|
|
910
|
+
data: T;
|
|
911
|
+
status: number;
|
|
912
|
+
statusText: string;
|
|
913
|
+
headers: any;
|
|
914
|
+
request?: any;
|
|
915
|
+
};
|
|
916
|
+
type RequestOptions$2<_TResponse = any, Data = any> = {
|
|
917
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
918
|
+
url: string;
|
|
919
|
+
data?: Data;
|
|
920
|
+
params?: URLSearchParams;
|
|
921
|
+
} & APIMetadata$2;
|
|
922
|
+
type APIMetadata$2 = {
|
|
923
|
+
methodFqn?: string;
|
|
924
|
+
entityFqdn?: string;
|
|
925
|
+
packageName?: string;
|
|
926
|
+
};
|
|
927
|
+
type BuildRESTFunction$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
|
|
928
|
+
|
|
929
|
+
declare global {
|
|
930
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
931
|
+
interface SymbolConstructor {
|
|
932
|
+
readonly observable: symbol;
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
|
|
868
936
|
interface SendBIEventResponse {
|
|
869
937
|
}
|
|
870
938
|
interface SendBIEventRequest {
|
|
@@ -953,7 +1021,7 @@ interface SendBiEventOptions {
|
|
|
953
1021
|
eventData?: Record<string, string>;
|
|
954
1022
|
}
|
|
955
1023
|
|
|
956
|
-
declare function sendBiEvent$1(httpClient: HttpClient): SendBiEventSignature;
|
|
1024
|
+
declare function sendBiEvent$1(httpClient: HttpClient$2): SendBiEventSignature;
|
|
957
1025
|
interface SendBiEventSignature {
|
|
958
1026
|
/**
|
|
959
1027
|
* Submit a BI event to Wix.
|
|
@@ -961,7 +1029,7 @@ interface SendBiEventSignature {
|
|
|
961
1029
|
(options?: SendBiEventOptions | undefined): Promise<void>;
|
|
962
1030
|
}
|
|
963
1031
|
|
|
964
|
-
declare const sendBiEvent: BuildRESTFunction<typeof sendBiEvent$1> & typeof sendBiEvent$1;
|
|
1032
|
+
declare const sendBiEvent: BuildRESTFunction$2<typeof sendBiEvent$1> & typeof sendBiEvent$1;
|
|
965
1033
|
|
|
966
1034
|
type index_d$2_EventName = EventName;
|
|
967
1035
|
declare const index_d$2_EventName: typeof EventName;
|
|
@@ -973,6 +1041,40 @@ declare namespace index_d$2 {
|
|
|
973
1041
|
export { index_d$2_EventName as EventName, type index_d$2_SendBIEventRequest as SendBIEventRequest, type index_d$2_SendBIEventResponse as SendBIEventResponse, type index_d$2_SendBiEventOptions as SendBiEventOptions, index_d$2_sendBiEvent as sendBiEvent };
|
|
974
1042
|
}
|
|
975
1043
|
|
|
1044
|
+
type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
|
|
1045
|
+
interface HttpClient$1 {
|
|
1046
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
|
|
1047
|
+
fetchWithAuth: typeof fetch;
|
|
1048
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
1049
|
+
}
|
|
1050
|
+
type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
|
|
1051
|
+
type HttpResponse$1<T = any> = {
|
|
1052
|
+
data: T;
|
|
1053
|
+
status: number;
|
|
1054
|
+
statusText: string;
|
|
1055
|
+
headers: any;
|
|
1056
|
+
request?: any;
|
|
1057
|
+
};
|
|
1058
|
+
type RequestOptions$1<_TResponse = any, Data = any> = {
|
|
1059
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
1060
|
+
url: string;
|
|
1061
|
+
data?: Data;
|
|
1062
|
+
params?: URLSearchParams;
|
|
1063
|
+
} & APIMetadata$1;
|
|
1064
|
+
type APIMetadata$1 = {
|
|
1065
|
+
methodFqn?: string;
|
|
1066
|
+
entityFqdn?: string;
|
|
1067
|
+
packageName?: string;
|
|
1068
|
+
};
|
|
1069
|
+
type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
|
|
1070
|
+
|
|
1071
|
+
declare global {
|
|
1072
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
1073
|
+
interface SymbolConstructor {
|
|
1074
|
+
readonly observable: symbol;
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
|
|
976
1078
|
interface PurchasedItem {
|
|
977
1079
|
/** ID of your app's paid plan. */
|
|
978
1080
|
productId?: string;
|
|
@@ -1225,7 +1327,7 @@ interface GetUrlOptions {
|
|
|
1225
1327
|
couponCode?: string | null;
|
|
1226
1328
|
}
|
|
1227
1329
|
|
|
1228
|
-
declare function getUrl$1(httpClient: HttpClient): GetUrlSignature;
|
|
1330
|
+
declare function getUrl$1(httpClient: HttpClient$1): GetUrlSignature;
|
|
1229
1331
|
interface GetUrlSignature {
|
|
1230
1332
|
/**
|
|
1231
1333
|
* Retrieves the URL for a Wix checkout page for the specified paid plan of your app.
|
|
@@ -1243,7 +1345,7 @@ interface GetUrlSignature {
|
|
|
1243
1345
|
*/
|
|
1244
1346
|
(productId: string, options?: GetUrlOptions | undefined): Promise<GetUrlResponse & GetUrlResponseNonNullableFields>;
|
|
1245
1347
|
}
|
|
1246
|
-
declare function getPurchaseHistory$1(httpClient: HttpClient): GetPurchaseHistorySignature;
|
|
1348
|
+
declare function getPurchaseHistory$1(httpClient: HttpClient$1): GetPurchaseHistorySignature;
|
|
1247
1349
|
interface GetPurchaseHistorySignature {
|
|
1248
1350
|
/**
|
|
1249
1351
|
* Retrieves a list of the site owner's past purchases for your app.
|
|
@@ -1257,8 +1359,8 @@ interface GetPurchaseHistorySignature {
|
|
|
1257
1359
|
(): Promise<GetPurchaseHistoryResponse & GetPurchaseHistoryResponseNonNullableFields>;
|
|
1258
1360
|
}
|
|
1259
1361
|
|
|
1260
|
-
declare const getUrl: BuildRESTFunction<typeof getUrl$1> & typeof getUrl$1;
|
|
1261
|
-
declare const getPurchaseHistory: BuildRESTFunction<typeof getPurchaseHistory$1> & typeof getPurchaseHistory$1;
|
|
1362
|
+
declare const getUrl: BuildRESTFunction$1<typeof getUrl$1> & typeof getUrl$1;
|
|
1363
|
+
declare const getPurchaseHistory: BuildRESTFunction$1<typeof getPurchaseHistory$1> & typeof getPurchaseHistory$1;
|
|
1262
1364
|
|
|
1263
1365
|
type index_d$1_Charge = Charge;
|
|
1264
1366
|
type index_d$1_ChargeOverride = ChargeOverride;
|
|
@@ -1290,6 +1392,40 @@ declare namespace index_d$1 {
|
|
|
1290
1392
|
export { type index_d$1_Charge as Charge, type index_d$1_ChargeOverride as ChargeOverride, type index_d$1_GetMeteredBillingChargesRequest as GetMeteredBillingChargesRequest, type index_d$1_GetMeteredBillingChargesResponse as GetMeteredBillingChargesResponse, type index_d$1_GetPurchaseHistoryRequest as GetPurchaseHistoryRequest, type index_d$1_GetPurchaseHistoryResponse as GetPurchaseHistoryResponse, type index_d$1_GetPurchaseHistoryResponseNonNullableFields as GetPurchaseHistoryResponseNonNullableFields, type index_d$1_GetSitePaymentMethodsStatusRequest as GetSitePaymentMethodsStatusRequest, type index_d$1_GetSitePaymentMethodsStatusResponse as GetSitePaymentMethodsStatusResponse, type index_d$1_GetUrlOptions as GetUrlOptions, type index_d$1_GetUrlRequest as GetUrlRequest, type index_d$1_GetUrlResponse as GetUrlResponse, type index_d$1_GetUrlResponseNonNullableFields as GetUrlResponseNonNullableFields, type index_d$1_IdentificationData as IdentificationData, type index_d$1_IdentificationDataIdOneOf as IdentificationDataIdOneOf, index_d$1_InvoiceStatus as InvoiceStatus, type index_d$1_InvoiceStatusUpdate as InvoiceStatusUpdate, type index_d$1_MessageEnvelope as MessageEnvelope, index_d$1_PaymentCycle as PaymentCycle, type index_d$1_PurchasedItem as PurchasedItem, index_d$1_WebhookIdentityType as WebhookIdentityType, index_d$1_getPurchaseHistory as getPurchaseHistory, index_d$1_getUrl as getUrl };
|
|
1291
1393
|
}
|
|
1292
1394
|
|
|
1395
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
1396
|
+
interface HttpClient {
|
|
1397
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
1398
|
+
fetchWithAuth: typeof fetch;
|
|
1399
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
1400
|
+
}
|
|
1401
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
1402
|
+
type HttpResponse<T = any> = {
|
|
1403
|
+
data: T;
|
|
1404
|
+
status: number;
|
|
1405
|
+
statusText: string;
|
|
1406
|
+
headers: any;
|
|
1407
|
+
request?: any;
|
|
1408
|
+
};
|
|
1409
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
1410
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
1411
|
+
url: string;
|
|
1412
|
+
data?: Data;
|
|
1413
|
+
params?: URLSearchParams;
|
|
1414
|
+
} & APIMetadata;
|
|
1415
|
+
type APIMetadata = {
|
|
1416
|
+
methodFqn?: string;
|
|
1417
|
+
entityFqdn?: string;
|
|
1418
|
+
packageName?: string;
|
|
1419
|
+
};
|
|
1420
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
1421
|
+
|
|
1422
|
+
declare global {
|
|
1423
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
1424
|
+
interface SymbolConstructor {
|
|
1425
|
+
readonly observable: symbol;
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1293
1429
|
/** Embedded script data */
|
|
1294
1430
|
interface ScriptProperties {
|
|
1295
1431
|
/** Script parameters */
|