@capgo/native-purchases 6.0.41 → 7.1.7

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.
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
11
11
  s.author = package['author']
12
12
  s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13
13
  s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
14
- s.ios.deployment_target = '13.0'
14
+ s.ios.deployment_target = '14.0'
15
15
  s.dependency 'Capacitor'
16
16
  s.swift_version = '5.1'
17
17
  end
package/README.md CHANGED
@@ -397,20 +397,18 @@ This approach balances immediate user gratification with proper server-side vali
397
397
  ### restorePurchases()
398
398
 
399
399
  ```typescript
400
- restorePurchases() => any
400
+ restorePurchases() => Promise<void>
401
401
  ```
402
402
 
403
403
  Restores a user's previous and links their appUserIDs to any user's also using those .
404
404
 
405
- **Returns:** <code>any</code>
406
-
407
405
  --------------------
408
406
 
409
407
 
410
408
  ### purchaseProduct(...)
411
409
 
412
410
  ```typescript
413
- purchaseProduct(options: { productIdentifier: string; planIdentifier?: string; productType?: PURCHASE_TYPE; quantity?: number; }) => any
411
+ purchaseProduct(options: { productIdentifier: string; planIdentifier?: string; productType?: PURCHASE_TYPE; quantity?: number; }) => Promise<Transaction>
414
412
  ```
415
413
 
416
414
  Started purchase process for the given product.
@@ -419,7 +417,7 @@ Started purchase process for the given product.
419
417
  | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- |
420
418
  | **`options`** | <code>{ productIdentifier: string; planIdentifier?: string; productType?: <a href="#purchase_type">PURCHASE_TYPE</a>; quantity?: number; }</code> | - The product to purchase |
421
419
 
422
- **Returns:** <code>any</code>
420
+ **Returns:** <code>Promise&lt;<a href="#transaction">Transaction</a>&gt;</code>
423
421
 
424
422
  --------------------
425
423
 
@@ -427,16 +425,16 @@ Started purchase process for the given product.
427
425
  ### getProducts(...)
428
426
 
429
427
  ```typescript
430
- getProducts(options: { productIdentifiers: string[]; productType?: PURCHASE_TYPE; }) => any
428
+ getProducts(options: { productIdentifiers: string[]; productType?: PURCHASE_TYPE; }) => Promise<{ products: Product[]; }>
431
429
  ```
432
430
 
433
431
  Gets the product info associated with a list of product identifiers.
434
432
 
435
- | Param | Type | Description |
436
- | ------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
437
- | **`options`** | <code>{ productIdentifiers: {}; productType?: <a href="#purchase_type">PURCHASE_TYPE</a>; }</code> | - The product identifiers you wish to retrieve information for |
433
+ | Param | Type | Description |
434
+ | ------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
435
+ | **`options`** | <code>{ productIdentifiers: string[]; productType?: <a href="#purchase_type">PURCHASE_TYPE</a>; }</code> | - The product identifiers you wish to retrieve information for |
438
436
 
439
- **Returns:** <code>any</code>
437
+ **Returns:** <code>Promise&lt;{ products: Product[]; }&gt;</code>
440
438
 
441
439
  --------------------
442
440
 
@@ -444,7 +442,7 @@ Gets the product info associated with a list of product identifiers.
444
442
  ### getProduct(...)
445
443
 
446
444
  ```typescript
447
- getProduct(options: { productIdentifier: string; productType?: PURCHASE_TYPE; }) => any
445
+ getProduct(options: { productIdentifier: string; productType?: PURCHASE_TYPE; }) => Promise<{ product: Product; }>
448
446
  ```
449
447
 
450
448
  Gets the product info for a single product identifier.
@@ -453,7 +451,7 @@ Gets the product info for a single product identifier.
453
451
  | ------------- | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
454
452
  | **`options`** | <code>{ productIdentifier: string; productType?: <a href="#purchase_type">PURCHASE_TYPE</a>; }</code> | - The product identifier you wish to retrieve information for |
455
453
 
456
- **Returns:** <code>any</code>
454
+ **Returns:** <code>Promise&lt;{ product: <a href="#product">Product</a>; }&gt;</code>
457
455
 
458
456
  --------------------
459
457
 
@@ -461,12 +459,12 @@ Gets the product info for a single product identifier.
461
459
  ### isBillingSupported()
462
460
 
463
461
  ```typescript
464
- isBillingSupported() => any
462
+ isBillingSupported() => Promise<{ isBillingSupported: boolean; }>
465
463
  ```
466
464
 
467
465
  Check if billing is supported for the current device.
468
466
 
469
- **Returns:** <code>any</code>
467
+ **Returns:** <code>Promise&lt;{ isBillingSupported: boolean; }&gt;</code>
470
468
 
471
469
  --------------------
472
470
 
@@ -474,12 +472,12 @@ Check if billing is supported for the current device.
474
472
  ### getPluginVersion()
475
473
 
476
474
  ```typescript
477
- getPluginVersion() => any
475
+ getPluginVersion() => Promise<{ version: string; }>
478
476
  ```
479
477
 
480
478
  Get the native Capacitor plugin version
481
479
 
482
- **Returns:** <code>any</code>
480
+ **Returns:** <code>Promise&lt;{ version: string; }&gt;</code>
483
481
 
484
482
  --------------------
485
483
 
@@ -487,22 +485,6 @@ Get the native Capacitor plugin version
487
485
  ### Interfaces
488
486
 
489
487
 
490
- #### CustomerInfo
491
-
492
- | Prop | Type | Description |
493
- | ------------------------------------ | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
494
- | **`activeSubscriptions`** | <code>[string]</code> | Set of active subscription skus |
495
- | **`allPurchasedProductIdentifiers`** | <code>[string]</code> | Set of purchased skus, active and inactive |
496
- | **`nonSubscriptionTransactions`** | <code>{}</code> | Returns all the non-subscription a user has made. The are ordered by purchase date in ascending order. |
497
- | **`latestExpirationDate`** | <code>string \| null</code> | The latest expiration date of all purchased skus |
498
- | **`firstSeen`** | <code>string</code> | The date this user was first seen in RevenueCat. |
499
- | **`originalAppUserId`** | <code>string</code> | The original App User Id recorded for this user. |
500
- | **`requestDate`** | <code>string</code> | Date when this info was requested |
501
- | **`originalApplicationVersion`** | <code>string \| null</code> | Returns the version number for the version of the application when the user bought the app. Use this for grandfathering users when migrating to subscriptions. This corresponds to the value of CFBundleVersion (in iOS) in the Info.plist file when the purchase was originally made. This is always null in Android |
502
- | **`originalPurchaseDate`** | <code>string \| null</code> | Returns the purchase date for the version of the application when the user bought the app. Use this for grandfathering users when migrating to subscriptions. |
503
- | **`managementURL`** | <code>string \| null</code> | URL to manage the active subscription of the user. If this user has an active iOS subscription, this will point to the App Store, if the user has an active Play Store subscription it will point there. If there are no active subscriptions it will be null. If there are multiple for different platforms, it will point to the device store. |
504
-
505
-
506
488
  #### Transaction
507
489
 
508
490
  | Prop | Type | Description |
@@ -525,7 +507,7 @@ Get the native Capacitor plugin version
525
507
  | **`subscriptionGroupIdentifier`** | <code>string</code> | Group identifier for the product. |
526
508
  | **`subscriptionPeriod`** | <code><a href="#subscriptionperiod">SubscriptionPeriod</a></code> | The <a href="#product">Product</a> subcription group identifier. |
527
509
  | **`introductoryPrice`** | <code><a href="#skproductdiscount">SKProductDiscount</a> \| null</code> | The <a href="#product">Product</a> introductory Price. |
528
- | **`discounts`** | <code>{}</code> | The <a href="#product">Product</a> discounts list. |
510
+ | **`discounts`** | <code>SKProductDiscount[]</code> | The <a href="#product">Product</a> discounts list. |
529
511
 
530
512
 
531
513
  #### SubscriptionPeriod
@@ -1,8 +1,8 @@
1
1
  ext {
2
2
  junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3
- androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
4
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
5
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
3
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
4
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
5
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
6
6
  }
7
7
 
