Skip to content

Commit 1c8a5e1

Browse files
authored
Merge pull request #24 from webrpc/header-type
Add missing types to request header
2 parents dffc0ff + f5c8398 commit 1c8a5e1

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

_examples/node-ts/server/server.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/* eslint-disable */
22
// node-ts v1.0.0 6713366104e62b8479d628a193e2a7ca03f37edc
33
// --
4-
// Code generated by webrpc-gen@v0.20.3-2-g18c094a with ../../../gen-typescript generator. DO NOT EDIT.
4+
// Code generated by webrpc-gen@v0.21.0-1-g96d144e with ../../../gen-typescript generator. DO NOT EDIT.
55
//
66
// webrpc-gen -schema=service.ridl -target=../../../gen-typescript -server -out=./server/server.gen.ts
77

88
export const WebrpcHeader = "Webrpc"
99

10-
export const WebrpcHeaderValue = "webrpc@v0.20.3-2-g18c094a;gen-typescript@unknown;node-ts@v1.0.0"
10+
export const WebrpcHeaderValue = "webrpc@v0.21.0-1-g96d144e;gen-typescript@unknown;node-ts@v1.0.0"
1111

1212
// WebRPC description and code-gen version
1313
export const WebRPCVersion = "v1"

_examples/node-ts/webapp/client.gen.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/* eslint-disable */
22
// node-ts v1.0.0 6713366104e62b8479d628a193e2a7ca03f37edc
33
// --
4-
// Code generated by webrpc-gen@v0.20.3-2-g18c094a with ../../../gen-typescript generator. DO NOT EDIT.
4+
// Code generated by webrpc-gen@v0.21.0-1-g96d144e with ../../../gen-typescript generator. DO NOT EDIT.
55
//
66
// webrpc-gen -schema=service.ridl -target=../../../gen-typescript -client -out=./webapp/client.gen.ts
77

88
export const WebrpcHeader = "Webrpc"
99

10-
export const WebrpcHeaderValue = "webrpc@v0.20.3-2-g18c094a;gen-typescript@unknown;node-ts@v1.0.0"
10+
export const WebrpcHeaderValue = "webrpc@v0.21.0-1-g96d144e;gen-typescript@unknown;node-ts@v1.0.0"
1111

1212
// WebRPC description and code-gen version
1313
export const WebRPCVersion = "v1"
@@ -157,7 +157,7 @@ export class ExampleService implements ExampleService {
157157
}
158158

159159
const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => {
160-
const reqHeaders = { ...headers, 'Content-Type': 'application/json' }
160+
const reqHeaders: {[key: string]: string} = { ...headers, 'Content-Type': 'application/json' }
161161
reqHeaders[WebrpcHeader] = WebrpcHeaderValue
162162

163163
return {

_examples/sse/webapp/client.gen.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/* eslint-disable */
22
// webrpc-sse-chat v1.0.0 a799dc63b082644f5d003c8881424546aee23a2c
33
// --
4-
// Code generated by webrpc-gen@v0.20.3-2-g18c094a with ../../ generator. DO NOT EDIT.
4+
// Code generated by webrpc-gen@v0.21.0-1-g96d144e with ../../ generator. DO NOT EDIT.
55
//
66
// webrpc-gen -schema=service.ridl -target=../../ -client -out=./webapp/client.gen.ts
77

88
export const WebrpcHeader = "Webrpc"
99

10-
export const WebrpcHeaderValue = "webrpc@v0.20.3-2-g18c094a;@unknown;webrpc-sse-chat@v1.0.0"
10+
export const WebrpcHeaderValue = "webrpc@v0.21.0-1-g96d144e;@unknown;webrpc-sse-chat@v1.0.0"
1111

1212
// WebRPC description and code-gen version
1313
export const WebRPCVersion = "v1"
@@ -285,7 +285,7 @@ const sseResponse = async (
285285

286286

287287
const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => {
288-
const reqHeaders = { ...headers, 'Content-Type': 'application/json' }
288+
const reqHeaders: {[key: string]: string} = { ...headers, 'Content-Type': 'application/json' }
289289
reqHeaders[WebrpcHeader] = WebrpcHeaderValue
290290

291291
return {

clientHelpers.go.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{- $schemaErrors := .SchemaErrors -}}
44
{{- $opts := .Opts -}}
55
const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => {
6-
const reqHeaders = { ...headers, 'Content-Type': 'application/json' }
6+
const reqHeaders: {[key: string]: string} = { ...headers, 'Content-Type': 'application/json' }
77
{{- if eq $opts.webrpcHeader true }}
88
reqHeaders[WebrpcHeader] = WebrpcHeaderValue
99
{{- end }}

0 commit comments

Comments
 (0)