@xdcobra/react-native-grpc 1.1.0 → 1.1.8

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 (70) hide show
  1. package/LICENSE.md +22 -22
  2. package/README.md +284 -284
  3. package/android/build.gradle +127 -127
  4. package/android/gradle.properties +4 -4
  5. package/android/src/main/AndroidManifest.xml +3 -3
  6. package/android/src/main/java/com/reactnativegrpc/GrpcMarshaller.java +27 -27
  7. package/android/src/main/java/com/reactnativegrpc/GrpcModule.java +730 -730
  8. package/android/src/main/java/com/reactnativegrpc/GrpcPackage.java +27 -27
  9. package/android/src/main/java/com/reactnativegrpc/SpkiPinTrustManager.java +101 -101
  10. package/android/src/main/java/com/reactnativegrpc/TrustManagers.java +51 -51
  11. package/ios/Grpc.h +22 -22
  12. package/ios/Grpc.m +625 -625
  13. package/ios/SpkiPinning.h +22 -22
  14. package/ios/SpkiPinning.m +114 -114
  15. package/lib/commonjs/bidi-streaming.js.map +1 -1
  16. package/lib/commonjs/channel.js +9 -9
  17. package/lib/commonjs/channel.js.map +1 -1
  18. package/lib/commonjs/client-streaming.js +3 -3
  19. package/lib/commonjs/client-streaming.js.map +1 -1
  20. package/lib/commonjs/client.js +24 -24
  21. package/lib/commonjs/client.js.map +1 -1
  22. package/lib/commonjs/create-client.js +5 -5
  23. package/lib/commonjs/create-client.js.map +1 -1
  24. package/lib/commonjs/errors.js.map +1 -1
  25. package/lib/commonjs/index.js.map +1 -1
  26. package/lib/commonjs/interceptors.js +3 -3
  27. package/lib/commonjs/interceptors.js.map +1 -1
  28. package/lib/commonjs/native.js.map +1 -1
  29. package/lib/commonjs/retry.js.map +1 -1
  30. package/lib/commonjs/server-streaming.js.map +1 -1
  31. package/lib/commonjs/status.js.map +1 -1
  32. package/lib/commonjs/types.js +5 -5
  33. package/lib/commonjs/types.js.map +1 -1
  34. package/lib/commonjs/unary.js.map +1 -1
  35. package/lib/module/bidi-streaming.js.map +1 -1
  36. package/lib/module/channel.js +9 -9
  37. package/lib/module/channel.js.map +1 -1
  38. package/lib/module/client-streaming.js +3 -3
  39. package/lib/module/client-streaming.js.map +1 -1
  40. package/lib/module/client.js +24 -24
  41. package/lib/module/client.js.map +1 -1
  42. package/lib/module/create-client.js +5 -5
  43. package/lib/module/create-client.js.map +1 -1
  44. package/lib/module/errors.js.map +1 -1
  45. package/lib/module/index.js.map +1 -1
  46. package/lib/module/interceptors.js +3 -3
  47. package/lib/module/interceptors.js.map +1 -1
  48. package/lib/module/native.js.map +1 -1
  49. package/lib/module/retry.js.map +1 -1
  50. package/lib/module/server-streaming.js.map +1 -1
  51. package/lib/module/status.js.map +1 -1
  52. package/lib/module/types.js +5 -5
  53. package/lib/module/types.js.map +1 -1
  54. package/lib/module/unary.js.map +1 -1
  55. package/package.json +209 -210
  56. package/react-native-grpc.podspec +29 -29
  57. package/src/bidi-streaming.ts +78 -78
  58. package/src/channel.ts +110 -110
  59. package/src/client-streaming.ts +106 -106
  60. package/src/client.ts +1046 -1046
  61. package/src/create-client.ts +391 -391
  62. package/src/errors.ts +11 -11
  63. package/src/index.ts +28 -28
  64. package/src/interceptors.ts +167 -167
  65. package/src/native.ts +99 -99
  66. package/src/retry.ts +208 -208
  67. package/src/server-streaming.ts +105 -105
  68. package/src/status.ts +50 -50
  69. package/src/types.ts +171 -171
  70. package/src/unary.ts +71 -71