8
8
  buildscript {
@@ -19,10 +19,10 @@ apply plugin: 'com.android.library'
19
19
 
20
20
  android {
21
21
  namespace "ee.forgr.nativepurchases"
22
- compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
22
+ compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
23
23
  defaultConfig {
24
- minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
25
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
24
+ minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23
25
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
26
26
  versionCode 1
27
27
  versionName "1.0"
28
28
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -37,8 +37,8 @@ android {
37
37
  abortOnError false
38
38
  }
39
39
  compileOptions {
40
- sourceCompatibility JavaVersion.VERSION_17
41
- targetCompatibility JavaVersion.VERSION_17
40
+ sourceCompatibility JavaVersion.VERSION_21
41
+ targetCompatibility JavaVersion.VERSION_21
42
42
  }
43
43
  }
44
44
 
@@ -49,8 +49,8 @@ repositories {
49
49
 
50
50
 
51
51
  dependencies {
52
- implementation "com.google.guava:guava:31.1-jre"
53
- def billing_version = "6.2.1"
52
+ implementation "com.google.guava:guava:33.4.0-android"
53
+ def billing_version = "7.1.1"
54
54
  implementation "com.android.billingclient:billing:$billing_version"
55
55
  implementation fileTree(dir: 'libs', include: ['*.jar'])
56
56
  implementation project(':capacitor-android')
package/dist/docs.json CHANGED
@@ -7,19 +7,17 @@
7
7
  "methods": [
8
8
  {
9
9
  "name": "restorePurchases",
10
- "signature": "() => any",
10
+ "signature": "() => Promise<void>",
11
11
  "parameters": [],
12
- "returns": "any",
12
+ "returns": "Promise<void>",
13
13
  "tags": [],
14
14
  "docs": "Restores a user's previous and links their appUserIDs to any user's also using those .",
15
- "complexTypes": [
16
- "CustomerInfo"
17
- ],
15
+ "complexTypes": [],
18
16
  "slug": "restorepurchases"
19
17
  },
20
18
  {
21
19
  "name": "purchaseProduct",
22
- "signature": "(options: { productIdentifier: string; planIdentifier?: string; productType?: PURCHASE_TYPE; quantity?: number; }) => any",
20
+ "signature": "(options: { productIdentifier: string; planIdentifier?: string; productType?: PURCHASE_TYPE; quantity?: number; }) => Promise<Transaction>",
23
21
  "parameters": [
24
22
  {
25
23
  "name": "options",
@@ -27,7 +25,7 @@
27
25
  "type": "{ productIdentifier: string; planIdentifier?: string | undefined; productType?: PURCHASE_TYPE | undefined; quantity?: number | undefined; }"
28
26
  }
29
27
  ],
30
- "returns": "any",
28
+ "returns": "Promise<Transaction>",
31
29
  "tags": [
32
30
  {
33
31
  "name": "param",
@@ -52,22 +50,22 @@
52
50
  ],
53
51
  "docs": "Started purchase process for the given product.",
54
52
  "complexTypes": [
55
- "PURCHASE_TYPE",
56
- "Transaction"
53
+ "Transaction",
54
+ "PURCHASE_TYPE"
57
55
  ],
58
56
  "slug": "purchaseproduct"
59
57
  },
60
58
  {
61
59
  "name": "getProducts",
62
- "signature": "(options: { productIdentifiers: string[]; productType?: PURCHASE_TYPE; }) => any",
60
+ "signature": "(options: { productIdentifiers: string[]; productType?: PURCHASE_TYPE; }) => Promise<{ products: Product[]; }>",
63
61
  "parameters": [
64
62
  {
65
63
  "name": "options",
66
64
  "docs": "- The product identifiers you wish to retrieve information for",
67
- "type": "{ productIdentifiers: {}; productType?: PURCHASE_TYPE | undefined; }"
65
+ "type": "{ productIdentifiers: string[]; productType?: PURCHASE_TYPE | undefined; }"
68
66
  }
69
67
  ],
70
- "returns": "any",
68
+ "returns": "Promise<{ products: Product[]; }>",
71
69
  "tags": [
72
70
  {
73
71
  "name": "param",
@@ -88,14 +86,14 @@
88
86
  ],
89
87
  "docs": "Gets the product info associated with a list of product identifiers.",
90
88
  "complexTypes": [
91
- "PURCHASE_TYPE",
92
- "Product"
89
+ "Product",
90
+ "PURCHASE_TYPE"
93
91
  ],
94
92
  "slug": "getproducts"
95
93
  },
96
94
  {
97
95
  "name": "getProduct",
98
- "signature": "(options: { productIdentifier: string; productType?: PURCHASE_TYPE; }) => any",
96
+ "signature": "(options: { productIdentifier: string; productType?: PURCHASE_TYPE; }) => Promise<{ product: Product; }>",
99
97
  "parameters": [
100
98
  {
101
99
  "name": "options",
@@ -103,7 +101,7 @@
103
101
  "type": "{ productIdentifier: string; productType?: PURCHASE_TYPE | undefined; }"
104
102
  }
105
103
  ],
106
- "returns": "any",
104
+ "returns": "Promise<{ product: Product; }>",
107
105
  "tags": [
108
106
  {
109
107
  "name": "param",
@@ -124,16 +122,16 @@
124
122
  ],
125
123
  "docs": "Gets the product info for a single product identifier.",
126
124
  "complexTypes": [
127
- "PURCHASE_TYPE",
128
- "Product"
125
+ "Product",
126
+ "PURCHASE_TYPE"
129
127
  ],
130
128
  "slug": "getproduct"
131
129
  },
132
130
  {
133
131
  "name": "isBillingSupported",
134
- "signature": "() => any",
132
+ "signature": "() => Promise<{ isBillingSupported: boolean; }>",
135
133
  "parameters": [],
136
- "returns": "any",
134
+ "returns": "Promise<{ isBillingSupported: boolean; }>",
137
135
  "tags": [],
138
136
  "docs": "Check if billing is supported for the current device.",
139
137
  "complexTypes": [],
@@ -141,9 +139,9 @@
141
139
  },
142
140
  {
143
141
  "name": "getPluginVersion",
144
- "signature": "() => any",
142
+ "signature": "() => Promise<{ version: string; }>",
145
143
  "parameters": [],
146
- "returns": "any",
144
+ "returns": "Promise<{ version: string; }>",
147
145
  "tags": [
148
146
  {
149
147
  "name": "returns",
@@ -162,87 +160,6 @@
162
160
  "properties": []
163
161
  },
164
162
  "interfaces": [
165
- {
166
- "name": "CustomerInfo",
167
- "slug": "customerinfo",
168
- "docs": "",
169
- "tags": [],
170
- "methods": [],
171
- "properties": [
172
- {
173
- "name": "activeSubscriptions",
174
- "tags": [],
175
- "docs": "Set of active subscription skus",
176
- "complexTypes": [],
177
- "type": "[string]"
178
- },
179
- {
180
- "name": "allPurchasedProductIdentifiers",
181
- "tags": [],
182
- "docs": "Set of purchased skus, active and inactive",
183
- "complexTypes": [],
184
- "type": "[string]"
185
- },
186
- {
187
- "name": "nonSubscriptionTransactions",
188
- "tags": [],
189
- "docs": "Returns all the non-subscription a user has made.\nThe are ordered by purchase date in ascending order.",
190
- "complexTypes": [
191
- "Transaction"
192
- ],
193
- "type": "{}"
194
- },
195
- {
196
- "name": "latestExpirationDate",
197
- "tags": [],
198
- "docs": "The latest expiration date of all purchased skus",
199
- "complexTypes": [],
200
- "type": "string | null"
201
- },
202
- {
203
- "name": "firstSeen",
204
- "tags": [],
205
- "docs": "The date this user was first seen in RevenueCat.",
206
- "complexTypes": [],
207
- "type": "string"
208
- },
209
- {
210
- "name": "originalAppUserId",
211
- "tags": [],
212
- "docs": "The original App User Id recorded for this user.",
213
- "complexTypes": [],
214
- "type": "string"
215
- },
216
- {
217
- "name": "requestDate",
218
- "tags": [],
219
- "docs": "Date when this info was requested",
220
- "complexTypes": [],
221
- "type": "string"
222
- },
223
- {
224
- "name": "originalApplicationVersion",
225
- "tags": [],
226
- "docs": "Returns the version number for the version of the application when the\nuser bought the app. Use this for grandfathering users when migrating\nto subscriptions.\n\nThis corresponds to the value of CFBundleVersion (in iOS) in the\nInfo.plist file when the purchase was originally made. This is always null\nin Android",
227
- "complexTypes": [],
228
- "type": "string | null"
229
- },
230
- {
231
- "name": "originalPurchaseDate",
232
- "tags": [],
233
- "docs": "Returns the purchase date for the version of the application when the user bought the app.\nUse this for grandfathering users when migrating to subscriptions.",
234
- "complexTypes": [],
235
- "type": "string | null"
236
- },
237
- {
238
- "name": "managementURL",
239
- "tags": [],
240
- "docs": "URL to manage the active subscription of the user. If this user has an active iOS\nsubscription, this will point to the App Store, if the user has an active Play Store subscription\nit will point there. If there are no active subscriptions it will be null.\nIf there are multiple for different platforms, it will point to the device store.",
241
- "complexTypes": [],
242
- "type": "string | null"
243
- }
244
- ]
245
- },
246
163
  {
247
164
  "name": "Transaction",
248
165
  "slug": "transaction",
@@ -354,7 +271,7 @@
354
271
  "complexTypes": [
355
272
  "SKProductDiscount"
356
273
  ],
357
- "type": "{}"
274
+ "type": "SKProductDiscount[]"
358
275
  }
359
276
  ]
360
277
  },
@@ -125,59 +125,6 @@ export interface Transaction {
125
125
  */
126
126
  readonly transactionId: string;
127
127
  }
128
- export interface CustomerInfo {
129
- /**
130
- * Set of active subscription skus
131
- */
132
- readonly activeSubscriptions: [string];
133
- /**
134
- * Set of purchased skus, active and inactive
135
- */
136
- readonly allPurchasedProductIdentifiers: [string];
137
- /**
138
- * Returns all the non-subscription a user has made.
139
- * The are ordered by purchase date in ascending order.
140
- */
141
- readonly nonSubscriptionTransactions: Transaction[];
142
- /**
143
- * The latest expiration date of all purchased skus
144
- */
145
- readonly latestExpirationDate: string | null;
146
- /**
147
- * The date this user was first seen in RevenueCat.
148
- */
149
- readonly firstSeen: string;
150
- /**
151
- * The original App User Id recorded for this user.
152
- */
153
- readonly originalAppUserId: string;
154
- /**
155
- * Date when this info was requested
156
- */
157
- readonly requestDate: string;
158
- /**
159
- * Returns the version number for the version of the application when the
160
- * user bought the app. Use this for grandfathering users when migrating
161
- * to subscriptions.
162
- *
163
- * This corresponds to the value of CFBundleVersion (in iOS) in the
164
- * Info.plist file when the purchase was originally made. This is always null
165
- * in Android
166
- */
167
- readonly originalApplicationVersion: string | null;
168
- /**
169
- * Returns the purchase date for the version of the application when the user bought the app.
170
- * Use this for grandfathering users when migrating to subscriptions.
171
- */
172
- readonly originalPurchaseDate: string | null;
173
- /**
174
- * URL to manage the active subscription of the user. If this user has an active iOS
175
- * subscription, this will point to the App Store, if the user has an active Play Store subscription
176
- * it will point there. If there are no active subscriptions it will be null.
177
- * If there are multiple for different platforms, it will point to the device store.
178
- */
179
- readonly managementURL: string | null;
180
- }
181
128
  export interface SubscriptionPeriod {
182
129
  /**
183
130
  * The Subscription Period number of unit.
@@ -280,9 +227,7 @@ export interface NativePurchasesPlugin {
280
227
  /**
281
228
  * Restores a user's previous and links their appUserIDs to any user's also using those .
282
229
  */
283
- restorePurchases(): Promise<{
284
- customerInfo: CustomerInfo;
285
- }>;
230
+ restorePurchases(): Promise<void>;
286
231
  /**
287
232
  * Started purchase process for the given product.
288
233
  *
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,qFAAoB,CAAA;IACpB,iEAAU,CAAA;IACV,uEAAa,CAAA;IACb,iEAAU,CAAA;IACV,iEAAU,CAAA;IACV,qEAAY,CAAA;AACd,CAAC,EAPW,mBAAmB,KAAnB,mBAAmB,QAO9B;AAED,MAAM,CAAN,IAAY,aAUX;AAVD,WAAY,aAAa;IACvB;;OAEG;IACH,gCAAe,CAAA;IAEf;;OAEG;IACH,8BAAa,CAAA;AACf,CAAC,EAVW,aAAa,KAAb,aAAa,QAUxB;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,eAyBX;AAzBD,WAAY,eAAe;IACzB;;OAEG;IACH,uEAAa,CAAA;IAEb;;OAEG;IACH,qFAAoB,CAAA;IAEpB;;OAEG;IACH,iFAAkB,CAAA;IAElB;;OAEG;IACH,mFAAmB,CAAA;IAEnB;;OAEG;IACH,+FAAyB,CAAA;AAC3B,CAAC,EAzBW,eAAe,KAAf,eAAe,QAyB1B;AACD,MAAM,CAAN,IAAY,cA2BX;AA3BD,WAAY,cAAc;IACxB,qIAAiD,CAAA;IAEjD;;;OAGG;IACH,qGAAiC,CAAA;IAEjC;;;;OAIG;IACH,iHAAuC,CAAA;IAEvC;;;OAGG;IACH,iGAA+B,CAAA;IAE/B;;;OAGG;IACH,2DAAY,CAAA;AACd,CAAC,EA3BW,cAAc,KAAd,cAAc,QA2BzB;AAED,MAAM,CAAN,IAAY,YA6CX;AA7CD,WAAY,YAAY;IACtB;;OAEG;IACH,mCAAmB,CAAA;IAEnB;;OAEG;IACH,iCAAiB,CAAA;IAEjB;;OAEG;IACH,qCAAqB,CAAA;IAErB;;OAEG;IACH,iCAAiB,CAAA;IAEjB;;OAEG;IACH,uCAAuB,CAAA;IAEvB;;OAEG;IACH,2CAA2B,CAAA;IAE3B;;OAEG;IACH,uCAAuB,CAAA;IAEvB;;OAEG;IACH,mCAAmB,CAAA;IAEnB;;OAEG;IACH,iCAAiB,CAAA;AACnB,CAAC,EA7CW,YAAY,KAAZ,YAAY,QA6CvB;AAED,MAAM,CAAN,IAAY,wBAaX;AAbD,WAAY,wBAAwB;IAClC;;OAEG;IACH,+HAAoC,CAAA;IACpC;;OAEG;IACH,qIAAmC,CAAA;IACnC;;OAEG;IACH,iIAAiC,CAAA;AACnC,CAAC,EAbW,wBAAwB,KAAxB,wBAAwB,QAanC","sourcesContent":["export enum ATTRIBUTION_NETWORK {\n APPLE_SEARCH_ADS = 0,\n ADJUST = 1,\n APPSFLYER = 2,\n BRANCH = 3,\n TENJIN = 4,\n FACEBOOK = 5,\n}\n\nexport enum PURCHASE_TYPE {\n /**\n * A type of SKU for in-app products.\n */\n INAPP = \"inapp\",\n\n /**\n * A type of SKU for subscriptions.\n */\n SUBS = \"subs\",\n}\n\n/**\n * Enum for billing features.\n * Currently, these are only relevant for Google Play Android users:\n * https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType\n */\nexport enum BILLING_FEATURE {\n /**\n * Purchase/query for subscriptions.\n */\n SUBSCRIPTIONS,\n\n /**\n * Subscriptions update/replace.\n */\n SUBSCRIPTIONS_UPDATE,\n\n /**\n * Purchase/query for in-app items on VR.\n */\n IN_APP_ITEMS_ON_VR,\n\n /**\n * Purchase/query for subscriptions on VR.\n */\n SUBSCRIPTIONS_ON_VR,\n\n /**\n * Launch a price change confirmation flow.\n */\n PRICE_CHANGE_CONFIRMATION,\n}\nexport enum PRORATION_MODE {\n UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY = 0,\n\n /**\n * Replacement takes effect immediately, and the remaining time will be\n * prorated and credited to the user. This is the current default behavior.\n */\n IMMEDIATE_WITH_TIME_PRORATION = 1,\n\n /**\n * Replacement takes effect immediately, and the billing cycle remains the\n * same. The price for the remaining period will be charged. This option is\n * only available for subscription upgrade.\n */\n IMMEDIATE_AND_CHARGE_PRORATED_PRICE = 2,\n\n /**\n * Replacement takes effect immediately, and the new price will be charged on\n * next recurrence time. The billing cycle stays the same.\n */\n IMMEDIATE_WITHOUT_PRORATION = 3,\n\n /**\n * Replacement takes effect when the old plan expires, and the new price will\n * be charged at the same time.\n */\n DEFERRED = 4,\n}\n\nexport enum PACKAGE_TYPE {\n /**\n * A package that was defined with a custom identifier.\n */\n UNKNOWN = \"UNKNOWN\",\n\n /**\n * A package that was defined with a custom identifier.\n */\n CUSTOM = \"CUSTOM\",\n\n /**\n * A package configured with the predefined lifetime identifier.\n */\n LIFETIME = \"LIFETIME\",\n\n /**\n * A package configured with the predefined annual identifier.\n */\n ANNUAL = \"ANNUAL\",\n\n /**\n * A package configured with the predefined six month identifier.\n */\n SIX_MONTH = \"SIX_MONTH\",\n\n /**\n * A package configured with the predefined three month identifier.\n */\n THREE_MONTH = \"THREE_MONTH\",\n\n /**\n * A package configured with the predefined two month identifier.\n */\n TWO_MONTH = \"TWO_MONTH\",\n\n /**\n * A package configured with the predefined monthly identifier.\n */\n MONTHLY = \"MONTHLY\",\n\n /**\n * A package configured with the predefined weekly identifier.\n */\n WEEKLY = \"WEEKLY\",\n}\n\nexport enum INTRO_ELIGIBILITY_STATUS {\n /**\n * RevenueCat doesn't have enough information to determine eligibility.\n */\n INTRO_ELIGIBILITY_STATUS_UNKNOWN = 0,\n /**\n * The user is not eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS_INELIGIBLE,\n /**\n * The user is eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS_ELIGIBLE,\n}\n\nexport interface Transaction {\n /**\n * RevenueCat Id associated to the transaction.\n */\n readonly transactionId: string;\n /**\n * Product Id associated with the transaction.\n */\n // readonly productIdentifier: string;\n /**\n * Purchase date of the transaction in ISO 8601 format.\n */\n // readonly purchaseDate: string;\n}\n\nexport interface CustomerInfo {\n /**\n * Set of active subscription skus\n */\n readonly activeSubscriptions: [string];\n /**\n * Set of purchased skus, active and inactive\n */\n readonly allPurchasedProductIdentifiers: [string];\n /**\n * Returns all the non-subscription a user has made.\n * The are ordered by purchase date in ascending order.\n */\n readonly nonSubscriptionTransactions: Transaction[];\n /**\n * The latest expiration date of all purchased skus\n */\n readonly latestExpirationDate: string | null;\n /**\n * The date this user was first seen in RevenueCat.\n */\n readonly firstSeen: string;\n /**\n * The original App User Id recorded for this user.\n */\n readonly originalAppUserId: string;\n /**\n * Date when this info was requested\n */\n readonly requestDate: string;\n /**\n * Returns the version number for the version of the application when the\n * user bought the app. Use this for grandfathering users when migrating\n * to subscriptions.\n *\n * This corresponds to the value of CFBundleVersion (in iOS) in the\n * Info.plist file when the purchase was originally made. This is always null\n * in Android\n */\n readonly originalApplicationVersion: string | null;\n /**\n * Returns the purchase date for the version of the application when the user bought the app.\n * Use this for grandfathering users when migrating to subscriptions.\n */\n readonly originalPurchaseDate: string | null;\n /**\n * URL to manage the active subscription of the user. If this user has an active iOS\n * subscription, this will point to the App Store, if the user has an active Play Store subscription\n * it will point there. If there are no active subscriptions it will be null.\n * If there are multiple for different platforms, it will point to the device store.\n */\n readonly managementURL: string | null;\n}\nexport interface SubscriptionPeriod {\n /**\n * The Subscription Period number of unit.\n */\n readonly numberOfUnits: number;\n /**\n * The Subscription Period unit.\n */\n readonly unit: number;\n}\nexport interface SKProductDiscount {\n /**\n * The Product discount identifier.\n */\n readonly identifier: string;\n /**\n * The Product discount type.\n */\n readonly type: number;\n /**\n * The Product discount price.\n */\n readonly price: number;\n /**\n * Formatted price of the item, including its currency sign, such as €3.99.\n */\n readonly priceString: string;\n /**\n * The Product discount currency symbol.\n */\n readonly currencySymbol: string;\n /**\n * The Product discount currency code.\n */\n readonly currencyCode: string;\n /**\n * The Product discount paymentMode.\n */\n readonly paymentMode: number;\n /**\n * The Product discount number Of Periods.\n */\n readonly numberOfPeriods: number;\n /**\n * The Product discount subscription period.\n */\n readonly subscriptionPeriod: SubscriptionPeriod;\n}\nexport interface Product {\n /**\n * Product Id.\n */\n readonly identifier: string;\n /**\n * Description of the product.\n */\n readonly description: string;\n /**\n * Title of the product.\n */\n readonly title: string;\n /**\n * Price of the product in the local currency.\n */\n readonly price: number;\n /**\n * Formatted price of the item, including its currency sign, such as €3.99.\n */\n readonly priceString: string;\n /**\n * Currency code for price and original price.\n */\n readonly currencyCode: string;\n /**\n * Currency symbol for price and original price.\n */\n readonly currencySymbol: string;\n /**\n * Boolean indicating if the product is sharable with family\n */\n readonly isFamilyShareable: boolean;\n /**\n * Group identifier for the product.\n */\n readonly subscriptionGroupIdentifier: string;\n /**\n * The Product subcription group identifier.\n */\n readonly subscriptionPeriod: SubscriptionPeriod;\n /**\n * The Product introductory Price.\n */\n readonly introductoryPrice: SKProductDiscount | null;\n /**\n * The Product discounts list.\n */\n readonly discounts: SKProductDiscount[];\n}\n\nexport interface NativePurchasesPlugin {\n /**\n * Restores a user's previous and links their appUserIDs to any user's also using those .\n */\n restorePurchases(): Promise<{ customerInfo: CustomerInfo }>;\n\n /**\n * Started purchase process for the given product.\n *\n * @param options - The product to purchase\n * @param options.productIdentifier - The product identifier of the product you want to purchase.\n * @param options.productType - Only Android, the type of product, can be inapp or subs. Will use inapp by default.\n * @param options.planIdentifier - Only Android, the identifier of the plan you want to purchase, require for for subs.\n * @param options.quantity - Only iOS, the number of items you wish to purchase. Will use 1 by default.\n */\n purchaseProduct(options: {\n productIdentifier: string;\n planIdentifier?: string;\n productType?: PURCHASE_TYPE;\n quantity?: number;\n }): Promise<Transaction>;\n\n /**\n * Gets the product info associated with a list of product identifiers.\n *\n * @param options - The product identifiers you wish to retrieve information for\n * @param options.productIdentifiers - Array of product identifiers\n * @param options.productType - Only Android, the type of product, can be inapp or subs. Will use inapp by default.\n * @returns - The requested product info\n */\n getProducts(options: {\n productIdentifiers: string[];\n productType?: PURCHASE_TYPE;\n }): Promise<{ products: Product[] }>;\n\n /**\n * Gets the product info for a single product identifier.\n *\n * @param options - The product identifier you wish to retrieve information for\n * @param options.productIdentifier - The product identifier\n * @param options.productType - Only Android, the type of product, can be inapp or subs. Will use inapp by default.\n * @returns - The requested product info\n */\n getProduct(options: {\n productIdentifier: string;\n productType?: PURCHASE_TYPE;\n }): Promise<{ product: Product }>;\n\n /**\n * Check if billing is supported for the current device.\n *\n *\n */\n isBillingSupported(): Promise<{ isBillingSupported: boolean }>;\n /**\n * Get the native Capacitor plugin version\n *\n * @returns {Promise<{ id: string }>} an Promise with version for this device\n * @throws An error if the something went wrong\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,qFAAoB,CAAA;IACpB,iEAAU,CAAA;IACV,uEAAa,CAAA;IACb,iEAAU,CAAA;IACV,iEAAU,CAAA;IACV,qEAAY,CAAA;AACd,CAAC,EAPW,mBAAmB,KAAnB,mBAAmB,QAO9B;AAED,MAAM,CAAN,IAAY,aAUX;AAVD,WAAY,aAAa;IACvB;;OAEG;IACH,gCAAe,CAAA;IAEf;;OAEG;IACH,8BAAa,CAAA;AACf,CAAC,EAVW,aAAa,KAAb,aAAa,QAUxB;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,eAyBX;AAzBD,WAAY,eAAe;IACzB;;OAEG;IACH,uEAAa,CAAA;IAEb;;OAEG;IACH,qFAAoB,CAAA;IAEpB;;OAEG;IACH,iFAAkB,CAAA;IAElB;;OAEG;IACH,mFAAmB,CAAA;IAEnB;;OAEG;IACH,+FAAyB,CAAA;AAC3B,CAAC,EAzBW,eAAe,KAAf,eAAe,QAyB1B;AACD,MAAM,CAAN,IAAY,cA2BX;AA3BD,WAAY,cAAc;IACxB,qIAAiD,CAAA;IAEjD;;;OAGG;IACH,qGAAiC,CAAA;IAEjC;;;;OAIG;IACH,iHAAuC,CAAA;IAEvC;;;OAGG;IACH,iGAA+B,CAAA;IAE/B;;;OAGG;IACH,2DAAY,CAAA;AACd,CAAC,EA3BW,cAAc,KAAd,cAAc,QA2BzB;AAED,MAAM,CAAN,IAAY,YA6CX;AA7CD,WAAY,YAAY;IACtB;;OAEG;IACH,mCAAmB,CAAA;IAEnB;;OAEG;IACH,iCAAiB,CAAA;IAEjB;;OAEG;IACH,qCAAqB,CAAA;IAErB;;OAEG;IACH,iCAAiB,CAAA;IAEjB;;OAEG;IACH,uCAAuB,CAAA;IAEvB;;OAEG;IACH,2CAA2B,CAAA;IAE3B;;OAEG;IACH,uCAAuB,CAAA;IAEvB;;OAEG;IACH,mCAAmB,CAAA;IAEnB;;OAEG;IACH,iCAAiB,CAAA;AACnB,CAAC,EA7CW,YAAY,KAAZ,YAAY,QA6CvB;AAED,MAAM,CAAN,IAAY,wBAaX;AAbD,WAAY,wBAAwB;IAClC;;OAEG;IACH,+HAAoC,CAAA;IACpC;;OAEG;IACH,qIAAmC,CAAA;IACnC;;OAEG;IACH,iIAAiC,CAAA;AACnC,CAAC,EAbW,wBAAwB,KAAxB,wBAAwB,QAanC","sourcesContent":["export enum ATTRIBUTION_NETWORK {\n APPLE_SEARCH_ADS = 0,\n ADJUST = 1,\n APPSFLYER = 2,\n BRANCH = 3,\n TENJIN = 4,\n FACEBOOK = 5,\n}\n\nexport enum PURCHASE_TYPE {\n /**\n * A type of SKU for in-app products.\n */\n INAPP = \"inapp\",\n\n /**\n * A type of SKU for subscriptions.\n */\n SUBS = \"subs\",\n}\n\n/**\n * Enum for billing features.\n * Currently, these are only relevant for Google Play Android users:\n * https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType\n */\nexport enum BILLING_FEATURE {\n /**\n * Purchase/query for subscriptions.\n */\n SUBSCRIPTIONS,\n\n /**\n * Subscriptions update/replace.\n */\n SUBSCRIPTIONS_UPDATE,\n\n /**\n * Purchase/query for in-app items on VR.\n */\n IN_APP_ITEMS_ON_VR,\n\n /**\n * Purchase/query for subscriptions on VR.\n */\n SUBSCRIPTIONS_ON_VR,\n\n /**\n * Launch a price change confirmation flow.\n */\n PRICE_CHANGE_CONFIRMATION,\n}\nexport enum PRORATION_MODE {\n UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY = 0,\n\n /**\n * Replacement takes effect immediately, and the remaining time will be\n * prorated and credited to the user. This is the current default behavior.\n */\n IMMEDIATE_WITH_TIME_PRORATION = 1,\n\n /**\n * Replacement takes effect immediately, and the billing cycle remains the\n * same. The price for the remaining period will be charged. This option is\n * only available for subscription upgrade.\n */\n IMMEDIATE_AND_CHARGE_PRORATED_PRICE = 2,\n\n /**\n * Replacement takes effect immediately, and the new price will be charged on\n * next recurrence time. The billing cycle stays the same.\n */\n IMMEDIATE_WITHOUT_PRORATION = 3,\n\n /**\n * Replacement takes effect when the old plan expires, and the new price will\n * be charged at the same time.\n */\n DEFERRED = 4,\n}\n\nexport enum PACKAGE_TYPE {\n /**\n * A package that was defined with a custom identifier.\n */\n UNKNOWN = \"UNKNOWN\",\n\n /**\n * A package that was defined with a custom identifier.\n */\n CUSTOM = \"CUSTOM\",\n\n /**\n * A package configured with the predefined lifetime identifier.\n */\n LIFETIME = \"LIFETIME\",\n\n /**\n * A package configured with the predefined annual identifier.\n */\n ANNUAL = \"ANNUAL\",\n\n /**\n * A package configured with the predefined six month identifier.\n */\n SIX_MONTH = \"SIX_MONTH\",\n\n /**\n * A package configured with the predefined three month identifier.\n */\n THREE_MONTH = \"THREE_MONTH\",\n\n /**\n * A package configured with the predefined two month identifier.\n */\n TWO_MONTH = \"TWO_MONTH\",\n\n /**\n * A package configured with the predefined monthly identifier.\n */\n MONTHLY = \"MONTHLY\",\n\n /**\n * A package configured with the predefined weekly identifier.\n */\n WEEKLY = \"WEEKLY\",\n}\n\nexport enum INTRO_ELIGIBILITY_STATUS {\n /**\n * RevenueCat doesn't have enough information to determine eligibility.\n */\n INTRO_ELIGIBILITY_STATUS_UNKNOWN = 0,\n /**\n * The user is not eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS_INELIGIBLE,\n /**\n * The user is eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS_ELIGIBLE,\n}\n\nexport interface Transaction {\n /**\n * RevenueCat Id associated to the transaction.\n */\n readonly transactionId: string;\n /**\n * Product Id associated with the transaction.\n */\n // readonly productIdentifier: string;\n /**\n * Purchase date of the transaction in ISO 8601 format.\n */\n // readonly purchaseDate: string;\n}\n\nexport interface SubscriptionPeriod {\n /**\n * The Subscription Period number of unit.\n */\n readonly numberOfUnits: number;\n /**\n * The Subscription Period unit.\n */\n readonly unit: number;\n}\nexport interface SKProductDiscount {\n /**\n * The Product discount identifier.\n */\n readonly identifier: string;\n /**\n * The Product discount type.\n */\n readonly type: number;\n /**\n * The Product discount price.\n */\n readonly price: number;\n /**\n * Formatted price of the item, including its currency sign, such as €3.99.\n */\n readonly priceString: string;\n /**\n * The Product discount currency symbol.\n */\n readonly currencySymbol: string;\n /**\n * The Product discount currency code.\n */\n readonly currencyCode: string;\n /**\n * The Product discount paymentMode.\n */\n readonly paymentMode: number;\n /**\n * The Product discount number Of Periods.\n */\n readonly numberOfPeriods: number;\n /**\n * The Product discount subscription period.\n */\n readonly subscriptionPeriod: SubscriptionPeriod;\n}\nexport interface Product {\n /**\n * Product Id.\n */\n readonly identifier: string;\n /**\n * Description of the product.\n */\n readonly description: string;\n /**\n * Title of the product.\n */\n readonly title: string;\n /**\n * Price of the product in the local currency.\n */\n readonly price: number;\n /**\n * Formatted price of the item, including its currency sign, such as €3.99.\n */\n readonly priceString: string;\n /**\n * Currency code for price and original price.\n */\n readonly currencyCode: string;\n /**\n * Currency symbol for price and original price.\n */\n readonly currencySymbol: string;\n /**\n * Boolean indicating if the product is sharable with family\n */\n readonly isFamilyShareable: boolean;\n /**\n * Group identifier for the product.\n */\n readonly subscriptionGroupIdentifier: string;\n /**\n * The Product subcription group identifier.\n */\n readonly subscriptionPeriod: SubscriptionPeriod;\n /**\n * The Product introductory Price.\n */\n readonly introductoryPrice: SKProductDiscount | null;\n /**\n * The Product discounts list.\n */\n readonly discounts: SKProductDiscount[];\n}\n\nexport interface NativePurchasesPlugin {\n /**\n * Restores a user's previous and links their appUserIDs to any user's also using those .\n */\n restorePurchases(): Promise<void>;\n\n /**\n * Started purchase process for the given product.\n *\n * @param options - The product to purchase\n * @param options.productIdentifier - The product identifier of the product you want to purchase.\n * @param options.productType - Only Android, the type of product, can be inapp or subs. Will use inapp by default.\n * @param options.planIdentifier - Only Android, the identifier of the plan you want to purchase, require for for subs.\n * @param options.quantity - Only iOS, the number of items you wish to purchase. Will use 1 by default.\n */\n purchaseProduct(options: {\n productIdentifier: string;\n planIdentifier?: string;\n productType?: PURCHASE_TYPE;\n quantity?: number;\n }): Promise<Transaction>;\n\n /**\n * Gets the product info associated with a list of product identifiers.\n *\n * @param options - The product identifiers you wish to retrieve information for\n * @param options.productIdentifiers - Array of product identifiers\n * @param options.productType - Only Android, the type of product, can be inapp or subs. Will use inapp by default.\n * @returns - The requested product info\n */\n getProducts(options: {\n productIdentifiers: string[];\n productType?: PURCHASE_TYPE;\n }): Promise<{ products: Product[] }>;\n\n /**\n * Gets the product info for a single product identifier.\n *\n * @param options - The product identifier you wish to retrieve information for\n * @param options.productIdentifier - The product identifier\n * @param options.productType - Only Android, the type of product, can be inapp or subs. Will use inapp by default.\n * @returns - The requested product info\n */\n getProduct(options: {\n productIdentifier: string;\n productType?: PURCHASE_TYPE;\n }): Promise<{ product: Product }>;\n\n /**\n * Check if billing is supported for the current device.\n *\n *\n */\n isBillingSupported(): Promise<{ isBillingSupported: boolean }>;\n /**\n * Get the native Capacitor plugin version\n *\n * @returns {Promise<{ id: string }>} an Promise with version for this device\n * @throws An error if the something went wrong\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n"]}
package/dist/esm/web.d.ts CHANGED
@@ -1,10 +1,7 @@
1
1
  import { WebPlugin } from "@capacitor/core";
2
- import type { NativePurchasesPlugin, CustomerInfo, Product } from "./definitions";
3
- export declare const mockCustomerInfo: CustomerInfo;
2
+ import type { NativePurchasesPlugin, Product } from "./definitions";
4
3
  export declare class NativePurchasesWeb extends WebPlugin implements NativePurchasesPlugin {
5
- restorePurchases(): Promise<{
6
- customerInfo: CustomerInfo;
7
- }>;
4
+ restorePurchases(): Promise<void>;
8
5
  getProducts(options: {
9
6
  productIdentifiers: string[];
10
7
  }): Promise<{
package/dist/esm/web.js CHANGED
@@ -1,20 +1,7 @@
1
1
  import { WebPlugin } from "@capacitor/core";
2
- export const mockCustomerInfo = {
3
- activeSubscriptions: [""],
4
- allPurchasedProductIdentifiers: [""],
5
- nonSubscriptionTransactions: [],
6
- latestExpirationDate: null,
7
- firstSeen: "2020-01-01T00:00:00.000Z",
8
- originalAppUserId: "",
9
- requestDate: "2020-01-01T00:00:00.000Z",
10
- originalApplicationVersion: "",
11
- originalPurchaseDate: null,
12
- managementURL: null,
13
- };
14
2
  export class NativePurchasesWeb extends WebPlugin {
15
3
  async restorePurchases() {
16
- console.error("purchasePackage only mocked in web");
17
- return { customerInfo: mockCustomerInfo };
4
+ console.error("restorePurchases only mocked in web");
18
5
  }
19
6
  async getProducts(options) {
20
7
  console.error("getProducts only mocked in web " + options);
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,MAAM,CAAC,MAAM,gBAAgB,GAAiB;IAC5C,mBAAmB,EAAE,CAAC,EAAE,CAAC;IACzB,8BAA8B,EAAE,CAAC,EAAE,CAAC;IACpC,2BAA2B,EAAE,EAAE;IAC/B,oBAAoB,EAAE,IAAI;IAC1B,SAAS,EAAE,0BAA0B;IACrC,iBAAiB,EAAE,EAAE;IACrB,WAAW,EAAE,0BAA0B;IACvC,0BAA0B,EAAE,EAAE;IAC9B,oBAAoB,EAAE,IAAI;IAC1B,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,MAAM,OAAO,kBACX,SAAQ,SAAS;IAGjB,KAAK,CAAC,gBAAgB;QACpB,OAAO,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACpD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAEjB;QACC,OAAO,CAAC,KAAK,CAAC,iCAAiC,GAAG,OAAO,CAAC,CAAC;QAC3D,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,OAEhB;QACC,OAAO,CAAC,KAAK,CAAC,gCAAgC,GAAG,OAAO,CAAC,CAAC;QAC1D,OAAO,EAAE,OAAO,EAAE,EAAS,EAAE,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,OAIrB;QACC,OAAO,CAAC,KAAK,CAAC,oCAAoC,GAAG,OAAO,CAAC,CAAC;QAC9D,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;QACvD,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC;IACvC,CAAC;IACD,KAAK,CAAC,gBAAgB;QACpB,OAAO,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;QACjD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAChC,CAAC;CACF","sourcesContent":["import { WebPlugin } from \"@capacitor/core\";\n\nimport type {\n NativePurchasesPlugin,\n CustomerInfo,\n Product,\n} from \"./definitions\";\n\nexport const mockCustomerInfo: CustomerInfo = {\n activeSubscriptions: [\"\"],\n allPurchasedProductIdentifiers: [\"\"],\n nonSubscriptionTransactions: [],\n latestExpirationDate: null,\n firstSeen: \"2020-01-01T00:00:00.000Z\",\n originalAppUserId: \"\",\n requestDate: \"2020-01-01T00:00:00.000Z\",\n originalApplicationVersion: \"\",\n originalPurchaseDate: null,\n managementURL: null,\n};\n\nexport class NativePurchasesWeb\n extends WebPlugin\n implements NativePurchasesPlugin\n{\n async restorePurchases(): Promise<{ customerInfo: CustomerInfo }> {\n console.error(\"purchasePackage only mocked in web\");\n return { customerInfo: mockCustomerInfo };\n }\n\n async getProducts(options: {\n productIdentifiers: string[];\n }): Promise<{ products: Product[] }> {\n console.error(\"getProducts only mocked in web \" + options);\n return { products: [] };\n }\n\n async getProduct(options: {\n productIdentifier: string;\n }): Promise<{ product: Product }> {\n console.error(\"getProduct only mocked in web \" + options);\n return { product: {} as any };\n }\n\n async purchaseProduct(options: {\n productIdentifier: string;\n planIdentifier: string;\n quantity: number;\n }): Promise<{ transactionId: string }> {\n console.error(\"purchaseProduct only mocked in web\" + options);\n return { transactionId: \"transactionId\" };\n }\n\n async isBillingSupported(): Promise<{ isBillingSupported: boolean }> {\n console.error(\"isBillingSupported only mocked in web\");\n return { isBillingSupported: false };\n }\n async getPluginVersion(): Promise<{ version: string }> {\n console.warn(\"Cannot get plugin version in web\");\n return { version: \"default\" };\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,kBACX,SAAQ,SAAS;IAGjB,KAAK,CAAC,gBAAgB;QACpB,OAAO,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAEjB;QACC,OAAO,CAAC,KAAK,CAAC,iCAAiC,GAAG,OAAO,CAAC,CAAC;QAC3D,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,OAEhB;QACC,OAAO,CAAC,KAAK,CAAC,gCAAgC,GAAG,OAAO,CAAC,CAAC;QAC1D,OAAO,EAAE,OAAO,EAAE,EAAS,EAAE,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,OAIrB;QACC,OAAO,CAAC,KAAK,CAAC,oCAAoC,GAAG,OAAO,CAAC,CAAC;QAC9D,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;QACvD,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC;IACvC,CAAC;IACD,KAAK,CAAC,gBAAgB;QACpB,OAAO,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;QACjD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAChC,CAAC;CACF","sourcesContent":["import { WebPlugin } from \"@capacitor/core\";\n\nimport type { NativePurchasesPlugin, Product } from \"./definitions\";\n\nexport class NativePurchasesWeb\n extends WebPlugin\n implements NativePurchasesPlugin\n{\n async restorePurchases(): Promise<void> {\n console.error(\"restorePurchases only mocked in web\");\n }\n\n async getProducts(options: {\n productIdentifiers: string[];\n }): Promise<{ products: Product[] }> {\n console.error(\"getProducts only mocked in web \" + options);\n return { products: [] };\n }\n\n async getProduct(options: {\n productIdentifier: string;\n }): Promise<{ product: Product }> {\n console.error(\"getProduct only mocked in web \" + options);\n return { product: {} as any };\n }\n\n async purchaseProduct(options: {\n productIdentifier: string;\n planIdentifier: string;\n quantity: number;\n }): Promise<{ transactionId: string }> {\n console.error(\"purchaseProduct only mocked in web\" + options);\n return { transactionId: \"transactionId\" };\n }\n\n async isBillingSupported(): Promise<{ isBillingSupported: boolean }> {\n console.error(\"isBillingSupported only mocked in web\");\n return { isBillingSupported: false };\n }\n async getPluginVersion(): Promise<{ version: string }> {\n console.warn(\"Cannot get plugin version in web\");\n return { version: \"default\" };\n }\n}\n"]}
@@ -134,22 +134,9 @@ const NativePurchases = core.registerPlugin("NativePurchases", {
134
134
  web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.NativePurchasesWeb()),
135
135
  });
136
136
 
137
- const mockCustomerInfo = {
138
- activeSubscriptions: [""],
139
- allPurchasedProductIdentifiers: [""],
140
- nonSubscriptionTransactions: [],
141
- latestExpirationDate: null,
142
- firstSeen: "2020-01-01T00:00:00.000Z",
143
- originalAppUserId: "",
144
- requestDate: "2020-01-01T00:00:00.000Z",
145
- originalApplicationVersion: "",
146
- originalPurchaseDate: null,
147
- managementURL: null,
148
- };
149
137
  class NativePurchasesWeb extends core.WebPlugin {
150
138
  async restorePurchases() {
151
- console.error("purchasePackage only mocked in web");
152
- return { customerInfo: mockCustomerInfo };
139
+ console.error("restorePurchases only mocked in web");
153
140
  }
154
141
  async getProducts(options) {
155
142
  console.error("getProducts only mocked in web " + options);
@@ -175,8 +162,7 @@ class NativePurchasesWeb extends core.WebPlugin {
175
162
 
176
163
  var web = /*#__PURE__*/Object.freeze({
177
164
  __proto__: null,
178
- NativePurchasesWeb: NativePurchasesWeb,
179
- mockCustomerInfo: mockCustomerInfo
165
+ NativePurchasesWeb: NativePurchasesWeb
180
166
  });
181
167
 
182
168
  exports.NativePurchases = NativePurchases;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var ATTRIBUTION_NETWORK;\n(function (ATTRIBUTION_NETWORK) {\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPLE_SEARCH_ADS\"] = 0] = \"APPLE_SEARCH_ADS\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"ADJUST\"] = 1] = \"ADJUST\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPSFLYER\"] = 2] = \"APPSFLYER\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"BRANCH\"] = 3] = \"BRANCH\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"TENJIN\"] = 4] = \"TENJIN\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"FACEBOOK\"] = 5] = \"FACEBOOK\";\n})(ATTRIBUTION_NETWORK || (ATTRIBUTION_NETWORK = {}));\nexport var PURCHASE_TYPE;\n(function (PURCHASE_TYPE) {\n /**\n * A type of SKU for in-app products.\n */\n PURCHASE_TYPE[\"INAPP\"] = \"inapp\";\n /**\n * A type of SKU for subscriptions.\n */\n PURCHASE_TYPE[\"SUBS\"] = \"subs\";\n})(PURCHASE_TYPE || (PURCHASE_TYPE = {}));\n/**\n * Enum for billing features.\n * Currently, these are only relevant for Google Play Android users:\n * https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType\n */\nexport var BILLING_FEATURE;\n(function (BILLING_FEATURE) {\n /**\n * Purchase/query for subscriptions.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS\"] = 0] = \"SUBSCRIPTIONS\";\n /**\n * Subscriptions update/replace.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_UPDATE\"] = 1] = \"SUBSCRIPTIONS_UPDATE\";\n /**\n * Purchase/query for in-app items on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"IN_APP_ITEMS_ON_VR\"] = 2] = \"IN_APP_ITEMS_ON_VR\";\n /**\n * Purchase/query for subscriptions on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_ON_VR\"] = 3] = \"SUBSCRIPTIONS_ON_VR\";\n /**\n * Launch a price change confirmation flow.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"PRICE_CHANGE_CONFIRMATION\"] = 4] = \"PRICE_CHANGE_CONFIRMATION\";\n})(BILLING_FEATURE || (BILLING_FEATURE = {}));\nexport var PRORATION_MODE;\n(function (PRORATION_MODE) {\n PRORATION_MODE[PRORATION_MODE[\"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\"] = 0] = \"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\";\n /**\n * Replacement takes effect immediately, and the remaining time will be\n * prorated and credited to the user. This is the current default behavior.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITH_TIME_PRORATION\"] = 1] = \"IMMEDIATE_WITH_TIME_PRORATION\";\n /**\n * Replacement takes effect immediately, and the billing cycle remains the\n * same. The price for the remaining period will be charged. This option is\n * only available for subscription upgrade.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\"] = 2] = \"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\";\n /**\n * Replacement takes effect immediately, and the new price will be charged on\n * next recurrence time. The billing cycle stays the same.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITHOUT_PRORATION\"] = 3] = \"IMMEDIATE_WITHOUT_PRORATION\";\n /**\n * Replacement takes effect when the old plan expires, and the new price will\n * be charged at the same time.\n */\n PRORATION_MODE[PRORATION_MODE[\"DEFERRED\"] = 4] = \"DEFERRED\";\n})(PRORATION_MODE || (PRORATION_MODE = {}));\nexport var PACKAGE_TYPE;\n(function (PACKAGE_TYPE) {\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"UNKNOWN\"] = \"UNKNOWN\";\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"CUSTOM\"] = \"CUSTOM\";\n /**\n * A package configured with the predefined lifetime identifier.\n */\n PACKAGE_TYPE[\"LIFETIME\"] = \"LIFETIME\";\n /**\n * A package configured with the predefined annual identifier.\n */\n PACKAGE_TYPE[\"ANNUAL\"] = \"ANNUAL\";\n /**\n * A package configured with the predefined six month identifier.\n */\n PACKAGE_TYPE[\"SIX_MONTH\"] = \"SIX_MONTH\";\n /**\n * A package configured with the predefined three month identifier.\n */\n PACKAGE_TYPE[\"THREE_MONTH\"] = \"THREE_MONTH\";\n /**\n * A package configured with the predefined two month identifier.\n */\n PACKAGE_TYPE[\"TWO_MONTH\"] = \"TWO_MONTH\";\n /**\n * A package configured with the predefined monthly identifier.\n */\n PACKAGE_TYPE[\"MONTHLY\"] = \"MONTHLY\";\n /**\n * A package configured with the predefined weekly identifier.\n */\n PACKAGE_TYPE[\"WEEKLY\"] = \"WEEKLY\";\n})(PACKAGE_TYPE || (PACKAGE_TYPE = {}));\nexport var INTRO_ELIGIBILITY_STATUS;\n(function (INTRO_ELIGIBILITY_STATUS) {\n /**\n * RevenueCat doesn't have enough information to determine eligibility.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_UNKNOWN\"] = 0] = \"INTRO_ELIGIBILITY_STATUS_UNKNOWN\";\n /**\n * The user is not eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\"] = 1] = \"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\";\n /**\n * The user is eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\"] = 2] = \"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\";\n})(INTRO_ELIGIBILITY_STATUS || (INTRO_ELIGIBILITY_STATUS = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from \"@capacitor/core\";\nconst NativePurchases = registerPlugin(\"NativePurchases\", {\n web: () => import(\"./web\").then((m) => new m.NativePurchasesWeb()),\n});\nexport * from \"./definitions\";\nexport { NativePurchases };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from \"@capacitor/core\";\nexport const mockCustomerInfo = {\n activeSubscriptions: [\"\"],\n allPurchasedProductIdentifiers: [\"\"],\n nonSubscriptionTransactions: [],\n latestExpirationDate: null,\n firstSeen: \"2020-01-01T00:00:00.000Z\",\n originalAppUserId: \"\",\n requestDate: \"2020-01-01T00:00:00.000Z\",\n originalApplicationVersion: \"\",\n originalPurchaseDate: null,\n managementURL: null,\n};\nexport class NativePurchasesWeb extends WebPlugin {\n async restorePurchases() {\n console.error(\"purchasePackage only mocked in web\");\n return { customerInfo: mockCustomerInfo };\n }\n async getProducts(options) {\n console.error(\"getProducts only mocked in web \" + options);\n return { products: [] };\n }\n async getProduct(options) {\n console.error(\"getProduct only mocked in web \" + options);\n return { product: {} };\n }\n async purchaseProduct(options) {\n console.error(\"purchaseProduct only mocked in web\" + options);\n return { transactionId: \"transactionId\" };\n }\n async isBillingSupported() {\n console.error(\"isBillingSupported only mocked in web\");\n return { isBillingSupported: false };\n }\n async getPluginVersion() {\n console.warn(\"Cannot get plugin version in web\");\n return { version: \"default\" };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ATTRIBUTION_NETWORK","PURCHASE_TYPE","BILLING_FEATURE","PRORATION_MODE","PACKAGE_TYPE","INTRO_ELIGIBILITY_STATUS","registerPlugin","WebPlugin"],"mappings":";;;;AAAWA;AACX,CAAC,UAAU,mBAAmB,EAAE;AAChC,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,GAAG,kBAAkB;AACzF,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;AACrE,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,WAAW;AAC3E,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;AACrE,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;AACrE,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,UAAU,CAAC,GAAG,CAA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IAAI,MAAM,eAAe,CAAC,OAAO,EAAE;AACnC,QAAQ,OAAO,CAAC,KAAK,CAAC,oCAAoC,GAAG,OAAO,CAAC;AACrE,QAAQ,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE;AACjD;AACA,IAAI,MAAM,kBAAkB,GAAG;AAC/B,QAAQ,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC;AAC9D,QAAQ,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE;AAC5C;AACA,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,CAAC,IAAI,CAAC,kCAAkC,CAAC;AACxD,QAAQ,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE;AACrC;AACA;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var ATTRIBUTION_NETWORK;\n(function (ATTRIBUTION_NETWORK) {\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPLE_SEARCH_ADS\"] = 0] = \"APPLE_SEARCH_ADS\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"ADJUST\"] = 1] = \"ADJUST\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPSFLYER\"] = 2] = \"APPSFLYER\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"BRANCH\"] = 3] = \"BRANCH\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"TENJIN\"] = 4] = \"TENJIN\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"FACEBOOK\"] = 5] = \"FACEBOOK\";\n})(ATTRIBUTION_NETWORK || (ATTRIBUTION_NETWORK = {}));\nexport var PURCHASE_TYPE;\n(function (PURCHASE_TYPE) {\n /**\n * A type of SKU for in-app products.\n */\n PURCHASE_TYPE[\"INAPP\"] = \"inapp\";\n /**\n * A type of SKU for subscriptions.\n */\n PURCHASE_TYPE[\"SUBS\"] = \"subs\";\n})(PURCHASE_TYPE || (PURCHASE_TYPE = {}));\n/**\n * Enum for billing features.\n * Currently, these are only relevant for Google Play Android users:\n * https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType\n */\nexport var BILLING_FEATURE;\n(function (BILLING_FEATURE) {\n /**\n * Purchase/query for subscriptions.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS\"] = 0] = \"SUBSCRIPTIONS\";\n /**\n * Subscriptions update/replace.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_UPDATE\"] = 1] = \"SUBSCRIPTIONS_UPDATE\";\n /**\n * Purchase/query for in-app items on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"IN_APP_ITEMS_ON_VR\"] = 2] = \"IN_APP_ITEMS_ON_VR\";\n /**\n * Purchase/query for subscriptions on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_ON_VR\"] = 3] = \"SUBSCRIPTIONS_ON_VR\";\n /**\n * Launch a price change confirmation flow.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"PRICE_CHANGE_CONFIRMATION\"] = 4] = \"PRICE_CHANGE_CONFIRMATION\";\n})(BILLING_FEATURE || (BILLING_FEATURE = {}));\nexport var PRORATION_MODE;\n(function (PRORATION_MODE) {\n PRORATION_MODE[PRORATION_MODE[\"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\"] = 0] = \"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\";\n /**\n * Replacement takes effect immediately, and the remaining time will be\n * prorated and credited to the user. This is the current default behavior.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITH_TIME_PRORATION\"] = 1] = \"IMMEDIATE_WITH_TIME_PRORATION\";\n /**\n * Replacement takes effect immediately, and the billing cycle remains the\n * same. The price for the remaining period will be charged. This option is\n * only available for subscription upgrade.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\"] = 2] = \"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\";\n /**\n * Replacement takes effect immediately, and the new price will be charged on\n * next recurrence time. The billing cycle stays the same.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITHOUT_PRORATION\"] = 3] = \"IMMEDIATE_WITHOUT_PRORATION\";\n /**\n * Replacement takes effect when the old plan expires, and the new price will\n * be charged at the same time.\n */\n PRORATION_MODE[PRORATION_MODE[\"DEFERRED\"] = 4] = \"DEFERRED\";\n})(PRORATION_MODE || (PRORATION_MODE = {}));\nexport var PACKAGE_TYPE;\n(function (PACKAGE_TYPE) {\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"UNKNOWN\"] = \"UNKNOWN\";\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"CUSTOM\"] = \"CUSTOM\";\n /**\n * A package configured with the predefined lifetime identifier.\n */\n PACKAGE_TYPE[\"LIFETIME\"] = \"LIFETIME\";\n /**\n * A package configured with the predefined annual identifier.\n */\n PACKAGE_TYPE[\"ANNUAL\"] = \"ANNUAL\";\n /**\n * A package configured with the predefined six month identifier.\n */\n PACKAGE_TYPE[\"SIX_MONTH\"] = \"SIX_MONTH\";\n /**\n * A package configured with the predefined three month identifier.\n */\n PACKAGE_TYPE[\"THREE_MONTH\"] = \"THREE_MONTH\";\n /**\n * A package configured with the predefined two month identifier.\n */\n PACKAGE_TYPE[\"TWO_MONTH\"] = \"TWO_MONTH\";\n /**\n * A package configured with the predefined monthly identifier.\n */\n PACKAGE_TYPE[\"MONTHLY\"] = \"MONTHLY\";\n /**\n * A package configured with the predefined weekly identifier.\n */\n PACKAGE_TYPE[\"WEEKLY\"] = \"WEEKLY\";\n})(PACKAGE_TYPE || (PACKAGE_TYPE = {}));\nexport var INTRO_ELIGIBILITY_STATUS;\n(function (INTRO_ELIGIBILITY_STATUS) {\n /**\n * RevenueCat doesn't have enough information to determine eligibility.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_UNKNOWN\"] = 0] = \"INTRO_ELIGIBILITY_STATUS_UNKNOWN\";\n /**\n * The user is not eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\"] = 1] = \"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\";\n /**\n * The user is eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\"] = 2] = \"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\";\n})(INTRO_ELIGIBILITY_STATUS || (INTRO_ELIGIBILITY_STATUS = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from \"@capacitor/core\";\nconst NativePurchases = registerPlugin(\"NativePurchases\", {\n web: () => import(\"./web\").then((m) => new m.NativePurchasesWeb()),\n});\nexport * from \"./definitions\";\nexport { NativePurchases };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from \"@capacitor/core\";\nexport class NativePurchasesWeb extends WebPlugin {\n async restorePurchases() {\n console.error(\"restorePurchases only mocked in web\");\n }\n async getProducts(options) {\n console.error(\"getProducts only mocked in web \" + options);\n return { products: [] };\n }\n async getProduct(options) {\n console.error(\"getProduct only mocked in web \" + options);\n return { product: {} };\n }\n async purchaseProduct(options) {\n console.error(\"purchaseProduct only mocked in web\" + options);\n return { transactionId: \"transactionId\" };\n }\n async isBillingSupported() {\n console.error(\"isBillingSupported only mocked in web\");\n return { isBillingSupported: false };\n }\n async getPluginVersion() {\n console.warn(\"Cannot get plugin version in web\");\n return { version: \"default\" };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ATTRIBUTION_NETWORK","PURCHASE_TYPE","BILLING_FEATURE","PRORATION_MODE","PACK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M,UAAU,CAAC,OAAO,EAAE;AAC9B,QAAQ,OAAO,CAAC,KAAK,CAAC,gCAAgC,GAAG,OAAO,CAAC;AACjE,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;AAC9B;AACA,IAAI,MAAM,eAAe,CAAC,OAAO,EAAE;AACnC,QAAQ,OAAO,CAAC,KAAK,CAAC,oCAAoC,GAAG,OAAO,CAAC;AACrE,QAAQ,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE;AACjD;AACA,IAAI,MAAM,kBAAkB,GAAG;AAC/B,QAAQ,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC;AAC9D,QAAQ,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE;AAC5C;AACA,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,CAAC,IAAI,CAAC,kCAAkC,CAAC;AACxD,QAAQ,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE;AACrC;AACA;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -133,22 +133,9 @@ var capacitorNativePurchases = (function (exports, core) {
133
133
  web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.NativePurchasesWeb()),
134
134
  });
135
135
 
136
- const mockCustomerInfo = {
137
- activeSubscriptions: [""],
138
- allPurchasedProductIdentifiers: [""],
139
- nonSubscriptionTransactions: [],
140
- latestExpirationDate: null,
141
- firstSeen: "2020-01-01T00:00:00.000Z",
142
- originalAppUserId: "",
143
- requestDate: "2020-01-01T00:00:00.000Z",
144
- originalApplicationVersion: "",
145
- originalPurchaseDate: null,
146
- managementURL: null,
147
- };
148
136
  class NativePurchasesWeb extends core.WebPlugin {
149
137
  async restorePurchases() {
150
- console.error("purchasePackage only mocked in web");
151
- return { customerInfo: mockCustomerInfo };
138
+ console.error("restorePurchases only mocked in web");
152
139
  }
153
140
  async getProducts(options) {
154
141
  console.error("getProducts only mocked in web " + options);
@@ -174,8 +161,7 @@ var capacitorNativePurchases = (function (exports, core) {
174
161
 
175
162
  var web = /*#__PURE__*/Object.freeze({
176
163
  __proto__: null,
177
- NativePurchasesWeb: NativePurchasesWeb,
178
- mockCustomerInfo: mockCustomerInfo
164
+ NativePurchasesWeb: NativePurchasesWeb
179
165
  });
180
166
 
181
167
  exports.NativePurchases = NativePurchases;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var ATTRIBUTION_NETWORK;\n(function (ATTRIBUTION_NETWORK) {\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPLE_SEARCH_ADS\"] = 0] = \"APPLE_SEARCH_ADS\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"ADJUST\"] = 1] = \"ADJUST\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPSFLYER\"] = 2] = \"APPSFLYER\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"BRANCH\"] = 3] = \"BRANCH\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"TENJIN\"] = 4] = \"TENJIN\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"FACEBOOK\"] = 5] = \"FACEBOOK\";\n})(ATTRIBUTION_NETWORK || (ATTRIBUTION_NETWORK = {}));\nexport var PURCHASE_TYPE;\n(function (PURCHASE_TYPE) {\n /**\n * A type of SKU for in-app products.\n */\n PURCHASE_TYPE[\"INAPP\"] = \"inapp\";\n /**\n * A type of SKU for subscriptions.\n */\n PURCHASE_TYPE[\"SUBS\"] = \"subs\";\n})(PURCHASE_TYPE || (PURCHASE_TYPE = {}));\n/**\n * Enum for billing features.\n * Currently, these are only relevant for Google Play Android users:\n * https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType\n */\nexport var BILLING_FEATURE;\n(function (BILLING_FEATURE) {\n /**\n * Purchase/query for subscriptions.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS\"] = 0] = \"SUBSCRIPTIONS\";\n /**\n * Subscriptions update/replace.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_UPDATE\"] = 1] = \"SUBSCRIPTIONS_UPDATE\";\n /**\n * Purchase/query for in-app items on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"IN_APP_ITEMS_ON_VR\"] = 2] = \"IN_APP_ITEMS_ON_VR\";\n /**\n * Purchase/query for subscriptions on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_ON_VR\"] = 3] = \"SUBSCRIPTIONS_ON_VR\";\n /**\n * Launch a price change confirmation flow.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"PRICE_CHANGE_CONFIRMATION\"] = 4] = \"PRICE_CHANGE_CONFIRMATION\";\n})(BILLING_FEATURE || (BILLING_FEATURE = {}));\nexport var PRORATION_MODE;\n(function (PRORATION_MODE) {\n PRORATION_MODE[PRORATION_MODE[\"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\"] = 0] = \"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\";\n /**\n * Replacement takes effect immediately, and the remaining time will be\n * prorated and credited to the user. This is the current default behavior.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITH_TIME_PRORATION\"] = 1] = \"IMMEDIATE_WITH_TIME_PRORATION\";\n /**\n * Replacement takes effect immediately, and the billing cycle remains the\n * same. The price for the remaining period will be charged. This option is\n * only available for subscription upgrade.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\"] = 2] = \"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\";\n /**\n * Replacement takes effect immediately, and the new price will be charged on\n * next recurrence time. The billing cycle stays the same.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITHOUT_PRORATION\"] = 3] = \"IMMEDIATE_WITHOUT_PRORATION\";\n /**\n * Replacement takes effect when the old plan expires, and the new price will\n * be charged at the same time.\n */\n PRORATION_MODE[PRORATION_MODE[\"DEFERRED\"] = 4] = \"DEFERRED\";\n})(PRORATION_MODE || (PRORATION_MODE = {}));\nexport var PACKAGE_TYPE;\n(function (PACKAGE_TYPE) {\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"UNKNOWN\"] = \"UNKNOWN\";\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"CUSTOM\"] = \"CUSTOM\";\n /**\n * A package configured with the predefined lifetime identifier.\n */\n PACKAGE_TYPE[\"LIFETIME\"] = \"LIFETIME\";\n /**\n * A package configured with the predefined annual identifier.\n */\n PACKAGE_TYPE[\"ANNUAL\"] = \"ANNUAL\";\n /**\n * A package configured with the predefined six month identifier.\n */\n PACKAGE_TYPE[\"SIX_MONTH\"] = \"SIX_MONTH\";\n /**\n * A package configured with the predefined three month identifier.\n */\n PACKAGE_TYPE[\"THREE_MONTH\"] = \"THREE_MONTH\";\n /**\n * A package configured with the predefined two month identifier.\n */\n PACKAGE_TYPE[\"TWO_MONTH\"] = \"TWO_MONTH\";\n /**\n * A package configured with the predefined monthly identifier.\n */\n PACKAGE_TYPE[\"MONTHLY\"] = \"MONTHLY\";\n /**\n * A package configured with the predefined weekly identifier.\n */\n PACKAGE_TYPE[\"WEEKLY\"] = \"WEEKLY\";\n})(PACKAGE_TYPE || (PACKAGE_TYPE = {}));\nexport var INTRO_ELIGIBILITY_STATUS;\n(function (INTRO_ELIGIBILITY_STATUS) {\n /**\n * RevenueCat doesn't have enough information to determine eligibility.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_UNKNOWN\"] = 0] = \"INTRO_ELIGIBILITY_STATUS_UNKNOWN\";\n /**\n * The user is not eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\"] = 1] = \"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\";\n /**\n * The user is eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\"] = 2] = \"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\";\n})(INTRO_ELIGIBILITY_STATUS || (INTRO_ELIGIBILITY_STATUS = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from \"@capacitor/core\";\nconst NativePurchases = registerPlugin(\"NativePurchases\", {\n web: () => import(\"./web\").then((m) => new m.NativePurchasesWeb()),\n});\nexport * from \"./definitions\";\nexport { NativePurchases };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from \"@capacitor/core\";\nexport const mockCustomerInfo = {\n activeSubscriptions: [\"\"],\n allPurchasedProductIdentifiers: [\"\"],\n nonSubscriptionTransactions: [],\n latestExpirationDate: null,\n firstSeen: \"2020-01-01T00:00:00.000Z\",\n originalAppUserId: \"\",\n requestDate: \"2020-01-01T00:00:00.000Z\",\n originalApplicationVersion: \"\",\n originalPurchaseDate: null,\n managementURL: null,\n};\nexport class NativePurchasesWeb extends WebPlugin {\n async restorePurchases() {\n console.error(\"purchasePackage only mocked in web\");\n return { customerInfo: mockCustomerInfo };\n }\n async getProducts(options) {\n console.error(\"getProducts only mocked in web \" + options);\n return { products: [] };\n }\n async getProduct(options) {\n console.error(\"getProduct only mocked in web \" + options);\n return { product: {} };\n }\n async purchaseProduct(options) {\n console.error(\"purchaseProduct only mocked in web\" + options);\n return { transactionId: \"transactionId\" };\n }\n async isBillingSupported() {\n console.error(\"isBillingSupported only mocked in web\");\n return { isBillingSupported: false };\n }\n async getPluginVersion() {\n console.warn(\"Cannot get plugin version in web\");\n return { version: \"default\" };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ATTRIBUTION_NETWORK","PURCHASE_TYPE","BILLING_FEATURE","PRORATION_MODE","PACKAGE_TY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 0] = \"APPLE_SEARCH_ADS\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"ADJUST\"] = 1] = \"ADJUST\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPSFLYER\"] = 2] = \"APPSFLYER\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"BRANCH\"] = 3] = \"BRANCH\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"TENJIN\"] = 4] = \"TENJIN\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"FACEBOOK\"] = 5] = \"FACEBOOK\";\n})(ATTRIBUTION_NETWORK || (ATTRIBUTION_NETWORK = {}));\nexport var PURCHASE_TYPE;\n(function (PURCHASE_TYPE) {\n /**\n * A type of SKU for in-app products.\n */\n PURCHASE_TYPE[\"INAPP\"] = \"inapp\";\n /**\n * A type of SKU for subscriptions.\n */\n PURCHASE_TYPE[\"SUBS\"] = \"subs\";\n})(PURCHASE_TYPE || (PURCHASE_TYPE = {}));\n/**\n * Enum for billing features.\n * Currently, these are only relevant for Google Play Android users:\n * https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType\n */\nexport var BILLING_FEATURE;\n(function (BILLING_FEATURE) {\n /**\n * Purchase/query for subscriptions.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS\"] = 0] = \"SUBSCRIPTIONS\";\n /**\n * Subscriptions update/replace.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_UPDATE\"] = 1] = \"SUBSCRIPTIONS_UPDATE\";\n /**\n * Purchase/query for in-app items on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"IN_APP_ITEMS_ON_VR\"] = 2] = \"IN_APP_ITEMS_ON_VR\";\n /**\n * Purchase/query for subscriptions on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_ON_VR\"] = 3] = \"SUBSCRIPTIONS_ON_VR\";\n /**\n * Launch a price change confirmation flow.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"PRICE_CHANGE_CONFIRMATION\"] = 4] = \"PRICE_CHANGE_CONFIRMATION\";\n})(BILLING_FEATURE || (BILLING_FEATURE = {}));\nexport var PRORATION_MODE;\n(function (PRORATION_MODE) {\n PRORATION_MODE[PRORATION_MODE[\"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\"] = 0] = \"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\";\n /**\n * Replacement takes effect immediately, and the remaining time will be\n * prorated and credited to the user. This is the current default behavior.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITH_TIME_PRORATION\"] = 1] = \"IMMEDIATE_WITH_TIME_PRORATION\";\n /**\n * Replacement takes effect immediately, and the billing cycle remains the\n * same. The price for the remaining period will be charged. This option is\n * only available for subscription upgrade.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\"] = 2] = \"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\";\n /**\n * Replacement takes effect immediately, and the new price will be charged on\n * next recurrence time. The billing cycle stays the same.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITHOUT_PRORATION\"] = 3] = \"IMMEDIATE_WITHOUT_PRORATION\";\n /**\n * Replacement takes effect when the old plan expires, and the new price will\n * be charged at the same time.\n */\n PRORATION_MODE[PRORATION_MODE[\"DEFERRED\"] = 4] = \"DEFERRED\";\n})(PRORATION_MODE || (PRORATION_MODE = {}));\nexport var PACKAGE_TYPE;\n(function (PACKAGE_TYPE) {\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"UNKNOWN\"] = \"UNKNOWN\";\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"CUSTOM\"] = \"CUSTOM\";\n /**\n * A package configured with the predefined lifetime identifier.\n */\n PACKAGE_TYPE[\"LIFETIME\"] = \"LIFETIME\";\n /**\n * A package configured with the predefined annual identifier.\n */\n PACKAGE_TYPE[\"ANNUAL\"] = \"ANNUAL\";\n /**\n * A package configured with the predefined six month identifier.\n */\n PACKAGE_TYPE[\"SIX_MONTH\"] = \"SIX_MONTH\";\n /**\n * A package configured with the predefined three month identifier.\n */\n PACKAGE_TYPE[\"THREE_MONTH\"] = \"THREE_MONTH\";\n /**\n * A package configured with the predefined two month identifier.\n */\n PACKAGE_TYPE[\"TWO_MONTH\"] = \"TWO_MONTH\";\n /**\n * A package configured with the predefined monthly identifier.\n */\n PACKAGE_TYPE[\"MONTHLY\"] = \"MONTHLY\";\n /**\n * A package configured with the predefined weekly identifier.\n */\n PACKAGE_TYPE[\"WEEKLY\"] = \"WEEKLY\";\n})(PACKAGE_TYPE || (PACKAGE_TYPE = {}));\nexport var INTRO_ELIGIBILITY_STATUS;\n(function (INTRO_ELIGIBILITY_STATUS) {\n /**\n * RevenueCat doesn't have enough information to determine eligibility.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_UNKNOWN\"] = 0] = \"INTRO_ELIGIBILITY_STATUS_UNKNOWN\";\n /**\n * The user is not eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\"] = 1] = \"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\";\n /**\n * The user is eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\"] = 2] = \"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\";\n})(INTRO_ELIGIBILITY_STATUS || (INTRO_ELIGIBILITY_STATUS = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from \"@capacitor/core\";\nconst NativePurchases = registerPlugin(\"NativePurchases\", {\n web: () => import(\"./web\").then((m) => new m.NativePurchasesWeb()),\n});\nexport * from \"./definitions\";\nexport { NativePurchases };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from \"@capacitor/core\";\nexport class NativePurchasesWeb extends WebPlugin {\n async restorePurchases() {\n console.error(\"restorePurchases only mocked in web\");\n }\n async getProducts(options) {\n console.error(\"getProducts only mocked in web \" + options);\n return { products: [] };\n }\n async getProduct(options) {\n console.error(\"getProduct only mocked in web \" + options);\n return { product: {} };\n }\n async purchaseProduct(options) {\n console.error(\"purchaseProduct only mocked in web\" + options);\n return { transactionId: \"transactionId\" };\n }\n async isBillingSupported() {\n console.error(\"isBillingSupported only mocked in web\");\n return { isBillingSupported: false };\n }\n async getPluginVersion() {\n console.warn(\"Cannot get plugin version in web\");\n return { version: \"default\" };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ATTRIBUTION_NETWORK","PURCHASE_TYPE","BILLING_FEATURE","PRORATION_MODE","PACKAGE_TYPE","INTRO_ELIGIBILITY_STATUS","registerPlugin","WebPlugin"],"mappings":";;;AAAWA;IACX,CAAC,UAAU,mBAAmB,EAAE;IAChC,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,GAAG,kBAAkB;IACzF,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;IACrE,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,WAAW;IAC3E,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;IACrE,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;IACrE,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;IACzE,CAAC,EAAEA,2BAAmB,KAAK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
8
  */
9
9
  @objc(NativePurchasesPlugin)
10
10
  public class NativePurchasesPlugin: CAPPlugin {
11
+ public let identifier = "NativePurchasesPlugin"
12
+ public let jsName = "NativePurchases"
13
+ public let pluginMethods: [CAPPluginMethod] = [
14
+ CAPPluginMethod(name: "isBillingSupported", returnType: CAPPluginReturnPromise),
15
+ CAPPluginMethod(name: "purchaseProduct", returnType: CAPPluginReturnPromise),
16
+ CAPPluginMethod(name: "restorePurchases", returnType: CAPPluginReturnPromise),
17
+ CAPPluginMethod(name: "getProducts", returnType: CAPPluginReturnPromise),
18
+ CAPPluginMethod(name: "getProduct", returnType: CAPPluginReturnPromise),
19
+ CAPPluginMethod(name: "getPluginVersion", returnType: CAPPluginReturnPromise)
20
+ ]
11
21
 
12
22
  private let PLUGIN_VERSION = "0.0.25"
13
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/native-purchases",
3
- "version": "6.0.41",
3
+ "version": "7.1.7",
4
4
  "description": "In-app Subscriptions Made Easy",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -44,23 +44,27 @@
44
44
  "prepublishOnly": "npm run build"
45
45
  },
46
46
  "devDependencies": {
47
- "@capacitor/android": "^6.0.0",
48
- "@capacitor/core": "^6.0.0",
47
+ "@capacitor/android": "^7.0.0",
48
+ "@capacitor/cli": "^7.0.0",
49
+ "@capacitor/core": "^7.0.0",
49
50
  "@capacitor/docgen": "^0.3.0",
50
- "@capacitor/ios": "^6.0.0",
51
+ "@capacitor/ios": "^7.0.0",
51
52
  "@ionic/eslint-config": "^0.4.0",
52
53
  "@ionic/prettier-config": "^4.0.0",
53
54
  "@ionic/swiftlint-config": "^2.0.0",
55
+ "@types/node": "^22.13.1",
54
56
  "eslint": "^8.57.0",
55
- "prettier": "~3.4.0",
56
- "prettier-plugin-java": "~2.6.4",
57
+ "eslint-plugin-import": "^2.31.0",
58
+ "husky": "^9.1.7",
59
+ "prettier": "^3.4.2",
60
+ "prettier-plugin-java": "^2.6.7",
57
61
  "rimraf": "^6.0.1",
58
- "rollup": "^4.22.4",
62
+ "rollup": "^4.34.6",
59
63
  "swiftlint": "^2.0.0",
60
- "typescript": "~4.9.0"
64
+ "typescript": "^5.7.3"
61
65
  },
62
66
  "peerDependencies": {
63
- "@capacitor/core": "^6.0.0"
67
+ "@capacitor/core": ">=7.0.0"
64
68
  },
65
69
  "prettier": "@ionic/prettier-config",
66
70
  "swiftlint": "@ionic/swiftlint-config",
@@ -74,6 +78,5 @@
74
78
  "android": {
75
79
  "src": "android"
76
80
  }
77
- },
78
- "packageManager": "pnpm@9.15.2+sha512.93e57b0126f0df74ce6bff29680394c0ba54ec47246b9cf321f0121d8d9bb03f750a705f24edc3c1180853afd7c2c3b94196d0a3d53d3e069d9e2793ef11f321"
81
+ }
79
82
  }
@@ -1,10 +0,0 @@
1
- #import <UIKit/UIKit.h>
2
-
3
- //! Project version number for Plugin.
4
- FOUNDATION_EXPORT double PluginVersionNumber;
5
-
6
- //! Project version string for Plugin.
7
- FOUNDATION_EXPORT const unsigned char PluginVersionString[];
8
-
9
- // In this header, you should import all the public headers of your framework using statements like #import <Plugin/PublicHeader.h>
10
-
@@ -1,12 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import <Capacitor/Capacitor.h>
3
-
4
- // Define the plugin using the CAP_PLUGIN Macro, and
5
- // each method the plugin supports using the CAP_PLUGIN_METHOD macro.
6
- CAP_PLUGIN(NativePurchasesPlugin, "NativePurchases",
7
- CAP_PLUGIN_METHOD(getProducts, CAPPluginReturnPromise);
8
- CAP_PLUGIN_METHOD(purchaseProduct, CAPPluginReturnPromise);
9
- CAP_PLUGIN_METHOD(restorePurchases, CAPPluginReturnPromise);
10
- CAP_PLUGIN_METHOD(isBillingSupported, CAPPluginReturnPromise);
11
- CAP_PLUGIN_METHOD(getPluginVersion, CAPPluginReturnPromise);
12
- )