@onairos/react-native 1.0.3 → 2.0.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.
- package/lib/commonjs/api/index.js +34 -0
- package/lib/commonjs/api/index.js.map +1 -0
- package/lib/commonjs/components/OnairosButton.js +59 -20
- package/lib/commonjs/components/OnairosButton.js.map +1 -1
- package/lib/commonjs/components/Overlay.js +180 -197
- package/lib/commonjs/components/Overlay.js.map +1 -1
- package/lib/commonjs/constants/index.js +13 -9
- package/lib/commonjs/constants/index.js.map +1 -1
- package/lib/commonjs/index.js +220 -0
- package/lib/commonjs/utils/encryption.js +32 -0
- package/lib/commonjs/utils/encryption.js.map +1 -0
- package/lib/module/api/index.js +27 -0
- package/lib/module/api/index.js.map +1 -0
- package/lib/module/components/OnairosButton.js +59 -20
- package/lib/module/components/OnairosButton.js.map +1 -1
- package/lib/module/components/Overlay.js +182 -198
- package/lib/module/components/Overlay.js.map +1 -1
- package/lib/module/constants/index.js +13 -9
- package/lib/module/constants/index.js.map +1 -1
- package/lib/module/utils/encryption.js +24 -0
- package/lib/module/utils/encryption.js.map +1 -0
- package/package.json +2 -1
- package/src/api/index.ts +33 -0
- package/src/components/OnairosButton.tsx +66 -22
- package/src/components/Overlay.tsx +198 -185
- package/src/constants/index.ts +12 -8
- package/src/types/index.ts +20 -14
- package/src/utils/encryption.ts +25 -0
|
@@ -1,260 +1,244 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React, { useState, useEffect } from 'react';
|
|
3
|
+
import { View, Text, StyleSheet, TouchableOpacity, ScrollView, Alert } from 'react-native';
|
|
4
|
+
import { BottomSheetModal, BottomSheetBackdrop } from '@gorhom/bottom-sheet';
|
|
5
5
|
import { COLORS } from '../constants';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} = Dimensions.get('window');
|
|
6
|
+
import { onairosApi } from '../api';
|
|
7
|
+
import { encryptModelKey, getServerPublicKey } from '../utils/encryption';
|
|
9
8
|
export const Overlay = ({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
requestData,
|
|
15
|
-
biometricType = Platform.OS === 'ios' ? 'FaceID' : 'BiometricID'
|
|
9
|
+
data,
|
|
10
|
+
username,
|
|
11
|
+
modelKey,
|
|
12
|
+
onResolved
|
|
16
13
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
// Expand or collapse the bottom sheet based on visibility
|
|
14
|
+
const [selections, setSelections] = useState({});
|
|
15
|
+
const [details, setDetails] = useState('');
|
|
16
|
+
const bottomSheetRef = React.useRef(null);
|
|
21
17
|
useEffect(() => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
// Initialize selection state
|
|
19
|
+
const initialSelections = {};
|
|
20
|
+
Object.keys(data).forEach(key => {
|
|
21
|
+
initialSelections[key] = false;
|
|
22
|
+
});
|
|
23
|
+
setSelections(initialSelections);
|
|
24
|
+
getDetails();
|
|
25
|
+
}, []);
|
|
26
|
+
const getDetails = async () => {
|
|
27
|
+
try {
|
|
28
|
+
const response = await onairosApi.post('getAccountInfo', {
|
|
29
|
+
Info: {
|
|
30
|
+
username: username
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
setDetails(response.AccountInfo);
|
|
34
|
+
} catch (e) {
|
|
35
|
+
console.error('Error getting account info:', e);
|
|
28
36
|
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
};
|
|
38
|
+
const closeOverlay = () => {
|
|
39
|
+
var _bottomSheetRef$curre;
|
|
40
|
+
(_bottomSheetRef$curre = bottomSheetRef.current) === null || _bottomSheetRef$curre === void 0 || _bottomSheetRef$curre.dismiss();
|
|
41
|
+
};
|
|
42
|
+
const confirmSelection = async () => {
|
|
43
|
+
try {
|
|
44
|
+
let appId = 'unknown';
|
|
45
|
+
try {
|
|
46
|
+
// Try to get package info, but don't fail if it's not available
|
|
47
|
+
const PackageInfo = require('react-native-package-info');
|
|
48
|
+
const packageInfo = await PackageInfo.getPackageInfo();
|
|
49
|
+
appId = packageInfo.packageName;
|
|
50
|
+
} catch (e) {
|
|
51
|
+
console.warn('Package info not available:', e);
|
|
52
|
+
}
|
|
53
|
+
const serverPublicKey = await getServerPublicKey();
|
|
54
|
+
const encryptedModelKey = encryptModelKey(serverPublicKey, modelKey);
|
|
55
|
+
const response = await onairosApi.post('getAPIUrlMobile', {
|
|
56
|
+
Info: {
|
|
57
|
+
storage: 'local',
|
|
58
|
+
appId: appId,
|
|
59
|
+
confirmations: selections,
|
|
60
|
+
developerURL: 'devURL',
|
|
61
|
+
EncryptedUserPin: encryptedModelKey,
|
|
62
|
+
account: username,
|
|
63
|
+
proofMode: false
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
if (response.apiUrl && response.token) {
|
|
67
|
+
onResolved(response.apiUrl, response.token, {
|
|
68
|
+
username
|
|
69
|
+
});
|
|
70
|
+
closeOverlay();
|
|
71
|
+
}
|
|
72
|
+
} catch (e) {
|
|
73
|
+
console.error('Error in confirmSelection:', e);
|
|
74
|
+
showErrorModal('Failed to confirm selection. Please try again.');
|
|
40
75
|
}
|
|
41
|
-
}, [biometricType]);
|
|
42
|
-
|
|
43
|
-
// Render the requested data sections
|
|
44
|
-
const renderDataCategories = () => {
|
|
45
|
-
return Object.entries(requestData).map(([category, items]) => /*#__PURE__*/React.createElement(View, {
|
|
46
|
-
key: category,
|
|
47
|
-
style: styles.categoryContainer
|
|
48
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
49
|
-
style: styles.categoryTitle
|
|
50
|
-
}, category), Object.entries(items).map(([item, description]) => /*#__PURE__*/React.createElement(View, {
|
|
51
|
-
key: item,
|
|
52
|
-
style: styles.itemContainer
|
|
53
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
54
|
-
name: "check-circle",
|
|
55
|
-
size: 20,
|
|
56
|
-
color: COLORS.primary
|
|
57
|
-
}), /*#__PURE__*/React.createElement(View, {
|
|
58
|
-
style: styles.itemContent
|
|
59
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
60
|
-
style: styles.itemTitle
|
|
61
|
-
}, item), /*#__PURE__*/React.createElement(Text, {
|
|
62
|
-
style: styles.itemDescription
|
|
63
|
-
}, description))))));
|
|
64
76
|
};
|
|
65
|
-
|
|
77
|
+
const showErrorModal = errorMessage => {
|
|
78
|
+
Alert.alert('Notice', errorMessage, [{
|
|
79
|
+
text: 'OK'
|
|
80
|
+
}]);
|
|
81
|
+
};
|
|
82
|
+
const selectedCount = Object.values(selections).filter(Boolean).length;
|
|
83
|
+
return /*#__PURE__*/React.createElement(BottomSheetModal, {
|
|
66
84
|
ref: bottomSheetRef,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
animatedIndex
|
|
73
|
-
}) => /*#__PURE__*/React.createElement(View, {
|
|
74
|
-
style: [styles.backdrop, {
|
|
75
|
-
opacity: animatedIndex.interpolate({
|
|
76
|
-
inputRange: [0, 1],
|
|
77
|
-
outputRange: [0.5, 0]
|
|
78
|
-
})
|
|
79
|
-
}]
|
|
80
|
-
})
|
|
85
|
+
snapPoints: ['80%'],
|
|
86
|
+
backdropComponent: props => /*#__PURE__*/React.createElement(BottomSheetBackdrop, _extends({}, props, {
|
|
87
|
+
appearsOnIndex: 0,
|
|
88
|
+
disappearsOnIndex: -1
|
|
89
|
+
}))
|
|
81
90
|
}, /*#__PURE__*/React.createElement(View, {
|
|
82
91
|
style: styles.container
|
|
83
92
|
}, /*#__PURE__*/React.createElement(View, {
|
|
84
93
|
style: styles.header
|
|
85
|
-
}, /*#__PURE__*/React.createElement(
|
|
86
|
-
name: "shield",
|
|
87
|
-
size: 24,
|
|
88
|
-
color: COLORS.primary
|
|
89
|
-
}), /*#__PURE__*/React.createElement(Text, {
|
|
94
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
90
95
|
style: styles.headerTitle
|
|
91
|
-
}, "
|
|
92
|
-
onPress:
|
|
96
|
+
}, "Onairos"), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
97
|
+
onPress: closeOverlay
|
|
98
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
93
99
|
style: styles.closeButton
|
|
94
|
-
}, /*#__PURE__*/React.createElement(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
color: "#000"
|
|
98
|
-
}))), /*#__PURE__*/React.createElement(ScrollView, {
|
|
100
|
+
}, "\xD7")), /*#__PURE__*/React.createElement(Text, {
|
|
101
|
+
style: styles.username
|
|
102
|
+
}, username)), /*#__PURE__*/React.createElement(ScrollView, {
|
|
99
103
|
style: styles.content
|
|
104
|
+
}, Object.entries(data).map(([key, value]) => /*#__PURE__*/React.createElement(View, {
|
|
105
|
+
key: key,
|
|
106
|
+
style: styles.card
|
|
107
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
108
|
+
style: styles.checkboxContainer,
|
|
109
|
+
onPress: () => setSelections(prev => ({
|
|
110
|
+
...prev,
|
|
111
|
+
[key]: !prev[key]
|
|
112
|
+
}))
|
|
100
113
|
}, /*#__PURE__*/React.createElement(View, {
|
|
101
|
-
style: styles.
|
|
114
|
+
style: [styles.checkbox, selections[key] && styles.checkboxSelected]
|
|
115
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
116
|
+
style: styles.cardContent
|
|
102
117
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
103
|
-
style: styles.
|
|
104
|
-
},
|
|
105
|
-
style: styles.
|
|
106
|
-
}, "
|
|
107
|
-
style: styles.
|
|
108
|
-
}, /*#__PURE__*/React.createElement(
|
|
109
|
-
name: "security",
|
|
110
|
-
size: 20,
|
|
111
|
-
color: "#666"
|
|
112
|
-
}), /*#__PURE__*/React.createElement(Text, {
|
|
113
|
-
style: styles.securityText
|
|
114
|
-
}, "Your data is securely processed and never shared with third parties."))), /*#__PURE__*/React.createElement(View, {
|
|
118
|
+
style: styles.cardTitle
|
|
119
|
+
}, value.type, " Insight"), /*#__PURE__*/React.createElement(Text, {
|
|
120
|
+
style: styles.cardDescription
|
|
121
|
+
}, "Description: ", value.descriptions), value.reward && /*#__PURE__*/React.createElement(Text, {
|
|
122
|
+
style: styles.cardReward
|
|
123
|
+
}, "Reward: ", value.reward)))))), /*#__PURE__*/React.createElement(View, {
|
|
115
124
|
style: styles.footer
|
|
116
125
|
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
117
|
-
style: styles.
|
|
118
|
-
onPress:
|
|
126
|
+
style: styles.footerButton,
|
|
127
|
+
onPress: closeOverlay
|
|
119
128
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
120
|
-
style: styles.
|
|
121
|
-
}, "
|
|
122
|
-
style: styles.
|
|
123
|
-
|
|
129
|
+
style: styles.footerButtonText
|
|
130
|
+
}, "Cancel")), /*#__PURE__*/React.createElement(Text, {
|
|
131
|
+
style: styles.selectedCount
|
|
132
|
+
}, "Selected: ", selectedCount), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
133
|
+
style: styles.footerButton,
|
|
134
|
+
onPress: confirmSelection
|
|
124
135
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
125
|
-
style: styles.
|
|
126
|
-
}, "
|
|
127
|
-
name: getBiometricIcon(),
|
|
128
|
-
size: 20,
|
|
129
|
-
color: "#fff",
|
|
130
|
-
style: styles.buttonIcon
|
|
131
|
-
})))));
|
|
136
|
+
style: styles.footerButtonText
|
|
137
|
+
}, "Confirm")))));
|
|
132
138
|
};
|
|
133
139
|
const styles = StyleSheet.create({
|
|
134
140
|
container: {
|
|
135
141
|
flex: 1,
|
|
136
|
-
backgroundColor:
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
...StyleSheet.absoluteFillObject,
|
|
140
|
-
backgroundColor: '#000'
|
|
142
|
+
backgroundColor: COLORS.white,
|
|
143
|
+
borderTopLeftRadius: 10,
|
|
144
|
+
borderTopRightRadius: 10
|
|
141
145
|
},
|
|
142
146
|
header: {
|
|
143
147
|
flexDirection: 'row',
|
|
144
148
|
alignItems: 'center',
|
|
149
|
+
justifyContent: 'space-between',
|
|
145
150
|
padding: 16,
|
|
146
|
-
backgroundColor: COLORS.
|
|
147
|
-
borderTopLeftRadius:
|
|
148
|
-
borderTopRightRadius:
|
|
151
|
+
backgroundColor: COLORS.primary,
|
|
152
|
+
borderTopLeftRadius: 10,
|
|
153
|
+
borderTopRightRadius: 10
|
|
149
154
|
},
|
|
150
155
|
headerTitle: {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
fontWeight: '
|
|
154
|
-
marginLeft: 12,
|
|
155
|
-
color: '#000'
|
|
156
|
+
fontSize: 24,
|
|
157
|
+
color: COLORS.white,
|
|
158
|
+
fontWeight: 'bold'
|
|
156
159
|
},
|
|
157
160
|
closeButton: {
|
|
161
|
+
fontSize: 24,
|
|
162
|
+
color: COLORS.white,
|
|
158
163
|
padding: 8
|
|
159
164
|
},
|
|
165
|
+
username: {
|
|
166
|
+
fontSize: 18,
|
|
167
|
+
color: COLORS.primary
|
|
168
|
+
},
|
|
160
169
|
content: {
|
|
161
170
|
flex: 1,
|
|
162
171
|
padding: 16
|
|
163
172
|
},
|
|
164
|
-
|
|
165
|
-
|
|
173
|
+
card: {
|
|
174
|
+
backgroundColor: COLORS.white,
|
|
175
|
+
borderRadius: 8,
|
|
176
|
+
marginBottom: 12,
|
|
177
|
+
shadowColor: COLORS.black,
|
|
178
|
+
shadowOffset: {
|
|
179
|
+
width: 0,
|
|
180
|
+
height: 2
|
|
181
|
+
},
|
|
182
|
+
shadowOpacity: 0.1,
|
|
183
|
+
shadowRadius: 4,
|
|
184
|
+
elevation: 3
|
|
185
|
+
},
|
|
186
|
+
checkboxContainer: {
|
|
187
|
+
flexDirection: 'row',
|
|
188
|
+
padding: 16,
|
|
189
|
+
alignItems: 'center'
|
|
166
190
|
},
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
191
|
+
checkbox: {
|
|
192
|
+
width: 24,
|
|
193
|
+
height: 24,
|
|
194
|
+
borderRadius: 4,
|
|
195
|
+
borderWidth: 2,
|
|
196
|
+
borderColor: COLORS.primary,
|
|
197
|
+
marginRight: 12
|
|
172
198
|
},
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
color: '#666'
|
|
199
|
+
checkboxSelected: {
|
|
200
|
+
backgroundColor: COLORS.primary
|
|
176
201
|
},
|
|
177
|
-
|
|
178
|
-
|
|
202
|
+
cardContent: {
|
|
203
|
+
flex: 1
|
|
179
204
|
},
|
|
180
|
-
|
|
205
|
+
cardTitle: {
|
|
181
206
|
fontSize: 18,
|
|
182
|
-
fontWeight: '
|
|
183
|
-
|
|
184
|
-
marginBottom: 12
|
|
185
|
-
},
|
|
186
|
-
itemContainer: {
|
|
187
|
-
flexDirection: 'row',
|
|
188
|
-
marginBottom: 12,
|
|
189
|
-
paddingLeft: 8
|
|
190
|
-
},
|
|
191
|
-
itemContent: {
|
|
192
|
-
flex: 1,
|
|
193
|
-
marginLeft: 12
|
|
194
|
-
},
|
|
195
|
-
itemTitle: {
|
|
196
|
-
fontSize: 16,
|
|
197
|
-
fontWeight: '500',
|
|
198
|
-
color: '#000',
|
|
199
|
-
marginBottom: 2
|
|
207
|
+
fontWeight: 'bold',
|
|
208
|
+
marginBottom: 4
|
|
200
209
|
},
|
|
201
|
-
|
|
210
|
+
cardDescription: {
|
|
202
211
|
fontSize: 14,
|
|
203
|
-
color:
|
|
204
|
-
|
|
205
|
-
securityNotice: {
|
|
206
|
-
flexDirection: 'row',
|
|
207
|
-
alignItems: 'flex-start',
|
|
208
|
-
backgroundColor: '#f5f5f5',
|
|
209
|
-
padding: 12,
|
|
210
|
-
borderRadius: 8,
|
|
211
|
-
marginBottom: 24
|
|
212
|
+
color: COLORS.gray,
|
|
213
|
+
marginBottom: 4
|
|
212
214
|
},
|
|
213
|
-
|
|
214
|
-
flex: 1,
|
|
215
|
+
cardReward: {
|
|
215
216
|
fontSize: 14,
|
|
216
|
-
color:
|
|
217
|
-
|
|
217
|
+
color: COLORS.success,
|
|
218
|
+
fontWeight: 'bold'
|
|
218
219
|
},
|
|
219
220
|
footer: {
|
|
220
221
|
flexDirection: 'row',
|
|
222
|
+
justifyContent: 'space-between',
|
|
223
|
+
alignItems: 'center',
|
|
221
224
|
padding: 16,
|
|
222
225
|
borderTopWidth: 1,
|
|
223
|
-
borderTopColor:
|
|
226
|
+
borderTopColor: COLORS.lightGray
|
|
224
227
|
},
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
borderWidth: 1,
|
|
231
|
-
borderColor: '#ddd',
|
|
232
|
-
borderRadius: 25,
|
|
233
|
-
marginRight: 8
|
|
228
|
+
footerButton: {
|
|
229
|
+
paddingVertical: 8,
|
|
230
|
+
paddingHorizontal: 16,
|
|
231
|
+
borderRadius: 8,
|
|
232
|
+
backgroundColor: COLORS.primary
|
|
234
233
|
},
|
|
235
|
-
|
|
234
|
+
footerButtonText: {
|
|
235
|
+
color: COLORS.white,
|
|
236
236
|
fontSize: 16,
|
|
237
|
-
fontWeight: '600'
|
|
238
|
-
color: '#666'
|
|
237
|
+
fontWeight: '600'
|
|
239
238
|
},
|
|
240
|
-
|
|
241
|
-
flex: 2,
|
|
242
|
-
flexDirection: 'row',
|
|
243
|
-
justifyContent: 'center',
|
|
244
|
-
alignItems: 'center',
|
|
245
|
-
paddingVertical: 12,
|
|
246
|
-
backgroundColor: COLORS.primary,
|
|
247
|
-
borderRadius: 25,
|
|
248
|
-
marginLeft: 8
|
|
249
|
-
},
|
|
250
|
-
acceptButtonText: {
|
|
239
|
+
selectedCount: {
|
|
251
240
|
fontSize: 16,
|
|
252
|
-
|
|
253
|
-
color: '#fff',
|
|
254
|
-
marginRight: 8
|
|
255
|
-
},
|
|
256
|
-
buttonIcon: {
|
|
257
|
-
marginLeft: 4
|
|
241
|
+
color: COLORS.gray
|
|
258
242
|
}
|
|
259
243
|
});
|
|
260
244
|
//# sourceMappingURL=Overlay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","useState","useEffect","View","Text","StyleSheet","TouchableOpacity","ScrollView","Alert","BottomSheetModal","BottomSheetBackdrop","COLORS","onairosApi","encryptModelKey","getServerPublicKey","Overlay","data","username","modelKey","onResolved","selections","setSelections","details","setDetails","bottomSheetRef","useRef","initialSelections","Object","keys","forEach","key","getDetails","response","post","Info","AccountInfo","e","console","error","closeOverlay","_bottomSheetRef$curre","current","dismiss","confirmSelection","appId","PackageInfo","require","packageInfo","getPackageInfo","packageName","warn","serverPublicKey","encryptedModelKey","storage","confirmations","developerURL","EncryptedUserPin","account","proofMode","apiUrl","token","showErrorModal","errorMessage","alert","text","selectedCount","values","filter","Boolean","length","createElement","ref","snapPoints","backdropComponent","props","_extends","appearsOnIndex","disappearsOnIndex","style","styles","container","header","headerTitle","onPress","closeButton","content","entries","map","value","card","checkboxContainer","prev","checkbox","checkboxSelected","cardContent","cardTitle","type","cardDescription","descriptions","reward","cardReward","footer","footerButton","footerButtonText","create","flex","backgroundColor","white","borderTopLeftRadius","borderTopRightRadius","flexDirection","alignItems","justifyContent","padding","primary","fontSize","color","fontWeight","borderRadius","marginBottom","shadowColor","black","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","borderWidth","borderColor","marginRight","gray","success","borderTopWidth","borderTopColor","lightGray","paddingVertical","padding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KAAK,EAAEzG,MAAM,CAACwH,IAAI;IAClBZ,YAAY,EAAE;EAChB,CAAC;EACDnB,UAAU,EAAE;IACVe,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAEzG,MAAM,CAACyH,OAAO;IACrBf,UAAU,EAAE;EACd,CAAC;EACDhB,MAAM,EAAE;IACNS,aAAa,EAAE,KAAK;IACpBE,cAAc,EAAE,eAAe;IAC/BD,UAAU,EAAE,QAAQ;IACpBE,OAAO,EAAE,EAAE;IACXoB,cAAc,EAAE,CAAC;IACjBC,cAAc,EAAE3H,MAAM,CAAC4H;EACzB,CAAC;EACDjC,YAAY,EAAE;IACZkC,eAAe,EAAE,CAAC;IAClBC,iBAAiB,EAAE,EAAE;IACrBnB,YAAY,EAAE,CAAC;IACfZ,eAAe,EAAE/F,MAAM,CAACuG;EAC1B,CAAC;EACDX,gBAAgB,EAAE;IAChBa,KAAK,EAAEzG,MAAM,CAACgG,KAAK;IACnBQ,QAAQ,EAAE,EAAE;IACZE,UAAU,EAAE;EACd,CAAC;EACDpD,aAAa,EAAE;IACbkD,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAEzG,MAAM,CAACwH;EAChB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
export const COLORS = {
|
|
2
|
-
primary: '#
|
|
3
|
-
headerBg: '#
|
|
2
|
+
primary: '#1BA9D4',
|
|
3
|
+
headerBg: '#F8F9FA',
|
|
4
4
|
text: {
|
|
5
5
|
primary: '#000000',
|
|
6
|
-
secondary: '#
|
|
6
|
+
secondary: '#666666'
|
|
7
7
|
},
|
|
8
|
-
border: '#
|
|
9
|
-
success: '#
|
|
10
|
-
error: '#
|
|
11
|
-
instagram: '#
|
|
12
|
-
pinterest: '#
|
|
8
|
+
border: '#E5E5E5',
|
|
9
|
+
success: '#34C759',
|
|
10
|
+
error: '#FF3B30',
|
|
11
|
+
instagram: '#E1306C',
|
|
12
|
+
pinterest: '#E60023',
|
|
13
13
|
reddit: '#FF4500',
|
|
14
|
-
youtube: '#FF0000'
|
|
14
|
+
youtube: '#FF0000',
|
|
15
|
+
white: '#FFFFFF',
|
|
16
|
+
black: '#000000',
|
|
17
|
+
gray: '#666666',
|
|
18
|
+
lightGray: '#E5E5E5'
|
|
15
19
|
};
|
|
16
20
|
export const PLATFORMS = {
|
|
17
21
|
instagram: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["COLORS","primary","headerBg","text","secondary","border","success","error","instagram","pinterest","reddit","youtube","PLATFORMS","name","icon","color","description","API_ENDPOINTS","base","oauth","callback","STORAGE_KEYS","credentials","connections","PIN_REQUIREMENTS","minLength","requireUppercase","requireLowercase","requireNumber","requireSpecialChar","DEEP_LINK_CONFIG","scheme","host"],"sourceRoot":"..\\..\\..\\src","sources":["constants/index.ts"],"mappings":"AAEA,OAAO,MAAMA,MAAM,GAAG;EACpBC,OAAO,EAAE,SAAS;EAClBC,QAAQ,EAAE,SAAS;EACnBC,IAAI,EAAE;IACJF,OAAO,EAAE,SAAS;IAClBG,SAAS,EAAE;EACb,CAAC;EACDC,MAAM,EAAE,SAAS;EACjBC,OAAO,EAAE,SAAS;EAClBC,KAAK,EAAE,SAAS;EAChBC,SAAS,EAAE,SAAS;EACpBC,SAAS,EAAE,SAAS;EACpBC,MAAM,EAAE,SAAS;EACjBC,OAAO,EAAE;
|
|
1
|
+
{"version":3,"names":["COLORS","primary","headerBg","text","secondary","border","success","error","instagram","pinterest","reddit","youtube","white","black","gray","lightGray","PLATFORMS","name","icon","color","description","API_ENDPOINTS","base","oauth","callback","STORAGE_KEYS","credentials","connections","PIN_REQUIREMENTS","minLength","requireUppercase","requireLowercase","requireNumber","requireSpecialChar","DEEP_LINK_CONFIG","scheme","host"],"sourceRoot":"..\\..\\..\\src","sources":["constants/index.ts"],"mappings":"AAEA,OAAO,MAAMA,MAAM,GAAG;EACpBC,OAAO,EAAE,SAAS;EAClBC,QAAQ,EAAE,SAAS;EACnBC,IAA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AAO,EAAE;EACX;AACF,CAAC;AAED,OAAO,MAAMc,YAAY,GAAG;EAC1BC,WAAW,EAAE,qBAAqB;EAClCC,WAAW,EAAE;AACf,CAAC;AAED,OAAO,MAAMC,gBAAgB,GAAG;EAC9BC,SAAS,EAAE,CAAC;EACZC,gBAAgB,EAAE,IAAI;EACtBC,gBAAgB,EAAE,IAAI;EACtBC,aAAa,EAAE,IAAI;EACnBC,kBAAkB,EAAE;AACtB,CAAC;AAED,OAAO,MAAMC,gBAAgB,GAAG;EAC9BC,MAAM,EAAE,cAAc;EACtBC,IAAI,EAAE;AACR,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { RSA } from 'react-native-rsa-native';
|
|
2
|
+
import { onairosApi } from '../api';
|
|
3
|
+
export const encryptModelKey = async (publicKey, modelKey) => {
|
|
4
|
+
try {
|
|
5
|
+
const encrypted = await RSA.encrypt(modelKey, publicKey);
|
|
6
|
+
return encrypted;
|
|
7
|
+
} catch (error) {
|
|
8
|
+
console.error('Error encrypting model key:', error);
|
|
9
|
+
throw error;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
export const getServerPublicKey = async () => {
|
|
13
|
+
try {
|
|
14
|
+
const response = await onairosApi.get('public/getPublicKey');
|
|
15
|
+
if (response && response.publicKey) {
|
|
16
|
+
return response.publicKey;
|
|
17
|
+
}
|
|
18
|
+
throw new Error('Server response does not contain publicKey field');
|
|
19
|
+
} catch (error) {
|
|
20
|
+
console.error('Error getting server public key:', error);
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=encryption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["RSA","onairosApi","encryptModelKey","publicKey","modelKey","encrypted","encrypt","error","console","getServerPublicKey","response","get","Error"],"sourceRoot":"..\\..\\..\\src","sources":["utils/encryption.ts"],"mappings":"AAAA,SAASA,GAAG,QAAQ,yBAAyB;AAC7C,SAASC,UAAU,QAAQ,QAAQ;AAEnC,OAAO,MAAMC,eAAe,GAAG,MAAAA,CAAOC,SAAiB,EAAEC,QAAgB,KAAsB;EAC7F,IAAI;IACF,MAAMC,SAAS,GAAG,MAAML,GAAG,CAACM,OAAO,CAACF,QAAQ,EAAED,SAAS,CAAC;IACxD,OAAOE,SAAS;EAClB,CAAC,CAAC,OAAOE,KAAK,EAAE;IACdC,OAAO,CAACD,KAAK,CAAC,6BAA6B,EAAEA,KAAK,CAAC;IACnD,MAAMA,KAAK;EACb;AACF,CAAC;AAED,OAAO,MAAME,kBAAkB,GAAG,MAAAA,CAAA,KAA6B;EAC7D,IAAI;IACF,MAAMC,QAAQ,GAAG,MAAMT,UAAU,CAACU,GAAG,CAAC,qBAAqB,CAAC;IAC5D,IAAID,QAAQ,IAAIA,QAAQ,CAACP,SAAS,EAAE;MAClC,OAAOO,QAAQ,CAACP,SAAS;IAC3B;IACA,MAAM,IAAIS,KAAK,CAAC,kDAAkD,CAAC;EACrE,CAAC,CAAC,OAAOL,KAAK,EAAE;IACdC,OAAO,CAACD,KAAK,CAAC,kCAAkC,EAAEA,KAAK,CAAC;IACxD,MAAMA,KAAK;EACb;AACF,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onairos/react-native",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Onairos React Native SDK for social media authentication and AI model training",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
"react-native-crypto-js": "^1.0.0",
|
|
65
65
|
"react-native-gesture-handler": "^2.0.0",
|
|
66
66
|
"react-native-keychain": "^8.0.0",
|
|
67
|
+
"react-native-package-info": "^1.0.0",
|
|
67
68
|
"react-native-reanimated": "^2.0.0",
|
|
68
69
|
"react-native-rsa-native": "^2.0.0",
|
|
69
70
|
"react-native-safe-area-context": "^4.0.0",
|
package/src/api/index.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
|
|
3
|
+
const BASE_URL = 'https://api2.onairos.uk';
|
|
4
|
+
|
|
5
|
+
class OnairosApi {
|
|
6
|
+
private baseUrl: string;
|
|
7
|
+
|
|
8
|
+
constructor(baseUrl: string = BASE_URL) {
|
|
9
|
+
this.baseUrl = baseUrl;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
async get(endpoint: string) {
|
|
13
|
+
try {
|
|
14
|
+
const response = await axios.get(`${this.baseUrl}/${endpoint}`);
|
|
15
|
+
return response.data;
|
|
16
|
+
} catch (error) {
|
|
17
|
+
console.error('API GET Error:', error);
|
|
18
|
+
throw error;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async post(endpoint: string, data: any) {
|
|
23
|
+
try {
|
|
24
|
+
const response = await axios.post(`${this.baseUrl}/${endpoint}`, data);
|
|
25
|
+
return response.data;
|
|
26
|
+
} catch (error) {
|
|
27
|
+
console.error('API POST Error:', error);
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const onairosApi = new OnairosApi();
|