@travetto/web-rpc 8.0.0-alpha.22 → 8.0.0-alpha.24
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 +4 -3
- package/package.json +4 -4
- package/support/client/rpc.ts +3 -0
package/README.md
CHANGED
|
@@ -24,10 +24,11 @@ $ trv web:rpc-client --help
|
|
|
24
24
|
|
|
25
25
|
Usage: web:rpc-client [options] <type:config|node|web> [output:string]
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
Description:
|
|
28
|
+
Generate web-rpc client artifacts from a specified provider or leveraging local config.
|
|
28
29
|
|
|
29
|
-
Resolves generator services from DI and writes typed client code for the
|
|
30
|
-
selected provider target.
|
|
30
|
+
Resolves generator services from DI and writes typed client code for the
|
|
31
|
+
selected provider target.
|
|
31
32
|
|
|
32
33
|
Options:
|
|
33
34
|
-p, --profile <string> Application profiles
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/web-rpc",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.24",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "RPC support for a Web Application",
|
|
6
6
|
"keywords": [
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"directory": "module/web-rpc"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@travetto/config": "^8.0.0-alpha.
|
|
31
|
-
"@travetto/schema": "^8.0.0-alpha.
|
|
32
|
-
"@travetto/web": "^8.0.0-alpha.
|
|
30
|
+
"@travetto/config": "^8.0.0-alpha.19",
|
|
31
|
+
"@travetto/schema": "^8.0.0-alpha.19",
|
|
32
|
+
"@travetto/web": "^8.0.0-alpha.20"
|
|
33
33
|
},
|
|
34
34
|
"travetto": {
|
|
35
35
|
"displayName": "Web RPC Support"
|
package/support/client/rpc.ts
CHANGED
|
@@ -281,6 +281,9 @@ export async function invokeFetch<T>(request: RpcRequest, ...params: unknown[]):
|
|
|
281
281
|
|
|
282
282
|
if (resolved.ok) {
|
|
283
283
|
const text = await resolved.text();
|
|
284
|
+
if (resolved.status === 204 || !contentType || !text) {
|
|
285
|
+
return undefined!;
|
|
286
|
+
}
|
|
284
287
|
if (contentType === 'application/json') {
|
|
285
288
|
return await request.consumeJSON!<T>(text);
|
|
286
289
|
} else if (contentType === 'text/plain') {
|