@wix/app-management 1.0.12 → 1.0.14

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.
@@ -0,0 +1,1334 @@
1
+ /**
2
+ * An `appPlans` object describes how you charge users for using your app.
3
+ * You can set up multiple plans for a single app, with different plans giving access to
4
+ * different tiers of functionality. For example, you can offer a free plan and
5
+ * 3 paid plans with an increasing number of benefits. Learn more about
6
+ * [setting up your app pricing](https://dev.wix.com/docs/build-apps/build-your-app/pricing-plans/set-up-your-app-pricing).
7
+ */
8
+ interface AppPlans {
9
+ /** App ID, as defined in the [Wix Dev Center](https://dev.wix.com/). */
10
+ _id?: string;
11
+ /**
12
+ * List of the app's pricing plans.
13
+ *
14
+ * Min: `0` plans
15
+ * Max: `50` plans
16
+ */
17
+ plans?: Plan[];
18
+ }
19
+ interface Cycle {
20
+ /**
21
+ * Type of the billing cycle.
22
+ *
23
+ * + `"UNKNOWN_UNIT"`: There is no information about the billing cycle.
24
+ * + `"ONE_TIME"`: The customer pays for unlimited usage of the app with a single payment.
25
+ * + `"RECURRING"`: The customer pays for a subscription to the app on a recurring schedule.
26
+ */
27
+ cycleType?: CycleType;
28
+ /** Duration of the billing cycle. Available only for `{"cycleType": "RECURRING"}`. */
29
+ cycleDuration?: Duration;
30
+ }
31
+ declare enum DurationUnit {
32
+ /** unknown interval unit */
33
+ UNKNOWN_UNIT = "UNKNOWN_UNIT",
34
+ /** month */
35
+ MONTH = "MONTH",
36
+ /** year */
37
+ YEAR = "YEAR"
38
+ }
39
+ declare enum CycleType {
40
+ UNKNOWN_TYPE = "UNKNOWN_TYPE",
41
+ ONE_TIME = "ONE_TIME",
42
+ RECURRING = "RECURRING"
43
+ }
44
+ interface Duration {
45
+ /** Unit of the billing cycle. */
46
+ unit?: DurationUnit;
47
+ /** Count of units that make up the billing cycle. */
48
+ count?: number;
49
+ }
50
+ interface UsageBasedDetails {
51
+ /**
52
+ * Smallest possible amount that your app charges customers in usage-based
53
+ * pricing. For example, the price of a single SMS message if your
54
+ * app charges customers for sending text messages. Always in
55
+ * [USD](https://en.wikipedia.org/wiki/United_States_dollar).
56
+ *
57
+ * Min: `0.00`
58
+ * Max: 1024 characters
59
+ */
60
+ minimumChargeIncrement?: string | null;
61
+ /**
62
+ * Recurring, monthly base fee in usaged-based pricing that your app
63
+ * charges customers regardless of how much they use your app.
64
+ *
65
+ * Min: `0.00`
66
+ * Max: 1024 characters
67
+ */
68
+ monthlyBaseFee?: string | null;
69
+ /**
70
+ * Description of the usaged-based pricing plan, as defined in the
71
+ * [Dev Center](https://dev.wix.com/).
72
+ *
73
+ * Max: 1024 characters
74
+ */
75
+ customChargeDescription?: string | null;
76
+ }
77
+ interface Price {
78
+ /**
79
+ * Price without taxes. For yearly plans, Wix calculates and returns the
80
+ * average price per month. You can get thefull price by multiplying the
81
+ * returned price with 12.
82
+ *
83
+ * Min: `0.00`
84
+ * Max: 1024 characters
85
+ */
86
+ priceBeforeTax?: string;
87
+ /**
88
+ * Total price including taxes.
89
+ *
90
+ * Min: `0.00`
91
+ * Max: 1024 characters
92
+ */
93
+ totalPrice?: string;
94
+ /** Information about the plan's recurring billing cycle or single payment. */
95
+ billingCycle?: Cycle;
96
+ /**
97
+ * Details about the plan's usage-based pricing.
98
+ * Available only for plans with
99
+ * [usage-based pricing](https://dev.wix.com/docs/build-apps/build-your-app/pricing-plans/usage-based-pricing).
100
+ */
101
+ usageBaseOptions?: UsageBasedDetails;
102
+ }
103
+ interface Plan {
104
+ /**
105
+ * ID of the app plan.
106
+ * @readonly
107
+ */
108
+ _id?: string;
109
+ /**
110
+ * ID of your app's pricing plan, as displayed in the [Dev Center](https://dev.wix.com/).
111
+ * Identical to `vendorProductId` in the
112
+ * [Paid Plan Purchased webhook](https://dev.wix.com/docs/rest/api-reference/app-management/apps/app-instance/paid-plan-purchased).
113
+ */
114
+ vendorId?: string;
115
+ /** Name of your app's pricing plan, as defined by you in the [Dev Center](https://dev.wix.com/). */
116
+ name?: string;
117
+ /**
118
+ * List of your plan's benefits, as defined by you in the [Dev Center](https://dev.wix.com/).
119
+ * Currently, the benefits are available only in English.
120
+ *
121
+ * Min: `0` benefits
122
+ * Max: `4` benefits
123
+ * Max per benefit: 1024 characters
124
+ */
125
+ benefits?: string[];
126
+ /**
127
+ * List of the plan's prices. Available only when the plan's prices are managed
128
+ * by Wix and not externally.
129
+ *
130
+ * Min: `0` prices
131
+ * Max: `10` prices
132
+ */
133
+ prices?: Price[];
134
+ }
135
+ interface ListAppPlansByAppIdRequest {
136
+ /**
137
+ * List of app IDs to retrieve plans for.
138
+ *
139
+ * Min: 1 app ID
140
+ * Max: 100 app IDs
141
+ */
142
+ appIds: string[];
143
+ }
144
+ interface ListAppPlansByAppIdResponse {
145
+ /**
146
+ * Tax settings. Wix calculates the tax settings based on the country code that
147
+ * you pass in the call's header. If you don't pass a country code in the header,
148
+ * Wix calculates the tax settings based on the caller's IP address. Note that the
149
+ * tax settings may not resolve properly if you call through a VPN.
150
+ */
151
+ taxSettings?: TaxSettings;
152
+ /**
153
+ * 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)
154
+ * format. Wix calculates the currency based on the country code that
155
+ * you pass in the call's header. If you don't pass a country code in the header,
156
+ * Wix calculates the currency based on the caller's IP address. Note that the
157
+ * currency may not resolve properly if you call through a VPN.
158
+ */
159
+ currency?: string;
160
+ /**
161
+ * Currency symbol in decimal HTML entity format. For example, `$` for $
162
+ * (United States Dollar). Wix calculates the currency symbol based on the
163
+ * country code that you pass in the call's header. If you don't pass a country
164
+ * code in the header, Wix calculates the tax settings based on the caller's IP
165
+ * address. Note that the currency symbol may not resolve properly if you call
166
+ * through a VPN.
167
+ */
168
+ currencySymbol?: string;
169
+ /**
170
+ * Retrieved app plans.
171
+ *
172
+ * Min: 0 plans
173
+ * Max: 50 plans
174
+ */
175
+ appPlans?: AppPlans[];
176
+ }
177
+ interface TaxSettings {
178
+ /**
179
+ * Whether you must display the total price including taxes in the given
180
+ * country.
181
+ */
182
+ showPriceWithTax?: boolean;
183
+ /**
184
+ * Tax rate for the given country as percentage. Returned as `0` when
185
+ * `{"showPriceWithTax": false}`.
186
+ */
187
+ percentage?: string | null;
188
+ /**
189
+ * Type of tax required in the given country.
190
+ *
191
+ * + `"NOT_APPLICABLE"`: The country doesn't require that you display the total price including taxes, or Wix failed to calculate the country based on the call's IP address.
192
+ * + `"VAT"`: The given country requires that you display the total price including [value-added tax (VAT)](https://en.wikipedia.org/wiki/Value-added_tax).
193
+ * + `"GST"`: The given country requires that you display the total price including [generation-skipping transfer tax (GST)](https://en.wikipedia.org/wiki/Generation-skipping_transfer_tax).
194
+ */
195
+ taxType?: TaxType;
196
+ }
197
+ declare enum TaxType {
198
+ NOT_APPLICABLE = "NOT_APPLICABLE",
199
+ VAT = "VAT",
200
+ GST = "GST"
201
+ }
202
+ interface ListAppPlansByAppIdResponseNonNullableFields {
203
+ taxSettings?: {
204
+ showPriceWithTax: boolean;
205
+ taxType: TaxType;
206
+ };
207
+ currency: string;
208
+ currencySymbol: string;
209
+ appPlans: {
210
+ _id: string;
211
+ plans: {
212
+ _id: string;
213
+ vendorId: string;
214
+ name: string;
215
+ benefits: string[];
216
+ prices: {
217
+ priceBeforeTax: string;
218
+ totalPrice: string;
219
+ billingCycle?: {
220
+ cycleType: CycleType;
221
+ cycleDuration?: {
222
+ unit: DurationUnit;
223
+ count: number;
224
+ };
225
+ };
226
+ }[];
227
+ }[];
228
+ }[];
229
+ }
230
+
231
+ interface HttpClient$4 {
232
+ request<TResponse, TData = any>(req: RequestOptionsFactory$4<TResponse, TData>): Promise<HttpResponse$4<TResponse>>;
233
+ fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
234
+ }
235
+ type RequestOptionsFactory$4<TResponse = any, TData = any> = (context: any) => RequestOptions$4<TResponse, TData>;
236
+ type HttpResponse$4<T = any> = {
237
+ data: T;
238
+ status: number;
239
+ statusText: string;
240
+ headers: any;
241
+ request?: any;
242
+ };
243
+ type RequestOptions$4<_TResponse = any, Data = any> = {
244
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
245
+ url: string;
246
+ data?: Data;
247
+ params?: URLSearchParams;
248
+ } & APIMetadata$4;
249
+ type APIMetadata$4 = {
250
+ methodFqn?: string;
251
+ entityFqdn?: string;
252
+ packageName?: string;
253
+ };
254
+
255
+ declare global {
256
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
257
+ interface SymbolConstructor {
258
+ readonly observable: symbol;
259
+ }
260
+ }
261
+
262
+ declare const __metadata$4: {
263
+ PACKAGE_NAME: string;
264
+ };
265
+ declare function listAppPlansByAppId(httpClient: HttpClient$4): (appIds: string[]) => Promise<ListAppPlansByAppIdResponse & ListAppPlansByAppIdResponseNonNullableFields>;
266
+
267
+ type index_d$4_AppPlans = AppPlans;
268
+ type index_d$4_Cycle = Cycle;
269
+ type index_d$4_CycleType = CycleType;
270
+ declare const index_d$4_CycleType: typeof CycleType;
271
+ type index_d$4_Duration = Duration;
272
+ type index_d$4_DurationUnit = DurationUnit;
273
+ declare const index_d$4_DurationUnit: typeof DurationUnit;
274
+ type index_d$4_ListAppPlansByAppIdRequest = ListAppPlansByAppIdRequest;
275
+ type index_d$4_ListAppPlansByAppIdResponse = ListAppPlansByAppIdResponse;
276
+ type index_d$4_ListAppPlansByAppIdResponseNonNullableFields = ListAppPlansByAppIdResponseNonNullableFields;
277
+ type index_d$4_Plan = Plan;
278
+ type index_d$4_Price = Price;
279
+ type index_d$4_TaxSettings = TaxSettings;
280
+ type index_d$4_TaxType = TaxType;
281
+ declare const index_d$4_TaxType: typeof TaxType;
282
+ type index_d$4_UsageBasedDetails = UsageBasedDetails;
283
+ declare const index_d$4_listAppPlansByAppId: typeof listAppPlansByAppId;
284
+ declare namespace index_d$4 {
285
+ 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_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, __metadata$4 as __metadata, index_d$4_listAppPlansByAppId as listAppPlansByAppId };
286
+ }
287
+
288
+ /**
289
+ * An app instance is a specific occurrence of your app on a particular Wix site.
290
+ * When a site owner installs your app, a unique instance is generated for that
291
+ * specific site. Use the `instanceId` to keep track of the individual data
292
+ * associated with each app instance.
293
+ */
294
+ interface AppInstance {
295
+ /**
296
+ * ID of the app instance. You can use it to keep track of the individual
297
+ * data that's associated with the specific occurence of your app that's
298
+ * installed on a Wix site.
299
+ */
300
+ instanceId?: string;
301
+ /**
302
+ * App name, as set by you in the Wix Developers Center during the app creation
303
+ * process.
304
+ */
305
+ appName?: string;
306
+ /**
307
+ * Version of your app that's installed on the Wix site, as set by you in the
308
+ * Wix Developers Center during the app creation process.
309
+ */
310
+ appVersion?: string | null;
311
+ /**
312
+ * Whether the site owners have installed a free or paid version of your app
313
+ * on their site.
314
+ */
315
+ isFree?: boolean;
316
+ /**
317
+ * Billing information for the app instance. Available only in case
318
+ * `{"isFree": false}`.
319
+ */
320
+ billing?: BillingInfo;
321
+ /**
322
+ * List of [permissions](https://dev.wix.com/docs/build-apps/developer-tools/developers-center/example-app-walkthrough/build-an-app#4-add-permissions)
323
+ * that the site owners have granted your app. You set the list of permissions that
324
+ * your app requires from the site owners in the Wix Developers Center during the
325
+ * app creation process.
326
+ */
327
+ permissions?: string[];
328
+ /** Plans available to this app instance. */
329
+ availablePlans?: AvailablePlan[];
330
+ /**
331
+ * ID of the Wix site from which the instance of your app has been cloned.
332
+ * Available only in case `{"copiedFromTemplate": true}`.
333
+ * All visual settings of the Wix site and app data are duplicated during the
334
+ * cloning process. Wix also notifies you in case there is any additional
335
+ * external functionality for the original site.
336
+ */
337
+ originInstanceId?: string | null;
338
+ /**
339
+ * __Deprecated__. This parameter will be removed on March 30, 2023. Use
340
+ * `copiedFromTemplate` instead.
341
+ * @deprecated
342
+ */
343
+ isOriginSiteTemplate?: boolean;
344
+ /** Whether the app instance was created when another Wix site was cloned. */
345
+ copiedFromTemplate?: boolean;
346
+ /** Whether the app instance includes a free trial that hasn't started yet. */
347
+ freeTrialAvailable?: boolean;
348
+ }
349
+ interface BillingInfo {
350
+ /** Name of the package that the site owner has paid for. */
351
+ packageName?: string;
352
+ /**
353
+ * Interval of the billing cycle. `"ONE_TIME"` means that site owners have
354
+ * purchased unlimited access to the app with a single, upfront payment.
355
+ */
356
+ billingCycle?: PaymentCycle$1;
357
+ /**
358
+ * Date and time the site owners have purchased the app's paid plan in
359
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
360
+ */
361
+ timeStamp?: string;
362
+ /**
363
+ * Date and time the app's current billing cycle ends in
364
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format. Available only for yearly and
365
+ * multi-yearly plans.
366
+ */
367
+ expirationDate?: string | null;
368
+ /**
369
+ * Whether the app's subscription automatically renews at the end of the
370
+ * current billing cycle.
371
+ */
372
+ autoRenewing?: boolean | null;
373
+ /** ID of the invoice for the current billing cycle. */
374
+ invoiceId?: string | null;
375
+ /**
376
+ * Information about any discounts applied to the app instance's current billing cycle.
377
+ * If the site owners applied a developer coupon or Wix Voucher
378
+ * when installing the paid version of your app, this field holds the coupon's
379
+ * name or `“Wix discount coupon”`. Site owners may receive a Wix Voucher when
380
+ * upgrading their Wix subscription. If there is no discount for the
381
+ * current billing cycle, the field is an empty string.
382
+ */
383
+ source?: string | null;
384
+ /** Information about the free trial applied, if relevant. */
385
+ freeTrialInfo?: FreeTrialInfo;
386
+ }
387
+ declare enum PaymentCycle$1 {
388
+ NO_CYCLE = "NO_CYCLE",
389
+ MONTHLY = "MONTHLY",
390
+ YEARLY = "YEARLY",
391
+ ONE_TIME = "ONE_TIME",
392
+ TWO_YEARS = "TWO_YEARS",
393
+ THREE_YEARS = "THREE_YEARS",
394
+ FOUR_YEARS = "FOUR_YEARS",
395
+ FIVE_YEARS = "FIVE_YEARS"
396
+ }
397
+ interface FreeTrialInfo {
398
+ /**
399
+ * Current free trial status.
400
+ *
401
+ * Supported values:
402
+ *
403
+ * - `IN_PROGRESS`: The free trial is currently in progress.
404
+ * - `ENDED`: The free trial has ended.
405
+ * - `NOT_AVAILABLE`: No free trial was applied, as none was available.
406
+ * @readonly
407
+ */
408
+ status?: FreeTrialStatus;
409
+ /**
410
+ * When the free trial has ended. Populated only once the free trial is over.
411
+ * @readonly
412
+ */
413
+ endDate?: Date;
414
+ }
415
+ declare enum FreeTrialStatus {
416
+ UNKNOWN_STATUS = "UNKNOWN_STATUS",
417
+ IN_PROGRESS = "IN_PROGRESS",
418
+ ENDED = "ENDED",
419
+ NOT_AVAILABLE = "NOT_AVAILABLE"
420
+ }
421
+ interface AvailablePlan {
422
+ /** Package name of the available plan. */
423
+ packageName?: string;
424
+ /** Source of the available plan. Can be a bundle or 3rd-party app. */
425
+ source?: string;
426
+ }
427
+ interface AppInstalled {
428
+ /** Unique identifier of the app within the website. */
429
+ appId?: string;
430
+ /** Instance ID of the app in the original website (relevant only when this site was [duplicated from another site](https://support.wix.com/en/article/duplicating-your-site-1472847)). */
431
+ originInstanceId?: string | null;
432
+ }
433
+ interface AppRemoved {
434
+ /** Unique identifier of the app within the website. */
435
+ appId?: string;
436
+ }
437
+ interface PaidPlanPurchased {
438
+ /** Date and time of purchase. */
439
+ operationTimeStamp?: Date;
440
+ /** Purchased app plan. */
441
+ vendorProductId?: string;
442
+ /** Selected payment cycle. */
443
+ cycle?: PaymentCycle$1;
444
+ /** Plan expiration date. */
445
+ expiresOn?: Date;
446
+ /** Coupon applied to purchase (if relevant). */
447
+ couponName?: string | null;
448
+ /** Invoice ID. */
449
+ invoiceId?: string | null;
450
+ }
451
+ interface PaidPlanChanged {
452
+ /** Date and time of change. */
453
+ operationTimeStamp?: Date;
454
+ /** Newly purchased app plan. */
455
+ vendorProductId?: string;
456
+ /** Newly selected payment cycle. */
457
+ cycle?: PaymentCycle$1;
458
+ /** Previous app plan. */
459
+ previousVendorProductId?: string | null;
460
+ /** Previous payment cycle. */
461
+ previousCycle?: PaymentCycle$1;
462
+ /** Coupon applied to purchase (if relevant). */
463
+ couponName?: string | null;
464
+ /** Invoice ID. */
465
+ invoiceId?: string | null;
466
+ }
467
+ interface PaidPlanAutoRenewalCancelled {
468
+ /** Date and time of auto-renewal cancellation. */
469
+ operationTimeStamp?: Date;
470
+ /** Current app plan. */
471
+ vendorProductId?: string;
472
+ /** Current payment cycle. */
473
+ cycle?: PaymentCycle$1;
474
+ /** Supported values: `UNKNOWN_CANCELLATION_TYPE_ERROR_STATE`, `USER_CANCEL`, `FAILED_PAYMENT`, `TRANSFER_CANCELLATION_REASON`. Reason provided by app for cancellation (if relevant). */
475
+ cancelReason?: string | null;
476
+ /** Reason provided by site owner for cancellation (if relevant). */
477
+ userReason?: string | null;
478
+ /** Cancellation type. */
479
+ subscriptionCancellationType?: string | null;
480
+ }
481
+ interface GetAppInstanceRequest {
482
+ }
483
+ interface GetAppInstanceResponse {
484
+ /** Retrieved app instance. */
485
+ instance?: AppInstance;
486
+ /** Information about the corresponding Wix site. */
487
+ site?: SiteInfo;
488
+ }
489
+ interface SiteInfo {
490
+ /** Display name of the site. */
491
+ siteDisplayName?: string | null;
492
+ /**
493
+ * 2-letter language code of the site's locale in
494
+ * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
495
+ */
496
+ locale?: string;
497
+ /**
498
+ * 3-letter currency code for the site's billing in
499
+ * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
500
+ */
501
+ paymentCurrency?: string;
502
+ /** Information about the site's supported languages. */
503
+ multilingual?: Multilingual;
504
+ /** URL of the site. Available only in case the site has been published. */
505
+ url?: string | null;
506
+ /** Description of the site. */
507
+ description?: string | null;
508
+ /** Wix apps that are installed on the site. */
509
+ installedWixApps?: string[];
510
+ /**
511
+ * > **Deprecation Notice:** This parameter will be removed on June 30, 2022. Use `ownerInfo` instead.
512
+ * @deprecated
513
+ */
514
+ ownerEmail?: string | null;
515
+ /**
516
+ * Information about the site owner. Available only when calling
517
+ * _Get App Instance_ with the __Read Site Owner Email__ permission scope.
518
+ */
519
+ ownerInfo?: OwnerInfo;
520
+ /** Site ID. */
521
+ siteId?: string;
522
+ }
523
+ interface Multilingual {
524
+ /** Whether the site supports more than a single language. */
525
+ isMultiLingual?: boolean;
526
+ /** List of supported languages. Returned only when `{"isMultiLingual": true}`. */
527
+ supportedLanguages?: SupportedLanguage[];
528
+ }
529
+ interface SupportedLanguage {
530
+ /** Two-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */
531
+ languageCode?: string;
532
+ /** Locale. */
533
+ locale?: Locale;
534
+ /** Whether the supported language is the primary language for the site. */
535
+ isPrimary?: boolean;
536
+ /** Language icon. */
537
+ countryCode?: string;
538
+ /** How the language will be resolved. For internal use. */
539
+ resolutionMethod?: ResolutionMethod;
540
+ }
541
+ interface Locale {
542
+ /** Two-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */
543
+ languageCode?: string;
544
+ /** Two-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format. */
545
+ country?: string;
546
+ }
547
+ declare enum ResolutionMethod {
548
+ QUERY_PARAM = "QUERY_PARAM",
549
+ SUBDOMAIN = "SUBDOMAIN",
550
+ SUBDIRECTORY = "SUBDIRECTORY"
551
+ }
552
+ interface OwnerInfo {
553
+ /** Site owner's email address. Identical to the site owner's login email. */
554
+ email?: string;
555
+ /**
556
+ * Supported values: `VERIFIED_OPT_IN`, `VERIFIED_OPT_OUT`,
557
+ * `NOT_VERIFIED_OPT_IN`, `NOT_VERIFIED_OPT_OUT`.
558
+ *
559
+ * Whether the site owner has verified their email and whether they have chosen
560
+ * to receive email notifications from Wix.
561
+ */
562
+ emailStatus?: string;
563
+ }
564
+ interface GetAppInstanceByInstanceIdRequest {
565
+ /** ID of the app instance to retrieve. */
566
+ instanceId?: string;
567
+ }
568
+ interface MessageEnvelope$1 {
569
+ /** App instance ID. */
570
+ instanceId?: string | null;
571
+ /** Event type. */
572
+ eventType?: string;
573
+ /** The identification type and identity data. */
574
+ identity?: IdentificationData$1;
575
+ /** Stringify payload. */
576
+ data?: string;
577
+ }
578
+ interface IdentificationData$1 extends IdentificationDataIdOneOf$1 {
579
+ /** ID of a site visitor that has not logged in to the site. */
580
+ anonymousVisitorId?: string;
581
+ /** ID of a site visitor that has logged in to the site. */
582
+ memberId?: string;
583
+ /** ID of a Wix user (site owner, contributor, etc.). */
584
+ wixUserId?: string;
585
+ /** ID of an app. */
586
+ appId?: string;
587
+ /** @readonly */
588
+ identityType?: WebhookIdentityType$1;
589
+ }
590
+ /** @oneof */
591
+ interface IdentificationDataIdOneOf$1 {
592
+ /** ID of a site visitor that has not logged in to the site. */
593
+ anonymousVisitorId?: string;
594
+ /** ID of a site visitor that has logged in to the site. */
595
+ memberId?: string;
596
+ /** ID of a Wix user (site owner, contributor, etc.). */
597
+ wixUserId?: string;
598
+ /** ID of an app. */
599
+ appId?: string;
600
+ }
601
+ declare enum WebhookIdentityType$1 {
602
+ UNKNOWN = "UNKNOWN",
603
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
604
+ MEMBER = "MEMBER",
605
+ WIX_USER = "WIX_USER",
606
+ APP = "APP"
607
+ }
608
+ interface GetAppInstanceResponseNonNullableFields {
609
+ instance?: {
610
+ instanceId: string;
611
+ appName: string;
612
+ isFree: boolean;
613
+ billing?: {
614
+ packageName: string;
615
+ billingCycle: PaymentCycle$1;
616
+ timeStamp: string;
617
+ freeTrialInfo?: {
618
+ status: FreeTrialStatus;
619
+ };
620
+ };
621
+ permissions: string[];
622
+ availablePlans: {
623
+ packageName: string;
624
+ source: string;
625
+ }[];
626
+ isOriginSiteTemplate: boolean;
627
+ copiedFromTemplate: boolean;
628
+ freeTrialAvailable: boolean;
629
+ };
630
+ site?: {
631
+ locale: string;
632
+ paymentCurrency: string;
633
+ multilingual?: {
634
+ isMultiLingual: boolean;
635
+ supportedLanguages: {
636
+ languageCode: string;
637
+ locale?: {
638
+ languageCode: string;
639
+ country: string;
640
+ };
641
+ isPrimary: boolean;
642
+ countryCode: string;
643
+ resolutionMethod: ResolutionMethod;
644
+ }[];
645
+ };
646
+ installedWixApps: string[];
647
+ ownerInfo?: {
648
+ email: string;
649
+ emailStatus: string;
650
+ };
651
+ siteId: string;
652
+ };
653
+ }
654
+ interface BaseEventMetadata {
655
+ /** App instance ID. */
656
+ instanceId?: string | null;
657
+ /** Event type. */
658
+ eventType?: string;
659
+ /** The identification type and identity data. */
660
+ identity?: IdentificationData$1;
661
+ }
662
+ interface AppInstanceInstalledEnvelope {
663
+ data: AppInstalled;
664
+ metadata: BaseEventMetadata;
665
+ }
666
+ interface AppInstanceRemovedEnvelope {
667
+ data: AppRemoved;
668
+ metadata: BaseEventMetadata;
669
+ }
670
+ interface AppInstancePaidPlanPurchasedEnvelope {
671
+ data: PaidPlanPurchased;
672
+ metadata: BaseEventMetadata;
673
+ }
674
+ interface AppInstancePaidPlanChangedEnvelope {
675
+ data: PaidPlanChanged;
676
+ metadata: BaseEventMetadata;
677
+ }
678
+ interface AppInstancePaidPlanAutoRenewalCancelledEnvelope {
679
+ data: PaidPlanAutoRenewalCancelled;
680
+ metadata: BaseEventMetadata;
681
+ }
682
+
683
+ interface HttpClient$3 {
684
+ request<TResponse, TData = any>(req: RequestOptionsFactory$3<TResponse, TData>): Promise<HttpResponse$3<TResponse>>;
685
+ fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
686
+ }
687
+ type RequestOptionsFactory$3<TResponse = any, TData = any> = (context: any) => RequestOptions$3<TResponse, TData>;
688
+ type HttpResponse$3<T = any> = {
689
+ data: T;
690
+ status: number;
691
+ statusText: string;
692
+ headers: any;
693
+ request?: any;
694
+ };
695
+ type RequestOptions$3<_TResponse = any, Data = any> = {
696
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
697
+ url: string;
698
+ data?: Data;
699
+ params?: URLSearchParams;
700
+ } & APIMetadata$3;
701
+ type APIMetadata$3 = {
702
+ methodFqn?: string;
703
+ entityFqdn?: string;
704
+ packageName?: string;
705
+ };
706
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
707
+ __type: 'event-definition';
708
+ type: Type;
709
+ isDomainEvent?: boolean;
710
+ transformations?: (envelope: unknown) => Payload;
711
+ __payload: Payload;
712
+ };
713
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
714
+
715
+ declare global {
716
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
717
+ interface SymbolConstructor {
718
+ readonly observable: symbol;
719
+ }
720
+ }
721
+
722
+ declare const __metadata$3: {
723
+ PACKAGE_NAME: string;
724
+ };
725
+ declare function getAppInstance(httpClient: HttpClient$3): () => Promise<GetAppInstanceResponse & GetAppInstanceResponseNonNullableFields>;
726
+ declare const onAppInstanceInstalled: EventDefinition<AppInstanceInstalledEnvelope, "AppInstalled">;
727
+ declare const onAppInstanceRemoved: EventDefinition<AppInstanceRemovedEnvelope, "AppRemoved">;
728
+ declare const onAppInstancePaidPlanPurchased: EventDefinition<AppInstancePaidPlanPurchasedEnvelope, "PaidPlanPurchased">;
729
+ declare const onAppInstancePaidPlanChanged: EventDefinition<AppInstancePaidPlanChangedEnvelope, "PaidPlanChanged">;
730
+ declare const onAppInstancePaidPlanAutoRenewalCancelled: EventDefinition<AppInstancePaidPlanAutoRenewalCancelledEnvelope, "PaidPlanAutoRenewalCancelled">;
731
+
732
+ type index_d$3_AppInstalled = AppInstalled;
733
+ type index_d$3_AppInstance = AppInstance;
734
+ type index_d$3_AppInstanceInstalledEnvelope = AppInstanceInstalledEnvelope;
735
+ type index_d$3_AppInstancePaidPlanAutoRenewalCancelledEnvelope = AppInstancePaidPlanAutoRenewalCancelledEnvelope;
736
+ type index_d$3_AppInstancePaidPlanChangedEnvelope = AppInstancePaidPlanChangedEnvelope;
737
+ type index_d$3_AppInstancePaidPlanPurchasedEnvelope = AppInstancePaidPlanPurchasedEnvelope;
738
+ type index_d$3_AppInstanceRemovedEnvelope = AppInstanceRemovedEnvelope;
739
+ type index_d$3_AppRemoved = AppRemoved;
740
+ type index_d$3_AvailablePlan = AvailablePlan;
741
+ type index_d$3_BaseEventMetadata = BaseEventMetadata;
742
+ type index_d$3_BillingInfo = BillingInfo;
743
+ type index_d$3_FreeTrialInfo = FreeTrialInfo;
744
+ type index_d$3_FreeTrialStatus = FreeTrialStatus;
745
+ declare const index_d$3_FreeTrialStatus: typeof FreeTrialStatus;
746
+ type index_d$3_GetAppInstanceByInstanceIdRequest = GetAppInstanceByInstanceIdRequest;
747
+ type index_d$3_GetAppInstanceRequest = GetAppInstanceRequest;
748
+ type index_d$3_GetAppInstanceResponse = GetAppInstanceResponse;
749
+ type index_d$3_GetAppInstanceResponseNonNullableFields = GetAppInstanceResponseNonNullableFields;
750
+ type index_d$3_Locale = Locale;
751
+ type index_d$3_Multilingual = Multilingual;
752
+ type index_d$3_OwnerInfo = OwnerInfo;
753
+ type index_d$3_PaidPlanAutoRenewalCancelled = PaidPlanAutoRenewalCancelled;
754
+ type index_d$3_PaidPlanChanged = PaidPlanChanged;
755
+ type index_d$3_PaidPlanPurchased = PaidPlanPurchased;
756
+ type index_d$3_ResolutionMethod = ResolutionMethod;
757
+ declare const index_d$3_ResolutionMethod: typeof ResolutionMethod;
758
+ type index_d$3_SiteInfo = SiteInfo;
759
+ type index_d$3_SupportedLanguage = SupportedLanguage;
760
+ declare const index_d$3_getAppInstance: typeof getAppInstance;
761
+ declare const index_d$3_onAppInstanceInstalled: typeof onAppInstanceInstalled;
762
+ declare const index_d$3_onAppInstancePaidPlanAutoRenewalCancelled: typeof onAppInstancePaidPlanAutoRenewalCancelled;
763
+ declare const index_d$3_onAppInstancePaidPlanChanged: typeof onAppInstancePaidPlanChanged;
764
+ declare const index_d$3_onAppInstancePaidPlanPurchased: typeof onAppInstancePaidPlanPurchased;
765
+ declare const index_d$3_onAppInstanceRemoved: typeof onAppInstanceRemoved;
766
+ declare namespace index_d$3 {
767
+ 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, __metadata$3 as __metadata, 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 };
768
+ }
769
+
770
+ interface HttpClient$2 {
771
+ request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
772
+ fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
773
+ }
774
+ type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
775
+ type HttpResponse$2<T = any> = {
776
+ data: T;
777
+ status: number;
778
+ statusText: string;
779
+ headers: any;
780
+ request?: any;
781
+ };
782
+ type RequestOptions$2<_TResponse = any, Data = any> = {
783
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
784
+ url: string;
785
+ data?: Data;
786
+ params?: URLSearchParams;
787
+ } & APIMetadata$2;
788
+ type APIMetadata$2 = {
789
+ methodFqn?: string;
790
+ entityFqdn?: string;
791
+ packageName?: string;
792
+ };
793
+
794
+ declare global {
795
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
796
+ interface SymbolConstructor {
797
+ readonly observable: symbol;
798
+ }
799
+ }
800
+
801
+ interface SendBIEventResponse {
802
+ }
803
+ interface SendBIEventRequest {
804
+ /**
805
+ * Name of the event that's triggered in your app.
806
+ *
807
+ * + `"APP_DASHBOARD_LOADED"`: A site onwer or contributor loads your app's dashboard.
808
+ * + `"APP_FINISHED_CONFIGURATION"`: The site owner completes all required configurations for your app in the Wix Developers Center.
809
+ * + `"APP_UPGRADED"`: The site owner upgrades your app's paid plan. An upgrade means that they have finished the checkout flow on the app's side but not necessarily on Wix's side.
810
+ * + `"PRIMARY_ACTION_PERFORMED"`: A site owner, contributor, or visitor triggers your app's primary action. For example, a site visitor writes a product review using your product review app.
811
+ * + `"CHARGE"`: You charge money from the site owner. For example, when the site owner purchases or renews a subscription for your app. Make sure to also send `eventData` and a key of `sum`.
812
+ * + `"FUNDS_RETURNED"`: Trigger this event when you send money back to a site owner (for example, refunds or chargebacks). Make sure to also send the charge amount inside `eventData`. For example, `{"eventData": {"sum": "5.99"}}`.
813
+ * + `"CUSTOM"`: Any event that's not listed here. Make sure to also send `customEventName`.
814
+ * + `"APP_DEPLOYED"`: Your app’s internal code implementation is changed and might affect user flows or cause a regression.
815
+ * + `"APP_FINISH_BUSINESS_SETUP"`: __Deprecation Notice:__ This enum value will be removed on March 30, 2023. Use `"APP_SETUP_FINISHED"` instead.
816
+ * + `"APP_SETUP_FINISHED"`: The site owner completes your app's required business setup.
817
+ */
818
+ eventName?: EventName;
819
+ /**
820
+ * Name of your app's custom event that was triggered. Required when `{"eventName": "CUSTOM"}`.
821
+ *
822
+ * Min: 2 characters
823
+ */
824
+ customEventName?: string | null;
825
+ /**
826
+ * Supported values include: `"cycle_name"`, `"currency"`, `"sum"`, `"reason"`, `"app_plan_id"`.
827
+ * You may also submit data with keys that aren't listed here.
828
+ *
829
+ * Additional data about your app's event.
830
+ *
831
+ * + `"cycle_name"`: Supported values: `"monthly"`, `"yearly"`, `"2 years"`, `"one time"`.
832
+ * + `"currency"`: 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
833
+ * + `"sum"`: Amount of money. Required for `{"eventName": "CHARGE"}` and `{"eventName": "FUNDS_RETURNED"}`.
834
+ * + `"reason"`: Information about why the event was triggered in your app.
835
+ * + `"app_plan_id"`: ID of the your app's plan as displayed in the Developers Center. Note that it's the same value as `vendorProductId` in the [Paid Plan Purchased webhook](https://dev.wix.com/docs/rest/api-reference/app-management/apps/app-instance/paid-plan-purchased).
836
+ */
837
+ eventData?: Record<string, string>;
838
+ }
839
+ declare enum EventName {
840
+ UNKNOWN = "UNKNOWN",
841
+ APP_DASHBOARD_LOADED = "APP_DASHBOARD_LOADED",
842
+ APP_FINISHED_CONFIGURATION = "APP_FINISHED_CONFIGURATION",
843
+ APP_UPGRADED = "APP_UPGRADED",
844
+ PRIMARY_ACTION_PERFORMED = "PRIMARY_ACTION_PERFORMED",
845
+ CUSTOM = "CUSTOM",
846
+ CHARGE = "CHARGE",
847
+ FUNDS_RETURNED = "FUNDS_RETURNED",
848
+ APP_FINISH_BUSINESS_SETUP = "APP_FINISH_BUSINESS_SETUP",
849
+ APP_DEPLOYED = "APP_DEPLOYED",
850
+ APP_SETUP_FINISHED = "APP_SETUP_FINISHED"
851
+ }
852
+ interface SendBiEventOptions {
853
+ /**
854
+ * Name of the event that's triggered in your app.
855
+ *
856
+ * + `"APP_DASHBOARD_LOADED"`: A site onwer or contributor loads your app's dashboard.
857
+ * + `"APP_FINISHED_CONFIGURATION"`: The site owner completes all required configurations for your app in the Wix Developers Center.
858
+ * + `"APP_UPGRADED"`: The site owner upgrades your app's paid plan. An upgrade means that they have finished the checkout flow on the app's side but not necessarily on Wix's side.
859
+ * + `"PRIMARY_ACTION_PERFORMED"`: A site owner, contributor, or visitor triggers your app's primary action. For example, a site visitor writes a product review using your product review app.
860
+ * + `"CHARGE"`: You charge money from the site owner. For example, when the site owner purchases or renews a subscription for your app. Make sure to also send `eventData` and a key of `sum`.
861
+ * + `"FUNDS_RETURNED"`: Trigger this event when you send money back to a site owner (for example, refunds or chargebacks). Make sure to also send the charge amount inside `eventData`. For example, `{"eventData": {"sum": "5.99"}}`.
862
+ * + `"CUSTOM"`: Any event that's not listed here. Make sure to also send `customEventName`.
863
+ * + `"APP_DEPLOYED"`: Your app’s internal code implementation is changed and might affect user flows or cause a regression.
864
+ * + `"APP_FINISH_BUSINESS_SETUP"`: __Deprecation Notice:__ This enum value will be removed on March 30, 2023. Use `"APP_SETUP_FINISHED"` instead.
865
+ * + `"APP_SETUP_FINISHED"`: The site owner completes your app's required business setup.
866
+ */
867
+ eventName?: EventName;
868
+ /**
869
+ * Name of your app's custom event that was triggered. Required when `{"eventName": "CUSTOM"}`.
870
+ *
871
+ * Min: 2 characters
872
+ */
873
+ customEventName?: string | null;
874
+ /**
875
+ * Supported values include: `"cycle_name"`, `"currency"`, `"sum"`, `"reason"`, `"app_plan_id"`.
876
+ * You may also submit data with keys that aren't listed here.
877
+ *
878
+ * Additional data about your app's event.
879
+ *
880
+ * + `"cycle_name"`: Supported values: `"monthly"`, `"yearly"`, `"2 years"`, `"one time"`.
881
+ * + `"currency"`: 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
882
+ * + `"sum"`: Amount of money. Required for `{"eventName": "CHARGE"}` and `{"eventName": "FUNDS_RETURNED"}`.
883
+ * + `"reason"`: Information about why the event was triggered in your app.
884
+ * + `"app_plan_id"`: ID of the your app's plan as displayed in the Developers Center. Note that it's the same value as `vendorProductId` in the [Paid Plan Purchased webhook](https://dev.wix.com/docs/rest/api-reference/app-management/apps/app-instance/paid-plan-purchased).
885
+ */
886
+ eventData?: Record<string, string>;
887
+ }
888
+
889
+ declare const __metadata$2: {
890
+ PACKAGE_NAME: string;
891
+ };
892
+ declare function sendBiEvent(httpClient: HttpClient$2): (options?: SendBiEventOptions) => Promise<void>;
893
+
894
+ type index_d$2_EventName = EventName;
895
+ declare const index_d$2_EventName: typeof EventName;
896
+ type index_d$2_SendBIEventRequest = SendBIEventRequest;
897
+ type index_d$2_SendBIEventResponse = SendBIEventResponse;
898
+ type index_d$2_SendBiEventOptions = SendBiEventOptions;
899
+ declare const index_d$2_sendBiEvent: typeof sendBiEvent;
900
+ declare namespace index_d$2 {
901
+ 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, __metadata$2 as __metadata, index_d$2_sendBiEvent as sendBiEvent };
902
+ }
903
+
904
+ interface PurchasedItem {
905
+ /** ID of your app's paid plan. */
906
+ productId?: string;
907
+ /** Price of your app's paid plan. For example, `9.95`. */
908
+ price?: string;
909
+ /**
910
+ * 3-letter currency code in
911
+ * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
912
+ */
913
+ currency?: string;
914
+ /** Information about the billing cycle for your app's paid plan. */
915
+ billingCycle?: PaymentCycle;
916
+ /**
917
+ * Date and time the site onwers have purchased your app's paid plan in
918
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
919
+ */
920
+ dateCreated?: Date;
921
+ }
922
+ declare enum PaymentCycle {
923
+ NO_CYCLE = "NO_CYCLE",
924
+ MONTHLY = "MONTHLY",
925
+ YEARLY = "YEARLY",
926
+ ONE_TIME = "ONE_TIME",
927
+ TWO_YEARS = "TWO_YEARS",
928
+ THREE_YEARS = "THREE_YEARS",
929
+ FOUR_YEARS = "FOUR_YEARS",
930
+ FIVE_YEARS = "FIVE_YEARS"
931
+ }
932
+ interface InvoiceStatusUpdate {
933
+ /** Invoice payment status. */
934
+ status?: InvoiceStatus;
935
+ /** Wix Premium invoice ID. */
936
+ invoiceId?: string;
937
+ /** App instance ID - a unique ID assigned to each app in each site. */
938
+ instanceId?: string | null;
939
+ /** Whether the invoice is for a single payment or for multiple, recurring payments. */
940
+ recurring?: boolean;
941
+ }
942
+ declare enum InvoiceStatus {
943
+ UNKNOWN_INVOICE_STATUS = "UNKNOWN_INVOICE_STATUS",
944
+ PAYMENT_FAILED = "PAYMENT_FAILED",
945
+ PAID = "PAID",
946
+ REFUNDED = "REFUNDED",
947
+ VOIDED = "VOIDED",
948
+ CHARGEDBACK = "CHARGEDBACK"
949
+ }
950
+ interface GetUrlRequest {
951
+ /**
952
+ * ID of your app's paid plan to retrieve the Wix checkout URL for. Check the
953
+ * Wix Developers Center for a list of your app's supported product IDs.
954
+ */
955
+ productId: string;
956
+ /**
957
+ * URL for the Wix checkout page. Redirect site owners to this URL after
958
+ * they've successfully purchased a paid plan for your app.
959
+ */
960
+ successUrl?: string | null;
961
+ /**
962
+ * Whether the checkout is for testing purposes only. Testing is mainly
963
+ * relevant for in-app purchase flows. When `true`, Wix charges the site
964
+ * owners an amount of `0.00`.
965
+ */
966
+ testCheckout?: boolean;
967
+ /** Information about the paid plan's billing cycle. */
968
+ billingCycle?: PaymentCycle;
969
+ /**
970
+ * 2-letter country code in
971
+ * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
972
+ * format.
973
+ *
974
+ * Default: `"US"`
975
+ */
976
+ countryCode?: string | null;
977
+ /**
978
+ * 2-letter language code in
979
+ * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
980
+ *
981
+ * Default: `"EN"`
982
+ */
983
+ languageCode?: string | null;
984
+ /** Coupon code for the paid plan. Available only in case there is a discount. */
985
+ couponCode?: string | null;
986
+ }
987
+ interface ChargeOverride {
988
+ /**
989
+ * Override price. In case you omit the override price, Wix charges site
990
+ * owners the app's default price that's configured in the Wix Developers
991
+ * Center.
992
+ */
993
+ price?: number;
994
+ /**
995
+ * Override 3-letter currency code in
996
+ * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
997
+ */
998
+ currency?: string;
999
+ }
1000
+ interface GetUrlResponse {
1001
+ /** URL for the Wix checkout page. */
1002
+ checkoutUrl?: string;
1003
+ /**
1004
+ * Token for the Wix checkout page. The token holds all data about the order
1005
+ * you're creating a checkout for. It is [signed](),
1006
+ * so you can verify that it comes from Wix.
1007
+ */
1008
+ token?: string | null;
1009
+ }
1010
+ interface GetPurchaseHistoryRequest {
1011
+ }
1012
+ interface GetPurchaseHistoryResponse {
1013
+ /** Retrieved purchases the site owners have completed for you app. */
1014
+ purchases?: PurchasedItem[];
1015
+ }
1016
+ interface GetSitePaymentMethodsStatusRequest {
1017
+ }
1018
+ interface GetSitePaymentMethodsStatusResponse {
1019
+ /**
1020
+ * Whether the site owners have enabled at least a single online payment method.
1021
+ * Online payment methods include Wix Payments, Stripe, PayPal, and credit
1022
+ * cards.
1023
+ */
1024
+ onlineProviderEnabled?: boolean;
1025
+ /** Whether the site owners accept offline payments. */
1026
+ offlineProviderEnabled?: boolean;
1027
+ /**
1028
+ * Whether the site owners have enabled the
1029
+ * [Wix Point of Sale](https://www.wix.com/pos).
1030
+ * This allows their customers to make electronic payments in person.
1031
+ */
1032
+ wixPosProviderEnabled?: boolean;
1033
+ /**
1034
+ * Whether the site owners have enabled at least one 3rd-party point-of-sale
1035
+ * provider. This allows their customers to make electronic payments in person.
1036
+ */
1037
+ thirdPartyPosProviderEnabled?: boolean;
1038
+ }
1039
+ interface GetMeteredBillingChargesRequest {
1040
+ /**
1041
+ * 3-letter currency code in
1042
+ * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
1043
+ */
1044
+ currency?: string | null;
1045
+ /**
1046
+ * Start of the period you want to retrieve the custom charges for in
1047
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
1048
+ */
1049
+ startDate?: Date;
1050
+ /**
1051
+ * End of the period you want to retrieve the custom charges for in
1052
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
1053
+ */
1054
+ endDate?: Date;
1055
+ }
1056
+ interface GetMeteredBillingChargesResponse {
1057
+ /** List of retrieved custom charges. */
1058
+ charges?: Charge[];
1059
+ }
1060
+ interface Charge {
1061
+ /** ID of the custom charge. The ID consists of 64 characters. */
1062
+ _id?: string | null;
1063
+ /** Description of the custom charge. */
1064
+ description?: string;
1065
+ /**
1066
+ * Charge amount.
1067
+ *
1068
+ * Min: `0.50`
1069
+ */
1070
+ amount?: string;
1071
+ }
1072
+ interface MessageEnvelope {
1073
+ /** App instance ID. */
1074
+ instanceId?: string | null;
1075
+ /** Event type. */
1076
+ eventType?: string;
1077
+ /** The identification type and identity data. */
1078
+ identity?: IdentificationData;
1079
+ /** Stringify payload. */
1080
+ data?: string;
1081
+ }
1082
+ interface IdentificationData extends IdentificationDataIdOneOf {
1083
+ /** ID of a site visitor that has not logged in to the site. */
1084
+ anonymousVisitorId?: string;
1085
+ /** ID of a site visitor that has logged in to the site. */
1086
+ memberId?: string;
1087
+ /** ID of a Wix user (site owner, contributor, etc.). */
1088
+ wixUserId?: string;
1089
+ /** ID of an app. */
1090
+ appId?: string;
1091
+ /** @readonly */
1092
+ identityType?: WebhookIdentityType;
1093
+ }
1094
+ /** @oneof */
1095
+ interface IdentificationDataIdOneOf {
1096
+ /** ID of a site visitor that has not logged in to the site. */
1097
+ anonymousVisitorId?: string;
1098
+ /** ID of a site visitor that has logged in to the site. */
1099
+ memberId?: string;
1100
+ /** ID of a Wix user (site owner, contributor, etc.). */
1101
+ wixUserId?: string;
1102
+ /** ID of an app. */
1103
+ appId?: string;
1104
+ }
1105
+ declare enum WebhookIdentityType {
1106
+ UNKNOWN = "UNKNOWN",
1107
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
1108
+ MEMBER = "MEMBER",
1109
+ WIX_USER = "WIX_USER",
1110
+ APP = "APP"
1111
+ }
1112
+ interface GetUrlResponseNonNullableFields {
1113
+ checkoutUrl: string;
1114
+ }
1115
+ interface GetPurchaseHistoryResponseNonNullableFields {
1116
+ purchases: {
1117
+ productId: string;
1118
+ price: string;
1119
+ currency: string;
1120
+ billingCycle: PaymentCycle;
1121
+ }[];
1122
+ }
1123
+ interface GetUrlOptions {
1124
+ /**
1125
+ * URL for the Wix checkout page. Redirect site owners to this URL after
1126
+ * they've successfully purchased a paid plan for your app.
1127
+ */
1128
+ successUrl?: string | null;
1129
+ /**
1130
+ * Whether the checkout is for testing purposes only. Testing is mainly
1131
+ * relevant for in-app purchase flows. When `true`, Wix charges the site
1132
+ * owners an amount of `0.00`.
1133
+ */
1134
+ testCheckout?: boolean;
1135
+ /** Information about the paid plan's billing cycle. */
1136
+ billingCycle?: PaymentCycle;
1137
+ /**
1138
+ * 2-letter country code in
1139
+ * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
1140
+ * format.
1141
+ *
1142
+ * Default: `"US"`
1143
+ */
1144
+ countryCode?: string | null;
1145
+ /**
1146
+ * 2-letter language code in
1147
+ * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
1148
+ *
1149
+ * Default: `"EN"`
1150
+ */
1151
+ languageCode?: string | null;
1152
+ /** Coupon code for the paid plan. Available only in case there is a discount. */
1153
+ couponCode?: string | null;
1154
+ }
1155
+
1156
+ interface HttpClient$1 {
1157
+ request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
1158
+ fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
1159
+ }
1160
+ type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
1161
+ type HttpResponse$1<T = any> = {
1162
+ data: T;
1163
+ status: number;
1164
+ statusText: string;
1165
+ headers: any;
1166
+ request?: any;
1167
+ };
1168
+ type RequestOptions$1<_TResponse = any, Data = any> = {
1169
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
1170
+ url: string;
1171
+ data?: Data;
1172
+ params?: URLSearchParams;
1173
+ } & APIMetadata$1;
1174
+ type APIMetadata$1 = {
1175
+ methodFqn?: string;
1176
+ entityFqdn?: string;
1177
+ packageName?: string;
1178
+ };
1179
+
1180
+ declare global {
1181
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
1182
+ interface SymbolConstructor {
1183
+ readonly observable: symbol;
1184
+ }
1185
+ }
1186
+
1187
+ declare const __metadata$1: {
1188
+ PACKAGE_NAME: string;
1189
+ };
1190
+ declare function getUrl(httpClient: HttpClient$1): (productId: string, options?: GetUrlOptions) => Promise<GetUrlResponse & GetUrlResponseNonNullableFields>;
1191
+ declare function getPurchaseHistory(httpClient: HttpClient$1): () => Promise<GetPurchaseHistoryResponse & GetPurchaseHistoryResponseNonNullableFields>;
1192
+
1193
+ type index_d$1_Charge = Charge;
1194
+ type index_d$1_ChargeOverride = ChargeOverride;
1195
+ type index_d$1_GetMeteredBillingChargesRequest = GetMeteredBillingChargesRequest;
1196
+ type index_d$1_GetMeteredBillingChargesResponse = GetMeteredBillingChargesResponse;
1197
+ type index_d$1_GetPurchaseHistoryRequest = GetPurchaseHistoryRequest;
1198
+ type index_d$1_GetPurchaseHistoryResponse = GetPurchaseHistoryResponse;
1199
+ type index_d$1_GetPurchaseHistoryResponseNonNullableFields = GetPurchaseHistoryResponseNonNullableFields;
1200
+ type index_d$1_GetSitePaymentMethodsStatusRequest = GetSitePaymentMethodsStatusRequest;
1201
+ type index_d$1_GetSitePaymentMethodsStatusResponse = GetSitePaymentMethodsStatusResponse;
1202
+ type index_d$1_GetUrlOptions = GetUrlOptions;
1203
+ type index_d$1_GetUrlRequest = GetUrlRequest;
1204
+ type index_d$1_GetUrlResponse = GetUrlResponse;
1205
+ type index_d$1_GetUrlResponseNonNullableFields = GetUrlResponseNonNullableFields;
1206
+ type index_d$1_IdentificationData = IdentificationData;
1207
+ type index_d$1_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
1208
+ type index_d$1_InvoiceStatus = InvoiceStatus;
1209
+ declare const index_d$1_InvoiceStatus: typeof InvoiceStatus;
1210
+ type index_d$1_InvoiceStatusUpdate = InvoiceStatusUpdate;
1211
+ type index_d$1_MessageEnvelope = MessageEnvelope;
1212
+ type index_d$1_PaymentCycle = PaymentCycle;
1213
+ declare const index_d$1_PaymentCycle: typeof PaymentCycle;
1214
+ type index_d$1_PurchasedItem = PurchasedItem;
1215
+ type index_d$1_WebhookIdentityType = WebhookIdentityType;
1216
+ declare const index_d$1_WebhookIdentityType: typeof WebhookIdentityType;
1217
+ declare const index_d$1_getPurchaseHistory: typeof getPurchaseHistory;
1218
+ declare const index_d$1_getUrl: typeof getUrl;
1219
+ declare namespace index_d$1 {
1220
+ 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, __metadata$1 as __metadata, index_d$1_getPurchaseHistory as getPurchaseHistory, index_d$1_getUrl as getUrl };
1221
+ }
1222
+
1223
+ /** Embedded script data */
1224
+ interface ScriptProperties {
1225
+ /** Script parameters */
1226
+ parameters?: Record<string, string>;
1227
+ /** Whether script is disabled or not, defaults to false (not disabled) */
1228
+ disabled?: boolean;
1229
+ }
1230
+ interface EmbedScriptRequest {
1231
+ /** Details of the script to embed. */
1232
+ properties: ScriptProperties;
1233
+ /** ID of the corresponding embedded script component. */
1234
+ componentId?: string | null;
1235
+ }
1236
+ interface EmbedScriptResponse {
1237
+ /** Details of the embedded script. */
1238
+ properties?: ScriptProperties;
1239
+ }
1240
+ interface GetEmbeddedScriptRequest {
1241
+ /** Component ID of the embedded script to retrieve. */
1242
+ componentId?: string | null;
1243
+ }
1244
+ interface GetEmbeddedScriptResponse {
1245
+ /** Details of the retrieved embedded script. */
1246
+ properties?: ScriptProperties;
1247
+ }
1248
+ interface EmbedScriptByInstanceIdRequest {
1249
+ instanceId?: string;
1250
+ /** Parameters to embed */
1251
+ properties?: ScriptProperties;
1252
+ componentId?: string | null;
1253
+ }
1254
+ interface GetEmbeddedScriptByInstanceIdRequest {
1255
+ instanceId?: string;
1256
+ componentId?: string | null;
1257
+ }
1258
+ interface EmbedScriptResponseNonNullableFields {
1259
+ properties?: {
1260
+ disabled: boolean;
1261
+ };
1262
+ }
1263
+ interface GetEmbeddedScriptResponseNonNullableFields {
1264
+ properties?: {
1265
+ disabled: boolean;
1266
+ };
1267
+ }
1268
+ interface EmbedScriptOptions {
1269
+ /** ID of the corresponding embedded script component. */
1270
+ componentId?: string | null;
1271
+ }
1272
+ interface GetEmbeddedScriptOptions {
1273
+ /** Component ID of the embedded script to retrieve. */
1274
+ componentId?: string | null;
1275
+ }
1276
+
1277
+ interface HttpClient {
1278
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
1279
+ fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
1280
+ }
1281
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
1282
+ type HttpResponse<T = any> = {
1283
+ data: T;
1284
+ status: number;
1285
+ statusText: string;
1286
+ headers: any;
1287
+ request?: any;
1288
+ };
1289
+ type RequestOptions<_TResponse = any, Data = any> = {
1290
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
1291
+ url: string;
1292
+ data?: Data;
1293
+ params?: URLSearchParams;
1294
+ } & APIMetadata;
1295
+ type APIMetadata = {
1296
+ methodFqn?: string;
1297
+ entityFqdn?: string;
1298
+ packageName?: string;
1299
+ };
1300
+
1301
+ declare global {
1302
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
1303
+ interface SymbolConstructor {
1304
+ readonly observable: symbol;
1305
+ }
1306
+ }
1307
+
1308
+ declare const __metadata: {
1309
+ PACKAGE_NAME: string;
1310
+ };
1311
+ declare function embedScript(httpClient: HttpClient): (properties: ScriptProperties, options?: EmbedScriptOptions) => Promise<EmbedScriptResponse & EmbedScriptResponseNonNullableFields>;
1312
+ declare function getEmbeddedScript(httpClient: HttpClient): (options?: GetEmbeddedScriptOptions) => Promise<ScriptProperties & {
1313
+ disabled: boolean;
1314
+ }>;
1315
+
1316
+ type index_d_EmbedScriptByInstanceIdRequest = EmbedScriptByInstanceIdRequest;
1317
+ type index_d_EmbedScriptOptions = EmbedScriptOptions;
1318
+ type index_d_EmbedScriptRequest = EmbedScriptRequest;
1319
+ type index_d_EmbedScriptResponse = EmbedScriptResponse;
1320
+ type index_d_EmbedScriptResponseNonNullableFields = EmbedScriptResponseNonNullableFields;
1321
+ type index_d_GetEmbeddedScriptByInstanceIdRequest = GetEmbeddedScriptByInstanceIdRequest;
1322
+ type index_d_GetEmbeddedScriptOptions = GetEmbeddedScriptOptions;
1323
+ type index_d_GetEmbeddedScriptRequest = GetEmbeddedScriptRequest;
1324
+ type index_d_GetEmbeddedScriptResponse = GetEmbeddedScriptResponse;
1325
+ type index_d_GetEmbeddedScriptResponseNonNullableFields = GetEmbeddedScriptResponseNonNullableFields;
1326
+ type index_d_ScriptProperties = ScriptProperties;
1327
+ declare const index_d___metadata: typeof __metadata;
1328
+ declare const index_d_embedScript: typeof embedScript;
1329
+ declare const index_d_getEmbeddedScript: typeof getEmbeddedScript;
1330
+ declare namespace index_d {
1331
+ export { type index_d_EmbedScriptByInstanceIdRequest as EmbedScriptByInstanceIdRequest, type index_d_EmbedScriptOptions as EmbedScriptOptions, type index_d_EmbedScriptRequest as EmbedScriptRequest, type index_d_EmbedScriptResponse as EmbedScriptResponse, type index_d_EmbedScriptResponseNonNullableFields as EmbedScriptResponseNonNullableFields, type index_d_GetEmbeddedScriptByInstanceIdRequest as GetEmbeddedScriptByInstanceIdRequest, type index_d_GetEmbeddedScriptOptions as GetEmbeddedScriptOptions, type index_d_GetEmbeddedScriptRequest as GetEmbeddedScriptRequest, type index_d_GetEmbeddedScriptResponse as GetEmbeddedScriptResponse, type index_d_GetEmbeddedScriptResponseNonNullableFields as GetEmbeddedScriptResponseNonNullableFields, type index_d_ScriptProperties as ScriptProperties, index_d___metadata as __metadata, index_d_embedScript as embedScript, index_d_getEmbeddedScript as getEmbeddedScript };
1332
+ }
1333
+
1334
+ export { index_d$3 as appInstances, index_d$4 as appPlans, index_d$2 as biEvents, index_d$1 as billing, index_d as embeddedScripts };