@platformatic/client
Advanced tools
Comparing version 1.20.0 to 1.20.1
42
index.js
@@ -140,6 +140,2 @@ 'use strict' | ||
function whereOrClauseIsComplexObject (orClause) { | ||
return (Array.isArray(orClause) && typeof orClause[0] !== 'string') | ||
} | ||
async function buildCallFunction (spec, baseUrl, path, method, methodMeta, throwOnError, openTelemetry, fullRequest, fullResponse, validateResponse, queryParser) { | ||
@@ -183,20 +179,3 @@ await $RefParser.dereference(spec) | ||
if (isArrayQueryParam(param)) { | ||
if (param.name === 'where.or' && whereOrClauseIsComplexObject(args.query[param.name])) { | ||
// parse the object from | ||
// [ | ||
// { id: { eq: 1 }, | ||
// { title: { eq: 'Matrix' }, | ||
// ] | ||
// to ['id.eq=1|title.eq=Matrix'] | ||
const stringArray = [] | ||
for (const c of args.query[param.name]) { | ||
const field = Object.keys(c)[0] | ||
const [op, value] = Object.entries(c[field])[0] | ||
stringArray.push(`${field}.${op}=${value}`) | ||
} | ||
query.append(param.name, `(${stringArray.join('|')})`) | ||
} else { | ||
args.query[param.name].forEach((p) => query.append(param.name, p)) | ||
} | ||
args.query[param.name].forEach((p) => query.append(param.name, p)) | ||
} else { | ||
@@ -221,20 +200,3 @@ query.append(param.name, args.query[param.name]) | ||
if (isArrayQueryParam(param)) { | ||
if (param.name === 'where.or' && whereOrClauseIsComplexObject(body['where.or'])) { | ||
// parse the object from | ||
// [ | ||
// { id: { eq: 1 }, | ||
// { title: { eq: 'Matrix' }, | ||
// ] | ||
// to ['id.eq=1|title.eq=Matrix'] | ||
const stringArray = [] | ||
for (const c of body[param.name]) { | ||
const field = Object.keys(c)[0] | ||
const [op, value] = Object.entries(c[field])[0] | ||
stringArray.push(`${field}.${op}=${value}`) | ||
} | ||
query.append(param.name, `(${stringArray.join('|')})`) | ||
} else { | ||
body[param.name].forEach((p) => query.append(param.name, p)) | ||
} | ||
body[param.name].forEach((p) => query.append(param.name, p)) | ||
} else { | ||
@@ -241,0 +203,0 @@ query.append(param.name, body[param.name]) |
{ | ||
"name": "@platformatic/client", | ||
"version": "1.20.0", | ||
"version": "1.20.1", | ||
"description": "A client for all platformatic backends", | ||
@@ -28,3 +28,3 @@ "main": "index.js", | ||
"typescript": "^5.3.3", | ||
"@platformatic/telemetry": "1.20.0" | ||
"@platformatic/telemetry": "1.20.1" | ||
}, | ||
@@ -31,0 +31,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
32719
557