@graphql-inspector/commands
Advanced tools
Comparing version 2.5.0 to 2.6.0
@@ -26,2 +26,4 @@ 'use strict'; | ||
const headers = {}; | ||
const leftHeaders = {}; | ||
const rightHeaders = {}; | ||
if (args.header) { | ||
@@ -33,6 +35,18 @@ args.header.forEach((header) => { | ||
} | ||
if (args.leftHeader) { | ||
args.leftHeader.forEach((leftHeader) => { | ||
const [lname, ...lvalues] = leftHeader.split(':'); | ||
leftHeaders[lname] = lvalues.join(''); | ||
}); | ||
} | ||
if (args.rightHeader) { | ||
args.rightHeader.forEach((rightHeader) => { | ||
const [rname, ...rvalues] = rightHeader.split(':'); | ||
rightHeaders[rname] = rvalues.join(''); | ||
}); | ||
} | ||
if (args.require) { | ||
args.require.forEach((mod) => require(mod)); | ||
} | ||
return { headers, token: args.token }; | ||
return { headers, leftHeaders, rightHeaders, token: args.token }; | ||
} | ||
@@ -39,0 +53,0 @@ function mockCommand(mod, cmd) { |
@@ -17,2 +17,4 @@ import { InspectorConfig } from '@graphql-inspector/config'; | ||
header?: string[]; | ||
leftHeader?: string[]; | ||
rightHeader?: string[]; | ||
federation?: boolean; | ||
@@ -24,4 +26,6 @@ aws?: boolean; | ||
headers: Record<string, string>; | ||
leftHeaders: Record<string, string>; | ||
rightHeaders: Record<string, string>; | ||
token: string | undefined; | ||
}; | ||
export declare function mockCommand(mod: Command, cmd: string): Promise<string>; |
@@ -20,2 +20,4 @@ import { __awaiter } from 'tslib'; | ||
const headers = {}; | ||
const leftHeaders = {}; | ||
const rightHeaders = {}; | ||
if (args.header) { | ||
@@ -27,6 +29,18 @@ args.header.forEach((header) => { | ||
} | ||
if (args.leftHeader) { | ||
args.leftHeader.forEach((leftHeader) => { | ||
const [lname, ...lvalues] = leftHeader.split(':'); | ||
leftHeaders[lname] = lvalues.join(''); | ||
}); | ||
} | ||
if (args.rightHeader) { | ||
args.rightHeader.forEach((rightHeader) => { | ||
const [rname, ...rvalues] = rightHeader.split(':'); | ||
rightHeaders[rname] = rvalues.join(''); | ||
}); | ||
} | ||
if (args.require) { | ||
args.require.forEach((mod) => require(mod)); | ||
} | ||
return { headers, token: args.token }; | ||
return { headers, leftHeaders, rightHeaders, token: args.token }; | ||
} | ||
@@ -33,0 +47,0 @@ function mockCommand(mod, cmd) { |
{ | ||
"name": "@graphql-inspector/commands", | ||
"version": "2.5.0", | ||
"version": "2.6.0", | ||
"description": "Plugin system for commands in GraphQL Inspector", | ||
"sideEffects": false, | ||
"peerDependencies": { | ||
"@graphql-inspector/config": "2.5.0", | ||
"@graphql-inspector/loaders": "2.5.0", | ||
"@graphql-inspector/config": "2.6.0", | ||
"@graphql-inspector/loaders": "2.6.0", | ||
"graphql": "^0.13.0 || ^14.0.0 || ^15.0.0", | ||
"yargs": "16.2.0" | ||
"yargs": "17.0.1" | ||
}, | ||
@@ -12,0 +12,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
14912
154