@wix/app-management 1.0.21 → 1.0.22

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/app-management",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -19,12 +19,12 @@
19
19
  "service-plugins"
20
20
  ],
21
21
  "dependencies": {
22
- "@wix/app-management_app-instances": "1.0.11",
23
- "@wix/app-management_app-plans": "1.0.11",
24
- "@wix/app-management_bi-events": "1.0.10",
25
- "@wix/app-management_billing": "1.0.11",
22
+ "@wix/app-management_app-instances": "1.0.12",
23
+ "@wix/app-management_app-plans": "1.0.12",
24
+ "@wix/app-management_bi-events": "1.0.11",
25
+ "@wix/app-management_billing": "1.0.12",
26
26
  "@wix/app-management_custom-charges": "1.0.6",
27
- "@wix/app-management_embedded-scripts": "1.0.8"
27
+ "@wix/app-management_embedded-scripts": "1.0.9"
28
28
  },
29
29
  "devDependencies": {
30
30
  "glob": "^10.4.1",
@@ -48,5 +48,5 @@
48
48
  "fqdn": ""
49
49
  }
50
50
  },
51
- "falconPackageHash": "92d82785d051537964c94876233fcc6ab069b7f94e686627793308e0"
51
+ "falconPackageHash": "49dc28b408cb41bcde5e89d12716dbed38840dea218ac1fbff758e3f"
52
52
  }
@@ -1,3 +1,233 @@
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
+
1
231
  type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
2
232
  interface HttpClient {
3
233
  request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
@@ -46,9 +276,420 @@ declare function createRESTModule$4<T extends RESTFunctionDescriptor>(descriptor
46
276
 
47
277
  declare const listAppPlansByAppId: ReturnType<typeof createRESTModule$4<typeof publicListAppPlansByAppId>>;
48
278
 
279
+ type context$4_AppPlans = AppPlans;
280
+ type context$4_Cycle = Cycle;
281
+ type context$4_CycleType = CycleType;
282
+ declare const context$4_CycleType: typeof CycleType;
283
+ type context$4_Duration = Duration;
284
+ type context$4_DurationUnit = DurationUnit;
285
+ declare const context$4_DurationUnit: typeof DurationUnit;
286
+ type context$4_ListAppPlansByAppIdRequest = ListAppPlansByAppIdRequest;
287
+ type context$4_ListAppPlansByAppIdResponse = ListAppPlansByAppIdResponse;
288
+ type context$4_ListAppPlansByAppIdResponseNonNullableFields = ListAppPlansByAppIdResponseNonNullableFields;
289
+ type context$4_Plan = Plan;
290
+ type context$4_Price = Price;
291
+ type context$4_TaxSettings = TaxSettings;
292
+ type context$4_TaxType = TaxType;
293
+ declare const context$4_TaxType: typeof TaxType;
294
+ type context$4_UsageBasedDetails = UsageBasedDetails;
49
295
  declare const context$4_listAppPlansByAppId: typeof listAppPlansByAppId;
50
296
  declare namespace context$4 {
51
- export { context$4_listAppPlansByAppId as listAppPlansByAppId };
297
+ export { type context$4_AppPlans as AppPlans, type context$4_Cycle as Cycle, context$4_CycleType as CycleType, 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 };
298
+ }
299
+
300
+ /**
301
+ * An app instance is a specific occurrence of your app on a particular Wix site.
302
+ * When a site owner installs your app, a unique instance is generated for that
303
+ * specific site. Use the `instanceId` to keep track of the individual data
304
+ * associated with each app instance.
305
+ */
306
+ interface AppInstance {
307
+ /**
308
+ * ID of the app instance. You can use it to keep track of the individual
309
+ * data that's associated with the specific occurence of your app that's
310
+ * installed on a Wix site.
311
+ */
312
+ instanceId?: string;
313
+ /**
314
+ * App name, as set by you in the Wix Developers Center during the app creation
315
+ * process.
316
+ */
317
+ appName?: string;
318
+ /**
319
+ * Version of your app that's installed on the Wix site, as set by you in the
320
+ * Wix Developers Center during the app creation process.
321
+ */
322
+ appVersion?: string | null;
323
+ /**
324
+ * Whether the site owners have installed a free or paid version of your app
325
+ * on their site.
326
+ */
327
+ isFree?: boolean;
328
+ /**
329
+ * Billing information for the app instance. Available only in case
330
+ * `{"isFree": false}`.
331
+ */
332
+ billing?: BillingInfo;
333
+ /**
334
+ * List of [permissions](https://dev.wix.com/docs/build-apps/developer-tools/developers-center/example-app-walkthrough/build-an-app#4-add-permissions)
335
+ * that the site owners have granted your app. You set the list of permissions that
336
+ * your app requires from the site owners in the Wix Developers Center during the
337
+ * app creation process.
338
+ */
339
+ permissions?: string[];
340
+ /** Plans available to this app instance. */
341
+ availablePlans?: AvailablePlan[];
342
+ /**
343
+ * ID of the Wix site from which the instance of your app has been cloned.
344
+ * Available only in case `{"copiedFromTemplate": true}`.
345
+ * All visual settings of the Wix site and app data are duplicated during the
346
+ * cloning process. Wix also notifies you in case there is any additional
347
+ * external functionality for the original site.
348
+ */
349
+ originInstanceId?: string | null;
350
+ /**
351
+ * __Deprecated__. This parameter will be removed on March 30, 2023. Use
352
+ * `copiedFromTemplate` instead.
353
+ * @deprecated
354
+ */
355
+ isOriginSiteTemplate?: boolean;
356
+ /** Whether the app instance was created when another Wix site was cloned. */
357
+ copiedFromTemplate?: boolean;
358
+ /** Whether the app instance includes a free trial that hasn't started yet. */
359
+ freeTrialAvailable?: boolean;
360
+ }
361
+ interface BillingInfo {
362
+ /** Name of the package that the site owner has paid for. */
363
+ packageName?: string;
364
+ /**
365
+ * Interval of the billing cycle. `"ONE_TIME"` means that site owners have
366
+ * purchased unlimited access to the app with a single, upfront payment.
367
+ */
368
+ billingCycle?: PaymentCycle$1;
369
+ /**
370
+ * Date and time the site owners have purchased the app's paid plan in
371
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
372
+ */
373
+ timeStamp?: string;
374
+ /**
375
+ * Date and time the app's current billing cycle ends in
376
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format. Available only for yearly and
377
+ * multi-yearly plans.
378
+ */
379
+ expirationDate?: string | null;
380
+ /**
381
+ * Whether the app's subscription automatically renews at the end of the
382
+ * current billing cycle.
383
+ */
384
+ autoRenewing?: boolean | null;
385
+ /** ID of the invoice for the current billing cycle. */
386
+ invoiceId?: string | null;
387
+ /**
388
+ * Information about any discounts applied to the app instance's current billing cycle.
389
+ * If the site owners applied a developer coupon or Wix Voucher
390
+ * when installing the paid version of your app, this field holds the coupon's
391
+ * name or `“Wix discount coupon”`. Site owners may receive a Wix Voucher when
392
+ * upgrading their Wix subscription. If there is no discount for the
393
+ * current billing cycle, the field is an empty string.
394
+ */
395
+ source?: string | null;
396
+ /** Information about the free trial applied, if relevant. */
397
+ freeTrialInfo?: FreeTrialInfo;
398
+ }
399
+ declare enum PaymentCycle$1 {
400
+ NO_CYCLE = "NO_CYCLE",
401
+ MONTHLY = "MONTHLY",
402
+ YEARLY = "YEARLY",
403
+ ONE_TIME = "ONE_TIME",
404
+ TWO_YEARS = "TWO_YEARS",
405
+ THREE_YEARS = "THREE_YEARS",
406
+ FOUR_YEARS = "FOUR_YEARS",
407
+ FIVE_YEARS = "FIVE_YEARS"
408
+ }
409
+ interface FreeTrialInfo {
410
+ /**
411
+ * Current free trial status.
412
+ *
413
+ * Supported values:
414
+ *
415
+ * - `IN_PROGRESS`: The free trial is currently in progress.
416
+ * - `ENDED`: The free trial has ended.
417
+ * - `NOT_AVAILABLE`: No free trial was applied, as none was available.
418
+ * @readonly
419
+ */
420
+ status?: FreeTrialStatus;
421
+ /**
422
+ * When the free trial has ended. Populated only once the free trial is over.
423
+ * @readonly
424
+ */
425
+ endDate?: Date;
426
+ }
427
+ declare enum FreeTrialStatus {
428
+ UNKNOWN_STATUS = "UNKNOWN_STATUS",
429
+ IN_PROGRESS = "IN_PROGRESS",
430
+ ENDED = "ENDED",
431
+ NOT_AVAILABLE = "NOT_AVAILABLE"
432
+ }
433
+ interface AvailablePlan {
434
+ /** Package name of the available plan. */
435
+ packageName?: string;
436
+ /** Source of the available plan. Can be a bundle or 3rd-party app. */
437
+ source?: string;
438
+ }
439
+ interface AppInstalled {
440
+ /** Unique identifier of the app within the website. */
441
+ appId?: string;
442
+ /** 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)). */
443
+ originInstanceId?: string | null;
444
+ }
445
+ interface AppRemoved {
446
+ /** Unique identifier of the app within the website. */
447
+ appId?: string;
448
+ }
449
+ interface PaidPlanPurchased {
450
+ /** Date and time of purchase. */
451
+ operationTimeStamp?: Date;
452
+ /** Purchased app plan. */
453
+ vendorProductId?: string;
454
+ /** Selected payment cycle. */
455
+ cycle?: PaymentCycle$1;
456
+ /** Plan expiration date. */
457
+ expiresOn?: Date;
458
+ /** Coupon applied to purchase (if relevant). */
459
+ couponName?: string | null;
460
+ /** Invoice ID. */
461
+ invoiceId?: string | null;
462
+ }
463
+ interface PaidPlanChanged {
464
+ /** Date and time of change. */
465
+ operationTimeStamp?: Date;
466
+ /** Newly purchased app plan. */
467
+ vendorProductId?: string;
468
+ /** Newly selected payment cycle. */
469
+ cycle?: PaymentCycle$1;
470
+ /** Previous app plan. */
471
+ previousVendorProductId?: string | null;
472
+ /** Previous payment cycle. */
473
+ previousCycle?: PaymentCycle$1;
474
+ /** Coupon applied to purchase (if relevant). */
475
+ couponName?: string | null;
476
+ /** Invoice ID. */
477
+ invoiceId?: string | null;
478
+ }
479
+ interface PaidPlanAutoRenewalCancelled {
480
+ /** Date and time of auto-renewal cancellation. */
481
+ operationTimeStamp?: Date;
482
+ /** Current app plan. */
483
+ vendorProductId?: string;
484
+ /** Current payment cycle. */
485
+ cycle?: PaymentCycle$1;
486
+ /** Supported values: `UNKNOWN_CANCELLATION_TYPE_ERROR_STATE`, `USER_CANCEL`, `FAILED_PAYMENT`, `TRANSFER_CANCELLATION_REASON`. Reason provided by app for cancellation (if relevant). */
487
+ cancelReason?: string | null;
488
+ /** Reason provided by site owner for cancellation (if relevant). */
489
+ userReason?: string | null;
490
+ /** Cancellation type. */
491
+ subscriptionCancellationType?: string | null;
492
+ }
493
+ interface GetAppInstanceRequest {
494
+ }
495
+ interface GetAppInstanceResponse {
496
+ /** Retrieved app instance. */
497
+ instance?: AppInstance;
498
+ /** Information about the corresponding Wix site. */
499
+ site?: SiteInfo;
500
+ }
501
+ interface SiteInfo {
502
+ /** Display name of the site. */
503
+ siteDisplayName?: string | null;
504
+ /**
505
+ * 2-letter language code of the site's locale in
506
+ * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
507
+ */
508
+ locale?: string;
509
+ /**
510
+ * 3-letter currency code for the site's billing in
511
+ * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
512
+ */
513
+ paymentCurrency?: string;
514
+ /** Information about the site's supported languages. */
515
+ multilingual?: Multilingual;
516
+ /** URL of the site. Available only in case the site has been published. */
517
+ url?: string | null;
518
+ /** Description of the site. */
519
+ description?: string | null;
520
+ /** Wix apps that are installed on the site. */
521
+ installedWixApps?: string[];
522
+ /**
523
+ * > **Deprecation Notice:** This parameter will be removed on June 30, 2022. Use `ownerInfo` instead.
524
+ * @deprecated
525
+ */
526
+ ownerEmail?: string | null;
527
+ /**
528
+ * Information about the site owner. Available only when calling
529
+ * _Get App Instance_ with the __Read Site Owner Email__ permission scope.
530
+ */
531
+ ownerInfo?: OwnerInfo;
532
+ /** Site ID. */
533
+ siteId?: string;
534
+ }
535
+ interface Multilingual {
536
+ /** Whether the site supports more than a single language. */
537
+ isMultiLingual?: boolean;
538
+ /** List of supported languages. Returned only when `{"isMultiLingual": true}`. */
539
+ supportedLanguages?: SupportedLanguage[];
540
+ }
541
+ interface SupportedLanguage {
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
+ /** Locale. */
545
+ locale?: Locale;
546
+ /** Whether the supported language is the primary language for the site. */
547
+ isPrimary?: boolean;
548
+ /** Language icon. */
549
+ countryCode?: string;
550
+ /** How the language will be resolved. For internal use. */
551
+ resolutionMethod?: ResolutionMethod;
552
+ }
553
+ interface Locale {
554
+ /** Two-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */
555
+ languageCode?: string;
556
+ /** Two-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format. */
557
+ country?: string;
558
+ }
559
+ declare enum ResolutionMethod {
560
+ QUERY_PARAM = "QUERY_PARAM",
561
+ SUBDOMAIN = "SUBDOMAIN",
562
+ SUBDIRECTORY = "SUBDIRECTORY"
563
+ }
564
+ interface OwnerInfo {
565
+ /** Site owner's email address. Identical to the site owner's login email. */
566
+ email?: string;
567
+ /**
568
+ * Supported values: `VERIFIED_OPT_IN`, `VERIFIED_OPT_OUT`,
569
+ * `NOT_VERIFIED_OPT_IN`, `NOT_VERIFIED_OPT_OUT`.
570
+ *
571
+ * Whether the site owner has verified their email and whether they have chosen
572
+ * to receive email notifications from Wix.
573
+ */
574
+ emailStatus?: string;
575
+ }
576
+ interface GetAppInstanceByInstanceIdRequest {
577
+ /** ID of the app instance to retrieve. */
578
+ instanceId?: string;
579
+ }
580
+ interface MessageEnvelope$1 {
581
+ /** App instance ID. */
582
+ instanceId?: string | null;
583
+ /** Event type. */
584
+ eventType?: string;
585
+ /** The identification type and identity data. */
586
+ identity?: IdentificationData$1;
587
+ /** Stringify payload. */
588
+ data?: string;
589
+ }
590
+ interface IdentificationData$1 extends IdentificationDataIdOneOf$1 {
591
+ /** ID of a site visitor that has not logged in to the site. */
592
+ anonymousVisitorId?: string;
593
+ /** ID of a site visitor that has logged in to the site. */
594
+ memberId?: string;
595
+ /** ID of a Wix user (site owner, contributor, etc.). */
596
+ wixUserId?: string;
597
+ /** ID of an app. */
598
+ appId?: string;
599
+ /** @readonly */
600
+ identityType?: WebhookIdentityType$1;
601
+ }
602
+ /** @oneof */
603
+ interface IdentificationDataIdOneOf$1 {
604
+ /** ID of a site visitor that has not logged in to the site. */
605
+ anonymousVisitorId?: string;
606
+ /** ID of a site visitor that has logged in to the site. */
607
+ memberId?: string;
608
+ /** ID of a Wix user (site owner, contributor, etc.). */
609
+ wixUserId?: string;
610
+ /** ID of an app. */
611
+ appId?: string;
612
+ }
613
+ declare enum WebhookIdentityType$1 {
614
+ UNKNOWN = "UNKNOWN",
615
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
616
+ MEMBER = "MEMBER",
617
+ WIX_USER = "WIX_USER",
618
+ APP = "APP"
619
+ }
620
+ interface GetAppInstanceResponseNonNullableFields {
621
+ instance?: {
622
+ instanceId: string;
623
+ appName: string;
624
+ isFree: boolean;
625
+ billing?: {
626
+ packageName: string;
627
+ billingCycle: PaymentCycle$1;
628
+ timeStamp: string;
629
+ freeTrialInfo?: {
630
+ status: FreeTrialStatus;
631
+ };
632
+ };
633
+ permissions: string[];
634
+ availablePlans: {
635
+ packageName: string;
636
+ source: string;
637
+ }[];
638
+ isOriginSiteTemplate: boolean;
639
+ copiedFromTemplate: boolean;
640
+ freeTrialAvailable: boolean;
641
+ };
642
+ site?: {
643
+ locale: string;
644
+ paymentCurrency: string;
645
+ multilingual?: {
646
+ isMultiLingual: boolean;
647
+ supportedLanguages: {
648
+ languageCode: string;
649
+ locale?: {
650
+ languageCode: string;
651
+ country: string;
652
+ };
653
+ isPrimary: boolean;
654
+ countryCode: string;
655
+ resolutionMethod: ResolutionMethod;
656
+ }[];
657
+ };
658
+ installedWixApps: string[];
659
+ ownerInfo?: {
660
+ email: string;
661
+ emailStatus: string;
662
+ };
663
+ siteId: string;
664
+ };
665
+ }
666
+ interface BaseEventMetadata {
667
+ /** App instance ID. */
668
+ instanceId?: string | null;
669
+ /** Event type. */
670
+ eventType?: string;
671
+ /** The identification type and identity data. */
672
+ identity?: IdentificationData$1;
673
+ }
674
+ interface AppInstanceInstalledEnvelope {
675
+ data: AppInstalled;
676
+ metadata: BaseEventMetadata;
677
+ }
678
+ interface AppInstanceRemovedEnvelope {
679
+ data: AppRemoved;
680
+ metadata: BaseEventMetadata;
681
+ }
682
+ interface AppInstancePaidPlanPurchasedEnvelope {
683
+ data: PaidPlanPurchased;
684
+ metadata: BaseEventMetadata;
685
+ }
686
+ interface AppInstancePaidPlanChangedEnvelope {
687
+ data: PaidPlanChanged;
688
+ metadata: BaseEventMetadata;
689
+ }
690
+ interface AppInstancePaidPlanAutoRenewalCancelledEnvelope {
691
+ data: PaidPlanAutoRenewalCancelled;
692
+ metadata: BaseEventMetadata;
52
693
  }
53
694
 
54
695
  declare function createRESTModule$3<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
@@ -62,6 +703,34 @@ declare const onAppInstancePaidPlanPurchased: ReturnType<typeof createEventModul
62
703
  declare const onAppInstancePaidPlanChanged: ReturnType<typeof createEventModule<typeof publicOnAppInstancePaidPlanChanged>>;
63
704
  declare const onAppInstancePaidPlanAutoRenewalCancelled: ReturnType<typeof createEventModule<typeof publicOnAppInstancePaidPlanAutoRenewalCancelled>>;
64
705
 
706
+ type context$3_AppInstalled = AppInstalled;
707
+ type context$3_AppInstance = AppInstance;
708
+ type context$3_AppInstanceInstalledEnvelope = AppInstanceInstalledEnvelope;
709
+ type context$3_AppInstancePaidPlanAutoRenewalCancelledEnvelope = AppInstancePaidPlanAutoRenewalCancelledEnvelope;
710
+ type context$3_AppInstancePaidPlanChangedEnvelope = AppInstancePaidPlanChangedEnvelope;
711
+ type context$3_AppInstancePaidPlanPurchasedEnvelope = AppInstancePaidPlanPurchasedEnvelope;
712
+ type context$3_AppInstanceRemovedEnvelope = AppInstanceRemovedEnvelope;
713
+ type context$3_AppRemoved = AppRemoved;
714
+ type context$3_AvailablePlan = AvailablePlan;
715
+ type context$3_BaseEventMetadata = BaseEventMetadata;
716
+ type context$3_BillingInfo = BillingInfo;
717
+ type context$3_FreeTrialInfo = FreeTrialInfo;
718
+ type context$3_FreeTrialStatus = FreeTrialStatus;
719
+ declare const context$3_FreeTrialStatus: typeof FreeTrialStatus;
720
+ type context$3_GetAppInstanceByInstanceIdRequest = GetAppInstanceByInstanceIdRequest;
721
+ type context$3_GetAppInstanceRequest = GetAppInstanceRequest;
722
+ type context$3_GetAppInstanceResponse = GetAppInstanceResponse;
723
+ type context$3_GetAppInstanceResponseNonNullableFields = GetAppInstanceResponseNonNullableFields;
724
+ type context$3_Locale = Locale;
725
+ type context$3_Multilingual = Multilingual;
726
+ type context$3_OwnerInfo = OwnerInfo;
727
+ type context$3_PaidPlanAutoRenewalCancelled = PaidPlanAutoRenewalCancelled;
728
+ type context$3_PaidPlanChanged = PaidPlanChanged;
729
+ type context$3_PaidPlanPurchased = PaidPlanPurchased;
730
+ type context$3_ResolutionMethod = ResolutionMethod;
731
+ declare const context$3_ResolutionMethod: typeof ResolutionMethod;
732
+ type context$3_SiteInfo = SiteInfo;
733
+ type context$3_SupportedLanguage = SupportedLanguage;
65
734
  declare const context$3_getAppInstance: typeof getAppInstance;
66
735
  declare const context$3_onAppInstanceInstalled: typeof onAppInstanceInstalled;
67
736
  declare const context$3_onAppInstancePaidPlanAutoRenewalCancelled: typeof onAppInstancePaidPlanAutoRenewalCancelled;
@@ -69,16 +738,361 @@ declare const context$3_onAppInstancePaidPlanChanged: typeof onAppInstancePaidPl
69
738
  declare const context$3_onAppInstancePaidPlanPurchased: typeof onAppInstancePaidPlanPurchased;
70
739
  declare const context$3_onAppInstanceRemoved: typeof onAppInstanceRemoved;
71
740
  declare namespace context$3 {
72
- export { 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 };
741
+ 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, 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 };
742
+ }
743
+
744
+ interface SendBIEventResponse {
745
+ }
746
+ interface SendBIEventRequest {
747
+ /**
748
+ * Name of the event that's triggered in your app.
749
+ *
750
+ * + `"APP_DASHBOARD_LOADED"`: A site onwer or contributor loads your app's dashboard.
751
+ * + `"APP_FINISHED_CONFIGURATION"`: The site owner completes all required configurations for your app in the Wix Developers Center.
752
+ * + `"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.
753
+ * + `"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.
754
+ * + `"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`.
755
+ * + `"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"}}`.
756
+ * + `"CUSTOM"`: Any event that's not listed here. Make sure to also send `customEventName`.
757
+ * + `"APP_DEPLOYED"`: Your app’s internal code implementation is changed and might affect user flows or cause a regression.
758
+ * + `"APP_FINISH_BUSINESS_SETUP"`: __Deprecation Notice:__ This enum value will be removed on March 30, 2023. Use `"APP_SETUP_FINISHED"` instead.
759
+ * + `"APP_SETUP_FINISHED"`: The site owner completes your app's required business setup.
760
+ */
761
+ eventName?: EventName;
762
+ /**
763
+ * Name of your app's custom event that was triggered. Required when `{"eventName": "CUSTOM"}`.
764
+ *
765
+ * Min: 2 characters
766
+ */
767
+ customEventName?: string | null;
768
+ /**
769
+ * Supported values include: `"cycle_name"`, `"currency"`, `"sum"`, `"reason"`, `"app_plan_id"`.
770
+ * You may also submit data with keys that aren't listed here.
771
+ *
772
+ * Additional data about your app's event.
773
+ *
774
+ * + `"cycle_name"`: Supported values: `"monthly"`, `"yearly"`, `"2 years"`, `"one time"`.
775
+ * + `"currency"`: 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
776
+ * + `"sum"`: Amount of money. Required for `{"eventName": "CHARGE"}` and `{"eventName": "FUNDS_RETURNED"}`.
777
+ * + `"reason"`: Information about why the event was triggered in your app.
778
+ * + `"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).
779
+ */
780
+ eventData?: Record<string, string>;
781
+ }
782
+ declare enum EventName {
783
+ UNKNOWN = "UNKNOWN",
784
+ APP_DASHBOARD_LOADED = "APP_DASHBOARD_LOADED",
785
+ APP_FINISHED_CONFIGURATION = "APP_FINISHED_CONFIGURATION",
786
+ APP_UPGRADED = "APP_UPGRADED",
787
+ PRIMARY_ACTION_PERFORMED = "PRIMARY_ACTION_PERFORMED",
788
+ CUSTOM = "CUSTOM",
789
+ CHARGE = "CHARGE",
790
+ FUNDS_RETURNED = "FUNDS_RETURNED",
791
+ APP_FINISH_BUSINESS_SETUP = "APP_FINISH_BUSINESS_SETUP",
792
+ APP_DEPLOYED = "APP_DEPLOYED",
793
+ APP_SETUP_FINISHED = "APP_SETUP_FINISHED"
794
+ }
795
+ interface SendBiEventOptions {
796
+ /**
797
+ * Name of the event that's triggered in your app.
798
+ *
799
+ * + `"APP_DASHBOARD_LOADED"`: A site onwer or contributor loads your app's dashboard.
800
+ * + `"APP_FINISHED_CONFIGURATION"`: The site owner completes all required configurations for your app in the Wix Developers Center.
801
+ * + `"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.
802
+ * + `"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.
803
+ * + `"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`.
804
+ * + `"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"}}`.
805
+ * + `"CUSTOM"`: Any event that's not listed here. Make sure to also send `customEventName`.
806
+ * + `"APP_DEPLOYED"`: Your app’s internal code implementation is changed and might affect user flows or cause a regression.
807
+ * + `"APP_FINISH_BUSINESS_SETUP"`: __Deprecation Notice:__ This enum value will be removed on March 30, 2023. Use `"APP_SETUP_FINISHED"` instead.
808
+ * + `"APP_SETUP_FINISHED"`: The site owner completes your app's required business setup.
809
+ */
810
+ eventName?: EventName;
811
+ /**
812
+ * Name of your app's custom event that was triggered. Required when `{"eventName": "CUSTOM"}`.
813
+ *
814
+ * Min: 2 characters
815
+ */
816
+ customEventName?: string | null;
817
+ /**
818
+ * Supported values include: `"cycle_name"`, `"currency"`, `"sum"`, `"reason"`, `"app_plan_id"`.
819
+ * You may also submit data with keys that aren't listed here.
820
+ *
821
+ * Additional data about your app's event.
822
+ *
823
+ * + `"cycle_name"`: Supported values: `"monthly"`, `"yearly"`, `"2 years"`, `"one time"`.
824
+ * + `"currency"`: 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
825
+ * + `"sum"`: Amount of money. Required for `{"eventName": "CHARGE"}` and `{"eventName": "FUNDS_RETURNED"}`.
826
+ * + `"reason"`: Information about why the event was triggered in your app.
827
+ * + `"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).
828
+ */
829
+ eventData?: Record<string, string>;
73
830
  }
74
831
 
75
832
  declare function createRESTModule$2<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
76
833
 
77
834
  declare const sendBiEvent: ReturnType<typeof createRESTModule$2<typeof publicSendBiEvent>>;
78
835
 
836
+ type context$2_EventName = EventName;
837
+ declare const context$2_EventName: typeof EventName;
838
+ type context$2_SendBIEventRequest = SendBIEventRequest;
839
+ type context$2_SendBIEventResponse = SendBIEventResponse;
840
+ type context$2_SendBiEventOptions = SendBiEventOptions;
79
841
  declare const context$2_sendBiEvent: typeof sendBiEvent;
80
842
  declare namespace context$2 {
81
- export { context$2_sendBiEvent as sendBiEvent };
843
+ 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 };
844
+ }
845
+
846
+ interface PurchasedItem {
847
+ /** ID of your app's paid plan. */
848
+ productId?: string;
849
+ /** Price of your app's paid plan. For example, `9.95`. */
850
+ price?: string;
851
+ /**
852
+ * 3-letter currency code in
853
+ * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
854
+ */
855
+ currency?: string;
856
+ /** Information about the billing cycle for your app's paid plan. */
857
+ billingCycle?: PaymentCycle;
858
+ /**
859
+ * Date and time the site onwers have purchased your app's paid plan in
860
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
861
+ */
862
+ dateCreated?: Date;
863
+ }
864
+ declare enum PaymentCycle {
865
+ NO_CYCLE = "NO_CYCLE",
866
+ MONTHLY = "MONTHLY",
867
+ YEARLY = "YEARLY",
868
+ ONE_TIME = "ONE_TIME",
869
+ TWO_YEARS = "TWO_YEARS",
870
+ THREE_YEARS = "THREE_YEARS",
871
+ FOUR_YEARS = "FOUR_YEARS",
872
+ FIVE_YEARS = "FIVE_YEARS"
873
+ }
874
+ interface InvoiceStatusUpdate {
875
+ /** Invoice payment status. */
876
+ status?: InvoiceStatus;
877
+ /** Wix Premium invoice ID. */
878
+ invoiceId?: string;
879
+ /** App instance ID - a unique ID assigned to each app in each site. */
880
+ instanceId?: string | null;
881
+ /** Whether the invoice is for a single payment or for multiple, recurring payments. */
882
+ recurring?: boolean;
883
+ }
884
+ declare enum InvoiceStatus {
885
+ UNKNOWN_INVOICE_STATUS = "UNKNOWN_INVOICE_STATUS",
886
+ PAYMENT_FAILED = "PAYMENT_FAILED",
887
+ PAID = "PAID",
888
+ REFUNDED = "REFUNDED",
889
+ VOIDED = "VOIDED",
890
+ CHARGEDBACK = "CHARGEDBACK"
891
+ }
892
+ interface GetUrlRequest {
893
+ /**
894
+ * ID of your app's paid plan to retrieve the Wix checkout URL for. Check the
895
+ * Wix Developers Center for a list of your app's supported product IDs.
896
+ */
897
+ productId: string;
898
+ /**
899
+ * URL for the Wix checkout page. Redirect site owners to this URL after
900
+ * they've successfully purchased a paid plan for your app.
901
+ */
902
+ successUrl?: string | null;
903
+ /**
904
+ * Whether the checkout is for testing purposes only. Testing is mainly
905
+ * relevant for in-app purchase flows. When `true`, Wix charges the site
906
+ * owners an amount of `0.00`.
907
+ */
908
+ testCheckout?: boolean;
909
+ /** Information about the paid plan's billing cycle. */
910
+ billingCycle?: PaymentCycle;
911
+ /**
912
+ * 2-letter country code in
913
+ * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
914
+ * format.
915
+ *
916
+ * Default: `"US"`
917
+ */
918
+ countryCode?: string | null;
919
+ /**
920
+ * 2-letter language code in
921
+ * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
922
+ *
923
+ * Default: `"EN"`
924
+ */
925
+ languageCode?: string | null;
926
+ /** Coupon code for the paid plan. Available only in case there is a discount. */
927
+ couponCode?: string | null;
928
+ }
929
+ interface ChargeOverride {
930
+ /**
931
+ * Override price. In case you omit the override price, Wix charges site
932
+ * owners the app's default price that's configured in the Wix Developers
933
+ * Center.
934
+ */
935
+ price?: number;
936
+ /**
937
+ * Override 3-letter currency code in
938
+ * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
939
+ */
940
+ currency?: string;
941
+ }
942
+ interface GetUrlResponse {
943
+ /** URL for the Wix checkout page. */
944
+ checkoutUrl?: string;
945
+ /**
946
+ * Token for the Wix checkout page. The token holds all data about the order
947
+ * you're creating a checkout for. It is [signed](),
948
+ * so you can verify that it comes from Wix.
949
+ */
950
+ token?: string | null;
951
+ }
952
+ interface GetPurchaseHistoryRequest {
953
+ }
954
+ interface GetPurchaseHistoryResponse {
955
+ /** Retrieved purchases the site owners have completed for you app. */
956
+ purchases?: PurchasedItem[];
957
+ }
958
+ interface GetSitePaymentMethodsStatusRequest {
959
+ }
960
+ interface GetSitePaymentMethodsStatusResponse {
961
+ /**
962
+ * Whether the site owners have enabled at least a single online payment method.
963
+ * Online payment methods include Wix Payments, Stripe, PayPal, and credit
964
+ * cards.
965
+ */
966
+ onlineProviderEnabled?: boolean;
967
+ /** Whether the site owners accept offline payments. */
968
+ offlineProviderEnabled?: boolean;
969
+ /**
970
+ * Whether the site owners have enabled the
971
+ * [Wix Point of Sale](https://www.wix.com/pos).
972
+ * This allows their customers to make electronic payments in person.
973
+ */
974
+ wixPosProviderEnabled?: boolean;
975
+ /**
976
+ * Whether the site owners have enabled at least one 3rd-party point-of-sale
977
+ * provider. This allows their customers to make electronic payments in person.
978
+ */
979
+ thirdPartyPosProviderEnabled?: boolean;
980
+ }
981
+ interface GetMeteredBillingChargesRequest {
982
+ /**
983
+ * 3-letter currency code in
984
+ * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
985
+ */
986
+ currency?: string | null;
987
+ /**
988
+ * Start of the period you want to retrieve the custom charges for in
989
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
990
+ */
991
+ startDate?: Date;
992
+ /**
993
+ * End of the period you want to retrieve the custom charges for in
994
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
995
+ */
996
+ endDate?: Date;
997
+ }
998
+ interface GetMeteredBillingChargesResponse {
999
+ /** List of retrieved custom charges. */
1000
+ charges?: Charge[];
1001
+ }
1002
+ interface Charge {
1003
+ /** ID of the custom charge. The ID consists of 64 characters. */
1004
+ _id?: string | null;
1005
+ /** Description of the custom charge. */
1006
+ description?: string;
1007
+ /**
1008
+ * Charge amount.
1009
+ *
1010
+ * Min: `0.50`
1011
+ */
1012
+ amount?: string;
1013
+ }
1014
+ interface MessageEnvelope {
1015
+ /** App instance ID. */
1016
+ instanceId?: string | null;
1017
+ /** Event type. */
1018
+ eventType?: string;
1019
+ /** The identification type and identity data. */
1020
+ identity?: IdentificationData;
1021
+ /** Stringify payload. */
1022
+ data?: string;
1023
+ }
1024
+ interface IdentificationData extends IdentificationDataIdOneOf {
1025
+ /** ID of a site visitor that has not logged in to the site. */
1026
+ anonymousVisitorId?: string;
1027
+ /** ID of a site visitor that has logged in to the site. */
1028
+ memberId?: string;
1029
+ /** ID of a Wix user (site owner, contributor, etc.). */
1030
+ wixUserId?: string;
1031
+ /** ID of an app. */
1032
+ appId?: string;
1033
+ /** @readonly */
1034
+ identityType?: WebhookIdentityType;
1035
+ }
1036
+ /** @oneof */
1037
+ interface IdentificationDataIdOneOf {
1038
+ /** ID of a site visitor that has not logged in to the site. */
1039
+ anonymousVisitorId?: string;
1040
+ /** ID of a site visitor that has logged in to the site. */
1041
+ memberId?: string;
1042
+ /** ID of a Wix user (site owner, contributor, etc.). */
1043
+ wixUserId?: string;
1044
+ /** ID of an app. */
1045
+ appId?: string;
1046
+ }
1047
+ declare enum WebhookIdentityType {
1048
+ UNKNOWN = "UNKNOWN",
1049
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
1050
+ MEMBER = "MEMBER",
1051
+ WIX_USER = "WIX_USER",
1052
+ APP = "APP"
1053
+ }
1054
+ interface GetUrlResponseNonNullableFields {
1055
+ checkoutUrl: string;
1056
+ }
1057
+ interface GetPurchaseHistoryResponseNonNullableFields {
1058
+ purchases: {
1059
+ productId: string;
1060
+ price: string;
1061
+ currency: string;
1062
+ billingCycle: PaymentCycle;
1063
+ }[];
1064
+ }
1065
+ interface GetUrlOptions {
1066
+ /**
1067
+ * URL for the Wix checkout page. Redirect site owners to this URL after
1068
+ * they've successfully purchased a paid plan for your app.
1069
+ */
1070
+ successUrl?: string | null;
1071
+ /**
1072
+ * Whether the checkout is for testing purposes only. Testing is mainly
1073
+ * relevant for in-app purchase flows. When `true`, Wix charges the site
1074
+ * owners an amount of `0.00`.
1075
+ */
1076
+ testCheckout?: boolean;
1077
+ /** Information about the paid plan's billing cycle. */
1078
+ billingCycle?: PaymentCycle;
1079
+ /**
1080
+ * 2-letter country code in
1081
+ * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
1082
+ * format.
1083
+ *
1084
+ * Default: `"US"`
1085
+ */
1086
+ countryCode?: string | null;
1087
+ /**
1088
+ * 2-letter language code in
1089
+ * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
1090
+ *
1091
+ * Default: `"EN"`
1092
+ */
1093
+ languageCode?: string | null;
1094
+ /** Coupon code for the paid plan. Available only in case there is a discount. */
1095
+ couponCode?: string | null;
82
1096
  }
