@wix/auto_sdk_app-management_app-instances 1.0.0

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.
Files changed (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.context.d.ts +33 -0
  11. package/build/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.context.js +40 -0
  12. package/build/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.context.js.map +1 -0
  13. package/build/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.http.d.ts +13 -0
  14. package/build/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.http.js +112 -0
  15. package/build/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.http.js.map +1 -0
  16. package/build/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.meta.d.ts +13 -0
  17. package/build/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.meta.js +47 -0
  18. package/build/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.meta.js.map +1 -0
  19. package/build/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.public.d.ts +26 -0
  20. package/build/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.public.js +44 -0
  21. package/build/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.public.js.map +1 -0
  22. package/build/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.types.d.ts +367 -0
  23. package/build/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.types.js +40 -0
  24. package/build/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.types.js.map +1 -0
  25. package/build/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.universal.d.ts +447 -0
  26. package/build/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.universal.js +107 -0
  27. package/build/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/devcenter-app-instance-v1-app-instance-app-instances.context.d.ts +33 -0
  39. package/build/es/src/devcenter-app-instance-v1-app-instance-app-instances.context.js +33 -0
  40. package/build/es/src/devcenter-app-instance-v1-app-instance-app-instances.context.js.map +1 -0
  41. package/build/es/src/devcenter-app-instance-v1-app-instance-app-instances.http.d.ts +13 -0
  42. package/build/es/src/devcenter-app-instance-v1-app-instance-app-instances.http.js +108 -0
  43. package/build/es/src/devcenter-app-instance-v1-app-instance-app-instances.http.js.map +1 -0
  44. package/build/es/src/devcenter-app-instance-v1-app-instance-app-instances.meta.d.ts +13 -0
  45. package/build/es/src/devcenter-app-instance-v1-app-instance-app-instances.meta.js +20 -0
  46. package/build/es/src/devcenter-app-instance-v1-app-instance-app-instances.meta.js.map +1 -0
  47. package/build/es/src/devcenter-app-instance-v1-app-instance-app-instances.public.d.ts +26 -0
  48. package/build/es/src/devcenter-app-instance-v1-app-instance-app-instances.public.js +36 -0
  49. package/build/es/src/devcenter-app-instance-v1-app-instance-app-instances.public.js.map +1 -0
  50. package/build/es/src/devcenter-app-instance-v1-app-instance-app-instances.types.d.ts +367 -0
  51. package/build/es/src/devcenter-app-instance-v1-app-instance-app-instances.types.js +37 -0
  52. package/build/es/src/devcenter-app-instance-v1-app-instance-app-instances.types.js.map +1 -0
  53. package/build/es/src/devcenter-app-instance-v1-app-instance-app-instances.universal.d.ts +447 -0
  54. package/build/es/src/devcenter-app-instance-v1-app-instance-app-instances.universal.js +80 -0
  55. package/build/es/src/devcenter-app-instance-v1-app-instance-app-instances.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.context.d.ts +33 -0
  66. package/build/internal/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.context.js +40 -0
  67. package/build/internal/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.context.js.map +1 -0
  68. package/build/internal/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.http.d.ts +13 -0
  69. package/build/internal/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.http.js +112 -0
  70. package/build/internal/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.http.js.map +1 -0
  71. package/build/internal/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.meta.d.ts +13 -0
  72. package/build/internal/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.meta.js +47 -0
  73. package/build/internal/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.meta.js.map +1 -0
  74. package/build/internal/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.public.d.ts +26 -0
  75. package/build/internal/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.public.js +44 -0
  76. package/build/internal/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.public.js.map +1 -0
  77. package/build/internal/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.types.d.ts +367 -0
  78. package/build/internal/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.types.js +40 -0
  79. package/build/internal/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.types.js.map +1 -0
  80. package/build/internal/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.universal.d.ts +447 -0
  81. package/build/internal/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.universal.js +107 -0
  82. package/build/internal/cjs/src/devcenter-app-instance-v1-app-instance-app-instances.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/devcenter-app-instance-v1-app-instance-app-instances.context.d.ts +33 -0
  93. package/build/internal/es/src/devcenter-app-instance-v1-app-instance-app-instances.context.js +33 -0
  94. package/build/internal/es/src/devcenter-app-instance-v1-app-instance-app-instances.context.js.map +1 -0
  95. package/build/internal/es/src/devcenter-app-instance-v1-app-instance-app-instances.http.d.ts +13 -0
  96. package/build/internal/es/src/devcenter-app-instance-v1-app-instance-app-instances.http.js +108 -0
  97. package/build/internal/es/src/devcenter-app-instance-v1-app-instance-app-instances.http.js.map +1 -0
  98. package/build/internal/es/src/devcenter-app-instance-v1-app-instance-app-instances.meta.d.ts +13 -0
  99. package/build/internal/es/src/devcenter-app-instance-v1-app-instance-app-instances.meta.js +20 -0
  100. package/build/internal/es/src/devcenter-app-instance-v1-app-instance-app-instances.meta.js.map +1 -0
  101. package/build/internal/es/src/devcenter-app-instance-v1-app-instance-app-instances.public.d.ts +26 -0
  102. package/build/internal/es/src/devcenter-app-instance-v1-app-instance-app-instances.public.js +36 -0
  103. package/build/internal/es/src/devcenter-app-instance-v1-app-instance-app-instances.public.js.map +1 -0
  104. package/build/internal/es/src/devcenter-app-instance-v1-app-instance-app-instances.types.d.ts +367 -0
  105. package/build/internal/es/src/devcenter-app-instance-v1-app-instance-app-instances.types.js +37 -0
  106. package/build/internal/es/src/devcenter-app-instance-v1-app-instance-app-instances.types.js.map +1 -0
  107. package/build/internal/es/src/devcenter-app-instance-v1-app-instance-app-instances.universal.d.ts +447 -0
  108. package/build/internal/es/src/devcenter-app-instance-v1-app-instance-app-instances.universal.js +80 -0
  109. package/build/internal/es/src/devcenter-app-instance-v1-app-instance-app-instances.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,447 @@
1
+ /**
2
+ * An app instance is a specific occurrence of an app on a Wix site.
3
+ * When a Wix user installs an app, a unique instance is generated for that
4
+ * specific site. Use the `instanceId` to keep track of the individual data
5
+ * associated with each app instance.
6
+ */
7
+ export interface AppInstance {
8
+ /**
9
+ * App instance ID. Useful to keep track of the
10
+ * data that's associated with the specific instance of your app
11
+ * installed on a Wix site.
12
+ */
13
+ instanceId?: string;
14
+ /** App name, as you entered it in the App Dashboard. */
15
+ appName?: string;
16
+ /** Version of your app that's installed on the Wix site. */
17
+ appVersion?: string | null;
18
+ /**
19
+ * Whether the Wix user has installed a free or paid version of your app
20
+ * on their site.
21
+ */
22
+ isFree?: boolean;
23
+ /**
24
+ * Billing information for the app instance. Available only in case
25
+ * `{"isFree": false}`.
26
+ */
27
+ billing?: BillingInfo;
28
+ /**
29
+ * List of [permissions](https://dev.wix.com/docs/build-apps/developer-tools/developers-center/example-app-walkthrough/build-an-app#4-add-permissions)
30
+ * that the Wix user has granted your app. You set the list of permissions that
31
+ * your app requires from the Wix user in your app's Permissions page.
32
+ */
33
+ permissions?: string[];
34
+ /** Plans available to this app instance. */
35
+ availablePlans?: AvailablePlan[];
36
+ /**
37
+ * ID of the Wix site from which the instance of your app has been cloned.
38
+ * Available only when `{"copiedFromTemplate": true}`.
39
+ * All visual settings of the Wix site and app data are duplicated during the
40
+ * cloning process. Wix also notifies you in case there is any additional
41
+ * external functionality for the original site.
42
+ */
43
+ originInstanceId?: string | null;
44
+ /**
45
+ * __Deprecated__. This parameter will be removed on March 30, 2023. Use
46
+ * `copiedFromTemplate` instead.
47
+ * @deprecated
48
+ */
49
+ isOriginSiteTemplate?: boolean;
50
+ /** Whether this app instance was created when another Wix site was cloned. */
51
+ copiedFromTemplate?: boolean;
52
+ /** Whether this app instance includes a free trial that hasn't started yet. */
53
+ freeTrialAvailable?: boolean;
54
+ }
55
+ export interface BillingInfo {
56
+ /** Name of the package that the site owner has paid for. */
57
+ packageName?: string;
58
+ /**
59
+ * Interval of the billing cycle. `"ONE_TIME"` means that site owners have
60
+ * purchased unlimited access to the app with a single, upfront payment.
61
+ */
62
+ billingCycle?: PaymentCycle;
63
+ /**
64
+ * Date and time the Wix user purchased the app's paid plan or began their free trial. In
65
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
66
+ */
67
+ timeStamp?: string;
68
+ /**
69
+ * Date and time the app's current billing cycle ends in
70
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format. Available only for yearly and
71
+ * multi-yearly plans.
72
+ */
73
+ expirationDate?: string | null;
74
+ /**
75
+ * Whether the app's subscription automatically renews at the end of the
76
+ * current billing cycle.
77
+ */
78
+ autoRenewing?: boolean | null;
79
+ /** ID of the invoice for the current billing cycle. */
80
+ invoiceId?: string | null;
81
+ /**
82
+ * Information about any discounts applied to the app instance's current billing cycle.
83
+ * If the site owners applied a developer coupon or Wix Voucher
84
+ * when installing the paid version of your app, this field holds the coupon's
85
+ * name or `“Wix discount coupon”`. Site owners may receive a Wix Voucher when
86
+ * upgrading their Wix subscription. If there is no discount for the
87
+ * current billing cycle, the field is an empty string.
88
+ */
89
+ source?: string | null;
90
+ /** Information about the free trial applied, if relevant. */
91
+ freeTrialInfo?: FreeTrialInfo;
92
+ }
93
+ export declare enum PaymentCycle {
94
+ NO_CYCLE = "NO_CYCLE",
95
+ MONTHLY = "MONTHLY",
96
+ YEARLY = "YEARLY",
97
+ ONE_TIME = "ONE_TIME",
98
+ TWO_YEARS = "TWO_YEARS",
99
+ THREE_YEARS = "THREE_YEARS",
100
+ FOUR_YEARS = "FOUR_YEARS",
101
+ FIVE_YEARS = "FIVE_YEARS"
102
+ }
103
+ export interface FreeTrialInfo {
104
+ /**
105
+ * Current free trial status.
106
+ * @readonly
107
+ */
108
+ status?: FreeTrialStatus;
109
+ /**
110
+ * When the free trial has ended. Populated only once the free trial is over.
111
+ * @readonly
112
+ */
113
+ endDate?: Date | null;
114
+ }
115
+ export declare enum FreeTrialStatus {
116
+ /** Unknown trial status. */
117
+ UNKNOWN_STATUS = "UNKNOWN_STATUS",
118
+ /** The free trial is currently in progress. */
119
+ IN_PROGRESS = "IN_PROGRESS",
120
+ /** The free trial has ended. */
121
+ ENDED = "ENDED",
122
+ /** No free trial was applied, as none was available. */
123
+ NOT_AVAILABLE = "NOT_AVAILABLE"
124
+ }
125
+ export interface AvailablePlan {
126
+ /** Package name of the available plan. */
127
+ packageName?: string;
128
+ /** Source of the available plan. Can be a bundle or 3rd-party app. */
129
+ source?: string;
130
+ }
131
+ export interface AppInstalled {
132
+ /** Unique identifier of the app within the website. */
133
+ appId?: string;
134
+ /** 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)). */
135
+ originInstanceId?: string | null;
136
+ }
137
+ export interface AppRemoved {
138
+ /** Unique identifier of the app within the website. */
139
+ appId?: string;
140
+ }
141
+ export interface PaidPlanPurchased {
142
+ /** Date and time of purchase. */
143
+ operationTimeStamp?: Date | null;
144
+ /** Purchased app plan. */
145
+ vendorProductId?: string;
146
+ /** Selected payment cycle. */
147
+ cycle?: PaymentCycle;
148
+ /** Plan expiration date. */
149
+ expiresOn?: Date | null;
150
+ /** Coupon applied to purchase (if relevant). */
151
+ couponName?: string | null;
152
+ /** Invoice ID. */
153
+ invoiceId?: string | null;
154
+ }
155
+ export interface PaidPlanChanged {
156
+ /** Date and time of change. */
157
+ operationTimeStamp?: Date | null;
158
+ /** Newly purchased app plan. */
159
+ vendorProductId?: string;
160
+ /** Newly selected payment cycle. */
161
+ cycle?: PaymentCycle;
162
+ /** Previous app plan. */
163
+ previousVendorProductId?: string | null;
164
+ /** Previous payment cycle. */
165
+ previousCycle?: PaymentCycle;
166
+ /** Coupon applied to purchase (if relevant). */
167
+ couponName?: string | null;
168
+ /** Invoice ID. */
169
+ invoiceId?: string | null;
170
+ }
171
+ export interface PaidPlanAutoRenewalCancelled {
172
+ /** Date and time of auto-renewal cancellation. */
173
+ operationTimeStamp?: Date | null;
174
+ /** Current app plan. */
175
+ vendorProductId?: string;
176
+ /** Current payment cycle. */
177
+ cycle?: PaymentCycle;
178
+ /** Supported values: `UNKNOWN_CANCELLATION_TYPE_ERROR_STATE`, `USER_CANCEL`, `FAILED_PAYMENT`, `TRANSFER_CANCELLATION_REASON`. Reason provided by app for cancellation (if relevant). */
179
+ cancelReason?: string | null;
180
+ /** Reason provided by site owner for cancellation (if relevant). */
181
+ userReason?: string | null;
182
+ /** Cancellation type. */
183
+ subscriptionCancellationType?: string | null;
184
+ }
185
+ export interface GetAppInstanceRequest {
186
+ }
187
+ export interface GetAppInstanceResponse {
188
+ /** Retrieved app instance. */
189
+ instance?: AppInstance;
190
+ /** Information about the site. */
191
+ site?: SiteInfo;
192
+ }
193
+ export interface SiteInfo {
194
+ /** Display name of the site. */
195
+ siteDisplayName?: string | null;
196
+ /**
197
+ * 2-letter language code of the site's locale in
198
+ * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
199
+ */
200
+ locale?: string;
201
+ /**
202
+ * 3-letter currency code for the site's billing in
203
+ * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
204
+ */
205
+ paymentCurrency?: string;
206
+ /** Information about the site's supported languages. */
207
+ multilingual?: Multilingual;
208
+ /** URL of the site. Available only when the site has been published. */
209
+ url?: string | null;
210
+ /** Description of the site. */
211
+ description?: string | null;
212
+ /** Apps made by Wix that are installed on the site. */
213
+ installedWixApps?: string[];
214
+ /**
215
+ * > **Deprecation Notice:** This parameter will be removed on June 30, 2022. Use `ownerInfo` instead.
216
+ * @deprecated
217
+ */
218
+ ownerEmail?: string | null;
219
+ /**
220
+ * Information about the site's Wix user. Available only when calling
221
+ * _Get App Instance_ with the __Read Site Owner Email__ permission scope.
222
+ */
223
+ ownerInfo?: OwnerInfo;
224
+ /** Site ID. */
225
+ siteId?: string;
226
+ }
227
+ export interface Multilingual {
228
+ /** Whether the site supports more than a single language. */
229
+ isMultiLingual?: boolean;
230
+ /** List of supported languages. Returned only when `{"isMultiLingual": true}`. */
231
+ supportedLanguages?: SupportedLanguage[];
232
+ }
233
+ export interface SupportedLanguage {
234
+ /** Two-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */
235
+ languageCode?: string;
236
+ /** Locale. */
237
+ locale?: Locale;
238
+ /** Whether the supported language is the primary language for the site. */
239
+ isPrimary?: boolean;
240
+ /** Language icon. */
241
+ countryCode?: string;
242
+ /** How the language will be resolved. For internal use. */
243
+ resolutionMethod?: ResolutionMethod;
244
+ }
245
+ export interface Locale {
246
+ /** Two-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */
247
+ languageCode?: string;
248
+ /** Two-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format. */
249
+ country?: string;
250
+ }
251
+ export declare enum ResolutionMethod {
252
+ QUERY_PARAM = "QUERY_PARAM",
253
+ SUBDOMAIN = "SUBDOMAIN",
254
+ SUBDIRECTORY = "SUBDIRECTORY"
255
+ }
256
+ export interface OwnerInfo {
257
+ /** Wix user's email address. Identical to the their login email. */
258
+ email?: string;
259
+ /**
260
+ * Supported values: `VERIFIED_OPT_IN`, `VERIFIED_OPT_OUT`,
261
+ * `NOT_VERIFIED_OPT_IN`, `NOT_VERIFIED_OPT_OUT`.
262
+ *
263
+ * Whether the Wix user has verified their email and whether they have chosen
264
+ * to receive email notifications from Wix.
265
+ */
266
+ emailStatus?: string;
267
+ }
268
+ export interface GetAppInstanceByInstanceIdRequest {
269
+ /** ID of the app instance to retrieve. */
270
+ instanceId?: string;
271
+ }
272
+ export interface MessageEnvelope {
273
+ /** App instance ID. */
274
+ instanceId?: string | null;
275
+ /** Event type. */
276
+ eventType?: string;
277
+ /** The identification type and identity data. */
278
+ identity?: IdentificationData;
279
+ /** Stringify payload. */
280
+ data?: string;
281
+ }
282
+ export interface IdentificationData extends IdentificationDataIdOneOf {
283
+ /** ID of a site visitor that has not logged in to the site. */
284
+ anonymousVisitorId?: string;
285
+ /** ID of a site visitor that has logged in to the site. */
286
+ memberId?: string;
287
+ /** ID of a Wix user (site owner, contributor, etc.). */
288
+ wixUserId?: string;
289
+ /** ID of an app. */
290
+ appId?: string;
291
+ /** @readonly */
292
+ identityType?: WebhookIdentityType;
293
+ }
294
+ /** @oneof */
295
+ export interface IdentificationDataIdOneOf {
296
+ /** ID of a site visitor that has not logged in to the site. */
297
+ anonymousVisitorId?: string;
298
+ /** ID of a site visitor that has logged in to the site. */
299
+ memberId?: string;
300
+ /** ID of a Wix user (site owner, contributor, etc.). */
301
+ wixUserId?: string;
302
+ /** ID of an app. */
303
+ appId?: string;
304
+ }
305
+ export declare enum WebhookIdentityType {
306
+ UNKNOWN = "UNKNOWN",
307
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
308
+ MEMBER = "MEMBER",
309
+ WIX_USER = "WIX_USER",
310
+ APP = "APP"
311
+ }
312
+ interface FreeTrialInfoNonNullableFields {
313
+ status: FreeTrialStatus;
314
+ }
315
+ interface BillingInfoNonNullableFields {
316
+ packageName: string;
317
+ billingCycle: PaymentCycle;
318
+ timeStamp: string;
319
+ freeTrialInfo?: FreeTrialInfoNonNullableFields;
320
+ }
321
+ interface AvailablePlanNonNullableFields {
322
+ packageName: string;
323
+ source: string;
324
+ }
325
+ interface AppInstanceNonNullableFields {
326
+ instanceId: string;
327
+ appName: string;
328
+ isFree: boolean;
329
+ billing?: BillingInfoNonNullableFields;
330
+ permissions: string[];
331
+ availablePlans: AvailablePlanNonNullableFields[];
332
+ isOriginSiteTemplate: boolean;
333
+ copiedFromTemplate: boolean;
334
+ freeTrialAvailable: boolean;
335
+ }
336
+ interface LocaleNonNullableFields {
337
+ languageCode: string;
338
+ country: string;
339
+ }
340
+ interface SupportedLanguageNonNullableFields {
341
+ languageCode: string;
342
+ locale?: LocaleNonNullableFields;
343
+ isPrimary: boolean;
344
+ countryCode: string;
345
+ resolutionMethod: ResolutionMethod;
346
+ }
347
+ interface MultilingualNonNullableFields {
348
+ isMultiLingual: boolean;
349
+ supportedLanguages: SupportedLanguageNonNullableFields[];
350
+ }
351
+ interface OwnerInfoNonNullableFields {
352
+ email: string;
353
+ emailStatus: string;
354
+ }
355
+ interface SiteInfoNonNullableFields {
356
+ locale: string;
357
+ paymentCurrency: string;
358
+ multilingual?: MultilingualNonNullableFields;
359
+ installedWixApps: string[];
360
+ ownerInfo?: OwnerInfoNonNullableFields;
361
+ siteId: string;
362
+ }
363
+ export interface GetAppInstanceResponseNonNullableFields {
364
+ instance?: AppInstanceNonNullableFields;
365
+ site?: SiteInfoNonNullableFields;
366
+ }
367
+ export interface BaseEventMetadata {
368
+ /** App instance ID. */
369
+ instanceId?: string | null;
370
+ /** Event type. */
371
+ eventType?: string;
372
+ /** The identification type and identity data. */
373
+ identity?: IdentificationData;
374
+ }
375
+ export interface AppInstanceInstalledEnvelope {
376
+ data: AppInstalled;
377
+ metadata: BaseEventMetadata;
378
+ }
379
+ /**
380
+ * Triggered when an instance of your app is installed on a Wix site.
381
+ * @webhook
382
+ * @eventType AppInstalled
383
+ */
384
+ export declare function onAppInstanceInstalled(handler: (event: AppInstanceInstalledEnvelope) => void | Promise<void>): void;
385
+ export interface AppInstanceRemovedEnvelope {
386
+ data: AppRemoved;
387
+ metadata: BaseEventMetadata;
388
+ }
389
+ /**
390
+ * Triggered when an instance of your app is uninstalled from a Wix site.
391
+ * @webhook
392
+ * @eventType AppRemoved
393
+ */
394
+ export declare function onAppInstanceRemoved(handler: (event: AppInstanceRemovedEnvelope) => void | Promise<void>): void;
395
+ export interface AppInstancePaidPlanAutoRenewalCancelledEnvelope {
396
+ data: PaidPlanAutoRenewalCancelled;
397
+ metadata: BaseEventMetadata;
398
+ }
399
+ /**
400
+ * Triggered when a Wix user cancels a paid plan for your app. The
401
+ * Wix user can continue to use your app until the end of the current billing
402
+ * cycle.
403
+ * @webhook
404
+ * @eventType PaidPlanAutoRenewalCancelled
405
+ */
406
+ export declare function onAppInstancePaidPlanAutoRenewalCancelled(handler: (event: AppInstancePaidPlanAutoRenewalCancelledEnvelope) => void | Promise<void>): void;
407
+ export interface AppInstancePaidPlanChangedEnvelope {
408
+ data: PaidPlanChanged;
409
+ metadata: BaseEventMetadata;
410
+ }
411
+ /**
412
+ * Triggered when a Wix user upgrades or downgrades their plan for your app.
413
+ * @webhook
414
+ * @eventType PaidPlanChanged
415
+ */
416
+ export declare function onAppInstancePaidPlanChanged(handler: (event: AppInstancePaidPlanChangedEnvelope) => void | Promise<void>): void;
417
+ export interface AppInstancePaidPlanPurchasedEnvelope {
418
+ data: PaidPlanPurchased;
419
+ metadata: BaseEventMetadata;
420
+ }
421
+ /**
422
+ * Triggered when a Wix user purchases a paid plan for your app.
423
+ * @webhook
424
+ * @eventType PaidPlanPurchased
425
+ */
426
+ export declare function onAppInstancePaidPlanPurchased(handler: (event: AppInstancePaidPlanPurchasedEnvelope) => void | Promise<void>): void;
427
+ /**
428
+ * Retrieves data about the instance of your app that's installed on a Wix
429
+ * site and data about the site itself. For example, to check whether the Wix user has installed a free or paid version of your app,
430
+ * or to check which apps made by Wix are installed on the site.
431
+ *
432
+ * You must authenticate this method as a Wix app ([REST](https://dev.wix.com/docs/rest/articles/getting-started/about-identities#wix-app) | [SDK](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities#wix-apps)).
433
+ *
434
+ * To retrieve `site.ownerInfo` in the response, you must
435
+ * have the __READ SITE OWNER EMAIL__ permission scope in addition to
436
+ * __MANAGE YOUR APP__.
437
+ * @public
438
+ * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE
439
+ * @permissionScope Manage Your App
440
+ * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP
441
+ * @permissionScope Read site, business, and email details
442
+ * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO
443
+ * @applicableIdentity APP
444
+ * @fqn com.wixpress.market.aim.api.AppInstanceService.GetAppInstance
445
+ */
446
+ export declare function getAppInstance(): Promise<GetAppInstanceResponse & GetAppInstanceResponseNonNullableFields>;
447
+ export {};
@@ -0,0 +1,80 @@
1
+ import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
2
+ import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
3
+ import * as ambassadorWixDevcenterAppInstanceV1AppInstance from './devcenter-app-instance-v1-app-instance-app-instances.http.js';
4
+ export var PaymentCycle;
5
+ (function (PaymentCycle) {
6
+ PaymentCycle["NO_CYCLE"] = "NO_CYCLE";
7
+ PaymentCycle["MONTHLY"] = "MONTHLY";
8
+ PaymentCycle["YEARLY"] = "YEARLY";
9
+ PaymentCycle["ONE_TIME"] = "ONE_TIME";
10
+ PaymentCycle["TWO_YEARS"] = "TWO_YEARS";
11
+ PaymentCycle["THREE_YEARS"] = "THREE_YEARS";
12
+ PaymentCycle["FOUR_YEARS"] = "FOUR_YEARS";
13
+ PaymentCycle["FIVE_YEARS"] = "FIVE_YEARS";
14
+ })(PaymentCycle || (PaymentCycle = {}));
15
+ export var FreeTrialStatus;
16
+ (function (FreeTrialStatus) {
17
+ /** Unknown trial status. */
18
+ FreeTrialStatus["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
19
+ /** The free trial is currently in progress. */
20
+ FreeTrialStatus["IN_PROGRESS"] = "IN_PROGRESS";
21
+ /** The free trial has ended. */
22
+ FreeTrialStatus["ENDED"] = "ENDED";
23
+ /** No free trial was applied, as none was available. */
24
+ FreeTrialStatus["NOT_AVAILABLE"] = "NOT_AVAILABLE";
25
+ })(FreeTrialStatus || (FreeTrialStatus = {}));
26
+ export var ResolutionMethod;
27
+ (function (ResolutionMethod) {
28
+ ResolutionMethod["QUERY_PARAM"] = "QUERY_PARAM";
29
+ ResolutionMethod["SUBDOMAIN"] = "SUBDOMAIN";
30
+ ResolutionMethod["SUBDIRECTORY"] = "SUBDIRECTORY";
31
+ })(ResolutionMethod || (ResolutionMethod = {}));
32
+ export var WebhookIdentityType;
33
+ (function (WebhookIdentityType) {
34
+ WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
35
+ WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
36
+ WebhookIdentityType["MEMBER"] = "MEMBER";
37
+ WebhookIdentityType["WIX_USER"] = "WIX_USER";
38
+ WebhookIdentityType["APP"] = "APP";
39
+ })(WebhookIdentityType || (WebhookIdentityType = {}));
40
+ /**
41
+ * Retrieves data about the instance of your app that's installed on a Wix
42
+ * site and data about the site itself. For example, to check whether the Wix user has installed a free or paid version of your app,
43
+ * or to check which apps made by Wix are installed on the site.
44
+ *
45
+ * You must authenticate this method as a Wix app ([REST](https://dev.wix.com/docs/rest/articles/getting-started/about-identities#wix-app) | [SDK](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities#wix-apps)).
46
+ *
47
+ * To retrieve `site.ownerInfo` in the response, you must
48
+ * have the __READ SITE OWNER EMAIL__ permission scope in addition to
49
+ * __MANAGE YOUR APP__.
50
+ * @public
51
+ * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE
52
+ * @permissionScope Manage Your App
53
+ * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP
54
+ * @permissionScope Read site, business, and email details
55
+ * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO
56
+ * @applicableIdentity APP
57
+ * @fqn com.wixpress.market.aim.api.AppInstanceService.GetAppInstance
58
+ */
59
+ export async function getAppInstance() {
60
+ // @ts-ignore
61
+ const { httpClient, sideEffects } = arguments[0];
62
+ const payload = renameKeysFromSDKRequestToRESTRequest({});
63
+ const reqOpts = ambassadorWixDevcenterAppInstanceV1AppInstance.getAppInstance(payload);
64
+ sideEffects?.onSiteCall?.();
65
+ try {
66
+ const result = await httpClient.request(reqOpts);
67
+ sideEffects?.onSuccess?.(result);
68
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
69
+ }
70
+ catch (err) {
71
+ const transformedError = sdkTransformError(err, {
72
+ spreadPathsToArguments: {},
73
+ explicitPathsToArguments: {},
74
+ singleArgumentUnchanged: false,
75
+ }, []);
76
+ sideEffects?.onError?.(err);
77
+ throw transformedError;
78
+ }
79
+ }
80
+ //# sourceMappingURL=devcenter-app-instance-v1-app-instance-app-instances.universal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devcenter-app-instance-v1-app-instance-app-instances.universal.js","sourceRoot":"","sources":["../../../src/devcenter-app-instance-v1-app-instance-app-instances.universal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EACL,qCAAqC,EACrC,uCAAuC,GACxC,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,8CAA8C,MAAM,gEAAgE,CAAC;AAgGjI,MAAM,CAAN,IAAY,YASX;AATD,WAAY,YAAY;IACtB,qCAAqB,CAAA;IACrB,mCAAmB,CAAA;IACnB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,uCAAuB,CAAA;IACvB,2CAA2B,CAAA;IAC3B,yCAAyB,CAAA;IACzB,yCAAyB,CAAA;AAC3B,CAAC,EATW,YAAY,KAAZ,YAAY,QASvB;AAeD,MAAM,CAAN,IAAY,eASX;AATD,WAAY,eAAe;IACzB,4BAA4B;IAC5B,oDAAiC,CAAA;IACjC,+CAA+C;IAC/C,8CAA2B,CAAA;IAC3B,gCAAgC;IAChC,kCAAe,CAAA;IACf,wDAAwD;IACxD,kDAA+B,CAAA;AACjC,CAAC,EATW,eAAe,KAAf,eAAe,QAS1B;AA2ID,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,+CAA2B,CAAA;IAC3B,2CAAuB,CAAA;IACvB,iDAA6B,CAAA;AAC/B,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AAwDD,MAAM,CAAN,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,8DAAuC,CAAA;IACvC,wCAAiB,CAAA;IACjB,4CAAqB,CAAA;IACrB,kCAAW,CAAA;AACb,CAAC,EANW,mBAAmB,KAAnB,mBAAmB,QAM9B;AAsJD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc;IAGlC,aAAa;IACb,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC,CAAC,CAG9C,CAAC;IAEF,MAAM,OAAO,GAAG,qCAAqC,CAAC,EAAE,CAAC,CAAC;IAE1D,MAAM,OAAO,GACX,8CAA8C,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAEzE,WAAW,EAAE,UAAU,EAAE,EAAE,CAAC;IAC5B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACjD,WAAW,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC;QAEjC,OAAO,uCAAuC,CAAC,MAAM,CAAC,IAAI,CAAE,CAAC;IAC/D,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,MAAM,gBAAgB,GAAG,iBAAiB,CACxC,GAAG,EACH;YACE,sBAAsB,EAAE,EAAE;YAC1B,wBAAwB,EAAE,EAAE;YAC5B,uBAAuB,EAAE,KAAK;SAC/B,EACD,EAAE,CACH,CAAC;QACF,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QAE5B,MAAM,gBAAgB,CAAC;IACzB,CAAC;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './src/devcenter-app-instance-v1-app-instance-app-instances.context.js';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/devcenter-app-instance-v1-app-instance-app-instances.context.js"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wGAAsF"}
@@ -0,0 +1 @@
1
+ export * from './src/devcenter-app-instance-v1-app-instance-app-instances.universal.js';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/devcenter-app-instance-v1-app-instance-app-instances.universal.js"), exports);
18
+ //# sourceMappingURL=index.typings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../../index.typings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0GAAwF"}
@@ -0,0 +1 @@
1
+ export * from './src/devcenter-app-instance-v1-app-instance-app-instances.meta.js';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/devcenter-app-instance-v1-app-instance-app-instances.meta.js"), exports);
18
+ //# sourceMappingURL=meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qGAAmF"}
@@ -0,0 +1,33 @@
1
+ import { getAppInstance as publicGetAppInstance } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';
2
+ import { createEventModule } from '@wix/sdk-runtime/event-definition-modules';
3
+ import { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';
4
+ import { onAppInstanceInstalled as publicOnAppInstanceInstalled } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';
5
+ import { onAppInstanceRemoved as publicOnAppInstanceRemoved } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';
6
+ import { onAppInstancePaidPlanAutoRenewalCancelled as publicOnAppInstancePaidPlanAutoRenewalCancelled } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';
7
+ import { onAppInstancePaidPlanChanged as publicOnAppInstancePaidPlanChanged } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';
8
+ import { onAppInstancePaidPlanPurchased as publicOnAppInstancePaidPlanPurchased } from './devcenter-app-instance-v1-app-instance-app-instances.public.js';
9
+ export declare const getAppInstance: MaybeContext<BuildRESTFunction<typeof publicGetAppInstance> & typeof publicGetAppInstance>;
10
+ /**
11
+ * Triggered when an instance of your app is installed on a Wix site.
12
+ */
13
+ export declare const onAppInstanceInstalled: ReturnType<typeof createEventModule<typeof publicOnAppInstanceInstalled>>;
14
+ /**
15
+ * Triggered when an instance of your app is uninstalled from a Wix site.
16
+ */
17
+ export declare const onAppInstanceRemoved: ReturnType<typeof createEventModule<typeof publicOnAppInstanceRemoved>>;
18
+ /**
19
+ * Triggered when a Wix user cancels a paid plan for your app. The
20
+ * Wix user can continue to use your app until the end of the current billing
21
+ * cycle.
22
+ */
23
+ export declare const onAppInstancePaidPlanAutoRenewalCancelled: ReturnType<typeof createEventModule<typeof publicOnAppInstancePaidPlanAutoRenewalCancelled>>;
24
+ /**
25
+ * Triggered when a Wix user upgrades or downgrades their plan for your app.
26
+ */
27
+ export declare const onAppInstancePaidPlanChanged: ReturnType<typeof createEventModule<typeof publicOnAppInstancePaidPlanChanged>>;
28
+ /**
29
+ * Triggered when a Wix user purchases a paid plan for your app.
30
+ */
31
+ export declare const onAppInstancePaidPlanPurchased: ReturnType<typeof createEventModule<typeof publicOnAppInstancePaidPlanPurchased>>;
32
+ export { PaymentCycle, FreeTrialStatus, ResolutionMethod, WebhookIdentityType, } from './devcenter-app-instance-v1-app-instance-app-instances.universal.js';
33
+ export { AppInstance, BillingInfo, FreeTrialInfo, AvailablePlan, AppInstalled, AppRemoved, PaidPlanPurchased, PaidPlanChanged, PaidPlanAutoRenewalCancelled, GetAppInstanceRequest, GetAppInstanceResponse, SiteInfo, Multilingual, SupportedLanguage, Locale, OwnerInfo, GetAppInstanceByInstanceIdRequest, MessageEnvelope, IdentificationData, IdentificationDataIdOneOf, GetAppInstanceResponseNonNullableFields, BaseEventMetadata, AppInstanceInstalledEnvelope, AppInstanceRemovedEnvelope, AppInstancePaidPlanAutoRenewalCancelledEnvelope, AppInstancePaidPlanChangedEnvelope, AppInstancePaidPlanPurchasedEnvelope, } from './devcenter-app-instance-v1-app-instance-app-instances.universal.js';