@requestly/mock-server
Advanced tools
Comparing version 0.3.0 to 0.3.2
@@ -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" |
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
81209
1079
Updatedexpress@^4.20.0