Socket
Socket
Sign inDemoInstall

@requestly/mock-server

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@requestly/mock-server - npm Package Compare versions

Comparing version 0.3.0 to 0.3.2

52

build/test/dummy/mock1.js

@@ -7,3 +7,5 @@ "use strict";

id: "1",
name: "mock1",
desc: "Mock 1",
ownerId: "1",
method: types_1.RequestMethod.POST,

@@ -18,12 +20,14 @@ endpoint: "abcd/:userId/:name",

headers: {
"foo": "bar",
"content-type": "application/json"
foo: "bar",
"content-type": "application/json",
},
body: "{\"Hello\":\"There\",\"mockId\":\"1\", \"statusCode\": {{ statusCode }}, \"method\": \"{{ method }}\", \"urlParams\": \"{{ urlParam 'userId' }}\", \"header\": \"{{ header 'userid' 'test' }}\" }}"
}
]
body: '{"Hello":"There","mockId":"1", "statusCode": {{ statusCode }}, "method": "{{ method }}", "urlParams": "{{ urlParam \'userId\' }}", "header": "{{ header \'userid\' \'test\' }}" }}',
},
],
};
exports.dummyMock2 = {
id: "2",
name: "mock2",
desc: "Mock 2",
ownerId: "2",
method: types_1.RequestMethod.GET,

@@ -38,15 +42,17 @@ endpoint: "users2",

headers: {
"foo": "bar",
"content-type": "application/json"
foo: "bar",
"content-type": "application/json",
},
body: "{\"Hello\":\"There\",\"mockId\":\"2\"}"
}
]
body: '{"Hello":"There","mockId":"2"}',
},
],
};
exports.dummyMock3 = {
id: "3",
name: "mock3",
desc: "Mock 3 : Password protected",
ownerId: "3",
method: types_1.RequestMethod.GET,
endpoint: "users3",
password: '1234',
password: "1234",
responses: [

@@ -59,12 +65,14 @@ {

headers: {
"foo": "bar",
foo: "bar",
"content-type": "application/json",
},
body: "{\"Hello\":\"There\",\"mockId\":\"3\"}"
}
]
body: '{"Hello":"There","mockId":"3"}',
},
],
};
exports.dummyMock4 = {
id: "4",
name: "mock4",
desc: "Mock 4 : Password protected",
ownerId: "4",
method: types_1.RequestMethod.GET,

@@ -82,5 +90,5 @@ endpoint: "users4/:id/:name",

},
body: `the id is {{urlParam 'id'}} . the url is {{url}} . not passing param to url param {{urlParam}}. Content type is {{header 'Content-Type'}}. giberish ahead: {{random values}} {{}} {{color: "something"}} {{url 'http://localhost:3000'}} {{urlParam 'id'}} {{ color: "red", display: flex}}`
}
]
body: `the id is {{urlParam 'id'}} . the url is {{url}} . not passing param to url param {{urlParam}}. Content type is {{header 'Content-Type'}}. giberish ahead: {{random values}} {{}} {{color: "something"}} {{url 'http://localhost:3000'}} {{urlParam 'id'}} {{ color: "red", display: flex}}`,
},
],
};

@@ -91,15 +99,15 @@ const getSelectorMap = () => {

method: exports.dummyMock1.method,
endpoint: exports.dummyMock1.endpoint
endpoint: exports.dummyMock1.endpoint,
};
selectorMap[exports.dummyMock2.id] = {
method: exports.dummyMock2.method,
endpoint: exports.dummyMock2.endpoint
endpoint: exports.dummyMock2.endpoint,
};
selectorMap[exports.dummyMock3.id] = {
method: exports.dummyMock3.method,
endpoint: exports.dummyMock3.endpoint
endpoint: exports.dummyMock3.endpoint,
};
selectorMap[exports.dummyMock4.id] = {
method: exports.dummyMock4.method,
endpoint: exports.dummyMock4.endpoint
endpoint: exports.dummyMock4.endpoint,
};

@@ -106,0 +114,0 @@ return selectorMap;

@@ -7,3 +7,3 @@ import { RequestMethod } from ".";

id: string;
name?: string;
name: string;
desc?: string;

@@ -13,4 +13,4 @@ method: RequestMethod;

ownerId?: string;
createdTs?: string;
updatedTs?: string;
createdTs?: number;
updatedTs?: number;
password?: string;

@@ -17,0 +17,0 @@ }

{
"name": "@requestly/mock-server",
"version": "0.3.0",
"version": "0.3.2",
"description": "- Methods: GET, POST, PUT, OPTIONS - Description - Endpoint (can be full path) (/api/v1/users) - Multiple Responses - Shuffle Response - Sequential Response - Rules in Response - Status (Any status code 2xx, 4xx) - Latency - Body - Templating - Faker js - Headers",

@@ -28,3 +28,3 @@ "main": "build/index.js",

"cors": "^2.8.5",
"express": "^4.18.2",
"express": "^4.20.0",
"handlebars": "^4.7.8",

@@ -31,0 +31,0 @@ "path-to-regexp": "^0.1.7"

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