diff --git a/VERSION b/VERSION index 9cf3902a..66d60537 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,6 @@ -v9.5.1 +v9.5.2 + +v9.5.2 Bug fix in baggage options for JS client, wag-js baggage is now always a map. Server propagation now uses clever-request-id provided in baggage if available, and produces a uuid if it is not, instead of defaulting to traceid. v9.5.1 Minor bug fix in the typing of options in the generated JS client diff --git a/_hardcoded/tracing.go b/_hardcoded/tracing.go index 55f4d814..852f29be 100644 --- a/_hardcoded/tracing.go +++ b/_hardcoded/tracing.go @@ -10,6 +10,8 @@ import ( "strconv" "time" + "github.com/google/uuid" + "github.com/Clever/kayvee-go/v7/logger" "go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux" @@ -121,19 +123,19 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { } ctx := r.Context() - var crid string - s := trace.SpanFromContext(ctx) - crid = s.SpanContext().TraceID().String() bags := baggage.FromContext(ctx) - // Add clever-request-id to baggage - member, err := baggage.NewMember("clever-request-id", crid) - if err != nil { - logger.FromContext(ctx).WarnD("error-creating-baggage", logger.M{"error": err.Error()}) - } else { - bags, err = bags.SetMember(member) + + if bags.Member("clever-request-id").String() == "=" { // if clever-request-id is not set + reqid, err := baggage.NewMember("clever-request-id", uuid.New().String()) if err != nil { - logger.FromContext(ctx).WarnD("error-creating-baggage", logger.M{"error": err.Error()}) + logger.FromContext(ctx).ErrorD("error creating baggage member", logger.M{"error": err.Error()}) + } else { + bags, err = bags.SetMember(reqid) + if err != nil { + logger.FromContext(ctx).ErrorD("error setting baggage member", logger.M{"error": err.Error()}) + } + } } @@ -145,15 +147,16 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { // Add baggage to the context ctx = baggage.ContextWithBaggage(ctx, bags) - // Log if sampled - if s.SpanContext().IsSampled() { - logger.FromContext(ctx).AddContext("sampled", "true") - } else { - logger.FromContext(ctx).AddContext("sampled", "false") - } - // Encode the trace/span ids in the DD format if sc := s.SpanContext(); sc.HasTraceID() { + + // Log if sampled + if s.SpanContext().IsSampled() { + logger.FromContext(ctx).AddContext("sampled", "true") + } else { + logger.FromContext(ctx).AddContext("sampled", "false") + } + spanID, traceID := sc.SpanID().String(), sc.TraceID().String() // datadog converts hex strings to uint64 IDs, so log those so that correlating logs and traces works if len(traceID) == 32 && len(spanID) == 16 { // opentelemetry format: 16 byte (32-char hex), 8 byte (16-char hex) trace and span ids diff --git a/clients/js/genjs.go b/clients/js/genjs.go index fe51ebd8..5a23be82 100644 --- a/clients/js/genjs.go +++ b/clients/js/genjs.go @@ -103,21 +103,21 @@ const RollingNumberEvent = require("hystrixjs/lib/metrics/RollingNumberEvent"); const { Errors } = require("./types"); function parseForBaggage(entries) { + if (!entries) { + return ""; + } // Regular expression for valid characters in keys and values const validChars = /^[a-zA-Z0-9!#$%&'*+` + "`\\-.^_`" + `|~]+$/; - // Transform the entries object into an array of strings - const baggageItems = Object.entries(entries).map(([key, value]) => { - // Remove invalid characters from key and value + + const pairs = []; + + entries.forEach((value, key) => { const validKey = key.match(validChars) ? key : encodeURIComponent(key); const validValue = value.match(validChars) ? value : encodeURIComponent(value); - - return ` + "`${validKey}=${validValue}`" + `; + pairs.push(` + "`" + `${validKey}=${validValue}` + "`" + `); }); - // Combine the array of strings into the final baggageString - const baggageString = baggageItems.join(','); - - return baggageString; + return pairs.join(","); } /** @@ -429,30 +429,14 @@ const methodTmplStr = ` options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "{{.Operation}}"; headers[versionHeader] = version; @@ -616,7 +600,7 @@ const singleParamMethodDefinitionTemplateString = `/**{{if .Description}} * @param {{if $param.JSDocType}}{{.JSDocType}} {{end}}{{$param.JSName}}{{if $param.Default}}={{$param.Default}}{{end}}{{if $param.Description}} - {{.Description}}{{end}}{{end}} * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:{{.ServiceName}}.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy {{- if .IterMethod}} * @returns {Object} iter @@ -654,7 +638,7 @@ const pluralParamMethodDefinitionTemplateString = `/**{{if .Description}} * @param {{if $param.JSDocType}}{{.JSDocType}} {{end}}{{if not $param.Required}}[{{end}}params.{{$param.JSName}}{{if $param.Default}}={{$param.Default}}{{end}}{{if not $param.Required}}]{{end}}{{if $param.Description}} - {{.Description}}{{end}}{{end}} * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:{{.ServiceName}}.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy {{- if .IterMethod}} * @returns {Object} iter @@ -1377,7 +1361,7 @@ interface RetryPolicy { interface RequestOptions { timeout?: number; - baggage?: object; + baggage?: Map; retryPolicy?: RetryPolicy; } @@ -1398,7 +1382,7 @@ interface CircuitOptions { interface GenericOptions { timeout?: number; - baggage?: object; + baggage?: Map; keepalive?: boolean; retryPolicy?: RetryPolicy; logger?: Logger; diff --git a/hardcoded/hardcoded.go b/hardcoded/hardcoded.go index eb68885b..2b89f97d 100644 --- a/hardcoded/hardcoded.go +++ b/hardcoded/hardcoded.go @@ -2,7 +2,7 @@ // sources: // ../_hardcoded/doer.go (10.35kB) // ../_hardcoded/middleware.go (1.685kB) -// ../_hardcoded/tracing.go (6.789kB) +// ../_hardcoded/tracing.go (6.855kB) package hardcoded @@ -110,7 +110,7 @@ func _hardcodedMiddlewareGo() (*asset, error) { return a, nil } -var __hardcodedTracingGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x58\x5b\x6f\xdb\x38\xf6\x7f\x96\x3e\xc5\xf9\x0b\x98\xf9\x4b\x85\x22\x25\x73\xe9\x0c\x32\xc8\x43\x6e\x6d\x8d\x49\x32\x46\x92\x6e\xb1\x58\x2c\x02\x5a\x3a\x96\x89\x4a\xa4\x96\xa4\x7c\x41\x91\xef\xbe\x38\x24\x65\xcb\x8e\xe3\x69\x0b\x6c\x1f\x52\x99\x3c\xfc\xf1\xdc\x2f\x6c\x59\xf1\x99\x55\x08\x1a\xd5\x1c\x95\x51\xac\xe0\xa2\x0a\x43\xde\xb4\x52\x19\x88\xc3\x20\x2a\xa4\x30\xb8\x34\x51\x18\x44\x28\x0a\x59\x72\x51\xe5\x13\x2e\x98\x5a\x6d\x2d\xcd\x70\x49\xbf\xa7\x8d\xa5\x14\x68\xf2\x99\x31\x2d\x7d\x4b\x4d\x7f\xb5\x51\x85\x14\x73\xfa\x34\xbc\xc1\x28\x0c\x83\xa8\xe2\x66\xd6\x4d\xb2\x42\x36\xf9\x65\x8d\x73\x54\xf9\x67\xb6\x9a\x23\x1e\x55\x32\x9f\xff\x96\xd7\xb2\xaa\x50\x39\x4a\x99\xc9\x16\x85\xc1\x1a\x1b\x34\x6a\x95\x71\x99\x13\x63\x8a\x4f\x72\x2e\xb4\x51\x5d\x83\xc2\x30\xc3\xa5\xc8\x07\xa8\x95\x54\xbc\xae\x59\xde\x74\xcb\x5c\x1a\xac\x9b\xce\x32\xb9\x0f\x8d\xb6\x0f\xed\xe5\x13\x56\x55\xac\xc2\x83\x34\xb8\x24\xb5\xa1\xd2\xb9\x34\x75\x6b\xff\x90\x4a\xbf\xef\xd0\xe6\xab\x52\x6d\x71\x10\xa2\x55\xb2\x65\x95\x15\xff\x20\x9d\x2e\x3f\xe7\x0a\xb5\xec\x94\xe5\x49\x97\x9f\x2d\x3e\x1c\x3e\xf1\xf7\x22\xac\xa9\xdc\x5f\x83\x9a\xbc\x40\x63\x43\x26\x3f\x84\xee\x28\xf2\xf9\x49\x76\x72\x9c\x1d\x1f\xbc\xc3\x73\x91\x84\xe1\x9c\x29\x28\x71\xca\xba\xda\x5c\xca\xba\xc6\xc2\x48\xf5\x41\x6a\x03\xda\x28\x2e\x2a\x38\x83\xa8\x96\x05\xab\x67\x92\xd8\xd8\x47\x3d\x26\xe7\xee\xb8\x30\x27\x6f\xe1\x0c\x7e\xf9\xf9\xe4\xb7\x30\xcc\x73\x78\x40\xd3\xb5\xef\x6b\x39\x61\xf5\x23\xdd\x36\x56\x72\xce\x4b\x54\xe7\xa2\xbc\xf6\x46\x02\x8d\x46\x43\xd7\x82\x99\x21\x54\x96\x14\x9c\x0e\x5b\x4f\x0c\x4c\x94\xd0\xdb\x34\x0b\xa7\x9d\x28\xbe\x06\x38\x2e\xcc\x12\x7c\xac\x65\x97\xee\xff\x04\xe2\xde\x44\xd9\x43\xcb\x44\x4f\x9b\xc2\x9b\xf5\xba\xc5\x53\x3d\x60\x0a\xa8\x94\x54\x09\x7c\x09\xc3\x20\xcf\xe1\x7a\x8e\x6a\x05\x27\xbf\x82\xc6\x42\x8a\x52\xc3\x02\xff\xbf\x26\x8e\x57\x60\x24\x5d\x27\xb0\x30\xf4\xb9\xa5\x73\x28\x7a\x45\x01\x33\x16\x87\xa4\xf5\x4a\x04\xd2\x2d\x79\x1a\xc8\x29\xac\xf5\x7c\x6a\x95\x48\xa4\x9f\x66\x28\x40\x75\x42\x90\x29\xb8\x20\xbd\x94\x5d\x61\x0f\x98\x19\xd7\xc0\x35\x30\xd0\xbc\xc4\x82\xa9\xd4\x2a\x6b\x31\x38\x61\x21\x2c\x6a\xbd\x1a\xd0\xf7\x2b\x3d\xae\x6c\x71\xcd\xed\xd1\x9a\xdb\x2c\x0c\xc8\xda\x7a\xa0\x2a\xd8\xab\xc0\x30\x60\x65\xa9\xe0\xf4\x0c\xa6\x8d\xc9\x1e\x5a\xc5\x85\x99\xc6\xd1\x0f\xfa\xf4\x87\x32\x4a\xf7\x3a\xd7\xcb\x55\x72\xa2\x24\x0c\x50\x59\x20\xab\xf7\x58\xf0\x3a\x09\x03\x3e\x85\x58\xea\xec\x3d\x1a\x14\xf3\x38\x7a\x7a\xbc\x3f\xbf\x1c\xdd\xbd\x7f\xba\xbe\x3b\xbf\xb8\xb9\xbe\x8a\x92\x04\xce\xce\x20\x32\xaa\xc3\xc8\x5a\x2a\xa0\x50\xbf\xac\x39\x0a\x43\x58\x5b\x81\x9f\xdd\xe1\xc2\x6d\xc5\x61\xe0\x28\x37\x7b\x9f\xb8\x99\xdd\xa3\xb7\x23\x97\x62\x8c\x8a\xcb\x32\x3e\xf9\xf5\x0d\x25\xd9\xec\xc1\x5a\x3d\x49\xf7\x1f\xbc\x16\x65\x2b\xb9\x30\x31\x29\xe3\x35\xa2\x91\xd0\x58\x74\x0a\x63\x4b\x90\x84\x41\xa0\xb7\x3c\x91\xc4\x1f\x70\x4c\xdc\x92\x2b\xa7\xb0\x11\x89\x0e\xf1\xa9\xa5\xfc\xbf\x33\x10\xbc\x86\x2f\x74\x97\x42\xd3\x29\x41\xbf\x53\xf7\x87\x6c\x71\x4d\x6a\x9c\xc6\x91\x55\x27\x14\x0a\x99\x21\x7b\xf7\xf1\x74\x0a\x3f\xcc\x23\x7b\x29\x81\x3e\x87\xc1\x33\x60\xad\xd1\x02\x6e\x99\xfd\x0c\xd6\x99\x88\x58\xba\x93\xb2\x5d\x47\x5a\x12\x06\xcf\x61\x18\x98\x96\x74\x2d\x70\xb1\x1d\x42\xf1\xb6\x7c\x02\x17\xf7\x3e\x63\xc6\x49\x12\x06\x94\x8b\xb2\x07\x34\x3b\x87\x4c\x9b\x84\x61\xe0\x2a\x56\xf6\x4e\xc9\xc6\x87\x30\xe9\x22\xc9\x46\x62\x2a\xaf\xe2\x48\x1b\xa6\x48\x9c\x23\xcb\x9b\x8a\x52\xf0\x07\x6e\x89\xff\x88\xcc\x80\x5a\x47\xa7\x40\x5f\x69\x18\x3c\x27\x61\xaf\xa5\x6d\xa6\x4c\x6b\x55\x16\x3e\x87\x2e\xbf\xbc\x14\x02\x0f\xfa\x7f\x0a\x7d\x15\x80\x37\xfd\x57\xd6\x8b\x99\xbc\x9a\x5d\x48\xcd\x9a\x35\x6d\xcd\x45\x35\x56\x72\xc2\x26\xbc\xe6\x66\x45\x6a\x3c\xce\x8e\x7f\x0d\x03\xae\x6f\x28\x50\xad\x0f\x0f\xfc\x7f\xf4\xf0\x74\xf3\xd7\xe5\xf9\x4d\x34\xf0\x7b\x1b\x25\x3d\xbd\x35\xdf\x1e\xe0\x33\x38\xc9\x8e\xd7\x46\xe6\x53\x98\xef\x40\xf7\x91\xf5\x70\x7e\x3b\xbe\xa1\x8f\xf1\xfd\x5f\x17\xe7\x17\xa3\x9b\xd1\xe3\x3f\xa3\xe4\x0f\x98\x93\xc7\x45\xd1\x6b\x17\x90\xa1\xae\xc5\xdc\x79\xf1\xe9\x19\xf8\x26\x25\x1b\x33\xa5\xf1\x5d\x2d\x99\x89\xe7\x29\xbc\xfd\xe5\x15\x0f\x7e\x1d\x91\x38\x77\x0e\xfa\x8a\x5c\xaf\x1f\x1d\x3a\xe7\xda\x0e\x77\x2f\x0c\x1c\x06\x36\xd9\x22\x74\x1a\xb7\xd2\xf3\xe8\x0a\x2a\x14\xa8\x18\x25\x44\x18\x09\x90\x8a\x4c\x37\x95\x6a\x7d\x29\x25\xfc\x85\x54\x9f\x21\x66\x06\x6a\x64\xda\xc0\x82\x9b\x99\xcb\xb7\x96\x08\x6d\x7c\xf9\xc4\x3f\x44\x84\xa6\xd3\xa6\xff\x89\xbe\xf4\x8d\xae\x34\x74\x82\x4f\xa5\x6a\xea\x15\x30\x03\x8a\x89\x52\x36\x30\x55\xb2\xb1\x08\x28\x0c\x57\x48\x4e\x5c\x20\x95\x0d\x2a\xbd\x6f\x7f\xc9\xdc\x15\xef\xa4\x02\x5c\xda\x5b\xd3\x2d\x49\x96\x47\x8a\xad\xb6\x6f\x2f\x25\x6a\x10\xd2\x40\x29\x2d\xb7\x1e\x62\xad\x27\xca\x58\x0f\x4e\x80\x78\xdb\x89\x47\x57\xf7\x54\xb5\x2e\x98\xc6\x32\x4e\x6c\x32\x3b\x7c\x6a\xcc\x14\x0a\xe3\xe8\x0f\x40\xed\x31\x64\xe2\xe0\xf3\x1c\x1e\x67\xa8\x11\x1a\xb6\xe4\x4d\xd7\x68\x60\x0a\x49\xf5\x55\xc7\x54\x09\xac\x62\xd4\xb9\x82\x96\x0d\x9a\x19\x59\xa5\x92\xf4\x77\xa1\xa4\xa8\x6c\x5d\xd4\x28\xa8\xb5\x06\x06\xc6\x55\xdb\x92\x19\x06\x9d\xc0\x65\x8b\x85\xc1\xb2\x5e\xbd\x10\xa2\x65\xe2\x86\x37\xdc\xe8\xed\xc6\xc1\xad\x59\x9f\x3d\x37\xd4\x34\x77\x06\x2f\x65\x27\x8c\xdd\x38\x85\x93\xe3\x63\x9b\xfe\xaf\xe7\x28\xcc\x70\x83\xfe\xf5\x9b\x37\x5c\x7c\xde\xdd\xeb\x37\x9f\x93\x34\xdc\x65\xe6\x82\x99\x62\x36\x48\x45\x2f\x75\xbe\x4e\xac\x7d\x0e\x22\x92\xc3\x39\x76\xb3\x87\x4b\x73\xcb\xda\xb1\xef\x7c\xa5\x8a\x07\x4d\xb0\xad\x99\xb2\x69\xa5\xe6\x06\x0f\x53\xda\x3b\x7c\xb2\xfe\xf2\x9c\xc2\x70\xef\xc2\xb5\xfc\x5f\x9e\x13\x4a\xee\x3e\x13\x9b\x96\xd2\xee\xd7\x75\x8b\xef\xa4\x7a\x44\x6d\xa8\x87\x69\x90\x09\xdb\x69\x4d\x6c\xc8\x96\xd4\x1a\x75\x82\x1b\xa0\x12\xc5\x45\x95\x12\x24\x59\xbd\xe1\x54\xfa\xb4\x8d\x04\x4d\x57\x00\x9b\xc8\x39\xda\x00\x96\x9d\xa1\xce\xc9\x86\xd0\xe0\x6c\x06\x23\x03\x8e\x3d\x0d\x4c\x00\x17\x47\x0d\x36\x52\xad\x08\x73\x5d\x09\xa6\x3e\xce\xb8\xed\xa0\xfa\x10\x2e\x6d\x69\xd1\x5f\xdf\xa8\x7a\x99\xe2\x04\xe2\x37\x9b\x1a\x3b\x12\xb7\xf6\xc6\x6f\x6a\x51\x83\x35\x6f\xa7\x3b\xf5\x7a\x17\x8e\x6a\xf6\x6b\xf5\x1a\xbf\xa7\x56\xf7\xd6\xc4\x7d\x35\x35\xcf\xe1\xb6\x5b\x3e\xd8\x91\xf8\x96\x97\x65\x8d\x0b\x0a\xdd\x5e\xc3\xcd\x66\xc9\xcc\x98\x01\x3d\x93\x5d\x5d\x92\x61\x99\x31\xac\x98\x61\x49\x76\x66\x30\x98\x3e\xfd\x7c\x9d\x11\xf4\xc8\xb8\x34\x66\x16\x36\x87\x89\x4a\x9f\x82\xed\x0c\xb4\x33\x85\x6b\x8a\x59\x59\xba\xdf\x6e\xf0\x01\x2e\xa6\x92\x60\xc9\x2d\x14\xfe\xa7\x43\x6d\x8e\x74\x8b\x05\x9f\xf2\xa2\x6f\x23\x08\xfd\x9e\x57\x33\x03\x42\x2e\x60\x81\x20\x45\xbd\x02\xdd\xb5\x76\x98\x27\x22\xb2\x3c\x65\x6b\x2e\x2c\x10\x65\x6c\x66\x9c\x14\x57\xcc\xb0\x52\xda\x56\x0b\x0b\xd3\x3b\xc4\x1e\x3d\xc4\x24\x0b\x2f\xf0\x8e\x35\xe8\x47\xae\x04\x88\x38\xa6\x89\x3f\xfb\xc0\x44\x49\xf5\x03\x86\xbf\xc8\xd8\xd2\xd0\xfc\xed\xfa\x5b\x3b\x8a\x67\xfb\x31\xd3\xf5\x3e\xe5\x88\x4d\xd8\xea\xd8\xda\xf3\xfd\xbe\xd8\x4f\xc8\xdc\x79\x6e\x5b\xc8\x31\x75\xf3\xb5\x88\xa3\xf3\xd2\xa6\xcf\x8d\xfa\x07\x96\x8b\x36\x2e\xe0\x58\x87\xc3\xcc\xf7\xc4\x4e\x88\x2d\x49\xdf\xd1\x79\x0b\xa2\x16\xee\xdc\x3d\xea\x56\x0a\x8d\x9f\x14\x77\xcd\x16\xbc\xf1\xeb\xd6\x6e\x89\xeb\x1e\xf8\x14\x54\xbf\xf4\xf1\x7e\x64\x5b\xa3\xfc\x69\x86\xac\x36\x33\xd7\xb1\x04\xc1\x2c\xb3\xda\xff\xf0\xf8\x38\x8e\xd5\x22\x05\x5b\x96\x7b\x66\xe8\x93\x3a\x8c\x80\x46\xc7\xd3\x33\x50\xfd\xdc\x18\x53\xba\x0a\xec\x2c\x54\x28\x5e\x7a\x23\xd9\x35\xbd\x0e\x35\x5b\x18\x76\x3b\x55\x8b\x46\x47\xce\x40\x5b\x82\x35\x62\x5f\xfa\xe2\x24\x7b\xb0\x70\xb1\x25\x9e\xb0\xca\x42\xfa\xd7\x91\x17\xad\x2f\xd1\xe4\x39\x9c\x97\x25\x14\xf6\x89\xe7\xa8\x77\x5e\x6e\xa3\xc4\x9f\x23\xb2\x06\x9b\x49\x3f\x51\x0c\x10\xef\x70\x71\x6b\x77\xe2\xe8\x05\x42\x94\x5a\x01\x13\xaf\xce\xdd\xfe\xec\xd5\x7e\xfc\x13\x53\xe2\xca\x0f\x19\x47\xfd\x90\x71\xd4\xbf\xf0\x0c\xda\x72\x47\x12\x9d\x12\xb4\x9b\x4d\xe2\xe4\xd9\x5e\x37\x18\x3c\x9c\x16\xfa\x51\x88\xbe\x29\xe9\x78\xa6\x9d\x54\xce\x6c\xfb\x58\xfc\x5f\xf2\xe8\xbc\xe3\x39\x1c\x18\x81\xa2\xde\x63\xf4\xd9\xc4\x01\x11\x0d\x55\x88\xa7\x94\xf6\xad\x3b\x31\x51\xa1\x13\xc7\xc9\xa2\xe3\xe4\x6f\xf4\x7a\x5e\x96\xfd\xef\x09\xab\xb2\x3f\x71\x15\x27\x16\x2f\xfb\x07\xab\x3b\x97\x94\x77\x18\xda\x61\xc6\xbf\x80\xf4\x5e\xbd\x71\x03\x8f\xeb\x1a\x0b\xbb\xe4\xc6\x4c\xe2\x2f\xe9\x01\x6f\x64\x45\x53\x82\x6b\x61\x4b\xef\x15\xbb\x8e\x3c\xd2\xae\xd7\x2b\xbf\x45\x9c\xc8\x63\x46\xa9\x9f\x5f\x5e\x3a\xc1\x37\xa2\x4c\x59\xad\x7b\x98\x9e\xff\x6b\x51\xc8\xd2\xb5\xf3\xee\x39\x8d\x0a\x00\xf0\x72\x9d\xb0\xaf\xae\x7c\xce\xee\x65\x2b\xec\x98\xb0\x2d\xe1\x1f\xa0\x8b\xec\x03\xd3\xeb\x88\xf5\x0c\x12\xd8\xe8\x2a\x75\xd0\xa3\x2b\x7b\xb2\xb0\x47\xb7\xc2\x3a\xa5\xd5\xfd\xd1\x4e\x3c\x96\xbe\x4e\xd0\xa0\x84\x54\xb4\x66\xb8\xf4\x19\x46\x93\x15\x5d\x6f\x4f\x55\x26\x05\x2d\xc9\xbb\xc0\xcc\xa4\x46\xfa\x61\x0b\x4d\x21\x95\xc2\xda\xcd\xf5\xb5\xac\xb4\x2d\x77\x96\x27\x6d\xa7\x12\xdd\xc7\x4a\x8d\x22\xf6\xbc\xda\xc1\xf1\xe7\x9f\xe0\xc7\x1f\xed\xaa\x93\xc4\x2e\x9e\xbc\x85\x2f\x90\xe7\x3b\x0f\x58\x4e\x49\xa7\xb4\x3b\x59\x19\x84\xf8\xe7\x9f\x8e\x8a\x19\x53\xc4\x6c\x92\xc2\xef\x7e\xf5\xe4\xed\x66\xd5\xcf\x32\xb6\xf1\xf6\x5a\x0f\x5d\x84\x7a\x1e\x2e\x74\x0a\x4f\xa4\xb4\x19\x2e\xb3\x2b\x24\x4b\x79\xdd\xf4\x4c\x1e\x0e\xe8\xa1\x1f\x94\x65\x66\x0f\x3d\x51\x0e\x73\xc7\x82\xed\xa7\x28\xf2\x11\xf7\xcc\x9e\x5d\xf0\xea\x5a\x94\x9c\x89\xec\xa3\xd5\x6d\xbc\x66\xe8\x5f\xbf\x9f\xfe\x3b\x49\xfc\xbd\x4e\x29\xaf\x73\xe9\x95\xf6\x4d\x4c\xd2\x99\xef\xe3\xb1\xe7\xa6\x67\x6f\x90\x8a\x28\x4b\x2a\x5b\xdc\x77\x2b\xc5\xde\x72\x47\xdd\x77\xf0\xec\xfb\xb2\x41\x8b\xb7\xe9\x78\x37\xaf\x19\x25\xea\x42\xf1\x89\x9d\x71\x69\x98\x65\x6d\x5b\x73\xf7\x5c\x69\xbb\xa3\x8f\xd4\x79\xdb\x51\x18\x8d\x75\xc0\xae\x75\x76\x57\xeb\xf7\xdb\xf5\x8b\xca\xa6\x95\xdc\xf3\x48\x42\x21\x45\xf5\x95\xb5\xed\xa0\x0f\xb2\x8f\x1a\xc3\x97\x8f\xf3\xf1\xf8\xe9\xee\xfc\xf6\x3a\x4a\x06\x0f\x11\xfd\x99\xb3\x57\x48\x87\x0f\x1e\x03\x8a\xaf\xc7\xda\x82\x0a\x03\xe5\x3d\x62\x2d\xc4\x2d\xaa\x0a\x63\xdb\xd4\xf8\x95\x2b\x37\x72\xbb\x47\xbe\xf5\xea\x1d\x2e\xc8\x4a\xeb\x91\x51\xdb\x17\x48\xff\x68\x9f\x3d\x14\x33\x6c\xd8\xc7\xfb\x9b\x74\x6b\x75\xd3\xc8\xfd\x89\xab\x3e\x7b\x78\x36\xdd\x1b\xa2\x1b\xf2\x7c\x43\xa5\xc2\xe7\xf0\xbf\x01\x00\x00\xff\xff\xb5\x99\x8b\x90\x85\x1a\x00\x00") +var __hardcodedTracingGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x58\xdd\x6f\xe3\x36\x12\x7f\x96\xfe\x8a\x39\x01\xed\x49\x0b\x45\x4a\xfa\xb1\x2d\x52\xe4\x21\x5f\xbb\x6b\x34\x49\x83\x24\x7b\xc5\xe1\x70\x08\x68\x69\x2c\x13\x2b\x91\x2a\x49\xd9\x31\x16\xf9\xdf\x0f\x43\x52\xb2\x9c\xd8\xbe\x74\xf7\x21\x2b\x93\xc3\xe1\x7c\xcf\x6f\xd8\xb2\xe2\x0b\xab\x10\x34\xaa\x05\x2a\xa3\x58\xc1\x45\x15\x86\xbc\x69\xa5\x32\x10\x87\x41\x54\x48\x61\xf0\xc9\x44\x61\x10\xa1\x28\x64\xc9\x45\x95\x4f\xb9\x60\x6a\xb5\xb1\x34\xc7\x27\xfa\x3d\x6b\x2c\xa5\x40\x93\xcf\x8d\x69\xe9\x5b\x6a\xfa\xab\x8d\x2a\xa4\x58\xd0\xa7\xe1\x0d\x46\x61\x18\x44\x15\x37\xf3\x6e\x9a\x15\xb2\xc9\x2b\x29\xab\x1a\xf3\xae\xe3\xe5\xcb\xad\xf3\x1a\x17\xa8\xf2\x2f\x6c\xb5\x40\x3c\xa8\x64\xbe\xf8\x25\xaf\x65\x55\xa1\x72\x94\x32\x93\x2d\x0a\x83\x35\x36\x68\xd4\x2a\xe3\x32\x27\x99\x15\x9f\xe6\x5c\x68\xa3\xba\x06\x85\x61\x86\x4b\x91\x6f\x5c\xa8\x78\x5d\xb3\xbc\xe9\x9e\x72\x69\xb0\x6e\x3a\x2b\xff\x36\x6e\xb4\xbd\x6f\x2f\x9f\xb2\xaa\x62\x15\xee\xa5\xc1\x27\xb2\x28\x2a\x9d\x4b\x53\xb7\xf6\x0f\x59\xfb\xdb\x0e\xad\xbf\x2a\xd5\x16\x7b\x59\xb4\x4a\xb6\xac\xb2\xea\xef\xa5\xd3\xe5\x97\x5c\xa1\x96\x9d\xb2\x32\xe9\xf2\x8b\xe5\x0f\xfb\x4f\xfc\x7f\x15\x06\x2a\xf7\xd7\xa0\xa6\x00\xd1\xd8\x50\x34\xec\xe3\xee\x28\xf2\xc5\x51\x76\x74\x98\x1d\xee\xbd\xc3\x4b\x91\x84\xe1\x82\x29\x28\x71\xc6\xba\xda\x9c\xcb\xba\xc6\xc2\x48\xf5\x49\x6a\x03\xda\x28\x2e\x2a\x38\x81\xa8\x96\x05\xab\xe7\x92\xc4\xd8\x46\x7d\x4b\x71\xdf\x71\x61\x8e\xde\xc3\x09\xfc\xf4\xe3\xd1\x2f\x61\x98\xe7\x70\x8f\xa6\x6b\x3f\xd6\x72\xca\xea\x07\xba\xed\x56\xc9\x05\x2f\x51\x9d\x8a\xf2\xd2\x3b\x09\x34\x1a\x0d\x5d\x0b\x66\x8e\x50\x59\x52\x70\x36\x6c\x3d\x31\x30\x51\x42\xef\xd3\x2c\x9c\x75\xa2\x78\x0b\xe3\xb8\x30\x4f\xe0\xd3\x30\x3b\x77\xff\x27\x10\xf7\x2e\xca\xee\x5b\x26\x7a\xda\x14\xde\x0d\xeb\x96\x9f\xea\x19\xa6\x80\x4a\x49\x95\xc0\xd7\x30\x0c\xf2\x1c\x2e\x17\xa8\x56\x70\xf4\x33\x68\x2c\xa4\x28\x35\x2c\xf1\x9f\x35\x49\xbc\x02\x23\xe9\x3a\x81\x85\xa1\xcf\x0d\x9b\x43\xd1\x1b\x0a\x98\xb1\x7c\x48\x5b\x6f\x44\x20\xdb\x52\xa4\x81\x9c\xc1\x60\xe7\x63\x6b\x44\x22\xfd\x73\x8e\x02\x54\x27\x04\xb9\x82\x0b\xb2\x4b\xd9\x15\xf6\x80\x99\x73\x0d\x5c\x03\x03\xcd\x4b\x2c\x98\x4a\xad\xb1\x96\xa3\x13\x96\x85\xe5\x5a\xaf\x46\xf4\xfd\x4a\xcf\x57\xb6\x38\x48\x7b\x30\x48\x9b\x85\x01\x79\x5b\x8f\x4c\x05\x5b\x0d\x18\x06\xac\x2c\x15\x1c\x9f\xc0\xac\x31\xd9\x7d\xab\xb8\x30\xb3\x38\xfa\x4e\x1f\x7f\x57\x46\xe9\xd6\xe0\x7a\xbd\x4a\x41\x94\x84\x01\x2a\xcb\xc8\xda\x3d\x16\xbc\x4e\xc2\x80\xcf\x20\x96\x3a\xfb\x88\x06\xc5\x22\x8e\x1e\x1f\xee\x4e\xcf\x27\x37\x1f\x1f\x2f\x6f\x4e\xcf\xae\x2e\x2f\xa2\x24\x81\x93\x13\x88\x8c\xea\x30\xb2\x9e\x0a\x28\xd5\xcf\x6b\x8e\xc2\x10\xaf\x8d\xc4\xcf\x6e\x70\xe9\xb6\xe2\x30\x70\x94\xeb\xbd\x3f\xb9\x99\xdf\xa1\xf7\x23\x97\xe2\x16\x15\x97\x65\x7c\xf4\xf3\x3b\xaa\xbf\xd9\xbd\xf5\x7a\x92\x6e\x3f\x78\x29\xca\x56\x72\x61\x62\x32\xc6\x2e\xa2\x89\xd0\x58\x74\x0a\x63\x4b\x90\x84\x41\xa0\x37\x22\x91\xd4\x1f\x49\x4c\xd2\x52\x28\xa7\xb0\x56\x89\x0e\xf1\x99\xa5\xfc\xc7\x09\x08\x5e\xc3\x57\xba\x4b\xa1\xe9\x94\xa0\xdf\xa9\xfb\x43\xbe\xb8\x24\x33\xce\xe2\xc8\x9a\x13\x0a\x85\xcc\x90\xbf\xfb\x7c\x3a\x86\xef\x16\x91\xbd\x94\x98\x3e\x87\xc1\x33\x60\xad\xd1\x32\xdc\x70\xfb\x09\x0c\x95\x88\x44\xba\x91\xb2\x1d\x32\x2d\x09\x83\xe7\x30\x0c\x4c\x4b\xb6\x16\xb8\xdc\x4c\xa1\x78\x53\x3f\x81\xcb\x3b\x5f\x31\xe3\x24\x09\x03\xaa\x45\xd9\x3d\x9a\x17\x87\x4c\x9b\x84\x61\xe0\x3a\x56\xf6\x41\xc9\xc6\xa7\x30\xd9\x22\xc9\x26\x62\x26\x2f\xe2\x48\x1b\xa6\x48\x9d\x03\x2b\x9b\x8a\x52\xf0\x07\xae\x49\xfe\x88\xdc\x80\x5a\x47\xc7\x40\x5f\x69\x18\x3c\x27\x61\x6f\xa5\x4d\xa1\x4c\x6b\x4d\x16\x3e\x87\xae\xbe\xbc\x56\x02\xf7\xc6\x7f\x0a\x7d\x17\x80\x77\xfd\x57\xd6\xab\x99\xec\xac\x2e\x64\x66\xcd\x9a\xb6\xe6\xa2\xba\x55\x72\xca\xa6\xbc\xe6\x66\x45\x66\x3c\xcc\x0e\x7f\x0e\x03\xae\xaf\x28\x51\x6d\x0c\x8f\xe2\x7f\x72\xff\x78\xf5\xc7\xf9\xe9\x55\x34\x8a\x7b\x9b\x25\x3d\xbd\x75\xdf\x16\xc6\x27\x70\x94\x1d\x0e\x4e\xe6\x33\x58\xbc\x60\xdd\x67\xd6\xfd\xe9\xf5\xed\x15\x7d\xdc\xde\xfd\x71\x76\x7a\x36\xb9\x9a\x3c\xfc\x3b\x4a\x7e\x83\x05\x45\x5c\x14\xed\xba\x80\x1c\x75\x29\x16\x2e\x8a\x8f\x4f\xc0\xe3\x97\xec\x96\x29\x8d\x1f\x6a\xc9\x4c\xbc\x48\xe1\xfd\x4f\x3b\x22\x78\x37\x47\x92\xdc\x05\xe8\x0e\xbd\x76\x1f\x1d\x07\xe7\xe0\x87\x9b\x57\x0e\x0e\x03\x5b\x6c\x11\x3a\x8d\x1b\xe5\x79\x72\x01\x15\x0a\x54\x8c\x0a\x22\x4c\x04\x48\x45\xae\x9b\x49\x35\x5c\x4a\x05\x7f\x29\xd5\x17\x88\x99\x81\x1a\x99\x36\xb0\xe4\x66\xee\xea\xad\x25\x42\x9b\x5f\xbe\xf0\x8f\x39\x42\xd3\x69\xd3\xff\x44\xdf\xfa\x26\x17\x1a\x3a\xc1\x67\x52\x35\xf5\x0a\x98\x01\xc5\x44\x29\x1b\x98\x29\xd9\x58\x0e\x28\x0c\x57\x48\x41\x5c\x20\xb5\x0d\x6a\xbd\xef\x7f\xca\xdc\x15\x1f\xa4\x02\x7c\xb2\xb7\xa6\x1b\x9a\x3c\x1d\x28\xb6\xda\xbc\xbd\x94\xa8\x41\x48\x03\xa5\xb4\xd2\x7a\x16\x83\x9d\xa8\x62\xdd\x3b\x05\xe2\xcd\x20\x9e\x5c\xdc\x51\xd7\x3a\x63\x1a\xcb\x38\xb1\xc5\x6c\xff\xa9\x5b\xa6\x50\x18\x47\xbf\x87\xd5\x16\x47\x26\x8e\x7d\x9e\xc3\xc3\x1c\x35\x42\xc3\x9e\x78\xd3\x35\x1a\x98\x42\x32\x7d\xd5\x31\x55\x02\xab\x18\x21\x57\xd0\xb2\x41\x33\x27\xaf\x54\x92\xfe\x2e\x95\x14\x95\xed\x8b\x1a\x05\xa1\x6e\x60\x60\x5c\xb7\x2d\x99\x61\xd0\x09\x7c\x6a\xb1\x30\x58\xd6\xab\x57\x4a\xb4\x4c\x5c\xf1\x86\x1b\xbd\x09\x1c\xdc\x9a\x8d\xd9\x53\x43\xa0\xb9\x33\x78\x2e\x3b\x61\xec\xc6\x31\x1c\x1d\x1e\xda\xf2\x7f\xb9\x40\x61\xc6\x1b\xf4\xaf\xdf\xbc\xe2\xe2\xcb\xcb\xbd\x7e\xf3\x39\x49\xc3\x97\xc2\x9c\x31\x53\xcc\x47\xa5\xe8\xb5\xcd\x87\xc2\xda\xd7\x20\x22\xd9\x5f\x63\xd7\x7b\xf8\x64\xae\x59\x7b\xeb\x91\xaf\x54\xf1\x08\x04\xdb\x9e\x29\x9b\x56\x6a\x6e\x70\x3f\xa5\xbd\xc3\x17\xeb\xaf\xcf\x29\x8c\xf7\xce\x1c\xe4\xff\xfa\x9c\x50\x71\xf7\x95\xd8\xb4\x54\x76\xdf\x86\x16\x3f\x48\xf5\x80\xda\x10\x86\x69\x90\x09\x8b\xb4\xa6\x36\x65\x4b\x82\x46\x9d\xe0\x06\xa8\x45\x71\x51\xa5\xc4\x92\xbc\xde\x70\x6a\x7d\xda\x66\x82\xa6\x2b\x80\x4d\xe5\x02\x6d\x02\xcb\xce\x10\x72\xb2\x29\x34\x3a\x9b\xc1\xc4\x80\x13\x4f\x03\x13\xc0\xc5\x41\x83\x8d\x54\x2b\xe2\x39\x74\x82\x99\xcf\x33\x6e\x11\x54\x9f\xc2\xa5\x6d\x2d\xfa\xed\x40\xd5\xeb\x14\x27\x10\xbf\x5b\xf7\xd8\x89\xb8\xb6\x37\xfe\x2d\x88\x1a\x0c\xb2\x1d\xbf\xe8\xd7\x2f\xd9\x51\xcf\xde\xd5\xaf\xf1\x5b\x7a\x75\xef\x4d\xdc\xd6\x53\xf3\x1c\xae\xbb\xa7\x7b\x3b\x2d\x5f\xf3\xb2\xac\x71\x49\xa9\xdb\x5b\xb8\x59\x2f\x99\x39\x33\xa0\xe7\xb2\xab\x4b\x72\x2c\x33\x86\x15\x73\x2c\xc9\xcf\x0c\x46\xd3\xa7\x1f\xbd\x33\x62\x3d\x31\xae\x8c\x99\xa5\xad\x61\xa2\xd2\xc7\x60\x91\x81\x76\xae\x70\xa0\x98\x95\xa5\xfb\xed\x06\x1f\xe0\x62\x26\x89\x2d\x85\x85\xc2\xbf\x3a\xd4\xe6\x40\xb7\x58\xf0\x19\x2f\x7a\x18\x41\xdc\xef\x78\x35\x37\x20\xe4\x12\x96\x08\x52\xd4\x2b\xd0\x5d\x6b\xe7\x7c\x22\x22\xcf\x53\xb5\xe6\xc2\x32\xa2\x8a\xcd\x8c\xd3\xe2\x82\x19\x56\x4a\x0b\xb5\xb0\x30\x7d\x40\x6c\xb1\x43\x4c\xba\xf0\x02\x6f\x58\x83\x7e\xe4\x4a\x80\x88\xe3\xb9\x31\x6d\xf6\x89\x89\x92\xfa\x07\x8c\x7f\x91\xb3\xa5\xa1\xf9\xdb\xe1\x5b\x3b\x8a\x67\xdb\x79\xa6\xc3\x3e\xd5\x88\x75\xda\xea\xd8\xfa\xf3\xe3\xb6\xdc\x4f\xc8\xdd\x79\x6e\x21\xe4\x2d\xa1\xf9\x5a\xc4\xd1\x69\x69\xcb\xe7\xda\xfc\x23\xcf\x45\xeb\x10\x70\xa2\xc3\x7e\xe1\x7b\x62\xa7\xc4\x86\xa6\x1f\xe8\xbc\x65\xa2\x96\xee\xdc\x1d\xea\x56\x0a\x8d\x7f\x2a\xee\xc0\x16\xbc\xf3\xeb\xd6\x6f\x89\x43\x0f\x7c\x06\xaa\x5f\xfa\x7c\x37\xb1\xd0\x28\x7f\x9c\x23\xab\xcd\xdc\x21\x96\x20\x98\x67\xd6\xfa\x9f\x1e\x1e\x6e\x63\xb5\x4c\xc1\xb6\xe5\x5e\x18\xfa\x24\x84\x11\xd0\xe8\x78\x7c\x02\xaa\x9f\x1b\x63\x2a\x57\x41\xa0\x87\xb4\xb2\x4d\xe0\x25\x2a\x25\x92\x29\xab\x2c\x95\x7f\xdc\x78\x85\x5c\x43\x2f\x28\xd1\x65\xd7\xd8\x4c\x51\xc5\x51\x61\xdf\x6a\x0e\xfa\x28\xe4\x65\x94\x64\xf7\x36\x0e\x62\x07\xf0\x4e\x22\xf8\x0a\x79\x4e\x80\xed\x15\x2d\xd5\x42\x6a\xe0\x1a\x8d\x57\xe5\x2f\x5e\x0e\x00\xac\x97\xe3\x06\x97\xbb\x6f\x4b\xa1\xeb\x78\x69\x27\x8d\xf5\xc5\xce\x30\x5b\x40\x5a\xb0\x13\x95\xdb\x59\xe3\xe2\xd5\xac\xe1\x65\x80\xc6\x0a\x30\x06\xe9\x8e\x32\x3a\xa6\x3b\xdc\xe9\x38\x79\x76\x17\x8f\xe6\x10\x6f\xd6\x7e\x34\xb2\xa6\xbb\x47\xe3\xf5\xb1\xfa\xba\x33\xdb\xa5\x7d\xa3\xb8\x1a\xcd\xb7\x4b\x6b\x21\x66\x1f\x3d\xee\x3b\xcf\xe1\xb4\x2c\x6d\x55\xe8\x59\xfa\x6a\xe3\x18\x12\x0d\x75\x90\xc7\x94\xf6\x6d\xb8\x31\x51\xe1\x38\x32\x74\xec\x23\x7b\xa7\x0a\xa7\x65\xd9\xff\x9e\xb2\x2a\xfb\x1d\x57\x71\x62\xf9\x65\xff\x62\x75\x87\xde\x8b\x1b\x02\xbd\x10\xc6\xbf\x90\xf4\x51\xbf\x8e\x18\xcf\xd7\x01\x0f\xbb\xe4\xc6\x50\x92\x2f\xe9\x19\x5e\x8a\x42\x96\x0e\x2e\xbb\xe7\x2a\x2a\xb0\xc0\xcb\xa1\x20\x5e\x5c\xf8\x9a\xe8\xe3\x5e\x17\x16\x86\xdb\xfc\x19\x92\xeb\x37\xd0\x45\xf6\x89\x69\x0f\x06\x63\xf7\xda\xe2\x6e\xb8\x92\x15\x85\xbd\x03\xd1\x65\x1f\x93\x2f\x18\x64\x13\xed\xe0\x66\x39\x58\xec\x2d\x26\x8b\x3c\xd7\x28\xf5\x33\xd4\xb6\xd0\xfb\x9b\x7c\x66\xac\xd6\x03\x23\xa7\x05\xd9\x64\x72\x91\x3a\x0b\x4d\x2e\xac\x01\x0a\xab\x00\xe9\x3a\x24\x5c\x4a\xab\x83\x09\x86\xe5\xde\x10\xa5\x6f\x27\x34\x4f\x21\xf5\xb6\x39\x3e\xf9\x6e\xa1\xc9\x99\x6e\x04\xa0\x66\x94\x82\x96\x14\x64\x60\xe6\x52\x23\xfd\xb0\xfd\xa8\x90\x4a\x61\xed\x52\xb2\x96\x95\xb6\x5d\xd1\xca\xa4\xed\xf0\xa2\x7b\xe3\xd6\x28\x62\x2f\xab\x2d\x3f\x3f\xfe\x00\xdf\x7f\x6f\x57\x9d\x26\x76\xf1\xe8\xbd\x2b\x49\x9b\xef\x5c\xce\xd7\xc7\xb4\x3b\x5d\x19\x84\xf8\xc7\x1f\x0e\x8a\x39\x53\x24\x6c\x92\xc2\xaf\x7e\xf5\xe8\xfd\x7a\xd5\x8f\x3c\x16\x9f\xfb\xe0\x71\x66\x0b\xbc\x0c\x67\x3a\x85\x47\x32\xda\x1c\x9f\xb2\x0b\xa4\x80\xf3\xb6\xe9\x85\x7c\xbb\xa3\xca\x32\xb3\x87\x1e\xa9\xea\xf9\xf2\xb0\xf9\x62\x45\x4e\x74\x0f\xf5\xd9\x19\xaf\x2e\x45\xc9\x99\xc8\x3e\x5b\xdb\xc6\x83\x40\xff\xf9\xf5\xf8\xbf\x89\xaf\x90\xde\xbd\xbb\xa5\xf4\x46\xfb\x5b\x42\xd2\x99\x6f\x93\xb1\x97\xa6\x17\x6f\x54\x91\xa8\x78\x2a\x8b\x01\x5e\x76\xad\xad\x5d\x91\x40\x7a\xf0\xec\xe1\xdb\x08\x09\xae\x81\xf1\xfa\xd1\xa3\x44\x5d\x28\x3e\xb5\xa3\x30\xcd\xbc\xac\x6d\x6b\xee\x5e\x35\x2d\x88\xfa\x4c\x00\x7d\x36\xaa\xb2\x5d\xeb\xfc\xae\x86\x67\xde\xe1\xe1\x65\x8d\x38\xb7\xbc\xa5\x50\x56\x2e\x98\xa2\x0b\x46\x70\xc9\xbe\x7d\x8c\x1f\x48\x4e\x6f\x6f\x1f\x6f\x4e\xaf\x2f\xa3\x64\xf4\x5e\xd1\x9f\x39\xd9\x41\x3a\x7e\x17\x19\x51\xbc\x9d\xd7\x06\xab\x30\x50\x3e\x22\x06\x25\xae\x51\x55\x18\x5b\xec\xe3\x57\x2e\xdc\x64\xee\xde\x02\x87\xd5\x1b\x5c\x92\x97\x86\xc9\x52\xdb\x87\x4a\xff\xb6\x9f\xdd\x17\x73\x6c\xd8\xe7\xbb\xab\x74\x63\x75\x8d\xf7\x7e\xc7\x55\x5f\x3d\xbc\x98\xee\xa9\xd1\xcd\x82\x1e\x77\xa9\xf0\x39\xfc\x5f\x00\x00\x00\xff\xff\x06\xb9\x8e\xbf\xc7\x1a\x00\x00") func _hardcodedTracingGoBytes() ([]byte, error) { return bindataRead( @@ -126,7 +126,7 @@ func _hardcodedTracingGo() (*asset, error) { } info := bindataFileInfo{name: "../_hardcoded/tracing.go", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa8, 0x53, 0xbf, 0x58, 0x30, 0xe1, 0x1b, 0xc2, 0x72, 0x3a, 0xf9, 0x45, 0x2e, 0x4, 0x9, 0x9d, 0xc, 0xf9, 0x8c, 0xa8, 0x69, 0x8b, 0x64, 0x88, 0x7c, 0xb, 0xf4, 0x31, 0x4d, 0xb0, 0x65, 0x31}} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x84, 0xe2, 0xb0, 0x9f, 0x2e, 0x93, 0xd7, 0xed, 0x9a, 0x48, 0x80, 0xf9, 0xae, 0x9, 0x3f, 0x5d, 0xdc, 0x51, 0x3d, 0x78, 0xdb, 0x34, 0x45, 0x65, 0xac, 0x28, 0x3e, 0xcd, 0xf9, 0x60, 0xc8, 0xc}} return a, nil } diff --git a/samples/gen-go-basic/servertracing/tracing.go b/samples/gen-go-basic/servertracing/tracing.go index 55f4d814..2ffffdd5 100644 --- a/samples/gen-go-basic/servertracing/tracing.go +++ b/samples/gen-go-basic/servertracing/tracing.go @@ -10,6 +10,8 @@ import ( "strconv" "time" + "github.com/google/uuid" + "github.com/Clever/kayvee-go/v7/logger" "go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux" @@ -121,18 +123,14 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { } ctx := r.Context() - var crid string - s := trace.SpanFromContext(ctx) - crid = s.SpanContext().TraceID().String() bags := baggage.FromContext(ctx) - // Add clever-request-id to baggage - member, err := baggage.NewMember("clever-request-id", crid) - if err != nil { - logger.FromContext(ctx).WarnD("error-creating-baggage", logger.M{"error": err.Error()}) - } else { - bags, err = bags.SetMember(member) + + if bags.Member("clever-request-id") == "" { + reqid, err := baggage.NewMember("clever-request-id", uuid.New().String()) if err != nil { + bags, err = bags.SetMember(reqid) + } else { logger.FromContext(ctx).WarnD("error-creating-baggage", logger.M{"error": err.Error()}) } } @@ -145,15 +143,16 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { // Add baggage to the context ctx = baggage.ContextWithBaggage(ctx, bags) - // Log if sampled - if s.SpanContext().IsSampled() { - logger.FromContext(ctx).AddContext("sampled", "true") - } else { - logger.FromContext(ctx).AddContext("sampled", "false") - } - // Encode the trace/span ids in the DD format if sc := s.SpanContext(); sc.HasTraceID() { + + // Log if sampled + if s.SpanContext().IsSampled() { + logger.FromContext(ctx).AddContext("sampled", "true") + } else { + logger.FromContext(ctx).AddContext("sampled", "false") + } + spanID, traceID := sc.SpanID().String(), sc.TraceID().String() // datadog converts hex strings to uint64 IDs, so log those so that correlating logs and traces works if len(traceID) == 32 && len(spanID) == 16 { // opentelemetry format: 16 byte (32-char hex), 8 byte (16-char hex) trace and span ids diff --git a/samples/gen-go-blog/servertracing/tracing.go b/samples/gen-go-blog/servertracing/tracing.go index 55f4d814..2ffffdd5 100644 --- a/samples/gen-go-blog/servertracing/tracing.go +++ b/samples/gen-go-blog/servertracing/tracing.go @@ -10,6 +10,8 @@ import ( "strconv" "time" + "github.com/google/uuid" + "github.com/Clever/kayvee-go/v7/logger" "go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux" @@ -121,18 +123,14 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { } ctx := r.Context() - var crid string - s := trace.SpanFromContext(ctx) - crid = s.SpanContext().TraceID().String() bags := baggage.FromContext(ctx) - // Add clever-request-id to baggage - member, err := baggage.NewMember("clever-request-id", crid) - if err != nil { - logger.FromContext(ctx).WarnD("error-creating-baggage", logger.M{"error": err.Error()}) - } else { - bags, err = bags.SetMember(member) + + if bags.Member("clever-request-id") == "" { + reqid, err := baggage.NewMember("clever-request-id", uuid.New().String()) if err != nil { + bags, err = bags.SetMember(reqid) + } else { logger.FromContext(ctx).WarnD("error-creating-baggage", logger.M{"error": err.Error()}) } } @@ -145,15 +143,16 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { // Add baggage to the context ctx = baggage.ContextWithBaggage(ctx, bags) - // Log if sampled - if s.SpanContext().IsSampled() { - logger.FromContext(ctx).AddContext("sampled", "true") - } else { - logger.FromContext(ctx).AddContext("sampled", "false") - } - // Encode the trace/span ids in the DD format if sc := s.SpanContext(); sc.HasTraceID() { + + // Log if sampled + if s.SpanContext().IsSampled() { + logger.FromContext(ctx).AddContext("sampled", "true") + } else { + logger.FromContext(ctx).AddContext("sampled", "false") + } + spanID, traceID := sc.SpanID().String(), sc.TraceID().String() // datadog converts hex strings to uint64 IDs, so log those so that correlating logs and traces works if len(traceID) == 32 && len(spanID) == 16 { // opentelemetry format: 16 byte (32-char hex), 8 byte (16-char hex) trace and span ids diff --git a/samples/gen-go-client-only/servertracing/tracing.go b/samples/gen-go-client-only/servertracing/tracing.go index 55f4d814..2ffffdd5 100644 --- a/samples/gen-go-client-only/servertracing/tracing.go +++ b/samples/gen-go-client-only/servertracing/tracing.go @@ -10,6 +10,8 @@ import ( "strconv" "time" + "github.com/google/uuid" + "github.com/Clever/kayvee-go/v7/logger" "go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux" @@ -121,18 +123,14 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { } ctx := r.Context() - var crid string - s := trace.SpanFromContext(ctx) - crid = s.SpanContext().TraceID().String() bags := baggage.FromContext(ctx) - // Add clever-request-id to baggage - member, err := baggage.NewMember("clever-request-id", crid) - if err != nil { - logger.FromContext(ctx).WarnD("error-creating-baggage", logger.M{"error": err.Error()}) - } else { - bags, err = bags.SetMember(member) + + if bags.Member("clever-request-id") == "" { + reqid, err := baggage.NewMember("clever-request-id", uuid.New().String()) if err != nil { + bags, err = bags.SetMember(reqid) + } else { logger.FromContext(ctx).WarnD("error-creating-baggage", logger.M{"error": err.Error()}) } } @@ -145,15 +143,16 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { // Add baggage to the context ctx = baggage.ContextWithBaggage(ctx, bags) - // Log if sampled - if s.SpanContext().IsSampled() { - logger.FromContext(ctx).AddContext("sampled", "true") - } else { - logger.FromContext(ctx).AddContext("sampled", "false") - } - // Encode the trace/span ids in the DD format if sc := s.SpanContext(); sc.HasTraceID() { + + // Log if sampled + if s.SpanContext().IsSampled() { + logger.FromContext(ctx).AddContext("sampled", "true") + } else { + logger.FromContext(ctx).AddContext("sampled", "false") + } + spanID, traceID := sc.SpanID().String(), sc.TraceID().String() // datadog converts hex strings to uint64 IDs, so log those so that correlating logs and traces works if len(traceID) == 32 && len(spanID) == 16 { // opentelemetry format: 16 byte (32-char hex), 8 byte (16-char hex) trace and span ids diff --git a/samples/gen-go-db-custom-path/servertracing/tracing.go b/samples/gen-go-db-custom-path/servertracing/tracing.go index 55f4d814..2ffffdd5 100644 --- a/samples/gen-go-db-custom-path/servertracing/tracing.go +++ b/samples/gen-go-db-custom-path/servertracing/tracing.go @@ -10,6 +10,8 @@ import ( "strconv" "time" + "github.com/google/uuid" + "github.com/Clever/kayvee-go/v7/logger" "go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux" @@ -121,18 +123,14 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { } ctx := r.Context() - var crid string - s := trace.SpanFromContext(ctx) - crid = s.SpanContext().TraceID().String() bags := baggage.FromContext(ctx) - // Add clever-request-id to baggage - member, err := baggage.NewMember("clever-request-id", crid) - if err != nil { - logger.FromContext(ctx).WarnD("error-creating-baggage", logger.M{"error": err.Error()}) - } else { - bags, err = bags.SetMember(member) + + if bags.Member("clever-request-id") == "" { + reqid, err := baggage.NewMember("clever-request-id", uuid.New().String()) if err != nil { + bags, err = bags.SetMember(reqid) + } else { logger.FromContext(ctx).WarnD("error-creating-baggage", logger.M{"error": err.Error()}) } } @@ -145,15 +143,16 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { // Add baggage to the context ctx = baggage.ContextWithBaggage(ctx, bags) - // Log if sampled - if s.SpanContext().IsSampled() { - logger.FromContext(ctx).AddContext("sampled", "true") - } else { - logger.FromContext(ctx).AddContext("sampled", "false") - } - // Encode the trace/span ids in the DD format if sc := s.SpanContext(); sc.HasTraceID() { + + // Log if sampled + if s.SpanContext().IsSampled() { + logger.FromContext(ctx).AddContext("sampled", "true") + } else { + logger.FromContext(ctx).AddContext("sampled", "false") + } + spanID, traceID := sc.SpanID().String(), sc.TraceID().String() // datadog converts hex strings to uint64 IDs, so log those so that correlating logs and traces works if len(traceID) == 32 && len(spanID) == 16 { // opentelemetry format: 16 byte (32-char hex), 8 byte (16-char hex) trace and span ids diff --git a/samples/gen-go-db/servertracing/tracing.go b/samples/gen-go-db/servertracing/tracing.go index 55f4d814..2ffffdd5 100644 --- a/samples/gen-go-db/servertracing/tracing.go +++ b/samples/gen-go-db/servertracing/tracing.go @@ -10,6 +10,8 @@ import ( "strconv" "time" + "github.com/google/uuid" + "github.com/Clever/kayvee-go/v7/logger" "go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux" @@ -121,18 +123,14 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { } ctx := r.Context() - var crid string - s := trace.SpanFromContext(ctx) - crid = s.SpanContext().TraceID().String() bags := baggage.FromContext(ctx) - // Add clever-request-id to baggage - member, err := baggage.NewMember("clever-request-id", crid) - if err != nil { - logger.FromContext(ctx).WarnD("error-creating-baggage", logger.M{"error": err.Error()}) - } else { - bags, err = bags.SetMember(member) + + if bags.Member("clever-request-id") == "" { + reqid, err := baggage.NewMember("clever-request-id", uuid.New().String()) if err != nil { + bags, err = bags.SetMember(reqid) + } else { logger.FromContext(ctx).WarnD("error-creating-baggage", logger.M{"error": err.Error()}) } } @@ -145,15 +143,16 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { // Add baggage to the context ctx = baggage.ContextWithBaggage(ctx, bags) - // Log if sampled - if s.SpanContext().IsSampled() { - logger.FromContext(ctx).AddContext("sampled", "true") - } else { - logger.FromContext(ctx).AddContext("sampled", "false") - } - // Encode the trace/span ids in the DD format if sc := s.SpanContext(); sc.HasTraceID() { + + // Log if sampled + if s.SpanContext().IsSampled() { + logger.FromContext(ctx).AddContext("sampled", "true") + } else { + logger.FromContext(ctx).AddContext("sampled", "false") + } + spanID, traceID := sc.SpanID().String(), sc.TraceID().String() // datadog converts hex strings to uint64 IDs, so log those so that correlating logs and traces works if len(traceID) == 32 && len(spanID) == 16 { // opentelemetry format: 16 byte (32-char hex), 8 byte (16-char hex) trace and span ids diff --git a/samples/gen-go-deprecated/servertracing/tracing.go b/samples/gen-go-deprecated/servertracing/tracing.go index 55f4d814..2ffffdd5 100644 --- a/samples/gen-go-deprecated/servertracing/tracing.go +++ b/samples/gen-go-deprecated/servertracing/tracing.go @@ -10,6 +10,8 @@ import ( "strconv" "time" + "github.com/google/uuid" + "github.com/Clever/kayvee-go/v7/logger" "go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux" @@ -121,18 +123,14 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { } ctx := r.Context() - var crid string - s := trace.SpanFromContext(ctx) - crid = s.SpanContext().TraceID().String() bags := baggage.FromContext(ctx) - // Add clever-request-id to baggage - member, err := baggage.NewMember("clever-request-id", crid) - if err != nil { - logger.FromContext(ctx).WarnD("error-creating-baggage", logger.M{"error": err.Error()}) - } else { - bags, err = bags.SetMember(member) + + if bags.Member("clever-request-id") == "" { + reqid, err := baggage.NewMember("clever-request-id", uuid.New().String()) if err != nil { + bags, err = bags.SetMember(reqid) + } else { logger.FromContext(ctx).WarnD("error-creating-baggage", logger.M{"error": err.Error()}) } } @@ -145,15 +143,16 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { // Add baggage to the context ctx = baggage.ContextWithBaggage(ctx, bags) - // Log if sampled - if s.SpanContext().IsSampled() { - logger.FromContext(ctx).AddContext("sampled", "true") - } else { - logger.FromContext(ctx).AddContext("sampled", "false") - } - // Encode the trace/span ids in the DD format if sc := s.SpanContext(); sc.HasTraceID() { + + // Log if sampled + if s.SpanContext().IsSampled() { + logger.FromContext(ctx).AddContext("sampled", "true") + } else { + logger.FromContext(ctx).AddContext("sampled", "false") + } + spanID, traceID := sc.SpanID().String(), sc.TraceID().String() // datadog converts hex strings to uint64 IDs, so log those so that correlating logs and traces works if len(traceID) == 32 && len(spanID) == 16 { // opentelemetry format: 16 byte (32-char hex), 8 byte (16-char hex) trace and span ids diff --git a/samples/gen-go-errors/servertracing/tracing.go b/samples/gen-go-errors/servertracing/tracing.go index 55f4d814..2ffffdd5 100644 --- a/samples/gen-go-errors/servertracing/tracing.go +++ b/samples/gen-go-errors/servertracing/tracing.go @@ -10,6 +10,8 @@ import ( "strconv" "time" + "github.com/google/uuid" + "github.com/Clever/kayvee-go/v7/logger" "go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux" @@ -121,18 +123,14 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { } ctx := r.Context() - var crid string - s := trace.SpanFromContext(ctx) - crid = s.SpanContext().TraceID().String() bags := baggage.FromContext(ctx) - // Add clever-request-id to baggage - member, err := baggage.NewMember("clever-request-id", crid) - if err != nil { - logger.FromContext(ctx).WarnD("error-creating-baggage", logger.M{"error": err.Error()}) - } else { - bags, err = bags.SetMember(member) + + if bags.Member("clever-request-id") == "" { + reqid, err := baggage.NewMember("clever-request-id", uuid.New().String()) if err != nil { + bags, err = bags.SetMember(reqid) + } else { logger.FromContext(ctx).WarnD("error-creating-baggage", logger.M{"error": err.Error()}) } } @@ -145,15 +143,16 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { // Add baggage to the context ctx = baggage.ContextWithBaggage(ctx, bags) - // Log if sampled - if s.SpanContext().IsSampled() { - logger.FromContext(ctx).AddContext("sampled", "true") - } else { - logger.FromContext(ctx).AddContext("sampled", "false") - } - // Encode the trace/span ids in the DD format if sc := s.SpanContext(); sc.HasTraceID() { + + // Log if sampled + if s.SpanContext().IsSampled() { + logger.FromContext(ctx).AddContext("sampled", "true") + } else { + logger.FromContext(ctx).AddContext("sampled", "false") + } + spanID, traceID := sc.SpanID().String(), sc.TraceID().String() // datadog converts hex strings to uint64 IDs, so log those so that correlating logs and traces works if len(traceID) == 32 && len(spanID) == 16 { // opentelemetry format: 16 byte (32-char hex), 8 byte (16-char hex) trace and span ids diff --git a/samples/gen-go-nils/servertracing/tracing.go b/samples/gen-go-nils/servertracing/tracing.go index 55f4d814..2ffffdd5 100644 --- a/samples/gen-go-nils/servertracing/tracing.go +++ b/samples/gen-go-nils/servertracing/tracing.go @@ -10,6 +10,8 @@ import ( "strconv" "time" + "github.com/google/uuid" + "github.com/Clever/kayvee-go/v7/logger" "go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux" @@ -121,18 +123,14 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { } ctx := r.Context() - var crid string - s := trace.SpanFromContext(ctx) - crid = s.SpanContext().TraceID().String() bags := baggage.FromContext(ctx) - // Add clever-request-id to baggage - member, err := baggage.NewMember("clever-request-id", crid) - if err != nil { - logger.FromContext(ctx).WarnD("error-creating-baggage", logger.M{"error": err.Error()}) - } else { - bags, err = bags.SetMember(member) + + if bags.Member("clever-request-id") == "" { + reqid, err := baggage.NewMember("clever-request-id", uuid.New().String()) if err != nil { + bags, err = bags.SetMember(reqid) + } else { logger.FromContext(ctx).WarnD("error-creating-baggage", logger.M{"error": err.Error()}) } } @@ -145,15 +143,16 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { // Add baggage to the context ctx = baggage.ContextWithBaggage(ctx, bags) - // Log if sampled - if s.SpanContext().IsSampled() { - logger.FromContext(ctx).AddContext("sampled", "true") - } else { - logger.FromContext(ctx).AddContext("sampled", "false") - } - // Encode the trace/span ids in the DD format if sc := s.SpanContext(); sc.HasTraceID() { + + // Log if sampled + if s.SpanContext().IsSampled() { + logger.FromContext(ctx).AddContext("sampled", "true") + } else { + logger.FromContext(ctx).AddContext("sampled", "false") + } + spanID, traceID := sc.SpanID().String(), sc.TraceID().String() // datadog converts hex strings to uint64 IDs, so log those so that correlating logs and traces works if len(traceID) == 32 && len(spanID) == 16 { // opentelemetry format: 16 byte (32-char hex), 8 byte (16-char hex) trace and span ids diff --git a/samples/gen-go-strings/servertracing/tracing.go b/samples/gen-go-strings/servertracing/tracing.go index 55f4d814..2ffffdd5 100644 --- a/samples/gen-go-strings/servertracing/tracing.go +++ b/samples/gen-go-strings/servertracing/tracing.go @@ -10,6 +10,8 @@ import ( "strconv" "time" + "github.com/google/uuid" + "github.com/Clever/kayvee-go/v7/logger" "go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux" @@ -121,18 +123,14 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { } ctx := r.Context() - var crid string - s := trace.SpanFromContext(ctx) - crid = s.SpanContext().TraceID().String() bags := baggage.FromContext(ctx) - // Add clever-request-id to baggage - member, err := baggage.NewMember("clever-request-id", crid) - if err != nil { - logger.FromContext(ctx).WarnD("error-creating-baggage", logger.M{"error": err.Error()}) - } else { - bags, err = bags.SetMember(member) + + if bags.Member("clever-request-id") == "" { + reqid, err := baggage.NewMember("clever-request-id", uuid.New().String()) if err != nil { + bags, err = bags.SetMember(reqid) + } else { logger.FromContext(ctx).WarnD("error-creating-baggage", logger.M{"error": err.Error()}) } } @@ -145,15 +143,16 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { // Add baggage to the context ctx = baggage.ContextWithBaggage(ctx, bags) - // Log if sampled - if s.SpanContext().IsSampled() { - logger.FromContext(ctx).AddContext("sampled", "true") - } else { - logger.FromContext(ctx).AddContext("sampled", "false") - } - // Encode the trace/span ids in the DD format if sc := s.SpanContext(); sc.HasTraceID() { + + // Log if sampled + if s.SpanContext().IsSampled() { + logger.FromContext(ctx).AddContext("sampled", "true") + } else { + logger.FromContext(ctx).AddContext("sampled", "false") + } + spanID, traceID := sc.SpanID().String(), sc.TraceID().String() // datadog converts hex strings to uint64 IDs, so log those so that correlating logs and traces works if len(traceID) == 32 && len(spanID) == 16 { // opentelemetry format: 16 byte (32-char hex), 8 byte (16-char hex) trace and span ids diff --git a/samples/gen-js-blog/README.md b/samples/gen-js-blog/README.md index eecad3bd..c8e27869 100644 --- a/samples/gen-js-blog/README.md +++ b/samples/gen-js-blog/README.md @@ -74,7 +74,7 @@ Posts the grade file for the specified student | [params.file] | | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_blog--Blog.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | @@ -94,7 +94,7 @@ Gets the sections for the specified student | studentID | string | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_blog--Blog.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | @@ -117,7 +117,7 @@ Posts the sections for the specified student | params.userType | string | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_blog--Blog.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | diff --git a/samples/gen-js-blog/index.d.ts b/samples/gen-js-blog/index.d.ts index e935df75..67242bfd 100644 --- a/samples/gen-js-blog/index.d.ts +++ b/samples/gen-js-blog/index.d.ts @@ -10,7 +10,7 @@ interface RetryPolicy { interface RequestOptions { timeout?: number; - baggage?: object; + baggage?: Map; retryPolicy?: RetryPolicy; } @@ -31,7 +31,7 @@ interface CircuitOptions { interface GenericOptions { timeout?: number; - baggage?: object; + baggage?: Map; keepalive?: boolean; retryPolicy?: RetryPolicy; logger?: Logger; diff --git a/samples/gen-js-blog/index.js b/samples/gen-js-blog/index.js index ce53309c..b42e724e 100644 --- a/samples/gen-js-blog/index.js +++ b/samples/gen-js-blog/index.js @@ -8,21 +8,21 @@ const RollingNumberEvent = require("hystrixjs/lib/metrics/RollingNumberEvent"); const { Errors } = require("./types"); function parseForBaggage(entries) { + if (!entries) { + return ""; + } // Regular expression for valid characters in keys and values const validChars = /^[a-zA-Z0-9!#$%&'*+`\-.^_`|~]+$/; - // Transform the entries object into an array of strings - const baggageItems = Object.entries(entries).map(([key, value]) => { - // Remove invalid characters from key and value + + const pairs = []; + + entries.forEach((value, key) => { const validKey = key.match(validChars) ? key : encodeURIComponent(key); const validValue = value.match(validChars) ? value : encodeURIComponent(value); - - return `${validKey}=${validValue}`; + pairs.push(`${validKey}=${validValue}`); }); - // Combine the array of strings into the final baggageString - const baggageString = baggageItems.join(','); - - return baggageString; + return pairs.join(","); } /** @@ -280,7 +280,7 @@ class Blog { * @param [params.file] * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:blog.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -307,30 +307,14 @@ class Blog { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "postGradeFileForStudent"; headers[versionHeader] = version; @@ -411,7 +395,7 @@ class Blog { * @param {string} studentID * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:blog.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -441,30 +425,14 @@ class Blog { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "getSectionsForStudent"; headers[versionHeader] = version; @@ -546,7 +514,7 @@ class Blog { * @param {string} params.userType * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:blog.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -573,30 +541,14 @@ class Blog { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "postSectionsForStudent"; headers[versionHeader] = version; diff --git a/samples/gen-js-client-only/README.md b/samples/gen-js-client-only/README.md index 72478255..e773fd55 100644 --- a/samples/gen-js-client-only/README.md +++ b/samples/gen-js-client-only/README.md @@ -85,7 +85,7 @@ Gets authors | [params.startingAfter] | string | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | @@ -104,7 +104,7 @@ Gets authors | [params.startingAfter] | string | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | @@ -126,7 +126,7 @@ Gets authors, but needs to use the body so it's a PUT | [params.favoriteBooks] | | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | @@ -146,7 +146,7 @@ Gets authors, but needs to use the body so it's a PUT | [params.favoriteBooks] | | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | @@ -176,7 +176,7 @@ Returns a list of books | [params.startingAfter] | number | | | | [options] | object | | | | [options.timeout] | number | | A request specific timeout | -| [options.baggage] | object | | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | | A request specific retryPolicy | | [cb] | function | | | @@ -204,7 +204,7 @@ Returns a list of books | [params.startingAfter] | number | | | | [options] | object | | | | [options.timeout] | number | | A request specific timeout | -| [options.baggage] | object | | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | | A request specific retryPolicy | @@ -223,7 +223,7 @@ Creates a book | newBook | | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | @@ -243,7 +243,7 @@ Puts a book | newBook | | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | @@ -270,7 +270,7 @@ Returns a book | [params.randomBytes] | string | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | @@ -291,7 +291,7 @@ Retrieve a book | id | string | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | @@ -308,7 +308,7 @@ Retrieve a book | --- | --- | --- | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | @@ -330,7 +330,7 @@ testing that we can use a lowercase name for a model | params.pathParam | string | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | diff --git a/samples/gen-js-client-only/index.d.ts b/samples/gen-js-client-only/index.d.ts index efae73fb..146ceb16 100644 --- a/samples/gen-js-client-only/index.d.ts +++ b/samples/gen-js-client-only/index.d.ts @@ -10,7 +10,7 @@ interface RetryPolicy { interface RequestOptions { timeout?: number; - baggage?: object; + baggage?: Map; retryPolicy?: RetryPolicy; } @@ -31,7 +31,7 @@ interface CircuitOptions { interface GenericOptions { timeout?: number; - baggage?: object; + baggage?: Map; keepalive?: boolean; retryPolicy?: RetryPolicy; logger?: Logger; diff --git a/samples/gen-js-client-only/index.js b/samples/gen-js-client-only/index.js index 60555d67..efc89286 100644 --- a/samples/gen-js-client-only/index.js +++ b/samples/gen-js-client-only/index.js @@ -8,21 +8,21 @@ const RollingNumberEvent = require("hystrixjs/lib/metrics/RollingNumberEvent"); const { Errors } = require("./types"); function parseForBaggage(entries) { + if (!entries) { + return ""; + } // Regular expression for valid characters in keys and values const validChars = /^[a-zA-Z0-9!#$%&'*+`\-.^_`|~]+$/; - // Transform the entries object into an array of strings - const baggageItems = Object.entries(entries).map(([key, value]) => { - // Remove invalid characters from key and value + + const pairs = []; + + entries.forEach((value, key) => { const validKey = key.match(validChars) ? key : encodeURIComponent(key); const validValue = value.match(validChars) ? value : encodeURIComponent(value); - - return `${validKey}=${validValue}`; + pairs.push(`${validKey}=${validValue}`); }); - // Combine the array of strings into the final baggageString - const baggageString = baggageItems.join(','); - - return baggageString; + return pairs.join(","); } /** @@ -280,7 +280,7 @@ class SwaggerTest { * @param {string} [params.startingAfter] * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -307,30 +307,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "getAuthors"; headers[versionHeader] = version; @@ -416,7 +400,7 @@ class SwaggerTest { * @param {string} [params.startingAfter] * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @returns {Object} iter * @returns {function} iter.map - takes in a function, applies it to each resource, and returns a promise to the result as an array @@ -430,30 +414,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "getAuthors"; headers[versionHeader] = version; @@ -586,7 +554,7 @@ class SwaggerTest { * @param [params.favoriteBooks] * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -613,30 +581,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "getAuthorsWithPut"; headers[versionHeader] = version; @@ -725,7 +677,7 @@ class SwaggerTest { * @param [params.favoriteBooks] * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @returns {Object} iter * @returns {function} iter.map - takes in a function, applies it to each resource, and returns a promise to the result as an array @@ -739,30 +691,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "getAuthorsWithPut"; headers[versionHeader] = version; @@ -905,7 +841,7 @@ class SwaggerTest { * @param {number} [params.startingAfter] * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -932,30 +868,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "getBooks"; headers[versionHeader] = version; @@ -1083,7 +1003,7 @@ class SwaggerTest { * @param {number} [params.startingAfter] * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @returns {Object} iter * @returns {function} iter.map - takes in a function, applies it to each resource, and returns a promise to the result as an array @@ -1097,30 +1017,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "getBooks"; headers[versionHeader] = version; @@ -1283,7 +1187,7 @@ class SwaggerTest { * @param newBook * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -1313,30 +1217,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "createBook"; headers[versionHeader] = version; @@ -1413,7 +1301,7 @@ class SwaggerTest { * @param newBook * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -1443,30 +1331,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "putBook"; headers[versionHeader] = version; @@ -1548,7 +1420,7 @@ class SwaggerTest { * @param {string} [params.randomBytes] * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -1577,30 +1449,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "getBookByID"; headers[versionHeader] = version; @@ -1701,7 +1557,7 @@ class SwaggerTest { * @param {string} id * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -1732,30 +1588,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "getBookByID2"; headers[versionHeader] = version; @@ -1838,7 +1678,7 @@ class SwaggerTest { /** * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -1867,30 +1707,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "healthCheck"; headers[versionHeader] = version; @@ -1967,7 +1791,7 @@ class SwaggerTest { * @param {string} params.pathParam * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -1994,30 +1818,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "lowercaseModelsTest"; headers[versionHeader] = version; diff --git a/samples/gen-js-db-custom-path/README.md b/samples/gen-js-db-custom-path/README.md index dcef6dca..f627237e 100644 --- a/samples/gen-js-db-custom-path/README.md +++ b/samples/gen-js-db-custom-path/README.md @@ -67,7 +67,7 @@ Releases handles used in client | --- | --- | --- | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | diff --git a/samples/gen-js-db-custom-path/index.d.ts b/samples/gen-js-db-custom-path/index.d.ts index 95cfd688..0c503da0 100644 --- a/samples/gen-js-db-custom-path/index.d.ts +++ b/samples/gen-js-db-custom-path/index.d.ts @@ -10,7 +10,7 @@ interface RetryPolicy { interface RequestOptions { timeout?: number; - baggage?: object; + baggage?: Map; retryPolicy?: RetryPolicy; } @@ -31,7 +31,7 @@ interface CircuitOptions { interface GenericOptions { timeout?: number; - baggage?: object; + baggage?: Map; keepalive?: boolean; retryPolicy?: RetryPolicy; logger?: Logger; diff --git a/samples/gen-js-db-custom-path/index.js b/samples/gen-js-db-custom-path/index.js index c6624ec8..4f452394 100644 --- a/samples/gen-js-db-custom-path/index.js +++ b/samples/gen-js-db-custom-path/index.js @@ -8,21 +8,21 @@ const RollingNumberEvent = require("hystrixjs/lib/metrics/RollingNumberEvent"); const { Errors } = require("./types"); function parseForBaggage(entries) { + if (!entries) { + return ""; + } // Regular expression for valid characters in keys and values const validChars = /^[a-zA-Z0-9!#$%&'*+`\-.^_`|~]+$/; - // Transform the entries object into an array of strings - const baggageItems = Object.entries(entries).map(([key, value]) => { - // Remove invalid characters from key and value + + const pairs = []; + + entries.forEach((value, key) => { const validKey = key.match(validChars) ? key : encodeURIComponent(key); const validValue = value.match(validChars) ? value : encodeURIComponent(value); - - return `${validKey}=${validValue}`; + pairs.push(`${validKey}=${validValue}`); }); - // Combine the array of strings into the final baggageString - const baggageString = baggageItems.join(','); - - return baggageString; + return pairs.join(","); } /** @@ -276,7 +276,7 @@ class SwaggerTest { /** * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -305,30 +305,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "healthCheck"; headers[versionHeader] = version; diff --git a/samples/gen-js-db/README.md b/samples/gen-js-db/README.md index dcef6dca..f627237e 100644 --- a/samples/gen-js-db/README.md +++ b/samples/gen-js-db/README.md @@ -67,7 +67,7 @@ Releases handles used in client | --- | --- | --- | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | diff --git a/samples/gen-js-db/index.d.ts b/samples/gen-js-db/index.d.ts index 95cfd688..0c503da0 100644 --- a/samples/gen-js-db/index.d.ts +++ b/samples/gen-js-db/index.d.ts @@ -10,7 +10,7 @@ interface RetryPolicy { interface RequestOptions { timeout?: number; - baggage?: object; + baggage?: Map; retryPolicy?: RetryPolicy; } @@ -31,7 +31,7 @@ interface CircuitOptions { interface GenericOptions { timeout?: number; - baggage?: object; + baggage?: Map; keepalive?: boolean; retryPolicy?: RetryPolicy; logger?: Logger; diff --git a/samples/gen-js-db/index.js b/samples/gen-js-db/index.js index c6624ec8..4f452394 100644 --- a/samples/gen-js-db/index.js +++ b/samples/gen-js-db/index.js @@ -8,21 +8,21 @@ const RollingNumberEvent = require("hystrixjs/lib/metrics/RollingNumberEvent"); const { Errors } = require("./types"); function parseForBaggage(entries) { + if (!entries) { + return ""; + } // Regular expression for valid characters in keys and values const validChars = /^[a-zA-Z0-9!#$%&'*+`\-.^_`|~]+$/; - // Transform the entries object into an array of strings - const baggageItems = Object.entries(entries).map(([key, value]) => { - // Remove invalid characters from key and value + + const pairs = []; + + entries.forEach((value, key) => { const validKey = key.match(validChars) ? key : encodeURIComponent(key); const validValue = value.match(validChars) ? value : encodeURIComponent(value); - - return `${validKey}=${validValue}`; + pairs.push(`${validKey}=${validValue}`); }); - // Combine the array of strings into the final baggageString - const baggageString = baggageItems.join(','); - - return baggageString; + return pairs.join(","); } /** @@ -276,7 +276,7 @@ class SwaggerTest { /** * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -305,30 +305,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "healthCheck"; headers[versionHeader] = version; diff --git a/samples/gen-js-deprecated/index.d.ts b/samples/gen-js-deprecated/index.d.ts index 1d4f11f7..66c5367f 100644 --- a/samples/gen-js-deprecated/index.d.ts +++ b/samples/gen-js-deprecated/index.d.ts @@ -10,7 +10,7 @@ interface RetryPolicy { interface RequestOptions { timeout?: number; - baggage?: object; + baggage?: Map; retryPolicy?: RetryPolicy; } @@ -31,7 +31,7 @@ interface CircuitOptions { interface GenericOptions { timeout?: number; - baggage?: object; + baggage?: Map; keepalive?: boolean; retryPolicy?: RetryPolicy; logger?: Logger; diff --git a/samples/gen-js-deprecated/index.js b/samples/gen-js-deprecated/index.js index 82ddc4fc..f5f38eb4 100644 --- a/samples/gen-js-deprecated/index.js +++ b/samples/gen-js-deprecated/index.js @@ -8,21 +8,21 @@ const RollingNumberEvent = require("hystrixjs/lib/metrics/RollingNumberEvent"); const { Errors } = require("./types"); function parseForBaggage(entries) { + if (!entries) { + return ""; + } // Regular expression for valid characters in keys and values const validChars = /^[a-zA-Z0-9!#$%&'*+`\-.^_`|~]+$/; - // Transform the entries object into an array of strings - const baggageItems = Object.entries(entries).map(([key, value]) => { - // Remove invalid characters from key and value + + const pairs = []; + + entries.forEach((value, key) => { const validKey = key.match(validChars) ? key : encodeURIComponent(key); const validValue = value.match(validChars) ? value : encodeURIComponent(value); - - return `${validKey}=${validValue}`; + pairs.push(`${validKey}=${validValue}`); }); - // Combine the array of strings into the final baggageString - const baggageString = baggageItems.join(','); - - return baggageString; + return pairs.join(","); } /** diff --git a/samples/gen-js-errors/README.md b/samples/gen-js-errors/README.md index 3386f6f5..f16f96fe 100644 --- a/samples/gen-js-errors/README.md +++ b/samples/gen-js-errors/README.md @@ -70,7 +70,7 @@ Releases handles used in client | id | number | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | diff --git a/samples/gen-js-errors/index.d.ts b/samples/gen-js-errors/index.d.ts index 5461b5ff..d2696ff8 100644 --- a/samples/gen-js-errors/index.d.ts +++ b/samples/gen-js-errors/index.d.ts @@ -10,7 +10,7 @@ interface RetryPolicy { interface RequestOptions { timeout?: number; - baggage?: object; + baggage?: Map; retryPolicy?: RetryPolicy; } @@ -31,7 +31,7 @@ interface CircuitOptions { interface GenericOptions { timeout?: number; - baggage?: object; + baggage?: Map; keepalive?: boolean; retryPolicy?: RetryPolicy; logger?: Logger; diff --git a/samples/gen-js-errors/index.js b/samples/gen-js-errors/index.js index 04a608fe..f9950249 100644 --- a/samples/gen-js-errors/index.js +++ b/samples/gen-js-errors/index.js @@ -8,21 +8,21 @@ const RollingNumberEvent = require("hystrixjs/lib/metrics/RollingNumberEvent"); const { Errors } = require("./types"); function parseForBaggage(entries) { + if (!entries) { + return ""; + } // Regular expression for valid characters in keys and values const validChars = /^[a-zA-Z0-9!#$%&'*+`\-.^_`|~]+$/; - // Transform the entries object into an array of strings - const baggageItems = Object.entries(entries).map(([key, value]) => { - // Remove invalid characters from key and value + + const pairs = []; + + entries.forEach((value, key) => { const validKey = key.match(validChars) ? key : encodeURIComponent(key); const validValue = value.match(validChars) ? value : encodeURIComponent(value); - - return `${validKey}=${validValue}`; + pairs.push(`${validKey}=${validValue}`); }); - // Combine the array of strings into the final baggageString - const baggageString = baggageItems.join(','); - - return baggageString; + return pairs.join(","); } /** @@ -277,7 +277,7 @@ class SwaggerTest { * @param {number} id * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -308,30 +308,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "getBook"; headers[versionHeader] = version; diff --git a/samples/gen-js-nils/README.md b/samples/gen-js-nils/README.md index b815b929..18e720f1 100644 --- a/samples/gen-js-nils/README.md +++ b/samples/gen-js-nils/README.md @@ -75,7 +75,7 @@ Nil check tests | [params.body] | | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_nil-test--NilTest.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | diff --git a/samples/gen-js-nils/index.d.ts b/samples/gen-js-nils/index.d.ts index d9c3893b..9bc84906 100644 --- a/samples/gen-js-nils/index.d.ts +++ b/samples/gen-js-nils/index.d.ts @@ -10,7 +10,7 @@ interface RetryPolicy { interface RequestOptions { timeout?: number; - baggage?: object; + baggage?: Map; retryPolicy?: RetryPolicy; } @@ -31,7 +31,7 @@ interface CircuitOptions { interface GenericOptions { timeout?: number; - baggage?: object; + baggage?: Map; keepalive?: boolean; retryPolicy?: RetryPolicy; logger?: Logger; diff --git a/samples/gen-js-nils/index.js b/samples/gen-js-nils/index.js index 54814537..f2158125 100644 --- a/samples/gen-js-nils/index.js +++ b/samples/gen-js-nils/index.js @@ -8,21 +8,21 @@ const RollingNumberEvent = require("hystrixjs/lib/metrics/RollingNumberEvent"); const { Errors } = require("./types"); function parseForBaggage(entries) { + if (!entries) { + return ""; + } // Regular expression for valid characters in keys and values const validChars = /^[a-zA-Z0-9!#$%&'*+`\-.^_`|~]+$/; - // Transform the entries object into an array of strings - const baggageItems = Object.entries(entries).map(([key, value]) => { - // Remove invalid characters from key and value + + const pairs = []; + + entries.forEach((value, key) => { const validKey = key.match(validChars) ? key : encodeURIComponent(key); const validValue = value.match(validChars) ? value : encodeURIComponent(value); - - return `${validKey}=${validValue}`; + pairs.push(`${validKey}=${validValue}`); }); - // Combine the array of strings into the final baggageString - const baggageString = baggageItems.join(','); - - return baggageString; + return pairs.join(","); } /** @@ -283,7 +283,7 @@ class NilTest { * @param [params.body] * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:nil-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -310,30 +310,14 @@ class NilTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "nilCheck"; headers[versionHeader] = version; diff --git a/samples/gen-js-strings/README.md b/samples/gen-js-strings/README.md index 4582279f..54f9485b 100644 --- a/samples/gen-js-strings/README.md +++ b/samples/gen-js-strings/README.md @@ -72,7 +72,7 @@ Releases handles used in client | [params.pageSize] | number | 1000 | | | [options] | object | | | | [options.timeout] | number | | A request specific timeout | -| [options.baggage] | object | | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_nil-test--NilTest.RetryPolicies) | | A request specific retryPolicy | | [cb] | function | | | diff --git a/samples/gen-js-strings/index.d.ts b/samples/gen-js-strings/index.d.ts index 1737494e..0f65ee76 100644 --- a/samples/gen-js-strings/index.d.ts +++ b/samples/gen-js-strings/index.d.ts @@ -10,7 +10,7 @@ interface RetryPolicy { interface RequestOptions { timeout?: number; - baggage?: object; + baggage?: Map; retryPolicy?: RetryPolicy; } @@ -31,7 +31,7 @@ interface CircuitOptions { interface GenericOptions { timeout?: number; - baggage?: object; + baggage?: Map; keepalive?: boolean; retryPolicy?: RetryPolicy; logger?: Logger; diff --git a/samples/gen-js-strings/index.js b/samples/gen-js-strings/index.js index a0dd58aa..fbe46bfc 100644 --- a/samples/gen-js-strings/index.js +++ b/samples/gen-js-strings/index.js @@ -8,21 +8,21 @@ const RollingNumberEvent = require("hystrixjs/lib/metrics/RollingNumberEvent"); const { Errors } = require("./types"); function parseForBaggage(entries) { + if (!entries) { + return ""; + } // Regular expression for valid characters in keys and values const validChars = /^[a-zA-Z0-9!#$%&'*+`\-.^_`|~]+$/; - // Transform the entries object into an array of strings - const baggageItems = Object.entries(entries).map(([key, value]) => { - // Remove invalid characters from key and value + + const pairs = []; + + entries.forEach((value, key) => { const validKey = key.match(validChars) ? key : encodeURIComponent(key); const validValue = value.match(validChars) ? value : encodeURIComponent(value); - - return `${validKey}=${validValue}`; + pairs.push(`${validKey}=${validValue}`); }); - // Combine the array of strings into the final baggageString - const baggageString = baggageItems.join(','); - - return baggageString; + return pairs.join(","); } /** @@ -281,7 +281,7 @@ class NilTest { * @param {number} [params.pageSize=1000] * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:nil-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -308,30 +308,14 @@ class NilTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "getDistricts"; headers[versionHeader] = version; diff --git a/samples/gen-js/README.md b/samples/gen-js/README.md index 72478255..e773fd55 100644 --- a/samples/gen-js/README.md +++ b/samples/gen-js/README.md @@ -85,7 +85,7 @@ Gets authors | [params.startingAfter] | string | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | @@ -104,7 +104,7 @@ Gets authors | [params.startingAfter] | string | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | @@ -126,7 +126,7 @@ Gets authors, but needs to use the body so it's a PUT | [params.favoriteBooks] | | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | @@ -146,7 +146,7 @@ Gets authors, but needs to use the body so it's a PUT | [params.favoriteBooks] | | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | @@ -176,7 +176,7 @@ Returns a list of books | [params.startingAfter] | number | | | | [options] | object | | | | [options.timeout] | number | | A request specific timeout | -| [options.baggage] | object | | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | | A request specific retryPolicy | | [cb] | function | | | @@ -204,7 +204,7 @@ Returns a list of books | [params.startingAfter] | number | | | | [options] | object | | | | [options.timeout] | number | | A request specific timeout | -| [options.baggage] | object | | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | | A request specific retryPolicy | @@ -223,7 +223,7 @@ Creates a book | newBook | | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | @@ -243,7 +243,7 @@ Puts a book | newBook | | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | @@ -270,7 +270,7 @@ Returns a book | [params.randomBytes] | string | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | @@ -291,7 +291,7 @@ Retrieve a book | id | string | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | @@ -308,7 +308,7 @@ Retrieve a book | --- | --- | --- | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | @@ -330,7 +330,7 @@ testing that we can use a lowercase name for a model | params.pathParam | string | | | [options] | object | | | [options.timeout] | number | A request specific timeout | -| [options.baggage] | object | A request specific baggage to be propagated | +| [options.baggage] | [ 'Map' ].<string, (string\|number)> | A request-specific baggage to be propagated | | [options.retryPolicy] | [RetryPolicies](#module_swagger-test--SwaggerTest.RetryPolicies) | A request specific retryPolicy | | [cb] | function | | diff --git a/samples/gen-js/index.d.ts b/samples/gen-js/index.d.ts index efae73fb..146ceb16 100644 --- a/samples/gen-js/index.d.ts +++ b/samples/gen-js/index.d.ts @@ -10,7 +10,7 @@ interface RetryPolicy { interface RequestOptions { timeout?: number; - baggage?: object; + baggage?: Map; retryPolicy?: RetryPolicy; } @@ -31,7 +31,7 @@ interface CircuitOptions { interface GenericOptions { timeout?: number; - baggage?: object; + baggage?: Map; keepalive?: boolean; retryPolicy?: RetryPolicy; logger?: Logger; diff --git a/samples/gen-js/index.js b/samples/gen-js/index.js index 60555d67..efc89286 100644 --- a/samples/gen-js/index.js +++ b/samples/gen-js/index.js @@ -8,21 +8,21 @@ const RollingNumberEvent = require("hystrixjs/lib/metrics/RollingNumberEvent"); const { Errors } = require("./types"); function parseForBaggage(entries) { + if (!entries) { + return ""; + } // Regular expression for valid characters in keys and values const validChars = /^[a-zA-Z0-9!#$%&'*+`\-.^_`|~]+$/; - // Transform the entries object into an array of strings - const baggageItems = Object.entries(entries).map(([key, value]) => { - // Remove invalid characters from key and value + + const pairs = []; + + entries.forEach((value, key) => { const validKey = key.match(validChars) ? key : encodeURIComponent(key); const validValue = value.match(validChars) ? value : encodeURIComponent(value); - - return `${validKey}=${validValue}`; + pairs.push(`${validKey}=${validValue}`); }); - // Combine the array of strings into the final baggageString - const baggageString = baggageItems.join(','); - - return baggageString; + return pairs.join(","); } /** @@ -280,7 +280,7 @@ class SwaggerTest { * @param {string} [params.startingAfter] * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -307,30 +307,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "getAuthors"; headers[versionHeader] = version; @@ -416,7 +400,7 @@ class SwaggerTest { * @param {string} [params.startingAfter] * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @returns {Object} iter * @returns {function} iter.map - takes in a function, applies it to each resource, and returns a promise to the result as an array @@ -430,30 +414,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "getAuthors"; headers[versionHeader] = version; @@ -586,7 +554,7 @@ class SwaggerTest { * @param [params.favoriteBooks] * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -613,30 +581,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "getAuthorsWithPut"; headers[versionHeader] = version; @@ -725,7 +677,7 @@ class SwaggerTest { * @param [params.favoriteBooks] * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @returns {Object} iter * @returns {function} iter.map - takes in a function, applies it to each resource, and returns a promise to the result as an array @@ -739,30 +691,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "getAuthorsWithPut"; headers[versionHeader] = version; @@ -905,7 +841,7 @@ class SwaggerTest { * @param {number} [params.startingAfter] * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -932,30 +868,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "getBooks"; headers[versionHeader] = version; @@ -1083,7 +1003,7 @@ class SwaggerTest { * @param {number} [params.startingAfter] * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @returns {Object} iter * @returns {function} iter.map - takes in a function, applies it to each resource, and returns a promise to the result as an array @@ -1097,30 +1017,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "getBooks"; headers[versionHeader] = version; @@ -1283,7 +1187,7 @@ class SwaggerTest { * @param newBook * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -1313,30 +1217,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "createBook"; headers[versionHeader] = version; @@ -1413,7 +1301,7 @@ class SwaggerTest { * @param newBook * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -1443,30 +1331,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "putBook"; headers[versionHeader] = version; @@ -1548,7 +1420,7 @@ class SwaggerTest { * @param {string} [params.randomBytes] * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -1577,30 +1449,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "getBookByID"; headers[versionHeader] = version; @@ -1701,7 +1557,7 @@ class SwaggerTest { * @param {string} id * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -1732,30 +1588,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "getBookByID2"; headers[versionHeader] = version; @@ -1838,7 +1678,7 @@ class SwaggerTest { /** * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -1867,30 +1707,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "healthCheck"; headers[versionHeader] = version; @@ -1967,7 +1791,7 @@ class SwaggerTest { * @param {string} params.pathParam * @param {object} [options] * @param {number} [options.timeout] - A request specific timeout - * @param {object} [options.baggage] - A request specific baggage to be propagated + * @param {Map} [options.baggage] - A request-specific baggage to be propagated * @param {module:swagger-test.RetryPolicies} [options.retryPolicy] - A request specific retryPolicy * @param {function} [cb] * @returns {Promise} @@ -1994,30 +1818,14 @@ class SwaggerTest { options = {}; } - const optionsBaggage = options.baggage || {} + const optionsBaggage = options.baggage || new Map(); const timeout = options.timeout || this.timeout; - const headers = {}; + let headers = {}; - if (headers["baggage"]) { - const existingBaggageItems = headers["baggage"].split(','); - const existingBaggage = {}; - - for (const item of existingBaggageItems) { - const [key, value] = item.split('='); - existingBaggage[key] = value; - } - - // Merge existingBaggage and optionsBaggage. Values in optionsBaggage will overwrite those in existingBaggage. - const mergedBaggage = {...existingBaggage, ...optionsBaggage}; - - // Convert mergedBaggage back into a string using parseForBaggage - headers["baggage"] = parseForBaggage(mergedBaggage); - } else { - // Convert optionsBaggage into a string using parseForBaggage - headers["baggage"] = parseForBaggage(optionsBaggage); - } + // Convert optionsBaggage into a string using parseForBaggage + headers["baggage"] = parseForBaggage(optionsBaggage); headers["Canonical-Resource"] = "lowercaseModelsTest"; headers[versionHeader] = version; diff --git a/samples/gen-js/package-lock.json b/samples/gen-js/package-lock.json deleted file mode 100644 index 2ba1c4ed..00000000 --- a/samples/gen-js/package-lock.json +++ /dev/null @@ -1,850 +0,0 @@ -{ - "name": "swagger-test", - "version": "9.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "swagger-test", - "version": "9.0.0", - "dependencies": { - "async": "^2.1.4", - "clever-discovery": "0.0.8", - "hystrixjs": "^0.2.0", - "kayvee": "^3.13.0", - "request": "^2.87.0", - "rxjs": "^5.4.1" - }, - "devDependencies": { - "typescript": "^3.3.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "dependencies": { - "safer-buffer": "~2.1.0" - } - }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", - "engines": { - "node": ">=0.8" - } - }, - "node_modules/async": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", - "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", - "dependencies": { - "lodash": "^4.17.14" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" - }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", - "engines": { - "node": "*" - } - }, - "node_modules/aws4": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.2.tgz", - "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==" - }, - "node_modules/basic-auth": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", - "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", - "dependencies": { - "safe-buffer": "5.1.2" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, - "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==" - }, - "node_modules/clever-discovery": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/clever-discovery/-/clever-discovery-0.0.8.tgz", - "integrity": "sha512-o1x6v+p9+dt5S5Y2dk7yzI72JvwG3FQ14KsIYo+K7JSVk1VmLrRx92GKv6ZbrAFteYfBABm3Uvghk+ER2Bc0ng==" - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==" - }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "dependencies": { - "assert-plus": "^1.0.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" - }, - "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "dependencies": { - "get-intrinsic": "^1.2.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "engines": [ - "node >=0.6.0" - ] - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" - }, - "node_modules/fast-stats": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/fast-stats/-/fast-stats-0.0.3.tgz", - "integrity": "sha512-GCDJBJEDccRpAuMcVe+OfMnovhXNPMTuiBl08ZysjcJdSfNNHn1exukCHGNp3q+vbKP2ZuDDhi6w03ad1vFTBw==", - "engines": { - "node": "*" - } - }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", - "engines": { - "node": "*" - } - }, - "node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", - "dependencies": { - "assert-plus": "^1.0.0" - } - }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", - "engines": { - "node": ">=4" - } - }, - "node_modules/har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "deprecated": "this library is no longer supported", - "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" - } - }, - "node_modules/hystrixjs": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/hystrixjs/-/hystrixjs-0.2.0.tgz", - "integrity": "sha512-IuyxI6MotAwZUfAdBVc7YRo79tu0RMqjdTGkw8DR7M/loWAjvQFLoqbBeUqpvOMiNesJ/E0NpsHYIDMwd396Ew==", - "dependencies": { - "fast-stats": "0.0.3" - }, - "peerDependencies": { - "rxjs": "^5.0.0" - } - }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" - }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==" - }, - "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==" - }, - "node_modules/json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" - }, - "node_modules/jsonschema": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz", - "integrity": "sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==", - "engines": { - "node": "*" - } - }, - "node_modules/jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/kayvee": { - "version": "3.18.0", - "resolved": "https://registry.npmjs.org/kayvee/-/kayvee-3.18.0.tgz", - "integrity": "sha512-2kNl4IS+hOBh7/oim34GIGbwzMFPZvUMWYiBfsNPecCFLsWhisW2RGm8hHlurujcCZ9fLRTTzpvkaL58QKDNUw==", - "dependencies": { - "js-yaml": "^3.6.1", - "jsonschema": "^1.1.0", - "morgan": "^1.7.0", - "qs": "^6.9.4", - "split": "^1.0.0", - "underscore": "^1.8.3" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/morgan": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", - "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==", - "dependencies": { - "basic-auth": "~2.0.1", - "debug": "2.6.9", - "depd": "~2.0.0", - "on-finished": "~2.3.0", - "on-headers": "~1.0.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "engines": { - "node": "*" - } - }, - "node_modules/object-inspect": { - "version": "1.13.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", - "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" - }, - "node_modules/psl": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.10.0.tgz", - "integrity": "sha512-KSKHEbjAnpUuAUserOq0FxGXCUrzC3WniuSJhvdbs102rL55266ZcHBqLWOsG30spQMlPdpy7icATiAQehg/iA==", - "dependencies": { - "punycode": "^2.3.1" - } - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/qs": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", - "dependencies": { - "side-channel": "^1.0.6" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/request/node_modules/qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/rxjs": { - "version": "5.5.12", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.12.tgz", - "integrity": "sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==", - "dependencies": { - "symbol-observable": "1.0.1" - }, - "engines": { - "npm": ">=2.0.0" - } - }, - "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", - "dependencies": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/split": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", - "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", - "dependencies": { - "through": "2" - }, - "engines": { - "node": "*" - } - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" - }, - "node_modules/sshpk": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", - "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/symbol-observable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", - "integrity": "sha512-Kb3PrPYz4HanVF1LVGuAdW6LoVgIwjUYJGzFe7NDrBLCN4lsV/5J0MFurV+ygS4bRVwrCEt2c7MQ1R2a72oJDw==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" - }, - "node_modules/tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==" - }, - "node_modules/typescript": { - "version": "3.9.10", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", - "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/underscore": { - "version": "1.13.7", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz", - "integrity": "sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==" - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "bin": { - "uuid": "bin/uuid" - } - }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - } - } -} diff --git a/samples/go.mod b/samples/go.mod index 9824a83d..763e19f5 100644 --- a/samples/go.mod +++ b/samples/go.mod @@ -26,6 +26,7 @@ require ( github.com/go-openapi/strfmt v0.21.3 github.com/go-openapi/swag v0.22.3 github.com/golang/mock v1.6.0 + github.com/google/uuid v1.1.2 github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 @@ -138,7 +139,6 @@ require ( github.com/google/martian/v3 v3.2.1 // indirect github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect github.com/google/renameio v0.1.0 // indirect - github.com/google/uuid v1.1.2 // indirect github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa // indirect github.com/googleapis/gax-go/v2 v2.4.0 // indirect github.com/googleapis/go-type-adapters v1.0.0 // indirect diff --git a/samples/test/js/operations.js b/samples/test/js/operations.js index 941bb344..9b70e845 100644 --- a/samples/test/js/operations.js +++ b/samples/test/js/operations.js @@ -26,11 +26,12 @@ describe("operations", function() { baggageHeader = this.req.headers["baggage"]; return mockResponse; }); + const baggage = new Map(); + baggage.set("ClientIP", req.ClientIP); + baggage.set("session_id", req.SessionID); + const options = { - baggage: { - ClientIP: req.ClientIP, - session_id: req.SessionID - } + baggage } c.getBookByID({bookID: params.bookID}, options, function(err, resp) { assert.ifError(err);