react-native-mosquito-transport 0.0.48 → 0.0.49

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 (96) hide show
  1. package/CONTRIBUTING.md +37 -19
  2. package/MosquitoTransport.podspec +20 -0
  3. package/android/build.gradle +32 -42
  4. package/android/src/main/AndroidManifest.xml +1 -3
  5. package/android/src/main/java/com/mosquitotransport/MosquitoTransportModule.kt +101 -0
  6. package/android/src/main/java/com/mosquitotransport/MosquitoTransportPackage.kt +31 -0
  7. package/android/src/main/java/com/mosquitotransport/utils/FileUploader.kt +106 -0
  8. package/android/src/main/java/com/mosquitotransport/utils/UploadCallback.kt +7 -0
  9. package/ios/MosquitoTransport-Bridging-Header.h +1 -0
  10. package/ios/MosquitoTransport.h +6 -0
  11. package/ios/MosquitoTransport.mm +81 -0
  12. package/ios/{Mosquitodb.swift → MosquitoTransport.swift} +39 -42
  13. package/package.json +10 -2
  14. package/src/NativeMosquitoTransport.js +24 -0
  15. package/src/helpers/fs_manager.js +1 -1
  16. package/src/helpers/utils.js +2 -4
  17. package/src/helpers/variables.js +2 -1
  18. package/src/index.d.ts +1 -1
  19. package/src/index.js +15 -10
  20. package/src/products/auth/accessor.js +118 -94
  21. package/src/products/auth/index.js +7 -6
  22. package/src/products/database/index.js +1 -0
  23. package/src/products/storage/index.js +9 -23
  24. package/.jshintignore +0 -4
  25. package/.jshintrc +0 -16
  26. package/TODO +0 -35
  27. package/android/gradle.properties +0 -5
  28. package/android/src/main/java/com/mosquitodb/MosquitodbModule.java +0 -82
  29. package/android/src/main/java/com/mosquitodb/MosquitodbPackage.java +0 -28
  30. package/android/src/main/java/com/mosquitodb/utils/FileUploader.java +0 -101
  31. package/android/src/main/java/com/mosquitodb/utils/UploadCallback.java +0 -7
  32. package/example/.bundle/config +0 -2
  33. package/example/.node-version +0 -1
  34. package/example/.watchmanconfig +0 -1
  35. package/example/Gemfile +0 -6
  36. package/example/android/app/build.gradle +0 -170
  37. package/example/android/app/debug.keystore +0 -0
  38. package/example/android/app/proguard-rules.pro +0 -10
  39. package/example/android/app/src/debug/AndroidManifest.xml +0 -13
  40. package/example/android/app/src/debug/java/com/mosquitodbexample/ReactNativeFlipper.java +0 -75
  41. package/example/android/app/src/main/AndroidManifest.xml +0 -25
  42. package/example/android/app/src/main/java/com/mosquitodbexample/MainActivity.java +0 -35
  43. package/example/android/app/src/main/java/com/mosquitodbexample/MainApplication.java +0 -62
  44. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +0 -36
  45. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  46. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  47. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  48. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  49. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  50. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  51. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  52. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  53. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  54. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  55. package/example/android/app/src/main/res/values/strings.xml +0 -3
  56. package/example/android/app/src/main/res/values/styles.xml +0 -9
  57. package/example/android/app/src/release/java/com/mosquitodbexample/ReactNativeFlipper.java +0 -20
  58. package/example/android/build.gradle +0 -21
  59. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  60. package/example/android/gradle/wrapper/gradle-wrapper.properties +0 -5
  61. package/example/android/gradle.properties +0 -44
  62. package/example/android/gradlew +0 -234
  63. package/example/android/gradlew.bat +0 -89
  64. package/example/android/settings.gradle +0 -4
  65. package/example/app.json +0 -4
  66. package/example/babel.config.js +0 -17
  67. package/example/index.js +0 -5
  68. package/example/ios/.xcode.env +0 -11
  69. package/example/ios/File.swift +0 -6
  70. package/example/ios/MosquitodbExample/AppDelegate.h +0 -6
  71. package/example/ios/MosquitodbExample/AppDelegate.mm +0 -36
  72. package/example/ios/MosquitodbExample/Images.xcassets/AppIcon.appiconset/Contents.json +0 -53
  73. package/example/ios/MosquitodbExample/Images.xcassets/Contents.json +0 -6
  74. package/example/ios/MosquitodbExample/Info.plist +0 -55
  75. package/example/ios/MosquitodbExample/LaunchScreen.storyboard +0 -47
  76. package/example/ios/MosquitodbExample/main.m +0 -10
  77. package/example/ios/MosquitodbExample-Bridging-Header.h +0 -3
  78. package/example/ios/MosquitodbExample.xcodeproj/project.pbxproj +0 -703
  79. package/example/ios/MosquitodbExample.xcodeproj/xcshareddata/xcschemes/MosquitodbExample.xcscheme +0 -88
  80. package/example/ios/MosquitodbExample.xcworkspace/contents.xcworkspacedata +0 -10
  81. package/example/ios/MosquitodbExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  82. package/example/ios/MosquitodbExample.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +0 -8
  83. package/example/ios/MosquitodbExample.xcworkspace/xcuserdata/anthony.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  84. package/example/ios/MosquitodbExample.xcworkspace/xcuserdata/anthony.xcuserdatad/WorkspaceSettings.xcsettings +0 -14
  85. package/example/ios/MosquitodbExampleTests/Info.plist +0 -24
  86. package/example/ios/MosquitodbExampleTests/MosquitodbExampleTests.m +0 -66
  87. package/example/ios/Podfile +0 -60
  88. package/example/metro.config.js +0 -40
  89. package/example/package.json +0 -22
  90. package/example/react-native.config.js +0 -10
  91. package/example/src/App.tsx +0 -31
  92. package/ios/Mosquitodb-Bridging-Header.h +0 -2
  93. package/ios/Mosquitodb.m +0 -22
  94. package/ios/Mosquitodb.xcodeproj/project.pbxproj +0 -283
  95. package/ios/Mosquitodb.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
  96. package/react-native-mosquitodb.podspec +0 -35