83
1097
 
84
1098
  declare function createRESTModule$1<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
@@ -86,10 +1100,88 @@ declare function createRESTModule$1<T extends RESTFunctionDescriptor>(descriptor
86
1100
  declare const getUrl: ReturnType<typeof createRESTModule$1<typeof publicGetUrl>>;
87
1101
  declare const getPurchaseHistory: ReturnType<typeof createRESTModule$1<typeof publicGetPurchaseHistory>>;
88
1102
 
1103
+ type context$1_Charge = Charge;
1104
+ type context$1_ChargeOverride = ChargeOverride;
1105
+ type context$1_GetMeteredBillingChargesRequest = GetMeteredBillingChargesRequest;
1106
+ type context$1_GetMeteredBillingChargesResponse = GetMeteredBillingChargesResponse;
1107
+ type context$1_GetPurchaseHistoryRequest = GetPurchaseHistoryRequest;
1108
+ type context$1_GetPurchaseHistoryResponse = GetPurchaseHistoryResponse;
1109
+ type context$1_GetPurchaseHistoryResponseNonNullableFields = GetPurchaseHistoryResponseNonNullableFields;
1110
+ type context$1_GetSitePaymentMethodsStatusRequest = GetSitePaymentMethodsStatusRequest;
1111
+ type context$1_GetSitePaymentMethodsStatusResponse = GetSitePaymentMethodsStatusResponse;
1112
+ type context$1_GetUrlOptions = GetUrlOptions;
1113
+ type context$1_GetUrlRequest = GetUrlRequest;
1114
+ type context$1_GetUrlResponse = GetUrlResponse;
1115
+ type context$1_GetUrlResponseNonNullableFields = GetUrlResponseNonNullableFields;
1116
+ type context$1_IdentificationData = IdentificationData;
1117
+ type context$1_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
1118
+ type context$1_InvoiceStatus = InvoiceStatus;
1119
+ declare const context$1_InvoiceStatus: typeof InvoiceStatus;
1120
+ type context$1_InvoiceStatusUpdate = InvoiceStatusUpdate;
1121
+ type context$1_MessageEnvelope = MessageEnvelope;
1122
+ type context$1_PaymentCycle = PaymentCycle;
1123
+ declare const context$1_PaymentCycle: typeof PaymentCycle;
1124
+ type context$1_PurchasedItem = PurchasedItem;
1125
+ type context$1_WebhookIdentityType = WebhookIdentityType;
1126
+ declare const context$1_WebhookIdentityType: typeof WebhookIdentityType;
89
1127
  declare const context$1_getPurchaseHistory: typeof getPurchaseHistory;
90
1128
  declare const context$1_getUrl: typeof getUrl;
91
1129
  declare namespace context$1 {
92
- export { context$1_getPurchaseHistory as getPurchaseHistory, context$1_getUrl as getUrl };
1130
+ 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 };
1131
+ }
1132
+
1133
+ /** Embedded script data */
1134
+ interface ScriptProperties {
1135
+ /** Script parameters */
1136
+ parameters?: Record<string, string>;
1137
+ /** Whether script is disabled or not, defaults to false (not disabled) */
1138
+ disabled?: boolean;
1139
+ }
1140
+ interface EmbedScriptRequest {
1141
+ /** Details of the script to embed. */
1142
+ properties: ScriptProperties;
1143
+ /** ID of the corresponding embedded script component. */
1144
+ componentId?: string | null;
1145
+ }
1146
+ interface EmbedScriptResponse {
1147
+ /** Details of the embedded script. */
1148
+ properties?: ScriptProperties;
1149
+ }
1150
+ interface GetEmbeddedScriptRequest {
1151
+ /** Component ID of the embedded script to retrieve. */
1152
+ componentId?: string | null;
1153
+ }
1154
+ interface GetEmbeddedScriptResponse {
1155
+ /** Details of the retrieved embedded script. */
1156
+ properties?: ScriptProperties;
1157
+ }
1158
+ interface EmbedScriptByInstanceIdRequest {
1159
+ instanceId?: string;
1160
+ /** Parameters to embed */
1161
+ properties?: ScriptProperties;
1162
+ componentId?: string | null;
1163
+ }
1164
+ interface GetEmbeddedScriptByInstanceIdRequest {
1165
+ instanceId?: string;
1166
+ componentId?: string | null;
1167
+ }
1168
+ interface EmbedScriptResponseNonNullableFields {
1169
+ properties?: {
1170
+ disabled: boolean;
1171
+ };
1172
+ }
1173
+ interface GetEmbeddedScriptResponseNonNullableFields {
1174
+ properties?: {
1175
+ disabled: boolean;
1176
+ };
1177
+ }
1178
+ interface EmbedScriptOptions {
1179
+ /** ID of the corresponding embedded script component. */
1180
+ componentId?: string | null;
1181
+ }
1182
+ interface GetEmbeddedScriptOptions {
1183
+ /** Component ID of the embedded script to retrieve. */
1184
+ componentId?: string | null;
93
1185
  }
