@harkenapp/sdk-react-native 0.0.1-alpha.1 → 0.0.1-alpha.2
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/README.md +44 -7
- package/app.plugin.cjs +12 -17
- package/dist/__mocks__/async-storage.d.ts +16 -0
- package/dist/__mocks__/async-storage.d.ts.map +1 -0
- package/dist/__mocks__/async-storage.js +39 -0
- package/dist/__mocks__/async-storage.js.map +1 -0
- package/dist/__mocks__/expo-document-picker.d.ts +26 -0
- package/dist/__mocks__/expo-document-picker.d.ts.map +1 -0
- package/dist/__mocks__/expo-document-picker.js +25 -0
- package/dist/__mocks__/expo-document-picker.js.map +1 -0
- package/dist/__mocks__/expo-file-system.d.ts +42 -0
- package/dist/__mocks__/expo-file-system.d.ts.map +1 -0
- package/dist/__mocks__/expo-file-system.js +37 -0
- package/dist/__mocks__/expo-file-system.js.map +1 -0
- package/dist/__mocks__/expo-image-picker.d.ts +30 -0
- package/dist/__mocks__/expo-image-picker.d.ts.map +1 -0
- package/dist/__mocks__/expo-image-picker.js +30 -0
- package/dist/__mocks__/expo-image-picker.js.map +1 -0
- package/dist/__mocks__/expo-secure-store.d.ts +15 -0
- package/dist/__mocks__/expo-secure-store.d.ts.map +1 -0
- package/dist/__mocks__/expo-secure-store.js +30 -0
- package/dist/__mocks__/expo-secure-store.js.map +1 -0
- package/dist/__mocks__/react-native.d.ts +73 -0
- package/dist/__mocks__/react-native.d.ts.map +1 -0
- package/dist/__mocks__/react-native.js +45 -0
- package/dist/__mocks__/react-native.js.map +1 -0
- package/dist/api/client.d.ts +8 -8
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +17 -19
- package/dist/api/client.js.map +1 -1
- package/dist/api/client.test.d.ts +2 -0
- package/dist/api/client.test.d.ts.map +1 -0
- package/dist/api/client.test.js +417 -0
- package/dist/api/client.test.js.map +1 -0
- package/dist/api/errors.d.ts +3 -3
- package/dist/api/errors.d.ts.map +1 -1
- package/dist/api/errors.js +3 -3
- package/dist/api/errors.js.map +1 -1
- package/dist/api/errors.test.d.ts +2 -0
- package/dist/api/errors.test.d.ts.map +1 -0
- package/dist/api/errors.test.js +155 -0
- package/dist/api/errors.test.js.map +1 -0
- package/dist/api/index.d.ts +6 -6
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/retry.d.ts +1 -1
- package/dist/api/retry.d.ts.map +1 -1
- package/dist/api/retry.js.map +1 -1
- package/dist/api/retry.test.d.ts +2 -0
- package/dist/api/retry.test.d.ts.map +1 -0
- package/dist/api/retry.test.js +193 -0
- package/dist/api/retry.test.js.map +1 -0
- package/dist/attachments/FeedbackSheet.d.ts +36 -13
- package/dist/attachments/FeedbackSheet.d.ts.map +1 -1
- package/dist/attachments/FeedbackSheet.js +50 -30
- package/dist/attachments/FeedbackSheet.js.map +1 -1
- package/dist/attachments/index.d.ts +2 -2
- package/dist/components/AttachmentGrid.d.ts +12 -4
- package/dist/components/AttachmentGrid.d.ts.map +1 -1
- package/dist/components/AttachmentGrid.js +44 -34
- package/dist/components/AttachmentGrid.js.map +1 -1
- package/dist/components/AttachmentPicker.d.ts +3 -3
- package/dist/components/AttachmentPicker.d.ts.map +1 -1
- package/dist/components/AttachmentPicker.js +34 -36
- package/dist/components/AttachmentPicker.js.map +1 -1
- package/dist/components/AttachmentPreview.d.ts +10 -4
- package/dist/components/AttachmentPreview.d.ts.map +1 -1
- package/dist/components/AttachmentPreview.js +48 -34
- package/dist/components/AttachmentPreview.js.map +1 -1
- package/dist/components/CategorySelector.d.ts +3 -3
- package/dist/components/CategorySelector.d.ts.map +1 -1
- package/dist/components/CategorySelector.js +21 -27
- package/dist/components/CategorySelector.js.map +1 -1
- package/dist/components/FeedbackForm.d.ts +3 -3
- package/dist/components/FeedbackForm.d.ts.map +1 -1
- package/dist/components/FeedbackForm.js +7 -8
- package/dist/components/FeedbackForm.js.map +1 -1
- package/dist/components/FeedbackSheet.d.ts +34 -11
- package/dist/components/FeedbackSheet.d.ts.map +1 -1
- package/dist/components/FeedbackSheet.js +46 -28
- package/dist/components/FeedbackSheet.js.map +1 -1
- package/dist/components/ThemedButton.d.ts +16 -5
- package/dist/components/ThemedButton.d.ts.map +1 -1
- package/dist/components/ThemedButton.js +38 -29
- package/dist/components/ThemedButton.js.map +1 -1
- package/dist/components/ThemedText.d.ts +3 -3
- package/dist/components/ThemedText.d.ts.map +1 -1
- package/dist/components/ThemedText.js +1 -1
- package/dist/components/ThemedText.js.map +1 -1
- package/dist/components/ThemedTextInput.d.ts +11 -2
- package/dist/components/ThemedTextInput.d.ts.map +1 -1
- package/dist/components/ThemedTextInput.js +19 -9
- package/dist/components/ThemedTextInput.js.map +1 -1
- package/dist/components/UploadStatusOverlay.d.ts +11 -3
- package/dist/components/UploadStatusOverlay.d.ts.map +1 -1
- package/dist/components/UploadStatusOverlay.js +59 -76
- package/dist/components/UploadStatusOverlay.js.map +1 -1
- package/dist/components/index.d.ts +18 -18
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/context/HarkenContext.d.ts +20 -15
- package/dist/context/HarkenContext.d.ts.map +1 -1
- package/dist/context/HarkenContext.js +20 -17
- package/dist/context/HarkenContext.js.map +1 -1
- package/dist/context/index.d.ts +2 -2
- package/dist/domain/index.d.ts +2 -2
- package/dist/domain/index.d.ts.map +1 -1
- package/dist/domain/index.js.map +1 -1
- package/dist/hooks/index.d.ts +5 -5
- package/dist/hooks/useAnonymousId.js +1 -1
- package/dist/hooks/useAnonymousId.test.d.ts +2 -0
- package/dist/hooks/useAnonymousId.test.d.ts.map +1 -0
- package/dist/hooks/useAnonymousId.test.js +154 -0
- package/dist/hooks/useAnonymousId.test.js.map +1 -0
- package/dist/hooks/useAttachmentPicker.d.ts +3 -3
- package/dist/hooks/useAttachmentPicker.js +7 -7
- package/dist/hooks/useAttachmentStatus.d.ts +1 -1
- package/dist/hooks/useAttachmentStatus.d.ts.map +1 -1
- package/dist/hooks/useAttachmentStatus.js.map +1 -1
- package/dist/hooks/useAttachmentUpload.d.ts +2 -2
- package/dist/hooks/useAttachmentUpload.d.ts.map +1 -1
- package/dist/hooks/useAttachmentUpload.js +5 -5
- package/dist/hooks/useAttachmentUpload.js.map +1 -1
- package/dist/hooks/useAttachmentUpload.test.d.ts +2 -0
- package/dist/hooks/useAttachmentUpload.test.d.ts.map +1 -0
- package/dist/hooks/useAttachmentUpload.test.js +542 -0
- package/dist/hooks/useAttachmentUpload.test.js.map +1 -0
- package/dist/hooks/useFeedback.d.ts +4 -4
- package/dist/hooks/useFeedback.d.ts.map +1 -1
- package/dist/hooks/useFeedback.js +3 -5
- package/dist/hooks/useFeedback.js.map +1 -1
- package/dist/hooks/useFeedback.test.d.ts +2 -0
- package/dist/hooks/useFeedback.test.d.ts.map +1 -0
- package/dist/hooks/useFeedback.test.js +299 -0
- package/dist/hooks/useFeedback.test.js.map +1 -0
- package/dist/hooks/useHarkenContext.d.ts +1 -1
- package/dist/hooks/useHarkenContext.js +1 -1
- package/dist/hooks/useHarkenTheme.d.ts +27 -3
- package/dist/hooks/useHarkenTheme.d.ts.map +1 -1
- package/dist/hooks/useHarkenTheme.js +26 -2
- package/dist/hooks/useHarkenTheme.js.map +1 -1
- package/dist/index.d.ts +28 -28
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/services/index.d.ts +3 -3
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js.map +1 -1
- package/dist/services/uploadQueueService.d.ts +2 -2
- package/dist/services/uploadQueueService.d.ts.map +1 -1
- package/dist/services/uploadQueueService.js +16 -17
- package/dist/services/uploadQueueService.js.map +1 -1
- package/dist/services/uploadQueueService.test.d.ts +2 -0
- package/dist/services/uploadQueueService.test.d.ts.map +1 -0
- package/dist/services/uploadQueueService.test.js +426 -0
- package/dist/services/uploadQueueService.test.js.map +1 -0
- package/dist/services/uploadQueueStorage.d.ts +1 -1
- package/dist/services/uploadQueueStorage.d.ts.map +1 -1
- package/dist/services/uploadQueueStorage.js +4 -4
- package/dist/services/uploadQueueStorage.js.map +1 -1
- package/dist/services/uploadQueueStorage.test.d.ts +2 -0
- package/dist/services/uploadQueueStorage.test.d.ts.map +1 -0
- package/dist/services/uploadQueueStorage.test.js +200 -0
- package/dist/services/uploadQueueStorage.test.js.map +1 -0
- package/dist/storage/IdentityStore.d.ts +1 -1
- package/dist/storage/IdentityStore.d.ts.map +1 -1
- package/dist/storage/IdentityStore.js.map +1 -1
- package/dist/storage/IdentityStore.test.d.ts +2 -0
- package/dist/storage/IdentityStore.test.d.ts.map +1 -0
- package/dist/storage/IdentityStore.test.js +176 -0
- package/dist/storage/IdentityStore.test.js.map +1 -0
- package/dist/storage/SecureStoreAdapter.d.ts +1 -1
- package/dist/storage/SecureStoreAdapter.test.d.ts +2 -0
- package/dist/storage/SecureStoreAdapter.test.d.ts.map +1 -0
- package/dist/storage/SecureStoreAdapter.test.js +114 -0
- package/dist/storage/SecureStoreAdapter.test.js.map +1 -0
- package/dist/storage/defaultStorage.d.ts +1 -1
- package/dist/storage/defaultStorage.js +4 -4
- package/dist/storage/defaultStorage.test.d.ts +2 -0
- package/dist/storage/defaultStorage.test.d.ts.map +1 -0
- package/dist/storage/defaultStorage.test.js +159 -0
- package/dist/storage/defaultStorage.test.js.map +1 -0
- package/dist/storage/index.d.ts +5 -5
- package/dist/storage/types.js +1 -1
- package/dist/theme/defaults.d.ts +14 -3
- package/dist/theme/defaults.d.ts.map +1 -1
- package/dist/theme/defaults.js +58 -43
- package/dist/theme/defaults.js.map +1 -1
- package/dist/theme/index.d.ts +3 -2
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +4 -1
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/resolver.d.ts +16 -0
- package/dist/theme/resolver.d.ts.map +1 -0
- package/dist/theme/resolver.js +375 -0
- package/dist/theme/resolver.js.map +1 -0
- package/dist/theme/resolver.test.d.ts +2 -0
- package/dist/theme/resolver.test.d.ts.map +1 -0
- package/dist/theme/resolver.test.js +344 -0
- package/dist/theme/resolver.test.js.map +1 -0
- package/dist/theme/types.d.ts +378 -5
- package/dist/theme/types.d.ts.map +1 -1
- package/dist/types/config.d.ts +4 -4
- package/dist/types/index.d.ts +2 -2
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/uuid.d.ts.map +1 -1
- package/dist/utils/uuid.js +4 -5
- package/dist/utils/uuid.js.map +1 -1
- package/dist/utils/uuid.test.d.ts +2 -0
- package/dist/utils/uuid.test.d.ts.map +1 -0
- package/dist/utils/uuid.test.js +78 -0
- package/dist/utils/uuid.test.js.map +1 -0
- package/package.json +21 -13
- package/src/@types/expo-file-system-legacy.d.ts +3 -3
- package/src/__mocks__/async-storage.ts +46 -0
- package/src/__mocks__/expo-document-picker.ts +41 -0
- package/src/__mocks__/expo-file-system.ts +62 -0
- package/src/__mocks__/expo-image-picker.ts +48 -0
- package/src/__mocks__/expo-secure-store.ts +29 -0
- package/src/__mocks__/react-native.ts +46 -0
- package/src/api/client.test.ts +515 -0
- package/src/api/client.ts +45 -64
- package/src/api/errors.test.ts +193 -0
- package/src/api/errors.ts +7 -11
- package/src/api/index.ts +6 -10
- package/src/api/retry.test.ts +251 -0
- package/src/api/retry.ts +3 -6
- package/src/attachments/FeedbackSheet.tsx +100 -80
- package/src/attachments/index.ts +2 -2
- package/src/components/AttachmentGrid.tsx +54 -45
- package/src/components/AttachmentPicker.tsx +43 -54
- package/src/components/AttachmentPreview.tsx +51 -47
- package/src/components/CategorySelector.tsx +29 -35
- package/src/components/FeedbackForm.tsx +23 -35
- package/src/components/FeedbackSheet.tsx +89 -68
- package/src/components/ThemedButton.tsx +49 -47
- package/src/components/ThemedText.tsx +7 -10
- package/src/components/ThemedTextInput.tsx +23 -13
- package/src/components/UploadStatusOverlay.tsx +66 -89
- package/src/components/index.ts +18 -21
- package/src/context/HarkenContext.tsx +29 -28
- package/src/context/index.ts +2 -2
- package/src/domain/index.ts +2 -5
- package/src/domain/upload-queue.ts +5 -5
- package/src/hooks/index.ts +5 -5
- package/src/hooks/useAnonymousId.test.ts +189 -0
- package/src/hooks/useAnonymousId.ts +3 -3
- package/src/hooks/useAttachmentPicker.ts +12 -12
- package/src/hooks/useAttachmentStatus.ts +12 -16
- package/src/hooks/useAttachmentUpload.test.ts +632 -0
- package/src/hooks/useAttachmentUpload.ts +45 -54
- package/src/hooks/useFeedback.test.ts +376 -0
- package/src/hooks/useFeedback.ts +12 -14
- package/src/hooks/useHarkenContext.ts +4 -4
- package/src/hooks/useHarkenTheme.ts +30 -6
- package/src/index.ts +28 -52
- package/src/services/index.ts +3 -9
- package/src/services/uploadQueueService.test.ts +489 -0
- package/src/services/uploadQueueService.ts +40 -56
- package/src/services/uploadQueueStorage.test.ts +243 -0
- package/src/services/uploadQueueStorage.ts +7 -9
- package/src/storage/IdentityStore.test.ts +173 -0
- package/src/storage/IdentityStore.ts +4 -5
- package/src/storage/SecureStoreAdapter.test.ts +147 -0
- package/src/storage/SecureStoreAdapter.ts +1 -1
- package/src/storage/defaultStorage.test.ts +159 -0
- package/src/storage/defaultStorage.ts +6 -6
- package/src/storage/index.ts +5 -5
- package/src/storage/types.ts +1 -1
- package/src/theme/defaults.ts +75 -46
- package/src/theme/index.ts +15 -2
- package/src/theme/resolver.test.ts +411 -0
- package/src/theme/resolver.ts +446 -0
- package/src/theme/types.ts +453 -15
- package/src/types/config.ts +4 -4
- package/src/types/index.ts +2 -2
- package/src/utils/index.ts +1 -1
- package/src/utils/uuid.test.ts +85 -0
- package/src/utils/uuid.ts +4 -7
package/README.md
CHANGED
|
@@ -19,9 +19,7 @@ Add the SDK to your `app.json` or `app.config.js` plugins:
|
|
|
19
19
|
```json
|
|
20
20
|
{
|
|
21
21
|
"expo": {
|
|
22
|
-
"plugins": [
|
|
23
|
-
"@harkenapp/sdk-react-native"
|
|
24
|
-
]
|
|
22
|
+
"plugins": ["@harkenapp/sdk-react-native"]
|
|
25
23
|
}
|
|
26
24
|
}
|
|
27
25
|
```
|
|
@@ -29,12 +27,14 @@ Add the SDK to your `app.json` or `app.config.js` plugins:
|
|
|
29
27
|
This automatically configures:
|
|
30
28
|
|
|
31
29
|
**iOS (Info.plist):**
|
|
30
|
+
|
|
32
31
|
- `NSCameraUsageDescription` - Camera access for taking photos
|
|
33
32
|
- `NSPhotoLibraryUsageDescription` - Photo library access for selecting images
|
|
34
33
|
|
|
35
34
|
> **Note:** `NSDocumentsFolderUsageDescription` is not required. The SDK uses `expo-document-picker` which presents the system document picker UI, handling file access permissions automatically without needing an Info.plist entry.
|
|
36
35
|
|
|
37
36
|
**Android (AndroidManifest.xml):**
|
|
37
|
+
|
|
38
38
|
- `android.permission.CAMERA` - Camera access
|
|
39
39
|
- `android.permission.READ_MEDIA_IMAGES` - Photo library access (Android 13+)
|
|
40
40
|
- `android.permission.READ_EXTERNAL_STORAGE` - Photo library access (Android 12 and below)
|
|
@@ -47,10 +47,13 @@ You can customize the iOS permission dialog strings:
|
|
|
47
47
|
{
|
|
48
48
|
"expo": {
|
|
49
49
|
"plugins": [
|
|
50
|
-
[
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
[
|
|
51
|
+
"@harkenapp/sdk-react-native",
|
|
52
|
+
{
|
|
53
|
+
"cameraPermission": "Take photos to include with your feedback",
|
|
54
|
+
"photoLibraryPermission": "Select photos to include with your feedback"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
54
57
|
]
|
|
55
58
|
}
|
|
56
59
|
}
|
|
@@ -65,3 +68,37 @@ npx expo prebuild
|
|
|
65
68
|
```
|
|
66
69
|
|
|
67
70
|
Or if using EAS Build, permissions are applied automatically during the build process.
|
|
71
|
+
|
|
72
|
+
## Development
|
|
73
|
+
|
|
74
|
+
See the root [CONTRIBUTING.md](../../CONTRIBUTING.md) for development setup.
|
|
75
|
+
|
|
76
|
+
### Testing
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Run tests
|
|
80
|
+
pnpm test
|
|
81
|
+
|
|
82
|
+
# Run tests in watch mode
|
|
83
|
+
pnpm test:watch
|
|
84
|
+
|
|
85
|
+
# Run tests with coverage
|
|
86
|
+
pnpm test:coverage
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Building
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Regenerate OpenAPI types and build
|
|
93
|
+
pnpm build
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Versioning
|
|
97
|
+
|
|
98
|
+
This package follows [Semantic Versioning](https://semver.org/). Releases are automated via GitHub Actions when changes are merged to `main`.
|
|
99
|
+
|
|
100
|
+
Current version: See [package.json](./package.json)
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
Apache-2.0
|
package/app.plugin.cjs
CHANGED
|
@@ -28,17 +28,14 @@
|
|
|
28
28
|
* }
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
-
const {
|
|
32
|
-
withInfoPlist,
|
|
33
|
-
withAndroidManifest,
|
|
34
|
-
} = require('@expo/config-plugins');
|
|
31
|
+
const { withInfoPlist, withAndroidManifest } = require("@expo/config-plugins");
|
|
35
32
|
|
|
36
33
|
/**
|
|
37
34
|
* Default permission strings for iOS
|
|
38
35
|
*/
|
|
39
36
|
const DEFAULT_PERMISSIONS = {
|
|
40
|
-
cameraPermission:
|
|
41
|
-
photoLibraryPermission:
|
|
37
|
+
cameraPermission: "Allow $(PRODUCT_NAME) to access your camera to take photos for feedback",
|
|
38
|
+
photoLibraryPermission: "Allow $(PRODUCT_NAME) to access your photos to include with feedback",
|
|
42
39
|
};
|
|
43
40
|
|
|
44
41
|
/**
|
|
@@ -74,23 +71,21 @@ function withAndroidPermissions(config) {
|
|
|
74
71
|
const manifest = config.modResults.manifest;
|
|
75
72
|
|
|
76
73
|
// Ensure uses-permission array exists
|
|
77
|
-
if (!manifest[
|
|
78
|
-
manifest[
|
|
74
|
+
if (!manifest["uses-permission"]) {
|
|
75
|
+
manifest["uses-permission"] = [];
|
|
79
76
|
}
|
|
80
77
|
|
|
81
|
-
const permissions = manifest[
|
|
78
|
+
const permissions = manifest["uses-permission"];
|
|
82
79
|
|
|
83
80
|
/**
|
|
84
81
|
* Add a permission if it doesn't already exist
|
|
85
82
|
*/
|
|
86
83
|
function addPermission(name, attributes = {}) {
|
|
87
|
-
const exists = permissions.some(
|
|
88
|
-
(p) => p.$?.['android:name'] === name
|
|
89
|
-
);
|
|
84
|
+
const exists = permissions.some((p) => p.$?.["android:name"] === name);
|
|
90
85
|
if (!exists) {
|
|
91
86
|
permissions.push({
|
|
92
87
|
$: {
|
|
93
|
-
|
|
88
|
+
"android:name": name,
|
|
94
89
|
...attributes,
|
|
95
90
|
},
|
|
96
91
|
});
|
|
@@ -98,16 +93,16 @@ function withAndroidPermissions(config) {
|
|
|
98
93
|
}
|
|
99
94
|
|
|
100
95
|
// Camera permission
|
|
101
|
-
addPermission(
|
|
96
|
+
addPermission("android.permission.CAMERA");
|
|
102
97
|
|
|
103
98
|
// Photo library permissions
|
|
104
99
|
// READ_MEDIA_IMAGES for Android 13+ (API 33+)
|
|
105
|
-
addPermission(
|
|
100
|
+
addPermission("android.permission.READ_MEDIA_IMAGES");
|
|
106
101
|
|
|
107
102
|
// READ_EXTERNAL_STORAGE for Android 12 and below
|
|
108
103
|
// Use maxSdkVersion to limit to older APIs
|
|
109
|
-
addPermission(
|
|
110
|
-
|
|
104
|
+
addPermission("android.permission.READ_EXTERNAL_STORAGE", {
|
|
105
|
+
"android:maxSdkVersion": "32",
|
|
111
106
|
});
|
|
112
107
|
|
|
113
108
|
return config;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock @react-native-async-storage/async-storage for testing.
|
|
3
|
+
*/
|
|
4
|
+
declare const AsyncStorage: {
|
|
5
|
+
getItem: (key: string) => Promise<string | null>;
|
|
6
|
+
setItem: (key: string, value: string) => Promise<void>;
|
|
7
|
+
removeItem: (key: string) => Promise<void>;
|
|
8
|
+
clear: () => Promise<void>;
|
|
9
|
+
getAllKeys: () => Promise<string[]>;
|
|
10
|
+
multiGet: (keys: string[]) => Promise<readonly [string, string | null][]>;
|
|
11
|
+
multiSet: (keyValuePairs: [string, string][]) => Promise<void>;
|
|
12
|
+
multiRemove: (keys: string[]) => Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
export declare function __clearStorage(): void;
|
|
15
|
+
export default AsyncStorage;
|
|
16
|
+
//# sourceMappingURL=async-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async-storage.d.ts","sourceRoot":"","sources":["../../src/__mocks__/async-storage.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,QAAA,MAAM,YAAY;mBACK,MAAM,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;mBAI/B,MAAM,SAAS,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;sBAIlC,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;iBAI7B,OAAO,CAAC,IAAI,CAAC;sBAIR,OAAO,CAAC,MAAM,EAAE,CAAC;qBAIhB,MAAM,EAAE,KAAG,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;8BAI7C,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,KAAG,OAAO,CAAC,IAAI,CAAC;wBAIxC,MAAM,EAAE,KAAG,OAAO,CAAC,IAAI,CAAC;CAGnD,CAAC;AAGF,wBAAgB,cAAc,IAAI,IAAI,CAErC;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Mock @react-native-async-storage/async-storage for testing.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.__clearStorage = __clearStorage;
|
|
7
|
+
const storage = new Map();
|
|
8
|
+
const AsyncStorage = {
|
|
9
|
+
getItem: async (key) => {
|
|
10
|
+
return storage.get(key) ?? null;
|
|
11
|
+
},
|
|
12
|
+
setItem: async (key, value) => {
|
|
13
|
+
storage.set(key, value);
|
|
14
|
+
},
|
|
15
|
+
removeItem: async (key) => {
|
|
16
|
+
storage.delete(key);
|
|
17
|
+
},
|
|
18
|
+
clear: async () => {
|
|
19
|
+
storage.clear();
|
|
20
|
+
},
|
|
21
|
+
getAllKeys: async () => {
|
|
22
|
+
return Array.from(storage.keys());
|
|
23
|
+
},
|
|
24
|
+
multiGet: async (keys) => {
|
|
25
|
+
return keys.map((key) => [key, storage.get(key) ?? null]);
|
|
26
|
+
},
|
|
27
|
+
multiSet: async (keyValuePairs) => {
|
|
28
|
+
keyValuePairs.forEach(([key, value]) => storage.set(key, value));
|
|
29
|
+
},
|
|
30
|
+
multiRemove: async (keys) => {
|
|
31
|
+
keys.forEach((key) => storage.delete(key));
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
// Helper to clear storage between tests
|
|
35
|
+
function __clearStorage() {
|
|
36
|
+
storage.clear();
|
|
37
|
+
}
|
|
38
|
+
exports.default = AsyncStorage;
|
|
39
|
+
//# sourceMappingURL=async-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async-storage.js","sourceRoot":"","sources":["../../src/__mocks__/async-storage.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAuCH,wCAEC;AAvCD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAkB,CAAC;AAE1C,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE,KAAK,EAAE,GAAW,EAA0B,EAAE;QACrD,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC;IAClC,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,GAAW,EAAE,KAAa,EAAiB,EAAE;QAC3D,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC1B,CAAC;IAED,UAAU,EAAE,KAAK,EAAE,GAAW,EAAiB,EAAE;QAC/C,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;IAED,KAAK,EAAE,KAAK,IAAmB,EAAE;QAC/B,OAAO,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC;IAED,UAAU,EAAE,KAAK,IAAuB,EAAE;QACxC,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,QAAQ,EAAE,KAAK,EAAE,IAAc,EAA+C,EAAE;QAC9E,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;IAC5D,CAAC;IAED,QAAQ,EAAE,KAAK,EAAE,aAAiC,EAAiB,EAAE;QACnE,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;IACnE,CAAC;IAED,WAAW,EAAE,KAAK,EAAE,IAAc,EAAiB,EAAE;QACnD,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7C,CAAC;CACF,CAAC;AAEF,wCAAwC;AACxC,SAAgB,cAAc;IAC5B,OAAO,CAAC,KAAK,EAAE,CAAC;AAClB,CAAC;AAED,kBAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock expo-document-picker for testing.
|
|
3
|
+
*/
|
|
4
|
+
export interface DocumentPickerOptions {
|
|
5
|
+
type?: string[];
|
|
6
|
+
copyToCacheDirectory?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface DocumentPickerResult {
|
|
9
|
+
canceled: boolean;
|
|
10
|
+
assets: Array<{
|
|
11
|
+
uri: string;
|
|
12
|
+
name: string;
|
|
13
|
+
mimeType?: string;
|
|
14
|
+
size?: number;
|
|
15
|
+
}> | null;
|
|
16
|
+
}
|
|
17
|
+
export declare function getDocumentAsync(_options?: DocumentPickerOptions): Promise<DocumentPickerResult>;
|
|
18
|
+
export declare function __setMockResult(result: DocumentPickerResult): void;
|
|
19
|
+
export declare function __resetMock(): void;
|
|
20
|
+
declare const _default: {
|
|
21
|
+
getDocumentAsync: typeof getDocumentAsync;
|
|
22
|
+
__setMockResult: typeof __setMockResult;
|
|
23
|
+
__resetMock: typeof __resetMock;
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
26
|
+
//# sourceMappingURL=expo-document-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expo-document-picker.d.ts","sourceRoot":"","sources":["../../src/__mocks__/expo-document-picker.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,KAAK,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC,GAAG,IAAI,CAAC;CACX;AAID,wBAAsB,gBAAgB,CACpC,QAAQ,CAAC,EAAE,qBAAqB,GAC/B,OAAO,CAAC,oBAAoB,CAAC,CAE/B;AAGD,wBAAgB,eAAe,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAElE;AAED,wBAAgB,WAAW,IAAI,IAAI,CAElC;;;;;;AAED,wBAIE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Mock expo-document-picker for testing.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getDocumentAsync = getDocumentAsync;
|
|
7
|
+
exports.__setMockResult = __setMockResult;
|
|
8
|
+
exports.__resetMock = __resetMock;
|
|
9
|
+
let mockResult = { canceled: true, assets: null };
|
|
10
|
+
async function getDocumentAsync(_options) {
|
|
11
|
+
return mockResult;
|
|
12
|
+
}
|
|
13
|
+
// Helper to set mock result for tests
|
|
14
|
+
function __setMockResult(result) {
|
|
15
|
+
mockResult = result;
|
|
16
|
+
}
|
|
17
|
+
function __resetMock() {
|
|
18
|
+
mockResult = { canceled: true, assets: null };
|
|
19
|
+
}
|
|
20
|
+
exports.default = {
|
|
21
|
+
getDocumentAsync,
|
|
22
|
+
__setMockResult,
|
|
23
|
+
__resetMock,
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=expo-document-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expo-document-picker.js","sourceRoot":"","sources":["../../src/__mocks__/expo-document-picker.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAmBH,4CAIC;AAGD,0CAEC;AAED,kCAEC;AAfD,IAAI,UAAU,GAAyB,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAEjE,KAAK,UAAU,gBAAgB,CACpC,QAAgC;IAEhC,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,sCAAsC;AACtC,SAAgB,eAAe,CAAC,MAA4B;IAC1D,UAAU,GAAG,MAAM,CAAC;AACtB,CAAC;AAED,SAAgB,WAAW;IACzB,UAAU,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAChD,CAAC;AAED,kBAAe;IACb,gBAAgB;IAChB,eAAe;IACf,WAAW;CACZ,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock expo-file-system/legacy for testing.
|
|
3
|
+
*/
|
|
4
|
+
export interface FileInfo {
|
|
5
|
+
exists: boolean;
|
|
6
|
+
uri?: string;
|
|
7
|
+
size?: number;
|
|
8
|
+
modificationTime?: number;
|
|
9
|
+
isDirectory?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function getInfoAsync(uri: string): Promise<FileInfo>;
|
|
12
|
+
export interface UploadProgressData {
|
|
13
|
+
totalBytesSent: number;
|
|
14
|
+
totalBytesExpectedToSend: number;
|
|
15
|
+
}
|
|
16
|
+
export interface FileSystemUploadResult {
|
|
17
|
+
status: number;
|
|
18
|
+
body?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function uploadAsync(_url: string, _fileUri: string, _options?: {
|
|
21
|
+
httpMethod?: string;
|
|
22
|
+
uploadType?: string;
|
|
23
|
+
headers?: Record<string, string>;
|
|
24
|
+
}): Promise<FileSystemUploadResult>;
|
|
25
|
+
export declare const FileSystemUploadType: {
|
|
26
|
+
BINARY_CONTENT: string;
|
|
27
|
+
MULTIPART: string;
|
|
28
|
+
};
|
|
29
|
+
export declare function __setMockFileInfo(uri: string, info: FileInfo): void;
|
|
30
|
+
export declare function __resetMock(): void;
|
|
31
|
+
declare const _default: {
|
|
32
|
+
getInfoAsync: typeof getInfoAsync;
|
|
33
|
+
uploadAsync: typeof uploadAsync;
|
|
34
|
+
FileSystemUploadType: {
|
|
35
|
+
BINARY_CONTENT: string;
|
|
36
|
+
MULTIPART: string;
|
|
37
|
+
};
|
|
38
|
+
__setMockFileInfo: typeof __setMockFileInfo;
|
|
39
|
+
__resetMock: typeof __resetMock;
|
|
40
|
+
};
|
|
41
|
+
export default _default;
|
|
42
|
+
//# sourceMappingURL=expo-file-system.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expo-file-system.d.ts","sourceRoot":"","sources":["../../src/__mocks__/expo-file-system.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAID,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAEjE;AAED,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,wBAAwB,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE;IACT,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,GACA,OAAO,CAAC,sBAAsB,CAAC,CAEjC;AAGD,eAAO,MAAM,oBAAoB;;;CAGhC,CAAC;AAGF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,CAEnE;AAED,wBAAgB,WAAW,IAAI,IAAI,CAElC;;;;;;;;;;;AAED,wBAME"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Mock expo-file-system/legacy for testing.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FileSystemUploadType = void 0;
|
|
7
|
+
exports.getInfoAsync = getInfoAsync;
|
|
8
|
+
exports.uploadAsync = uploadAsync;
|
|
9
|
+
exports.__setMockFileInfo = __setMockFileInfo;
|
|
10
|
+
exports.__resetMock = __resetMock;
|
|
11
|
+
const mockFileInfo = new Map();
|
|
12
|
+
async function getInfoAsync(uri) {
|
|
13
|
+
return mockFileInfo.get(uri) ?? { exists: false };
|
|
14
|
+
}
|
|
15
|
+
async function uploadAsync(_url, _fileUri, _options) {
|
|
16
|
+
return { status: 200 };
|
|
17
|
+
}
|
|
18
|
+
// Constants
|
|
19
|
+
exports.FileSystemUploadType = {
|
|
20
|
+
BINARY_CONTENT: "binaryContent",
|
|
21
|
+
MULTIPART: "multipart",
|
|
22
|
+
};
|
|
23
|
+
// Helper to set mock file info for tests
|
|
24
|
+
function __setMockFileInfo(uri, info) {
|
|
25
|
+
mockFileInfo.set(uri, info);
|
|
26
|
+
}
|
|
27
|
+
function __resetMock() {
|
|
28
|
+
mockFileInfo.clear();
|
|
29
|
+
}
|
|
30
|
+
exports.default = {
|
|
31
|
+
getInfoAsync,
|
|
32
|
+
uploadAsync,
|
|
33
|
+
FileSystemUploadType: exports.FileSystemUploadType,
|
|
34
|
+
__setMockFileInfo,
|
|
35
|
+
__resetMock,
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=expo-file-system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expo-file-system.js","sourceRoot":"","sources":["../../src/__mocks__/expo-file-system.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAYH,oCAEC;AAYD,kCAUC;AASD,8CAEC;AAED,kCAEC;AAzCD,MAAM,YAAY,GAA0B,IAAI,GAAG,EAAE,CAAC;AAE/C,KAAK,UAAU,YAAY,CAAC,GAAW;IAC5C,OAAO,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AACpD,CAAC;AAYM,KAAK,UAAU,WAAW,CAC/B,IAAY,EACZ,QAAgB,EAChB,QAIC;IAED,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;AACzB,CAAC;AAED,YAAY;AACC,QAAA,oBAAoB,GAAG;IAClC,cAAc,EAAE,eAAe;IAC/B,SAAS,EAAE,WAAW;CACvB,CAAC;AAEF,yCAAyC;AACzC,SAAgB,iBAAiB,CAAC,GAAW,EAAE,IAAc;IAC3D,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED,SAAgB,WAAW;IACzB,YAAY,CAAC,KAAK,EAAE,CAAC;AACvB,CAAC;AAED,kBAAe;IACb,YAAY;IACZ,WAAW;IACX,oBAAoB,EAApB,4BAAoB;IACpB,iBAAiB;IACjB,WAAW;CACZ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock expo-image-picker for testing.
|
|
3
|
+
*/
|
|
4
|
+
export interface ImagePickerOptions {
|
|
5
|
+
mediaTypes?: string[];
|
|
6
|
+
quality?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ImagePickerResult {
|
|
9
|
+
canceled: boolean;
|
|
10
|
+
assets: Array<{
|
|
11
|
+
uri: string;
|
|
12
|
+
fileName?: string;
|
|
13
|
+
mimeType?: string;
|
|
14
|
+
fileSize?: number;
|
|
15
|
+
width?: number;
|
|
16
|
+
height?: number;
|
|
17
|
+
}> | null;
|
|
18
|
+
}
|
|
19
|
+
export declare function launchCameraAsync(_options?: ImagePickerOptions): Promise<ImagePickerResult>;
|
|
20
|
+
export declare function launchImageLibraryAsync(_options?: ImagePickerOptions): Promise<ImagePickerResult>;
|
|
21
|
+
export declare function __setMockResult(result: ImagePickerResult): void;
|
|
22
|
+
export declare function __resetMock(): void;
|
|
23
|
+
declare const _default: {
|
|
24
|
+
launchCameraAsync: typeof launchCameraAsync;
|
|
25
|
+
launchImageLibraryAsync: typeof launchImageLibraryAsync;
|
|
26
|
+
__setMockResult: typeof __setMockResult;
|
|
27
|
+
__resetMock: typeof __resetMock;
|
|
28
|
+
};
|
|
29
|
+
export default _default;
|
|
30
|
+
//# sourceMappingURL=expo-image-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expo-image-picker.d.ts","sourceRoot":"","sources":["../../src/__mocks__/expo-image-picker.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,KAAK,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC,GAAG,IAAI,CAAC;CACX;AAID,wBAAsB,iBAAiB,CAAC,QAAQ,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAEjG;AAED,wBAAsB,uBAAuB,CAC3C,QAAQ,CAAC,EAAE,kBAAkB,GAC5B,OAAO,CAAC,iBAAiB,CAAC,CAE5B;AAGD,wBAAgB,eAAe,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAE/D;AAED,wBAAgB,WAAW,IAAI,IAAI,CAElC;;;;;;;AAED,wBAKE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Mock expo-image-picker for testing.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.launchCameraAsync = launchCameraAsync;
|
|
7
|
+
exports.launchImageLibraryAsync = launchImageLibraryAsync;
|
|
8
|
+
exports.__setMockResult = __setMockResult;
|
|
9
|
+
exports.__resetMock = __resetMock;
|
|
10
|
+
let mockResult = { canceled: true, assets: null };
|
|
11
|
+
async function launchCameraAsync(_options) {
|
|
12
|
+
return mockResult;
|
|
13
|
+
}
|
|
14
|
+
async function launchImageLibraryAsync(_options) {
|
|
15
|
+
return mockResult;
|
|
16
|
+
}
|
|
17
|
+
// Helper to set mock result for tests
|
|
18
|
+
function __setMockResult(result) {
|
|
19
|
+
mockResult = result;
|
|
20
|
+
}
|
|
21
|
+
function __resetMock() {
|
|
22
|
+
mockResult = { canceled: true, assets: null };
|
|
23
|
+
}
|
|
24
|
+
exports.default = {
|
|
25
|
+
launchCameraAsync,
|
|
26
|
+
launchImageLibraryAsync,
|
|
27
|
+
__setMockResult,
|
|
28
|
+
__resetMock,
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=expo-image-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expo-image-picker.js","sourceRoot":"","sources":["../../src/__mocks__/expo-image-picker.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAqBH,8CAEC;AAED,0DAIC;AAGD,0CAEC;AAED,kCAEC;AAnBD,IAAI,UAAU,GAAsB,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAE9D,KAAK,UAAU,iBAAiB,CAAC,QAA6B;IACnE,OAAO,UAAU,CAAC;AACpB,CAAC;AAEM,KAAK,UAAU,uBAAuB,CAC3C,QAA6B;IAE7B,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,sCAAsC;AACtC,SAAgB,eAAe,CAAC,MAAyB;IACvD,UAAU,GAAG,MAAM,CAAC;AACtB,CAAC;AAED,SAAgB,WAAW;IACzB,UAAU,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAChD,CAAC;AAED,kBAAe;IACb,iBAAiB;IACjB,uBAAuB;IACvB,eAAe;IACf,WAAW;CACZ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock expo-secure-store for testing.
|
|
3
|
+
*/
|
|
4
|
+
export declare function getItemAsync(key: string): Promise<string | null>;
|
|
5
|
+
export declare function setItemAsync(key: string, value: string): Promise<void>;
|
|
6
|
+
export declare function deleteItemAsync(key: string): Promise<void>;
|
|
7
|
+
export declare function __clearStorage(): void;
|
|
8
|
+
declare const _default: {
|
|
9
|
+
getItemAsync: typeof getItemAsync;
|
|
10
|
+
setItemAsync: typeof setItemAsync;
|
|
11
|
+
deleteItemAsync: typeof deleteItemAsync;
|
|
12
|
+
__clearStorage: typeof __clearStorage;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
15
|
+
//# sourceMappingURL=expo-secure-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expo-secure-store.d.ts","sourceRoot":"","sources":["../../src/__mocks__/expo-secure-store.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAEtE;AAED,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5E;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhE;AAGD,wBAAgB,cAAc,IAAI,IAAI,CAErC;;;;;;;AAED,wBAKE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Mock expo-secure-store for testing.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getItemAsync = getItemAsync;
|
|
7
|
+
exports.setItemAsync = setItemAsync;
|
|
8
|
+
exports.deleteItemAsync = deleteItemAsync;
|
|
9
|
+
exports.__clearStorage = __clearStorage;
|
|
10
|
+
const storage = new Map();
|
|
11
|
+
async function getItemAsync(key) {
|
|
12
|
+
return storage.get(key) ?? null;
|
|
13
|
+
}
|
|
14
|
+
async function setItemAsync(key, value) {
|
|
15
|
+
storage.set(key, value);
|
|
16
|
+
}
|
|
17
|
+
async function deleteItemAsync(key) {
|
|
18
|
+
storage.delete(key);
|
|
19
|
+
}
|
|
20
|
+
// Helper to clear storage between tests
|
|
21
|
+
function __clearStorage() {
|
|
22
|
+
storage.clear();
|
|
23
|
+
}
|
|
24
|
+
exports.default = {
|
|
25
|
+
getItemAsync,
|
|
26
|
+
setItemAsync,
|
|
27
|
+
deleteItemAsync,
|
|
28
|
+
__clearStorage,
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=expo-secure-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expo-secure-store.js","sourceRoot":"","sources":["../../src/__mocks__/expo-secure-store.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAIH,oCAEC;AAED,oCAEC;AAED,0CAEC;AAGD,wCAEC;AAjBD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEnC,KAAK,UAAU,YAAY,CAAC,GAAW;IAC5C,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC;AAClC,CAAC;AAEM,KAAK,UAAU,YAAY,CAAC,GAAW,EAAE,KAAa;IAC3D,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAC1B,CAAC;AAEM,KAAK,UAAU,eAAe,CAAC,GAAW;IAC/C,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AACtB,CAAC;AAED,wCAAwC;AACxC,SAAgB,cAAc;IAC5B,OAAO,CAAC,KAAK,EAAE,CAAC;AAClB,CAAC;AAED,kBAAe;IACb,YAAY;IACZ,YAAY;IACZ,eAAe;IACf,cAAc;CACf,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock React Native module for testing.
|
|
3
|
+
*
|
|
4
|
+
* Provides minimal mocks for modules used by the SDK.
|
|
5
|
+
*/
|
|
6
|
+
export declare const Platform: {
|
|
7
|
+
OS: "ios" | "android" | "web" | "windows" | "macos";
|
|
8
|
+
select: <T>(options: {
|
|
9
|
+
ios?: T;
|
|
10
|
+
android?: T;
|
|
11
|
+
default?: T;
|
|
12
|
+
}) => T | undefined;
|
|
13
|
+
Version: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const StyleSheet: {
|
|
16
|
+
create: <T extends Record<string, unknown>>(styles: T) => T;
|
|
17
|
+
flatten: <T>(style: T | T[]) => T;
|
|
18
|
+
};
|
|
19
|
+
export declare const Dimensions: {
|
|
20
|
+
get: () => {
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
scale: number;
|
|
24
|
+
fontScale: number;
|
|
25
|
+
};
|
|
26
|
+
addEventListener: () => {
|
|
27
|
+
remove: () => void;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export declare const View = "View";
|
|
31
|
+
export declare const Text = "Text";
|
|
32
|
+
export declare const TouchableOpacity = "TouchableOpacity";
|
|
33
|
+
export declare const TextInput = "TextInput";
|
|
34
|
+
export declare const ScrollView = "ScrollView";
|
|
35
|
+
export declare const ActivityIndicator = "ActivityIndicator";
|
|
36
|
+
export declare const Image = "Image";
|
|
37
|
+
export declare const Pressable = "Pressable";
|
|
38
|
+
declare const _default: {
|
|
39
|
+
Platform: {
|
|
40
|
+
OS: "ios" | "android" | "web" | "windows" | "macos";
|
|
41
|
+
select: <T>(options: {
|
|
42
|
+
ios?: T;
|
|
43
|
+
android?: T;
|
|
44
|
+
default?: T;
|
|
45
|
+
}) => T | undefined;
|
|
46
|
+
Version: string;
|
|
47
|
+
};
|
|
48
|
+
StyleSheet: {
|
|
49
|
+
create: <T extends Record<string, unknown>>(styles: T) => T;
|
|
50
|
+
flatten: <T>(style: T | T[]) => T;
|
|
51
|
+
};
|
|
52
|
+
Dimensions: {
|
|
53
|
+
get: () => {
|
|
54
|
+
width: number;
|
|
55
|
+
height: number;
|
|
56
|
+
scale: number;
|
|
57
|
+
fontScale: number;
|
|
58
|
+
};
|
|
59
|
+
addEventListener: () => {
|
|
60
|
+
remove: () => void;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
View: string;
|
|
64
|
+
Text: string;
|
|
65
|
+
TouchableOpacity: string;
|
|
66
|
+
TextInput: string;
|
|
67
|
+
ScrollView: string;
|
|
68
|
+
ActivityIndicator: string;
|
|
69
|
+
Image: string;
|
|
70
|
+
Pressable: string;
|
|
71
|
+
};
|
|
72
|
+
export default _default;
|
|
73
|
+
//# sourceMappingURL=react-native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-native.d.ts","sourceRoot":"","sources":["../../src/__mocks__/react-native.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,QAAQ;QACN,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO;aACnD,CAAC,WAAW;QAAE,GAAG,CAAC,EAAE,CAAC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC,CAAA;KAAE,KAAG,CAAC,GAAG,SAAS;;CAI3E,CAAC;AAEF,eAAO,MAAM,UAAU;aACZ,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,KAAG,CAAC;cAC/C,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,KAAG,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;CAGtB,CAAC;AAEF,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,SAAS,cAAc,CAAC;AACrC,eAAO,MAAM,UAAU,eAAe,CAAC;AACvC,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AACrD,eAAO,MAAM,KAAK,UAAU,CAAC;AAC7B,eAAO,MAAM,SAAS,cAAc,CAAC;;;YAxBtB,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO;iBACnD,CAAC,WAAW;YAAE,GAAG,CAAC,EAAE,CAAC,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC,CAAA;SAAE,KAAG,CAAC,GAAG,SAAS;;;;iBAOjE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,KAAG,CAAC;kBAC/C,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,KAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;AAiBjC,wBAYE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Mock React Native module for testing.
|
|
4
|
+
*
|
|
5
|
+
* Provides minimal mocks for modules used by the SDK.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.Pressable = exports.Image = exports.ActivityIndicator = exports.ScrollView = exports.TextInput = exports.TouchableOpacity = exports.Text = exports.View = exports.Dimensions = exports.StyleSheet = exports.Platform = void 0;
|
|
9
|
+
exports.Platform = {
|
|
10
|
+
OS: "ios",
|
|
11
|
+
select: (options) => {
|
|
12
|
+
return options.ios ?? options.default;
|
|
13
|
+
},
|
|
14
|
+
Version: "17.0",
|
|
15
|
+
};
|
|
16
|
+
exports.StyleSheet = {
|
|
17
|
+
create: (styles) => styles,
|
|
18
|
+
flatten: (style) => (Array.isArray(style) ? Object.assign({}, ...style) : style),
|
|
19
|
+
};
|
|
20
|
+
exports.Dimensions = {
|
|
21
|
+
get: () => ({ width: 375, height: 812, scale: 2, fontScale: 1 }),
|
|
22
|
+
addEventListener: () => ({ remove: () => { } }),
|
|
23
|
+
};
|
|
24
|
+
exports.View = "View";
|
|
25
|
+
exports.Text = "Text";
|
|
26
|
+
exports.TouchableOpacity = "TouchableOpacity";
|
|
27
|
+
exports.TextInput = "TextInput";
|
|
28
|
+
exports.ScrollView = "ScrollView";
|
|
29
|
+
exports.ActivityIndicator = "ActivityIndicator";
|
|
30
|
+
exports.Image = "Image";
|
|
31
|
+
exports.Pressable = "Pressable";
|
|
32
|
+
exports.default = {
|
|
33
|
+
Platform: exports.Platform,
|
|
34
|
+
StyleSheet: exports.StyleSheet,
|
|
35
|
+
Dimensions: exports.Dimensions,
|
|
36
|
+
View: exports.View,
|
|
37
|
+
Text: exports.Text,
|
|
38
|
+
TouchableOpacity: exports.TouchableOpacity,
|
|
39
|
+
TextInput: exports.TextInput,
|
|
40
|
+
ScrollView: exports.ScrollView,
|
|
41
|
+
ActivityIndicator: exports.ActivityIndicator,
|
|
42
|
+
Image: exports.Image,
|
|
43
|
+
Pressable: exports.Pressable,
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=react-native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-native.js","sourceRoot":"","sources":["../../src/__mocks__/react-native.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEU,QAAA,QAAQ,GAAG;IACtB,EAAE,EAAE,KAAwD;IAC5D,MAAM,EAAE,CAAI,OAA8C,EAAiB,EAAE;QAC3E,OAAO,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;IACxC,CAAC;IACD,OAAO,EAAE,MAAM;CAChB,CAAC;AAEW,QAAA,UAAU,GAAG;IACxB,MAAM,EAAE,CAAoC,MAAS,EAAK,EAAE,CAAC,MAAM;IACnE,OAAO,EAAE,CAAI,KAAc,EAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;CAChG,CAAC;AAEW,QAAA,UAAU,GAAG;IACxB,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IAChE,gBAAgB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,CAAC;CAC/C,CAAC;AAEW,QAAA,IAAI,GAAG,MAAM,CAAC;AACd,QAAA,IAAI,GAAG,MAAM,CAAC;AACd,QAAA,gBAAgB,GAAG,kBAAkB,CAAC;AACtC,QAAA,SAAS,GAAG,WAAW,CAAC;AACxB,QAAA,UAAU,GAAG,YAAY,CAAC;AAC1B,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AACxC,QAAA,KAAK,GAAG,OAAO,CAAC;AAChB,QAAA,SAAS,GAAG,WAAW,CAAC;AAErC,kBAAe;IACb,QAAQ,EAAR,gBAAQ;IACR,UAAU,EAAV,kBAAU;IACV,UAAU,EAAV,kBAAU;IACV,IAAI,EAAJ,YAAI;IACJ,IAAI,EAAJ,YAAI;IACJ,gBAAgB,EAAhB,wBAAgB;IAChB,SAAS,EAAT,iBAAS;IACT,UAAU,EAAV,kBAAU;IACV,iBAAiB,EAAjB,yBAAiB;IACjB,KAAK,EAAL,aAAK;IACL,SAAS,EAAT,iBAAS;CACV,CAAC"}
|
package/dist/api/client.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { components } from
|
|
2
|
-
import type { RetryConfig } from
|
|
3
|
-
type FeedbackSubmission = components[
|
|
4
|
-
type FeedbackSubmissionResponse = components[
|
|
5
|
-
type AttachmentPresignRequest = components[
|
|
6
|
-
type AttachmentPresignResponse = components[
|
|
7
|
-
type AttachmentConfirmRequest = components[
|
|
8
|
-
type AttachmentStatusResponse = components[
|
|
1
|
+
import type { components } from "../types/index.js";
|
|
2
|
+
import type { RetryConfig } from "./retry";
|
|
3
|
+
type FeedbackSubmission = components["schemas"]["FeedbackSubmission"];
|
|
4
|
+
type FeedbackSubmissionResponse = components["schemas"]["FeedbackSubmissionResponse"];
|
|
5
|
+
type AttachmentPresignRequest = components["schemas"]["AttachmentPresignRequest"];
|
|
6
|
+
type AttachmentPresignResponse = components["schemas"]["AttachmentPresignResponse"];
|
|
7
|
+
type AttachmentConfirmRequest = components["schemas"]["AttachmentConfirmRequest"];
|
|
8
|
+
type AttachmentStatusResponse = components["schemas"]["AttachmentStatusResponse"];
|
|
9
9
|
export interface HarkenClientConfig {
|
|
10
10
|
/** Publishable API key */
|
|
11
11
|
publishableKey: string;
|