From 839d6e1b8c3466b70f1500d4dccceb177d41362a Mon Sep 17 00:00:00 2001 From: Alexander Diana Date: Mon, 8 Jan 2024 19:38:23 +0000 Subject: [PATCH] update vendor --- go.mod | 16 +- go.sum | 35 +-- .../aws/ec2metadata/token_provider.go | 5 +- .../github.com/aws/aws-sdk-go/aws/version.go | 2 +- .../tdewolff/minify/v2/html/html.go | 2 + .../github.com/tdewolff/minify/v2/js/util.go | 85 ++++-- .../tidepool-org/clinic/client/client.go | 128 +++++++++ .../tidepool-org/clinic/client/types.go | 252 ++++++++++++------ vendor/modules.txt | 16 +- 9 files changed, 415 insertions(+), 126 deletions(-) diff --git a/go.mod b/go.mod index 452348dde..9a1871051 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ toolchain go1.21.0 require ( github.com/IBM/sarama v1.42.1 github.com/ant0ine/go-json-rest v3.3.2+incompatible - github.com/aws/aws-sdk-go v1.49.15 + github.com/aws/aws-sdk-go v1.49.17 github.com/blang/semver v3.5.1+incompatible github.com/deckarep/golang-set/v2 v2.6.0 github.com/githubnemo/CompileDaemon v1.4.0 @@ -22,17 +22,17 @@ require ( github.com/onsi/gomega v1.30.0 github.com/prometheus/client_golang v1.18.0 github.com/rinchsan/device-check-go v1.3.0 - github.com/tidepool-org/clinic/client v0.0.0-20231130132900-fa671533ce9f + github.com/tidepool-org/clinic/client v0.0.0-20240105042120-0e825159ca41 github.com/tidepool-org/devices/api v0.0.0-20220914225528-c7373eb1babc github.com/tidepool-org/go-common v0.11.0 github.com/tidepool-org/hydrophone/client v0.0.0-20230915144349-ccec1a4d1782 github.com/urfave/cli v1.22.14 go.mongodb.org/mongo-driver v1.13.1 go.uber.org/fx v1.20.1 - golang.org/x/crypto v0.17.0 + golang.org/x/crypto v0.18.0 golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 - golang.org/x/oauth2 v0.15.0 + golang.org/x/oauth2 v0.16.0 golang.org/x/sync v0.6.0 golang.org/x/tools v0.16.1 google.golang.org/grpc v1.60.1 @@ -129,7 +129,7 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/schollz/closestmatch v2.1.0+incompatible // indirect github.com/sirupsen/logrus v1.9.3 // indirect - github.com/tdewolff/minify/v2 v2.20.10 // indirect + github.com/tdewolff/minify/v2 v2.20.12 // indirect github.com/tdewolff/parse/v2 v2.7.7 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.12 // indirect @@ -150,15 +150,15 @@ require ( go.uber.org/zap v1.26.0 // indirect golang.org/x/arch v0.7.0 // indirect golang.org/x/mod v0.14.0 // indirect - golang.org/x/net v0.19.0 // indirect + golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.16.0 // indirect golang.org/x/term v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 // indirect + google.golang.org/genproto v0.0.0-20240108191215-35c7eff3a6b1 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect google.golang.org/protobuf v1.32.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 0268ace76..c4e5c2968 100644 --- a/go.sum +++ b/go.sum @@ -27,8 +27,8 @@ github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7D github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0= github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= -github.com/aws/aws-sdk-go v1.49.15 h1:aH9bSV4kL4ziH0AMtuYbukGIVebXddXBL0cKZ1zj15k= -github.com/aws/aws-sdk-go v1.49.15/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.17 h1:Cc+7LgPjKeJkF2SdNo1IkpQ5Dfl9HCZEVw9OP3CPuEI= +github.com/aws/aws-sdk-go v1.49.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= @@ -300,14 +300,15 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/tdewolff/minify/v2 v2.20.10 h1:iz9IkdRqD2pyneib/AvTas23RRG5TnuUFNcNVKmL/jU= -github.com/tdewolff/minify/v2 v2.20.10/go.mod h1:xSJ9fXIfyuEMex88JT4jl8GvXnl/RzWNdqD96AqKlX0= +github.com/tdewolff/minify/v2 v2.20.12 h1:ie5+91QGUUeEDbLkexhx2tlI9BQgwwnfY+/Qdj4BlQ4= +github.com/tdewolff/minify/v2 v2.20.12/go.mod h1:8ktdncc9Rh41MkTX2KYaicHT9+VnpvIDjCyIVsr/nN8= github.com/tdewolff/parse/v2 v2.7.7 h1:V+50eFDH7Piw4IBwH8D8FtYeYbZp3T4SCtIvmBSIMyc= github.com/tdewolff/parse/v2 v2.7.7/go.mod h1:3FbJWZp3XT9OWVN3Hmfp0p/a08v4h8J9W1aghka0soA= -github.com/tdewolff/test v1.0.11-0.20231101010635-f1265d231d52 h1:gAQliwn+zJrkjAHVcBEYW/RFvd2St4yYimisvozAYlA= github.com/tdewolff/test v1.0.11-0.20231101010635-f1265d231d52/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE= -github.com/tidepool-org/clinic/client v0.0.0-20231130132900-fa671533ce9f h1:4mKOdmoszvURyHBEAUhLyOk6SY8Oz10oVKKbIkv+uPU= -github.com/tidepool-org/clinic/client v0.0.0-20231130132900-fa671533ce9f/go.mod h1:/pKE2peJWlb18cnXWdxLO+jeenxnWH6V6W0OilLyT7I= +github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739 h1:IkjBCtQOOjIn03u/dMQK9g+Iw9ewps4mCl1nB8Sscbo= +github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739/go.mod h1:XPuWBzvdUzhCuxWO1ojpXsyzsA5bFoS3tO/Q3kFuTG8= +github.com/tidepool-org/clinic/client v0.0.0-20240105042120-0e825159ca41 h1:YzjMh9PocAme3eKNseH8a1YHBDr+8UDsG6ErFoALKbo= +github.com/tidepool-org/clinic/client v0.0.0-20240105042120-0e825159ca41/go.mod h1:/pKE2peJWlb18cnXWdxLO+jeenxnWH6V6W0OilLyT7I= github.com/tidepool-org/devices/api v0.0.0-20220914225528-c7373eb1babc h1:QLsASXo2G8RRm9C6/5Wf7+4iQK6dJQlqcVQFax0AunA= github.com/tidepool-org/devices/api v0.0.0-20220914225528-c7373eb1babc/go.mod h1:hiVnAb182K2eV2/ZqZGhi3v3qK7qJhBuDE4bR0HvIcE= github.com/tidepool-org/go-common v0.11.0 h1:S5lGQlmYIVyfw58R7rDHmUaBwANb4Xf/MLjB2ZIFqDg= @@ -381,8 +382,8 @@ golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc h1:ao2WRsKSzW6KuUY9IWPwWahcHCgR0s52IfwutMfEbdM= golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= @@ -404,10 +405,10 @@ golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= -golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= -golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= +golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -461,12 +462,12 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 h1:nz5NESFLZbJGPFxDT/HCn+V1mZ8JGNoY4nUpmW/Y2eg= -google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917/go.mod h1:pZqR+glSb11aJ+JQcczCvgf47+duRuzNSKqE8YAQnV0= +google.golang.org/genproto v0.0.0-20240108191215-35c7eff3a6b1 h1:/IWabOtPziuXTEtI1KYCpM6Ss7vaAkeMxk+uXV/xvZs= +google.golang.org/genproto v0.0.0-20240108191215-35c7eff3a6b1/go.mod h1:+Rvu7ElI+aLzyDQhpHMFMMltsD6m7nqpuWDd2CwJw3k= google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 h1:rcS6EyEaoCO52hQDupoSfrxI3R6C2Tq741is7X8OvnM= google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917/go.mod h1:CmlNWB9lSezaYELKS5Ym1r44VrrbPUa7JTvw+6MbpJ0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 h1:6G8oQ016D88m1xAKljMlBOOGWDZkes4kMhgGFlf8WcQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 h1:gphdwh0npgs8elJ4T6J+DQJHPVF7RsuJHCfwztUb4J4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go index 604aeffde..f1f9ba4ec 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go @@ -2,6 +2,7 @@ package ec2metadata import ( "fmt" + "github.com/aws/aws-sdk-go/aws" "net/http" "sync/atomic" "time" @@ -65,7 +66,9 @@ func (t *tokenProvider) fetchTokenHandler(r *request.Request) { switch requestFailureError.StatusCode() { case http.StatusForbidden, http.StatusNotFound, http.StatusMethodNotAllowed: atomic.StoreUint32(&t.disabled, 1) - t.client.Config.Logger.Log(fmt.Sprintf("WARN: failed to get session token, falling back to IMDSv1: %v", requestFailureError)) + if t.client.Config.LogLevel.Matches(aws.LogDebugWithDeprecated) { + t.client.Config.Logger.Log(fmt.Sprintf("WARN: failed to get session token, falling back to IMDSv1: %v", requestFailureError)) + } case http.StatusBadRequest: r.Error = requestFailureError } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/version.go b/vendor/github.com/aws/aws-sdk-go/aws/version.go index 788355354..809585817 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/version.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "1.49.15" +const SDKVersion = "1.49.17" diff --git a/vendor/github.com/tdewolff/minify/v2/html/html.go b/vendor/github.com/tdewolff/minify/v2/html/html.go index 1a5aa9450..ea817037b 100644 --- a/vendor/github.com/tdewolff/minify/v2/html/html.go +++ b/vendor/github.com/tdewolff/minify/v2/html/html.go @@ -126,6 +126,7 @@ func (o *Minifier) Minify(m *minify.M, w io.Writer, r io.Reader, _ map[string]st } w.Write(t.Data) } + omitSpace = false case html.MathToken: if err := m.MinifyMimetype(mathMimeBytes, w, buffer.NewReader(t.Data), nil); err != nil { if err != minify.ErrNotExist { @@ -133,6 +134,7 @@ func (o *Minifier) Minify(m *minify.M, w io.Writer, r io.Reader, _ map[string]st } w.Write(t.Data) } + omitSpace = false case html.TextToken: if t.HasTemplate { w.Write(t.Data) diff --git a/vendor/github.com/tdewolff/minify/v2/js/util.go b/vendor/github.com/tdewolff/minify/v2/js/util.go index ada17651a..f3bee51a1 100644 --- a/vendor/github.com/tdewolff/minify/v2/js/util.go +++ b/vendor/github.com/tdewolff/minify/v2/js/util.go @@ -940,7 +940,6 @@ func minifyString(b []byte, allowTemplate bool) []byte { backtickQuotes := 0 newlines := 0 dollarSigns := 0 - notEscapes := false for i := 1; i < len(b)-1; i++ { if b[i] == '\'' { singleQuotes++ @@ -948,25 +947,69 @@ func minifyString(b []byte, allowTemplate bool) []byte { doubleQuotes++ } else if b[i] == '`' { backtickQuotes++ - } else if b[i] == '$' { + } else if b[i] == '$' && i+1 < len(b) && b[i+1] == '{' { dollarSigns++ } else if b[i] == '\\' && i+1 < len(b) { if b[i+1] == 'n' || b[i+1] == 'r' { newlines++ - } else if '1' <= b[i+1] && b[i+1] <= '9' || b[i+1] == '0' && i+2 < len(b) && '0' <= b[i+2] && b[i+2] <= '9' { - notEscapes = true + } else if '1' <= b[i+1] && b[i+1] <= '9' && i+2 < len(b) { + if b[i+1] == '1' && (b[i+2] == '2' || b[i+2] == '5') { + newlines++ + } else if b[i+1] == '4' && b[i+2] == '2' { + doubleQuotes++ + } else if b[i+1] == '4' && b[i+2] == '7' { + singleQuotes++ + } else if i+3 < len(b) && b[i+1] == '1' && b[i+2] == '4' && b[i+3] == '0' { + backtickQuotes++ + } + } else if b[i+1] == 'x' && i+3 < len(b) { + if b[i+2] == '0' && (b[i+3]|0x20 == 'a' || b[i+3]|0x20 == 'd') { + newlines++ + } else if b[i+2] == '2' && b[i+3] == '2' { + doubleQuotes++ + } else if b[i+2] == '2' && b[i+3] == '7' { + singleQuotes++ + } else if b[i+2] == '6' && b[i+3] == '0' { + backtickQuotes++ + } + } else if b[i+1] == 'u' && i+5 < len(b) && b[i+2] == '0' && b[i+3] == '0' { + if b[i+4] == '0' && (b[i+5]|0x20 == 'a' || b[i+5]|0x20 == 'd') { + newlines++ + } else if b[i+4] == '2' && b[i+5] == '2' { + doubleQuotes++ + } else if b[i+4] == '2' && b[i+5] == '7' { + singleQuotes++ + } else if b[i+4] == '6' && b[i+5] == '0' { + backtickQuotes++ + } + } else if b[i+1] == 'u' && i+4 < len(b) && b[i+2] == '{' { + j := i + 3 + for j < len(b) && b[j] == '0' { + j++ + } + if j+1 < len(b) && (b[j]|0x20 == 'a' || b[j]|0x20 == 'd') && b[j+1] == '}' { + newlines++ + } else if j+2 < len(b) && b[j+2] == '}' { + if b[j] == '2' && b[j+1] == '2' { + doubleQuotes++ + } else if b[j] == '2' && b[j+1] == '7' { + singleQuotes++ + } else if b[j] == '6' && b[j+1] == '0' { + backtickQuotes++ + } + } } } } quote := byte('"') // default to " for better GZIP compression - quotes := singleQuotes + quotes := doubleQuotes if doubleQuotes < singleQuotes { quote = byte('"') - quotes = doubleQuotes } else if singleQuotes < doubleQuotes { quote = byte('\'') + quotes = singleQuotes } - if allowTemplate && !notEscapes && backtickQuotes+dollarSigns < quotes+newlines { + if allowTemplate && backtickQuotes+dollarSigns < quotes+newlines { quote = byte('`') } b[0] = quote @@ -1004,7 +1047,7 @@ func replaceEscapes(b []byte, quote byte, prefix, suffix int) []byte { // hexadecimal escapes _, _ = hex.Decode(b[i:i+1:i+1], b[i+2:i+4]) n = 4 - if b[i] == '\\' || b[i] == quote || b[i] == '\n' || b[i] == '\r' || b[i] == 0 { + if b[i] == '\\' || b[i] == quote || quote != '`' && (b[i] == '\n' || b[i] == '\r') || b[i] == 0 { if b[i] == '\n' { b[i+1] = 'n' } else if b[i] == '\r' { @@ -1061,20 +1104,32 @@ func replaceEscapes(b []byte, quote byte, prefix, suffix int) []byte { i += 4 n -= 4 } - } else { + } else if quote == '`' || num != 10 && num != 13 { // decode unicode character to UTF-8 and put at the end of the escape sequence // then skip the first part of the escape sequence until the decoded character m := utf8.RuneLen(rune(num)) if m == -1 { i++ continue + } else if num < 256 && quote == byte(num) { + b[i] = '\\' + i++ + n-- } utf8.EncodeRune(b[i:], rune(num)) i += m n -= m + } else { + if num == 10 { + b[i+1] = 'n' + } else { + b[i+1] = 'r' + } + i += 2 + n -= 2 } } else if '0' <= c && c <= '7' { - // octal escapes (legacy), \0 already handled + // octal escapes (legacy), \0 already handled (quote != `) num := c - '0' n++ if i+2 < len(b)-1 && '0' <= b[i+2] && b[i+2] <= '7' { @@ -1086,7 +1141,7 @@ func replaceEscapes(b []byte, quote byte, prefix, suffix int) []byte { } } b[i] = num - if num == 0 || num == '\\' || num == quote || num == '\n' || num == '\r' { + if num == 0 || num == '\\' || num == quote || quote != '`' && (num == '\n' || num == '\r') { if num == 0 { b[i+1] = '0' } else if num == '\n' { @@ -1102,11 +1157,11 @@ func replaceEscapes(b []byte, quote byte, prefix, suffix int) []byte { } i++ n-- - } else if c == 'n' { - b[i] = '\n' // only for template literals + } else if quote == '`' && c == 'n' { + b[i] = '\n' i++ - } else if c == 'r' { - b[i] = '\r' // only for template literals + } else if quote == '`' && c == 'r' { + b[i] = '\r' i++ } else if c == 't' { b[i] = '\t' diff --git a/vendor/github.com/tidepool-org/clinic/client/client.go b/vendor/github.com/tidepool-org/clinic/client/client.go index a45aa25a7..a7ed06c9d 100644 --- a/vendor/github.com/tidepool-org/clinic/client/client.go +++ b/vendor/github.com/tidepool-org/clinic/client/client.go @@ -2908,6 +2908,22 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } + if params.CgmTimeInAnyLowPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInAnyLowPercent", runtime.ParamLocationQuery, *params.CgmTimeInAnyLowPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + if params.CgmTimeInLowPercent != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInLowPercent", runtime.ParamLocationQuery, *params.CgmTimeInLowPercent); err != nil { @@ -2972,6 +2988,22 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } + if params.CgmTimeInAnyHighPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInAnyHighPercent", runtime.ParamLocationQuery, *params.CgmTimeInAnyHighPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + if params.CgmTimeCGMUseRecords != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeCGMUseRecords", runtime.ParamLocationQuery, *params.CgmTimeCGMUseRecords); err != nil { @@ -3004,6 +3036,22 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } + if params.CgmTimeInAnyLowRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInAnyLowRecords", runtime.ParamLocationQuery, *params.CgmTimeInAnyLowRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + if params.CgmTimeInLowRecords != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInLowRecords", runtime.ParamLocationQuery, *params.CgmTimeInLowRecords); err != nil { @@ -3068,6 +3116,22 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } + if params.CgmTimeInAnyHighRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInAnyHighRecords", runtime.ParamLocationQuery, *params.CgmTimeInAnyHighRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + if params.CgmAverageDailyRecords != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.averageDailyRecords", runtime.ParamLocationQuery, *params.CgmAverageDailyRecords); err != nil { @@ -3148,6 +3212,22 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } + if params.BgmTimeInAnyLowPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInAnyLowPercent", runtime.ParamLocationQuery, *params.BgmTimeInAnyLowPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + if params.BgmTimeInLowPercent != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInLowPercent", runtime.ParamLocationQuery, *params.BgmTimeInLowPercent); err != nil { @@ -3212,6 +3292,22 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } + if params.BgmTimeInAnyHighPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInAnyHighPercent", runtime.ParamLocationQuery, *params.BgmTimeInAnyHighPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + if params.BgmTimeInVeryLowRecords != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInVeryLowRecords", runtime.ParamLocationQuery, *params.BgmTimeInVeryLowRecords); err != nil { @@ -3228,6 +3324,22 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } + if params.BgmTimeInAnyLowRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInAnyLowRecords", runtime.ParamLocationQuery, *params.BgmTimeInAnyLowRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + if params.BgmTimeInLowRecords != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInLowRecords", runtime.ParamLocationQuery, *params.BgmTimeInLowRecords); err != nil { @@ -3292,6 +3404,22 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } + if params.BgmTimeInAnyHighRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInAnyHighRecords", runtime.ParamLocationQuery, *params.BgmTimeInAnyHighRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + if params.BgmAverageDailyRecords != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.averageDailyRecords", runtime.ParamLocationQuery, *params.BgmAverageDailyRecords); err != nil { diff --git a/vendor/github.com/tidepool-org/clinic/client/types.go b/vendor/github.com/tidepool-org/clinic/client/types.go index 3e4eaee05..2ff601e92 100644 --- a/vendor/github.com/tidepool-org/clinic/client/types.go +++ b/vendor/github.com/tidepool-org/clinic/client/types.go @@ -972,19 +972,47 @@ type PatientBGMPeriod struct { // AverageGlucoseMmolDelta Difference between the averageGlucose in this period and the other offset version AverageGlucoseMmolDelta *float64 `json:"averageGlucoseMmolDelta,omitempty"` - HasAverageDailyRecords *bool `json:"hasAverageDailyRecords,omitempty"` - HasAverageGlucoseMmol *bool `json:"hasAverageGlucoseMmol,omitempty"` - HasTimeInHighPercent *bool `json:"hasTimeInHighPercent,omitempty"` - HasTimeInHighRecords *bool `json:"hasTimeInHighRecords,omitempty"` - HasTimeInLowPercent *bool `json:"hasTimeInLowPercent,omitempty"` - HasTimeInLowRecords *bool `json:"hasTimeInLowRecords,omitempty"` - HasTimeInTargetPercent *bool `json:"hasTimeInTargetPercent,omitempty"` - HasTimeInTargetRecords *bool `json:"hasTimeInTargetRecords,omitempty"` - HasTimeInVeryHighPercent *bool `json:"hasTimeInVeryHighPercent,omitempty"` - HasTimeInVeryHighRecords *bool `json:"hasTimeInVeryHighRecords,omitempty"` - HasTimeInVeryLowPercent *bool `json:"hasTimeInVeryLowPercent,omitempty"` - HasTimeInVeryLowRecords *bool `json:"hasTimeInVeryLowRecords,omitempty"` - HasTotalRecords *bool `json:"hasTotalRecords,omitempty"` + HasAverageDailyRecords bool `json:"hasAverageDailyRecords"` + HasAverageGlucoseMmol bool `json:"hasAverageGlucoseMmol"` + HasTimeInAnyHighPercent bool `json:"hasTimeInAnyHighPercent"` + HasTimeInAnyHighRecords bool `json:"hasTimeInAnyHighRecords"` + HasTimeInAnyLowPercent bool `json:"hasTimeInAnyLowPercent"` + HasTimeInAnyLowRecords bool `json:"hasTimeInAnyLowRecords"` + HasTimeInHighPercent bool `json:"hasTimeInHighPercent"` + HasTimeInHighRecords bool `json:"hasTimeInHighRecords"` + HasTimeInLowPercent bool `json:"hasTimeInLowPercent"` + HasTimeInLowRecords bool `json:"hasTimeInLowRecords"` + HasTimeInTargetPercent bool `json:"hasTimeInTargetPercent"` + HasTimeInTargetRecords bool `json:"hasTimeInTargetRecords"` + HasTimeInVeryHighPercent bool `json:"hasTimeInVeryHighPercent"` + HasTimeInVeryHighRecords bool `json:"hasTimeInVeryHighRecords"` + HasTimeInVeryLowPercent bool `json:"hasTimeInVeryLowPercent"` + HasTimeInVeryLowRecords bool `json:"hasTimeInVeryLowRecords"` + HasTotalRecords bool `json:"hasTotalRecords"` + + // TimeInAnyHighPercent Percentage of time spent in Any high glucose range + TimeInAnyHighPercent *float64 `json:"timeInAnyHighPercent,omitempty"` + + // TimeInAnyHighPercentDelta Difference between the timeInAnyHighPercent in this period and version in the opposite offset + TimeInAnyHighPercentDelta *float64 `json:"timeInAnyHighPercentDelta,omitempty"` + + // TimeInAnyHighRecords Counter of records in Any high glucose range + TimeInAnyHighRecords *int `json:"timeInAnyHighRecords,omitempty"` + + // TimeInAnyHighRecordsDelta Difference between the timeInAnyHighRecords in this period and version in the opposite offset + TimeInAnyHighRecordsDelta *int `json:"timeInAnyHighRecordsDelta,omitempty"` + + // TimeInAnyLowPercent Percentage of time spent in Any low glucose range + TimeInAnyLowPercent *float64 `json:"timeInAnyLowPercent,omitempty"` + + // TimeInAnyLowPercentDelta Difference between the timeInAnyLowPercent in this period and version in the opposite offset + TimeInAnyLowPercentDelta *float64 `json:"timeInAnyLowPercentDelta,omitempty"` + + // TimeInAnyLowRecords Counter of records in Any low glucose range + TimeInAnyLowRecords *int `json:"timeInAnyLowRecords,omitempty"` + + // TimeInAnyLowRecordsDelta Difference between the timeInAnyLowRecords in this period and version in the opposite offset + TimeInAnyLowRecordsDelta *int `json:"timeInAnyLowRecordsDelta,omitempty"` // TimeInHighPercent Percentage of time spent in high glucose range TimeInHighPercent *float64 `json:"timeInHighPercent,omitempty"` @@ -1059,19 +1087,19 @@ type PatientBGMPeriods map[string]PatientBGMPeriod // PatientBGMStats A summary of a users recent BGM glucose values type PatientBGMStats struct { // Config Summary schema version and calculation configuration - Config *PatientSummaryConfig `json:"config,omitempty"` + Config PatientSummaryConfig `json:"config,omitempty"` // Dates dates tracked for summary calculation - Dates *PatientSummaryDates `json:"dates,omitempty"` + Dates PatientSummaryDates `json:"dates,omitempty"` // OffsetPeriods A map to each supported BGM summary period - OffsetPeriods *PatientBGMPeriods `json:"offsetPeriods,omitempty"` + OffsetPeriods PatientBGMPeriods `json:"offsetPeriods,omitempty"` // Periods A map to each supported BGM summary period - Periods *PatientBGMPeriods `json:"periods,omitempty"` + Periods PatientBGMPeriods `json:"periods,omitempty"` // TotalHours Total hours represented in the hourly stats - TotalHours *int `json:"totalHours,omitempty"` + TotalHours int `json:"totalHours"` } // PatientCGMPeriod Summary of a specific CGM time period (currently: 1d, 7d, 14d, 30d) @@ -1093,28 +1121,34 @@ type PatientCGMPeriod struct { // GlucoseManagementIndicatorDelta Difference between the glucoseManagementIndicator in this period and the other offset version GlucoseManagementIndicatorDelta *float64 `json:"glucoseManagementIndicatorDelta,omitempty"` - HasAverageDailyRecords *bool `json:"hasAverageDailyRecords,omitempty"` - HasAverageGlucoseMmol *bool `json:"hasAverageGlucoseMmol,omitempty"` - HasGlucoseManagementIndicator *bool `json:"hasGlucoseManagementIndicator,omitempty"` - HasTimeCGMUseMinutes *bool `json:"hasTimeCGMUseMinutes,omitempty"` - HasTimeCGMUsePercent *bool `json:"hasTimeCGMUsePercent,omitempty"` - HasTimeCGMUseRecords *bool `json:"hasTimeCGMUseRecords,omitempty"` - HasTimeInHighMinutes *bool `json:"hasTimeInHighMinutes,omitempty"` - HasTimeInHighPercent *bool `json:"hasTimeInHighPercent,omitempty"` - HasTimeInHighRecords *bool `json:"hasTimeInHighRecords,omitempty"` - HasTimeInLowMinutes *bool `json:"hasTimeInLowMinutes,omitempty"` - HasTimeInLowPercent *bool `json:"hasTimeInLowPercent,omitempty"` - HasTimeInLowRecords *bool `json:"hasTimeInLowRecords,omitempty"` - HasTimeInTargetMinutes *bool `json:"hasTimeInTargetMinutes,omitempty"` - HasTimeInTargetPercent *bool `json:"hasTimeInTargetPercent,omitempty"` - HasTimeInTargetRecords *bool `json:"hasTimeInTargetRecords,omitempty"` - HasTimeInVeryHighMinutes *bool `json:"hasTimeInVeryHighMinutes,omitempty"` - HasTimeInVeryHighPercent *bool `json:"hasTimeInVeryHighPercent,omitempty"` - HasTimeInVeryHighRecords *bool `json:"hasTimeInVeryHighRecords,omitempty"` - HasTimeInVeryLowMinutes *bool `json:"hasTimeInVeryLowMinutes,omitempty"` - HasTimeInVeryLowPercent *bool `json:"hasTimeInVeryLowPercent,omitempty"` - HasTimeInVeryLowRecords *bool `json:"hasTimeInVeryLowRecords,omitempty"` - HasTotalRecords *bool `json:"hasTotalRecords,omitempty"` + HasAverageDailyRecords bool `json:"hasAverageDailyRecords"` + HasAverageGlucoseMmol bool `json:"hasAverageGlucoseMmol"` + HasGlucoseManagementIndicator bool `json:"hasGlucoseManagementIndicator"` + HasTimeCGMUseMinutes bool `json:"hasTimeCGMUseMinutes"` + HasTimeCGMUsePercent bool `json:"hasTimeCGMUsePercent"` + HasTimeCGMUseRecords bool `json:"hasTimeCGMUseRecords"` + HasTimeInAnyHighMinutes bool `json:"hasTimeInAnyHighMinutes"` + HasTimeInAnyHighPercent bool `json:"hasTimeInAnyHighPercent"` + HasTimeInAnyHighRecords bool `json:"hasTimeInAnyHighRecords"` + HasTimeInAnyLowMinutes bool `json:"hasTimeInAnyLowMinutes"` + HasTimeInAnyLowPercent bool `json:"hasTimeInAnyLowPercent"` + HasTimeInAnyLowRecords bool `json:"hasTimeInAnyLowRecords"` + HasTimeInHighMinutes bool `json:"hasTimeInHighMinutes"` + HasTimeInHighPercent bool `json:"hasTimeInHighPercent"` + HasTimeInHighRecords bool `json:"hasTimeInHighRecords"` + HasTimeInLowMinutes bool `json:"hasTimeInLowMinutes"` + HasTimeInLowPercent bool `json:"hasTimeInLowPercent"` + HasTimeInLowRecords bool `json:"hasTimeInLowRecords"` + HasTimeInTargetMinutes bool `json:"hasTimeInTargetMinutes"` + HasTimeInTargetPercent bool `json:"hasTimeInTargetPercent"` + HasTimeInTargetRecords bool `json:"hasTimeInTargetRecords"` + HasTimeInVeryHighMinutes bool `json:"hasTimeInVeryHighMinutes"` + HasTimeInVeryHighPercent bool `json:"hasTimeInVeryHighPercent"` + HasTimeInVeryHighRecords bool `json:"hasTimeInVeryHighRecords"` + HasTimeInVeryLowMinutes bool `json:"hasTimeInVeryLowMinutes"` + HasTimeInVeryLowPercent bool `json:"hasTimeInVeryLowPercent"` + HasTimeInVeryLowRecords bool `json:"hasTimeInVeryLowRecords"` + HasTotalRecords bool `json:"hasTotalRecords"` // TimeCGMUseMinutes Counter of minutes spent wearing a cgm TimeCGMUseMinutes *int `json:"timeCGMUseMinutes,omitempty"` @@ -1134,6 +1168,42 @@ type PatientCGMPeriod struct { // TimeCGMUseRecordsDelta Difference between the timeCGMUseRecords in this period and version in the opposite offset TimeCGMUseRecordsDelta *int `json:"timeCGMUseRecordsDelta,omitempty"` + // TimeInAnyHighMinutes Counter of minutes spent in Any high glucose range + TimeInAnyHighMinutes *int `json:"timeInAnyHighMinutes,omitempty"` + + // TimeInAnyHighMinutesDelta Difference between the timeInAnyHighMinutes in this period and version in the opposite offset + TimeInAnyHighMinutesDelta *int `json:"timeInAnyHighMinutesDelta,omitempty"` + + // TimeInAnyHighPercent Percentage of time spent in Any high glucose range + TimeInAnyHighPercent *float64 `json:"timeInAnyHighPercent,omitempty"` + + // TimeInAnyHighPercentDelta Difference between the timeInAnyHighPercent in this period and version in the opposite offset + TimeInAnyHighPercentDelta *float64 `json:"timeInAnyHighPercentDelta,omitempty"` + + // TimeInAnyHighRecords Counter of records in Any high glucose range + TimeInAnyHighRecords *int `json:"timeInAnyHighRecords,omitempty"` + + // TimeInAnyHighRecordsDelta Difference between the timeInAnyHighRecords in this period and version in the opposite offset + TimeInAnyHighRecordsDelta *int `json:"timeInAnyHighRecordsDelta,omitempty"` + + // TimeInAnyLowMinutes Counter of minutes spent in Any low glucose range + TimeInAnyLowMinutes *int `json:"timeInAnyLowMinutes,omitempty"` + + // TimeInAnyLowMinutesDelta Difference between the timeInAnyLowMinutes in this period and version in the opposite offset + TimeInAnyLowMinutesDelta *int `json:"timeInAnyLowMinutesDelta,omitempty"` + + // TimeInAnyLowPercent Percentage of time spent in Any low glucose range + TimeInAnyLowPercent *float64 `json:"timeInAnyLowPercent,omitempty"` + + // TimeInAnyLowPercentDelta Difference between the timeInAnyLowPercent in this period and version in the opposite offset + TimeInAnyLowPercentDelta *float64 `json:"timeInAnyLowPercentDelta,omitempty"` + + // TimeInAnyLowRecords Counter of records in Any low glucose range + TimeInAnyLowRecords *int `json:"timeInAnyLowRecords,omitempty"` + + // TimeInAnyLowRecordsDelta Difference between the timeInAnyLowRecords in this period and version in the opposite offset + TimeInAnyLowRecordsDelta *int `json:"timeInAnyLowRecordsDelta,omitempty"` + // TimeInHighMinutes Counter of minutes spent in high glucose range TimeInHighMinutes *int `json:"timeInHighMinutes,omitempty"` @@ -1237,19 +1307,19 @@ type PatientCGMPeriods map[string]PatientCGMPeriod // PatientCGMStats A summary of a users recent CGM glucose values type PatientCGMStats struct { // Config Summary schema version and calculation configuration - Config *PatientSummaryConfig `json:"config,omitempty"` + Config PatientSummaryConfig `json:"config,omitempty"` // Dates dates tracked for summary calculation - Dates *PatientSummaryDates `json:"dates,omitempty"` + Dates PatientSummaryDates `json:"dates,omitempty"` // OffsetPeriods A map to each supported CGM summary period - OffsetPeriods *PatientCGMPeriods `json:"offsetPeriods,omitempty"` + OffsetPeriods PatientCGMPeriods `json:"offsetPeriods,omitempty"` // Periods A map to each supported CGM summary period - Periods *PatientCGMPeriods `json:"periods,omitempty"` + Periods PatientCGMPeriods `json:"periods,omitempty"` // TotalHours Total hours represented in the hourly stats - TotalHours *int `json:"totalHours,omitempty"` + TotalHours int `json:"totalHours"` } // PatientClinicRelationship defines model for PatientClinicRelationship. @@ -1282,29 +1352,29 @@ type PatientSummary struct { // PatientSummaryConfig Summary schema version and calculation configuration type PatientSummaryConfig struct { // HighGlucoseThreshold Threshold used for determining if a value is high - HighGlucoseThreshold *float64 `json:"highGlucoseThreshold,omitempty"` + HighGlucoseThreshold float64 `json:"highGlucoseThreshold"` // LowGlucoseThreshold Threshold used for determining if a value is low - LowGlucoseThreshold *float64 `json:"lowGlucoseThreshold,omitempty"` + LowGlucoseThreshold float64 `json:"lowGlucoseThreshold"` // SchemaVersion Summary schema version - SchemaVersion *int `json:"schemaVersion,omitempty"` + SchemaVersion int `json:"schemaVersion"` // VeryHighGlucoseThreshold Threshold used for determining if a value is very high - VeryHighGlucoseThreshold *float64 `json:"veryHighGlucoseThreshold,omitempty"` + VeryHighGlucoseThreshold float64 `json:"veryHighGlucoseThreshold"` // VeryLowGlucoseThreshold Threshold used for determining if a value is very low - VeryLowGlucoseThreshold *float64 `json:"veryLowGlucoseThreshold,omitempty"` + VeryLowGlucoseThreshold float64 `json:"veryLowGlucoseThreshold"` } // PatientSummaryDates dates tracked for summary calculation type PatientSummaryDates struct { // FirstData Date of the first included value FirstData *time.Time `json:"firstData,omitempty"` - HasFirstData *bool `json:"hasFirstData,omitempty"` - HasLastData *bool `json:"hasLastData,omitempty"` - HasLastUploadDate *bool `json:"hasLastUploadDate,omitempty"` - HasOutdatedSince *bool `json:"hasOutdatedSince,omitempty"` + HasFirstData bool `json:"hasFirstData"` + HasLastData bool `json:"hasLastData"` + HasLastUploadDate bool `json:"hasLastUploadDate"` + HasOutdatedSince bool `json:"hasOutdatedSince"` // LastData Date of the last calculated value LastData *time.Time `json:"lastData,omitempty"` @@ -1362,51 +1432,51 @@ type SuppressedNotifications struct { // Tide Report of at-risk patients based on specific grouping criteria type Tide struct { - Config *TideConfig `json:"config,omitempty"` - Results *TideResults `json:"results,omitempty"` + Config TideConfig `json:"config"` + Results TideResults `json:"results"` } // TideConfig defines model for TideConfig. type TideConfig struct { // ClinicId Clinic identifier. - ClinicId *Id `json:"clinicId,omitempty"` - Filters *TideFilters `json:"filters,omitempty"` + ClinicId *Id `json:"clinicId,omitempty"` + Filters TideFilters `json:"filters"` // HighGlucoseThreshold Threshold used for determining if a value is high - HighGlucoseThreshold *float64 `json:"highGlucoseThreshold,omitempty"` - LastUploadDateFrom *time.Time `json:"lastUploadDateFrom,omitempty"` - LastUploadDateTo *time.Time `json:"lastUploadDateTo,omitempty"` + HighGlucoseThreshold float64 `json:"highGlucoseThreshold"` + LastUploadDateFrom time.Time `json:"lastUploadDateFrom"` + LastUploadDateTo time.Time `json:"lastUploadDateTo"` // LowGlucoseThreshold Threshold used for determining if a value is low - LowGlucoseThreshold *float64 `json:"lowGlucoseThreshold,omitempty"` - Period *string `json:"period,omitempty"` + LowGlucoseThreshold float64 `json:"lowGlucoseThreshold"` + Period string `json:"period"` // SchemaVersion TIDE schema version - SchemaVersion *int `json:"schemaVersion,omitempty"` + SchemaVersion int `json:"schemaVersion"` Tags *PatientTagIds `json:"tags"` // VeryHighGlucoseThreshold Threshold used for determining if a value is very high - VeryHighGlucoseThreshold *float64 `json:"veryHighGlucoseThreshold,omitempty"` + VeryHighGlucoseThreshold float64 `json:"veryHighGlucoseThreshold"` // VeryLowGlucoseThreshold Threshold used for determining if a value is very low - VeryLowGlucoseThreshold *float64 `json:"veryLowGlucoseThreshold,omitempty"` + VeryLowGlucoseThreshold float64 `json:"veryLowGlucoseThreshold"` } // TideFilters defines model for TideFilters. type TideFilters struct { - DropInTimeInTargetPercent *string `json:"dropInTimeInTargetPercent,omitempty"` - TimeCGMUsePercent *string `json:"timeCGMUsePercent,omitempty"` - TimeInLowPercent *string `json:"timeInLowPercent,omitempty"` - TimeInTargetPercent *string `json:"timeInTargetPercent,omitempty"` - TimeInVeryLowPercent *string `json:"timeInVeryLowPercent,omitempty"` + DropInTimeInTargetPercent string `json:"dropInTimeInTargetPercent"` + TimeCGMUsePercent string `json:"timeCGMUsePercent"` + TimeInAnyLowPercent string `json:"timeInAnyLowPercent"` + TimeInTargetPercent string `json:"timeInTargetPercent"` + TimeInVeryLowPercent string `json:"timeInVeryLowPercent"` } // TidePatient defines model for TidePatient. type TidePatient struct { - Email *string `json:"email,omitempty"` + Email string `json:"email"` // FullName The full name of the patient - FullName *string `json:"fullName,omitempty"` + FullName string `json:"fullName"` // Id String representation of a Tidepool User ID. Old style IDs are 10-digit strings consisting of only hexadeximcal digits. New style IDs are 36-digit [UUID v4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) Id *TidepoolUserId `json:"id,omitempty"` @@ -1419,8 +1489,8 @@ type TideResultPatient struct { AverageGlucoseMmol *float64 `json:"averageGlucoseMmol,omitempty"` // GlucoseManagementIndicator A derived value which emulates A1C - GlucoseManagementIndicator *float64 `json:"glucoseManagementIndicator,omitempty"` - Patient *TidePatient `json:"patient,omitempty"` + GlucoseManagementIndicator *float64 `json:"glucoseManagementIndicator,omitempty"` + Patient TidePatient `json:"patient"` // TimeCGMUseMinutes Counter of minutes spent wearing a cgm TimeCGMUseMinutes *int `json:"timeCGMUseMinutes,omitempty"` @@ -1428,6 +1498,12 @@ type TideResultPatient struct { // TimeCGMUsePercent Percentage of time spent wearing a cgm TimeCGMUsePercent *float64 `json:"timeCGMUsePercent,omitempty"` + // TimeInAnyHighPercent Percentage of time spent in any high glucose range + TimeInAnyHighPercent *float64 `json:"timeInAnyHighPercent,omitempty"` + + // TimeInAnyLowPercent Percentage of time spent in any low glucose range + TimeInAnyLowPercent *float64 `json:"timeInAnyLowPercent,omitempty"` + // TimeInHighPercent Percentage of time spent in high glucose range TimeInHighPercent *float64 `json:"timeInHighPercent,omitempty"` @@ -1448,7 +1524,7 @@ type TideResultPatient struct { } // TideResults defines model for TideResults. -type TideResults map[string]*[]TideResultPatient +type TideResults map[string][]TideResultPatient // TidepoolUserId String representation of a Tidepool User ID. Old style IDs are 10-digit strings consisting of only hexadeximcal digits. New style IDs are 36-digit [UUID v4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) type TidepoolUserId = string @@ -1596,6 +1672,9 @@ type ListPatientsParams struct { // CgmTimeInVeryLowPercent Percentage of time below 54 mg/dL CgmTimeInVeryLowPercent *string `form:"cgm.timeInVeryLowPercent,omitempty" json:"cgm.timeInVeryLowPercent,omitempty"` + // CgmTimeInAnyLowPercent Percentage of time below 70 mg/dL + CgmTimeInAnyLowPercent *string `form:"cgm.timeInAnyLowPercent,omitempty" json:"cgm.timeInAnyLowPercent,omitempty"` + // CgmTimeInLowPercent Percentage of time in range 54-70 mg/dL CgmTimeInLowPercent *string `form:"cgm.timeInLowPercent,omitempty" json:"cgm.timeInLowPercent,omitempty"` @@ -1608,12 +1687,18 @@ type ListPatientsParams struct { // CgmTimeInVeryHighPercent Percentage of time above 250 mg/dL CgmTimeInVeryHighPercent *string `form:"cgm.timeInVeryHighPercent,omitempty" json:"cgm.timeInVeryHighPercent,omitempty"` + // CgmTimeInAnyHighPercent Percentage of time above 180 mg/dL + CgmTimeInAnyHighPercent *string `form:"cgm.timeInAnyHighPercent,omitempty" json:"cgm.timeInAnyHighPercent,omitempty"` + // CgmTimeCGMUseRecords Records of CGM use CgmTimeCGMUseRecords *string `form:"cgm.timeCGMUseRecords,omitempty" json:"cgm.timeCGMUseRecords,omitempty"` // CgmTimeInVeryLowRecords Records below 54 mg/dL CgmTimeInVeryLowRecords *string `form:"cgm.timeInVeryLowRecords,omitempty" json:"cgm.timeInVeryLowRecords,omitempty"` + // CgmTimeInAnyLowRecords Records below 70 mg/dL + CgmTimeInAnyLowRecords *string `form:"cgm.timeInAnyLowRecords,omitempty" json:"cgm.timeInAnyLowRecords,omitempty"` + // CgmTimeInLowRecords Records in range 54-70 mg/dL CgmTimeInLowRecords *string `form:"cgm.timeInLowRecords,omitempty" json:"cgm.timeInLowRecords,omitempty"` @@ -1626,6 +1711,9 @@ type ListPatientsParams struct { // CgmTimeInVeryHighRecords Records above 250 mg/dL CgmTimeInVeryHighRecords *string `form:"cgm.timeInVeryHighRecords,omitempty" json:"cgm.timeInVeryHighRecords,omitempty"` + // CgmTimeInAnyHighRecords Records above 180 mg/dL + CgmTimeInAnyHighRecords *string `form:"cgm.timeInAnyHighRecords,omitempty" json:"cgm.timeInAnyHighRecords,omitempty"` + // CgmAverageDailyRecords Average records per day CgmAverageDailyRecords *string `form:"cgm.averageDailyRecords,omitempty" json:"cgm.averageDailyRecords,omitempty"` @@ -1641,6 +1729,9 @@ type ListPatientsParams struct { // BgmTimeInVeryLowPercent Percentage of time below 54 mg/dL BgmTimeInVeryLowPercent *string `form:"bgm.timeInVeryLowPercent,omitempty" json:"bgm.timeInVeryLowPercent,omitempty"` + // BgmTimeInAnyLowPercent Percentage of time below 70 mg/dL + BgmTimeInAnyLowPercent *string `form:"bgm.timeInAnyLowPercent,omitempty" json:"bgm.timeInAnyLowPercent,omitempty"` + // BgmTimeInLowPercent Percentage of time in range 54-70 mg/dL BgmTimeInLowPercent *string `form:"bgm.timeInLowPercent,omitempty" json:"bgm.timeInLowPercent,omitempty"` @@ -1653,9 +1744,15 @@ type ListPatientsParams struct { // BgmTimeInVeryHighPercent Percentage of time above 250 mg/dL BgmTimeInVeryHighPercent *string `form:"bgm.timeInVeryHighPercent,omitempty" json:"bgm.timeInVeryHighPercent,omitempty"` + // BgmTimeInAnyHighPercent Percentage of time above 180 mg/dL + BgmTimeInAnyHighPercent *string `form:"bgm.timeInAnyHighPercent,omitempty" json:"bgm.timeInAnyHighPercent,omitempty"` + // BgmTimeInVeryLowRecords Records below 54 mg/dL BgmTimeInVeryLowRecords *string `form:"bgm.timeInVeryLowRecords,omitempty" json:"bgm.timeInVeryLowRecords,omitempty"` + // BgmTimeInAnyLowRecords Records below 70 mg/dL + BgmTimeInAnyLowRecords *string `form:"bgm.timeInAnyLowRecords,omitempty" json:"bgm.timeInAnyLowRecords,omitempty"` + // BgmTimeInLowRecords Records in range 54-70 mg/dL BgmTimeInLowRecords *string `form:"bgm.timeInLowRecords,omitempty" json:"bgm.timeInLowRecords,omitempty"` @@ -1668,6 +1765,9 @@ type ListPatientsParams struct { // BgmTimeInVeryHighRecords Records above 250 mg/dL BgmTimeInVeryHighRecords *string `form:"bgm.timeInVeryHighRecords,omitempty" json:"bgm.timeInVeryHighRecords,omitempty"` + // BgmTimeInAnyHighRecords Records above 180 mg/dL + BgmTimeInAnyHighRecords *string `form:"bgm.timeInAnyHighRecords,omitempty" json:"bgm.timeInAnyHighRecords,omitempty"` + // BgmAverageDailyRecords Average records per day BgmAverageDailyRecords *string `form:"bgm.averageDailyRecords,omitempty" json:"bgm.averageDailyRecords,omitempty"` diff --git a/vendor/modules.txt b/vendor/modules.txt index 8e79f25c9..fc88cb4b5 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -33,7 +33,7 @@ github.com/apapsch/go-jsonmerge/v2 # github.com/avast/retry-go v3.0.0+incompatible ## explicit github.com/avast/retry-go -# github.com/aws/aws-sdk-go v1.49.15 +# github.com/aws/aws-sdk-go v1.49.17 ## explicit; go 1.19 github.com/aws/aws-sdk-go/aws github.com/aws/aws-sdk-go/aws/arn @@ -574,7 +574,7 @@ github.com/schollz/closestmatch # github.com/sirupsen/logrus v1.9.3 ## explicit; go 1.13 github.com/sirupsen/logrus -# github.com/tdewolff/minify/v2 v2.20.10 +# github.com/tdewolff/minify/v2 v2.20.12 ## explicit; go 1.18 github.com/tdewolff/minify/v2 github.com/tdewolff/minify/v2/css @@ -593,7 +593,7 @@ github.com/tdewolff/parse/v2/js github.com/tdewolff/parse/v2/json github.com/tdewolff/parse/v2/strconv github.com/tdewolff/parse/v2/xml -# github.com/tidepool-org/clinic/client v0.0.0-20231130132900-fa671533ce9f +# github.com/tidepool-org/clinic/client v0.0.0-20240105042120-0e825159ca41 ## explicit; go 1.21 github.com/tidepool-org/clinic/client # github.com/tidepool-org/devices/api v0.0.0-20220914225528-c7373eb1babc @@ -757,7 +757,7 @@ go.uber.org/zap/zapcore # golang.org/x/arch v0.7.0 ## explicit; go 1.18 golang.org/x/arch/x86/x86asm -# golang.org/x/crypto v0.17.0 +# golang.org/x/crypto v0.18.0 ## explicit; go 1.18 golang.org/x/crypto/acme golang.org/x/crypto/acme/autocert @@ -780,7 +780,7 @@ golang.org/x/lint/golint golang.org/x/mod/internal/lazyregexp golang.org/x/mod/module golang.org/x/mod/semver -# golang.org/x/net v0.19.0 +# golang.org/x/net v0.20.0 ## explicit; go 1.18 golang.org/x/net/context golang.org/x/net/html @@ -796,7 +796,7 @@ golang.org/x/net/internal/timeseries golang.org/x/net/proxy golang.org/x/net/publicsuffix golang.org/x/net/trace -# golang.org/x/oauth2 v0.15.0 +# golang.org/x/oauth2 v0.16.0 ## explicit; go 1.18 golang.org/x/oauth2 golang.org/x/oauth2/clientcredentials @@ -877,7 +877,7 @@ google.golang.org/appengine/internal/log google.golang.org/appengine/internal/remote_api google.golang.org/appengine/internal/urlfetch google.golang.org/appengine/urlfetch -# google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 +# google.golang.org/genproto v0.0.0-20240108191215-35c7eff3a6b1 ## explicit; go 1.19 google.golang.org/genproto/internal # google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 @@ -885,7 +885,7 @@ google.golang.org/genproto/internal google.golang.org/genproto/googleapis/api google.golang.org/genproto/googleapis/api/annotations google.golang.org/genproto/googleapis/api/httpbody -# google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 ## explicit; go 1.19 google.golang.org/genproto/googleapis/rpc/status # google.golang.org/grpc v1.60.1