@explorins/pers-sdk-react-native 1.5.27 → 1.5.28
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/dist/index.js +31 -25
- package/dist/index.js.map +1 -1
- package/dist/providers/rn-dpop-provider.d.ts.map +1 -1
- package/dist/providers/rn-dpop-provider.js +18 -1
- package/dist/storage/rn-secure-storage.d.ts.map +1 -1
- package/dist/storage/rn-secure-storage.js +11 -1
- package/package.json +1 -1
- package/src/providers/rn-dpop-provider.ts +17 -1
- package/src/storage/rn-secure-storage.ts +11 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rn-dpop-provider.d.ts","sourceRoot":"","sources":["../../src/providers/rn-dpop-provider.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"rn-dpop-provider.d.ts","sourceRoot":"","sources":["../../src/providers/rn-dpop-provider.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAkB3E,qBAAa,uBAAwB,YAAW,kBAAkB;IAChE;;;;;;;OAOG;IACG,eAAe,CAAC,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,CAAC;IAoB1E,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;IAmC9E,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAO3D,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,eAAe;CAQxB"}
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
2
|
import { Buffer } from 'buffer';
|
|
3
|
+
// Conditionally require quick-crypto for Native platforms only
|
|
4
|
+
let crypto;
|
|
5
|
+
if (Platform.OS !== 'web') {
|
|
6
|
+
try {
|
|
7
|
+
crypto = require('react-native-quick-crypto').default || require('react-native-quick-crypto');
|
|
8
|
+
}
|
|
9
|
+
catch (e) {
|
|
10
|
+
console.warn('ReactNativeDPoPProvider: Failed to load react-native-quick-crypto', e);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
// on Web, we shouldn't be using this provider anyway (Core SDK has WebDPoPProvider)
|
|
15
|
+
// But to be safe, we can mock or throw
|
|
16
|
+
crypto = {
|
|
17
|
+
generateKeyPair: () => { throw new Error('ReactNativeDPoPProvider not supported on Web'); }
|
|
18
|
+
};
|
|
19
|
+
}
|
|
3
20
|
export class ReactNativeDPoPProvider {
|
|
4
21
|
/**
|
|
5
22
|
* Generates a new key pair (ES256 recommended)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rn-secure-storage.d.ts","sourceRoot":"","sources":["../../src/storage/rn-secure-storage.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EAGb,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"rn-secure-storage.d.ts","sourceRoot":"","sources":["../../src/storage/rn-secure-storage.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EAGb,MAAM,0BAA0B,CAAC;AAYlC;;;GAGG;AACH,qBAAa,wBAAyB,YAAW,YAAY;IAY/C,OAAO,CAAC,SAAS;IAV7B,QAAQ,CAAC,eAAe,SAAS;IAGjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAKzB;gBAEiB,SAAS,GAAE,MAAuB;IAEhD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB/C,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAyBzC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAUlC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB5B,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,QAAQ;CAOjB"}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
2
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
3
3
|
import { DPOP_STORAGE_KEYS, AUTH_STORAGE_KEYS } from '@explorins/pers-sdk/core';
|
|
4
|
+
// Conditionally require Keychain to avoid Web bundler errors
|
|
5
|
+
let Keychain;
|
|
6
|
+
if (Platform.OS !== 'web') {
|
|
7
|
+
try {
|
|
8
|
+
Keychain = require('react-native-keychain');
|
|
9
|
+
}
|
|
10
|
+
catch (e) {
|
|
11
|
+
console.warn('ReactNativeSecureStorage: Failed to load react-native-keychain', e);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
4
14
|
/**
|
|
5
15
|
* Secure Storage implementation for React Native
|
|
6
16
|
* Uses Keychain/Keystore for sensitive data and AsyncStorage for non-sensitive data.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@explorins/pers-sdk-react-native",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.28",
|
|
4
4
|
"description": "React Native SDK for PERS Platform - Tourism Loyalty System with Blockchain Transaction Signing and WebAuthn Authentication",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -1,7 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
2
|
import { Buffer } from 'buffer';
|
|
3
3
|
import { DPoPCryptoProvider, DPoPKeyPair } from '@explorins/pers-sdk/core';
|
|
4
4
|
|
|
5
|
+
// Conditionally require quick-crypto for Native platforms only
|
|
6
|
+
let crypto: any;
|
|
7
|
+
if (Platform.OS !== 'web') {
|
|
8
|
+
try {
|
|
9
|
+
crypto = require('react-native-quick-crypto').default || require('react-native-quick-crypto');
|
|
10
|
+
} catch (e) {
|
|
11
|
+
console.warn('ReactNativeDPoPProvider: Failed to load react-native-quick-crypto', e);
|
|
12
|
+
}
|
|
13
|
+
} else {
|
|
14
|
+
// on Web, we shouldn't be using this provider anyway (Core SDK has WebDPoPProvider)
|
|
15
|
+
// But to be safe, we can mock or throw
|
|
16
|
+
crypto = {
|
|
17
|
+
generateKeyPair: () => { throw new Error('ReactNativeDPoPProvider not supported on Web'); }
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
5
21
|
export class ReactNativeDPoPProvider implements DPoPCryptoProvider {
|
|
6
22
|
/**
|
|
7
23
|
* Generates a new key pair (ES256 recommended)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
2
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
3
3
|
import {
|
|
4
4
|
TokenStorage,
|
|
@@ -6,6 +6,16 @@ import {
|
|
|
6
6
|
AUTH_STORAGE_KEYS
|
|
7
7
|
} from '@explorins/pers-sdk/core';
|
|
8
8
|
|
|
9
|
+
// Conditionally require Keychain to avoid Web bundler errors
|
|
10
|
+
let Keychain: any;
|
|
11
|
+
if (Platform.OS !== 'web') {
|
|
12
|
+
try {
|
|
13
|
+
Keychain = require('react-native-keychain');
|
|
14
|
+
} catch (e) {
|
|
15
|
+
console.warn('ReactNativeSecureStorage: Failed to load react-native-keychain', e);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
9
19
|
/**
|
|
10
20
|
* Secure Storage implementation for React Native
|
|
11
21
|
* Uses Keychain/Keystore for sensitive data and AsyncStorage for non-sensitive data.
|