@@ -1,127 +1,127 @@
1
- buildscript {
2
- // Buildscript is evaluated before everything else so we can't use getExtOrDefault
3
-
4
- repositories {
5
- google()
6
- mavenCentral()
7
- mavenLocal()
8
- }
9
-
10
- dependencies {
11
- classpath 'com.android.tools.build:gradle:4.2.1'
12
- }
13
- }
14
-
15
- apply plugin: 'com.android.library'
16
-
17
- def getExtOrDefault(name) {
18
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['Grpc_' + name]
19
- }
20
-
21
- def getExtOrIntegerDefault(name) {
22
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['Grpc_' + name]).toInteger()
23
- }
24
-
25
- android {
26
- namespace 'com.reactnativegrpc'
27
- compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
28
- buildToolsVersion getExtOrDefault('buildToolsVersion')
29
- defaultConfig {
30
- minSdkVersion 24
31
- targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
32
- versionCode 1
33
- versionName "1.0"
34
-
35
- }
36
-
37
- buildTypes {
38
- release {
39
- minifyEnabled false
40
- }
41
- }
42
- lintOptions {
43
- disable 'GradleCompatible'
44
- }
45
- compileOptions {
46
- sourceCompatibility JavaVersion.VERSION_1_8
47
- targetCompatibility JavaVersion.VERSION_1_8
48
- }
49
- }
50
-
51
- repositories {
52
- mavenCentral()
53
- google()
54
-
55
- def found = false
56
- def defaultDir = null
57
- def androidSourcesName = 'React Native sources'
58
-
59
- if (rootProject.ext.has('reactNativeAndroidRoot')) {
60
- defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
61
- } else {
62
- defaultDir = new File(
63
- projectDir,
64
- '/../../../node_modules/react-native/android'
65
- )
66
- }
67
-
68
- if (defaultDir.exists()) {
69
- maven {
70
- url defaultDir.toString()
71
- name androidSourcesName
72
- }
73
-
74
- logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
75
- found = true
76
- } else {
77
- def parentDir = rootProject.projectDir
78
-
79
- 1.upto(5, {
80
- if (found) return true
81
- parentDir = parentDir.parentFile
82
-
83
- def androidSourcesDir = new File(
84
- parentDir,
85
- 'node_modules/react-native'
86
- )
87
-
88
- def androidPrebuiltBinaryDir = new File(
89
- parentDir,
90
- 'node_modules/react-native/android'
91
- )
92
-
93
- if (androidPrebuiltBinaryDir.exists()) {
94
- maven {
95
- url androidPrebuiltBinaryDir.toString()
96
- name androidSourcesName
97
- }
98
-
99
- logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
100
- found = true
101
- } else if (androidSourcesDir.exists()) {
102
- maven {
103
- url androidSourcesDir.toString()
104
- name androidSourcesName
105
- }
106
-
107
- logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
108
- found = true
109
- }
110
- })
111
- }
112
-
113
- if (!found) {
114
- throw new GradleException(
115
- "${project.name}: unable to locate React Native android sources. " +
116
- "Ensure you have you installed React Native as a dependency in your project and try again."
117
- )
118
- }
119
- }
120
-
121
- dependencies {
122
- // noinspection GradleDynamicVersion
123
- implementation 'io.grpc:grpc-okhttp:1.51.0'// CURRENT_GRPC_VERSION
124
- implementation 'io.grpc:grpc-stub:1.51.0' // CURRENT_GRPC_VERSION
125
-
126
- api 'com.facebook.react:react-native:+'
127
- }
1
+ buildscript {
2
+ // Buildscript is evaluated before everything else so we can't use getExtOrDefault
3
+
4
+ repositories {
5
+ google()
6
+ mavenCentral()
7
+ mavenLocal()
8
+ }
9
+
10
+ dependencies {
11
+ classpath 'com.android.tools.build:gradle:4.2.1'
12
+ }
13
+ }
14
+
15
+ apply plugin: 'com.android.library'
16
+
17
+ def getExtOrDefault(name) {
18
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['Grpc_' + name]
19
+ }
20
+
21
+ def getExtOrIntegerDefault(name) {
22
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['Grpc_' + name]).toInteger()
23
+ }
24
+
25
+ android {
26
+ namespace 'com.reactnativegrpc'
27
+ compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
28
+ buildToolsVersion getExtOrDefault('buildToolsVersion')
29
+ defaultConfig {
30
+ minSdkVersion 24
31
+ targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
32
+ versionCode 1
33
+ versionName "1.0"
34
+
35
+ }
36
+
37
+ buildTypes {
38
+ release {
39
+ minifyEnabled false
40
+ }
41
+ }
42
+ lintOptions {
43
+ disable 'GradleCompatible'
44
+ }
45
+ compileOptions {
46
+ sourceCompatibility JavaVersion.VERSION_1_8
47
+ targetCompatibility JavaVersion.VERSION_1_8
48
+ }
49
+ }
50
+
51
+ repositories {
52
+ mavenCentral()
53
+ google()
54
+
55
+ def found = false
56
+ def defaultDir = null
57
+ def androidSourcesName = 'React Native sources'
58
+
59
+ if (rootProject.ext.has('reactNativeAndroidRoot')) {
60
+ defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
61
+ } else {
62
+ defaultDir = new File(
63
+ projectDir,
64
+ '/../../../node_modules/react-native/android'
65
+ )
66
+ }
67
+
68
+ if (defaultDir.exists()) {
69
+ maven {
70
+ url defaultDir.toString()
71
+ name androidSourcesName
72
+ }
73
+
74
+ logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
75
+ found = true
76
+ } else {
77
+ def parentDir = rootProject.projectDir
78
+
79
+ 1.upto(5, {
80
+ if (found) return true
81
+ parentDir = parentDir.parentFile
82
+
83
+ def androidSourcesDir = new File(
84
+ parentDir,
85
+ 'node_modules/react-native'
86
+ )
87
+
88
+ def androidPrebuiltBinaryDir = new File(
89
+ parentDir,
90
+ 'node_modules/react-native/android'
91
+ )
92
+
93
+ if (androidPrebuiltBinaryDir.exists()) {
94
+ maven {
95
+ url androidPrebuiltBinaryDir.toString()
96
+ name androidSourcesName
97
+ }
98
+
99
+ logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
100
+ found = true
101
+ } else if (androidSourcesDir.exists()) {
102
+ maven {
103
+ url androidSourcesDir.toString()
104
+ name androidSourcesName
105
+ }
106
+
107
+ logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
108
+ found = true
109
+ }
110
+ })
111
+ }
112
+
113
+ if (!found) {
114
+ throw new GradleException(
115
+ "${project.name}: unable to locate React Native android sources. " +
116
+ "Ensure you have you installed React Native as a dependency in your project and try again."
117
+ )
118
+ }
119
+ }
120
+
121
+ dependencies {
122
+ // noinspection GradleDynamicVersion
123
+ implementation 'io.grpc:grpc-okhttp:1.51.0'// CURRENT_GRPC_VERSION
124
+ implementation 'io.grpc:grpc-stub:1.51.0' // CURRENT_GRPC_VERSION
125
+
126
+ api 'com.facebook.react:react-native:+'
127
+ }
@@ -1,4 +1,4 @@
1
- Grpc_kotlinVersion=1.3.50
2
- Grpc_compileSdkVersion=29
3
- Grpc_buildToolsVersion=29.0.2
4
- Grpc_targetSdkVersion=29
1
+ Grpc_kotlinVersion=1.3.50
2
+ Grpc_compileSdkVersion=29
3
+ Grpc_buildToolsVersion=29.0.2
4
+ Grpc_targetSdkVersion=29
@@ -1,3 +1,3 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
-
3
- </manifest>
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+
3
+ </manifest>
@@ -1,27 +1,27 @@
1
- package com.reactnativegrpc;
2
-
3
- import com.google.common.io.ByteStreams;
4
-
5
- import java.io.ByteArrayInputStream;
6
- import java.io.IOException;
7
- import java.io.InputStream;
8
-
9
- import io.grpc.MethodDescriptor;
10
-
11
- public class GrpcMarshaller implements MethodDescriptor.Marshaller<byte[]> {
12
- @Override
13
- public InputStream stream(byte[] value) {
14
- return new ByteArrayInputStream(value);
15
- }
16
-
17
- @Override
18
- public byte[] parse(InputStream stream) {
19
- try {
20
- return ByteStreams.toByteArray(stream);
21
- } catch (IOException e) {
22
- e.printStackTrace();
23
-
24
- return null;
25
- }
26
- }
27
- }
1
+ package com.reactnativegrpc;
2
+
3
+ import com.google.common.io.ByteStreams;
4
+
5
+ import java.io.ByteArrayInputStream;
6
+ import java.io.IOException;
7
+ import java.io.InputStream;
8
+
9
+ import io.grpc.MethodDescriptor;
10
+
11
+ public class GrpcMarshaller implements MethodDescriptor.Marshaller<byte[]> {
12
+ @Override
13
+ public InputStream stream(byte[] value) {
14
+ return new ByteArrayInputStream(value);
15
+ }
16
+
17
+ @Override
18
+ public byte[] parse(InputStream stream) {
19
+ try {
20
+ return ByteStreams.toByteArray(stream);
21
+ } catch (IOException e) {
22
+ e.printStackTrace();
23
+
24
+ return null;
25
+ }
26
+ }
27
+ }