@graphql-ez/client
Advanced tools
+13
-12
@@ -5,12 +5,12 @@ 'use strict'; | ||
| const clientURI = require('@graphql-ez/utils/clientURI'); | ||
| const object = require('@graphql-ez/utils/object'); | ||
| const url = require('@graphql-ez/utils/url'); | ||
| const undici = require('undici'); | ||
| const sse = require('./sse.js'); | ||
| const stream = require('./stream.js'); | ||
| const upload = require('./upload.js'); | ||
| const utils = require('./utils.js'); | ||
| const graphqlWs = require('./websockets/graphql-ws.js'); | ||
| const subscriptionsTransport = require('./websockets/subscriptions-transport.js'); | ||
| var clientURI = require('@graphql-ez/utils/clientURI'); | ||
| var object = require('@graphql-ez/utils/object'); | ||
| var url = require('@graphql-ez/utils/url'); | ||
| var undici = require('undici'); | ||
| var sse = require('./sse.js'); | ||
| var stream = require('./stream.js'); | ||
| var upload = require('./upload.js'); | ||
| var utils = require('./utils.js'); | ||
| var graphqlWs = require('./websockets/graphql-ws.js'); | ||
| var subscriptionsTransport = require('./websockets/subscriptions-transport.js'); | ||
@@ -50,3 +50,2 @@ class GraphQLErrorJSON extends Error { | ||
| const query = async function query2(document, { variables, headers: headersArg, method = "POST", extensions, operationName, requestOptions } = {}) { | ||
| var _a; | ||
| const { body, headers: headers2 } = await client.request( | ||
@@ -69,3 +68,5 @@ method === "GET" ? { | ||
| ); | ||
| if (!((_a = headers2["content-type"]) == null ? void 0 : _a.startsWith("application/json"))) { | ||
| const contentType = headers2["content-type"]; | ||
| const contentTypeString = Array.isArray(contentType) ? contentType[0] : contentType; | ||
| if (!(contentTypeString == null ? void 0 : contentTypeString.startsWith("application/json"))) { | ||
| const errorBody = await body.text().catch(() => null) || "No body"; | ||
@@ -72,0 +73,0 @@ throw Error(`Unexpected content type received: ${headers2["content-type"]}, BodyText: ${errorBody}`); |
+3
-2
@@ -45,3 +45,2 @@ import { documentParamsToURIParams } from '@graphql-ez/utils/clientURI'; | ||
| const query = async function query2(document, { variables, headers: headersArg, method = "POST", extensions, operationName, requestOptions } = {}) { | ||
| var _a; | ||
| const { body, headers: headers2 } = await client.request( | ||
@@ -64,3 +63,5 @@ method === "GET" ? { | ||
| ); | ||
| if (!((_a = headers2["content-type"]) == null ? void 0 : _a.startsWith("application/json"))) { | ||
| const contentType = headers2["content-type"]; | ||
| const contentTypeString = Array.isArray(contentType) ? contentType[0] : contentType; | ||
| if (!(contentTypeString == null ? void 0 : contentTypeString.startsWith("application/json"))) { | ||
| const errorBody = await body.text().catch(() => null) || "No body"; | ||
@@ -67,0 +68,0 @@ throw Error(`Unexpected content type received: ${headers2["content-type"]}, BodyText: ${errorBody}`); |
+5
-3
| { | ||
| "name": "@graphql-ez/client", | ||
| "version": "0.6.1", | ||
| "version": "0.6.2", | ||
| "sideEffects": false, | ||
@@ -16,4 +16,4 @@ "peerDependencies": { | ||
| "dependencies": { | ||
| "@graphql-ez/utils": "^0.2.0", | ||
| "undici": "^5.14.0" | ||
| "undici": "^5.14.0", | ||
| "@graphql-ez/utils": "^0.2.1" | ||
| }, | ||
@@ -33,2 +33,3 @@ "repository": { | ||
| ".": { | ||
| "types": "./index.d.ts", | ||
| "require": "./index.js", | ||
@@ -38,2 +39,3 @@ "import": "./index.mjs" | ||
| "./*": { | ||
| "types": "./*.d.ts", | ||
| "require": "./*.js", | ||
@@ -40,0 +42,0 @@ "import": "./*.mjs" |
+3
-3
@@ -5,5 +5,5 @@ 'use strict'; | ||
| const promise = require('@graphql-ez/utils/promise'); | ||
| const graphql = require('graphql'); | ||
| const utils = require('./utils.js'); | ||
| var promise = require('@graphql-ez/utils/promise'); | ||
| var graphql = require('graphql'); | ||
| var utils = require('./utils.js'); | ||
@@ -10,0 +10,0 @@ function createSSESubscription(href, getHeaders) { |
+4
-4
@@ -5,6 +5,6 @@ 'use strict'; | ||
| const promise = require('@graphql-ez/utils/promise'); | ||
| const assert = require('assert'); | ||
| const stream = require('stream'); | ||
| const utils = require('./utils.js'); | ||
| var promise = require('@graphql-ez/utils/promise'); | ||
| var assert = require('assert'); | ||
| var stream = require('stream'); | ||
| var utils = require('./utils.js'); | ||
@@ -11,0 +11,0 @@ function createStreamHelper(pool, path, getHeaders) { |
+2
-2
@@ -5,4 +5,4 @@ 'use strict'; | ||
| const fs = require('fs'); | ||
| const utils = require('./utils.js'); | ||
| var fs = require('fs'); | ||
| var utils = require('./utils.js'); | ||
@@ -9,0 +9,0 @@ function createUploadQuery(endpoint, getHeaders, defaultQuery) { |
+2
-2
@@ -5,4 +5,4 @@ 'use strict'; | ||
| const promise = require('@graphql-ez/utils/promise'); | ||
| const graphql = require('graphql'); | ||
| var promise = require('@graphql-ez/utils/promise'); | ||
| var graphql = require('graphql'); | ||
@@ -9,0 +9,0 @@ const lazyDeps = promise.LazyPromise(() => Promise.resolve().then(function () { return require('./deps.js'); })); |
@@ -5,4 +5,4 @@ 'use strict'; | ||
| const promise = require('@graphql-ez/utils/promise'); | ||
| const utils = require('../utils.js'); | ||
| var promise = require('@graphql-ez/utils/promise'); | ||
| var utils = require('../utils.js'); | ||
@@ -9,0 +9,0 @@ function createGraphQLWSWebsocketsClient(wsEndpoint, options = {}) { |
@@ -5,4 +5,4 @@ 'use strict'; | ||
| const promise = require('@graphql-ez/utils/promise'); | ||
| const utils = require('../utils.js'); | ||
| var promise = require('@graphql-ez/utils/promise'); | ||
| var utils = require('../utils.js'); | ||
@@ -9,0 +9,0 @@ function createSubscriptionsTransportWebsocketsClient(wsEndpoint, options = {}) { |
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 5 instances in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 5 instances in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
578602
0.76%3147
0.99%19
-20.83%Updated