@platformatic/client
Advanced tools
Comparing version 1.5.0 to 1.5.1
17
index.js
@@ -66,5 +66,14 @@ 'use strict' | ||
const pathMeta = spec.paths[path] | ||
let commonParameters = [] | ||
if (pathMeta.parameters) { | ||
commonParameters = pathMeta.parameters | ||
delete pathMeta.parameters | ||
} | ||
for (const method of Object.keys(pathMeta)) { | ||
const methodMeta = pathMeta[method] | ||
if (methodMeta.parameters) { | ||
methodMeta.parameters = [...methodMeta.parameters, ...commonParameters] | ||
} else { | ||
methodMeta.parameters = commonParameters | ||
} | ||
const operationId = generateOperationId(path, method, methodMeta, generatedOperationIds) | ||
@@ -82,3 +91,2 @@ const responses = pathMeta[method].responses | ||
} | ||
return client | ||
@@ -128,3 +136,3 @@ } | ||
headers = args?.headers | ||
body = args?.body | ||
body = args?.body || '' | ||
for (const param of pathParams) { | ||
@@ -149,3 +157,3 @@ if (args?.path[param.name] === undefined) { | ||
} else { | ||
body = { ...args } // shallow copy | ||
body = { ...args } || '' // shallow copy | ||
for (const param of pathParams) { | ||
@@ -390,2 +398,3 @@ if (body[param.name] === undefined) { | ||
const newClient = Object.create(client) | ||
if (getHeaders) { | ||
@@ -392,0 +401,0 @@ newClient[kGetHeaders] = getHeaders.bind(newClient, req, reply) |
{ | ||
"name": "@platformatic/client", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "A client for all platformatic backends", | ||
@@ -27,3 +27,3 @@ "main": "index.js", | ||
"typescript": "^5.2.2", | ||
"@platformatic/telemetry": "1.5.0" | ||
"@platformatic/telemetry": "1.5.1" | ||
}, | ||
@@ -30,0 +30,0 @@ "dependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30353
47996
495
264
29
49
6
156