@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.
Files changed (114) hide show
  1. package/LICENSE.md +22 -22
  2. package/README.md +302 -284
  3. package/android/build.gradle +31 -127
  4. package/android/src/main/AndroidManifest.xml +3 -3
  5. package/android/src/main/java/com/reactnativegrpc/GrpcMarshaller.java +27 -27
  6. package/android/src/main/java/com/reactnativegrpc/GrpcModule.java +730 -730
  7. package/android/src/main/java/com/reactnativegrpc/GrpcPackage.java +27 -27
  8. package/android/src/main/java/com/reactnativegrpc/SpkiPinTrustManager.java +101 -101
  9. package/android/src/main/java/com/reactnativegrpc/TrustManagers.java +51 -51
  10. package/ios/Grpc.h +22 -22
  11. package/ios/Grpc.m +627 -625
  12. package/ios/SpkiPinning.h +22 -22
  13. package/ios/SpkiPinning.m +162 -114
  14. package/lib/commonjs/bidi-streaming.js.map +1 -1
  15. package/lib/commonjs/channel.js +9 -9
  16. package/lib/commonjs/channel.js.map +1 -1
  17. package/lib/commonjs/client-streaming.js +3 -3
  18. package/lib/commonjs/client-streaming.js.map +1 -1
  19. package/lib/commonjs/client.js +24 -24
  20. package/lib/commonjs/client.js.map +1 -1
  21. package/lib/commonjs/create-client.js +5 -5
  22. package/lib/commonjs/create-client.js.map +1 -1
  23. package/lib/commonjs/errors.js.map +1 -1
  24. package/lib/commonjs/index.js.map +1 -1
  25. package/lib/commonjs/interceptors.js +3 -3
  26. package/lib/commonjs/interceptors.js.map +1 -1
  27. package/lib/commonjs/native.js.map +1 -1
  28. package/lib/commonjs/retry.js.map +1 -1
  29. package/lib/commonjs/server-streaming.js.map +1 -1
  30. package/lib/commonjs/status.js.map +1 -1
  31. package/lib/commonjs/types.js +5 -5
  32. package/lib/commonjs/types.js.map +1 -1
  33. package/lib/commonjs/unary.js.map +1 -1
  34. package/lib/module/bidi-streaming.js.map +1 -1
  35. package/lib/module/channel.js +9 -9
  36. package/lib/module/channel.js.map +1 -1
  37. package/lib/module/client-streaming.js +3 -3
  38. package/lib/module/client-streaming.js.map +1 -1
  39. package/lib/module/client.js +24 -24
  40. package/lib/module/client.js.map +1 -1
  41. package/lib/module/create-client.js +5 -5
  42. package/lib/module/create-client.js.map +1 -1
  43. package/lib/module/errors.js.map +1 -1
  44. package/lib/module/index.js.map +1 -1
  45. package/lib/module/interceptors.js +3 -3
  46. package/lib/module/interceptors.js.map +1 -1
  47. package/lib/module/native.js.map +1 -1
  48. package/lib/module/retry.js.map +1 -1
  49. package/lib/module/server-streaming.js.map +1 -1
  50. package/lib/module/status.js.map +1 -1
  51. package/lib/module/types.js +5 -5
  52. package/lib/module/types.js.map +1 -1
  53. package/lib/module/unary.js.map +1 -1
  54. package/lib/typescript/src/bidi-streaming.d.ts.map +1 -0
  55. package/lib/typescript/src/channel.d.ts.map +1 -0
  56. package/lib/typescript/src/client-streaming.d.ts.map +1 -0
  57. package/lib/typescript/src/client.d.ts.map +1 -0
  58. package/lib/typescript/src/create-client.d.ts.map +1 -0
  59. package/lib/typescript/src/errors.d.ts.map +1 -0
  60. package/lib/typescript/src/index.d.ts.map +1 -0
  61. package/lib/typescript/src/interceptors.d.ts.map +1 -0
  62. package/lib/typescript/src/native.d.ts.map +1 -0
  63. package/lib/typescript/src/retry.d.ts.map +1 -0
  64. package/lib/typescript/src/server-streaming.d.ts.map +1 -0
  65. package/lib/typescript/src/status.d.ts.map +1 -0
  66. package/lib/typescript/src/types.d.ts.map +1 -0
  67. package/lib/typescript/src/unary.d.ts.map +1 -0
  68. package/lib/typescript/test/app/App.d.ts +3 -0
  69. package/lib/typescript/test/app/App.d.ts.map +1 -0
  70. package/package.json +209 -210
  71. package/react-native-grpc.podspec +33 -29
  72. package/src/bidi-streaming.ts +78 -78
  73. package/src/channel.ts +110 -110
  74. package/src/client-streaming.ts +106 -106
  75. package/src/client.ts +1046 -1046
  76. package/src/create-client.ts +391 -391
  77. package/src/errors.ts +11 -11
  78. package/src/index.ts +28 -28
  79. package/src/interceptors.ts +167 -167
  80. package/src/native.ts +99 -99
  81. package/src/retry.ts +208 -208
  82. package/src/server-streaming.ts +105 -105
  83. package/src/status.ts +50 -50
  84. package/src/types.ts +171 -171
  85. package/src/unary.ts +71 -71
  86. package/android/gradle.properties +0 -4
  87. package/lib/typescript/bidi-streaming.d.ts.map +0 -1
  88. package/lib/typescript/channel.d.ts.map +0 -1
  89. package/lib/typescript/client-streaming.d.ts.map +0 -1
  90. package/lib/typescript/client.d.ts.map +0 -1
  91. package/lib/typescript/create-client.d.ts.map +0 -1
  92. package/lib/typescript/errors.d.ts.map +0 -1
  93. package/lib/typescript/index.d.ts.map +0 -1
  94. package/lib/typescript/interceptors.d.ts.map +0 -1
  95. package/lib/typescript/native.d.ts.map +0 -1
  96. package/lib/typescript/retry.d.ts.map +0 -1
  97. package/lib/typescript/server-streaming.d.ts.map +0 -1
  98. package/lib/typescript/status.d.ts.map +0 -1
  99. package/lib/typescript/types.d.ts.map +0 -1
  100. package/lib/typescript/unary.d.ts.map +0 -1
  101. /package/lib/typescript/{bidi-streaming.d.ts → src/bidi-streaming.d.ts} +0 -0
  102. /package/lib/typescript/{channel.d.ts → src/channel.d.ts} +0 -0
  103. /package/lib/typescript/{client-streaming.d.ts → src/client-streaming.d.ts} +0 -0
  104. /package/lib/typescript/{client.d.ts → src/client.d.ts} +0 -0
  105. /package/lib/typescript/{create-client.d.ts → src/create-client.d.ts} +0 -0
  106. /package/lib/typescript/{errors.d.ts → src/errors.d.ts} +0 -0
  107. /package/lib/typescript/{index.d.ts → src/index.d.ts} +0 -0
  108. /package/lib/typescript/{interceptors.d.ts → src/interceptors.d.ts} +0 -0
  109. /package/lib/typescript/{native.d.ts → src/native.d.ts} +0 -0
  110. /package/lib/typescript/{retry.d.ts → src/retry.d.ts} +0 -0
  111. /package/lib/typescript/{server-streaming.d.ts → src/server-streaming.d.ts} +0 -0
  112. /package/lib/typescript/{status.d.ts → src/status.d.ts} +0 -0
  113. /package/lib/typescript/{types.d.ts → src/types.d.ts} +0 -0
  114. /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": "1.1.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": "git+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
- "provenance": true
75
- },
76
- "packageManager": "yarn@1.22.22",
77
- "engines": {
78
- "node": ">=18"
79
- },
80
- "devDependencies": {
81
- "@bufbuild/protobuf": "^2.13.0",
82
- "@react-native-community/eslint-config": "^3.0.0",
83
- "@release-it/keep-a-changelog": "^3.0.0",
84
- "@types/jest": "^26.0.23",
85
- "@types/react": "^17.0.11",
86
- "@types/react-native": "0.70.6",
87
- "commitlint": "^12.1.4",
88
- "eslint": "^7.29.0",
89
- "eslint-config-prettier": "^8.3.0",
90
- "eslint-plugin-prettier": "^3.4.0",
91
- "husky": "^4.3.8",
92
- "jest": "^26.6.3",
93
- "pod-install": "^0.1.23",
94
- "prettier": "^2.3.1",
95
- "react": "17.0.2",
96
- "react-native": "0.70.6",
97
- "react-native-builder-bob": "^0.20.1",
98
- "release-it": "^15.0.0",
99
- "typescript": "^5.7.3",
100
- "xcode": "^3.0.1"
101
- },
102
- "peerDependencies": {
103
- "@bufbuild/protobuf": "^2.0.0",
104
- "react": "*",
105
- "react-native": "*"
106
- },
107
- "peerDependenciesMeta": {
108
- "@bufbuild/protobuf": {
109
- "optional": true
110
- }
111
- },
112
- "jest": {
113
- "preset": "react-native",
114
- "testMatch": [
115
- "**/__tests__/**/*.(test|spec).[jt]s?(x)"
116
- ],
117
- "modulePathIgnorePatterns": [
118
- "<rootDir>/example/node_modules",
119
- "<rootDir>/lib/"
120
- ],
121
- "moduleNameMapper": {
122
- "^@bufbuild/protobuf/codegenv2$": "<rootDir>/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/index.js",
123
- "^@bufbuild/protobuf/codegenv1$": "<rootDir>/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/index.js",
124
- "^@bufbuild/protobuf/reflect$": "<rootDir>/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/index.js",
125
- "^@bufbuild/protobuf/wkt$": "<rootDir>/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/index.js",
126
- "^@bufbuild/protobuf/wire$": "<rootDir>/node_modules/@bufbuild/protobuf/dist/commonjs/wire/index.js",
127
- "^@bufbuild/protobuf$": "<rootDir>/node_modules/@bufbuild/protobuf/dist/commonjs/index.js"
128
- },
129
- "transformIgnorePatterns": [
130
- "node_modules/(?!((jest-)?react-native|@react-native(-community)?|@bufbuild)/)"
131
- ]
132
- },
133
- "husky": {
134
- "hooks": {
135
- "pre-commit": "yarn lint && yarn typescript"
136
- }
137
- },
138
- "release-it": {
139
- "git": {
140
- "commitMessage": "chore: release ${version}",
141
- "tagName": "v${version}",
142
- "allowEmptyCommit": true,
143
- "push": true
144
- },
145
- "npm": {
146
- "publish": false
147
- },
148
- "github": {
149
- "release": false
150
- },
151
- "plugins": {
152
- "@release-it/keep-a-changelog": {
153
- "filename": "CHANGELOG.md"
154
- }
155
- }
156
- },
157
- "eslintConfig": {
158
- "root": true,
159
- "extends": [
160
- "@react-native-community",
161
- "prettier"
162
- ],
163
- "rules": {
164
- "prettier/prettier": [
165
- "error",
166
- {
167
- "quoteProps": "consistent",
168
- "singleQuote": true,
169
- "tabWidth": 2,
170
- "trailingComma": "es5",
171
- "useTabs": false
172
- }
173
- ]
174
- }
175
- },
176
- "eslintIgnore": [
177
- "node_modules/",
178
- "lib/",
179
- "example/src/_proto/",
180
- "example/src/gen/",
181
- "src/__fixtures__/"
182
- ],
183
- "prettier": {
184
- "quoteProps": "consistent",
185
- "singleQuote": true,
186
- "tabWidth": 2,
187
- "trailingComma": "es5",
188
- "useTabs": false,
189
- "endOfLine": "auto"
190
- },
191
- "react-native-builder-bob": {
192
- "source": "src",
193
- "output": "lib",
194
- "targets": [
195
- "commonjs",
196
- "module",
197
- [
198
- "typescript",
199
- {
200
- "project": "tsconfig.build.json"
201
- }
202
- ]
203
- ]
204
- },
205
- "dependencies": {
206
- "abort-controller": "^3.0.0",
207
- "base64-js": "^1.5.1",
208
- "eventemitter3": "^4.0.7"
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
- s.platforms = { :ios => "10.0" }
14
- s.source = { :git => "https://github.com/XDcobra/react-native-grpc.git", :tag => "#{s.version}" }
15
-
16
-
17
- s.source_files = "ios/**/*.{h,m,mm,swift}"
18
-
19
-
20
- s.dependency "React-Core"
21
- s.dependency "gRPC"
22
-
23
- # Pods directory corresponding to this app's Podfile, relative to the location of this podspec.
24
- pods_root = 'Pods'
25
-
26
- s.pod_target_xcconfig = {
27
- # This is needed by all pods that depend on gRPC-RxLibrary:
28
- 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
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
@@ -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
+ }