@platformatic/client
Advanced tools
Comparing version 2.0.0-alpha.2 to 2.0.0-alpha.3
@@ -8,3 +8,3 @@ 'use strict' | ||
module.exports = { | ||
OptionsUrlRequiredError: createError(`${ERROR_PREFIX}_OPTIONS_URL_REQUIRED`, 'options.url is required') | ||
OptionsUrlRequiredError: createError(`${ERROR_PREFIX}_OPTIONS_URL_REQUIRED`, 'options.url is required'), | ||
} |
26
index.js
@@ -215,3 +215,3 @@ 'use strict' | ||
const { span, telemetryHeaders } = openTelemetry?.startSpanClient(urlToCall.toString(), method, telemetryContext) || { span: null, telemetryHeaders: {} } | ||
const { span, telemetryHeaders } = openTelemetry?.startHTTPSpanClient(urlToCall.toString(), method, telemetryContext) || { span: null, telemetryHeaders: {} } | ||
const telemetryId = openTelemetry?.tracer?.resource?._attributes?.['service.name'] | ||
@@ -234,7 +234,7 @@ | ||
...headers, | ||
...telemetryHeaders | ||
...telemetryHeaders, | ||
}, | ||
throwOnError, | ||
bodyTimeout, | ||
headersTimeout | ||
headersTimeout, | ||
} | ||
@@ -286,3 +286,3 @@ if (canHaveBody) { | ||
headers: res.headers, | ||
body: responseBody | ||
body: responseBody, | ||
} | ||
@@ -295,3 +295,3 @@ } | ||
} finally { | ||
openTelemetry?.endSpanClient(span, res) | ||
openTelemetry?.endHTTPSpanClient(span, res) | ||
} | ||
@@ -303,3 +303,3 @@ } | ||
statusCode: 500, | ||
message | ||
message, | ||
} | ||
@@ -335,3 +335,3 @@ } | ||
async function graphql (url, log, headers, query, variables, openTelemetry, telemetryContext) { | ||
const { span, telemetryHeaders } = openTelemetry?.startSpanClient(url.toString(), 'POST', telemetryContext) || { span: null, telemetryHeaders: {} } | ||
const { span, telemetryHeaders } = openTelemetry?.startHTTPSpanClient(url.toString(), 'POST', telemetryContext) || { span: null, telemetryHeaders: {} } | ||
const telemetryId = openTelemetry?.tracer?.resource?._attributes?.['service.name'] | ||
@@ -342,3 +342,3 @@ | ||
...telemetryHeaders, | ||
'content-type': 'application/json; charset=utf-8' | ||
'content-type': 'application/json; charset=utf-8', | ||
} | ||
@@ -357,4 +357,4 @@ | ||
query, | ||
variables | ||
}) | ||
variables, | ||
}), | ||
}) | ||
@@ -386,3 +386,3 @@ | ||
} finally { | ||
openTelemetry?.endSpanClient(span, res) | ||
openTelemetry?.endHTTPSpanClient(span, res) | ||
} | ||
@@ -412,3 +412,3 @@ } | ||
graphql: wrapGraphQLClient(options.url, openTelemetry, logger), | ||
[kHeaders]: options.headers || {} | ||
[kHeaders]: options.headers || {}, | ||
} | ||
@@ -468,3 +468,3 @@ } | ||
plugin[Symbol.for('plugin-meta')] = { | ||
name: '@platformatic/client' | ||
name: '@platformatic/client', | ||
} | ||
@@ -471,0 +471,0 @@ |
{ | ||
"name": "@platformatic/client", | ||
"version": "2.0.0-alpha.2", | ||
"version": "2.0.0-alpha.3", | ||
"description": "A client for all platformatic backends", | ||
@@ -17,12 +17,13 @@ "main": "index.js", | ||
"devDependencies": { | ||
"borp": "^0.16.0", | ||
"borp": "^0.17.0", | ||
"c8": "^10.0.0", | ||
"eslint": "9", | ||
"execa": "^8.0.1", | ||
"fastify": "^4.26.2", | ||
"snazzy": "^9.0.0", | ||
"neostandard": "^0.11.1", | ||
"split2": "^4.2.0", | ||
"standard": "^17.1.0", | ||
"tsd": "^0.31.0", | ||
"typescript": "^5.4.2", | ||
"@platformatic/telemetry": "2.0.0-alpha.2" | ||
"@platformatic/telemetry": "2.0.0-alpha.3", | ||
"@platformatic/utils": "2.0.0-alpha.3" | ||
}, | ||
@@ -35,11 +36,11 @@ "dependencies": { | ||
"camelcase": "^6.3.0", | ||
"desm": "^1.3.1", | ||
"jsonpointer": "^5.0.1", | ||
"undici": "^6.9.0", | ||
"desm": "^1.3.1" | ||
"undici": "^6.9.0" | ||
}, | ||
"scripts": { | ||
"lint": "standard", | ||
"test": "pnpm run lint && borp --concurrency=1 --timeout 120000 && tsd", | ||
"cov": "pnpm run lint && borp --concurrency=1 --coverage --timeout 120000 && tsd" | ||
"lint": "eslint", | ||
"test": "pnpm run lint && borp --concurrency=1 --timeout=180000 && tsd", | ||
"cov": "pnpm run lint && borp --concurrency=1 --coverage --timeout=180000 && tsd" | ||
} | ||
} |
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
35397
10
636
11