mock-config-server 2.2.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -5
- package/dist/bin/build.d.ts +2 -0
- package/dist/bin/build.js +49 -0
- package/dist/bin/cli.js +14 -2
- package/dist/bin/helpers/index.d.ts +3 -0
- package/dist/bin/helpers/index.js +19 -0
- package/dist/bin/helpers/resolveConfigFile.d.ts +2 -0
- package/dist/bin/helpers/resolveConfigFile.js +20 -0
- package/dist/bin/helpers/resolveConfigFilePath.d.ts +1 -0
- package/dist/bin/helpers/resolveConfigFilePath.js +39 -0
- package/dist/bin/resolveConfigFilePath/resolveConfigFilePath.d.ts +1 -0
- package/dist/bin/resolveConfigFilePath/resolveConfigFilePath.js +39 -0
- package/dist/bin/run.d.ts +6 -0
- package/dist/bin/run.js +17 -0
- package/dist/bin/validateMockServerConfig/validateGraphqlConfig/validateRoutes/validateRoutes.js +11 -11
- package/dist/bin/validateMockServerConfig/validateRestConfig/validateRoutes/validateRoutes.js +15 -15
- package/dist/src/core/graphql/createGraphQLRoutes/createGraphQLRoutes.d.ts +2 -2
- package/dist/src/core/graphql/createGraphQLRoutes/createGraphQLRoutes.js +18 -16
- package/dist/src/core/graphql/createGraphQLRoutes/helpers/prepareGraphQLRequestConfigs/prepareGraphQLRequestConfigs.js +3 -1
- package/dist/src/core/middlewares/cookieParseMiddleware/cookieParseMiddleware.d.ts +2 -0
- package/dist/src/core/middlewares/cookieParseMiddleware/cookieParseMiddleware.js +16 -0
- package/dist/src/core/middlewares/cookieParseMiddleware/helpers/index.d.ts +1 -0
- package/dist/src/core/middlewares/cookieParseMiddleware/helpers/index.js +17 -0
- package/dist/src/core/middlewares/cookieParseMiddleware/helpers/parseCookie/parseCookie.d.ts +3 -0
- package/dist/src/core/middlewares/cookieParseMiddleware/helpers/parseCookie/parseCookie.js +17 -0
- package/dist/src/core/middlewares/corsMiddleware/corsMiddleware.js +12 -12
- package/dist/src/core/middlewares/destroyerMiddleware/destroyerMiddleware.d.ts +7 -0
- package/dist/src/core/middlewares/destroyerMiddleware/destroyerMiddleware.js +23 -0
- package/dist/src/core/middlewares/index.d.ts +3 -0
- package/dist/src/core/middlewares/index.js +3 -0
- package/dist/src/core/middlewares/noCorsMiddleware/noCorsMiddleware.js +13 -13
- package/dist/src/core/middlewares/notFoundMiddleware/helpers/getGraphqlUrlSuggestions/getGraphqlUrlSuggestions.d.ts +7 -2
- package/dist/src/core/middlewares/notFoundMiddleware/helpers/getGraphqlUrlSuggestions/getGraphqlUrlSuggestions.js +8 -7
- package/dist/src/core/middlewares/notFoundMiddleware/helpers/getRestUrlSuggestions/getRestUrlSuggestions.d.ts +7 -2
- package/dist/src/core/middlewares/notFoundMiddleware/helpers/getRestUrlSuggestions/getRestUrlSuggestions.js +4 -4
- package/dist/src/core/middlewares/notFoundMiddleware/notFoundMiddleware.js +36 -30
- package/dist/src/core/middlewares/requestInterceptorMiddleware/requestInterceptorMiddleware.d.ts +3 -0
- package/dist/src/core/middlewares/requestInterceptorMiddleware/requestInterceptorMiddleware.js +11 -0
- package/dist/src/core/rest/createRestRoutes/createRestRoutes.d.ts +2 -2
- package/dist/src/core/rest/createRestRoutes/createRestRoutes.js +9 -11
- package/dist/src/core/rest/createRestRoutes/helpers/prepareRestRequestConfigs/prepareRestRequestConfigs.js +3 -1
- package/dist/src/server/createMockServer/createMockServer.js +17 -3
- package/dist/src/server/index.d.ts +1 -1
- package/dist/src/server/index.js +1 -1
- package/dist/src/server/startMockServer/startMockServer.d.ts +4 -1
- package/dist/src/server/startMockServer/startMockServer.js +4 -1
- package/dist/src/static/views/assets/icons/scheme-dark.svg +3 -0
- package/dist/src/static/views/assets/icons/scheme-light.svg +3 -0
- package/dist/src/static/views/assets/images/404.png +0 -0
- package/dist/src/static/views/assets/images/logo.png +0 -0
- package/dist/src/static/views/assets/images/success.png +0 -0
- package/dist/src/static/views/assets/styles/global.css +88 -0
- package/dist/src/static/views/components/header/index.css +55 -0
- package/dist/src/static/views/components/header/index.ejs +40 -0
- package/dist/src/static/views/components/header/index.js +1 -0
- package/dist/src/static/views/features/scheme/dark.css +12 -0
- package/dist/src/static/views/features/scheme/index.ejs +3 -0
- package/dist/src/static/views/features/scheme/index.js +31 -0
- package/dist/src/static/views/features/scheme/light.css +12 -0
- package/dist/src/static/views/features/tab/index.css +30 -0
- package/dist/src/static/views/features/tab/index.ejs +2 -0
- package/dist/src/static/views/features/tab/index.js +12 -0
- package/dist/src/static/views/pages/404/index.css +10 -0
- package/dist/src/static/views/pages/404/index.ejs +85 -0
- package/dist/src/utils/helpers/interceptors/callRequestInterceptor/callRequestInterceptor.d.ts +8 -0
- package/dist/src/utils/helpers/interceptors/callRequestInterceptor/callRequestInterceptor.js +19 -0
- package/dist/src/utils/helpers/interceptors/callResponseInterceptors/callResponseInterceptors.d.ts +6 -5
- package/dist/src/utils/helpers/interceptors/callResponseInterceptors/callResponseInterceptors.js +20 -23
- package/dist/src/utils/helpers/interceptors/helpers/setDelay.d.ts +1 -0
- package/dist/src/utils/helpers/interceptors/helpers/setDelay.js +8 -0
- package/dist/src/utils/helpers/interceptors/index.d.ts +1 -1
- package/dist/src/utils/helpers/interceptors/index.js +1 -1
- package/dist/src/utils/helpers/sleep.d.ts +1 -1
- package/dist/src/utils/helpers/sleep.js +2 -2
- package/dist/src/utils/types/graphql.d.ts +1 -1
- package/dist/src/utils/types/interceptors.d.ts +15 -6
- package/dist/src/utils/types/rest.d.ts +9 -8
- package/dist/src/utils/types/server.d.ts +19 -9
- package/dist/src/utils/types/values.d.ts +1 -0
- package/package.json +9 -2
- package/dist/bin/start.d.ts +0 -3
- package/dist/bin/start.js +0 -73
- package/dist/src/static/views/notFound.ejs +0 -42
- package/dist/src/utils/helpers/interceptors/callRequestInterceptors/callRequestInterceptors.d.ts +0 -12
- package/dist/src/utils/helpers/interceptors/callRequestInterceptors/callRequestInterceptors.js +0 -13
- /package/dist/bin/{resolveExportsFromSourceCode → helpers}/resolveExportsFromSourceCode.d.ts +0 -0
- /package/dist/bin/{resolveExportsFromSourceCode → helpers}/resolveExportsFromSourceCode.js +0 -0
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<body class="container">
|
|
4
|
-
<h1>404</h1>
|
|
5
|
-
<div>
|
|
6
|
-
Seems to be your config does not have data for <%= requestMethod %>
|
|
7
|
-
<%= decodeURIComponent(url) %> request, or you have typo in it.
|
|
8
|
-
</div>
|
|
9
|
-
|
|
10
|
-
<% if (restUrlSuggestions.length || graphqlUrlSuggestions.length) { %>
|
|
11
|
-
<h2>
|
|
12
|
-
Maybe you are looking for one of these paths?
|
|
13
|
-
</h2>
|
|
14
|
-
<% } %>
|
|
15
|
-
|
|
16
|
-
<% if (restUrlSuggestions.length) { %>
|
|
17
|
-
<div>
|
|
18
|
-
<h3>REST</h3>
|
|
19
|
-
<ul>
|
|
20
|
-
<% restUrlSuggestions.forEach((restUrlSuggestion) => { %>
|
|
21
|
-
<li>
|
|
22
|
-
<a href=<%= restUrlSuggestion %>><%= decodeURIComponent(restUrlSuggestion) %></a>
|
|
23
|
-
</li>
|
|
24
|
-
<% }) %>
|
|
25
|
-
</ul>
|
|
26
|
-
</div>
|
|
27
|
-
<% } %>
|
|
28
|
-
|
|
29
|
-
<% if (graphqlUrlSuggestions.length) { %>
|
|
30
|
-
<div>
|
|
31
|
-
<h3>GraphQL</h3>
|
|
32
|
-
<ul>
|
|
33
|
-
<% graphqlUrlSuggestions.forEach((graphqlUrlSuggestion) => { %>
|
|
34
|
-
<li>
|
|
35
|
-
<%= decodeURIComponent(graphqlUrlSuggestion) %>
|
|
36
|
-
</li>
|
|
37
|
-
<% }) %>
|
|
38
|
-
</ul>
|
|
39
|
-
</div>
|
|
40
|
-
<% } %>
|
|
41
|
-
</body>
|
|
42
|
-
</html>
|
package/dist/src/utils/helpers/interceptors/callRequestInterceptors/callRequestInterceptors.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Request } from 'express';
|
|
2
|
-
import type { InterceptorRequest } from '../../../types';
|
|
3
|
-
interface CallRequestInterceptorsParams {
|
|
4
|
-
request: Request;
|
|
5
|
-
interceptors?: {
|
|
6
|
-
routeInterceptor?: InterceptorRequest | undefined;
|
|
7
|
-
requestInterceptor?: InterceptorRequest | undefined;
|
|
8
|
-
serverInterceptor?: InterceptorRequest | undefined;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export declare const callRequestInterceptors: (params: CallRequestInterceptorsParams) => void;
|
|
12
|
-
export {};
|
package/dist/src/utils/helpers/interceptors/callRequestInterceptors/callRequestInterceptors.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.callRequestInterceptors = void 0;
|
|
4
|
-
const callRequestInterceptors = (params) => {
|
|
5
|
-
const { request, interceptors } = params;
|
|
6
|
-
if (interceptors?.routeInterceptor)
|
|
7
|
-
interceptors.routeInterceptor({ request });
|
|
8
|
-
if (interceptors?.requestInterceptor)
|
|
9
|
-
interceptors.requestInterceptor({ request });
|
|
10
|
-
if (interceptors?.serverInterceptor)
|
|
11
|
-
interceptors.serverInterceptor({ request });
|
|
12
|
-
};
|
|
13
|
-
exports.callRequestInterceptors = callRequestInterceptors;
|
/package/dist/bin/{resolveExportsFromSourceCode → helpers}/resolveExportsFromSourceCode.d.ts
RENAMED
|
File without changes
|
|
File without changes
|