94
1186
 
95
1187
  declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
@@ -97,10 +1189,21 @@ declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor:
97
1189
  declare const embedScript: ReturnType<typeof createRESTModule<typeof publicEmbedScript>>;
98
1190
  declare const getEmbeddedScript: ReturnType<typeof createRESTModule<typeof publicGetEmbeddedScript>>;
99
1191
 
1192
+ type context_EmbedScriptByInstanceIdRequest = EmbedScriptByInstanceIdRequest;
1193
+ type context_EmbedScriptOptions = EmbedScriptOptions;
1194
+ type context_EmbedScriptRequest = EmbedScriptRequest;
1195
+ type context_EmbedScriptResponse = EmbedScriptResponse;
1196
+ type context_EmbedScriptResponseNonNullableFields = EmbedScriptResponseNonNullableFields;
1197
+ type context_GetEmbeddedScriptByInstanceIdRequest = GetEmbeddedScriptByInstanceIdRequest;
1198
+ type context_GetEmbeddedScriptOptions = GetEmbeddedScriptOptions;
1199
+ type context_GetEmbeddedScriptRequest = GetEmbeddedScriptRequest;
1200
+ type context_GetEmbeddedScriptResponse = GetEmbeddedScriptResponse;
1201
+ type context_GetEmbeddedScriptResponseNonNullableFields = GetEmbeddedScriptResponseNonNullableFields;
1202
+ type context_ScriptProperties = ScriptProperties;
100
1203
  declare const context_embedScript: typeof embedScript;
