Skip to content

Commit

Permalink
fix: Remove unusable external export of HTTPConfig, which removes the…
Browse files Browse the repository at this point in the history
… need to have needle types as a dependency
  • Loading branch information
TimothyJones committed Mar 21, 2023
1 parent dd1bfde commit f123204
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
10 changes: 7 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"access": "public"
},
"dependencies": {
"@types/needle": "2.5.2",
"bindings": "^1.5.0",
"chalk": "4.1.2",
"check-types": "7.3.0",
Expand Down Expand Up @@ -83,6 +82,7 @@
"@types/express": "4.11.1",
"@types/mkdirp": "^0.5.2",
"@types/mocha": "9.0.0",
"@types/needle": "2.5.2",
"@types/node": "^18.11.10",
"@types/promise-timeout": "^1.3.0",
"@types/rimraf": "^2.0.2",
Expand Down
4 changes: 2 additions & 2 deletions src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import needle = require('needle');
import spawn, { CliVerbOptions } from './spawn';
import { LogLevel } from './logger/types';
import logger, { setLogLevel } from './logger';
import { HTTPConfig, ServiceOptions } from './types';
import { ServiceOptions } from './types';

// Get a reference to the global setTimeout object in case it is mocked by a testing library later
const { setTimeout } = global;
Expand Down Expand Up @@ -320,7 +320,7 @@ export abstract class AbstractService extends events.EventEmitter {
}

private __call(options: ServiceOptions): Promise<unknown> {
const config: HTTPConfig = {
const config: needle.NeedleOptions = {
method: 'GET',
headers: {
'X-Pact-Mock-Service': 'true',
Expand Down
8 changes: 0 additions & 8 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import needle from 'needle';
import { LogLevel } from './logger/types';

export interface MessageOptions {
Expand Down Expand Up @@ -36,10 +35,3 @@ export interface ServiceOptions {
logLevel?: LogLevel;
timeout?: number;
}

export interface HTTPConfig extends Omit<needle.NeedleOptions, 'headers'> {
headers: {
'X-Pact-Mock-Service': string;
'Content-Type': string;
};
}

0 comments on commit f123204

Please sign in to comment.