expo-iap 3.3.0-rc.4 → 3.3.1

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 (31) hide show
  1. package/README.md +1 -1
  2. package/coverage/clover.xml +7 -7
  3. package/coverage/coverage-final.json +5 -5
  4. package/coverage/lcov-report/block-navigation.js +1 -1
  5. package/coverage/lcov-report/index.html +1 -1
  6. package/coverage/lcov-report/sorter.js +21 -7
  7. package/coverage/lcov-report/src/index.html +1 -1
  8. package/coverage/lcov-report/src/index.ts.html +1 -1
  9. package/coverage/lcov-report/src/modules/android.ts.html +1 -1
  10. package/coverage/lcov-report/src/modules/index.html +1 -1
  11. package/coverage/lcov-report/src/modules/ios.ts.html +1 -1
  12. package/coverage/lcov-report/src/utils/debug.ts.html +1 -1
  13. package/coverage/lcov-report/src/utils/errorMapping.ts.html +1 -1
  14. package/coverage/lcov-report/src/utils/index.html +1 -1
  15. package/ios/ExpoIapModule.swift +24 -0
  16. package/openiap-versions.json +2 -2
  17. package/package.json +1 -1
  18. package/plugin/tsconfig.tsbuildinfo +1 -1
  19. package/scripts/update-types.mjs +44 -6
  20. package/coverage/lcov-report/src/ExpoIap.types.ts.html +0 -1396
  21. package/coverage/lcov-report/src/helpers/index.html +0 -116
  22. package/coverage/lcov-report/src/helpers/subscription.ts.html +0 -499
  23. package/coverage/lcov-report/src/onside/ExpoOnsideMarketplaceAvailabilityModule.ts.html +0 -145
  24. package/coverage/lcov-report/src/onside/index.html +0 -131
  25. package/coverage/lcov-report/src/onside/index.ts.html +0 -253
  26. package/coverage/lcov-report/src/types/ExpoIapAndroid.types.ts.html +0 -502
  27. package/coverage/lcov-report/src/types/index.html +0 -116
  28. package/coverage/lcov-report/src/useIAP.ts.html +0 -1654
  29. package/coverage/lcov-report/src/utils/constants.ts.html +0 -127
  30. package/ios/expoiap.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  31. package/ios/expoiap.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