101
1204
  declare const context_getEmbeddedScript: typeof getEmbeddedScript;
102
1205
  declare namespace context {
103
- export { context_embedScript as embedScript, context_getEmbeddedScript as getEmbeddedScript };
1206
+ export { type context_EmbedScriptByInstanceIdRequest as EmbedScriptByInstanceIdRequest, type context_EmbedScriptOptions as EmbedScriptOptions, type context_EmbedScriptRequest as EmbedScriptRequest, type context_EmbedScriptResponse as EmbedScriptResponse, type context_EmbedScriptResponseNonNullableFields as EmbedScriptResponseNonNullableFields, type context_GetEmbeddedScriptByInstanceIdRequest as GetEmbeddedScriptByInstanceIdRequest, type context_GetEmbeddedScriptOptions as GetEmbeddedScriptOptions, type context_GetEmbeddedScriptRequest as GetEmbeddedScriptRequest, type context_GetEmbeddedScriptResponse as GetEmbeddedScriptResponse, type context_GetEmbeddedScriptResponseNonNullableFields as GetEmbeddedScriptResponseNonNullableFields, type context_ScriptProperties as ScriptProperties, context_embedScript as embedScript, context_getEmbeddedScript as getEmbeddedScript };
104
1207
  }
105
1208
 
106
1209
  export { context$3 as appInstances, context$4 as appPlans, context$2 as biEvents, context$1 as billing, context as embeddedScripts };