diff --git a/CHANGELOG.md b/CHANGELOG.md index be3a625680dcd5a2ace39eab59bd8808fe31e5a8..1117b9c82576c76e6ed5b540c257892fa3dda133 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,11 +9,13 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr - Improve group list cursor handling for messages with close timestamps. - Improve handling of database connections going through proxies. - Improve extraction of purchases and subscriptions from Apple receipts. +- Improve signature of JavaScript runtime Base64 decode functions. ### Fixed - Graceful handling of storage list errors in JavaScript runtime. - More exact usage of limit parameter in leaderboard record listings. - Include subscriptions in all data deletion from the developer console. +- Correct return format of JavaScript runtime account export function. ## [3.13.1] - 2022-08-18 ### Fixed diff --git a/go.mod b/go.mod index 892e357f74f88ed4450cda08ab816b15f6133895..e818c3893e403edfd1796d53e6bf97226b28ff74 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/gorilla/mux v1.8.0 github.com/gorilla/websocket v1.4.2 github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 - github.com/heroiclabs/nakama-common v1.24.0 + github.com/heroiclabs/nakama-common v0.0.0-20220914101240-3f8026e3577d github.com/jackc/pgconn v1.10.0 github.com/jackc/pgerrcode v0.0.0-20201024163028-a0d42d470451 github.com/jackc/pgtype v1.8.1 diff --git a/go.sum b/go.sum index ccd7a9753b90599ae178b5125deb02cb54fd8dc0..58c2045a2f00ad18a5fca3055776ea37c91221a4 100644 --- a/go.sum +++ b/go.sum @@ -291,8 +291,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/heroiclabs/nakama-common v1.24.0 h1:HGSNw/Nq1YTq0xdf5Te8eq7OkLYbbm1cXZCGXNDXBgw= -github.com/heroiclabs/nakama-common v1.24.0/go.mod h1:WF4YG46afwY3ibzsXnkt3zvhQ3tBY03IYeU7xSLr8HE= +github.com/heroiclabs/nakama-common v0.0.0-20220914101240-3f8026e3577d h1:mxvlHXFcPe/amuFlz3LveeyCZr4SK7zanAHjUYqwm1U= +github.com/heroiclabs/nakama-common v0.0.0-20220914101240-3f8026e3577d/go.mod h1:WF4YG46afwY3ibzsXnkt3zvhQ3tBY03IYeU7xSLr8HE= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= diff --git a/server/runtime_javascript_nakama.go b/server/runtime_javascript_nakama.go index c1a72013f091600a1619e8e406f11dde7eb8fbe6..579768491544e9de357416235859ceee8fa745b0 100644 --- a/server/runtime_javascript_nakama.go +++ b/server/runtime_javascript_nakama.go @@ -549,7 +549,7 @@ func (n *runtimeJavascriptNakamaModule) sqlQuery(r *goja.Runtime) func(goja.Func } // @group utils -// @summary Send a HTTP request that returns a data type containing the result of the HTTP response. +// @summary Send an HTTP request that returns a data type containing the result of the HTTP response. // @param url(type=string) The URL of the web resource to request. // @param method(type=string) The HTTP method verb used with the request. // @param headers(type=string) A table of headers used with the request. @@ -667,7 +667,7 @@ func (n *runtimeJavascriptNakamaModule) base64Encode(r *goja.Runtime) func(goja. // @group utils // @summary Decode a base64 encoded string. // @param input(type=string) The string which will be base64 decoded. -// @return out(string) Decoded string. +// @return out(ArrayBuffer) Decoded string. // @return error(error) An optional error value if an error occurred. func (n *runtimeJavascriptNakamaModule) base64Decode(r *goja.Runtime) func(goja.FunctionCall) goja.Value { return func(f goja.FunctionCall) goja.Value { @@ -688,7 +688,7 @@ func (n *runtimeJavascriptNakamaModule) base64Decode(r *goja.Runtime) func(goja. if err != nil { panic(r.NewGoError(fmt.Errorf("Failed to decode string: %s", in))) } - return r.ToValue(string(out)) + return r.ToValue(r.NewArrayBuffer(out)) } } @@ -731,7 +731,7 @@ func (n *runtimeJavascriptNakamaModule) base64UrlEncode(r *goja.Runtime) func(go // @group utils // @summary Decode a base64 URL encoded string. // @param input(type=string) The string to be decoded. -// @return out(string) Decoded string. +// @return out(ArrayBuffer) Decoded string. // @return error(error) An optional error value if an error occurred. func (n *runtimeJavascriptNakamaModule) base64UrlDecode(r *goja.Runtime) func(goja.FunctionCall) goja.Value { return func(f goja.FunctionCall) goja.Value { @@ -752,7 +752,7 @@ func (n *runtimeJavascriptNakamaModule) base64UrlDecode(r *goja.Runtime) func(go if err != nil { panic(r.NewGoError(fmt.Errorf("Failed to decode string: %s", in))) } - return r.ToValue(string(out)) + return r.ToValue(r.NewArrayBuffer(out)) } } @@ -1894,7 +1894,7 @@ func (n *runtimeJavascriptNakamaModule) accountExportId(r *goja.Runtime) func(go panic(r.NewGoError(fmt.Errorf("error encoding account export: %v", err.Error()))) } - return r.ToValue(exportString) + return r.ToValue(string(exportString)) } } diff --git a/vendor/modules.txt b/vendor/modules.txt index ec5d59217ddb99f50bd9982e620ce72ff85e608b..ad62e0d41218a83aca8c341417cddd9f6f0e26fe 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -142,7 +142,7 @@ github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/internal/genopena github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options github.com/grpc-ecosystem/grpc-gateway/v2/runtime github.com/grpc-ecosystem/grpc-gateway/v2/utilities -# github.com/heroiclabs/nakama-common v1.24.0 +# github.com/heroiclabs/nakama-common v0.0.0-20220914101240-3f8026e3577d ## explicit; go 1.14 github.com/heroiclabs/nakama-common/api github.com/heroiclabs/nakama-common/rtapi