@@ -9,7 +9,7 @@ var jumpToCode = (function init() {
9
9
  // We don't want to select elements that are direct descendants of another match
10
10
  var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
11
11
 
12
- // Selecter that finds elements on the page to which we can jump
12
+ // Selector that finds elements on the page to which we can jump
13
13
  var selector =
14
14
  fileListingElements.join(', ') +
15
15
  ', ' +
@@ -131,7 +131,7 @@
131
131
  <div class='footer quiet pad2 space-top1 center small'>
132
132
  Code coverage generated by
133
133
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
134
- at 2025-12-13T21:44:43.478Z
134
+ at 2025-12-17T14:21:12.653Z
135
135
  </div>
136
136
  <script src="prettify.js"></script>
137
137
  <script>
@@ -27,17 +27,31 @@ var addSorting = (function() {
27
27
  function onFilterInput() {
28
28
  const searchValue = document.getElementById('fileSearch').value;
29
29
  const rows = document.getElementsByTagName('tbody')[0].children;
30
+
31
+ // Try to create a RegExp from the searchValue. If it fails (invalid regex),
32
+ // it will be treated as a plain text search
33
+ let searchRegex;
34
+ try {
35
+ searchRegex = new RegExp(searchValue, 'i'); // 'i' for case-insensitive
36
+ } catch (error) {
37
+ searchRegex = null;
38
+ }
39
+
30
40
  for (let i = 0; i < rows.length; i++) {
31
41
  const row = rows[i];
32
- if (
33
- row.textContent
34
- .toLowerCase()
35
- .includes(searchValue.toLowerCase())
36
- ) {
37
- row.style.display = '';
42
+ let isMatch = false;
43
+
44
+ if (searchRegex) {
45
+ // If a valid regex was created, use it for matching
46
+ isMatch = searchRegex.test(row.textContent);
38
47
  } else {
39
- row.style.display = 'none';
48
+ // Otherwise, fall back to the original plain text search
49
+ isMatch = row.textContent
50
+ .toLowerCase()
51
+ .includes(searchValue.toLowerCase());
40
52
  }
53
+
54
+ row.style.display = isMatch ? '' : 'none';
41
55
  }
42
56
  }
43
57
 
@@ -101,7 +101,7 @@
101
101
  <div class='footer quiet pad2 space-top1 center small'>
102
102
  Code coverage generated by
103
103
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
104
- at 2025-12-13T21:44:43.478Z
104
+ at 2025-12-17T14:21:12.653Z
105
105
  </div>
106
106
  <script src="../prettify.js"></script>
107
107
  <script>
@@ -2635,7 +2635,7 @@ export {<span class="fstat-no" title="function not covered" >ExpoIapConsole}</sp
2635
2635
  <div class='footer quiet pad2 space-top1 center small'>
2636
2636
  Code coverage generated by
2637
2637
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
2638
- at 2025-12-13T21:44:43.478Z
2638
+ at 2025-12-17T14:21:12.653Z
2639
2639
  </div>
2640
2640
  <script src="../prettify.js"></script>
2641
2641
  <script>
@@ -1045,7 +1045,7 @@ export const createBillingProgramReportingDetailsAndroid = async (
1045
1045
  <div class='footer quiet pad2 space-top1 center small'>
1046
1046
  Code coverage generated by
1047
1047
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
1048
- at 2025-12-13T21:44:43.478Z
1048
+ at 2025-12-17T14:21:12.653Z
1049
1049
  </div>
1050
1050
  <script src="../../prettify.js"></script>
1051
1051
  <script>
@@ -116,7 +116,7 @@
116
116
  <div class='footer quiet pad2 space-top1 center small'>
117
117
  Code coverage generated by
118
118
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
119
- at 2025-12-13T21:44:43.478Z
119
+ at 2025-12-17T14:21:12.653Z
120
120
  </div>
121
121
  <script src="../../prettify.js"></script>
122
122
  <script>
@@ -1270,7 +1270,7 @@ export const presentExternalPurchaseLinkIOS: MutationField&lt;
1270
1270
  <div class='footer quiet pad2 space-top1 center small'>
1271
1271
  Code coverage generated by
1272
1272
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
1273
- at 2025-12-13T21:44:43.478Z
1273
+ at 2025-12-17T14:21:12.653Z
1274
1274
  </div>
1275
1275
  <script src="../../prettify.js"></script>
1276
1276
  <script>
@@ -268,7 +268,7 @@ export const ExpoIapConsole = createConsole();
268
268
  <div class='footer quiet pad2 space-top1 center small'>
269
269
  Code coverage generated by
270
270
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
271
- at 2025-12-13T21:44:43.478Z
271
+ at 2025-12-17T14:21:12.653Z
272
272
  </div>
273
273
  <script src="../../prettify.js"></script>
274
274
  <script>
@@ -1126,7 +1126,7 @@ export function getUserFriendlyErrorMessage(error: ErrorLike): string {
1126
1126
  <div class='footer quiet pad2 space-top1 center small'>
1127
1127
  Code coverage generated by
1128
1128
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
1129
- at 2025-12-13T21:44:43.478Z
1129
+ at 2025-12-17T14:21:12.653Z
1130
1130
  </div>
1131
1131
  <script src="../../prettify.js"></script>
1132
1132
  <script>
@@ -116,7 +116,7 @@
116
116
  <div class='footer quiet pad2 space-top1 center small'>
117
117
  Code coverage generated by
118
118
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
119
- at 2025-12-13T21:44:43.478Z
119
+ at 2025-12-17T14:21:12.653Z
120
120
  </div>
121
121
  <script src="../../prettify.js"></script>
122
122
  <script>
@@ -291,6 +291,14 @@ public final class ExpoIapModule: Module {
291
291
  return nil
292
292
  }
293
293
 
294
+ AsyncFunction("requestPurchaseOnPromotedProductIOS") { () async throws -> Bool in
295
+ ExpoIapLog.payload("requestPurchaseOnPromotedProductIOS", payload: nil)
296
+ try await ExpoIapHelper.ensureConnection(isInitialized: self.isInitialized)
297
+ let success = try await OpenIapModule.shared.requestPurchaseOnPromotedProductIOS()
298
+ ExpoIapLog.result("requestPurchaseOnPromotedProductIOS", value: success)
299
+ return success
300
+ }
301
+
294
302
  AsyncFunction("getStorefront") { () async throws -> String in
295
303
  ExpoIapLog.payload("getStorefront", payload: nil)
296
304
  try await ExpoIapHelper.ensureConnection(isInitialized: self.isInitialized)
@@ -424,5 +432,21 @@ public final class ExpoIapModule: Module {
424
432
  ExpoIapLog.result("presentExternalPurchaseLinkIOS", value: sanitized)
425
433
  return sanitized
426
434
  }
435
+
436
+ // MARK: - App Transaction (iOS 16.0+)
437
+
438
+ AsyncFunction("getAppTransactionIOS") { () async throws -> [String: Any]? in
439
+ ExpoIapLog.payload("getAppTransactionIOS", payload: nil)
440
+ try await ExpoIapHelper.ensureConnection(isInitialized: self.isInitialized)
441
+ if #available(iOS 16.0, tvOS 16.0, *) {
442
+ if let transaction = try await OpenIapModule.shared.getAppTransactionIOS() {
443
+ let sanitized = ExpoIapHelper.sanitizeDictionary(OpenIapSerialization.encode(transaction))
444
+ ExpoIapLog.result("getAppTransactionIOS", value: sanitized)
445
+ return sanitized
446
+ }
447
+ }
448
+ ExpoIapLog.result("getAppTransactionIOS", value: nil)
449
+ return nil
450
+ }
427
451
  }
428
452
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "apple": "1.3.2",
2
+ "apple": "1.3.5",
3
3
  "google": "1.3.14",
4
- "gql": "1.3.4"
4
+ "gql": "1.3.5"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-iap",
3
- "version": "3.3.0-rc.4",
3
+ "version": "3.3.1",
4
4
  "description": "In App Purchase module in Expo",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -1 +1 @@
1
- {"root":["./src/expoconfig.augmentation.d.ts","./src/withiap.ts","./src/withiosalternativebilling.ts","./src/withlocalopeniap.ts"],"version":"5.9.2"}
1
+ {"root":["./src/expoConfig.augmentation.d.ts","./src/withIAP.ts","./src/withIosAlternativeBilling.ts","./src/withLocalOpenIAP.ts"],"version":"5.9.3"}
@@ -45,17 +45,55 @@ function getReleaseUrl(tag) {
45
45
  return `https://github.com/hyodotdev/openiap/releases/download/${tag}/openiap-typescript.zip`;
46
46
  }
47
47
 
48
+ function resolveCandidateTags(tag) {
49
+ if (tag.startsWith('gql-')) {
50
+ return [tag];
51
+ }
52
+
53
+ // Prefer the new gql-<version> scheme but fall back to legacy bare tags
54
+ return [`gql-${tag}`, tag];
55
+ }
56
+
57
+ function downloadTypesArchive(zipPath, tags) {
58
+ let resolvedTag = null;
59
+ let lastError = null;
60
+
61
+ for (const [index, candidate] of tags.entries()) {
62
+ const releaseUrl = getReleaseUrl(candidate);
63
+ console.log(`Downloading OpenIAP types (tag: ${candidate}) from ${releaseUrl}`);
64
+
65
+ try {
66
+ execFileSync('curl', ['-L', '-o', zipPath, releaseUrl], {
67
+ stdio: 'inherit',
68
+ });
69
+ resolvedTag = candidate;
70
+ break;
71
+ } catch (error) {
72
+ lastError = error;
73
+ const hasFallback = index < tags.length - 1;
74
+ console.warn(
75
+ `Failed to download for tag ${candidate}; ${
76
+ hasFallback ? 'trying fallback' : 'no fallback available'
77
+ }.`,
78
+ );
79
+ }
80
+ }
81
+
82
+ if (!resolvedTag) {
83
+ throw lastError ?? new Error('Unable to download OpenIAP types archive.');
84
+ }
85
+
86
+ return resolvedTag;
87
+ }
88
+
48
89
  function main() {
49
90
  const {tag} = parseArgs();
50
- const releaseUrl = getReleaseUrl(tag);
91
+ const candidateTags = resolveCandidateTags(tag);
51
92
  const tempDir = mkdtempSync(join(tmpdir(), 'openiap-types-'));
52
93
  const zipPath = join(tempDir, 'openiap-typescript.zip');
53
94
 
54
95
  try {
55
- console.log(`Downloading OpenIAP types (tag: ${tag}) from ${releaseUrl}`);
56
- execFileSync('curl', ['-L', '-o', zipPath, releaseUrl], {
57
- stdio: 'inherit',
58
- });
96
+ const resolvedTag = downloadTypesArchive(zipPath, candidateTags);
59
97
 
60
98
  console.log('Extracting types.ts from archive');
61
99
  execFileSync('unzip', ['-o', zipPath, 'types.ts', '-d', tempDir], {
@@ -71,7 +109,7 @@ function main() {
71
109
 
72
110
  const destination = join(PROJECT_ROOT, 'src', 'types.ts');
73
111
  writeFileSync(destination, contents);
74
- console.log('Updated src/types.ts');
112
+ console.log(`Updated src/types.ts from tag ${resolvedTag}`);
75
113
  } finally {
76
114
  rmSync(tempDir, {recursive: true, force: true});
77
115
  }