Skip to content

Commit

Permalink
release 2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Gehorsam committed Aug 3, 2021
1 parent 36ec100 commit ca70b76
Show file tree
Hide file tree
Showing 12 changed files with 1,508 additions and 798 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ All notable changes to this project are documented below.

The format is based on [keep a changelog](http://keepachangelog.com/) and this project uses [semantic versioning](http://semver.org/).

### [2.3.0]

### Fixed
- Fixed 401 Unauthorized Responses from the server in response to `rpcHttpKey`.

### Changed
- Changed parameter list optionals and sequencing in `rpcHttpKey`.
- The signature is now listed as follows: `rpcHttpKey(httpKey: string, id: string, input?: object);`

- Renamed `ApiOverrideOperator` to `ApiOperator`.
- Query params are now formatted with snake case rather than camel case internally by client.

### [2.2.0]

### Added
Expand Down
14 changes: 9 additions & 5 deletions openapi-gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class NakamaApi {
{{ $parameter.Type }},
{{- end -}}
{{- end }}
options: any = {}): Promise<{{- if $operation.Responses.Ok.Schema.Ref | cleanRef -}} {{- $operation.Responses.Ok.Schema.Ref | cleanRef -}} {{- else -}} any {{- end}}> {
options: any = {}): Promise<{{- if $operation.Responses.Ok.Schema.Ref | cleanRef -}} {{- $operation.Responses.Ok.Schema.Ref | cleanRef -}} {{- else -}} any {{- end}}> {
{{ range $parameter := $operation.Parameters}}
{{- $snakeToCamel := $parameter.Name | snakeToCamel}}
{{- if $parameter.Required }}
Expand All @@ -151,7 +151,7 @@ export class NakamaApi {
{{- range $parameter := $operation.Parameters}}
{{- $camelToSnake := $parameter.Name | camelToSnake}}
{{- if eq $parameter.In "query"}}
queryParams.set("{{$parameter.Name}}", {{$parameter.Name | snakeToCamel}});
queryParams.set("{{$parameter.Name | camelToSnake }}", {{$parameter.Name | snakeToCamel}});
{{- end}}
{{- end}}
Expand All @@ -171,12 +171,16 @@ export class NakamaApi {
{{- if eq $key "BasicAuth" }}
fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
{{- else if eq $key "HttpKeyAuth" }}
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
{{- end }}
if (bearerToken) {
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
}
{{- end }}
{{- end }}
{{- end }}
{{- else }}
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
if (bearerToken) {
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
}
{{- end }}
return Promise.race([
Expand Down
2 changes: 1 addition & 1 deletion packages/nakama-js-test/client-rpc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('RPC Tests', () => {

const rpcResult = await page.evaluate(async (rpcid, HTTP_KEY) => {
const client = new nakamajs.Client();
return await client.rpc(rpcid, null!, HTTP_KEY);
return await client.rpcHttpKey(HTTP_KEY, rpcid, null!);
}, rpcid, HTTP_KEY);

expect(rpcResult).not.toBeNull();
Expand Down
Loading

0 comments on commit ca70b76

Please sign in to comment.