@@ -1,88 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Scheme
3
- LastUpgradeVersion = "1210"
4
- version = "1.3">
5
- <BuildAction
6
- parallelizeBuildables = "YES"
7
- buildImplicitDependencies = "YES">
8
- <BuildActionEntries>
9
- <BuildActionEntry
10
- buildForTesting = "YES"
11
- buildForRunning = "YES"
12
- buildForProfiling = "YES"
13
- buildForArchiving = "YES"
14
- buildForAnalyzing = "YES">
15
- <BuildableReference
16
- BuildableIdentifier = "primary"
17
- BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
18
- BuildableName = "MosquitodbExample.app"
19
- BlueprintName = "MosquitodbExample"
20
- ReferencedContainer = "container:MosquitodbExample.xcodeproj">
21
- </BuildableReference>
22
- </BuildActionEntry>
23
- </BuildActionEntries>
24
- </BuildAction>
25
- <TestAction
26
- buildConfiguration = "Debug"
27
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
- shouldUseLaunchSchemeArgsEnv = "YES">
30
- <Testables>
31
- <TestableReference
32
- skipped = "NO">
33
- <BuildableReference
34
- BuildableIdentifier = "primary"
35
- BlueprintIdentifier = "00E356ED1AD99517003FC87E"
36
- BuildableName = "MosquitodbExampleTests.xctest"
37
- BlueprintName = "MosquitodbExampleTests"
38
- ReferencedContainer = "container:MosquitodbExample.xcodeproj">
39
- </BuildableReference>
40
- </TestableReference>
41
- </Testables>
42
- </TestAction>
43
- <LaunchAction
44
- buildConfiguration = "Debug"
45
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
46
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47
- launchStyle = "0"
48
- useCustomWorkingDirectory = "NO"
49
- ignoresPersistentStateOnLaunch = "NO"
50
- debugDocumentVersioning = "YES"
51
- debugServiceExtension = "internal"
52
- allowLocationSimulation = "YES">
53
- <BuildableProductRunnable
54
- runnableDebuggingMode = "0">
55
- <BuildableReference
56
- BuildableIdentifier = "primary"
57
- BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
58
- BuildableName = "MosquitodbExample.app"
59
- BlueprintName = "MosquitodbExample"
60
- ReferencedContainer = "container:MosquitodbExample.xcodeproj">
61
- </BuildableReference>
62
- </BuildableProductRunnable>
63
- </LaunchAction>
64
- <ProfileAction
65
- buildConfiguration = "Release"
66
- shouldUseLaunchSchemeArgsEnv = "YES"
67
- savedToolIdentifier = ""
68
- useCustomWorkingDirectory = "NO"
69
- debugDocumentVersioning = "YES">
70
- <BuildableProductRunnable
71
- runnableDebuggingMode = "0">
72
- <BuildableReference
73
- BuildableIdentifier = "primary"
74
- BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
75
- BuildableName = "MosquitodbExample.app"
76
- BlueprintName = "MosquitodbExample"
77
- ReferencedContainer = "container:MosquitodbExample.xcodeproj">
78
- </BuildableReference>
79
- </BuildableProductRunnable>
80
- </ProfileAction>
81
- <AnalyzeAction
82
- buildConfiguration = "Debug">
83
- </AnalyzeAction>
84
- <ArchiveAction
85
- buildConfiguration = "Release"
86
- revealArchiveInOrganizer = "YES">
87
- </ArchiveAction>
88
- </Scheme>
@@ -1,10 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Workspace
3
- version = "1.0">
4
- <FileRef
5
- location = "group:MosquitodbExample.xcodeproj">
6
- </FileRef>
7
- <FileRef
8
- location = "group:Pods/Pods.xcodeproj">
9
- </FileRef>
10
- </Workspace>
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>IDEDidComputeMac32BitWarning</key>
6
- <true/>
7
- </dict>
8
- </plist>
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>PreviewsEnabled</key>
6
- <false/>
7
- </dict>
8
- </plist>
@@ -1,14 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>BuildLocationStyle</key>
6
- <string>UseAppPreferences</string>
7
- <key>CustomBuildLocationType</key>
8
- <string>RelativeToDerivedData</string>
9
- <key>DerivedDataLocationStyle</key>
10
- <string>Default</string>
11
- <key>ShowSharedSchemesAutomaticallyEnabled</key>
12
- <true/>
13
- </dict>
14
- </plist>
@@ -1,24 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>CFBundleDevelopmentRegion</key>
6
- <string>en</string>
7
- <key>CFBundleExecutable</key>
8
- <string>$(EXECUTABLE_NAME)</string>
9
- <key>CFBundleIdentifier</key>
10
- <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11
- <key>CFBundleInfoDictionaryVersion</key>
12
- <string>6.0</string>
13
- <key>CFBundleName</key>
14
- <string>$(PRODUCT_NAME)</string>
15
- <key>CFBundlePackageType</key>
16
- <string>BNDL</string>
17
- <key>CFBundleShortVersionString</key>
18
- <string>1.0</string>
19
- <key>CFBundleSignature</key>
20
- <string>????</string>
21
- <key>CFBundleVersion</key>
22
- <string>1</string>
23
- </dict>
24
- </plist>
@@ -1,66 +0,0 @@
1
- #import <UIKit/UIKit.h>
2
- #import <XCTest/XCTest.h>
3
-
4
- #import <React/RCTLog.h>
5
- #import <React/RCTRootView.h>
6
-
7
- #define TIMEOUT_SECONDS 600
8
- #define TEXT_TO_LOOK_FOR @"Welcome to React"
9
-
10
- @interface MosquitodbExampleTests : XCTestCase
11
-
12
- @end
13
-
14
- @implementation MosquitodbExampleTests
15
-
16
- - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test
17
- {
18
- if (test(view)) {
19
- return YES;
20
- }
21
- for (UIView *subview in [view subviews]) {
22
- if ([self findSubviewInView:subview matching:test]) {
23
- return YES;
24
- }
25
- }
26
- return NO;
27
- }
28
-
29
- - (void)testRendersWelcomeScreen
30
- {
31
- UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
32
- NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
33
- BOOL foundElement = NO;
34
-
35
- __block NSString *redboxError = nil;
36
- #ifdef DEBUG
37
- RCTSetLogFunction(
38
- ^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
39
- if (level >= RCTLogLevelError) {
40
- redboxError = message;
41
- }
42
- });
43
- #endif
44
-
45
- while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
46
- [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
47
- [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
48
-
49
- foundElement = [self findSubviewInView:vc.view
50
- matching:^BOOL(UIView *view) {
51
- if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
52
- return YES;
53
- }
54
- return NO;
55
- }];
56
- }
57
-
58
- #ifdef DEBUG
59
- RCTSetLogFunction(RCTDefaultLogFunction);
60
- #endif
61
-
62
- XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
63
- XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
64
- }
65
-
66
- @end
@@ -1,60 +0,0 @@
1
- require_relative '../node_modules/react-native/scripts/react_native_pods'
2
- require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
3
-
4
- platform :ios, min_ios_version_supported
5
- prepare_react_native_project!
6
-
7
- # If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
8
- # because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
9
- #
10
- # To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
11
- # ```js
12
- # module.exports = {
13
- # dependencies: {
14
- # ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
15
- # ```
16
- flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
17
-
18
- linkage = ENV['USE_FRAMEWORKS']
19
- if linkage != nil
20
- Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
21
- use_frameworks! :linkage => linkage.to_sym
22
- end
23
-
24
- target 'MosquitodbExample' do
25
- config = use_native_modules!
26
-
27
- # Flags change depending on the env values.
28
- flags = get_default_flags()
29
-
30
- use_react_native!(
31
- :path => config[:reactNativePath],
32
- # Hermes is now enabled by default. Disable by setting this flag to false.
33
- # Upcoming versions of React Native may rely on get_default_flags(), but
34
- # we make it explicit here to aid in the React Native upgrade process.
35
- :hermes_enabled => flags[:hermes_enabled],
36
- :fabric_enabled => flags[:fabric_enabled],
37
- # Enables Flipper.
38
- #
39
- # Note that if you have use_frameworks! enabled, Flipper will not work and
40
- # you should disable the next line.
41
- :flipper_configuration => flipper_config,
42
- # An absolute path to your application root.
43
- :app_path => "#{Pod::Config.instance.installation_root}/.."
44
- )
45
-
46
- target 'MosquitodbExampleTests' do
47
- inherit! :complete
48
- # Pods for testing
49
- end
50
-
51
- post_install do |installer|
52
- react_native_post_install(
53
- installer,
54
- # Set `mac_catalyst_enabled` to `true` in order to apply patches
55
- # necessary for Mac Catalyst builds
56
- :mac_catalyst_enabled => false
57
- )
58
- __apply_Xcode_12_5_M1_post_install_workaround(installer)
59
- end
60
- end
@@ -1,40 +0,0 @@
1
- const path = require('path');
2
- const escape = require('escape-string-regexp');
3
- const exclusionList = require('metro-config/src/defaults/exclusionList');
4
- const pak = require('../package.json');
5
-
6
- const root = path.resolve(__dirname, '..');
7
-
8
- const modules = Object.keys({
9
- ...pak.peerDependencies,
10
- });
11
-
12
- module.exports = {
13
- projectRoot: __dirname,
14
- watchFolders: [root],
15
-
16
- // We need to make sure that only one version is loaded for peerDependencies
17
- // So we block them at the root, and alias them to the versions in example's node_modules
18
- resolver: {
19
- blacklistRE: exclusionList(
20
- modules.map(
21
- (m) =>
22
- new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
23
- )
24
- ),
25
-
26
- extraNodeModules: modules.reduce((acc, name) => {
27
- acc[name] = path.join(__dirname, 'node_modules', name);
28
- return acc;
29
- }, {}),
30
- },
31
-
32
- transformer: {
33
- getTransformOptions: async () => ({
34
- transform: {
35
- experimentalImportSupport: false,
36
- inlineRequires: true,
37
- },
38
- }),
39
- },
40
- };
@@ -1,22 +0,0 @@
1
- {
2
- "name": "MosquitodbExample",
3
- "version": "0.0.1",
4
- "private": true,
5
- "scripts": {
6
- "android": "react-native run-android",
7
- "ios": "react-native run-ios",
8
- "start": "react-native start",
9
- "pods": "pod-install --quiet"
10
- },
11
- "dependencies": {
12
- "react": "18.2.0",
13
- "react-native": "0.71.8"
14
- },
15
- "devDependencies": {
16
- "@babel/core": "^7.20.0",
17
- "@babel/preset-env": "^7.20.0",
18
- "@babel/runtime": "^7.20.0",
19
- "metro-react-native-babel-preset": "0.73.9",
20
- "babel-plugin-module-resolver": "^4.1.0"
21
- }
22
- }
@@ -1,10 +0,0 @@
1
- const path = require('path');
2
- const pak = require('../package.json');
3
-
4
- module.exports = {
5
- dependencies: {
6
- [pak.name]: {
7
- root: path.join(__dirname, '..'),
8
- },
9
- },
10
- };
@@ -1,31 +0,0 @@
1
- import * as React from 'react';
2
-
3
- import { StyleSheet, View, Text } from 'react-native';
4
- import { multiply } from 'react-native-mosquitodb';
5
-
6
- export default function App() {
7
- const [result, setResult] = React.useState<number | undefined>();
8
-
9
- React.useEffect(() => {
10
- multiply(3, 7).then(setResult);
11
- }, []);
12
-
13
- return (
14
- <View style={styles.container}>
15
- <Text>Result: {result}</Text>
16
- </View>
17
- );
18
- }
19
-
20
- const styles = StyleSheet.create({
21
- container: {
22
- flex: 1,
23
- alignItems: 'center',
24
- justifyContent: 'center',
25
- },
26
- box: {
27
- width: 60,
28
- height: 60,
29
- marginVertical: 20,
30
- },
31
- });
@@ -1,2 +0,0 @@
1
- #import <React/RCTBridgeModule.h>
2
- #import <React/RCTViewManager.h>
package/ios/Mosquitodb.m DELETED
@@ -1,22 +0,0 @@
1
- #import <React/RCTBridgeModule.h>
2
-
3
- @interface RCT_EXTERN_MODULE(Mosquitodb, NSObject)
4
-
5
- RCT_EXTERN_METHOD(uploadFile:(NSDictionary *)options)
6
-
7
- RCT_EXTERN_METHOD(cancelUpload:(NSString *)processID)
8
-
9
- RCT_EXTERN_METHOD(downloadFile:(NSDictionary *)options)
10
-
11
- RCT_EXTERN_METHOD(cancelDownload:(NSString *)processID)
12
-
13
- RCT_EXTERN_METHOD(pauseDownload:(NSString *)processID)
14
-
15
- RCT_EXTERN_METHOD(resumeDownload:(NSString *)processID)
16
-
17
- + (BOOL)requiresMainQueueSetup
18
- {
19
- return NO;
20
- }
21
- @end
22
-