@xdcobra/react-native-grpc 1.1.0 → 2.0.0
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/LICENSE.md +22 -22
- package/README.md +302 -284
- package/android/build.gradle +31 -127
- package/android/src/main/AndroidManifest.xml +3 -3
- package/android/src/main/java/com/reactnativegrpc/GrpcMarshaller.java +27 -27
- package/android/src/main/java/com/reactnativegrpc/GrpcModule.java +730 -730
- package/android/src/main/java/com/reactnativegrpc/GrpcPackage.java +27 -27
- package/android/src/main/java/com/reactnativegrpc/SpkiPinTrustManager.java +101 -101
- package/android/src/main/java/com/reactnativegrpc/TrustManagers.java +51 -51
- package/ios/Grpc.h +22 -22
- package/ios/Grpc.m +627 -625
- package/ios/SpkiPinning.h +22 -22
- package/ios/SpkiPinning.m +162 -114
- package/lib/commonjs/bidi-streaming.js.map +1 -1
- package/lib/commonjs/channel.js +9 -9
- package/lib/commonjs/channel.js.map +1 -1
- package/lib/commonjs/client-streaming.js +3 -3
- package/lib/commonjs/client-streaming.js.map +1 -1
- package/lib/commonjs/client.js +24 -24
- package/lib/commonjs/client.js.map +1 -1
- package/lib/commonjs/create-client.js +5 -5
- package/lib/commonjs/create-client.js.map +1 -1
- package/lib/commonjs/errors.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/interceptors.js +3 -3
- package/lib/commonjs/interceptors.js.map +1 -1
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/retry.js.map +1 -1
- package/lib/commonjs/server-streaming.js.map +1 -1
- package/lib/commonjs/status.js.map +1 -1
- package/lib/commonjs/types.js +5 -5
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/unary.js.map +1 -1
- package/lib/module/bidi-streaming.js.map +1 -1
- package/lib/module/channel.js +9 -9
- package/lib/module/channel.js.map +1 -1
- package/lib/module/client-streaming.js +3 -3
- package/lib/module/client-streaming.js.map +1 -1
- package/lib/module/client.js +24 -24
- package/lib/module/client.js.map +1 -1
- package/lib/module/create-client.js +5 -5
- package/lib/module/create-client.js.map +1 -1
- package/lib/module/errors.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/interceptors.js +3 -3
- package/lib/module/interceptors.js.map +1 -1
- package/lib/module/native.js.map +1 -1
- package/lib/module/retry.js.map +1 -1
- package/lib/module/server-streaming.js.map +1 -1
- package/lib/module/status.js.map +1 -1
- package/lib/module/types.js +5 -5
- package/lib/module/types.js.map +1 -1
- package/lib/module/unary.js.map +1 -1
- package/lib/typescript/src/bidi-streaming.d.ts.map +1 -0
- package/lib/typescript/src/channel.d.ts.map +1 -0
- package/lib/typescript/src/client-streaming.d.ts.map +1 -0
- package/lib/typescript/src/client.d.ts.map +1 -0
- package/lib/typescript/src/create-client.d.ts.map +1 -0
- package/lib/typescript/src/errors.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/interceptors.d.ts.map +1 -0
- package/lib/typescript/src/native.d.ts.map +1 -0
- package/lib/typescript/src/retry.d.ts.map +1 -0
- package/lib/typescript/src/server-streaming.d.ts.map +1 -0
- package/lib/typescript/src/status.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/unary.d.ts.map +1 -0
- package/lib/typescript/test/app/App.d.ts +3 -0
- package/lib/typescript/test/app/App.d.ts.map +1 -0
- package/package.json +209 -210
- package/react-native-grpc.podspec +33 -29
- package/src/bidi-streaming.ts +78 -78
- package/src/channel.ts +110 -110
- package/src/client-streaming.ts +106 -106
- package/src/client.ts +1046 -1046
- package/src/create-client.ts +391 -391
- package/src/errors.ts +11 -11
- package/src/index.ts +28 -28
- package/src/interceptors.ts +167 -167
- package/src/native.ts +99 -99
- package/src/retry.ts +208 -208
- package/src/server-streaming.ts +105 -105
- package/src/status.ts +50 -50
- package/src/types.ts +171 -171
- package/src/unary.ts +71 -71
- package/android/gradle.properties +0 -4
- package/lib/typescript/bidi-streaming.d.ts.map +0 -1
- package/lib/typescript/channel.d.ts.map +0 -1
- package/lib/typescript/client-streaming.d.ts.map +0 -1
- package/lib/typescript/client.d.ts.map +0 -1
- package/lib/typescript/create-client.d.ts.map +0 -1
- package/lib/typescript/errors.d.ts.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/interceptors.d.ts.map +0 -1
- package/lib/typescript/native.d.ts.map +0 -1
- package/lib/typescript/retry.d.ts.map +0 -1
- package/lib/typescript/server-streaming.d.ts.map +0 -1
- package/lib/typescript/status.d.ts.map +0 -1
- package/lib/typescript/types.d.ts.map +0 -1
- package/lib/typescript/unary.d.ts.map +0 -1
- /package/lib/typescript/{bidi-streaming.d.ts → src/bidi-streaming.d.ts} +0 -0
- /package/lib/typescript/{channel.d.ts → src/channel.d.ts} +0 -0
- /package/lib/typescript/{client-streaming.d.ts → src/client-streaming.d.ts} +0 -0
- /package/lib/typescript/{client.d.ts → src/client.d.ts} +0 -0
- /package/lib/typescript/{create-client.d.ts → src/create-client.d.ts} +0 -0
- /package/lib/typescript/{errors.d.ts → src/errors.d.ts} +0 -0
- /package/lib/typescript/{index.d.ts → src/index.d.ts} +0 -0
- /package/lib/typescript/{interceptors.d.ts → src/interceptors.d.ts} +0 -0
- /package/lib/typescript/{native.d.ts → src/native.d.ts} +0 -0
- /package/lib/typescript/{retry.d.ts → src/retry.d.ts} +0 -0
- /package/lib/typescript/{server-streaming.d.ts → src/server-streaming.d.ts} +0 -0
- /package/lib/typescript/{status.d.ts → src/status.d.ts} +0 -0
- /package/lib/typescript/{types.d.ts → src/types.d.ts} +0 -0
- /package/lib/typescript/{unary.d.ts → src/unary.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,210 +1,209 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@xdcobra/react-native-grpc",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "gRPC for react-native (fork of @krishnafkh/react-native-grpc / Mitch528)",
|
|
5
|
-
"main": "lib/commonjs/index",
|
|
6
|
-
"module": "lib/module/index",
|
|
7
|
-
"types": "lib/typescript/index.d.ts",
|
|
8
|
-
"react-native": "src/index",
|
|
9
|
-
"source": "src/index",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": {
|
|
12
|
-
"react-native": "./src/index.ts",
|
|
13
|
-
"types": "./lib/typescript/index.d.ts",
|
|
14
|
-
"module": "./lib/module/index.js",
|
|
15
|
-
"default": "./lib/commonjs/index.js"
|
|
16
|
-
},
|
|
17
|
-
"./create-client": {
|
|
18
|
-
"react-native": "./src/create-client.ts",
|
|
19
|
-
"types": "./lib/typescript/create-client.d.ts",
|
|
20
|
-
"module": "./lib/module/create-client.js",
|
|
21
|
-
"default": "./lib/commonjs/create-client.js"
|
|
22
|
-
},
|
|
23
|
-
"./package.json": "./package.json"
|
|
24
|
-
},
|
|
25
|
-
"files": [
|
|
26
|
-
"src",
|
|
27
|
-
"lib",
|
|
28
|
-
"android",
|
|
29
|
-
"ios",
|
|
30
|
-
"react-native-grpc.podspec",
|
|
31
|
-
"!lib/typescript/example",
|
|
32
|
-
"!**/__tests__",
|
|
33
|
-
"!**/__fixtures__",
|
|
34
|
-
"!**/__mocks__",
|
|
35
|
-
"!**/node_modules",
|
|
36
|
-
"!android/build",
|
|
37
|
-
"!android/.project",
|
|
38
|
-
"!android/.settings",
|
|
39
|
-
"!android/.gradle",
|
|
40
|
-
"!ios/build",
|
|
41
|
-
"!ios/Grpc.xcodeproj"
|
|
42
|
-
],
|
|
43
|
-
"scripts": {
|
|
44
|
-
"test": "jest",
|
|
45
|
-
"typescript": "tsc --noEmit -p tsconfig.build.json",
|
|
46
|
-
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
47
|
-
"lint:fix": "eslint '**/*.{js,ts,tsx}' --fix",
|
|
48
|
-
"build": "bob build",
|
|
49
|
-
"prepare": "bob build",
|
|
50
|
-
"release": "release-it",
|
|
51
|
-
"example": "yarn --cwd example",
|
|
52
|
-
"pods": "cd example && pod-install --quiet",
|
|
53
|
-
"bootstrap": "yarn example && yarn && yarn pods"
|
|
54
|
-
},
|
|
55
|
-
"keywords": [
|
|
56
|
-
"react-native",
|
|
57
|
-
"ios",
|
|
58
|
-
"android",
|
|
59
|
-
"grpc"
|
|
60
|
-
],
|
|
61
|
-
"repository": {
|
|
62
|
-
"type": "git",
|
|
63
|
-
"url": "
|
|
64
|
-
},
|
|
65
|
-
"author": "XDcobra (fork; original Krishna / Mitch528)",
|
|
66
|
-
"license": "MIT",
|
|
67
|
-
"bugs": {
|
|
68
|
-
"url": "https://github.com/XDcobra/react-native-grpc/issues"
|
|
69
|
-
},
|
|
70
|
-
"homepage": "https://github.com/XDcobra/react-native-grpc#readme",
|
|
71
|
-
"publishConfig": {
|
|
72
|
-
"access": "public",
|
|
73
|
-
"registry": "https://registry.npmjs.org/"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"@
|
|
82
|
-
"@
|
|
83
|
-
"@
|
|
84
|
-
"@types/
|
|
85
|
-
"@types/react": "
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"eslint": "^
|
|
89
|
-
"eslint-
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"react": "
|
|
96
|
-
"react-native": "0.
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
"
|
|
104
|
-
"react": "
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
"<rootDir>/
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
"^@bufbuild/protobuf/
|
|
123
|
-
"^@bufbuild/protobuf/
|
|
124
|
-
"^@bufbuild/protobuf/
|
|
125
|
-
"^@bufbuild/protobuf/
|
|
126
|
-
"^@bufbuild/protobuf
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
"
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
"
|
|
159
|
-
|
|
160
|
-
"
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
"
|
|
178
|
-
"
|
|
179
|
-
"example/src/
|
|
180
|
-
"
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
"
|
|
185
|
-
"
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
"
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
"
|
|
193
|
-
"
|
|
194
|
-
|
|
195
|
-
"
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
"
|
|
207
|
-
"
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@xdcobra/react-native-grpc",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "gRPC for react-native (fork of @krishnafkh/react-native-grpc / Mitch528)",
|
|
5
|
+
"main": "lib/commonjs/index",
|
|
6
|
+
"module": "lib/module/index",
|
|
7
|
+
"types": "lib/typescript/index.d.ts",
|
|
8
|
+
"react-native": "src/index",
|
|
9
|
+
"source": "src/index",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"react-native": "./src/index.ts",
|
|
13
|
+
"types": "./lib/typescript/index.d.ts",
|
|
14
|
+
"module": "./lib/module/index.js",
|
|
15
|
+
"default": "./lib/commonjs/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./create-client": {
|
|
18
|
+
"react-native": "./src/create-client.ts",
|
|
19
|
+
"types": "./lib/typescript/create-client.d.ts",
|
|
20
|
+
"module": "./lib/module/create-client.js",
|
|
21
|
+
"default": "./lib/commonjs/create-client.js"
|
|
22
|
+
},
|
|
23
|
+
"./package.json": "./package.json"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"src",
|
|
27
|
+
"lib",
|
|
28
|
+
"android",
|
|
29
|
+
"ios",
|
|
30
|
+
"react-native-grpc.podspec",
|
|
31
|
+
"!lib/typescript/example",
|
|
32
|
+
"!**/__tests__",
|
|
33
|
+
"!**/__fixtures__",
|
|
34
|
+
"!**/__mocks__",
|
|
35
|
+
"!**/node_modules",
|
|
36
|
+
"!android/build",
|
|
37
|
+
"!android/.project",
|
|
38
|
+
"!android/.settings",
|
|
39
|
+
"!android/.gradle",
|
|
40
|
+
"!ios/build",
|
|
41
|
+
"!ios/Grpc.xcodeproj"
|
|
42
|
+
],
|
|
43
|
+
"scripts": {
|
|
44
|
+
"test": "jest",
|
|
45
|
+
"typescript": "tsc --noEmit -p tsconfig.build.json",
|
|
46
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
47
|
+
"lint:fix": "eslint '**/*.{js,ts,tsx}' --fix",
|
|
48
|
+
"build": "bob build",
|
|
49
|
+
"prepare": "bob build",
|
|
50
|
+
"release": "release-it",
|
|
51
|
+
"example": "yarn --cwd example",
|
|
52
|
+
"pods": "cd example && pod-install --quiet",
|
|
53
|
+
"bootstrap": "yarn example && yarn && yarn pods"
|
|
54
|
+
},
|
|
55
|
+
"keywords": [
|
|
56
|
+
"react-native",
|
|
57
|
+
"ios",
|
|
58
|
+
"android",
|
|
59
|
+
"grpc"
|
|
60
|
+
],
|
|
61
|
+
"repository": {
|
|
62
|
+
"type": "git",
|
|
63
|
+
"url": "https://github.com/XDcobra/react-native-grpc.git"
|
|
64
|
+
},
|
|
65
|
+
"author": "XDcobra (fork; original Krishna / Mitch528)",
|
|
66
|
+
"license": "MIT",
|
|
67
|
+
"bugs": {
|
|
68
|
+
"url": "https://github.com/XDcobra/react-native-grpc/issues"
|
|
69
|
+
},
|
|
70
|
+
"homepage": "https://github.com/XDcobra/react-native-grpc#readme",
|
|
71
|
+
"publishConfig": {
|
|
72
|
+
"access": "public",
|
|
73
|
+
"registry": "https://registry.npmjs.org/"
|
|
74
|
+
},
|
|
75
|
+
"packageManager": "yarn@1.22.22",
|
|
76
|
+
"engines": {
|
|
77
|
+
"node": ">=18"
|
|
78
|
+
},
|
|
79
|
+
"devDependencies": {
|
|
80
|
+
"@bufbuild/protobuf": "^2.13.0",
|
|
81
|
+
"@react-native-community/eslint-config": "^3.0.0",
|
|
82
|
+
"@release-it/keep-a-changelog": "^3.0.0",
|
|
83
|
+
"@types/jest": "^26.0.23",
|
|
84
|
+
"@types/react": "^17.0.11",
|
|
85
|
+
"@types/react-native": "0.70.6",
|
|
86
|
+
"commitlint": "^12.1.4",
|
|
87
|
+
"eslint": "^7.29.0",
|
|
88
|
+
"eslint-config-prettier": "^8.3.0",
|
|
89
|
+
"eslint-plugin-prettier": "^3.4.0",
|
|
90
|
+
"husky": "^4.3.8",
|
|
91
|
+
"jest": "^26.6.3",
|
|
92
|
+
"pod-install": "^0.1.23",
|
|
93
|
+
"prettier": "^2.3.1",
|
|
94
|
+
"react": "17.0.2",
|
|
95
|
+
"react-native": "0.70.6",
|
|
96
|
+
"react-native-builder-bob": "^0.20.1",
|
|
97
|
+
"release-it": "^15.0.0",
|
|
98
|
+
"typescript": "^5.7.3",
|
|
99
|
+
"xcode": "^3.0.1"
|
|
100
|
+
},
|
|
101
|
+
"peerDependencies": {
|
|
102
|
+
"@bufbuild/protobuf": "^2.0.0",
|
|
103
|
+
"react": ">=18.3.1",
|
|
104
|
+
"react-native": ">=0.76.0"
|
|
105
|
+
},
|
|
106
|
+
"peerDependenciesMeta": {
|
|
107
|
+
"@bufbuild/protobuf": {
|
|
108
|
+
"optional": true
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"jest": {
|
|
112
|
+
"preset": "react-native",
|
|
113
|
+
"testMatch": [
|
|
114
|
+
"**/__tests__/**/*.(test|spec).[jt]s?(x)"
|
|
115
|
+
],
|
|
116
|
+
"modulePathIgnorePatterns": [
|
|
117
|
+
"<rootDir>/example/node_modules",
|
|
118
|
+
"<rootDir>/lib/"
|
|
119
|
+
],
|
|
120
|
+
"moduleNameMapper": {
|
|
121
|
+
"^@bufbuild/protobuf/codegenv2$": "<rootDir>/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/index.js",
|
|
122
|
+
"^@bufbuild/protobuf/codegenv1$": "<rootDir>/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/index.js",
|
|
123
|
+
"^@bufbuild/protobuf/reflect$": "<rootDir>/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/index.js",
|
|
124
|
+
"^@bufbuild/protobuf/wkt$": "<rootDir>/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/index.js",
|
|
125
|
+
"^@bufbuild/protobuf/wire$": "<rootDir>/node_modules/@bufbuild/protobuf/dist/commonjs/wire/index.js",
|
|
126
|
+
"^@bufbuild/protobuf$": "<rootDir>/node_modules/@bufbuild/protobuf/dist/commonjs/index.js"
|
|
127
|
+
},
|
|
128
|
+
"transformIgnorePatterns": [
|
|
129
|
+
"node_modules/(?!((jest-)?react-native|@react-native(-community)?|@bufbuild)/)"
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
"husky": {
|
|
133
|
+
"hooks": {
|
|
134
|
+
"pre-commit": "yarn lint && yarn typescript"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"release-it": {
|
|
138
|
+
"git": {
|
|
139
|
+
"commitMessage": "chore: release ${version}",
|
|
140
|
+
"tagName": "v${version}",
|
|
141
|
+
"allowEmptyCommit": true,
|
|
142
|
+
"push": true
|
|
143
|
+
},
|
|
144
|
+
"npm": {
|
|
145
|
+
"publish": false
|
|
146
|
+
},
|
|
147
|
+
"github": {
|
|
148
|
+
"release": false
|
|
149
|
+
},
|
|
150
|
+
"plugins": {
|
|
151
|
+
"@release-it/keep-a-changelog": {
|
|
152
|
+
"filename": "CHANGELOG.md"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"eslintConfig": {
|
|
157
|
+
"root": true,
|
|
158
|
+
"extends": [
|
|
159
|
+
"@react-native-community",
|
|
160
|
+
"prettier"
|
|
161
|
+
],
|
|
162
|
+
"rules": {
|
|
163
|
+
"prettier/prettier": [
|
|
164
|
+
"error",
|
|
165
|
+
{
|
|
166
|
+
"quoteProps": "consistent",
|
|
167
|
+
"singleQuote": true,
|
|
168
|
+
"tabWidth": 2,
|
|
169
|
+
"trailingComma": "es5",
|
|
170
|
+
"useTabs": false
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"eslintIgnore": [
|
|
176
|
+
"node_modules/",
|
|
177
|
+
"lib/",
|
|
178
|
+
"example/src/_proto/",
|
|
179
|
+
"example/src/gen/",
|
|
180
|
+
"src/__fixtures__/"
|
|
181
|
+
],
|
|
182
|
+
"prettier": {
|
|
183
|
+
"quoteProps": "consistent",
|
|
184
|
+
"singleQuote": true,
|
|
185
|
+
"tabWidth": 2,
|
|
186
|
+
"trailingComma": "es5",
|
|
187
|
+
"useTabs": false,
|
|
188
|
+
"endOfLine": "auto"
|
|
189
|
+
},
|
|
190
|
+
"react-native-builder-bob": {
|
|
191
|
+
"source": "src",
|
|
192
|
+
"output": "lib",
|
|
193
|
+
"targets": [
|
|
194
|
+
"commonjs",
|
|
195
|
+
"module",
|
|
196
|
+
[
|
|
197
|
+
"typescript",
|
|
198
|
+
{
|
|
199
|
+
"project": "tsconfig.build.json"
|
|
200
|
+
}
|
|
201
|
+
]
|
|
202
|
+
]
|
|
203
|
+
},
|
|
204
|
+
"dependencies": {
|
|
205
|
+
"abort-controller": "^3.0.0",
|
|
206
|
+
"base64-js": "^1.5.1",
|
|
207
|
+
"eventemitter3": "^4.0.7"
|
|
208
|
+
}
|
|
209
|
+
}
|
|
@@ -1,30 +1,34 @@
|
|
|
1
|
-
require "json"
|
|
2
|
-
|
|
3
|
-
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
-
|
|
5
|
-
Pod::Spec.new do |s|
|
|
6
|
-
s.name = "react-native-grpc"
|
|
7
|
-
s.version = package["version"]
|
|
8
|
-
s.summary = package["description"]
|
|
9
|
-
s.homepage = package["homepage"]
|
|
10
|
-
s.license = package["license"]
|
|
11
|
-
s.authors = package["author"]
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
s.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
s.dependency "
|
|
22
|
-
|
|
23
|
-
#
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "react-native-grpc"
|
|
7
|
+
s.version = package["version"]
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.homepage = package["homepage"]
|
|
10
|
+
s.license = package["license"]
|
|
11
|
+
s.authors = package["author"]
|
|
12
|
+
|
|
13
|
+
# iOS 15.1 is the minimum of React Native 0.76+, the minimum supported version of this package.
|
|
14
|
+
s.platforms = { :ios => "15.1" }
|
|
15
|
+
s.source = { :git => "https://github.com/XDcobra/react-native-grpc.git", :tag => "#{s.version}" }
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
s.dependency "React-Core"
|
|
22
|
+
# gRPC 1.85.0 pulls abseil 1.20260526.0, whose CocoaPods spec compiles the Windows-only
|
|
23
|
+
# time_zone_name_win.cc on Apple platforms (fatal error: 'windows.h' file not found).
|
|
24
|
+
# Stay on 1.84.x until that is fixed upstream, then widen this range.
|
|
25
|
+
s.dependency "gRPC", ">= 1.84.1", "< 1.85.0"
|
|
26
|
+
|
|
27
|
+
# Pods directory corresponding to this app's Podfile, relative to the location of this podspec.
|
|
28
|
+
pods_root = 'Pods'
|
|
29
|
+
|
|
30
|
+
s.pod_target_xcconfig = {
|
|
31
|
+
# This is needed by all pods that depend on gRPC-RxLibrary:
|
|
32
|
+
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
|
|
33
|
+
}
|
|
30
34
|
end
|
package/src/bidi-streaming.ts
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import { AbortController } from 'abort-controller';
|
|
2
|
-
import {
|
|
3
|
-
CompletedGrpcBidiStreamingCall,
|
|
4
|
-
GrpcMetadata,
|
|
5
|
-
GrpcServerInputStream,
|
|
6
|
-
GrpcServerOutputStream,
|
|
7
|
-
} from './types';
|
|
8
|
-
|
|
9
|
-
export class GrpcBidiStreamingCall
|
|
10
|
-
implements PromiseLike<CompletedGrpcBidiStreamingCall>
|
|
11
|
-
{
|
|
12
|
-
readonly method: string;
|
|
13
|
-
readonly requestHeaders: GrpcMetadata;
|
|
14
|
-
readonly requests: GrpcServerInputStream;
|
|
15
|
-
readonly headers: Promise<GrpcMetadata>;
|
|
16
|
-
readonly responses: GrpcServerOutputStream;
|
|
17
|
-
readonly trailers: Promise<GrpcMetadata>;
|
|
18
|
-
|
|
19
|
-
#abort: AbortController;
|
|
20
|
-
|
|
21
|
-
constructor(
|
|
22
|
-
method: string,
|
|
23
|
-
requestHeaders: GrpcMetadata,
|
|
24
|
-
requests: GrpcServerInputStream,
|
|
25
|
-
headers: Promise<GrpcMetadata>,
|
|
26
|
-
responses: GrpcServerOutputStream,
|
|
27
|
-
trailers: Promise<GrpcMetadata>,
|
|
28
|
-
abort: AbortController
|
|
29
|
-
) {
|
|
30
|
-
this.method = method;
|
|
31
|
-
this.requestHeaders = requestHeaders;
|
|
32
|
-
this.requests = requests;
|
|
33
|
-
this.headers = headers;
|
|
34
|
-
this.responses = responses;
|
|
35
|
-
this.trailers = trailers;
|
|
36
|
-
this.#abort = abort;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
then<TResult1 = CompletedGrpcBidiStreamingCall, TResult2 = unknown>(
|
|
40
|
-
onfulfilled?:
|
|
41
|
-
| ((
|
|
42
|
-
value: CompletedGrpcBidiStreamingCall
|
|
43
|
-
) => TResult1 | PromiseLike<TResult1>)
|
|
44
|
-
| null,
|
|
45
|
-
onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null
|
|
46
|
-
): PromiseLike<TResult1 | TResult2> {
|
|
47
|
-
return this.completedPromise().then(
|
|
48
|
-
(value) =>
|
|
49
|
-
onfulfilled
|
|
50
|
-
? Promise.resolve(onfulfilled(value))
|
|
51
|
-
: (value as unknown as TResult1),
|
|
52
|
-
(reason) =>
|
|
53
|
-
onrejected
|
|
54
|
-
? Promise.resolve(onrejected(reason))
|
|
55
|
-
: Promise.reject(reason)
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
cancel() {
|
|
60
|
-
this.#abort.abort();
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
private async completedPromise(): Promise<CompletedGrpcBidiStreamingCall> {
|
|
64
|
-
const [headers, trailers] = await Promise.all([
|
|
65
|
-
this.headers,
|
|
66
|
-
this.trailers,
|
|
67
|
-
]);
|
|
68
|
-
|
|
69
|
-
return {
|
|
70
|
-
method: this.method,
|
|
71
|
-
requestHeaders: this.requestHeaders,
|
|
72
|
-
headers,
|
|
73
|
-
responses: this.responses,
|
|
74
|
-
trailers,
|
|
75
|
-
status: 0,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
}
|
|
1
|
+
import { AbortController } from 'abort-controller';
|
|
2
|
+
import {
|
|
3
|
+
CompletedGrpcBidiStreamingCall,
|
|
4
|
+
GrpcMetadata,
|
|
5
|
+
GrpcServerInputStream,
|
|
6
|
+
GrpcServerOutputStream,
|
|
7
|
+
} from './types';
|
|
8
|
+
|
|
9
|
+
export class GrpcBidiStreamingCall
|
|
10
|
+
implements PromiseLike<CompletedGrpcBidiStreamingCall>
|
|
11
|
+
{
|
|
12
|
+
readonly method: string;
|
|
13
|
+
readonly requestHeaders: GrpcMetadata;
|
|
14
|
+
readonly requests: GrpcServerInputStream;
|
|
15
|
+
readonly headers: Promise<GrpcMetadata>;
|
|
16
|
+
readonly responses: GrpcServerOutputStream;
|
|
17
|
+
readonly trailers: Promise<GrpcMetadata>;
|
|
18
|
+
|
|
19
|
+
#abort: AbortController;
|
|
20
|
+
|
|
21
|
+
constructor(
|
|
22
|
+
method: string,
|
|
23
|
+
requestHeaders: GrpcMetadata,
|
|
24
|
+
requests: GrpcServerInputStream,
|
|
25
|
+
headers: Promise<GrpcMetadata>,
|
|
26
|
+
responses: GrpcServerOutputStream,
|
|
27
|
+
trailers: Promise<GrpcMetadata>,
|
|
28
|
+
abort: AbortController
|
|
29
|
+
) {
|
|
30
|
+
this.method = method;
|
|
31
|
+
this.requestHeaders = requestHeaders;
|
|
32
|
+
this.requests = requests;
|
|
33
|
+
this.headers = headers;
|
|
34
|
+
this.responses = responses;
|
|
35
|
+
this.trailers = trailers;
|
|
36
|
+
this.#abort = abort;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
then<TResult1 = CompletedGrpcBidiStreamingCall, TResult2 = unknown>(
|
|
40
|
+
onfulfilled?:
|
|
41
|
+
| ((
|
|
42
|
+
value: CompletedGrpcBidiStreamingCall
|
|
43
|
+
) => TResult1 | PromiseLike<TResult1>)
|
|
44
|
+
| null,
|
|
45
|
+
onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null
|
|
46
|
+
): PromiseLike<TResult1 | TResult2> {
|
|
47
|
+
return this.completedPromise().then(
|
|
48
|
+
(value) =>
|
|
49
|
+
onfulfilled
|
|
50
|
+
? Promise.resolve(onfulfilled(value))
|
|
51
|
+
: (value as unknown as TResult1),
|
|
52
|
+
(reason) =>
|
|
53
|
+
onrejected
|
|
54
|
+
? Promise.resolve(onrejected(reason))
|
|
55
|
+
: Promise.reject(reason)
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
cancel() {
|
|
60
|
+
this.#abort.abort();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
private async completedPromise(): Promise<CompletedGrpcBidiStreamingCall> {
|
|
64
|
+
const [headers, trailers] = await Promise.all([
|
|
65
|
+
this.headers,
|
|
66
|
+
this.trailers,
|
|
67
|
+
]);
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
method: this.method,
|
|
71
|
+
requestHeaders: this.requestHeaders,
|
|
72
|
+
headers,
|
|
73
|
+
responses: this.responses,
|
|
74
|
+
trailers,
|
|
75
|
+
status: 0,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|