@quiltt/react-native 4.2.3 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.js +20 -7
- package/package.json +8 -8
- package/src/components/QuilttConnector.tsx +26 -10
- package/src/index.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @quiltt/react-native
|
|
2
2
|
|
|
3
|
+
## 4.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#363](https://github.com/quiltt/quiltt-js/pull/363) [`641d766`](https://github.com/quiltt/quiltt-js/commit/641d76620ffbb99bc80fdc9998ac936883fe1d06) Thanks [@zubairaziz](https://github.com/zubairaziz)! - Upgrade rails/actioncable to v8
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`641d766`](https://github.com/quiltt/quiltt-js/commit/641d76620ffbb99bc80fdc9998ac936883fe1d06)]:
|
|
12
|
+
- @quiltt/react@4.3.0
|
|
13
|
+
- @quiltt/core@4.3.0
|
|
14
|
+
|
|
3
15
|
## 4.2.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { URL } from 'react-native-url-polyfill';
|
|
|
9
9
|
import { WebView } from 'react-native-webview';
|
|
10
10
|
import { generateStackTrace, makeBacktrace, getCauses } from '@honeybadger-io/core/build/src/util';
|
|
11
11
|
|
|
12
|
-
var version = "4.
|
|
12
|
+
var version = "4.3.0";
|
|
13
13
|
|
|
14
14
|
// Custom Error Reporter to avoid hooking into or colliding with a client's Honeybadger singleton
|
|
15
15
|
const notifier = {
|
|
@@ -256,6 +256,20 @@ const LoadingScreen = ({ testId })=>/*#__PURE__*/ jsx(AndroidSafeAreaView, {
|
|
|
256
256
|
|
|
257
257
|
const errorReporter = new ErrorReporter(`${Platform.OS} ${Platform.Version}`);
|
|
258
258
|
const PREFLIGHT_RETRY_COUNT = 3;
|
|
259
|
+
const parseMetadata = (url, connectorId)=>{
|
|
260
|
+
const metadata = {
|
|
261
|
+
connectorId: url.searchParams.get('connectorId') ?? connectorId
|
|
262
|
+
};
|
|
263
|
+
const profileId = url.searchParams.get('profileId');
|
|
264
|
+
if (profileId) metadata.profileId = profileId;
|
|
265
|
+
const connectionId = url.searchParams.get('connectionId');
|
|
266
|
+
if (connectionId) metadata.connectionId = connectionId;
|
|
267
|
+
const connectorSessionId = url.searchParams.get('connectorSession');
|
|
268
|
+
if (connectorSessionId) metadata.connectorSession = {
|
|
269
|
+
id: connectorSessionId
|
|
270
|
+
};
|
|
271
|
+
return metadata;
|
|
272
|
+
};
|
|
259
273
|
const checkConnectorUrl = async (connectorUrl, retryCount = 0)=>{
|
|
260
274
|
let responseStatus;
|
|
261
275
|
try {
|
|
@@ -321,7 +335,7 @@ const checkConnectorUrl = async (connectorUrl, retryCount = 0)=>{
|
|
|
321
335
|
const normalizedUrl = normalizeUrlEncoding(urlString);
|
|
322
336
|
// Open the normalized URL
|
|
323
337
|
Linking.openURL(normalizedUrl);
|
|
324
|
-
} catch (
|
|
338
|
+
} catch (_error) {
|
|
325
339
|
console.error('OAuth URL handling error');
|
|
326
340
|
// Only try the fallback if oauthUrl is not null
|
|
327
341
|
if (oauthUrl != null) {
|
|
@@ -329,7 +343,7 @@ const checkConnectorUrl = async (connectorUrl, retryCount = 0)=>{
|
|
|
329
343
|
const fallbackUrl = typeof oauthUrl === 'string' ? oauthUrl : oauthUrl.toString();
|
|
330
344
|
console.log('Attempting fallback OAuth opening');
|
|
331
345
|
Linking.openURL(fallbackUrl);
|
|
332
|
-
} catch (
|
|
346
|
+
} catch (_fallbackError) {
|
|
333
347
|
console.error('Fallback OAuth opening failed');
|
|
334
348
|
}
|
|
335
349
|
}
|
|
@@ -431,7 +445,7 @@ const QuilttConnector = ({ connectorId, connectionId, institution, oauthRedirect
|
|
|
431
445
|
const handleQuilttEvent = useCallback((url)=>{
|
|
432
446
|
url.searchParams.delete('source');
|
|
433
447
|
url.searchParams.append('connectorId', connectorId);
|
|
434
|
-
const metadata =
|
|
448
|
+
const metadata = parseMetadata(url, connectorId);
|
|
435
449
|
requestAnimationFrame(()=>{
|
|
436
450
|
const eventType = url.host;
|
|
437
451
|
switch(eventType){
|
|
@@ -474,7 +488,7 @@ const QuilttConnector = ({ connectorId, connectionId, institution, oauthRedirect
|
|
|
474
488
|
try {
|
|
475
489
|
const decodedUrl = decodeURIComponent(navigateUrl);
|
|
476
490
|
handleOAuthUrl(decodedUrl);
|
|
477
|
-
} catch (
|
|
491
|
+
} catch (_error) {
|
|
478
492
|
console.error('Navigate URL decoding failed, using original');
|
|
479
493
|
handleOAuthUrl(navigateUrl);
|
|
480
494
|
}
|
|
@@ -555,8 +569,7 @@ const QuilttConnector = ({ connectorId, connectionId, institution, oauthRedirect
|
|
|
555
569
|
bounces: false,
|
|
556
570
|
scrollEnabled: true,
|
|
557
571
|
automaticallyAdjustContentInsets: false,
|
|
558
|
-
contentInsetAdjustmentBehavior: "never"
|
|
559
|
-
,
|
|
572
|
+
contentInsetAdjustmentBehavior: "never",
|
|
560
573
|
showsVerticalScrollIndicator: false,
|
|
561
574
|
showsHorizontalScrollIndicator: false,
|
|
562
575
|
testID: "webview",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quiltt/react-native",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "React Native Components for Quiltt Connector",
|
|
5
5
|
"homepage": "https://github.com/quiltt/quiltt-js/tree/main/packages/react-native#readme",
|
|
6
6
|
"repository": {
|
|
@@ -30,23 +30,23 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@honeybadger-io/core": "6.6.0",
|
|
32
32
|
"lodash.debounce": "4.0.8",
|
|
33
|
-
"@quiltt/core": "4.
|
|
34
|
-
"@quiltt/react": "4.
|
|
33
|
+
"@quiltt/core": "4.3.0",
|
|
34
|
+
"@quiltt/react": "4.3.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@biomejs/biome": "
|
|
37
|
+
"@biomejs/biome": "2.2.4",
|
|
38
38
|
"@types/base-64": "1.0.2",
|
|
39
39
|
"@types/lodash.debounce": "4.0.9",
|
|
40
|
-
"@types/node": "22.18.
|
|
41
|
-
"@types/react": "18.3.
|
|
40
|
+
"@types/node": "22.18.6",
|
|
41
|
+
"@types/react": "18.3.23",
|
|
42
42
|
"base-64": "1.0.0",
|
|
43
|
-
"bunchee": "6.
|
|
43
|
+
"bunchee": "6.6.0",
|
|
44
44
|
"react": "18.3.1",
|
|
45
45
|
"react-native": "0.76.7",
|
|
46
46
|
"react-native-url-polyfill": "2.0.0",
|
|
47
47
|
"react-native-webview": "13.12.5",
|
|
48
48
|
"rimraf": "6.0.1",
|
|
49
|
-
"typescript": "5.
|
|
49
|
+
"typescript": "5.9.2"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"base-64": "^1.0.0",
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|
2
|
-
import { Linking, Platform } from 'react-native'
|
|
3
|
-
|
|
2
|
+
import { Linking, Platform, StyleSheet } from 'react-native'
|
|
3
|
+
|
|
4
|
+
import type { ConnectorSDKCallbackMetadata, ConnectorSDKCallbacks } from '@quiltt/react'
|
|
5
|
+
import { ConnectorSDKEventType, useQuilttSession } from '@quiltt/react'
|
|
4
6
|
import { URL } from 'react-native-url-polyfill' // https://github.com/facebook/react-native/issues/16434
|
|
5
7
|
import { WebView } from 'react-native-webview'
|
|
6
8
|
import type { ShouldStartLoadRequest } from 'react-native-webview/lib/WebViewTypes'
|
|
7
9
|
|
|
8
|
-
import { ConnectorSDKEventType, useQuilttSession } from '@quiltt/react'
|
|
9
|
-
import type { ConnectorSDKCallbackMetadata, ConnectorSDKCallbacks } from '@quiltt/react'
|
|
10
|
-
|
|
11
10
|
import {
|
|
12
11
|
ErrorReporter,
|
|
13
12
|
getErrorMessage,
|
|
@@ -16,6 +15,7 @@ import {
|
|
|
16
15
|
smartEncodeURIComponent,
|
|
17
16
|
} from '@/utils'
|
|
18
17
|
import { version } from '@/version'
|
|
18
|
+
|
|
19
19
|
import { AndroidSafeAreaView } from './AndroidSafeAreaView'
|
|
20
20
|
import { ErrorScreen } from './ErrorScreen'
|
|
21
21
|
import { LoadingScreen } from './LoadingScreen'
|
|
@@ -28,12 +28,28 @@ export type PreFlightCheck = {
|
|
|
28
28
|
error?: string
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
const parseMetadata = (url: URL, connectorId: string): ConnectorSDKCallbackMetadata => {
|
|
32
|
+
const metadata: ConnectorSDKCallbackMetadata = {
|
|
33
|
+
connectorId: url.searchParams.get('connectorId') ?? connectorId,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const profileId = url.searchParams.get('profileId')
|
|
37
|
+
if (profileId) metadata.profileId = profileId
|
|
38
|
+
|
|
39
|
+
const connectionId = url.searchParams.get('connectionId')
|
|
40
|
+
if (connectionId) metadata.connectionId = connectionId
|
|
41
|
+
|
|
42
|
+
const connectorSessionId = url.searchParams.get('connectorSession')
|
|
43
|
+
if (connectorSessionId) metadata.connectorSession = { id: connectorSessionId }
|
|
44
|
+
|
|
45
|
+
return metadata
|
|
46
|
+
}
|
|
47
|
+
|
|
31
48
|
export const checkConnectorUrl = async (
|
|
32
49
|
connectorUrl: string,
|
|
33
50
|
retryCount = 0
|
|
34
51
|
): Promise<PreFlightCheck> => {
|
|
35
52
|
let responseStatus: number | undefined
|
|
36
|
-
let error: Error | undefined
|
|
37
53
|
try {
|
|
38
54
|
const response = await fetch(connectorUrl)
|
|
39
55
|
|
|
@@ -98,7 +114,7 @@ export const handleOAuthUrl = (oauthUrl: URL | string | null | undefined) => {
|
|
|
98
114
|
|
|
99
115
|
// Open the normalized URL
|
|
100
116
|
Linking.openURL(normalizedUrl)
|
|
101
|
-
} catch (
|
|
117
|
+
} catch (_error) {
|
|
102
118
|
console.error('OAuth URL handling error')
|
|
103
119
|
|
|
104
120
|
// Only try the fallback if oauthUrl is not null
|
|
@@ -107,7 +123,7 @@ export const handleOAuthUrl = (oauthUrl: URL | string | null | undefined) => {
|
|
|
107
123
|
const fallbackUrl = typeof oauthUrl === 'string' ? oauthUrl : oauthUrl.toString()
|
|
108
124
|
console.log('Attempting fallback OAuth opening')
|
|
109
125
|
Linking.openURL(fallbackUrl)
|
|
110
|
-
} catch (
|
|
126
|
+
} catch (_fallbackError) {
|
|
111
127
|
console.error('Fallback OAuth opening failed')
|
|
112
128
|
}
|
|
113
129
|
}
|
|
@@ -227,7 +243,7 @@ const QuilttConnector = ({
|
|
|
227
243
|
(url: URL) => {
|
|
228
244
|
url.searchParams.delete('source')
|
|
229
245
|
url.searchParams.append('connectorId', connectorId)
|
|
230
|
-
const metadata =
|
|
246
|
+
const metadata = parseMetadata(url, connectorId)
|
|
231
247
|
|
|
232
248
|
requestAnimationFrame(() => {
|
|
233
249
|
const eventType = url.host
|
|
@@ -272,7 +288,7 @@ const QuilttConnector = ({
|
|
|
272
288
|
try {
|
|
273
289
|
const decodedUrl = decodeURIComponent(navigateUrl)
|
|
274
290
|
handleOAuthUrl(decodedUrl)
|
|
275
|
-
} catch (
|
|
291
|
+
} catch (_error) {
|
|
276
292
|
console.error('Navigate URL decoding failed, using original')
|
|
277
293
|
handleOAuthUrl(navigateUrl)
|
|
278
294
|
}
|