Socket
Socket
Sign inDemoInstall

mockttp

Package Overview
Dependencies
Maintainers
1
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mockttp - npm Package Compare versions

Comparing version 0.9.1 to 0.10.0

custom-typings/brotli.d.ts

20

dist/client/mockttp-client.js

@@ -66,2 +66,3 @@ "use strict";

var mocked_endpoint_client_1 = require("./mocked-endpoint-client");
var request_utils_1 = require("../server/request-utils");
var ConnectionError = /** @class */ (function (_super) {

@@ -133,6 +134,6 @@ __extends(ConnectionError, _super);

_this.getEndpointData = function (ruleId) { return function () { return __awaiter(_this, void 0, void 0, function () {
var result;
var result, mockedEndpoint;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.queryMockServer("query GetEndpointData($id: ID!) {\n mockedEndpoint(id: $id) {\n seenRequests {\n protocol,\n method,\n url,\n path,\n hostname,\n headers,\n body {\n text\n }\n }\n }\n }", {
case 0: return [4 /*yield*/, this.queryMockServer("query GetEndpointData($id: ID!) {\n mockedEndpoint(id: $id) {\n seenRequests {\n protocol,\n method,\n url,\n path,\n hostname,\n headers,\n body\n }\n }\n }", {
id: ruleId

@@ -142,3 +143,9 @@ })];

result = _a.sent();
return [2 /*return*/, result.data.mockedEndpoint];
mockedEndpoint = result.data.mockedEndpoint;
if (!mockedEndpoint)
return [2 /*return*/, null];
mockedEndpoint.seenRequests.forEach(function (request) {
request.body = request_utils_1.buildBodyReader(Buffer.from(request.body, 'base64'), request.headers);
});
return [2 /*return*/, mockedEndpoint];
}

@@ -342,6 +349,6 @@ });

operationName: 'OnRequest',
query: "subscription OnRequest {\n " + queryResultName + " {\n id,\n protocol,\n method,\n url,\n path,\n hostname,\n\n headers,\n body {\n buffer,\n text,\n json,\n formData\n }\n }\n }"
query: "subscription OnRequest {\n " + queryResultName + " {\n id,\n protocol,\n method,\n url,\n path,\n hostname,\n\n headers,\n body\n }\n }"
} : {
operationName: 'OnResponse',
query: "subscription OnResponse {\n " + queryResultName + " {\n id,\n statusCode,\n statusMessage,\n headers,\n body {\n buffer,\n text,\n json,\n formData\n }\n }\n }"
query: "subscription OnResponse {\n " + queryResultName + " {\n id,\n statusCode,\n statusMessage,\n headers,\n body\n }\n }"
};

@@ -356,2 +363,5 @@ client.request(query).subscribe({

}
if (data.body) {
data.body = request_utils_1.buildBodyReader(Buffer.from(data.body, 'base64'), data.headers);
}
callback(data);

@@ -358,0 +368,0 @@ }

/// <reference types="node" />
/// <reference types="express" />
import http = require('http');
import express = require("express");
import { Readable } from 'stream';
import { Serializable, SerializationOptions } from "../util/serialization";
import { CompletedRequest, OngoingRequest, OngoingResponse } from "../types";
import { Headers, CompletedRequest, OngoingRequest, OngoingResponse } from "../types";
import { RequestHandler } from "./mock-rule-types";

@@ -16,6 +15,6 @@ export declare type SerializedBuffer = {

data: string | Buffer | SerializedBuffer | undefined;
headers: http.OutgoingHttpHeaders | undefined;
headers: Headers | undefined;
readonly type: 'simple';
constructor(status: number, data?: string | Buffer | SerializedBuffer | undefined, headers?: http.OutgoingHttpHeaders | undefined);
buildHandler(): ((request: OngoingRequest, response: OngoingResponse) => Promise<void>) & {
constructor(status: number, data?: string | Buffer | SerializedBuffer | undefined, headers?: Headers | undefined);
buildHandler(): ((_request: OngoingRequest, response: OngoingResponse) => Promise<void>) & {
explain: () => string;

@@ -51,3 +50,3 @@ };

status: number;
headers?: http.OutgoingHttpHeaders;
headers?: Headers;
}

@@ -59,8 +58,8 @@ export declare class StreamHandlerData extends Serializable {

};
headers: http.OutgoingHttpHeaders | undefined;
headers: Headers | undefined;
readonly type: 'stream';
constructor(status: number, stream: Readable & {
done?: true;
}, headers?: http.OutgoingHttpHeaders | undefined);
buildHandler(): ((request: OngoingRequest, response: express.Response) => Promise<void>) & {
}, headers?: Headers | undefined);
buildHandler(): ((_request: OngoingRequest, response: express.Response) => Promise<void>) & {
explain: () => string;

@@ -67,0 +66,0 @@ };

@@ -19,10 +19,2 @@ "use strict";

};
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -90,5 +82,8 @@ return new (P || (P = Promise))(function (resolve, reject) {

var _this = this;
return _.assign(function (request, response) { return __awaiter(_this, void 0, void 0, function () {
return _.assign(function (_request, response) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
response.writeHead(this.status, this.headers);
if (this.headers) {
request_utils_1.setHeaders(response, this.headers);
}
response.writeHead(this.status);
if (isSerializedBuffer(this.data)) {

@@ -122,3 +117,3 @@ this.data = new Buffer(this.data);

return _.assign(function (request, response) { return __awaiter(_this, void 0, void 0, function () {
var req, outResponse, error_1, defaultResponse;
var req, outResponse, error_1;
return __generator(this, function (_a) {

@@ -147,5 +142,7 @@ switch (_a.label) {

}
defaultResponse = __assign({ status: 200 }, outResponse);
response.writeHead(defaultResponse.status, defaultResponse.headers);
response.end(defaultResponse.body || "");
if (outResponse.headers) {
request_utils_1.setHeaders(response, outResponse.headers);
}
response.writeHead(outResponse.status || 200);
response.end(outResponse.body || "");
return [2 /*return*/];

@@ -264,6 +261,9 @@ }

var _this = this;
return _.assign(function (request, response) { return __awaiter(_this, void 0, void 0, function () {
return _.assign(function (_request, response) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
if (!this.stream.done) {
response.writeHead(this.status, this.headers);
if (this.headers) {
request_utils_1.setHeaders(response, this.headers);
}
response.writeHead(this.status);
this.stream.pipe(response);

@@ -270,0 +270,0 @@ this.stream.done = true;

/// <reference types="node" />
import { OutgoingHttpHeaders } from "http";
import { Readable } from "stream";
import { CompletedRequest, Method, MockedEndpoint } from "../types";
import { Headers, CompletedRequest, Method, MockedEndpoint } from "../types";
import { MockRuleData } from "./mock-rule-types";

@@ -89,3 +89,3 @@ import { CallbackHandlerResult } from "./handlers";

*/
thenReply(status: number, data?: string | Buffer, headers?: OutgoingHttpHeaders): Promise<MockedEndpoint>;
thenReply(status: number, data?: string | Buffer, headers?: Headers): Promise<MockedEndpoint>;
/**

@@ -151,3 +151,3 @@ * Reply to matched requests with the given status & JSON and (optionally)

*/
thenStream(status: number, stream: Readable, headers?: OutgoingHttpHeaders): Promise<MockedEndpoint>;
thenStream(status: number, stream: Readable, headers?: Headers): Promise<MockedEndpoint>;
/**

@@ -154,0 +154,0 @@ * Pass matched requests through to their real destination. This works

@@ -98,2 +98,3 @@ "use strict";

_this.app = express();
_this.app.disable('x-powered-by');
if (_this.cors) {

@@ -100,0 +101,0 @@ if (_this.debug)

/// <reference types="express" />
/// <reference types="node" />
import * as express from 'express';
import { OngoingRequest, CompletedRequest, CompletedResponse, OngoingResponse } from "../types";
export declare const parseBody: (req: express.Request, res: express.Response, next: express.NextFunction) => void;
import { Headers, OngoingRequest, CompletedRequest, OngoingResponse, CompletedResponse, CompletedBody } from "../types";
export declare const setHeaders: (response: express.Response, headers: Headers) => void;
export declare const buildBodyReader: (body: Buffer, headers: Headers) => CompletedBody;
export declare const parseBody: (req: express.Request, _res: express.Response, next: express.NextFunction) => void;
export declare function waitForCompletedRequest(request: OngoingRequest): Promise<CompletedRequest>;
export declare function trackResponse(response: express.Response): OngoingResponse;
export declare function waitForCompletedResponse(response: OngoingResponse): Promise<CompletedResponse>;

@@ -45,2 +45,12 @@ "use strict";

var querystring = require("querystring");
var zlib = require("zlib");
var brotliDecompress = require("brotli/decompress");
exports.setHeaders = function (response, headers) {
Object.keys(headers).forEach(function (header) {
var value = headers[header];
if (!value)
return;
response.setHeader(header, value.toString());
});
};
var streamToBuffer = function (input) {

@@ -77,24 +87,70 @@ return new Promise(function (resolve, reject) {

};
var waitForBody = function (body) { return __awaiter(_this, void 0, void 0, function () {
var _a;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = {};
return [4 /*yield*/, body.asBuffer()];
function runOrUndefined(func) {
try {
return func();
}
catch (_a) {
return undefined;
}
}
var waitForBody = function (body, headers) { return __awaiter(_this, void 0, void 0, function () {
var bufferBody;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, body.asBuffer()];
case 1:
_a.buffer = _b.sent();
return [4 /*yield*/, body.asText().catch(function () { return undefined; })];
case 2:
_a.text = _b.sent();
return [4 /*yield*/, body.asJson().catch(function () { return undefined; })];
case 3:
_a.json = _b.sent();
return [4 /*yield*/, body.asFormData().catch(function () { return undefined; })];
case 4: return [2 /*return*/, (_a.formData = _b.sent(),
_a)];
bufferBody = _a.sent();
return [2 /*return*/, exports.buildBodyReader(bufferBody, headers)];
}
});
}); };
exports.parseBody = function (req, res, next) {
var handleContentEncoding = function (body, encoding) {
if (encoding === 'gzip' || encoding === 'x-gzip') {
return zlib.gunzipSync(body);
}
else if (encoding === 'deflate' || encoding === 'x-deflate') {
// Deflate is ambiguous, and may or may not have a zlib wrapper.
// This checks the buffer header directly, based on
// https://stackoverflow.com/a/37528114/68051
var lowNibble = body[0] & 0xF;
if (lowNibble === 8) {
return zlib.inflateSync(body);
}
else {
return zlib.inflateRawSync(body);
}
}
else if (encoding === 'br') {
return new Buffer(brotliDecompress(body));
}
else if (!encoding || encoding === 'identity') {
return body;
}
else {
throw new Error("Unknown encoding: " + encoding);
}
};
exports.buildBodyReader = function (body, headers) {
var completedBody = {
buffer: body,
get text() {
return runOrUndefined(function () {
return handleContentEncoding(body, headers['content-encoding'])
.toString('utf8');
});
},
get json() {
return runOrUndefined(function () {
return JSON.parse(completedBody.text);
});
},
get formData() {
return runOrUndefined(function () {
return completedBody.text && querystring.parse(completedBody.text);
});
}
};
return completedBody;
};
exports.parseBody = function (req, _res, next) {
var transformedRequest = req;

@@ -122,3 +178,3 @@ var bodyStream = new stream.PassThrough();

_c = {};
return [4 /*yield*/, waitForBody(request.body)];
return [4 /*yield*/, waitForBody(request.body, request.headers)];
case 1: return [2 /*return*/, _b.apply(_a, [(_c.body = _d.sent(),

@@ -182,3 +238,3 @@ _c)]).valueOf()];

};
return [4 /*yield*/, waitForBody(response.body)];
return [4 /*yield*/, waitForBody(response.body, response.getHeaders())];
case 1: return [2 /*return*/, _b.apply(_a, [(_c.body = _d.sent(),

@@ -185,0 +241,0 @@ _c)]).valueOf()];

@@ -86,3 +86,3 @@ "use strict";

return [4 /*yield*/, endpoint.getSeenRequests()];
case 1: return [2 /*return*/, (_a.seenRequests = (_b.sent()),
case 1: return [2 /*return*/, (_a.seenRequests = _b.sent(),
_a)];

@@ -153,2 +153,13 @@ }

}),
Buffer: new graphql_1.GraphQLScalarType({
name: 'Buffer',
description: 'A buffer',
serialize: function (value) {
return value.toString('base64');
},
parseValue: function (input) {
return Buffer.from(input, 'base64');
},
parseLiteral: parseAnyAst
})
};

@@ -201,2 +212,10 @@ function buildStandaloneModel(mockServer, stream) {

}
}, Request: {
body: function (request) {
return request.body.buffer;
}
}, Response: {
body: function (response) {
return response.body.buffer;
}
} }, ScalarResolvers);

@@ -203,0 +222,0 @@ }

@@ -17,2 +17,5 @@ /// <reference types="node" />

}
export interface Headers {
[key: string]: string;
}
export interface Request {

@@ -24,5 +27,3 @@ protocol: string;

hostname: string;
headers: {
[key: string]: string;
};
headers: Headers;
}

@@ -57,5 +58,3 @@ export interface OngoingRequest extends Request {

id: string;
getHeaders(): {
[key: string]: string;
};
getHeaders(): Headers;
body: ParsedBody;

@@ -67,5 +66,3 @@ }

statusMessage: string;
headers: {
[key: string]: string;
};
headers: Headers;
body: CompletedBody;

@@ -72,0 +69,0 @@ }

{
"name": "mockttp",
"version": "0.9.1",
"version": "0.10.0",
"description": "Mock HTTP server for testing HTTP clients and stubbing webservices",

@@ -111,2 +111,3 @@ "main": "dist/main.js",

"body-parser": "^1.15.2",
"brotli": "^1.3.2",
"common-tags": "^1.8.0",

@@ -113,0 +114,0 @@ "cors": "^2.8.4",

@@ -126,3 +126,3 @@ # Mockttp [![Travis Build Status](https://img.shields.io/travis/pimterry/mockttp.svg)](https://travis-ci.org/pimterry/mockttp) [![Try Mockttp on RunKit](https://badge.runkitcdn.com/mockttp.svg)](https://npm.runkit.com/mockttp)

* [In-depth setup guide](docs/setup.md)
* [API reference](https://pimterry.github.io/mockttp/modules/mockttp.html)
* [API reference](https://httptoolkit.github.io/mockttp/modules/mockttp.html)

@@ -129,0 +129,0 @@ ## Credits

@@ -19,3 +19,3 @@ /**

import { MockedEndpoint } from "../types";
import { MockedEndpoint, CompletedRequest } from "../types";
import {

@@ -30,2 +30,3 @@ MockRuleData

import { Duplex } from 'stream';
import { buildBodyReader } from '../server/request-utils';

@@ -251,8 +252,3 @@ export class ConnectionError extends TypedError { }

headers,
body {
buffer,
text,
json,
formData
}
body
}

@@ -268,8 +264,3 @@ }`

headers,
body {
buffer,
text,
json,
formData
}
body
}

@@ -287,2 +278,5 @@ }`

}
if (data.body) {
data.body = buildBodyReader(Buffer.from(data.body, 'base64'), data.headers);
}
callback(data);

@@ -307,15 +301,13 @@ } else if (value.errors) {

`query GetEndpointData($id: ID!) {
mockedEndpoint(id: $id) {
seenRequests {
protocol,
method,
url,
path,
hostname,
headers,
body {
text
}
}
mockedEndpoint(id: $id) {
seenRequests {
protocol,
method,
url,
path,
hostname,
headers,
body
}
}
}`, {

@@ -326,4 +318,12 @@ id: ruleId

return result.data.mockedEndpoint;
const mockedEndpoint = result.data.mockedEndpoint;
if (!mockedEndpoint) return null;
mockedEndpoint.seenRequests.forEach((request: any) => {
request.body = buildBodyReader(Buffer.from(request.body, 'base64'), request.headers);
});
return mockedEndpoint;
}
}

@@ -17,6 +17,6 @@ /**

import { waitForCompletedRequest } from '../server/request-utils';
import { waitForCompletedRequest, setHeaders } from '../server/request-utils';
import { Serializable, SerializationOptions } from "../util/serialization";
import { CompletedRequest, OngoingRequest, OngoingResponse } from "../types";
import { Headers, CompletedRequest, OngoingRequest, OngoingResponse } from "../types";
import { RequestHandler } from "./mock-rule-types";

@@ -36,3 +36,3 @@

public data?: string | Buffer | SerializedBuffer,
public headers?: http.OutgoingHttpHeaders
public headers?: Headers
) {

@@ -43,4 +43,7 @@ super();

buildHandler() {
return _.assign(async (request: OngoingRequest, response: OngoingResponse) => {
response.writeHead(this.status, this.headers);
return _.assign(async (_request: OngoingRequest, response: OngoingResponse) => {
if (this.headers) {
setHeaders(response, this.headers);
}
response.writeHead(this.status);

@@ -121,9 +124,9 @@ if (isSerializedBuffer(this.data)) {

const defaultResponse = {
status: 200,
...outResponse
};
response.writeHead(defaultResponse.status, defaultResponse.headers);
response.end(defaultResponse.body || "");
}, { explain: () =>
if (outResponse.headers) {
setHeaders(response, outResponse.headers);
}
response.writeHead(outResponse.status || 200);
response.end(outResponse.body || "");
}, { explain: () =>
'respond using provided callback' +

@@ -225,3 +228,3 @@ (this.callback.name ? ` (${this.callback.name})` : '')

status: number;
headers?: http.OutgoingHttpHeaders;
headers?: Headers;
};

@@ -246,3 +249,3 @@

public stream: Readable & { done?: true },
public headers?: http.OutgoingHttpHeaders
public headers?: Headers
) {

@@ -253,5 +256,9 @@ super();

buildHandler() {
return _.assign(async (request: OngoingRequest, response: express.Response) => {
return _.assign(async (_request: OngoingRequest, response: express.Response) => {
if (!this.stream.done) {
response.writeHead(this.status, this.headers);
if (this.headers) {
setHeaders(response, this.headers);
}
response.writeHead(this.status);
this.stream.pipe(response);

@@ -258,0 +265,0 @@ this.stream.done = true;

@@ -11,3 +11,3 @@ /**

import { CompletedRequest, Method, MockedEndpoint } from "../types";
import { Headers, CompletedRequest, Method, MockedEndpoint } from "../types";

@@ -189,3 +189,3 @@ import {

*/
thenReply(status: number, data?: string | Buffer, headers?: OutgoingHttpHeaders): Promise<MockedEndpoint> {
thenReply(status: number, data?: string | Buffer, headers?: Headers): Promise<MockedEndpoint> {
const rule: MockRuleData = {

@@ -281,3 +281,3 @@ matchers: this.matchers,

*/
thenStream(status: number, stream: Readable, headers?: OutgoingHttpHeaders): Promise<MockedEndpoint> {
thenStream(status: number, stream: Readable, headers?: Headers): Promise<MockedEndpoint> {
const rule: MockRuleData = {

@@ -284,0 +284,0 @@ matchers: this.matchers,

@@ -7,3 +7,2 @@ /**

import { MockRule } from '../rules/mock-rule';
import * as _ from "lodash";

@@ -10,0 +9,0 @@ export class MockedEndpoint implements MockedEndpointInterface {

@@ -57,2 +57,3 @@ /**

this.app = express();
this.app.disable('x-powered-by');

@@ -59,0 +60,0 @@ if (this.cors) {

@@ -9,5 +9,24 @@ /**

import * as express from 'express';
import * as zlib from 'zlib';
import * as brotliDecompress from 'brotli/decompress';
import { OngoingRequest, CompletedRequest, CompletedResponse, OngoingResponse, ParsedBody } from "../types";
import {
Headers,
OngoingRequest,
CompletedRequest,
OngoingResponse,
CompletedResponse,
ParsedBody,
CompletedBody
} from "../types";
export const setHeaders = (response: express.Response, headers: Headers) => {
Object.keys(headers).forEach((header) => {
let value = headers[header];
if (!value) return;
response.setHeader(header, value.toString());
});
};
const streamToBuffer = (input: stream.Readable): Promise<Buffer> => {

@@ -48,14 +67,64 @@ return new Promise((resolve, reject) => {

const waitForBody = async (body: ParsedBody) => {
return {
buffer: await body.asBuffer(),
text: await body.asText().catch(() => undefined),
json: await body.asJson().catch(() => undefined),
formData: await body.asFormData().catch(() => undefined)
function runOrUndefined<R>(func: () => R): R | undefined {
try {
return func();
} catch {
return undefined;
}
}
const waitForBody = async (body: ParsedBody, headers: Headers): Promise<CompletedBody> => {
const bufferBody = await body.asBuffer();
return buildBodyReader(bufferBody, headers);
};
const handleContentEncoding = (body: Buffer, encoding?: string) => {
if (encoding === 'gzip' || encoding === 'x-gzip') {
return zlib.gunzipSync(body);
} else if (encoding === 'deflate' || encoding === 'x-deflate') {
// Deflate is ambiguous, and may or may not have a zlib wrapper.
// This checks the buffer header directly, based on
// https://stackoverflow.com/a/37528114/68051
const lowNibble = body[0] & 0xF;
if (lowNibble === 8) {
return zlib.inflateSync(body);
} else {
return zlib.inflateRawSync(body);
}
} else if (encoding === 'br') {
return new Buffer(brotliDecompress(body));
} else if (!encoding || encoding === 'identity') {
return body;
} else {
throw new Error(`Unknown encoding: ${encoding}`);
}
};
export const buildBodyReader = (body: Buffer, headers: Headers): CompletedBody => {
const completedBody = {
buffer: body,
get text() {
return runOrUndefined(() =>
handleContentEncoding(body, headers['content-encoding'])
.toString('utf8')
);
},
get json() {
return runOrUndefined(() =>
JSON.parse(completedBody.text!)
)
},
get formData() {
return runOrUndefined(() =>
completedBody.text && querystring.parse(completedBody.text)
);
}
};
return completedBody;
};
export const parseBody = (
req: express.Request,
res: express.Response,
_res: express.Response,
next: express.NextFunction

@@ -83,3 +152,3 @@ ) => {

]).assign({
body: await waitForBody(request.body)
body: await waitForBody(request.body, request.headers)
}).valueOf();

@@ -134,4 +203,4 @@ }

headers: response.getHeaders(),
body: await waitForBody(response.body)
body: await waitForBody(response.body, response.getHeaders())
}).valueOf();
}

@@ -11,3 +11,2 @@ /**

ObjectValueNode,
ListValueNode,
ValueNode

@@ -18,8 +17,7 @@ } from "graphql";

import { MatcherData, buildMatchers } from "../rules/matchers";
import { MatcherData } from "../rules/matchers";
import { HandlerData } from "../rules/handlers";
import { CompletionCheckerData } from "../rules/completion-checkers";
import MockttpServer from "../server/mockttp-server";
import { Method, CompletedRequest, MockedEndpoint, MockedEndpointData } from "../types";
import { MockRuleData } from "../rules/mock-rule-types";
import { MockedEndpoint, MockedEndpointData, CompletedBody, CompletedRequest, CompletedResponse } from "../types";
import { deserializeRuleData } from "../rules/mock-rule";

@@ -60,3 +58,3 @@ import { Duplex } from "stream";

id: endpoint.id,
seenRequests: (await endpoint.getSeenRequests())
seenRequests: await endpoint.getSeenRequests()
};

@@ -123,2 +121,14 @@ }

}),
Buffer: new GraphQLScalarType({
name: 'Buffer',
description: 'A buffer',
serialize: (value: Buffer) => {
return value.toString('base64');
},
parseValue: (input: string) => {
return Buffer.from(input, 'base64');
},
parseLiteral: parseAnyAst
})
};

@@ -178,4 +188,16 @@

Request: {
body: (request: CompletedRequest) => {
return request.body.buffer;
}
},
Response: {
body: (response: CompletedResponse) => {
return response.body.buffer;
}
},
...ScalarResolvers
};
}

@@ -20,2 +20,6 @@ /**

export interface Headers {
[key: string]: string;
}
export interface Request {

@@ -28,3 +32,3 @@ protocol: string;

headers: { [key: string]: string; };
headers: Headers;
}

@@ -62,3 +66,3 @@

id: string;
getHeaders(): { [key: string]: string };
getHeaders(): Headers;
body: ParsedBody;

@@ -71,3 +75,3 @@ }

statusMessage: string;
headers: { [key: string]: string; };
headers: Headers;
body: CompletedBody;

@@ -84,3 +88,3 @@ }

* Get the requests that this endpoint has seen so far.
*
*
* This method returns a promise, which resolves with the requests seen

@@ -87,0 +91,0 @@ * up until now. The returned lists are immutable, so won't change if more

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc